google_cloud_vmwareengine_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Request message for
42/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
43///
44/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
45#[derive(Clone, Default, PartialEq)]
46#[non_exhaustive]
47pub struct ListPrivateCloudsRequest {
48 /// Required. The resource name of the private cloud to be queried for
49 /// clusters. Resource names are schemeless URIs that follow the conventions in
50 /// <https://cloud.google.com/apis/design/resource_names>.
51 /// For example:
52 /// `projects/my-project/locations/us-central1-a`
53 pub parent: std::string::String,
54
55 /// The maximum number of private clouds to return in one page.
56 /// The service may return fewer than this value.
57 /// The maximum value is coerced to 1000.
58 /// The default value of this field is 500.
59 pub page_size: i32,
60
61 /// A page token, received from a previous `ListPrivateClouds` call.
62 /// Provide this to retrieve the subsequent page.
63 ///
64 /// When paginating, all other parameters provided to `ListPrivateClouds` must
65 /// match the call that provided the page token.
66 pub page_token: std::string::String,
67
68 /// A filter expression that matches resources returned in the response.
69 /// The expression must specify the field name, a comparison operator, and the
70 /// value that you want to use for filtering. The value must be a string, a
71 /// number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
72 /// `<`.
73 ///
74 /// For example, if you are filtering a list of private clouds, you can exclude
75 /// the ones named `example-pc` by specifying `name != "example-pc"`.
76 ///
77 /// You can also filter nested fields. For example, you could specify
78 /// `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
79 /// only if they have a matching address in their network configuration.
80 ///
81 /// To filter on multiple expressions, provide each separate expression within
82 /// parentheses. For example:
83 ///
84 /// ```norust
85 /// (name = "example-pc")
86 /// (createTime > "2021-04-12T08:15:10.40Z")
87 /// ```
88 ///
89 /// By default, each expression is an `AND` expression. However, you can
90 /// include `AND` and `OR` expressions explicitly. For example:
91 ///
92 /// ```norust
93 /// (name = "private-cloud-1") AND
94 /// (createTime > "2021-04-12T08:15:10.40Z") OR
95 /// (name = "private-cloud-2")
96 /// ```
97 pub filter: std::string::String,
98
99 /// Sorts list results by a certain order. By default, returned results are
100 /// ordered by `name` in ascending order. You can also sort results in
101 /// descending order based on the `name` value using `orderBy="name desc"`.
102 /// Currently, only ordering by `name` is supported.
103 pub order_by: std::string::String,
104
105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
106}
107
108impl ListPrivateCloudsRequest {
109 pub fn new() -> Self {
110 std::default::Default::default()
111 }
112
113 /// Sets the value of [parent][crate::model::ListPrivateCloudsRequest::parent].
114 ///
115 /// # Example
116 /// ```ignore,no_run
117 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
118 /// let x = ListPrivateCloudsRequest::new().set_parent("example");
119 /// ```
120 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121 self.parent = v.into();
122 self
123 }
124
125 /// Sets the value of [page_size][crate::model::ListPrivateCloudsRequest::page_size].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
130 /// let x = ListPrivateCloudsRequest::new().set_page_size(42);
131 /// ```
132 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
133 self.page_size = v.into();
134 self
135 }
136
137 /// Sets the value of [page_token][crate::model::ListPrivateCloudsRequest::page_token].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
142 /// let x = ListPrivateCloudsRequest::new().set_page_token("example");
143 /// ```
144 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145 self.page_token = v.into();
146 self
147 }
148
149 /// Sets the value of [filter][crate::model::ListPrivateCloudsRequest::filter].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
154 /// let x = ListPrivateCloudsRequest::new().set_filter("example");
155 /// ```
156 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157 self.filter = v.into();
158 self
159 }
160
161 /// Sets the value of [order_by][crate::model::ListPrivateCloudsRequest::order_by].
162 ///
163 /// # Example
164 /// ```ignore,no_run
165 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
166 /// let x = ListPrivateCloudsRequest::new().set_order_by("example");
167 /// ```
168 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169 self.order_by = v.into();
170 self
171 }
172}
173
174impl wkt::message::Message for ListPrivateCloudsRequest {
175 fn typename() -> &'static str {
176 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"
177 }
178}
179
180/// Response message for
181/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
182///
183/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
184#[derive(Clone, Default, PartialEq)]
185#[non_exhaustive]
186pub struct ListPrivateCloudsResponse {
187 /// A list of private clouds.
188 pub private_clouds: std::vec::Vec<crate::model::PrivateCloud>,
189
190 /// A token, which can be sent as `page_token` to retrieve the next page.
191 /// If this field is omitted, there are no subsequent pages.
192 pub next_page_token: std::string::String,
193
194 /// Locations that could not be reached when making an aggregated query using
195 /// wildcards.
196 pub unreachable: std::vec::Vec<std::string::String>,
197
198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
199}
200
201impl ListPrivateCloudsResponse {
202 pub fn new() -> Self {
203 std::default::Default::default()
204 }
205
206 /// Sets the value of [private_clouds][crate::model::ListPrivateCloudsResponse::private_clouds].
207 ///
208 /// # Example
209 /// ```ignore,no_run
210 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
211 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
212 /// let x = ListPrivateCloudsResponse::new()
213 /// .set_private_clouds([
214 /// PrivateCloud::default()/* use setters */,
215 /// PrivateCloud::default()/* use (different) setters */,
216 /// ]);
217 /// ```
218 pub fn set_private_clouds<T, V>(mut self, v: T) -> Self
219 where
220 T: std::iter::IntoIterator<Item = V>,
221 V: std::convert::Into<crate::model::PrivateCloud>,
222 {
223 use std::iter::Iterator;
224 self.private_clouds = v.into_iter().map(|i| i.into()).collect();
225 self
226 }
227
228 /// Sets the value of [next_page_token][crate::model::ListPrivateCloudsResponse::next_page_token].
229 ///
230 /// # Example
231 /// ```ignore,no_run
232 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
233 /// let x = ListPrivateCloudsResponse::new().set_next_page_token("example");
234 /// ```
235 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
236 self.next_page_token = v.into();
237 self
238 }
239
240 /// Sets the value of [unreachable][crate::model::ListPrivateCloudsResponse::unreachable].
241 ///
242 /// # Example
243 /// ```ignore,no_run
244 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
245 /// let x = ListPrivateCloudsResponse::new().set_unreachable(["a", "b", "c"]);
246 /// ```
247 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
248 where
249 T: std::iter::IntoIterator<Item = V>,
250 V: std::convert::Into<std::string::String>,
251 {
252 use std::iter::Iterator;
253 self.unreachable = v.into_iter().map(|i| i.into()).collect();
254 self
255 }
256}
257
258impl wkt::message::Message for ListPrivateCloudsResponse {
259 fn typename() -> &'static str {
260 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"
261 }
262}
263
264#[doc(hidden)]
265impl gax::paginator::internal::PageableResponse for ListPrivateCloudsResponse {
266 type PageItem = crate::model::PrivateCloud;
267
268 fn items(self) -> std::vec::Vec<Self::PageItem> {
269 self.private_clouds
270 }
271
272 fn next_page_token(&self) -> std::string::String {
273 use std::clone::Clone;
274 self.next_page_token.clone()
275 }
276}
277
278/// Request message for
279/// [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]
280///
281/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]: crate::client::VmwareEngine::get_private_cloud
282#[derive(Clone, Default, PartialEq)]
283#[non_exhaustive]
284pub struct GetPrivateCloudRequest {
285 /// Required. The resource name of the private cloud to retrieve.
286 /// Resource names are schemeless URIs that follow the conventions in
287 /// <https://cloud.google.com/apis/design/resource_names>.
288 /// For example:
289 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
290 pub name: std::string::String,
291
292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
293}
294
295impl GetPrivateCloudRequest {
296 pub fn new() -> Self {
297 std::default::Default::default()
298 }
299
300 /// Sets the value of [name][crate::model::GetPrivateCloudRequest::name].
301 ///
302 /// # Example
303 /// ```ignore,no_run
304 /// # use google_cloud_vmwareengine_v1::model::GetPrivateCloudRequest;
305 /// let x = GetPrivateCloudRequest::new().set_name("example");
306 /// ```
307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
308 self.name = v.into();
309 self
310 }
311}
312
313impl wkt::message::Message for GetPrivateCloudRequest {
314 fn typename() -> &'static str {
315 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"
316 }
317}
318
319/// Request message for
320/// [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]
321///
322/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]: crate::client::VmwareEngine::create_private_cloud
323#[derive(Clone, Default, PartialEq)]
324#[non_exhaustive]
325pub struct CreatePrivateCloudRequest {
326 /// Required. The resource name of the location to create the new
327 /// private cloud in. Resource names are schemeless URIs that follow the
328 /// conventions in <https://cloud.google.com/apis/design/resource_names>.
329 /// For example:
330 /// `projects/my-project/locations/us-central1-a`
331 pub parent: std::string::String,
332
333 /// Required. The user-provided identifier of the private cloud to be created.
334 /// This identifier must be unique among each `PrivateCloud` within the parent
335 /// and becomes the final token in the name URI.
336 /// The identifier must meet the following requirements:
337 ///
338 /// * Only contains 1-63 alphanumeric characters and hyphens
339 /// * Begins with an alphabetical character
340 /// * Ends with a non-hyphen character
341 /// * Not formatted as a UUID
342 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
343 /// (section 3.5)
344 pub private_cloud_id: std::string::String,
345
346 /// Required. The initial description of the new private cloud.
347 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
348
349 /// Optional. The request ID must be a valid UUID with the exception that zero
350 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
351 pub request_id: std::string::String,
352
353 /// Optional. True if you want the request to be validated and not executed;
354 /// false otherwise.
355 pub validate_only: bool,
356
357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
358}
359
360impl CreatePrivateCloudRequest {
361 pub fn new() -> Self {
362 std::default::Default::default()
363 }
364
365 /// Sets the value of [parent][crate::model::CreatePrivateCloudRequest::parent].
366 ///
367 /// # Example
368 /// ```ignore,no_run
369 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
370 /// let x = CreatePrivateCloudRequest::new().set_parent("example");
371 /// ```
372 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373 self.parent = v.into();
374 self
375 }
376
377 /// Sets the value of [private_cloud_id][crate::model::CreatePrivateCloudRequest::private_cloud_id].
378 ///
379 /// # Example
380 /// ```ignore,no_run
381 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
382 /// let x = CreatePrivateCloudRequest::new().set_private_cloud_id("example");
383 /// ```
384 pub fn set_private_cloud_id<T: std::convert::Into<std::string::String>>(
385 mut self,
386 v: T,
387 ) -> Self {
388 self.private_cloud_id = v.into();
389 self
390 }
391
392 /// Sets the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
393 ///
394 /// # Example
395 /// ```ignore,no_run
396 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
397 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
398 /// let x = CreatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
399 /// ```
400 pub fn set_private_cloud<T>(mut self, v: T) -> Self
401 where
402 T: std::convert::Into<crate::model::PrivateCloud>,
403 {
404 self.private_cloud = std::option::Option::Some(v.into());
405 self
406 }
407
408 /// Sets or clears the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
413 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
414 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
415 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
416 /// ```
417 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
418 where
419 T: std::convert::Into<crate::model::PrivateCloud>,
420 {
421 self.private_cloud = v.map(|x| x.into());
422 self
423 }
424
425 /// Sets the value of [request_id][crate::model::CreatePrivateCloudRequest::request_id].
426 ///
427 /// # Example
428 /// ```ignore,no_run
429 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
430 /// let x = CreatePrivateCloudRequest::new().set_request_id("example");
431 /// ```
432 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.request_id = v.into();
434 self
435 }
436
437 /// Sets the value of [validate_only][crate::model::CreatePrivateCloudRequest::validate_only].
438 ///
439 /// # Example
440 /// ```ignore,no_run
441 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
442 /// let x = CreatePrivateCloudRequest::new().set_validate_only(true);
443 /// ```
444 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
445 self.validate_only = v.into();
446 self
447 }
448}
449
450impl wkt::message::Message for CreatePrivateCloudRequest {
451 fn typename() -> &'static str {
452 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"
453 }
454}
455
456/// Request message for
457/// [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]
458///
459/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]: crate::client::VmwareEngine::update_private_cloud
460#[derive(Clone, Default, PartialEq)]
461#[non_exhaustive]
462pub struct UpdatePrivateCloudRequest {
463 /// Required. Private cloud description.
464 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
465
466 /// Required. Field mask is used to specify the fields to be overwritten in the
467 /// `PrivateCloud` resource by the update. The fields specified in `updateMask`
468 /// are relative to the resource, not the full request. A field will be
469 /// overwritten if it is in the mask. If the user does not provide a mask then
470 /// all fields will be overwritten.
471 pub update_mask: std::option::Option<wkt::FieldMask>,
472
473 /// Optional. The request ID must be a valid UUID with the exception that zero
474 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
475 pub request_id: std::string::String,
476
477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
478}
479
480impl UpdatePrivateCloudRequest {
481 pub fn new() -> Self {
482 std::default::Default::default()
483 }
484
485 /// Sets the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
486 ///
487 /// # Example
488 /// ```ignore,no_run
489 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
490 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
491 /// let x = UpdatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
492 /// ```
493 pub fn set_private_cloud<T>(mut self, v: T) -> Self
494 where
495 T: std::convert::Into<crate::model::PrivateCloud>,
496 {
497 self.private_cloud = std::option::Option::Some(v.into());
498 self
499 }
500
501 /// Sets or clears the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
502 ///
503 /// # Example
504 /// ```ignore,no_run
505 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
506 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
507 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
508 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
509 /// ```
510 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
511 where
512 T: std::convert::Into<crate::model::PrivateCloud>,
513 {
514 self.private_cloud = v.map(|x| x.into());
515 self
516 }
517
518 /// Sets the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
519 ///
520 /// # Example
521 /// ```ignore,no_run
522 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
523 /// use wkt::FieldMask;
524 /// let x = UpdatePrivateCloudRequest::new().set_update_mask(FieldMask::default()/* use setters */);
525 /// ```
526 pub fn set_update_mask<T>(mut self, v: T) -> Self
527 where
528 T: std::convert::Into<wkt::FieldMask>,
529 {
530 self.update_mask = std::option::Option::Some(v.into());
531 self
532 }
533
534 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
535 ///
536 /// # Example
537 /// ```ignore,no_run
538 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
539 /// use wkt::FieldMask;
540 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
541 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(None::<FieldMask>);
542 /// ```
543 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
544 where
545 T: std::convert::Into<wkt::FieldMask>,
546 {
547 self.update_mask = v.map(|x| x.into());
548 self
549 }
550
551 /// Sets the value of [request_id][crate::model::UpdatePrivateCloudRequest::request_id].
552 ///
553 /// # Example
554 /// ```ignore,no_run
555 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
556 /// let x = UpdatePrivateCloudRequest::new().set_request_id("example");
557 /// ```
558 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
559 self.request_id = v.into();
560 self
561 }
562}
563
564impl wkt::message::Message for UpdatePrivateCloudRequest {
565 fn typename() -> &'static str {
566 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"
567 }
568}
569
570/// Request message for
571/// [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]
572///
573/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]: crate::client::VmwareEngine::delete_private_cloud
574#[derive(Clone, Default, PartialEq)]
575#[non_exhaustive]
576pub struct DeletePrivateCloudRequest {
577 /// Required. The resource name of the private cloud to delete.
578 /// Resource names are schemeless URIs that follow the conventions in
579 /// <https://cloud.google.com/apis/design/resource_names>.
580 /// For example:
581 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
582 pub name: std::string::String,
583
584 /// Optional. The request ID must be a valid UUID with the exception that zero
585 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
586 pub request_id: std::string::String,
587
588 /// Optional. If set to true, cascade delete is enabled and all children of
589 /// this private cloud resource are also deleted. When this flag is set to
590 /// false, the private cloud will not be deleted if there are any children
591 /// other than the management cluster. The management cluster is always
592 /// deleted.
593 pub force: bool,
594
595 /// Optional. Time delay of the deletion specified in hours. The default value
596 /// is `3`. Specifying a non-zero value for this field changes the value of
597 /// `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
598 /// deletion time. Deletion can be cancelled before `expire_time` elapses using
599 /// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud].
600 /// Specifying a value of `0` for this field instead begins the deletion
601 /// process and ceases billing immediately. During the final deletion process,
602 /// the value of `PrivateCloud.state` becomes `PURGING`.
603 ///
604 /// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
605 pub delay_hours: std::option::Option<i32>,
606
607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
608}
609
610impl DeletePrivateCloudRequest {
611 pub fn new() -> Self {
612 std::default::Default::default()
613 }
614
615 /// Sets the value of [name][crate::model::DeletePrivateCloudRequest::name].
616 ///
617 /// # Example
618 /// ```ignore,no_run
619 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
620 /// let x = DeletePrivateCloudRequest::new().set_name("example");
621 /// ```
622 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
623 self.name = v.into();
624 self
625 }
626
627 /// Sets the value of [request_id][crate::model::DeletePrivateCloudRequest::request_id].
628 ///
629 /// # Example
630 /// ```ignore,no_run
631 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
632 /// let x = DeletePrivateCloudRequest::new().set_request_id("example");
633 /// ```
634 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
635 self.request_id = v.into();
636 self
637 }
638
639 /// Sets the value of [force][crate::model::DeletePrivateCloudRequest::force].
640 ///
641 /// # Example
642 /// ```ignore,no_run
643 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
644 /// let x = DeletePrivateCloudRequest::new().set_force(true);
645 /// ```
646 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
647 self.force = v.into();
648 self
649 }
650
651 /// Sets the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
652 ///
653 /// # Example
654 /// ```ignore,no_run
655 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
656 /// let x = DeletePrivateCloudRequest::new().set_delay_hours(42);
657 /// ```
658 pub fn set_delay_hours<T>(mut self, v: T) -> Self
659 where
660 T: std::convert::Into<i32>,
661 {
662 self.delay_hours = std::option::Option::Some(v.into());
663 self
664 }
665
666 /// Sets or clears the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
667 ///
668 /// # Example
669 /// ```ignore,no_run
670 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
671 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(Some(42));
672 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(None::<i32>);
673 /// ```
674 pub fn set_or_clear_delay_hours<T>(mut self, v: std::option::Option<T>) -> Self
675 where
676 T: std::convert::Into<i32>,
677 {
678 self.delay_hours = v.map(|x| x.into());
679 self
680 }
681}
682
683impl wkt::message::Message for DeletePrivateCloudRequest {
684 fn typename() -> &'static str {
685 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"
686 }
687}
688
689/// Request message for
690/// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]
691///
692/// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
693#[derive(Clone, Default, PartialEq)]
694#[non_exhaustive]
695pub struct UndeletePrivateCloudRequest {
696 /// Required. The resource name of the private cloud scheduled for deletion.
697 /// Resource names are schemeless URIs that follow the conventions in
698 /// <https://cloud.google.com/apis/design/resource_names>.
699 /// For example:
700 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
701 pub name: std::string::String,
702
703 /// Optional. The request ID must be a valid UUID with the exception that zero
704 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
705 pub request_id: std::string::String,
706
707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
708}
709
710impl UndeletePrivateCloudRequest {
711 pub fn new() -> Self {
712 std::default::Default::default()
713 }
714
715 /// Sets the value of [name][crate::model::UndeletePrivateCloudRequest::name].
716 ///
717 /// # Example
718 /// ```ignore,no_run
719 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
720 /// let x = UndeletePrivateCloudRequest::new().set_name("example");
721 /// ```
722 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
723 self.name = v.into();
724 self
725 }
726
727 /// Sets the value of [request_id][crate::model::UndeletePrivateCloudRequest::request_id].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
732 /// let x = UndeletePrivateCloudRequest::new().set_request_id("example");
733 /// ```
734 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735 self.request_id = v.into();
736 self
737 }
738}
739
740impl wkt::message::Message for UndeletePrivateCloudRequest {
741 fn typename() -> &'static str {
742 "type.googleapis.com/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"
743 }
744}
745
746/// Request message for
747/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
748///
749/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
750#[derive(Clone, Default, PartialEq)]
751#[non_exhaustive]
752pub struct ListClustersRequest {
753 /// Required. The resource name of the private cloud to query for clusters.
754 /// Resource names are schemeless URIs that follow the conventions in
755 /// <https://cloud.google.com/apis/design/resource_names>.
756 /// For example:
757 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
758 pub parent: std::string::String,
759
760 /// The maximum number of clusters to return in one page.
761 /// The service may return fewer than this value.
762 /// The maximum value is coerced to 1000.
763 /// The default value of this field is 500.
764 pub page_size: i32,
765
766 /// A page token, received from a previous `ListClusters` call.
767 /// Provide this to retrieve the subsequent page.
768 ///
769 /// When paginating, all other parameters provided to `ListClusters`
770 /// must match the call that provided the page token.
771 pub page_token: std::string::String,
772
773 /// To filter on multiple expressions, provide each separate expression within
774 /// parentheses. For example:
775 ///
776 /// ```norust
777 /// (name = "example-cluster")
778 /// (nodeCount = "3")
779 /// ```
780 ///
781 /// By default, each expression is an `AND` expression. However, you can
782 /// include `AND` and `OR` expressions explicitly. For example:
783 ///
784 /// ```norust
785 /// (name = "example-cluster-1") AND
786 /// (createTime > "2021-04-12T08:15:10.40Z") OR
787 /// (name = "example-cluster-2")
788 /// ```
789 pub filter: std::string::String,
790
791 /// Sorts list results by a certain order. By default, returned results are
792 /// ordered by `name` in ascending order. You can also sort results in
793 /// descending order based on the `name` value using `orderBy="name desc"`.
794 /// Currently, only ordering by `name` is supported.
795 pub order_by: std::string::String,
796
797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
798}
799
800impl ListClustersRequest {
801 pub fn new() -> Self {
802 std::default::Default::default()
803 }
804
805 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
806 ///
807 /// # Example
808 /// ```ignore,no_run
809 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
810 /// let x = ListClustersRequest::new().set_parent("example");
811 /// ```
812 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
813 self.parent = v.into();
814 self
815 }
816
817 /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
818 ///
819 /// # Example
820 /// ```ignore,no_run
821 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
822 /// let x = ListClustersRequest::new().set_page_size(42);
823 /// ```
824 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
825 self.page_size = v.into();
826 self
827 }
828
829 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
830 ///
831 /// # Example
832 /// ```ignore,no_run
833 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
834 /// let x = ListClustersRequest::new().set_page_token("example");
835 /// ```
836 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
837 self.page_token = v.into();
838 self
839 }
840
841 /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
842 ///
843 /// # Example
844 /// ```ignore,no_run
845 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
846 /// let x = ListClustersRequest::new().set_filter("example");
847 /// ```
848 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
849 self.filter = v.into();
850 self
851 }
852
853 /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
854 ///
855 /// # Example
856 /// ```ignore,no_run
857 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
858 /// let x = ListClustersRequest::new().set_order_by("example");
859 /// ```
860 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
861 self.order_by = v.into();
862 self
863 }
864}
865
866impl wkt::message::Message for ListClustersRequest {
867 fn typename() -> &'static str {
868 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersRequest"
869 }
870}
871
872/// Response message for
873/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
874///
875/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
876#[derive(Clone, Default, PartialEq)]
877#[non_exhaustive]
878pub struct ListClustersResponse {
879 /// A list of private cloud clusters.
880 pub clusters: std::vec::Vec<crate::model::Cluster>,
881
882 /// A token, which can be sent as `page_token` to retrieve the next page.
883 /// If this field is omitted, there are no subsequent pages.
884 pub next_page_token: std::string::String,
885
886 /// Locations that could not be reached when making an aggregated query using
887 /// wildcards.
888 pub unreachable: std::vec::Vec<std::string::String>,
889
890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
891}
892
893impl ListClustersResponse {
894 pub fn new() -> Self {
895 std::default::Default::default()
896 }
897
898 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
899 ///
900 /// # Example
901 /// ```ignore,no_run
902 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
903 /// use google_cloud_vmwareengine_v1::model::Cluster;
904 /// let x = ListClustersResponse::new()
905 /// .set_clusters([
906 /// Cluster::default()/* use setters */,
907 /// Cluster::default()/* use (different) setters */,
908 /// ]);
909 /// ```
910 pub fn set_clusters<T, V>(mut self, v: T) -> Self
911 where
912 T: std::iter::IntoIterator<Item = V>,
913 V: std::convert::Into<crate::model::Cluster>,
914 {
915 use std::iter::Iterator;
916 self.clusters = v.into_iter().map(|i| i.into()).collect();
917 self
918 }
919
920 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
921 ///
922 /// # Example
923 /// ```ignore,no_run
924 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
925 /// let x = ListClustersResponse::new().set_next_page_token("example");
926 /// ```
927 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
928 self.next_page_token = v.into();
929 self
930 }
931
932 /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
933 ///
934 /// # Example
935 /// ```ignore,no_run
936 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
937 /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
938 /// ```
939 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
940 where
941 T: std::iter::IntoIterator<Item = V>,
942 V: std::convert::Into<std::string::String>,
943 {
944 use std::iter::Iterator;
945 self.unreachable = v.into_iter().map(|i| i.into()).collect();
946 self
947 }
948}
949
950impl wkt::message::Message for ListClustersResponse {
951 fn typename() -> &'static str {
952 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersResponse"
953 }
954}
955
956#[doc(hidden)]
957impl gax::paginator::internal::PageableResponse for ListClustersResponse {
958 type PageItem = crate::model::Cluster;
959
960 fn items(self) -> std::vec::Vec<Self::PageItem> {
961 self.clusters
962 }
963
964 fn next_page_token(&self) -> std::string::String {
965 use std::clone::Clone;
966 self.next_page_token.clone()
967 }
968}
969
970/// Request message for
971/// [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]
972///
973/// [google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]: crate::client::VmwareEngine::get_cluster
974#[derive(Clone, Default, PartialEq)]
975#[non_exhaustive]
976pub struct GetClusterRequest {
977 /// Required. The cluster resource name to retrieve.
978 /// Resource names are schemeless URIs that follow the conventions in
979 /// <https://cloud.google.com/apis/design/resource_names>.
980 /// For example:
981 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
982 pub name: std::string::String,
983
984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
985}
986
987impl GetClusterRequest {
988 pub fn new() -> Self {
989 std::default::Default::default()
990 }
991
992 /// Sets the value of [name][crate::model::GetClusterRequest::name].
993 ///
994 /// # Example
995 /// ```ignore,no_run
996 /// # use google_cloud_vmwareengine_v1::model::GetClusterRequest;
997 /// let x = GetClusterRequest::new().set_name("example");
998 /// ```
999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.name = v.into();
1001 self
1002 }
1003}
1004
1005impl wkt::message::Message for GetClusterRequest {
1006 fn typename() -> &'static str {
1007 "type.googleapis.com/google.cloud.vmwareengine.v1.GetClusterRequest"
1008 }
1009}
1010
1011/// Request message for
1012/// [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]
1013///
1014/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]: crate::client::VmwareEngine::create_cluster
1015#[derive(Clone, Default, PartialEq)]
1016#[non_exhaustive]
1017pub struct CreateClusterRequest {
1018 /// Required. The resource name of the private cloud to create a new cluster
1019 /// in. Resource names are schemeless URIs that follow the conventions in
1020 /// <https://cloud.google.com/apis/design/resource_names>.
1021 /// For example:
1022 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1023 pub parent: std::string::String,
1024
1025 /// Required. The user-provided identifier of the new `Cluster`.
1026 /// This identifier must be unique among clusters within the parent and becomes
1027 /// the final token in the name URI.
1028 /// The identifier must meet the following requirements:
1029 ///
1030 /// * Only contains 1-63 alphanumeric characters and hyphens
1031 /// * Begins with an alphabetical character
1032 /// * Ends with a non-hyphen character
1033 /// * Not formatted as a UUID
1034 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1035 /// (section 3.5)
1036 pub cluster_id: std::string::String,
1037
1038 /// Required. The initial description of the new cluster.
1039 pub cluster: std::option::Option<crate::model::Cluster>,
1040
1041 /// Optional. The request ID must be a valid UUID with the exception that zero
1042 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1043 pub request_id: std::string::String,
1044
1045 /// Optional. True if you want the request to be validated and not executed;
1046 /// false otherwise.
1047 pub validate_only: bool,
1048
1049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1050}
1051
1052impl CreateClusterRequest {
1053 pub fn new() -> Self {
1054 std::default::Default::default()
1055 }
1056
1057 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
1058 ///
1059 /// # Example
1060 /// ```ignore,no_run
1061 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1062 /// let x = CreateClusterRequest::new().set_parent("example");
1063 /// ```
1064 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1065 self.parent = v.into();
1066 self
1067 }
1068
1069 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1074 /// let x = CreateClusterRequest::new().set_cluster_id("example");
1075 /// ```
1076 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1077 self.cluster_id = v.into();
1078 self
1079 }
1080
1081 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
1082 ///
1083 /// # Example
1084 /// ```ignore,no_run
1085 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1086 /// use google_cloud_vmwareengine_v1::model::Cluster;
1087 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1088 /// ```
1089 pub fn set_cluster<T>(mut self, v: T) -> Self
1090 where
1091 T: std::convert::Into<crate::model::Cluster>,
1092 {
1093 self.cluster = std::option::Option::Some(v.into());
1094 self
1095 }
1096
1097 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
1098 ///
1099 /// # Example
1100 /// ```ignore,no_run
1101 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1102 /// use google_cloud_vmwareengine_v1::model::Cluster;
1103 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1104 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1105 /// ```
1106 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1107 where
1108 T: std::convert::Into<crate::model::Cluster>,
1109 {
1110 self.cluster = v.map(|x| x.into());
1111 self
1112 }
1113
1114 /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
1115 ///
1116 /// # Example
1117 /// ```ignore,no_run
1118 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1119 /// let x = CreateClusterRequest::new().set_request_id("example");
1120 /// ```
1121 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1122 self.request_id = v.into();
1123 self
1124 }
1125
1126 /// Sets the value of [validate_only][crate::model::CreateClusterRequest::validate_only].
1127 ///
1128 /// # Example
1129 /// ```ignore,no_run
1130 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1131 /// let x = CreateClusterRequest::new().set_validate_only(true);
1132 /// ```
1133 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1134 self.validate_only = v.into();
1135 self
1136 }
1137}
1138
1139impl wkt::message::Message for CreateClusterRequest {
1140 fn typename() -> &'static str {
1141 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateClusterRequest"
1142 }
1143}
1144
1145/// Request message for
1146/// [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]
1147///
1148/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]: crate::client::VmwareEngine::update_cluster
1149#[derive(Clone, Default, PartialEq)]
1150#[non_exhaustive]
1151pub struct UpdateClusterRequest {
1152 /// Required. Field mask is used to specify the fields to be overwritten in the
1153 /// `Cluster` resource by the update. The fields specified in the `updateMask`
1154 /// are relative to the resource, not the full request. A field will be
1155 /// overwritten if it is in the mask. If the user does not provide a mask then
1156 /// all fields will be overwritten.
1157 pub update_mask: std::option::Option<wkt::FieldMask>,
1158
1159 /// Required. The description of the cluster.
1160 pub cluster: std::option::Option<crate::model::Cluster>,
1161
1162 /// Optional. The request ID must be a valid UUID with the exception that
1163 /// zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1164 pub request_id: std::string::String,
1165
1166 /// Optional. True if you want the request to be validated and not executed;
1167 /// false otherwise.
1168 pub validate_only: bool,
1169
1170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1171}
1172
1173impl UpdateClusterRequest {
1174 pub fn new() -> Self {
1175 std::default::Default::default()
1176 }
1177
1178 /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1179 ///
1180 /// # Example
1181 /// ```ignore,no_run
1182 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1183 /// use wkt::FieldMask;
1184 /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1185 /// ```
1186 pub fn set_update_mask<T>(mut self, v: T) -> Self
1187 where
1188 T: std::convert::Into<wkt::FieldMask>,
1189 {
1190 self.update_mask = std::option::Option::Some(v.into());
1191 self
1192 }
1193
1194 /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1195 ///
1196 /// # Example
1197 /// ```ignore,no_run
1198 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1199 /// use wkt::FieldMask;
1200 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1201 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1202 /// ```
1203 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1204 where
1205 T: std::convert::Into<wkt::FieldMask>,
1206 {
1207 self.update_mask = v.map(|x| x.into());
1208 self
1209 }
1210
1211 /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1212 ///
1213 /// # Example
1214 /// ```ignore,no_run
1215 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1216 /// use google_cloud_vmwareengine_v1::model::Cluster;
1217 /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1218 /// ```
1219 pub fn set_cluster<T>(mut self, v: T) -> Self
1220 where
1221 T: std::convert::Into<crate::model::Cluster>,
1222 {
1223 self.cluster = std::option::Option::Some(v.into());
1224 self
1225 }
1226
1227 /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1228 ///
1229 /// # Example
1230 /// ```ignore,no_run
1231 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1232 /// use google_cloud_vmwareengine_v1::model::Cluster;
1233 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1234 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1235 /// ```
1236 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1237 where
1238 T: std::convert::Into<crate::model::Cluster>,
1239 {
1240 self.cluster = v.map(|x| x.into());
1241 self
1242 }
1243
1244 /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
1245 ///
1246 /// # Example
1247 /// ```ignore,no_run
1248 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1249 /// let x = UpdateClusterRequest::new().set_request_id("example");
1250 /// ```
1251 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.request_id = v.into();
1253 self
1254 }
1255
1256 /// Sets the value of [validate_only][crate::model::UpdateClusterRequest::validate_only].
1257 ///
1258 /// # Example
1259 /// ```ignore,no_run
1260 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1261 /// let x = UpdateClusterRequest::new().set_validate_only(true);
1262 /// ```
1263 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1264 self.validate_only = v.into();
1265 self
1266 }
1267}
1268
1269impl wkt::message::Message for UpdateClusterRequest {
1270 fn typename() -> &'static str {
1271 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateClusterRequest"
1272 }
1273}
1274
1275/// Request message for
1276/// [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]
1277///
1278/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]: crate::client::VmwareEngine::delete_cluster
1279#[derive(Clone, Default, PartialEq)]
1280#[non_exhaustive]
1281pub struct DeleteClusterRequest {
1282 /// Required. The resource name of the cluster to delete.
1283 /// Resource names are schemeless URIs that follow the conventions in
1284 /// <https://cloud.google.com/apis/design/resource_names>.
1285 /// For example:
1286 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1287 pub name: std::string::String,
1288
1289 /// Optional. The request ID must be a valid UUID with the exception that zero
1290 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1291 pub request_id: std::string::String,
1292
1293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1294}
1295
1296impl DeleteClusterRequest {
1297 pub fn new() -> Self {
1298 std::default::Default::default()
1299 }
1300
1301 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1302 ///
1303 /// # Example
1304 /// ```ignore,no_run
1305 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1306 /// let x = DeleteClusterRequest::new().set_name("example");
1307 /// ```
1308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1309 self.name = v.into();
1310 self
1311 }
1312
1313 /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
1314 ///
1315 /// # Example
1316 /// ```ignore,no_run
1317 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1318 /// let x = DeleteClusterRequest::new().set_request_id("example");
1319 /// ```
1320 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1321 self.request_id = v.into();
1322 self
1323 }
1324}
1325
1326impl wkt::message::Message for DeleteClusterRequest {
1327 fn typename() -> &'static str {
1328 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteClusterRequest"
1329 }
1330}
1331
1332/// Request message for
1333/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1334///
1335/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1336#[derive(Clone, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct ListNodesRequest {
1339 /// Required. The resource name of the cluster to be queried for nodes.
1340 /// Resource names are schemeless URIs that follow the conventions in
1341 /// <https://cloud.google.com/apis/design/resource_names>.
1342 /// For example:
1343 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1344 pub parent: std::string::String,
1345
1346 /// The maximum number of nodes to return in one page.
1347 /// The service may return fewer than this value.
1348 /// The maximum value is coerced to 1000.
1349 /// The default value of this field is 500.
1350 pub page_size: i32,
1351
1352 /// A page token, received from a previous `ListNodes` call.
1353 /// Provide this to retrieve the subsequent page.
1354 ///
1355 /// When paginating, all other parameters provided to
1356 /// `ListNodes` must match the call that provided the page
1357 /// token.
1358 pub page_token: std::string::String,
1359
1360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1361}
1362
1363impl ListNodesRequest {
1364 pub fn new() -> Self {
1365 std::default::Default::default()
1366 }
1367
1368 /// Sets the value of [parent][crate::model::ListNodesRequest::parent].
1369 ///
1370 /// # Example
1371 /// ```ignore,no_run
1372 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1373 /// let x = ListNodesRequest::new().set_parent("example");
1374 /// ```
1375 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1376 self.parent = v.into();
1377 self
1378 }
1379
1380 /// Sets the value of [page_size][crate::model::ListNodesRequest::page_size].
1381 ///
1382 /// # Example
1383 /// ```ignore,no_run
1384 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1385 /// let x = ListNodesRequest::new().set_page_size(42);
1386 /// ```
1387 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1388 self.page_size = v.into();
1389 self
1390 }
1391
1392 /// Sets the value of [page_token][crate::model::ListNodesRequest::page_token].
1393 ///
1394 /// # Example
1395 /// ```ignore,no_run
1396 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1397 /// let x = ListNodesRequest::new().set_page_token("example");
1398 /// ```
1399 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.page_token = v.into();
1401 self
1402 }
1403}
1404
1405impl wkt::message::Message for ListNodesRequest {
1406 fn typename() -> &'static str {
1407 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesRequest"
1408 }
1409}
1410
1411/// Response message for
1412/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1413///
1414/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1415#[derive(Clone, Default, PartialEq)]
1416#[non_exhaustive]
1417pub struct ListNodesResponse {
1418 /// The nodes.
1419 pub nodes: std::vec::Vec<crate::model::Node>,
1420
1421 /// A token, which can be sent as `page_token` to retrieve the next page.
1422 /// If this field is omitted, there are no subsequent pages.
1423 pub next_page_token: std::string::String,
1424
1425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl ListNodesResponse {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 /// Sets the value of [nodes][crate::model::ListNodesResponse::nodes].
1434 ///
1435 /// # Example
1436 /// ```ignore,no_run
1437 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1438 /// use google_cloud_vmwareengine_v1::model::Node;
1439 /// let x = ListNodesResponse::new()
1440 /// .set_nodes([
1441 /// Node::default()/* use setters */,
1442 /// Node::default()/* use (different) setters */,
1443 /// ]);
1444 /// ```
1445 pub fn set_nodes<T, V>(mut self, v: T) -> Self
1446 where
1447 T: std::iter::IntoIterator<Item = V>,
1448 V: std::convert::Into<crate::model::Node>,
1449 {
1450 use std::iter::Iterator;
1451 self.nodes = v.into_iter().map(|i| i.into()).collect();
1452 self
1453 }
1454
1455 /// Sets the value of [next_page_token][crate::model::ListNodesResponse::next_page_token].
1456 ///
1457 /// # Example
1458 /// ```ignore,no_run
1459 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1460 /// let x = ListNodesResponse::new().set_next_page_token("example");
1461 /// ```
1462 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1463 self.next_page_token = v.into();
1464 self
1465 }
1466}
1467
1468impl wkt::message::Message for ListNodesResponse {
1469 fn typename() -> &'static str {
1470 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesResponse"
1471 }
1472}
1473
1474#[doc(hidden)]
1475impl gax::paginator::internal::PageableResponse for ListNodesResponse {
1476 type PageItem = crate::model::Node;
1477
1478 fn items(self) -> std::vec::Vec<Self::PageItem> {
1479 self.nodes
1480 }
1481
1482 fn next_page_token(&self) -> std::string::String {
1483 use std::clone::Clone;
1484 self.next_page_token.clone()
1485 }
1486}
1487
1488/// Request message for
1489/// [VmwareEngine.GetNode][google.cloud.vmwareengine.v1.VmwareEngine.GetNode]
1490///
1491/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNode]: crate::client::VmwareEngine::get_node
1492#[derive(Clone, Default, PartialEq)]
1493#[non_exhaustive]
1494pub struct GetNodeRequest {
1495 /// Required. The resource name of the node to retrieve.
1496 /// For example:
1497 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}`
1498 pub name: std::string::String,
1499
1500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1501}
1502
1503impl GetNodeRequest {
1504 pub fn new() -> Self {
1505 std::default::Default::default()
1506 }
1507
1508 /// Sets the value of [name][crate::model::GetNodeRequest::name].
1509 ///
1510 /// # Example
1511 /// ```ignore,no_run
1512 /// # use google_cloud_vmwareengine_v1::model::GetNodeRequest;
1513 /// let x = GetNodeRequest::new().set_name("example");
1514 /// ```
1515 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1516 self.name = v.into();
1517 self
1518 }
1519}
1520
1521impl wkt::message::Message for GetNodeRequest {
1522 fn typename() -> &'static str {
1523 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeRequest"
1524 }
1525}
1526
1527/// Request message for
1528/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1529///
1530/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1531#[derive(Clone, Default, PartialEq)]
1532#[non_exhaustive]
1533pub struct ListExternalAddressesRequest {
1534 /// Required. The resource name of the private cloud to be queried for
1535 /// external IP addresses.
1536 /// Resource names are schemeless URIs that follow the conventions in
1537 /// <https://cloud.google.com/apis/design/resource_names>.
1538 /// For example:
1539 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1540 pub parent: std::string::String,
1541
1542 /// The maximum number of external IP addresses to return in one page.
1543 /// The service may return fewer than this value.
1544 /// The maximum value is coerced to 1000.
1545 /// The default value of this field is 500.
1546 pub page_size: i32,
1547
1548 /// A page token, received from a previous `ListExternalAddresses` call.
1549 /// Provide this to retrieve the subsequent page.
1550 ///
1551 /// When paginating, all other parameters provided to
1552 /// `ListExternalAddresses` must match the call that provided the page token.
1553 pub page_token: std::string::String,
1554
1555 /// A filter expression that matches resources returned in the response.
1556 /// The expression must specify the field name, a comparison
1557 /// operator, and the value that you want to use for filtering. The value
1558 /// must be a string, a number, or a boolean. The comparison operator
1559 /// must be `=`, `!=`, `>`, or `<`.
1560 ///
1561 /// For example, if you are filtering a list of IP addresses, you can
1562 /// exclude the ones named `example-ip` by specifying
1563 /// `name != "example-ip"`.
1564 ///
1565 /// To filter on multiple expressions, provide each separate expression within
1566 /// parentheses. For example:
1567 ///
1568 /// ```norust
1569 /// (name = "example-ip")
1570 /// (createTime > "2021-04-12T08:15:10.40Z")
1571 /// ```
1572 ///
1573 /// By default, each expression is an `AND` expression. However, you
1574 /// can include `AND` and `OR` expressions explicitly.
1575 /// For example:
1576 ///
1577 /// ```norust
1578 /// (name = "example-ip-1") AND
1579 /// (createTime > "2021-04-12T08:15:10.40Z") OR
1580 /// (name = "example-ip-2")
1581 /// ```
1582 pub filter: std::string::String,
1583
1584 /// Sorts list results by a certain order. By default, returned results
1585 /// are ordered by `name` in ascending order.
1586 /// You can also sort results in descending order based on the `name` value
1587 /// using `orderBy="name desc"`.
1588 /// Currently, only ordering by `name` is supported.
1589 pub order_by: std::string::String,
1590
1591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1592}
1593
1594impl ListExternalAddressesRequest {
1595 pub fn new() -> Self {
1596 std::default::Default::default()
1597 }
1598
1599 /// Sets the value of [parent][crate::model::ListExternalAddressesRequest::parent].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1604 /// let x = ListExternalAddressesRequest::new().set_parent("example");
1605 /// ```
1606 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1607 self.parent = v.into();
1608 self
1609 }
1610
1611 /// Sets the value of [page_size][crate::model::ListExternalAddressesRequest::page_size].
1612 ///
1613 /// # Example
1614 /// ```ignore,no_run
1615 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1616 /// let x = ListExternalAddressesRequest::new().set_page_size(42);
1617 /// ```
1618 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1619 self.page_size = v.into();
1620 self
1621 }
1622
1623 /// Sets the value of [page_token][crate::model::ListExternalAddressesRequest::page_token].
1624 ///
1625 /// # Example
1626 /// ```ignore,no_run
1627 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1628 /// let x = ListExternalAddressesRequest::new().set_page_token("example");
1629 /// ```
1630 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1631 self.page_token = v.into();
1632 self
1633 }
1634
1635 /// Sets the value of [filter][crate::model::ListExternalAddressesRequest::filter].
1636 ///
1637 /// # Example
1638 /// ```ignore,no_run
1639 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1640 /// let x = ListExternalAddressesRequest::new().set_filter("example");
1641 /// ```
1642 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1643 self.filter = v.into();
1644 self
1645 }
1646
1647 /// Sets the value of [order_by][crate::model::ListExternalAddressesRequest::order_by].
1648 ///
1649 /// # Example
1650 /// ```ignore,no_run
1651 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1652 /// let x = ListExternalAddressesRequest::new().set_order_by("example");
1653 /// ```
1654 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1655 self.order_by = v.into();
1656 self
1657 }
1658}
1659
1660impl wkt::message::Message for ListExternalAddressesRequest {
1661 fn typename() -> &'static str {
1662 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesRequest"
1663 }
1664}
1665
1666/// Response message for
1667/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1668///
1669/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1670#[derive(Clone, Default, PartialEq)]
1671#[non_exhaustive]
1672pub struct ListExternalAddressesResponse {
1673 /// A list of external IP addresses.
1674 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1675
1676 /// A token, which can be sent as `page_token` to retrieve the next page.
1677 /// If this field is omitted, there are no subsequent pages.
1678 pub next_page_token: std::string::String,
1679
1680 /// Locations that could not be reached when making an aggregated query using
1681 /// wildcards.
1682 pub unreachable: std::vec::Vec<std::string::String>,
1683
1684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1685}
1686
1687impl ListExternalAddressesResponse {
1688 pub fn new() -> Self {
1689 std::default::Default::default()
1690 }
1691
1692 /// Sets the value of [external_addresses][crate::model::ListExternalAddressesResponse::external_addresses].
1693 ///
1694 /// # Example
1695 /// ```ignore,no_run
1696 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1697 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1698 /// let x = ListExternalAddressesResponse::new()
1699 /// .set_external_addresses([
1700 /// ExternalAddress::default()/* use setters */,
1701 /// ExternalAddress::default()/* use (different) setters */,
1702 /// ]);
1703 /// ```
1704 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1705 where
1706 T: std::iter::IntoIterator<Item = V>,
1707 V: std::convert::Into<crate::model::ExternalAddress>,
1708 {
1709 use std::iter::Iterator;
1710 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1711 self
1712 }
1713
1714 /// Sets the value of [next_page_token][crate::model::ListExternalAddressesResponse::next_page_token].
1715 ///
1716 /// # Example
1717 /// ```ignore,no_run
1718 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1719 /// let x = ListExternalAddressesResponse::new().set_next_page_token("example");
1720 /// ```
1721 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1722 self.next_page_token = v.into();
1723 self
1724 }
1725
1726 /// Sets the value of [unreachable][crate::model::ListExternalAddressesResponse::unreachable].
1727 ///
1728 /// # Example
1729 /// ```ignore,no_run
1730 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1731 /// let x = ListExternalAddressesResponse::new().set_unreachable(["a", "b", "c"]);
1732 /// ```
1733 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1734 where
1735 T: std::iter::IntoIterator<Item = V>,
1736 V: std::convert::Into<std::string::String>,
1737 {
1738 use std::iter::Iterator;
1739 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1740 self
1741 }
1742}
1743
1744impl wkt::message::Message for ListExternalAddressesResponse {
1745 fn typename() -> &'static str {
1746 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesResponse"
1747 }
1748}
1749
1750#[doc(hidden)]
1751impl gax::paginator::internal::PageableResponse for ListExternalAddressesResponse {
1752 type PageItem = crate::model::ExternalAddress;
1753
1754 fn items(self) -> std::vec::Vec<Self::PageItem> {
1755 self.external_addresses
1756 }
1757
1758 fn next_page_token(&self) -> std::string::String {
1759 use std::clone::Clone;
1760 self.next_page_token.clone()
1761 }
1762}
1763
1764/// Request message for
1765/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1766///
1767/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1768#[derive(Clone, Default, PartialEq)]
1769#[non_exhaustive]
1770pub struct FetchNetworkPolicyExternalAddressesRequest {
1771 /// Required. The resource name of the network policy to query for assigned
1772 /// external IP addresses. Resource names are schemeless URIs that follow the
1773 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
1774 /// example:
1775 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
1776 pub network_policy: std::string::String,
1777
1778 /// The maximum number of external IP addresses to return in one page.
1779 /// The service may return fewer than this value.
1780 /// The maximum value is coerced to 1000.
1781 /// The default value of this field is 500.
1782 pub page_size: i32,
1783
1784 /// A page token, received from a previous
1785 /// `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the
1786 /// subsequent page.
1787 ///
1788 /// When paginating, all parameters provided to
1789 /// `FetchNetworkPolicyExternalAddresses`, except for `page_size` and
1790 /// `page_token`, must match the call that provided the page token.
1791 pub page_token: std::string::String,
1792
1793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1794}
1795
1796impl FetchNetworkPolicyExternalAddressesRequest {
1797 pub fn new() -> Self {
1798 std::default::Default::default()
1799 }
1800
1801 /// Sets the value of [network_policy][crate::model::FetchNetworkPolicyExternalAddressesRequest::network_policy].
1802 ///
1803 /// # Example
1804 /// ```ignore,no_run
1805 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1806 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_network_policy("example");
1807 /// ```
1808 pub fn set_network_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.network_policy = v.into();
1810 self
1811 }
1812
1813 /// Sets the value of [page_size][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_size].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1818 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_size(42);
1819 /// ```
1820 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1821 self.page_size = v.into();
1822 self
1823 }
1824
1825 /// Sets the value of [page_token][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_token].
1826 ///
1827 /// # Example
1828 /// ```ignore,no_run
1829 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1830 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_token("example");
1831 /// ```
1832 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.page_token = v.into();
1834 self
1835 }
1836}
1837
1838impl wkt::message::Message for FetchNetworkPolicyExternalAddressesRequest {
1839 fn typename() -> &'static str {
1840 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest"
1841 }
1842}
1843
1844/// Response message for
1845/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1846///
1847/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1848#[derive(Clone, Default, PartialEq)]
1849#[non_exhaustive]
1850pub struct FetchNetworkPolicyExternalAddressesResponse {
1851 /// A list of external IP addresses assigned to VMware workload VMs within the
1852 /// scope of the given network policy.
1853 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1854
1855 /// A token, which can be sent as `page_token` to retrieve the next page.
1856 /// If this field is omitted, there are no subsequent pages.
1857 pub next_page_token: std::string::String,
1858
1859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860}
1861
1862impl FetchNetworkPolicyExternalAddressesResponse {
1863 pub fn new() -> Self {
1864 std::default::Default::default()
1865 }
1866
1867 /// Sets the value of [external_addresses][crate::model::FetchNetworkPolicyExternalAddressesResponse::external_addresses].
1868 ///
1869 /// # Example
1870 /// ```ignore,no_run
1871 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1872 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1873 /// let x = FetchNetworkPolicyExternalAddressesResponse::new()
1874 /// .set_external_addresses([
1875 /// ExternalAddress::default()/* use setters */,
1876 /// ExternalAddress::default()/* use (different) setters */,
1877 /// ]);
1878 /// ```
1879 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1880 where
1881 T: std::iter::IntoIterator<Item = V>,
1882 V: std::convert::Into<crate::model::ExternalAddress>,
1883 {
1884 use std::iter::Iterator;
1885 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1886 self
1887 }
1888
1889 /// Sets the value of [next_page_token][crate::model::FetchNetworkPolicyExternalAddressesResponse::next_page_token].
1890 ///
1891 /// # Example
1892 /// ```ignore,no_run
1893 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1894 /// let x = FetchNetworkPolicyExternalAddressesResponse::new().set_next_page_token("example");
1895 /// ```
1896 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1897 self.next_page_token = v.into();
1898 self
1899 }
1900}
1901
1902impl wkt::message::Message for FetchNetworkPolicyExternalAddressesResponse {
1903 fn typename() -> &'static str {
1904 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse"
1905 }
1906}
1907
1908#[doc(hidden)]
1909impl gax::paginator::internal::PageableResponse for FetchNetworkPolicyExternalAddressesResponse {
1910 type PageItem = crate::model::ExternalAddress;
1911
1912 fn items(self) -> std::vec::Vec<Self::PageItem> {
1913 self.external_addresses
1914 }
1915
1916 fn next_page_token(&self) -> std::string::String {
1917 use std::clone::Clone;
1918 self.next_page_token.clone()
1919 }
1920}
1921
1922/// Request message for
1923/// [VmwareEngine.GetExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]
1924///
1925/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]: crate::client::VmwareEngine::get_external_address
1926#[derive(Clone, Default, PartialEq)]
1927#[non_exhaustive]
1928pub struct GetExternalAddressRequest {
1929 /// Required. The resource name of the external IP address to retrieve.
1930 /// Resource names are schemeless URIs that follow the conventions in
1931 /// <https://cloud.google.com/apis/design/resource_names>.
1932 /// For example:
1933 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
1934 pub name: std::string::String,
1935
1936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1937}
1938
1939impl GetExternalAddressRequest {
1940 pub fn new() -> Self {
1941 std::default::Default::default()
1942 }
1943
1944 /// Sets the value of [name][crate::model::GetExternalAddressRequest::name].
1945 ///
1946 /// # Example
1947 /// ```ignore,no_run
1948 /// # use google_cloud_vmwareengine_v1::model::GetExternalAddressRequest;
1949 /// let x = GetExternalAddressRequest::new().set_name("example");
1950 /// ```
1951 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.name = v.into();
1953 self
1954 }
1955}
1956
1957impl wkt::message::Message for GetExternalAddressRequest {
1958 fn typename() -> &'static str {
1959 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAddressRequest"
1960 }
1961}
1962
1963/// Request message for
1964/// [VmwareEngine.CreateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]
1965///
1966/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]: crate::client::VmwareEngine::create_external_address
1967#[derive(Clone, Default, PartialEq)]
1968#[non_exhaustive]
1969pub struct CreateExternalAddressRequest {
1970 /// Required. The resource name of the private cloud
1971 /// to create a new external IP address in.
1972 /// Resource names are schemeless URIs that follow the conventions in
1973 /// <https://cloud.google.com/apis/design/resource_names>.
1974 /// For example:
1975 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1976 pub parent: std::string::String,
1977
1978 /// Required. The initial description of a new external IP address.
1979 pub external_address: std::option::Option<crate::model::ExternalAddress>,
1980
1981 /// Required. The user-provided identifier of the `ExternalAddress` to be
1982 /// created. This identifier must be unique among `ExternalAddress` resources
1983 /// within the parent and becomes the final token in the name URI. The
1984 /// identifier must meet the following requirements:
1985 ///
1986 /// * Only contains 1-63 alphanumeric characters and hyphens
1987 /// * Begins with an alphabetical character
1988 /// * Ends with a non-hyphen character
1989 /// * Not formatted as a UUID
1990 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1991 /// (section 3.5)
1992 pub external_address_id: std::string::String,
1993
1994 /// Optional. A request ID to identify requests. Specify a unique request ID
1995 /// so that if you must retry your request, the server will know to ignore
1996 /// the request if it has already been completed. The server guarantees that a
1997 /// request doesn't result in creation of duplicate commitments for at least 60
1998 /// minutes.
1999 ///
2000 /// For example, consider a situation where you make an initial request and the
2001 /// request times out. If you make the request again with the same request ID,
2002 /// the server can check if the original operation with the same request ID was
2003 /// received, and if so, will ignore the second request. This prevents clients
2004 /// from accidentally creating duplicate commitments.
2005 ///
2006 /// The request ID must be a valid UUID with the exception that zero UUID is
2007 /// not supported (00000000-0000-0000-0000-000000000000).
2008 pub request_id: std::string::String,
2009
2010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2011}
2012
2013impl CreateExternalAddressRequest {
2014 pub fn new() -> Self {
2015 std::default::Default::default()
2016 }
2017
2018 /// Sets the value of [parent][crate::model::CreateExternalAddressRequest::parent].
2019 ///
2020 /// # Example
2021 /// ```ignore,no_run
2022 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2023 /// let x = CreateExternalAddressRequest::new().set_parent("example");
2024 /// ```
2025 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2026 self.parent = v.into();
2027 self
2028 }
2029
2030 /// Sets the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2031 ///
2032 /// # Example
2033 /// ```ignore,no_run
2034 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2035 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2036 /// let x = CreateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2037 /// ```
2038 pub fn set_external_address<T>(mut self, v: T) -> Self
2039 where
2040 T: std::convert::Into<crate::model::ExternalAddress>,
2041 {
2042 self.external_address = std::option::Option::Some(v.into());
2043 self
2044 }
2045
2046 /// Sets or clears the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2051 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2052 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2053 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2054 /// ```
2055 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2056 where
2057 T: std::convert::Into<crate::model::ExternalAddress>,
2058 {
2059 self.external_address = v.map(|x| x.into());
2060 self
2061 }
2062
2063 /// Sets the value of [external_address_id][crate::model::CreateExternalAddressRequest::external_address_id].
2064 ///
2065 /// # Example
2066 /// ```ignore,no_run
2067 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2068 /// let x = CreateExternalAddressRequest::new().set_external_address_id("example");
2069 /// ```
2070 pub fn set_external_address_id<T: std::convert::Into<std::string::String>>(
2071 mut self,
2072 v: T,
2073 ) -> Self {
2074 self.external_address_id = v.into();
2075 self
2076 }
2077
2078 /// Sets the value of [request_id][crate::model::CreateExternalAddressRequest::request_id].
2079 ///
2080 /// # Example
2081 /// ```ignore,no_run
2082 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2083 /// let x = CreateExternalAddressRequest::new().set_request_id("example");
2084 /// ```
2085 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.request_id = v.into();
2087 self
2088 }
2089}
2090
2091impl wkt::message::Message for CreateExternalAddressRequest {
2092 fn typename() -> &'static str {
2093 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAddressRequest"
2094 }
2095}
2096
2097/// Request message for
2098/// [VmwareEngine.UpdateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]
2099///
2100/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]: crate::client::VmwareEngine::update_external_address
2101#[derive(Clone, Default, PartialEq)]
2102#[non_exhaustive]
2103pub struct UpdateExternalAddressRequest {
2104 /// Required. Field mask is used to specify the fields to be overwritten in the
2105 /// `ExternalAddress` resource by the update.
2106 /// The fields specified in the `update_mask` are relative to the resource, not
2107 /// the full request. A field will be overwritten if it is in the mask. If the
2108 /// user does not provide a mask then all fields will be overwritten.
2109 pub update_mask: std::option::Option<wkt::FieldMask>,
2110
2111 /// Required. External IP address description.
2112 pub external_address: std::option::Option<crate::model::ExternalAddress>,
2113
2114 /// Optional. A request ID to identify requests. Specify a unique request ID
2115 /// so that if you must retry your request, the server will know to ignore
2116 /// the request if it has already been completed. The server guarantees that a
2117 /// request doesn't result in creation of duplicate commitments for at least 60
2118 /// minutes.
2119 ///
2120 /// For example, consider a situation where you make an initial request and the
2121 /// request times out. If you make the request again with the same request ID,
2122 /// the server can check if the original operation with the same request ID was
2123 /// received, and if so, will ignore the second request. This prevents clients
2124 /// from accidentally creating duplicate commitments.
2125 ///
2126 /// The request ID must be a valid UUID with the exception that zero UUID is
2127 /// not supported (00000000-0000-0000-0000-000000000000).
2128 pub request_id: std::string::String,
2129
2130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2131}
2132
2133impl UpdateExternalAddressRequest {
2134 pub fn new() -> Self {
2135 std::default::Default::default()
2136 }
2137
2138 /// Sets the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2143 /// use wkt::FieldMask;
2144 /// let x = UpdateExternalAddressRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2145 /// ```
2146 pub fn set_update_mask<T>(mut self, v: T) -> Self
2147 where
2148 T: std::convert::Into<wkt::FieldMask>,
2149 {
2150 self.update_mask = std::option::Option::Some(v.into());
2151 self
2152 }
2153
2154 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2155 ///
2156 /// # Example
2157 /// ```ignore,no_run
2158 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2159 /// use wkt::FieldMask;
2160 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2161 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2162 /// ```
2163 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2164 where
2165 T: std::convert::Into<wkt::FieldMask>,
2166 {
2167 self.update_mask = v.map(|x| x.into());
2168 self
2169 }
2170
2171 /// Sets the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2172 ///
2173 /// # Example
2174 /// ```ignore,no_run
2175 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2176 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2177 /// let x = UpdateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2178 /// ```
2179 pub fn set_external_address<T>(mut self, v: T) -> Self
2180 where
2181 T: std::convert::Into<crate::model::ExternalAddress>,
2182 {
2183 self.external_address = std::option::Option::Some(v.into());
2184 self
2185 }
2186
2187 /// Sets or clears the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2192 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2193 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2194 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2195 /// ```
2196 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2197 where
2198 T: std::convert::Into<crate::model::ExternalAddress>,
2199 {
2200 self.external_address = v.map(|x| x.into());
2201 self
2202 }
2203
2204 /// Sets the value of [request_id][crate::model::UpdateExternalAddressRequest::request_id].
2205 ///
2206 /// # Example
2207 /// ```ignore,no_run
2208 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2209 /// let x = UpdateExternalAddressRequest::new().set_request_id("example");
2210 /// ```
2211 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.request_id = v.into();
2213 self
2214 }
2215}
2216
2217impl wkt::message::Message for UpdateExternalAddressRequest {
2218 fn typename() -> &'static str {
2219 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAddressRequest"
2220 }
2221}
2222
2223/// Request message for
2224/// [VmwareEngine.DeleteExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]
2225///
2226/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]: crate::client::VmwareEngine::delete_external_address
2227#[derive(Clone, Default, PartialEq)]
2228#[non_exhaustive]
2229pub struct DeleteExternalAddressRequest {
2230 /// Required. The resource name of the external IP address to delete.
2231 /// Resource names are schemeless URIs that follow the conventions in
2232 /// <https://cloud.google.com/apis/design/resource_names>.
2233 /// For example:
2234 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
2235 pub name: std::string::String,
2236
2237 /// Optional. A request ID to identify requests. Specify a unique request ID
2238 /// so that if you must retry your request, the server will know to ignore
2239 /// the request if it has already been completed. The server guarantees that a
2240 /// request doesn't result in creation of duplicate commitments for at least 60
2241 /// minutes.
2242 ///
2243 /// For example, consider a situation where you make an initial request and the
2244 /// request times out. If you make the request again with the same request
2245 /// ID, the server can check if the original operation with the same request ID
2246 /// was received, and if so, will ignore the second request. This prevents
2247 /// clients from accidentally creating duplicate commitments.
2248 ///
2249 /// The request ID must be a valid UUID with the exception that zero UUID is
2250 /// not supported (00000000-0000-0000-0000-000000000000).
2251 pub request_id: std::string::String,
2252
2253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2254}
2255
2256impl DeleteExternalAddressRequest {
2257 pub fn new() -> Self {
2258 std::default::Default::default()
2259 }
2260
2261 /// Sets the value of [name][crate::model::DeleteExternalAddressRequest::name].
2262 ///
2263 /// # Example
2264 /// ```ignore,no_run
2265 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2266 /// let x = DeleteExternalAddressRequest::new().set_name("example");
2267 /// ```
2268 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2269 self.name = v.into();
2270 self
2271 }
2272
2273 /// Sets the value of [request_id][crate::model::DeleteExternalAddressRequest::request_id].
2274 ///
2275 /// # Example
2276 /// ```ignore,no_run
2277 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2278 /// let x = DeleteExternalAddressRequest::new().set_request_id("example");
2279 /// ```
2280 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.request_id = v.into();
2282 self
2283 }
2284}
2285
2286impl wkt::message::Message for DeleteExternalAddressRequest {
2287 fn typename() -> &'static str {
2288 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAddressRequest"
2289 }
2290}
2291
2292/// Request message for
2293/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2294///
2295/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2296#[derive(Clone, Default, PartialEq)]
2297#[non_exhaustive]
2298pub struct ListSubnetsRequest {
2299 /// Required. The resource name of the private cloud to be queried for
2300 /// subnets.
2301 /// Resource names are schemeless URIs that follow the conventions in
2302 /// <https://cloud.google.com/apis/design/resource_names>.
2303 /// For example:
2304 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2305 pub parent: std::string::String,
2306
2307 /// The maximum number of subnets to return in one page.
2308 /// The service may return fewer than this value.
2309 /// The maximum value is coerced to 1000.
2310 /// The default value of this field is 500.
2311 pub page_size: i32,
2312
2313 /// A page token, received from a previous `ListSubnetsRequest` call.
2314 /// Provide this to retrieve the subsequent page.
2315 ///
2316 /// When paginating, all other parameters provided to
2317 /// `ListSubnetsRequest` must match the call that provided the page token.
2318 pub page_token: std::string::String,
2319
2320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2321}
2322
2323impl ListSubnetsRequest {
2324 pub fn new() -> Self {
2325 std::default::Default::default()
2326 }
2327
2328 /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
2329 ///
2330 /// # Example
2331 /// ```ignore,no_run
2332 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2333 /// let x = ListSubnetsRequest::new().set_parent("example");
2334 /// ```
2335 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2336 self.parent = v.into();
2337 self
2338 }
2339
2340 /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2345 /// let x = ListSubnetsRequest::new().set_page_size(42);
2346 /// ```
2347 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2348 self.page_size = v.into();
2349 self
2350 }
2351
2352 /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2357 /// let x = ListSubnetsRequest::new().set_page_token("example");
2358 /// ```
2359 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.page_token = v.into();
2361 self
2362 }
2363}
2364
2365impl wkt::message::Message for ListSubnetsRequest {
2366 fn typename() -> &'static str {
2367 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsRequest"
2368 }
2369}
2370
2371/// Response message for
2372/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2373///
2374/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2375#[derive(Clone, Default, PartialEq)]
2376#[non_exhaustive]
2377pub struct ListSubnetsResponse {
2378 /// A list of subnets.
2379 pub subnets: std::vec::Vec<crate::model::Subnet>,
2380
2381 /// A token, which can be sent as `page_token` to retrieve the next page.
2382 /// If this field is omitted, there are no subsequent pages.
2383 pub next_page_token: std::string::String,
2384
2385 /// Locations that could not be reached when making an aggregated query using
2386 /// wildcards.
2387 pub unreachable: std::vec::Vec<std::string::String>,
2388
2389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2390}
2391
2392impl ListSubnetsResponse {
2393 pub fn new() -> Self {
2394 std::default::Default::default()
2395 }
2396
2397 /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
2398 ///
2399 /// # Example
2400 /// ```ignore,no_run
2401 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2402 /// use google_cloud_vmwareengine_v1::model::Subnet;
2403 /// let x = ListSubnetsResponse::new()
2404 /// .set_subnets([
2405 /// Subnet::default()/* use setters */,
2406 /// Subnet::default()/* use (different) setters */,
2407 /// ]);
2408 /// ```
2409 pub fn set_subnets<T, V>(mut self, v: T) -> Self
2410 where
2411 T: std::iter::IntoIterator<Item = V>,
2412 V: std::convert::Into<crate::model::Subnet>,
2413 {
2414 use std::iter::Iterator;
2415 self.subnets = v.into_iter().map(|i| i.into()).collect();
2416 self
2417 }
2418
2419 /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2424 /// let x = ListSubnetsResponse::new().set_next_page_token("example");
2425 /// ```
2426 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.next_page_token = v.into();
2428 self
2429 }
2430
2431 /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
2432 ///
2433 /// # Example
2434 /// ```ignore,no_run
2435 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2436 /// let x = ListSubnetsResponse::new().set_unreachable(["a", "b", "c"]);
2437 /// ```
2438 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2439 where
2440 T: std::iter::IntoIterator<Item = V>,
2441 V: std::convert::Into<std::string::String>,
2442 {
2443 use std::iter::Iterator;
2444 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2445 self
2446 }
2447}
2448
2449impl wkt::message::Message for ListSubnetsResponse {
2450 fn typename() -> &'static str {
2451 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsResponse"
2452 }
2453}
2454
2455#[doc(hidden)]
2456impl gax::paginator::internal::PageableResponse for ListSubnetsResponse {
2457 type PageItem = crate::model::Subnet;
2458
2459 fn items(self) -> std::vec::Vec<Self::PageItem> {
2460 self.subnets
2461 }
2462
2463 fn next_page_token(&self) -> std::string::String {
2464 use std::clone::Clone;
2465 self.next_page_token.clone()
2466 }
2467}
2468
2469/// Request message for
2470/// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]
2471///
2472/// [google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]: crate::client::VmwareEngine::get_subnet
2473#[derive(Clone, Default, PartialEq)]
2474#[non_exhaustive]
2475pub struct GetSubnetRequest {
2476 /// Required. The resource name of the subnet to retrieve.
2477 /// Resource names are schemeless URIs that follow the conventions in
2478 /// <https://cloud.google.com/apis/design/resource_names>.
2479 /// For example:
2480 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
2481 pub name: std::string::String,
2482
2483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2484}
2485
2486impl GetSubnetRequest {
2487 pub fn new() -> Self {
2488 std::default::Default::default()
2489 }
2490
2491 /// Sets the value of [name][crate::model::GetSubnetRequest::name].
2492 ///
2493 /// # Example
2494 /// ```ignore,no_run
2495 /// # use google_cloud_vmwareengine_v1::model::GetSubnetRequest;
2496 /// let x = GetSubnetRequest::new().set_name("example");
2497 /// ```
2498 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2499 self.name = v.into();
2500 self
2501 }
2502}
2503
2504impl wkt::message::Message for GetSubnetRequest {
2505 fn typename() -> &'static str {
2506 "type.googleapis.com/google.cloud.vmwareengine.v1.GetSubnetRequest"
2507 }
2508}
2509
2510/// Request message for
2511/// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]
2512///
2513/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]: crate::client::VmwareEngine::update_subnet
2514#[derive(Clone, Default, PartialEq)]
2515#[non_exhaustive]
2516pub struct UpdateSubnetRequest {
2517 /// Required. Field mask is used to specify the fields to be overwritten in the
2518 /// `Subnet` resource by the update.
2519 /// The fields specified in the `update_mask` are relative to the resource, not
2520 /// the full request. A field will be overwritten if it is in the mask. If the
2521 /// user does not provide a mask then all fields will be overwritten.
2522 pub update_mask: std::option::Option<wkt::FieldMask>,
2523
2524 /// Required. Subnet description.
2525 pub subnet: std::option::Option<crate::model::Subnet>,
2526
2527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2528}
2529
2530impl UpdateSubnetRequest {
2531 pub fn new() -> Self {
2532 std::default::Default::default()
2533 }
2534
2535 /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2536 ///
2537 /// # Example
2538 /// ```ignore,no_run
2539 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2540 /// use wkt::FieldMask;
2541 /// let x = UpdateSubnetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2542 /// ```
2543 pub fn set_update_mask<T>(mut self, v: T) -> Self
2544 where
2545 T: std::convert::Into<wkt::FieldMask>,
2546 {
2547 self.update_mask = std::option::Option::Some(v.into());
2548 self
2549 }
2550
2551 /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2552 ///
2553 /// # Example
2554 /// ```ignore,no_run
2555 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2556 /// use wkt::FieldMask;
2557 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2558 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2559 /// ```
2560 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561 where
2562 T: std::convert::Into<wkt::FieldMask>,
2563 {
2564 self.update_mask = v.map(|x| x.into());
2565 self
2566 }
2567
2568 /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2569 ///
2570 /// # Example
2571 /// ```ignore,no_run
2572 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2573 /// use google_cloud_vmwareengine_v1::model::Subnet;
2574 /// let x = UpdateSubnetRequest::new().set_subnet(Subnet::default()/* use setters */);
2575 /// ```
2576 pub fn set_subnet<T>(mut self, v: T) -> Self
2577 where
2578 T: std::convert::Into<crate::model::Subnet>,
2579 {
2580 self.subnet = std::option::Option::Some(v.into());
2581 self
2582 }
2583
2584 /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2585 ///
2586 /// # Example
2587 /// ```ignore,no_run
2588 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2589 /// use google_cloud_vmwareengine_v1::model::Subnet;
2590 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(Some(Subnet::default()/* use setters */));
2591 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(None::<Subnet>);
2592 /// ```
2593 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
2594 where
2595 T: std::convert::Into<crate::model::Subnet>,
2596 {
2597 self.subnet = v.map(|x| x.into());
2598 self
2599 }
2600}
2601
2602impl wkt::message::Message for UpdateSubnetRequest {
2603 fn typename() -> &'static str {
2604 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateSubnetRequest"
2605 }
2606}
2607
2608/// Request message for
2609/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2610///
2611/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2612#[derive(Clone, Default, PartialEq)]
2613#[non_exhaustive]
2614pub struct ListExternalAccessRulesRequest {
2615 /// Required. The resource name of the network policy to query for external
2616 /// access firewall rules. Resource names are schemeless URIs that follow the
2617 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
2618 /// example:
2619 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2620 pub parent: std::string::String,
2621
2622 /// The maximum number of external access rules to return in one page.
2623 /// The service may return fewer than this value.
2624 /// The maximum value is coerced to 1000.
2625 /// The default value of this field is 500.
2626 pub page_size: i32,
2627
2628 /// A page token, received from a previous `ListExternalAccessRulesRequest`
2629 /// call. Provide this to retrieve the subsequent page.
2630 ///
2631 /// When paginating, all other parameters provided to
2632 /// `ListExternalAccessRulesRequest` must match the call that provided the page
2633 /// token.
2634 pub page_token: std::string::String,
2635
2636 /// A filter expression that matches resources returned in the response.
2637 /// The expression must specify the field name, a comparison
2638 /// operator, and the value that you want to use for filtering. The value
2639 /// must be a string, a number, or a boolean. The comparison operator
2640 /// must be `=`, `!=`, `>`, or `<`.
2641 ///
2642 /// For example, if you are filtering a list of external access rules, you can
2643 /// exclude the ones named `example-rule` by specifying
2644 /// `name != "example-rule"`.
2645 ///
2646 /// To filter on multiple expressions, provide each separate expression within
2647 /// parentheses. For example:
2648 ///
2649 /// ```norust
2650 /// (name = "example-rule")
2651 /// (createTime > "2021-04-12T08:15:10.40Z")
2652 /// ```
2653 ///
2654 /// By default, each expression is an `AND` expression. However, you
2655 /// can include `AND` and `OR` expressions explicitly.
2656 /// For example:
2657 ///
2658 /// ```norust
2659 /// (name = "example-rule-1") AND
2660 /// (createTime > "2021-04-12T08:15:10.40Z") OR
2661 /// (name = "example-rule-2")
2662 /// ```
2663 pub filter: std::string::String,
2664
2665 /// Sorts list results by a certain order. By default, returned results
2666 /// are ordered by `name` in ascending order.
2667 /// You can also sort results in descending order based on the `name` value
2668 /// using `orderBy="name desc"`.
2669 /// Currently, only ordering by `name` is supported.
2670 pub order_by: std::string::String,
2671
2672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2673}
2674
2675impl ListExternalAccessRulesRequest {
2676 pub fn new() -> Self {
2677 std::default::Default::default()
2678 }
2679
2680 /// Sets the value of [parent][crate::model::ListExternalAccessRulesRequest::parent].
2681 ///
2682 /// # Example
2683 /// ```ignore,no_run
2684 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2685 /// let x = ListExternalAccessRulesRequest::new().set_parent("example");
2686 /// ```
2687 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.parent = v.into();
2689 self
2690 }
2691
2692 /// Sets the value of [page_size][crate::model::ListExternalAccessRulesRequest::page_size].
2693 ///
2694 /// # Example
2695 /// ```ignore,no_run
2696 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2697 /// let x = ListExternalAccessRulesRequest::new().set_page_size(42);
2698 /// ```
2699 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2700 self.page_size = v.into();
2701 self
2702 }
2703
2704 /// Sets the value of [page_token][crate::model::ListExternalAccessRulesRequest::page_token].
2705 ///
2706 /// # Example
2707 /// ```ignore,no_run
2708 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2709 /// let x = ListExternalAccessRulesRequest::new().set_page_token("example");
2710 /// ```
2711 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2712 self.page_token = v.into();
2713 self
2714 }
2715
2716 /// Sets the value of [filter][crate::model::ListExternalAccessRulesRequest::filter].
2717 ///
2718 /// # Example
2719 /// ```ignore,no_run
2720 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2721 /// let x = ListExternalAccessRulesRequest::new().set_filter("example");
2722 /// ```
2723 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2724 self.filter = v.into();
2725 self
2726 }
2727
2728 /// Sets the value of [order_by][crate::model::ListExternalAccessRulesRequest::order_by].
2729 ///
2730 /// # Example
2731 /// ```ignore,no_run
2732 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2733 /// let x = ListExternalAccessRulesRequest::new().set_order_by("example");
2734 /// ```
2735 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2736 self.order_by = v.into();
2737 self
2738 }
2739}
2740
2741impl wkt::message::Message for ListExternalAccessRulesRequest {
2742 fn typename() -> &'static str {
2743 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest"
2744 }
2745}
2746
2747/// Response message for
2748/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2749///
2750/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2751#[derive(Clone, Default, PartialEq)]
2752#[non_exhaustive]
2753pub struct ListExternalAccessRulesResponse {
2754 /// A list of external access firewall rules.
2755 pub external_access_rules: std::vec::Vec<crate::model::ExternalAccessRule>,
2756
2757 /// A token, which can be sent as `page_token` to retrieve the next page.
2758 /// If this field is omitted, there are no subsequent pages.
2759 pub next_page_token: std::string::String,
2760
2761 /// Locations that could not be reached when making an aggregated query using
2762 /// wildcards.
2763 pub unreachable: std::vec::Vec<std::string::String>,
2764
2765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2766}
2767
2768impl ListExternalAccessRulesResponse {
2769 pub fn new() -> Self {
2770 std::default::Default::default()
2771 }
2772
2773 /// Sets the value of [external_access_rules][crate::model::ListExternalAccessRulesResponse::external_access_rules].
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2778 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2779 /// let x = ListExternalAccessRulesResponse::new()
2780 /// .set_external_access_rules([
2781 /// ExternalAccessRule::default()/* use setters */,
2782 /// ExternalAccessRule::default()/* use (different) setters */,
2783 /// ]);
2784 /// ```
2785 pub fn set_external_access_rules<T, V>(mut self, v: T) -> Self
2786 where
2787 T: std::iter::IntoIterator<Item = V>,
2788 V: std::convert::Into<crate::model::ExternalAccessRule>,
2789 {
2790 use std::iter::Iterator;
2791 self.external_access_rules = v.into_iter().map(|i| i.into()).collect();
2792 self
2793 }
2794
2795 /// Sets the value of [next_page_token][crate::model::ListExternalAccessRulesResponse::next_page_token].
2796 ///
2797 /// # Example
2798 /// ```ignore,no_run
2799 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2800 /// let x = ListExternalAccessRulesResponse::new().set_next_page_token("example");
2801 /// ```
2802 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2803 self.next_page_token = v.into();
2804 self
2805 }
2806
2807 /// Sets the value of [unreachable][crate::model::ListExternalAccessRulesResponse::unreachable].
2808 ///
2809 /// # Example
2810 /// ```ignore,no_run
2811 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2812 /// let x = ListExternalAccessRulesResponse::new().set_unreachable(["a", "b", "c"]);
2813 /// ```
2814 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2815 where
2816 T: std::iter::IntoIterator<Item = V>,
2817 V: std::convert::Into<std::string::String>,
2818 {
2819 use std::iter::Iterator;
2820 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2821 self
2822 }
2823}
2824
2825impl wkt::message::Message for ListExternalAccessRulesResponse {
2826 fn typename() -> &'static str {
2827 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse"
2828 }
2829}
2830
2831#[doc(hidden)]
2832impl gax::paginator::internal::PageableResponse for ListExternalAccessRulesResponse {
2833 type PageItem = crate::model::ExternalAccessRule;
2834
2835 fn items(self) -> std::vec::Vec<Self::PageItem> {
2836 self.external_access_rules
2837 }
2838
2839 fn next_page_token(&self) -> std::string::String {
2840 use std::clone::Clone;
2841 self.next_page_token.clone()
2842 }
2843}
2844
2845/// Request message for
2846/// [VmwareEngine.GetExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]
2847///
2848/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]: crate::client::VmwareEngine::get_external_access_rule
2849#[derive(Clone, Default, PartialEq)]
2850#[non_exhaustive]
2851pub struct GetExternalAccessRuleRequest {
2852 /// Required. The resource name of the external access firewall rule to
2853 /// retrieve. Resource names are schemeless URIs that follow the conventions in
2854 /// <https://cloud.google.com/apis/design/resource_names>.
2855 /// For example:
2856 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
2857 pub name: std::string::String,
2858
2859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2860}
2861
2862impl GetExternalAccessRuleRequest {
2863 pub fn new() -> Self {
2864 std::default::Default::default()
2865 }
2866
2867 /// Sets the value of [name][crate::model::GetExternalAccessRuleRequest::name].
2868 ///
2869 /// # Example
2870 /// ```ignore,no_run
2871 /// # use google_cloud_vmwareengine_v1::model::GetExternalAccessRuleRequest;
2872 /// let x = GetExternalAccessRuleRequest::new().set_name("example");
2873 /// ```
2874 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2875 self.name = v.into();
2876 self
2877 }
2878}
2879
2880impl wkt::message::Message for GetExternalAccessRuleRequest {
2881 fn typename() -> &'static str {
2882 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest"
2883 }
2884}
2885
2886/// Request message for
2887/// [VmwareEngine.CreateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]
2888///
2889/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]: crate::client::VmwareEngine::create_external_access_rule
2890#[derive(Clone, Default, PartialEq)]
2891#[non_exhaustive]
2892pub struct CreateExternalAccessRuleRequest {
2893 /// Required. The resource name of the network policy
2894 /// to create a new external access firewall rule in.
2895 /// Resource names are schemeless URIs that follow the conventions in
2896 /// <https://cloud.google.com/apis/design/resource_names>.
2897 /// For example:
2898 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2899 pub parent: std::string::String,
2900
2901 /// Required. The initial description of a new external access rule.
2902 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
2903
2904 /// Required. The user-provided identifier of the `ExternalAccessRule` to be
2905 /// created. This identifier must be unique among `ExternalAccessRule`
2906 /// resources within the parent and becomes the final token in the name URI.
2907 /// The identifier must meet the following requirements:
2908 ///
2909 /// * Only contains 1-63 alphanumeric characters and hyphens
2910 /// * Begins with an alphabetical character
2911 /// * Ends with a non-hyphen character
2912 /// * Not formatted as a UUID
2913 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2914 /// (section 3.5)
2915 pub external_access_rule_id: std::string::String,
2916
2917 /// A request ID to identify requests. Specify a unique request ID
2918 /// so that if you must retry your request, the server will know to ignore
2919 /// the request if it has already been completed. The server guarantees that a
2920 /// request doesn't result in creation of duplicate commitments for at least 60
2921 /// minutes.
2922 ///
2923 /// For example, consider a situation where you make an initial request and the
2924 /// request times out. If you make the request again with the same request ID,
2925 /// the server can check if the original operation with the same request ID was
2926 /// received, and if so, will ignore the second request. This prevents clients
2927 /// from accidentally creating duplicate commitments.
2928 ///
2929 /// The request ID must be a valid UUID with the exception that zero UUID is
2930 /// not supported (00000000-0000-0000-0000-000000000000).
2931 pub request_id: std::string::String,
2932
2933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2934}
2935
2936impl CreateExternalAccessRuleRequest {
2937 pub fn new() -> Self {
2938 std::default::Default::default()
2939 }
2940
2941 /// Sets the value of [parent][crate::model::CreateExternalAccessRuleRequest::parent].
2942 ///
2943 /// # Example
2944 /// ```ignore,no_run
2945 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2946 /// let x = CreateExternalAccessRuleRequest::new().set_parent("example");
2947 /// ```
2948 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2949 self.parent = v.into();
2950 self
2951 }
2952
2953 /// Sets the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2954 ///
2955 /// # Example
2956 /// ```ignore,no_run
2957 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2958 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2959 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
2960 /// ```
2961 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
2962 where
2963 T: std::convert::Into<crate::model::ExternalAccessRule>,
2964 {
2965 self.external_access_rule = std::option::Option::Some(v.into());
2966 self
2967 }
2968
2969 /// Sets or clears the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2970 ///
2971 /// # Example
2972 /// ```ignore,no_run
2973 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2974 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2975 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
2976 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
2977 /// ```
2978 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
2979 where
2980 T: std::convert::Into<crate::model::ExternalAccessRule>,
2981 {
2982 self.external_access_rule = v.map(|x| x.into());
2983 self
2984 }
2985
2986 /// Sets the value of [external_access_rule_id][crate::model::CreateExternalAccessRuleRequest::external_access_rule_id].
2987 ///
2988 /// # Example
2989 /// ```ignore,no_run
2990 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2991 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule_id("example");
2992 /// ```
2993 pub fn set_external_access_rule_id<T: std::convert::Into<std::string::String>>(
2994 mut self,
2995 v: T,
2996 ) -> Self {
2997 self.external_access_rule_id = v.into();
2998 self
2999 }
3000
3001 /// Sets the value of [request_id][crate::model::CreateExternalAccessRuleRequest::request_id].
3002 ///
3003 /// # Example
3004 /// ```ignore,no_run
3005 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3006 /// let x = CreateExternalAccessRuleRequest::new().set_request_id("example");
3007 /// ```
3008 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.request_id = v.into();
3010 self
3011 }
3012}
3013
3014impl wkt::message::Message for CreateExternalAccessRuleRequest {
3015 fn typename() -> &'static str {
3016 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest"
3017 }
3018}
3019
3020/// Request message for
3021/// [VmwareEngine.UpdateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]
3022///
3023/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]: crate::client::VmwareEngine::update_external_access_rule
3024#[derive(Clone, Default, PartialEq)]
3025#[non_exhaustive]
3026pub struct UpdateExternalAccessRuleRequest {
3027 /// Required. Field mask is used to specify the fields to be overwritten in the
3028 /// `ExternalAccessRule` resource by the update.
3029 /// The fields specified in the `update_mask` are relative to the resource, not
3030 /// the full request. A field will be overwritten if it is in the mask. If the
3031 /// user does not provide a mask then all fields will be overwritten.
3032 pub update_mask: std::option::Option<wkt::FieldMask>,
3033
3034 /// Required. Description of the external access rule.
3035 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
3036
3037 /// Optional. A request ID to identify requests. Specify a unique request ID
3038 /// so that if you must retry your request, the server will know to ignore
3039 /// the request if it has already been completed. The server guarantees that a
3040 /// request doesn't result in creation of duplicate commitments for at least 60
3041 /// minutes.
3042 ///
3043 /// For example, consider a situation where you make an initial request and the
3044 /// request times out. If you make the request again with the same request ID,
3045 /// the server can check if the original operation with the same request ID was
3046 /// received, and if so, will ignore the second request. This prevents clients
3047 /// from accidentally creating duplicate commitments.
3048 ///
3049 /// The request ID must be a valid UUID with the exception that zero UUID is
3050 /// not supported (00000000-0000-0000-0000-000000000000).
3051 pub request_id: std::string::String,
3052
3053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3054}
3055
3056impl UpdateExternalAccessRuleRequest {
3057 pub fn new() -> Self {
3058 std::default::Default::default()
3059 }
3060
3061 /// Sets the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3062 ///
3063 /// # Example
3064 /// ```ignore,no_run
3065 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3066 /// use wkt::FieldMask;
3067 /// let x = UpdateExternalAccessRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3068 /// ```
3069 pub fn set_update_mask<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<wkt::FieldMask>,
3072 {
3073 self.update_mask = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3078 ///
3079 /// # Example
3080 /// ```ignore,no_run
3081 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3082 /// use wkt::FieldMask;
3083 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3084 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3085 /// ```
3086 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3087 where
3088 T: std::convert::Into<wkt::FieldMask>,
3089 {
3090 self.update_mask = v.map(|x| x.into());
3091 self
3092 }
3093
3094 /// Sets the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3099 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3100 /// let x = UpdateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
3101 /// ```
3102 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
3103 where
3104 T: std::convert::Into<crate::model::ExternalAccessRule>,
3105 {
3106 self.external_access_rule = std::option::Option::Some(v.into());
3107 self
3108 }
3109
3110 /// Sets or clears the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3111 ///
3112 /// # Example
3113 /// ```ignore,no_run
3114 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3115 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3116 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
3117 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
3118 /// ```
3119 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
3120 where
3121 T: std::convert::Into<crate::model::ExternalAccessRule>,
3122 {
3123 self.external_access_rule = v.map(|x| x.into());
3124 self
3125 }
3126
3127 /// Sets the value of [request_id][crate::model::UpdateExternalAccessRuleRequest::request_id].
3128 ///
3129 /// # Example
3130 /// ```ignore,no_run
3131 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3132 /// let x = UpdateExternalAccessRuleRequest::new().set_request_id("example");
3133 /// ```
3134 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3135 self.request_id = v.into();
3136 self
3137 }
3138}
3139
3140impl wkt::message::Message for UpdateExternalAccessRuleRequest {
3141 fn typename() -> &'static str {
3142 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest"
3143 }
3144}
3145
3146/// Request message for
3147/// [VmwareEngine.DeleteExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]
3148///
3149/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]: crate::client::VmwareEngine::delete_external_access_rule
3150#[derive(Clone, Default, PartialEq)]
3151#[non_exhaustive]
3152pub struct DeleteExternalAccessRuleRequest {
3153 /// Required. The resource name of the external access firewall rule to delete.
3154 /// Resource names are schemeless URIs that follow the conventions in
3155 /// <https://cloud.google.com/apis/design/resource_names>.
3156 /// For example:
3157 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
3158 pub name: std::string::String,
3159
3160 /// Optional. A request ID to identify requests. Specify a unique request ID
3161 /// so that if you must retry your request, the server will know to ignore
3162 /// the request if it has already been completed. The server guarantees that a
3163 /// request doesn't result in creation of duplicate commitments for at least 60
3164 /// minutes.
3165 ///
3166 /// For example, consider a situation where you make an initial request and the
3167 /// request times out. If you make the request again with the same request
3168 /// ID, the server can check if the original operation with the same request ID
3169 /// was received, and if so, will ignore the second request. This prevents
3170 /// clients from accidentally creating duplicate commitments.
3171 ///
3172 /// The request ID must be a valid UUID with the exception that zero UUID is
3173 /// not supported (00000000-0000-0000-0000-000000000000).
3174 pub request_id: std::string::String,
3175
3176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3177}
3178
3179impl DeleteExternalAccessRuleRequest {
3180 pub fn new() -> Self {
3181 std::default::Default::default()
3182 }
3183
3184 /// Sets the value of [name][crate::model::DeleteExternalAccessRuleRequest::name].
3185 ///
3186 /// # Example
3187 /// ```ignore,no_run
3188 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3189 /// let x = DeleteExternalAccessRuleRequest::new().set_name("example");
3190 /// ```
3191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.name = v.into();
3193 self
3194 }
3195
3196 /// Sets the value of [request_id][crate::model::DeleteExternalAccessRuleRequest::request_id].
3197 ///
3198 /// # Example
3199 /// ```ignore,no_run
3200 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3201 /// let x = DeleteExternalAccessRuleRequest::new().set_request_id("example");
3202 /// ```
3203 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.request_id = v.into();
3205 self
3206 }
3207}
3208
3209impl wkt::message::Message for DeleteExternalAccessRuleRequest {
3210 fn typename() -> &'static str {
3211 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest"
3212 }
3213}
3214
3215/// Request message for
3216/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3217///
3218/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3219#[derive(Clone, Default, PartialEq)]
3220#[non_exhaustive]
3221pub struct ListLoggingServersRequest {
3222 /// Required. The resource name of the private cloud to be queried for
3223 /// logging servers.
3224 /// Resource names are schemeless URIs that follow the conventions in
3225 /// <https://cloud.google.com/apis/design/resource_names>.
3226 /// For example:
3227 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3228 pub parent: std::string::String,
3229
3230 /// The maximum number of logging servers to return in one page.
3231 /// The service may return fewer than this value.
3232 /// The maximum value is coerced to 1000.
3233 /// The default value of this field is 500.
3234 pub page_size: i32,
3235
3236 /// A page token, received from a previous `ListLoggingServersRequest` call.
3237 /// Provide this to retrieve the subsequent page.
3238 ///
3239 /// When paginating, all other parameters provided to
3240 /// `ListLoggingServersRequest` must match the call that provided the page
3241 /// token.
3242 pub page_token: std::string::String,
3243
3244 /// A filter expression that matches resources returned in the response.
3245 /// The expression must specify the field name, a comparison
3246 /// operator, and the value that you want to use for filtering. The value
3247 /// must be a string, a number, or a boolean. The comparison operator
3248 /// must be `=`, `!=`, `>`, or `<`.
3249 ///
3250 /// For example, if you are filtering a list of logging servers, you can
3251 /// exclude the ones named `example-server` by specifying
3252 /// `name != "example-server"`.
3253 ///
3254 /// To filter on multiple expressions, provide each separate expression within
3255 /// parentheses. For example:
3256 ///
3257 /// ```norust
3258 /// (name = "example-server")
3259 /// (createTime > "2021-04-12T08:15:10.40Z")
3260 /// ```
3261 ///
3262 /// By default, each expression is an `AND` expression. However, you
3263 /// can include `AND` and `OR` expressions explicitly.
3264 /// For example:
3265 ///
3266 /// ```norust
3267 /// (name = "example-server-1") AND
3268 /// (createTime > "2021-04-12T08:15:10.40Z") OR
3269 /// (name = "example-server-2")
3270 /// ```
3271 pub filter: std::string::String,
3272
3273 /// Sorts list results by a certain order. By default, returned results
3274 /// are ordered by `name` in ascending order.
3275 /// You can also sort results in descending order based on the `name` value
3276 /// using `orderBy="name desc"`.
3277 /// Currently, only ordering by `name` is supported.
3278 pub order_by: std::string::String,
3279
3280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3281}
3282
3283impl ListLoggingServersRequest {
3284 pub fn new() -> Self {
3285 std::default::Default::default()
3286 }
3287
3288 /// Sets the value of [parent][crate::model::ListLoggingServersRequest::parent].
3289 ///
3290 /// # Example
3291 /// ```ignore,no_run
3292 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3293 /// let x = ListLoggingServersRequest::new().set_parent("example");
3294 /// ```
3295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.parent = v.into();
3297 self
3298 }
3299
3300 /// Sets the value of [page_size][crate::model::ListLoggingServersRequest::page_size].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3305 /// let x = ListLoggingServersRequest::new().set_page_size(42);
3306 /// ```
3307 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3308 self.page_size = v.into();
3309 self
3310 }
3311
3312 /// Sets the value of [page_token][crate::model::ListLoggingServersRequest::page_token].
3313 ///
3314 /// # Example
3315 /// ```ignore,no_run
3316 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3317 /// let x = ListLoggingServersRequest::new().set_page_token("example");
3318 /// ```
3319 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3320 self.page_token = v.into();
3321 self
3322 }
3323
3324 /// Sets the value of [filter][crate::model::ListLoggingServersRequest::filter].
3325 ///
3326 /// # Example
3327 /// ```ignore,no_run
3328 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3329 /// let x = ListLoggingServersRequest::new().set_filter("example");
3330 /// ```
3331 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3332 self.filter = v.into();
3333 self
3334 }
3335
3336 /// Sets the value of [order_by][crate::model::ListLoggingServersRequest::order_by].
3337 ///
3338 /// # Example
3339 /// ```ignore,no_run
3340 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3341 /// let x = ListLoggingServersRequest::new().set_order_by("example");
3342 /// ```
3343 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3344 self.order_by = v.into();
3345 self
3346 }
3347}
3348
3349impl wkt::message::Message for ListLoggingServersRequest {
3350 fn typename() -> &'static str {
3351 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersRequest"
3352 }
3353}
3354
3355/// Response message for
3356/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3357///
3358/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3359#[derive(Clone, Default, PartialEq)]
3360#[non_exhaustive]
3361pub struct ListLoggingServersResponse {
3362 /// A list of Logging Servers.
3363 pub logging_servers: std::vec::Vec<crate::model::LoggingServer>,
3364
3365 /// A token, which can be send as `page_token` to retrieve the next page.
3366 /// If this field is omitted, there are no subsequent pages.
3367 pub next_page_token: std::string::String,
3368
3369 /// Locations that could not be reached when making an aggregated query using
3370 /// wildcards.
3371 pub unreachable: std::vec::Vec<std::string::String>,
3372
3373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3374}
3375
3376impl ListLoggingServersResponse {
3377 pub fn new() -> Self {
3378 std::default::Default::default()
3379 }
3380
3381 /// Sets the value of [logging_servers][crate::model::ListLoggingServersResponse::logging_servers].
3382 ///
3383 /// # Example
3384 /// ```ignore,no_run
3385 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3386 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3387 /// let x = ListLoggingServersResponse::new()
3388 /// .set_logging_servers([
3389 /// LoggingServer::default()/* use setters */,
3390 /// LoggingServer::default()/* use (different) setters */,
3391 /// ]);
3392 /// ```
3393 pub fn set_logging_servers<T, V>(mut self, v: T) -> Self
3394 where
3395 T: std::iter::IntoIterator<Item = V>,
3396 V: std::convert::Into<crate::model::LoggingServer>,
3397 {
3398 use std::iter::Iterator;
3399 self.logging_servers = v.into_iter().map(|i| i.into()).collect();
3400 self
3401 }
3402
3403 /// Sets the value of [next_page_token][crate::model::ListLoggingServersResponse::next_page_token].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3408 /// let x = ListLoggingServersResponse::new().set_next_page_token("example");
3409 /// ```
3410 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.next_page_token = v.into();
3412 self
3413 }
3414
3415 /// Sets the value of [unreachable][crate::model::ListLoggingServersResponse::unreachable].
3416 ///
3417 /// # Example
3418 /// ```ignore,no_run
3419 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3420 /// let x = ListLoggingServersResponse::new().set_unreachable(["a", "b", "c"]);
3421 /// ```
3422 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3423 where
3424 T: std::iter::IntoIterator<Item = V>,
3425 V: std::convert::Into<std::string::String>,
3426 {
3427 use std::iter::Iterator;
3428 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3429 self
3430 }
3431}
3432
3433impl wkt::message::Message for ListLoggingServersResponse {
3434 fn typename() -> &'static str {
3435 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersResponse"
3436 }
3437}
3438
3439#[doc(hidden)]
3440impl gax::paginator::internal::PageableResponse for ListLoggingServersResponse {
3441 type PageItem = crate::model::LoggingServer;
3442
3443 fn items(self) -> std::vec::Vec<Self::PageItem> {
3444 self.logging_servers
3445 }
3446
3447 fn next_page_token(&self) -> std::string::String {
3448 use std::clone::Clone;
3449 self.next_page_token.clone()
3450 }
3451}
3452
3453/// Request message for
3454/// [VmwareEngine.GetLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]
3455///
3456/// [google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]: crate::client::VmwareEngine::get_logging_server
3457#[derive(Clone, Default, PartialEq)]
3458#[non_exhaustive]
3459pub struct GetLoggingServerRequest {
3460 /// Required. The resource name of the Logging Server to retrieve.
3461 /// Resource names are schemeless URIs that follow the conventions in
3462 /// <https://cloud.google.com/apis/design/resource_names>.
3463 /// For example:
3464 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3465 pub name: std::string::String,
3466
3467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3468}
3469
3470impl GetLoggingServerRequest {
3471 pub fn new() -> Self {
3472 std::default::Default::default()
3473 }
3474
3475 /// Sets the value of [name][crate::model::GetLoggingServerRequest::name].
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_vmwareengine_v1::model::GetLoggingServerRequest;
3480 /// let x = GetLoggingServerRequest::new().set_name("example");
3481 /// ```
3482 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.name = v.into();
3484 self
3485 }
3486}
3487
3488impl wkt::message::Message for GetLoggingServerRequest {
3489 fn typename() -> &'static str {
3490 "type.googleapis.com/google.cloud.vmwareengine.v1.GetLoggingServerRequest"
3491 }
3492}
3493
3494/// Request message for
3495/// [VmwareEngine.CreateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]
3496///
3497/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]: crate::client::VmwareEngine::create_logging_server
3498#[derive(Clone, Default, PartialEq)]
3499#[non_exhaustive]
3500pub struct CreateLoggingServerRequest {
3501 /// Required. The resource name of the private cloud
3502 /// to create a new Logging Server in.
3503 /// Resource names are schemeless URIs that follow the conventions in
3504 /// <https://cloud.google.com/apis/design/resource_names>.
3505 /// For example:
3506 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3507 pub parent: std::string::String,
3508
3509 /// Required. The initial description of a new logging server.
3510 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3511
3512 /// Required. The user-provided identifier of the `LoggingServer` to be
3513 /// created. This identifier must be unique among `LoggingServer` resources
3514 /// within the parent and becomes the final token in the name URI.
3515 /// The identifier must meet the following requirements:
3516 ///
3517 /// * Only contains 1-63 alphanumeric characters and hyphens
3518 /// * Begins with an alphabetical character
3519 /// * Ends with a non-hyphen character
3520 /// * Not formatted as a UUID
3521 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3522 /// (section 3.5)
3523 pub logging_server_id: std::string::String,
3524
3525 /// Optional. A request ID to identify requests. Specify a unique request ID
3526 /// so that if you must retry your request, the server will know to ignore
3527 /// the request if it has already been completed. The server guarantees that a
3528 /// request doesn't result in creation of duplicate commitments for at least 60
3529 /// minutes.
3530 ///
3531 /// For example, consider a situation where you make an initial request and the
3532 /// request times out. If you make the request again with the same request ID,
3533 /// the server can check if original operation with the same request ID was
3534 /// received, and if so, will ignore the second request. This prevents clients
3535 /// from accidentally creating duplicate commitments.
3536 ///
3537 /// The request ID must be a valid UUID with the exception that zero UUID is
3538 /// not supported (00000000-0000-0000-0000-000000000000).
3539 pub request_id: std::string::String,
3540
3541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3542}
3543
3544impl CreateLoggingServerRequest {
3545 pub fn new() -> Self {
3546 std::default::Default::default()
3547 }
3548
3549 /// Sets the value of [parent][crate::model::CreateLoggingServerRequest::parent].
3550 ///
3551 /// # Example
3552 /// ```ignore,no_run
3553 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3554 /// let x = CreateLoggingServerRequest::new().set_parent("example");
3555 /// ```
3556 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.parent = v.into();
3558 self
3559 }
3560
3561 /// Sets the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3562 ///
3563 /// # Example
3564 /// ```ignore,no_run
3565 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3566 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3567 /// let x = CreateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3568 /// ```
3569 pub fn set_logging_server<T>(mut self, v: T) -> Self
3570 where
3571 T: std::convert::Into<crate::model::LoggingServer>,
3572 {
3573 self.logging_server = std::option::Option::Some(v.into());
3574 self
3575 }
3576
3577 /// Sets or clears the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3578 ///
3579 /// # Example
3580 /// ```ignore,no_run
3581 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3582 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3583 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3584 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3585 /// ```
3586 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3587 where
3588 T: std::convert::Into<crate::model::LoggingServer>,
3589 {
3590 self.logging_server = v.map(|x| x.into());
3591 self
3592 }
3593
3594 /// Sets the value of [logging_server_id][crate::model::CreateLoggingServerRequest::logging_server_id].
3595 ///
3596 /// # Example
3597 /// ```ignore,no_run
3598 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3599 /// let x = CreateLoggingServerRequest::new().set_logging_server_id("example");
3600 /// ```
3601 pub fn set_logging_server_id<T: std::convert::Into<std::string::String>>(
3602 mut self,
3603 v: T,
3604 ) -> Self {
3605 self.logging_server_id = v.into();
3606 self
3607 }
3608
3609 /// Sets the value of [request_id][crate::model::CreateLoggingServerRequest::request_id].
3610 ///
3611 /// # Example
3612 /// ```ignore,no_run
3613 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3614 /// let x = CreateLoggingServerRequest::new().set_request_id("example");
3615 /// ```
3616 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3617 self.request_id = v.into();
3618 self
3619 }
3620}
3621
3622impl wkt::message::Message for CreateLoggingServerRequest {
3623 fn typename() -> &'static str {
3624 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateLoggingServerRequest"
3625 }
3626}
3627
3628/// Request message for
3629/// [VmwareEngine.UpdateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]
3630///
3631/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]: crate::client::VmwareEngine::update_logging_server
3632#[derive(Clone, Default, PartialEq)]
3633#[non_exhaustive]
3634pub struct UpdateLoggingServerRequest {
3635 /// Required. Field mask is used to specify the fields to be overwritten in the
3636 /// `LoggingServer` resource by the update.
3637 /// The fields specified in the `update_mask` are relative to the resource, not
3638 /// the full request. A field will be overwritten if it is in the mask. If the
3639 /// user does not provide a mask then all fields will be overwritten.
3640 pub update_mask: std::option::Option<wkt::FieldMask>,
3641
3642 /// Required. Logging server description.
3643 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3644
3645 /// Optional. A request ID to identify requests. Specify a unique request ID
3646 /// so that if you must retry your request, the server will know to ignore
3647 /// the request if it has already been completed. The server guarantees that a
3648 /// request doesn't result in creation of duplicate commitments for at least 60
3649 /// minutes.
3650 ///
3651 /// For example, consider a situation where you make an initial request and the
3652 /// request times out. If you make the request again with the same request ID,
3653 /// the server can check if original operation with the same request ID was
3654 /// received, and if so, will ignore the second request. This prevents clients
3655 /// from accidentally creating duplicate commitments.
3656 ///
3657 /// The request ID must be a valid UUID with the exception that zero UUID is
3658 /// not supported (00000000-0000-0000-0000-000000000000).
3659 pub request_id: std::string::String,
3660
3661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3662}
3663
3664impl UpdateLoggingServerRequest {
3665 pub fn new() -> Self {
3666 std::default::Default::default()
3667 }
3668
3669 /// Sets the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3670 ///
3671 /// # Example
3672 /// ```ignore,no_run
3673 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3674 /// use wkt::FieldMask;
3675 /// let x = UpdateLoggingServerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3676 /// ```
3677 pub fn set_update_mask<T>(mut self, v: T) -> Self
3678 where
3679 T: std::convert::Into<wkt::FieldMask>,
3680 {
3681 self.update_mask = std::option::Option::Some(v.into());
3682 self
3683 }
3684
3685 /// Sets or clears the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3686 ///
3687 /// # Example
3688 /// ```ignore,no_run
3689 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3690 /// use wkt::FieldMask;
3691 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3692 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3693 /// ```
3694 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3695 where
3696 T: std::convert::Into<wkt::FieldMask>,
3697 {
3698 self.update_mask = v.map(|x| x.into());
3699 self
3700 }
3701
3702 /// Sets the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3703 ///
3704 /// # Example
3705 /// ```ignore,no_run
3706 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3707 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3708 /// let x = UpdateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3709 /// ```
3710 pub fn set_logging_server<T>(mut self, v: T) -> Self
3711 where
3712 T: std::convert::Into<crate::model::LoggingServer>,
3713 {
3714 self.logging_server = std::option::Option::Some(v.into());
3715 self
3716 }
3717
3718 /// Sets or clears the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3719 ///
3720 /// # Example
3721 /// ```ignore,no_run
3722 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3723 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3724 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3725 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3726 /// ```
3727 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3728 where
3729 T: std::convert::Into<crate::model::LoggingServer>,
3730 {
3731 self.logging_server = v.map(|x| x.into());
3732 self
3733 }
3734
3735 /// Sets the value of [request_id][crate::model::UpdateLoggingServerRequest::request_id].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3740 /// let x = UpdateLoggingServerRequest::new().set_request_id("example");
3741 /// ```
3742 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.request_id = v.into();
3744 self
3745 }
3746}
3747
3748impl wkt::message::Message for UpdateLoggingServerRequest {
3749 fn typename() -> &'static str {
3750 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateLoggingServerRequest"
3751 }
3752}
3753
3754/// Request message for
3755/// [VmwareEngine.DeleteLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]
3756///
3757/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]: crate::client::VmwareEngine::delete_logging_server
3758#[derive(Clone, Default, PartialEq)]
3759#[non_exhaustive]
3760pub struct DeleteLoggingServerRequest {
3761 /// Required. The resource name of the logging server to delete.
3762 /// Resource names are schemeless URIs that follow the conventions in
3763 /// <https://cloud.google.com/apis/design/resource_names>.
3764 /// For example:
3765 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3766 pub name: std::string::String,
3767
3768 /// Optional. A request ID to identify requests. Specify a unique request ID
3769 /// so that if you must retry your request, the server will know to ignore
3770 /// the request if it has already been completed. The server guarantees that a
3771 /// request doesn't result in creation of duplicate commitments for at least 60
3772 /// minutes.
3773 ///
3774 /// For example, consider a situation where you make an initial request and the
3775 /// request times out. If you make the request again with the same request
3776 /// ID, the server can check if original operation with the same request ID
3777 /// was received, and if so, will ignore the second request. This prevents
3778 /// clients from accidentally creating duplicate commitments.
3779 ///
3780 /// The request ID must be a valid UUID with the exception that zero UUID is
3781 /// not supported (00000000-0000-0000-0000-000000000000).
3782 pub request_id: std::string::String,
3783
3784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3785}
3786
3787impl DeleteLoggingServerRequest {
3788 pub fn new() -> Self {
3789 std::default::Default::default()
3790 }
3791
3792 /// Sets the value of [name][crate::model::DeleteLoggingServerRequest::name].
3793 ///
3794 /// # Example
3795 /// ```ignore,no_run
3796 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3797 /// let x = DeleteLoggingServerRequest::new().set_name("example");
3798 /// ```
3799 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3800 self.name = v.into();
3801 self
3802 }
3803
3804 /// Sets the value of [request_id][crate::model::DeleteLoggingServerRequest::request_id].
3805 ///
3806 /// # Example
3807 /// ```ignore,no_run
3808 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3809 /// let x = DeleteLoggingServerRequest::new().set_request_id("example");
3810 /// ```
3811 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.request_id = v.into();
3813 self
3814 }
3815}
3816
3817impl wkt::message::Message for DeleteLoggingServerRequest {
3818 fn typename() -> &'static str {
3819 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteLoggingServerRequest"
3820 }
3821}
3822
3823/// Represents the metadata of the long-running operation.
3824#[derive(Clone, Default, PartialEq)]
3825#[non_exhaustive]
3826pub struct OperationMetadata {
3827 /// Output only. The time the operation was created.
3828 pub create_time: std::option::Option<wkt::Timestamp>,
3829
3830 /// Output only. The time the operation finished running.
3831 pub end_time: std::option::Option<wkt::Timestamp>,
3832
3833 /// Output only. Server-defined resource path for the target of the operation.
3834 pub target: std::string::String,
3835
3836 /// Output only. Name of the verb executed by the operation.
3837 pub verb: std::string::String,
3838
3839 /// Output only. Human-readable status of the operation, if any.
3840 pub status_message: std::string::String,
3841
3842 /// Output only. True if the user has requested cancellation
3843 /// of the operation; false otherwise.
3844 /// Operations that have successfully been cancelled
3845 /// have [Operation.error][] value with a
3846 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3847 /// `Code.CANCELLED`.
3848 ///
3849 /// [google.rpc.Status.code]: rpc::model::Status::code
3850 pub requested_cancellation: bool,
3851
3852 /// Output only. API version used to start the operation.
3853 pub api_version: std::string::String,
3854
3855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3856}
3857
3858impl OperationMetadata {
3859 pub fn new() -> Self {
3860 std::default::Default::default()
3861 }
3862
3863 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3864 ///
3865 /// # Example
3866 /// ```ignore,no_run
3867 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3868 /// use wkt::Timestamp;
3869 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3870 /// ```
3871 pub fn set_create_time<T>(mut self, v: T) -> Self
3872 where
3873 T: std::convert::Into<wkt::Timestamp>,
3874 {
3875 self.create_time = std::option::Option::Some(v.into());
3876 self
3877 }
3878
3879 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3880 ///
3881 /// # Example
3882 /// ```ignore,no_run
3883 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3884 /// use wkt::Timestamp;
3885 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3886 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3887 /// ```
3888 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3889 where
3890 T: std::convert::Into<wkt::Timestamp>,
3891 {
3892 self.create_time = v.map(|x| x.into());
3893 self
3894 }
3895
3896 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3897 ///
3898 /// # Example
3899 /// ```ignore,no_run
3900 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3901 /// use wkt::Timestamp;
3902 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3903 /// ```
3904 pub fn set_end_time<T>(mut self, v: T) -> Self
3905 where
3906 T: std::convert::Into<wkt::Timestamp>,
3907 {
3908 self.end_time = std::option::Option::Some(v.into());
3909 self
3910 }
3911
3912 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3913 ///
3914 /// # Example
3915 /// ```ignore,no_run
3916 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3917 /// use wkt::Timestamp;
3918 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3919 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3920 /// ```
3921 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3922 where
3923 T: std::convert::Into<wkt::Timestamp>,
3924 {
3925 self.end_time = v.map(|x| x.into());
3926 self
3927 }
3928
3929 /// Sets the value of [target][crate::model::OperationMetadata::target].
3930 ///
3931 /// # Example
3932 /// ```ignore,no_run
3933 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3934 /// let x = OperationMetadata::new().set_target("example");
3935 /// ```
3936 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3937 self.target = v.into();
3938 self
3939 }
3940
3941 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3942 ///
3943 /// # Example
3944 /// ```ignore,no_run
3945 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3946 /// let x = OperationMetadata::new().set_verb("example");
3947 /// ```
3948 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3949 self.verb = v.into();
3950 self
3951 }
3952
3953 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3958 /// let x = OperationMetadata::new().set_status_message("example");
3959 /// ```
3960 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3961 self.status_message = v.into();
3962 self
3963 }
3964
3965 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3966 ///
3967 /// # Example
3968 /// ```ignore,no_run
3969 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3970 /// let x = OperationMetadata::new().set_requested_cancellation(true);
3971 /// ```
3972 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3973 self.requested_cancellation = v.into();
3974 self
3975 }
3976
3977 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3978 ///
3979 /// # Example
3980 /// ```ignore,no_run
3981 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3982 /// let x = OperationMetadata::new().set_api_version("example");
3983 /// ```
3984 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.api_version = v.into();
3986 self
3987 }
3988}
3989
3990impl wkt::message::Message for OperationMetadata {
3991 fn typename() -> &'static str {
3992 "type.googleapis.com/google.cloud.vmwareengine.v1.OperationMetadata"
3993 }
3994}
3995
3996/// Request message for
3997/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
3998///
3999/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4000#[derive(Clone, Default, PartialEq)]
4001#[non_exhaustive]
4002pub struct ListNodeTypesRequest {
4003 /// Required. The resource name of the location to be queried for node types.
4004 /// Resource names are schemeless URIs that follow the conventions in
4005 /// <https://cloud.google.com/apis/design/resource_names>.
4006 /// For example:
4007 /// `projects/my-project/locations/us-central1-a`
4008 pub parent: std::string::String,
4009
4010 /// The maximum number of node types to return in one page.
4011 /// The service may return fewer than this value.
4012 /// The maximum value is coerced to 1000.
4013 /// The default value of this field is 500.
4014 pub page_size: i32,
4015
4016 /// A page token, received from a previous `ListNodeTypes` call.
4017 /// Provide this to retrieve the subsequent page.
4018 ///
4019 /// When paginating, all other parameters provided to
4020 /// `ListNodeTypes` must match the call that provided the page token.
4021 pub page_token: std::string::String,
4022
4023 /// A filter expression that matches resources returned in the response.
4024 /// The expression must specify the field name, a comparison
4025 /// operator, and the value that you want to use for filtering. The value
4026 /// must be a string, a number, or a boolean. The comparison operator
4027 /// must be `=`, `!=`, `>`, or `<`.
4028 ///
4029 /// For example, if you are filtering a list of node types, you can
4030 /// exclude the ones named `standard-72` by specifying
4031 /// `name != "standard-72"`.
4032 ///
4033 /// To filter on multiple expressions, provide each separate expression within
4034 /// parentheses. For example:
4035 ///
4036 /// ```norust
4037 /// (name = "standard-72")
4038 /// (virtual_cpu_count > 2)
4039 /// ```
4040 ///
4041 /// By default, each expression is an `AND` expression. However, you
4042 /// can include `AND` and `OR` expressions explicitly.
4043 /// For example:
4044 ///
4045 /// ```norust
4046 /// (name = "standard-96") AND
4047 /// (virtual_cpu_count > 2) OR
4048 /// (name = "standard-72")
4049 /// ```
4050 pub filter: std::string::String,
4051
4052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4053}
4054
4055impl ListNodeTypesRequest {
4056 pub fn new() -> Self {
4057 std::default::Default::default()
4058 }
4059
4060 /// Sets the value of [parent][crate::model::ListNodeTypesRequest::parent].
4061 ///
4062 /// # Example
4063 /// ```ignore,no_run
4064 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4065 /// let x = ListNodeTypesRequest::new().set_parent("example");
4066 /// ```
4067 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068 self.parent = v.into();
4069 self
4070 }
4071
4072 /// Sets the value of [page_size][crate::model::ListNodeTypesRequest::page_size].
4073 ///
4074 /// # Example
4075 /// ```ignore,no_run
4076 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4077 /// let x = ListNodeTypesRequest::new().set_page_size(42);
4078 /// ```
4079 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4080 self.page_size = v.into();
4081 self
4082 }
4083
4084 /// Sets the value of [page_token][crate::model::ListNodeTypesRequest::page_token].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4089 /// let x = ListNodeTypesRequest::new().set_page_token("example");
4090 /// ```
4091 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.page_token = v.into();
4093 self
4094 }
4095
4096 /// Sets the value of [filter][crate::model::ListNodeTypesRequest::filter].
4097 ///
4098 /// # Example
4099 /// ```ignore,no_run
4100 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4101 /// let x = ListNodeTypesRequest::new().set_filter("example");
4102 /// ```
4103 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4104 self.filter = v.into();
4105 self
4106 }
4107}
4108
4109impl wkt::message::Message for ListNodeTypesRequest {
4110 fn typename() -> &'static str {
4111 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesRequest"
4112 }
4113}
4114
4115/// Response message for
4116/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
4117///
4118/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4119#[derive(Clone, Default, PartialEq)]
4120#[non_exhaustive]
4121pub struct ListNodeTypesResponse {
4122 /// A list of Node Types.
4123 pub node_types: std::vec::Vec<crate::model::NodeType>,
4124
4125 /// A token, which can be sent as `page_token` to retrieve the next page.
4126 /// If this field is omitted, there are no subsequent pages.
4127 pub next_page_token: std::string::String,
4128
4129 /// Locations that could not be reached when making an aggregated query using
4130 /// wildcards.
4131 pub unreachable: std::vec::Vec<std::string::String>,
4132
4133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4134}
4135
4136impl ListNodeTypesResponse {
4137 pub fn new() -> Self {
4138 std::default::Default::default()
4139 }
4140
4141 /// Sets the value of [node_types][crate::model::ListNodeTypesResponse::node_types].
4142 ///
4143 /// # Example
4144 /// ```ignore,no_run
4145 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4146 /// use google_cloud_vmwareengine_v1::model::NodeType;
4147 /// let x = ListNodeTypesResponse::new()
4148 /// .set_node_types([
4149 /// NodeType::default()/* use setters */,
4150 /// NodeType::default()/* use (different) setters */,
4151 /// ]);
4152 /// ```
4153 pub fn set_node_types<T, V>(mut self, v: T) -> Self
4154 where
4155 T: std::iter::IntoIterator<Item = V>,
4156 V: std::convert::Into<crate::model::NodeType>,
4157 {
4158 use std::iter::Iterator;
4159 self.node_types = v.into_iter().map(|i| i.into()).collect();
4160 self
4161 }
4162
4163 /// Sets the value of [next_page_token][crate::model::ListNodeTypesResponse::next_page_token].
4164 ///
4165 /// # Example
4166 /// ```ignore,no_run
4167 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4168 /// let x = ListNodeTypesResponse::new().set_next_page_token("example");
4169 /// ```
4170 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4171 self.next_page_token = v.into();
4172 self
4173 }
4174
4175 /// Sets the value of [unreachable][crate::model::ListNodeTypesResponse::unreachable].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4180 /// let x = ListNodeTypesResponse::new().set_unreachable(["a", "b", "c"]);
4181 /// ```
4182 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4183 where
4184 T: std::iter::IntoIterator<Item = V>,
4185 V: std::convert::Into<std::string::String>,
4186 {
4187 use std::iter::Iterator;
4188 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4189 self
4190 }
4191}
4192
4193impl wkt::message::Message for ListNodeTypesResponse {
4194 fn typename() -> &'static str {
4195 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesResponse"
4196 }
4197}
4198
4199#[doc(hidden)]
4200impl gax::paginator::internal::PageableResponse for ListNodeTypesResponse {
4201 type PageItem = crate::model::NodeType;
4202
4203 fn items(self) -> std::vec::Vec<Self::PageItem> {
4204 self.node_types
4205 }
4206
4207 fn next_page_token(&self) -> std::string::String {
4208 use std::clone::Clone;
4209 self.next_page_token.clone()
4210 }
4211}
4212
4213/// Request message for
4214/// [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]
4215///
4216/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]: crate::client::VmwareEngine::get_node_type
4217#[derive(Clone, Default, PartialEq)]
4218#[non_exhaustive]
4219pub struct GetNodeTypeRequest {
4220 /// Required. The resource name of the node type to retrieve.
4221 /// Resource names are schemeless URIs that follow the conventions in
4222 /// <https://cloud.google.com/apis/design/resource_names>.
4223 /// For example:
4224 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
4225 pub name: std::string::String,
4226
4227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4228}
4229
4230impl GetNodeTypeRequest {
4231 pub fn new() -> Self {
4232 std::default::Default::default()
4233 }
4234
4235 /// Sets the value of [name][crate::model::GetNodeTypeRequest::name].
4236 ///
4237 /// # Example
4238 /// ```ignore,no_run
4239 /// # use google_cloud_vmwareengine_v1::model::GetNodeTypeRequest;
4240 /// let x = GetNodeTypeRequest::new().set_name("example");
4241 /// ```
4242 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4243 self.name = v.into();
4244 self
4245 }
4246}
4247
4248impl wkt::message::Message for GetNodeTypeRequest {
4249 fn typename() -> &'static str {
4250 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeTypeRequest"
4251 }
4252}
4253
4254/// Request message for
4255/// [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]
4256///
4257/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]: crate::client::VmwareEngine::show_nsx_credentials
4258#[derive(Clone, Default, PartialEq)]
4259#[non_exhaustive]
4260pub struct ShowNsxCredentialsRequest {
4261 /// Required. The resource name of the private cloud
4262 /// to be queried for credentials.
4263 /// Resource names are schemeless URIs that follow the conventions in
4264 /// <https://cloud.google.com/apis/design/resource_names>.
4265 /// For example:
4266 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4267 pub private_cloud: std::string::String,
4268
4269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4270}
4271
4272impl ShowNsxCredentialsRequest {
4273 pub fn new() -> Self {
4274 std::default::Default::default()
4275 }
4276
4277 /// Sets the value of [private_cloud][crate::model::ShowNsxCredentialsRequest::private_cloud].
4278 ///
4279 /// # Example
4280 /// ```ignore,no_run
4281 /// # use google_cloud_vmwareengine_v1::model::ShowNsxCredentialsRequest;
4282 /// let x = ShowNsxCredentialsRequest::new().set_private_cloud("example");
4283 /// ```
4284 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.private_cloud = v.into();
4286 self
4287 }
4288}
4289
4290impl wkt::message::Message for ShowNsxCredentialsRequest {
4291 fn typename() -> &'static str {
4292 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"
4293 }
4294}
4295
4296/// Request message for
4297/// [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]
4298///
4299/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]: crate::client::VmwareEngine::show_vcenter_credentials
4300#[derive(Clone, Default, PartialEq)]
4301#[non_exhaustive]
4302pub struct ShowVcenterCredentialsRequest {
4303 /// Required. The resource name of the private cloud
4304 /// to be queried for credentials.
4305 /// Resource names are schemeless URIs that follow the conventions in
4306 /// <https://cloud.google.com/apis/design/resource_names>.
4307 /// For example:
4308 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4309 pub private_cloud: std::string::String,
4310
4311 /// Optional. The username of the user to be queried for credentials.
4312 /// The default value of this field is CloudOwner@gve.local.
4313 /// The provided value must be one of the following:
4314 /// CloudOwner@gve.local,
4315 /// solution-user-01@gve.local,
4316 /// solution-user-02@gve.local,
4317 /// solution-user-03@gve.local,
4318 /// solution-user-04@gve.local,
4319 /// solution-user-05@gve.local,
4320 /// zertoadmin@gve.local.
4321 pub username: std::string::String,
4322
4323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4324}
4325
4326impl ShowVcenterCredentialsRequest {
4327 pub fn new() -> Self {
4328 std::default::Default::default()
4329 }
4330
4331 /// Sets the value of [private_cloud][crate::model::ShowVcenterCredentialsRequest::private_cloud].
4332 ///
4333 /// # Example
4334 /// ```ignore,no_run
4335 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4336 /// let x = ShowVcenterCredentialsRequest::new().set_private_cloud("example");
4337 /// ```
4338 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4339 self.private_cloud = v.into();
4340 self
4341 }
4342
4343 /// Sets the value of [username][crate::model::ShowVcenterCredentialsRequest::username].
4344 ///
4345 /// # Example
4346 /// ```ignore,no_run
4347 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4348 /// let x = ShowVcenterCredentialsRequest::new().set_username("example");
4349 /// ```
4350 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4351 self.username = v.into();
4352 self
4353 }
4354}
4355
4356impl wkt::message::Message for ShowVcenterCredentialsRequest {
4357 fn typename() -> &'static str {
4358 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"
4359 }
4360}
4361
4362/// Request message for
4363/// [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]
4364///
4365/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]: crate::client::VmwareEngine::reset_nsx_credentials
4366#[derive(Clone, Default, PartialEq)]
4367#[non_exhaustive]
4368pub struct ResetNsxCredentialsRequest {
4369 /// Required. The resource name of the private cloud
4370 /// to reset credentials for.
4371 /// Resource names are schemeless URIs that follow the conventions in
4372 /// <https://cloud.google.com/apis/design/resource_names>.
4373 /// For example:
4374 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4375 pub private_cloud: std::string::String,
4376
4377 /// Optional. A request ID to identify requests. Specify a unique request ID
4378 /// so that if you must retry your request, the server will know to ignore
4379 /// the request if it has already been completed. The server guarantees that a
4380 /// request doesn't result in creation of duplicate commitments for at least 60
4381 /// minutes.
4382 ///
4383 /// For example, consider a situation where you make an initial request and the
4384 /// request times out. If you make the request again with the same request
4385 /// ID, the server can check if original operation with the same request ID
4386 /// was received, and if so, will ignore the second request. This prevents
4387 /// clients from accidentally creating duplicate commitments.
4388 ///
4389 /// The request ID must be a valid UUID with the exception that zero UUID is
4390 /// not supported (00000000-0000-0000-0000-000000000000).
4391 pub request_id: std::string::String,
4392
4393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4394}
4395
4396impl ResetNsxCredentialsRequest {
4397 pub fn new() -> Self {
4398 std::default::Default::default()
4399 }
4400
4401 /// Sets the value of [private_cloud][crate::model::ResetNsxCredentialsRequest::private_cloud].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4406 /// let x = ResetNsxCredentialsRequest::new().set_private_cloud("example");
4407 /// ```
4408 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4409 self.private_cloud = v.into();
4410 self
4411 }
4412
4413 /// Sets the value of [request_id][crate::model::ResetNsxCredentialsRequest::request_id].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4418 /// let x = ResetNsxCredentialsRequest::new().set_request_id("example");
4419 /// ```
4420 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421 self.request_id = v.into();
4422 self
4423 }
4424}
4425
4426impl wkt::message::Message for ResetNsxCredentialsRequest {
4427 fn typename() -> &'static str {
4428 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"
4429 }
4430}
4431
4432/// Request message for
4433/// [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]
4434///
4435/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]: crate::client::VmwareEngine::reset_vcenter_credentials
4436#[derive(Clone, Default, PartialEq)]
4437#[non_exhaustive]
4438pub struct ResetVcenterCredentialsRequest {
4439 /// Required. The resource name of the private cloud
4440 /// to reset credentials for.
4441 /// Resource names are schemeless URIs that follow the conventions in
4442 /// <https://cloud.google.com/apis/design/resource_names>.
4443 /// For example:
4444 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4445 pub private_cloud: std::string::String,
4446
4447 /// Optional. A request ID to identify requests. Specify a unique request ID
4448 /// so that if you must retry your request, the server will know to ignore
4449 /// the request if it has already been completed. The server guarantees that a
4450 /// request doesn't result in creation of duplicate commitments for at least 60
4451 /// minutes.
4452 ///
4453 /// For example, consider a situation where you make an initial request and the
4454 /// request times out. If you make the request again with the same request
4455 /// ID, the server can check if original operation with the same request ID
4456 /// was received, and if so, will ignore the second request. This prevents
4457 /// clients from accidentally creating duplicate commitments.
4458 ///
4459 /// The request ID must be a valid UUID with the exception that zero UUID is
4460 /// not supported (00000000-0000-0000-0000-000000000000).
4461 pub request_id: std::string::String,
4462
4463 /// Optional. The username of the user to be to reset the credentials.
4464 /// The default value of this field is CloudOwner@gve.local.
4465 /// The provided value should be one of the following:
4466 /// solution-user-01@gve.local,
4467 /// solution-user-02@gve.local,
4468 /// solution-user-03@gve.local,
4469 /// solution-user-04@gve.local,
4470 /// solution-user-05@gve.local,
4471 /// zertoadmin@gve.local.
4472 pub username: std::string::String,
4473
4474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4475}
4476
4477impl ResetVcenterCredentialsRequest {
4478 pub fn new() -> Self {
4479 std::default::Default::default()
4480 }
4481
4482 /// Sets the value of [private_cloud][crate::model::ResetVcenterCredentialsRequest::private_cloud].
4483 ///
4484 /// # Example
4485 /// ```ignore,no_run
4486 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4487 /// let x = ResetVcenterCredentialsRequest::new().set_private_cloud("example");
4488 /// ```
4489 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4490 self.private_cloud = v.into();
4491 self
4492 }
4493
4494 /// Sets the value of [request_id][crate::model::ResetVcenterCredentialsRequest::request_id].
4495 ///
4496 /// # Example
4497 /// ```ignore,no_run
4498 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4499 /// let x = ResetVcenterCredentialsRequest::new().set_request_id("example");
4500 /// ```
4501 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.request_id = v.into();
4503 self
4504 }
4505
4506 /// Sets the value of [username][crate::model::ResetVcenterCredentialsRequest::username].
4507 ///
4508 /// # Example
4509 /// ```ignore,no_run
4510 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4511 /// let x = ResetVcenterCredentialsRequest::new().set_username("example");
4512 /// ```
4513 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4514 self.username = v.into();
4515 self
4516 }
4517}
4518
4519impl wkt::message::Message for ResetVcenterCredentialsRequest {
4520 fn typename() -> &'static str {
4521 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"
4522 }
4523}
4524
4525/// Response message for
4526/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4527///
4528/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4529#[derive(Clone, Default, PartialEq)]
4530#[non_exhaustive]
4531pub struct ListHcxActivationKeysResponse {
4532 /// List of HCX activation keys.
4533 pub hcx_activation_keys: std::vec::Vec<crate::model::HcxActivationKey>,
4534
4535 /// A token, which can be sent as `page_token` to retrieve the next page.
4536 /// If this field is omitted, there are no subsequent pages.
4537 pub next_page_token: std::string::String,
4538
4539 /// Locations that could not be reached when making an aggregated query using
4540 /// wildcards.
4541 pub unreachable: std::vec::Vec<std::string::String>,
4542
4543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4544}
4545
4546impl ListHcxActivationKeysResponse {
4547 pub fn new() -> Self {
4548 std::default::Default::default()
4549 }
4550
4551 /// Sets the value of [hcx_activation_keys][crate::model::ListHcxActivationKeysResponse::hcx_activation_keys].
4552 ///
4553 /// # Example
4554 /// ```ignore,no_run
4555 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4556 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4557 /// let x = ListHcxActivationKeysResponse::new()
4558 /// .set_hcx_activation_keys([
4559 /// HcxActivationKey::default()/* use setters */,
4560 /// HcxActivationKey::default()/* use (different) setters */,
4561 /// ]);
4562 /// ```
4563 pub fn set_hcx_activation_keys<T, V>(mut self, v: T) -> Self
4564 where
4565 T: std::iter::IntoIterator<Item = V>,
4566 V: std::convert::Into<crate::model::HcxActivationKey>,
4567 {
4568 use std::iter::Iterator;
4569 self.hcx_activation_keys = v.into_iter().map(|i| i.into()).collect();
4570 self
4571 }
4572
4573 /// Sets the value of [next_page_token][crate::model::ListHcxActivationKeysResponse::next_page_token].
4574 ///
4575 /// # Example
4576 /// ```ignore,no_run
4577 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4578 /// let x = ListHcxActivationKeysResponse::new().set_next_page_token("example");
4579 /// ```
4580 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4581 self.next_page_token = v.into();
4582 self
4583 }
4584
4585 /// Sets the value of [unreachable][crate::model::ListHcxActivationKeysResponse::unreachable].
4586 ///
4587 /// # Example
4588 /// ```ignore,no_run
4589 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4590 /// let x = ListHcxActivationKeysResponse::new().set_unreachable(["a", "b", "c"]);
4591 /// ```
4592 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4593 where
4594 T: std::iter::IntoIterator<Item = V>,
4595 V: std::convert::Into<std::string::String>,
4596 {
4597 use std::iter::Iterator;
4598 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4599 self
4600 }
4601}
4602
4603impl wkt::message::Message for ListHcxActivationKeysResponse {
4604 fn typename() -> &'static str {
4605 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"
4606 }
4607}
4608
4609#[doc(hidden)]
4610impl gax::paginator::internal::PageableResponse for ListHcxActivationKeysResponse {
4611 type PageItem = crate::model::HcxActivationKey;
4612
4613 fn items(self) -> std::vec::Vec<Self::PageItem> {
4614 self.hcx_activation_keys
4615 }
4616
4617 fn next_page_token(&self) -> std::string::String {
4618 use std::clone::Clone;
4619 self.next_page_token.clone()
4620 }
4621}
4622
4623/// Request message for
4624/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4625///
4626/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4627#[derive(Clone, Default, PartialEq)]
4628#[non_exhaustive]
4629pub struct ListHcxActivationKeysRequest {
4630 /// Required. The resource name of the private cloud
4631 /// to be queried for HCX activation keys.
4632 /// Resource names are schemeless URIs that follow the conventions in
4633 /// <https://cloud.google.com/apis/design/resource_names>.
4634 /// For example:
4635 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4636 pub parent: std::string::String,
4637
4638 /// The maximum number of HCX activation keys to return in one page.
4639 /// The service may return fewer than this value.
4640 /// The maximum value is coerced to 1000.
4641 /// The default value of this field is 500.
4642 pub page_size: i32,
4643
4644 /// A page token, received from a previous `ListHcxActivationKeys` call.
4645 /// Provide this to retrieve the subsequent page.
4646 ///
4647 /// When paginating, all other parameters provided to
4648 /// `ListHcxActivationKeys` must match the call that provided the page
4649 /// token.
4650 pub page_token: std::string::String,
4651
4652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4653}
4654
4655impl ListHcxActivationKeysRequest {
4656 pub fn new() -> Self {
4657 std::default::Default::default()
4658 }
4659
4660 /// Sets the value of [parent][crate::model::ListHcxActivationKeysRequest::parent].
4661 ///
4662 /// # Example
4663 /// ```ignore,no_run
4664 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4665 /// let x = ListHcxActivationKeysRequest::new().set_parent("example");
4666 /// ```
4667 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4668 self.parent = v.into();
4669 self
4670 }
4671
4672 /// Sets the value of [page_size][crate::model::ListHcxActivationKeysRequest::page_size].
4673 ///
4674 /// # Example
4675 /// ```ignore,no_run
4676 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4677 /// let x = ListHcxActivationKeysRequest::new().set_page_size(42);
4678 /// ```
4679 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4680 self.page_size = v.into();
4681 self
4682 }
4683
4684 /// Sets the value of [page_token][crate::model::ListHcxActivationKeysRequest::page_token].
4685 ///
4686 /// # Example
4687 /// ```ignore,no_run
4688 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4689 /// let x = ListHcxActivationKeysRequest::new().set_page_token("example");
4690 /// ```
4691 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4692 self.page_token = v.into();
4693 self
4694 }
4695}
4696
4697impl wkt::message::Message for ListHcxActivationKeysRequest {
4698 fn typename() -> &'static str {
4699 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"
4700 }
4701}
4702
4703/// Request message for [VmwareEngine.GetHcxActivationKeys][]
4704#[derive(Clone, Default, PartialEq)]
4705#[non_exhaustive]
4706pub struct GetHcxActivationKeyRequest {
4707 /// Required. The resource name of the HCX activation key to retrieve.
4708 /// Resource names are schemeless URIs that follow the conventions in
4709 /// <https://cloud.google.com/apis/design/resource_names>.
4710 /// For example:
4711 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
4712 pub name: std::string::String,
4713
4714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4715}
4716
4717impl GetHcxActivationKeyRequest {
4718 pub fn new() -> Self {
4719 std::default::Default::default()
4720 }
4721
4722 /// Sets the value of [name][crate::model::GetHcxActivationKeyRequest::name].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_vmwareengine_v1::model::GetHcxActivationKeyRequest;
4727 /// let x = GetHcxActivationKeyRequest::new().set_name("example");
4728 /// ```
4729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.name = v.into();
4731 self
4732 }
4733}
4734
4735impl wkt::message::Message for GetHcxActivationKeyRequest {
4736 fn typename() -> &'static str {
4737 "type.googleapis.com/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"
4738 }
4739}
4740
4741/// Request message for
4742/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
4743///
4744/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
4745#[derive(Clone, Default, PartialEq)]
4746#[non_exhaustive]
4747pub struct CreateHcxActivationKeyRequest {
4748 /// Required. The resource name of the private cloud to create the key for.
4749 /// Resource names are schemeless URIs that follow the conventions in
4750 /// <https://cloud.google.com/apis/design/resource_names>.
4751 /// For example:
4752 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4753 pub parent: std::string::String,
4754
4755 /// Required. The initial description of a new HCX activation key. When
4756 /// creating a new key, this field must be an empty object.
4757 pub hcx_activation_key: std::option::Option<crate::model::HcxActivationKey>,
4758
4759 /// Required. The user-provided identifier of the `HcxActivationKey` to be
4760 /// created. This identifier must be unique among `HcxActivationKey` resources
4761 /// within the parent and becomes the final token in the name URI.
4762 /// The identifier must meet the following requirements:
4763 ///
4764 /// * Only contains 1-63 alphanumeric characters and hyphens
4765 /// * Begins with an alphabetical character
4766 /// * Ends with a non-hyphen character
4767 /// * Not formatted as a UUID
4768 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
4769 /// (section 3.5)
4770 pub hcx_activation_key_id: std::string::String,
4771
4772 /// A request ID to identify requests. Specify a unique request ID
4773 /// so that if you must retry your request, the server will know to ignore
4774 /// the request if it has already been completed. The server guarantees that a
4775 /// request doesn't result in creation of duplicate commitments for at least 60
4776 /// minutes.
4777 ///
4778 /// For example, consider a situation where you make an initial request and the
4779 /// request times out. If you make the request again with the same request ID,
4780 /// the server can check if original operation with the same request ID was
4781 /// received, and if so, will ignore the second request. This prevents clients
4782 /// from accidentally creating duplicate commitments.
4783 ///
4784 /// The request ID must be a valid UUID with the exception that zero UUID is
4785 /// not supported (00000000-0000-0000-0000-000000000000).
4786 pub request_id: std::string::String,
4787
4788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4789}
4790
4791impl CreateHcxActivationKeyRequest {
4792 pub fn new() -> Self {
4793 std::default::Default::default()
4794 }
4795
4796 /// Sets the value of [parent][crate::model::CreateHcxActivationKeyRequest::parent].
4797 ///
4798 /// # Example
4799 /// ```ignore,no_run
4800 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4801 /// let x = CreateHcxActivationKeyRequest::new().set_parent("example");
4802 /// ```
4803 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4804 self.parent = v.into();
4805 self
4806 }
4807
4808 /// Sets the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4809 ///
4810 /// # Example
4811 /// ```ignore,no_run
4812 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4813 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4814 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key(HcxActivationKey::default()/* use setters */);
4815 /// ```
4816 pub fn set_hcx_activation_key<T>(mut self, v: T) -> Self
4817 where
4818 T: std::convert::Into<crate::model::HcxActivationKey>,
4819 {
4820 self.hcx_activation_key = std::option::Option::Some(v.into());
4821 self
4822 }
4823
4824 /// Sets or clears the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4829 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4830 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(Some(HcxActivationKey::default()/* use setters */));
4831 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(None::<HcxActivationKey>);
4832 /// ```
4833 pub fn set_or_clear_hcx_activation_key<T>(mut self, v: std::option::Option<T>) -> Self
4834 where
4835 T: std::convert::Into<crate::model::HcxActivationKey>,
4836 {
4837 self.hcx_activation_key = v.map(|x| x.into());
4838 self
4839 }
4840
4841 /// Sets the value of [hcx_activation_key_id][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key_id].
4842 ///
4843 /// # Example
4844 /// ```ignore,no_run
4845 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4846 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key_id("example");
4847 /// ```
4848 pub fn set_hcx_activation_key_id<T: std::convert::Into<std::string::String>>(
4849 mut self,
4850 v: T,
4851 ) -> Self {
4852 self.hcx_activation_key_id = v.into();
4853 self
4854 }
4855
4856 /// Sets the value of [request_id][crate::model::CreateHcxActivationKeyRequest::request_id].
4857 ///
4858 /// # Example
4859 /// ```ignore,no_run
4860 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4861 /// let x = CreateHcxActivationKeyRequest::new().set_request_id("example");
4862 /// ```
4863 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4864 self.request_id = v.into();
4865 self
4866 }
4867}
4868
4869impl wkt::message::Message for CreateHcxActivationKeyRequest {
4870 fn typename() -> &'static str {
4871 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"
4872 }
4873}
4874
4875/// Request message for
4876/// [VmwareEngine.GetDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]
4877///
4878/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]: crate::client::VmwareEngine::get_dns_forwarding
4879#[derive(Clone, Default, PartialEq)]
4880#[non_exhaustive]
4881pub struct GetDnsForwardingRequest {
4882 /// Required. The resource name of a `DnsForwarding` to retrieve.
4883 /// Resource names are schemeless URIs that follow the conventions in
4884 /// <https://cloud.google.com/apis/design/resource_names>.
4885 /// For example:
4886 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
4887 pub name: std::string::String,
4888
4889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4890}
4891
4892impl GetDnsForwardingRequest {
4893 pub fn new() -> Self {
4894 std::default::Default::default()
4895 }
4896
4897 /// Sets the value of [name][crate::model::GetDnsForwardingRequest::name].
4898 ///
4899 /// # Example
4900 /// ```ignore,no_run
4901 /// # use google_cloud_vmwareengine_v1::model::GetDnsForwardingRequest;
4902 /// let x = GetDnsForwardingRequest::new().set_name("example");
4903 /// ```
4904 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4905 self.name = v.into();
4906 self
4907 }
4908}
4909
4910impl wkt::message::Message for GetDnsForwardingRequest {
4911 fn typename() -> &'static str {
4912 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsForwardingRequest"
4913 }
4914}
4915
4916/// Request message for
4917/// [VmwareEngine.UpdateDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]
4918///
4919/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]: crate::client::VmwareEngine::update_dns_forwarding
4920#[derive(Clone, Default, PartialEq)]
4921#[non_exhaustive]
4922pub struct UpdateDnsForwardingRequest {
4923 /// Required. DnsForwarding config details.
4924 pub dns_forwarding: std::option::Option<crate::model::DnsForwarding>,
4925
4926 /// Required. Field mask is used to specify the fields to be overwritten in the
4927 /// `DnsForwarding` resource by the update.
4928 /// The fields specified in the `update_mask` are relative to the resource, not
4929 /// the full request. A field will be overwritten if it is in the mask. If the
4930 /// user does not provide a mask then all fields will be overwritten.
4931 pub update_mask: std::option::Option<wkt::FieldMask>,
4932
4933 /// Optional. A request ID to identify requests. Specify a unique request ID
4934 /// so that if you must retry your request, the server will know to ignore
4935 /// the request if it has already been completed. The server guarantees that a
4936 /// request doesn't result in creation of duplicate commitments for at least 60
4937 /// minutes.
4938 ///
4939 /// For example, consider a situation where you make an initial request and the
4940 /// request times out. If you make the request again with the same request ID,
4941 /// the server can check if original operation with the same request ID was
4942 /// received, and if so, will ignore the second request. This prevents clients
4943 /// from accidentally creating duplicate commitments.
4944 ///
4945 /// The request ID must be a valid UUID with the exception that zero UUID is
4946 /// not supported (00000000-0000-0000-0000-000000000000).
4947 pub request_id: std::string::String,
4948
4949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4950}
4951
4952impl UpdateDnsForwardingRequest {
4953 pub fn new() -> Self {
4954 std::default::Default::default()
4955 }
4956
4957 /// Sets the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4958 ///
4959 /// # Example
4960 /// ```ignore,no_run
4961 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4962 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4963 /// let x = UpdateDnsForwardingRequest::new().set_dns_forwarding(DnsForwarding::default()/* use setters */);
4964 /// ```
4965 pub fn set_dns_forwarding<T>(mut self, v: T) -> Self
4966 where
4967 T: std::convert::Into<crate::model::DnsForwarding>,
4968 {
4969 self.dns_forwarding = std::option::Option::Some(v.into());
4970 self
4971 }
4972
4973 /// Sets or clears the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4978 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4979 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(Some(DnsForwarding::default()/* use setters */));
4980 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(None::<DnsForwarding>);
4981 /// ```
4982 pub fn set_or_clear_dns_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
4983 where
4984 T: std::convert::Into<crate::model::DnsForwarding>,
4985 {
4986 self.dns_forwarding = v.map(|x| x.into());
4987 self
4988 }
4989
4990 /// Sets the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
4991 ///
4992 /// # Example
4993 /// ```ignore,no_run
4994 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4995 /// use wkt::FieldMask;
4996 /// let x = UpdateDnsForwardingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4997 /// ```
4998 pub fn set_update_mask<T>(mut self, v: T) -> Self
4999 where
5000 T: std::convert::Into<wkt::FieldMask>,
5001 {
5002 self.update_mask = std::option::Option::Some(v.into());
5003 self
5004 }
5005
5006 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
5007 ///
5008 /// # Example
5009 /// ```ignore,no_run
5010 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5011 /// use wkt::FieldMask;
5012 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5013 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5014 /// ```
5015 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5016 where
5017 T: std::convert::Into<wkt::FieldMask>,
5018 {
5019 self.update_mask = v.map(|x| x.into());
5020 self
5021 }
5022
5023 /// Sets the value of [request_id][crate::model::UpdateDnsForwardingRequest::request_id].
5024 ///
5025 /// # Example
5026 /// ```ignore,no_run
5027 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5028 /// let x = UpdateDnsForwardingRequest::new().set_request_id("example");
5029 /// ```
5030 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5031 self.request_id = v.into();
5032 self
5033 }
5034}
5035
5036impl wkt::message::Message for UpdateDnsForwardingRequest {
5037 fn typename() -> &'static str {
5038 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest"
5039 }
5040}
5041
5042/// Request message for
5043/// [VmwareEngine.CreateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]
5044///
5045/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]: crate::client::VmwareEngine::create_network_peering
5046#[derive(Clone, Default, PartialEq)]
5047#[non_exhaustive]
5048pub struct CreateNetworkPeeringRequest {
5049 /// Required. The resource name of the location to create the new network
5050 /// peering in. This value is always `global`, because `NetworkPeering` is a
5051 /// global resource. Resource names are schemeless URIs that follow the
5052 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5053 /// example: `projects/my-project/locations/global`
5054 pub parent: std::string::String,
5055
5056 /// Required. The user-provided identifier of the new `NetworkPeering`.
5057 /// This identifier must be unique among `NetworkPeering` resources within the
5058 /// parent and becomes the final token in the name URI.
5059 /// The identifier must meet the following requirements:
5060 ///
5061 /// * Only contains 1-63 alphanumeric characters and hyphens
5062 /// * Begins with an alphabetical character
5063 /// * Ends with a non-hyphen character
5064 /// * Not formatted as a UUID
5065 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
5066 /// (section 3.5)
5067 pub network_peering_id: std::string::String,
5068
5069 /// Required. The initial description of the new network peering.
5070 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5071
5072 /// Optional. A request ID to identify requests. Specify a unique request ID
5073 /// so that if you must retry your request, the server will know to ignore
5074 /// the request if it has already been completed. The server guarantees that a
5075 /// request doesn't result in creation of duplicate commitments for at least 60
5076 /// minutes.
5077 ///
5078 /// For example, consider a situation where you make an initial request and the
5079 /// request times out. If you make the request again with the same request
5080 /// ID, the server can check if original operation with the same request ID
5081 /// was received, and if so, will ignore the second request. This prevents
5082 /// clients from accidentally creating duplicate commitments.
5083 ///
5084 /// The request ID must be a valid UUID with the exception that zero UUID is
5085 /// not supported (00000000-0000-0000-0000-000000000000).
5086 pub request_id: std::string::String,
5087
5088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5089}
5090
5091impl CreateNetworkPeeringRequest {
5092 pub fn new() -> Self {
5093 std::default::Default::default()
5094 }
5095
5096 /// Sets the value of [parent][crate::model::CreateNetworkPeeringRequest::parent].
5097 ///
5098 /// # Example
5099 /// ```ignore,no_run
5100 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5101 /// let x = CreateNetworkPeeringRequest::new().set_parent("example");
5102 /// ```
5103 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5104 self.parent = v.into();
5105 self
5106 }
5107
5108 /// Sets the value of [network_peering_id][crate::model::CreateNetworkPeeringRequest::network_peering_id].
5109 ///
5110 /// # Example
5111 /// ```ignore,no_run
5112 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5113 /// let x = CreateNetworkPeeringRequest::new().set_network_peering_id("example");
5114 /// ```
5115 pub fn set_network_peering_id<T: std::convert::Into<std::string::String>>(
5116 mut self,
5117 v: T,
5118 ) -> Self {
5119 self.network_peering_id = v.into();
5120 self
5121 }
5122
5123 /// Sets the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5128 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5129 /// let x = CreateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5130 /// ```
5131 pub fn set_network_peering<T>(mut self, v: T) -> Self
5132 where
5133 T: std::convert::Into<crate::model::NetworkPeering>,
5134 {
5135 self.network_peering = std::option::Option::Some(v.into());
5136 self
5137 }
5138
5139 /// Sets or clears the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5140 ///
5141 /// # Example
5142 /// ```ignore,no_run
5143 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5144 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5145 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5146 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5147 /// ```
5148 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5149 where
5150 T: std::convert::Into<crate::model::NetworkPeering>,
5151 {
5152 self.network_peering = v.map(|x| x.into());
5153 self
5154 }
5155
5156 /// Sets the value of [request_id][crate::model::CreateNetworkPeeringRequest::request_id].
5157 ///
5158 /// # Example
5159 /// ```ignore,no_run
5160 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5161 /// let x = CreateNetworkPeeringRequest::new().set_request_id("example");
5162 /// ```
5163 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5164 self.request_id = v.into();
5165 self
5166 }
5167}
5168
5169impl wkt::message::Message for CreateNetworkPeeringRequest {
5170 fn typename() -> &'static str {
5171 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest"
5172 }
5173}
5174
5175/// Request message for
5176/// [VmwareEngine.DeleteNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]
5177///
5178/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]: crate::client::VmwareEngine::delete_network_peering
5179#[derive(Clone, Default, PartialEq)]
5180#[non_exhaustive]
5181pub struct DeleteNetworkPeeringRequest {
5182 /// Required. The resource name of the network peering to be deleted.
5183 /// Resource names are schemeless URIs that follow the conventions in
5184 /// <https://cloud.google.com/apis/design/resource_names>.
5185 /// For example:
5186 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5187 pub name: std::string::String,
5188
5189 /// Optional. A request ID to identify requests. Specify a unique request ID
5190 /// so that if you must retry your request, the server will know to ignore
5191 /// the request if it has already been completed. The server guarantees that a
5192 /// request doesn't result in creation of duplicate commitments for at least 60
5193 /// minutes.
5194 ///
5195 /// For example, consider a situation where you make an initial request and the
5196 /// request times out. If you make the request again with the same request
5197 /// ID, the server can check if original operation with the same request ID
5198 /// was received, and if so, will ignore the second request. This prevents
5199 /// clients from accidentally creating duplicate commitments.
5200 ///
5201 /// The request ID must be a valid UUID with the exception that zero UUID is
5202 /// not supported (00000000-0000-0000-0000-000000000000).
5203 pub request_id: std::string::String,
5204
5205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5206}
5207
5208impl DeleteNetworkPeeringRequest {
5209 pub fn new() -> Self {
5210 std::default::Default::default()
5211 }
5212
5213 /// Sets the value of [name][crate::model::DeleteNetworkPeeringRequest::name].
5214 ///
5215 /// # Example
5216 /// ```ignore,no_run
5217 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5218 /// let x = DeleteNetworkPeeringRequest::new().set_name("example");
5219 /// ```
5220 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5221 self.name = v.into();
5222 self
5223 }
5224
5225 /// Sets the value of [request_id][crate::model::DeleteNetworkPeeringRequest::request_id].
5226 ///
5227 /// # Example
5228 /// ```ignore,no_run
5229 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5230 /// let x = DeleteNetworkPeeringRequest::new().set_request_id("example");
5231 /// ```
5232 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5233 self.request_id = v.into();
5234 self
5235 }
5236}
5237
5238impl wkt::message::Message for DeleteNetworkPeeringRequest {
5239 fn typename() -> &'static str {
5240 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest"
5241 }
5242}
5243
5244/// Request message for
5245/// [VmwareEngine.GetNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]
5246///
5247/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]: crate::client::VmwareEngine::get_network_peering
5248#[derive(Clone, Default, PartialEq)]
5249#[non_exhaustive]
5250pub struct GetNetworkPeeringRequest {
5251 /// Required. The resource name of the network peering to retrieve.
5252 /// Resource names are schemeless URIs that follow the conventions in
5253 /// <https://cloud.google.com/apis/design/resource_names>.
5254 /// For example:
5255 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5256 pub name: std::string::String,
5257
5258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5259}
5260
5261impl GetNetworkPeeringRequest {
5262 pub fn new() -> Self {
5263 std::default::Default::default()
5264 }
5265
5266 /// Sets the value of [name][crate::model::GetNetworkPeeringRequest::name].
5267 ///
5268 /// # Example
5269 /// ```ignore,no_run
5270 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPeeringRequest;
5271 /// let x = GetNetworkPeeringRequest::new().set_name("example");
5272 /// ```
5273 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5274 self.name = v.into();
5275 self
5276 }
5277}
5278
5279impl wkt::message::Message for GetNetworkPeeringRequest {
5280 fn typename() -> &'static str {
5281 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPeeringRequest"
5282 }
5283}
5284
5285/// Request message for
5286/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5287///
5288/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5289#[derive(Clone, Default, PartialEq)]
5290#[non_exhaustive]
5291pub struct ListNetworkPeeringsRequest {
5292 /// Required. The resource name of the location (global) to query for
5293 /// network peerings. Resource names are schemeless URIs that follow the
5294 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5295 /// example: `projects/my-project/locations/global`
5296 pub parent: std::string::String,
5297
5298 /// The maximum number of network peerings to return in one page.
5299 /// The maximum value is coerced to 1000.
5300 /// The default value of this field is 500.
5301 pub page_size: i32,
5302
5303 /// A page token, received from a previous `ListNetworkPeerings` call.
5304 /// Provide this to retrieve the subsequent page.
5305 ///
5306 /// When paginating, all other parameters provided to
5307 /// `ListNetworkPeerings` must match the call that provided the page
5308 /// token.
5309 pub page_token: std::string::String,
5310
5311 /// A filter expression that matches resources returned in the response.
5312 /// The expression must specify the field name, a comparison
5313 /// operator, and the value that you want to use for filtering. The value
5314 /// must be a string, a number, or a boolean. The comparison operator
5315 /// must be `=`, `!=`, `>`, or `<`.
5316 ///
5317 /// For example, if you are filtering a list of network peerings, you can
5318 /// exclude the ones named `example-peering` by specifying
5319 /// `name != "example-peering"`.
5320 ///
5321 /// To filter on multiple expressions, provide each separate expression within
5322 /// parentheses. For example:
5323 ///
5324 /// ```norust
5325 /// (name = "example-peering")
5326 /// (createTime > "2021-04-12T08:15:10.40Z")
5327 /// ```
5328 ///
5329 /// By default, each expression is an `AND` expression. However, you
5330 /// can include `AND` and `OR` expressions explicitly.
5331 /// For example:
5332 ///
5333 /// ```norust
5334 /// (name = "example-peering-1") AND
5335 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5336 /// (name = "example-peering-2")
5337 /// ```
5338 pub filter: std::string::String,
5339
5340 /// Sorts list results by a certain order. By default, returned results
5341 /// are ordered by `name` in ascending order.
5342 /// You can also sort results in descending order based on the `name` value
5343 /// using `orderBy="name desc"`.
5344 /// Currently, only ordering by `name` is supported.
5345 pub order_by: std::string::String,
5346
5347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5348}
5349
5350impl ListNetworkPeeringsRequest {
5351 pub fn new() -> Self {
5352 std::default::Default::default()
5353 }
5354
5355 /// Sets the value of [parent][crate::model::ListNetworkPeeringsRequest::parent].
5356 ///
5357 /// # Example
5358 /// ```ignore,no_run
5359 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5360 /// let x = ListNetworkPeeringsRequest::new().set_parent("example");
5361 /// ```
5362 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363 self.parent = v.into();
5364 self
5365 }
5366
5367 /// Sets the value of [page_size][crate::model::ListNetworkPeeringsRequest::page_size].
5368 ///
5369 /// # Example
5370 /// ```ignore,no_run
5371 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5372 /// let x = ListNetworkPeeringsRequest::new().set_page_size(42);
5373 /// ```
5374 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5375 self.page_size = v.into();
5376 self
5377 }
5378
5379 /// Sets the value of [page_token][crate::model::ListNetworkPeeringsRequest::page_token].
5380 ///
5381 /// # Example
5382 /// ```ignore,no_run
5383 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5384 /// let x = ListNetworkPeeringsRequest::new().set_page_token("example");
5385 /// ```
5386 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5387 self.page_token = v.into();
5388 self
5389 }
5390
5391 /// Sets the value of [filter][crate::model::ListNetworkPeeringsRequest::filter].
5392 ///
5393 /// # Example
5394 /// ```ignore,no_run
5395 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5396 /// let x = ListNetworkPeeringsRequest::new().set_filter("example");
5397 /// ```
5398 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5399 self.filter = v.into();
5400 self
5401 }
5402
5403 /// Sets the value of [order_by][crate::model::ListNetworkPeeringsRequest::order_by].
5404 ///
5405 /// # Example
5406 /// ```ignore,no_run
5407 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5408 /// let x = ListNetworkPeeringsRequest::new().set_order_by("example");
5409 /// ```
5410 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5411 self.order_by = v.into();
5412 self
5413 }
5414}
5415
5416impl wkt::message::Message for ListNetworkPeeringsRequest {
5417 fn typename() -> &'static str {
5418 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest"
5419 }
5420}
5421
5422/// Request message for
5423/// [VmwareEngine.UpdateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]
5424///
5425/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]: crate::client::VmwareEngine::update_network_peering
5426#[derive(Clone, Default, PartialEq)]
5427#[non_exhaustive]
5428pub struct UpdateNetworkPeeringRequest {
5429 /// Required. Network peering description.
5430 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5431
5432 /// Required. Field mask is used to specify the fields to be overwritten in the
5433 /// `NetworkPeering` resource by the update.
5434 /// The fields specified in the `update_mask` are relative to the resource, not
5435 /// the full request. A field will be overwritten if it is in the mask. If the
5436 /// user does not provide a mask then all fields will be overwritten.
5437 pub update_mask: std::option::Option<wkt::FieldMask>,
5438
5439 /// Optional. A request ID to identify requests. Specify a unique request ID
5440 /// so that if you must retry your request, the server will know to ignore
5441 /// the request if it has already been completed. The server guarantees that a
5442 /// request doesn't result in creation of duplicate commitments for at least 60
5443 /// minutes.
5444 ///
5445 /// For example, consider a situation where you make an initial request and the
5446 /// request times out. If you make the request again with the same request
5447 /// ID, the server can check if original operation with the same request ID
5448 /// was received, and if so, will ignore the second request. This prevents
5449 /// clients from accidentally creating duplicate commitments.
5450 ///
5451 /// The request ID must be a valid UUID with the exception that zero UUID is
5452 /// not supported (00000000-0000-0000-0000-000000000000).
5453 pub request_id: std::string::String,
5454
5455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5456}
5457
5458impl UpdateNetworkPeeringRequest {
5459 pub fn new() -> Self {
5460 std::default::Default::default()
5461 }
5462
5463 /// Sets the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5464 ///
5465 /// # Example
5466 /// ```ignore,no_run
5467 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5468 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5469 /// let x = UpdateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5470 /// ```
5471 pub fn set_network_peering<T>(mut self, v: T) -> Self
5472 where
5473 T: std::convert::Into<crate::model::NetworkPeering>,
5474 {
5475 self.network_peering = std::option::Option::Some(v.into());
5476 self
5477 }
5478
5479 /// Sets or clears the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5480 ///
5481 /// # Example
5482 /// ```ignore,no_run
5483 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5484 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5485 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5486 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5487 /// ```
5488 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5489 where
5490 T: std::convert::Into<crate::model::NetworkPeering>,
5491 {
5492 self.network_peering = v.map(|x| x.into());
5493 self
5494 }
5495
5496 /// Sets the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5497 ///
5498 /// # Example
5499 /// ```ignore,no_run
5500 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5501 /// use wkt::FieldMask;
5502 /// let x = UpdateNetworkPeeringRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5503 /// ```
5504 pub fn set_update_mask<T>(mut self, v: T) -> Self
5505 where
5506 T: std::convert::Into<wkt::FieldMask>,
5507 {
5508 self.update_mask = std::option::Option::Some(v.into());
5509 self
5510 }
5511
5512 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5513 ///
5514 /// # Example
5515 /// ```ignore,no_run
5516 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5517 /// use wkt::FieldMask;
5518 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5519 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5520 /// ```
5521 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5522 where
5523 T: std::convert::Into<wkt::FieldMask>,
5524 {
5525 self.update_mask = v.map(|x| x.into());
5526 self
5527 }
5528
5529 /// Sets the value of [request_id][crate::model::UpdateNetworkPeeringRequest::request_id].
5530 ///
5531 /// # Example
5532 /// ```ignore,no_run
5533 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5534 /// let x = UpdateNetworkPeeringRequest::new().set_request_id("example");
5535 /// ```
5536 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.request_id = v.into();
5538 self
5539 }
5540}
5541
5542impl wkt::message::Message for UpdateNetworkPeeringRequest {
5543 fn typename() -> &'static str {
5544 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest"
5545 }
5546}
5547
5548/// Response message for
5549/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5550///
5551/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5552#[derive(Clone, Default, PartialEq)]
5553#[non_exhaustive]
5554pub struct ListNetworkPeeringsResponse {
5555 /// A list of network peerings.
5556 pub network_peerings: std::vec::Vec<crate::model::NetworkPeering>,
5557
5558 /// A token, which can be sent as `page_token` to retrieve the next page.
5559 /// If this field is omitted, there are no subsequent pages.
5560 pub next_page_token: std::string::String,
5561
5562 /// Unreachable resources.
5563 pub unreachable: std::vec::Vec<std::string::String>,
5564
5565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5566}
5567
5568impl ListNetworkPeeringsResponse {
5569 pub fn new() -> Self {
5570 std::default::Default::default()
5571 }
5572
5573 /// Sets the value of [network_peerings][crate::model::ListNetworkPeeringsResponse::network_peerings].
5574 ///
5575 /// # Example
5576 /// ```ignore,no_run
5577 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5578 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5579 /// let x = ListNetworkPeeringsResponse::new()
5580 /// .set_network_peerings([
5581 /// NetworkPeering::default()/* use setters */,
5582 /// NetworkPeering::default()/* use (different) setters */,
5583 /// ]);
5584 /// ```
5585 pub fn set_network_peerings<T, V>(mut self, v: T) -> Self
5586 where
5587 T: std::iter::IntoIterator<Item = V>,
5588 V: std::convert::Into<crate::model::NetworkPeering>,
5589 {
5590 use std::iter::Iterator;
5591 self.network_peerings = v.into_iter().map(|i| i.into()).collect();
5592 self
5593 }
5594
5595 /// Sets the value of [next_page_token][crate::model::ListNetworkPeeringsResponse::next_page_token].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5600 /// let x = ListNetworkPeeringsResponse::new().set_next_page_token("example");
5601 /// ```
5602 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.next_page_token = v.into();
5604 self
5605 }
5606
5607 /// Sets the value of [unreachable][crate::model::ListNetworkPeeringsResponse::unreachable].
5608 ///
5609 /// # Example
5610 /// ```ignore,no_run
5611 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5612 /// let x = ListNetworkPeeringsResponse::new().set_unreachable(["a", "b", "c"]);
5613 /// ```
5614 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5615 where
5616 T: std::iter::IntoIterator<Item = V>,
5617 V: std::convert::Into<std::string::String>,
5618 {
5619 use std::iter::Iterator;
5620 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5621 self
5622 }
5623}
5624
5625impl wkt::message::Message for ListNetworkPeeringsResponse {
5626 fn typename() -> &'static str {
5627 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse"
5628 }
5629}
5630
5631#[doc(hidden)]
5632impl gax::paginator::internal::PageableResponse for ListNetworkPeeringsResponse {
5633 type PageItem = crate::model::NetworkPeering;
5634
5635 fn items(self) -> std::vec::Vec<Self::PageItem> {
5636 self.network_peerings
5637 }
5638
5639 fn next_page_token(&self) -> std::string::String {
5640 use std::clone::Clone;
5641 self.next_page_token.clone()
5642 }
5643}
5644
5645/// Request message for
5646/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5647///
5648/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5649#[derive(Clone, Default, PartialEq)]
5650#[non_exhaustive]
5651pub struct ListPeeringRoutesRequest {
5652 /// Required. The resource name of the network peering to retrieve peering
5653 /// routes from. Resource names are schemeless URIs that follow the conventions
5654 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
5655 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5656 pub parent: std::string::String,
5657
5658 /// The maximum number of peering routes to return in one page.
5659 /// The service may return fewer than this value.
5660 /// The maximum value is coerced to 1000.
5661 /// The default value of this field is 500.
5662 pub page_size: i32,
5663
5664 /// A page token, received from a previous `ListPeeringRoutes` call.
5665 /// Provide this to retrieve the subsequent page.
5666 /// When paginating, all other parameters provided to `ListPeeringRoutes` must
5667 /// match the call that provided the page token.
5668 pub page_token: std::string::String,
5669
5670 /// A filter expression that matches resources returned in the response.
5671 /// Currently, only filtering on the `direction` field is supported. To return
5672 /// routes imported from the peer network, provide "direction=INCOMING". To
5673 /// return routes exported from the VMware Engine network, provide
5674 /// "direction=OUTGOING". Other filter expressions return an error.
5675 pub filter: std::string::String,
5676
5677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5678}
5679
5680impl ListPeeringRoutesRequest {
5681 pub fn new() -> Self {
5682 std::default::Default::default()
5683 }
5684
5685 /// Sets the value of [parent][crate::model::ListPeeringRoutesRequest::parent].
5686 ///
5687 /// # Example
5688 /// ```ignore,no_run
5689 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5690 /// let x = ListPeeringRoutesRequest::new().set_parent("example");
5691 /// ```
5692 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5693 self.parent = v.into();
5694 self
5695 }
5696
5697 /// Sets the value of [page_size][crate::model::ListPeeringRoutesRequest::page_size].
5698 ///
5699 /// # Example
5700 /// ```ignore,no_run
5701 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5702 /// let x = ListPeeringRoutesRequest::new().set_page_size(42);
5703 /// ```
5704 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5705 self.page_size = v.into();
5706 self
5707 }
5708
5709 /// Sets the value of [page_token][crate::model::ListPeeringRoutesRequest::page_token].
5710 ///
5711 /// # Example
5712 /// ```ignore,no_run
5713 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5714 /// let x = ListPeeringRoutesRequest::new().set_page_token("example");
5715 /// ```
5716 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5717 self.page_token = v.into();
5718 self
5719 }
5720
5721 /// Sets the value of [filter][crate::model::ListPeeringRoutesRequest::filter].
5722 ///
5723 /// # Example
5724 /// ```ignore,no_run
5725 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5726 /// let x = ListPeeringRoutesRequest::new().set_filter("example");
5727 /// ```
5728 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5729 self.filter = v.into();
5730 self
5731 }
5732}
5733
5734impl wkt::message::Message for ListPeeringRoutesRequest {
5735 fn typename() -> &'static str {
5736 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesRequest"
5737 }
5738}
5739
5740/// Response message for
5741/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5742///
5743/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5744#[derive(Clone, Default, PartialEq)]
5745#[non_exhaustive]
5746pub struct ListPeeringRoutesResponse {
5747 /// A list of peering routes.
5748 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
5749
5750 /// A token, which can be sent as `page_token` to retrieve the next page.
5751 /// If this field is omitted, there are no subsequent pages.
5752 pub next_page_token: std::string::String,
5753
5754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5755}
5756
5757impl ListPeeringRoutesResponse {
5758 pub fn new() -> Self {
5759 std::default::Default::default()
5760 }
5761
5762 /// Sets the value of [peering_routes][crate::model::ListPeeringRoutesResponse::peering_routes].
5763 ///
5764 /// # Example
5765 /// ```ignore,no_run
5766 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5767 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
5768 /// let x = ListPeeringRoutesResponse::new()
5769 /// .set_peering_routes([
5770 /// PeeringRoute::default()/* use setters */,
5771 /// PeeringRoute::default()/* use (different) setters */,
5772 /// ]);
5773 /// ```
5774 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
5775 where
5776 T: std::iter::IntoIterator<Item = V>,
5777 V: std::convert::Into<crate::model::PeeringRoute>,
5778 {
5779 use std::iter::Iterator;
5780 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
5781 self
5782 }
5783
5784 /// Sets the value of [next_page_token][crate::model::ListPeeringRoutesResponse::next_page_token].
5785 ///
5786 /// # Example
5787 /// ```ignore,no_run
5788 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5789 /// let x = ListPeeringRoutesResponse::new().set_next_page_token("example");
5790 /// ```
5791 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5792 self.next_page_token = v.into();
5793 self
5794 }
5795}
5796
5797impl wkt::message::Message for ListPeeringRoutesResponse {
5798 fn typename() -> &'static str {
5799 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesResponse"
5800 }
5801}
5802
5803#[doc(hidden)]
5804impl gax::paginator::internal::PageableResponse for ListPeeringRoutesResponse {
5805 type PageItem = crate::model::PeeringRoute;
5806
5807 fn items(self) -> std::vec::Vec<Self::PageItem> {
5808 self.peering_routes
5809 }
5810
5811 fn next_page_token(&self) -> std::string::String {
5812 use std::clone::Clone;
5813 self.next_page_token.clone()
5814 }
5815}
5816
5817/// Request message for
5818/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5819///
5820/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5821#[derive(Clone, Default, PartialEq)]
5822#[non_exhaustive]
5823pub struct ListNetworkPoliciesRequest {
5824 /// Required. The resource name of the location (region) to query for
5825 /// network policies. Resource names are schemeless URIs that follow the
5826 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5827 /// example: `projects/my-project/locations/us-central1`
5828 pub parent: std::string::String,
5829
5830 /// The maximum number of network policies to return in one page.
5831 /// The service may return fewer than this value.
5832 /// The maximum value is coerced to 1000.
5833 /// The default value of this field is 500.
5834 pub page_size: i32,
5835
5836 /// A page token, received from a previous `ListNetworkPolicies` call.
5837 /// Provide this to retrieve the subsequent page.
5838 ///
5839 /// When paginating, all other parameters provided to
5840 /// `ListNetworkPolicies` must match the call that provided the page
5841 /// token.
5842 pub page_token: std::string::String,
5843
5844 /// A filter expression that matches resources returned in the response.
5845 /// The expression must specify the field name, a comparison
5846 /// operator, and the value that you want to use for filtering. The value
5847 /// must be a string, a number, or a boolean. The comparison operator
5848 /// must be `=`, `!=`, `>`, or `<`.
5849 ///
5850 /// For example, if you are filtering a list of network policies, you can
5851 /// exclude the ones named `example-policy` by specifying
5852 /// `name != "example-policy"`.
5853 ///
5854 /// To filter on multiple expressions, provide each separate expression within
5855 /// parentheses. For example:
5856 ///
5857 /// ```norust
5858 /// (name = "example-policy")
5859 /// (createTime > "2021-04-12T08:15:10.40Z")
5860 /// ```
5861 ///
5862 /// By default, each expression is an `AND` expression. However, you
5863 /// can include `AND` and `OR` expressions explicitly.
5864 /// For example:
5865 ///
5866 /// ```norust
5867 /// (name = "example-policy-1") AND
5868 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5869 /// (name = "example-policy-2")
5870 /// ```
5871 pub filter: std::string::String,
5872
5873 /// Sorts list results by a certain order. By default, returned results
5874 /// are ordered by `name` in ascending order.
5875 /// You can also sort results in descending order based on the `name` value
5876 /// using `orderBy="name desc"`.
5877 /// Currently, only ordering by `name` is supported.
5878 pub order_by: std::string::String,
5879
5880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5881}
5882
5883impl ListNetworkPoliciesRequest {
5884 pub fn new() -> Self {
5885 std::default::Default::default()
5886 }
5887
5888 /// Sets the value of [parent][crate::model::ListNetworkPoliciesRequest::parent].
5889 ///
5890 /// # Example
5891 /// ```ignore,no_run
5892 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5893 /// let x = ListNetworkPoliciesRequest::new().set_parent("example");
5894 /// ```
5895 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.parent = v.into();
5897 self
5898 }
5899
5900 /// Sets the value of [page_size][crate::model::ListNetworkPoliciesRequest::page_size].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5905 /// let x = ListNetworkPoliciesRequest::new().set_page_size(42);
5906 /// ```
5907 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5908 self.page_size = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [page_token][crate::model::ListNetworkPoliciesRequest::page_token].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5917 /// let x = ListNetworkPoliciesRequest::new().set_page_token("example");
5918 /// ```
5919 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.page_token = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [filter][crate::model::ListNetworkPoliciesRequest::filter].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5929 /// let x = ListNetworkPoliciesRequest::new().set_filter("example");
5930 /// ```
5931 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5932 self.filter = v.into();
5933 self
5934 }
5935
5936 /// Sets the value of [order_by][crate::model::ListNetworkPoliciesRequest::order_by].
5937 ///
5938 /// # Example
5939 /// ```ignore,no_run
5940 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5941 /// let x = ListNetworkPoliciesRequest::new().set_order_by("example");
5942 /// ```
5943 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5944 self.order_by = v.into();
5945 self
5946 }
5947}
5948
5949impl wkt::message::Message for ListNetworkPoliciesRequest {
5950 fn typename() -> &'static str {
5951 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"
5952 }
5953}
5954
5955/// Response message for
5956/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5957///
5958/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5959#[derive(Clone, Default, PartialEq)]
5960#[non_exhaustive]
5961pub struct ListNetworkPoliciesResponse {
5962 /// A list of network policies.
5963 pub network_policies: std::vec::Vec<crate::model::NetworkPolicy>,
5964
5965 /// A token, which can be send as `page_token` to retrieve the next page.
5966 /// If this field is omitted, there are no subsequent pages.
5967 pub next_page_token: std::string::String,
5968
5969 /// Locations that could not be reached when making an aggregated query using
5970 /// wildcards.
5971 pub unreachable: std::vec::Vec<std::string::String>,
5972
5973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5974}
5975
5976impl ListNetworkPoliciesResponse {
5977 pub fn new() -> Self {
5978 std::default::Default::default()
5979 }
5980
5981 /// Sets the value of [network_policies][crate::model::ListNetworkPoliciesResponse::network_policies].
5982 ///
5983 /// # Example
5984 /// ```ignore,no_run
5985 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
5986 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
5987 /// let x = ListNetworkPoliciesResponse::new()
5988 /// .set_network_policies([
5989 /// NetworkPolicy::default()/* use setters */,
5990 /// NetworkPolicy::default()/* use (different) setters */,
5991 /// ]);
5992 /// ```
5993 pub fn set_network_policies<T, V>(mut self, v: T) -> Self
5994 where
5995 T: std::iter::IntoIterator<Item = V>,
5996 V: std::convert::Into<crate::model::NetworkPolicy>,
5997 {
5998 use std::iter::Iterator;
5999 self.network_policies = v.into_iter().map(|i| i.into()).collect();
6000 self
6001 }
6002
6003 /// Sets the value of [next_page_token][crate::model::ListNetworkPoliciesResponse::next_page_token].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6008 /// let x = ListNetworkPoliciesResponse::new().set_next_page_token("example");
6009 /// ```
6010 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6011 self.next_page_token = v.into();
6012 self
6013 }
6014
6015 /// Sets the value of [unreachable][crate::model::ListNetworkPoliciesResponse::unreachable].
6016 ///
6017 /// # Example
6018 /// ```ignore,no_run
6019 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6020 /// let x = ListNetworkPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
6021 /// ```
6022 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6023 where
6024 T: std::iter::IntoIterator<Item = V>,
6025 V: std::convert::Into<std::string::String>,
6026 {
6027 use std::iter::Iterator;
6028 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6029 self
6030 }
6031}
6032
6033impl wkt::message::Message for ListNetworkPoliciesResponse {
6034 fn typename() -> &'static str {
6035 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"
6036 }
6037}
6038
6039#[doc(hidden)]
6040impl gax::paginator::internal::PageableResponse for ListNetworkPoliciesResponse {
6041 type PageItem = crate::model::NetworkPolicy;
6042
6043 fn items(self) -> std::vec::Vec<Self::PageItem> {
6044 self.network_policies
6045 }
6046
6047 fn next_page_token(&self) -> std::string::String {
6048 use std::clone::Clone;
6049 self.next_page_token.clone()
6050 }
6051}
6052
6053/// Request message for
6054/// [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]
6055///
6056/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]: crate::client::VmwareEngine::get_network_policy
6057#[derive(Clone, Default, PartialEq)]
6058#[non_exhaustive]
6059pub struct GetNetworkPolicyRequest {
6060 /// Required. The resource name of the network policy to retrieve.
6061 /// Resource names are schemeless URIs that follow the conventions in
6062 /// <https://cloud.google.com/apis/design/resource_names>.
6063 /// For example:
6064 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6065 pub name: std::string::String,
6066
6067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6068}
6069
6070impl GetNetworkPolicyRequest {
6071 pub fn new() -> Self {
6072 std::default::Default::default()
6073 }
6074
6075 /// Sets the value of [name][crate::model::GetNetworkPolicyRequest::name].
6076 ///
6077 /// # Example
6078 /// ```ignore,no_run
6079 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPolicyRequest;
6080 /// let x = GetNetworkPolicyRequest::new().set_name("example");
6081 /// ```
6082 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6083 self.name = v.into();
6084 self
6085 }
6086}
6087
6088impl wkt::message::Message for GetNetworkPolicyRequest {
6089 fn typename() -> &'static str {
6090 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"
6091 }
6092}
6093
6094/// Request message for
6095/// [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]
6096///
6097/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]: crate::client::VmwareEngine::update_network_policy
6098#[derive(Clone, Default, PartialEq)]
6099#[non_exhaustive]
6100pub struct UpdateNetworkPolicyRequest {
6101 /// Required. Network policy description.
6102 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6103
6104 /// Required. Field mask is used to specify the fields to be overwritten in the
6105 /// `NetworkPolicy` resource by the update.
6106 /// The fields specified in the `update_mask` are relative to the resource, not
6107 /// the full request. A field will be overwritten if it is in the mask. If the
6108 /// user does not provide a mask then all fields will be overwritten.
6109 pub update_mask: std::option::Option<wkt::FieldMask>,
6110
6111 /// Optional. A request ID to identify requests. Specify a unique request ID
6112 /// so that if you must retry your request, the server will know to ignore
6113 /// the request if it has already been completed. The server guarantees that a
6114 /// request doesn't result in creation of duplicate commitments for at least 60
6115 /// minutes.
6116 ///
6117 /// For example, consider a situation where you make an initial request and the
6118 /// request times out. If you make the request again with the same request
6119 /// ID, the server can check if original operation with the same request ID
6120 /// was received, and if so, will ignore the second request. This prevents
6121 /// clients from accidentally creating duplicate commitments.
6122 ///
6123 /// The request ID must be a valid UUID with the exception that zero UUID is
6124 /// not supported (00000000-0000-0000-0000-000000000000).
6125 pub request_id: std::string::String,
6126
6127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6128}
6129
6130impl UpdateNetworkPolicyRequest {
6131 pub fn new() -> Self {
6132 std::default::Default::default()
6133 }
6134
6135 /// Sets the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6136 ///
6137 /// # Example
6138 /// ```ignore,no_run
6139 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6140 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6141 /// let x = UpdateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6142 /// ```
6143 pub fn set_network_policy<T>(mut self, v: T) -> Self
6144 where
6145 T: std::convert::Into<crate::model::NetworkPolicy>,
6146 {
6147 self.network_policy = std::option::Option::Some(v.into());
6148 self
6149 }
6150
6151 /// Sets or clears the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6152 ///
6153 /// # Example
6154 /// ```ignore,no_run
6155 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6156 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6157 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6158 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6159 /// ```
6160 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6161 where
6162 T: std::convert::Into<crate::model::NetworkPolicy>,
6163 {
6164 self.network_policy = v.map(|x| x.into());
6165 self
6166 }
6167
6168 /// Sets the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6169 ///
6170 /// # Example
6171 /// ```ignore,no_run
6172 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6173 /// use wkt::FieldMask;
6174 /// let x = UpdateNetworkPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6175 /// ```
6176 pub fn set_update_mask<T>(mut self, v: T) -> Self
6177 where
6178 T: std::convert::Into<wkt::FieldMask>,
6179 {
6180 self.update_mask = std::option::Option::Some(v.into());
6181 self
6182 }
6183
6184 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6185 ///
6186 /// # Example
6187 /// ```ignore,no_run
6188 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6189 /// use wkt::FieldMask;
6190 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6191 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6192 /// ```
6193 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6194 where
6195 T: std::convert::Into<wkt::FieldMask>,
6196 {
6197 self.update_mask = v.map(|x| x.into());
6198 self
6199 }
6200
6201 /// Sets the value of [request_id][crate::model::UpdateNetworkPolicyRequest::request_id].
6202 ///
6203 /// # Example
6204 /// ```ignore,no_run
6205 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6206 /// let x = UpdateNetworkPolicyRequest::new().set_request_id("example");
6207 /// ```
6208 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.request_id = v.into();
6210 self
6211 }
6212}
6213
6214impl wkt::message::Message for UpdateNetworkPolicyRequest {
6215 fn typename() -> &'static str {
6216 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"
6217 }
6218}
6219
6220/// Request message for
6221/// [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]
6222///
6223/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]: crate::client::VmwareEngine::create_network_policy
6224#[derive(Clone, Default, PartialEq)]
6225#[non_exhaustive]
6226pub struct CreateNetworkPolicyRequest {
6227 /// Required. The resource name of the location (region)
6228 /// to create the new network policy in.
6229 /// Resource names are schemeless URIs that follow the conventions in
6230 /// <https://cloud.google.com/apis/design/resource_names>.
6231 /// For example:
6232 /// `projects/my-project/locations/us-central1`
6233 pub parent: std::string::String,
6234
6235 /// Required. The user-provided identifier of the network policy to be created.
6236 /// This identifier must be unique within parent
6237 /// `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
6238 /// the final token in the name URI.
6239 /// The identifier must meet the following requirements:
6240 ///
6241 /// * Only contains 1-63 alphanumeric characters and hyphens
6242 /// * Begins with an alphabetical character
6243 /// * Ends with a non-hyphen character
6244 /// * Not formatted as a UUID
6245 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6246 /// (section 3.5)
6247 pub network_policy_id: std::string::String,
6248
6249 /// Required. The network policy configuration to use in the request.
6250 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6251
6252 /// Optional. A request ID to identify requests. Specify a unique request ID
6253 /// so that if you must retry your request, the server will know to ignore
6254 /// the request if it has already been completed. The server guarantees that a
6255 /// request doesn't result in creation of duplicate commitments for at least 60
6256 /// minutes.
6257 ///
6258 /// For example, consider a situation where you make an initial request and the
6259 /// request times out. If you make the request again with the same request
6260 /// ID, the server can check if original operation with the same request ID
6261 /// was received, and if so, will ignore the second request. This prevents
6262 /// clients from accidentally creating duplicate commitments.
6263 ///
6264 /// The request ID must be a valid UUID with the exception that zero UUID is
6265 /// not supported (00000000-0000-0000-0000-000000000000).
6266 pub request_id: std::string::String,
6267
6268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6269}
6270
6271impl CreateNetworkPolicyRequest {
6272 pub fn new() -> Self {
6273 std::default::Default::default()
6274 }
6275
6276 /// Sets the value of [parent][crate::model::CreateNetworkPolicyRequest::parent].
6277 ///
6278 /// # Example
6279 /// ```ignore,no_run
6280 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6281 /// let x = CreateNetworkPolicyRequest::new().set_parent("example");
6282 /// ```
6283 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6284 self.parent = v.into();
6285 self
6286 }
6287
6288 /// Sets the value of [network_policy_id][crate::model::CreateNetworkPolicyRequest::network_policy_id].
6289 ///
6290 /// # Example
6291 /// ```ignore,no_run
6292 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6293 /// let x = CreateNetworkPolicyRequest::new().set_network_policy_id("example");
6294 /// ```
6295 pub fn set_network_policy_id<T: std::convert::Into<std::string::String>>(
6296 mut self,
6297 v: T,
6298 ) -> Self {
6299 self.network_policy_id = v.into();
6300 self
6301 }
6302
6303 /// Sets the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6304 ///
6305 /// # Example
6306 /// ```ignore,no_run
6307 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6308 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6309 /// let x = CreateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6310 /// ```
6311 pub fn set_network_policy<T>(mut self, v: T) -> Self
6312 where
6313 T: std::convert::Into<crate::model::NetworkPolicy>,
6314 {
6315 self.network_policy = std::option::Option::Some(v.into());
6316 self
6317 }
6318
6319 /// Sets or clears the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6320 ///
6321 /// # Example
6322 /// ```ignore,no_run
6323 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6324 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6325 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6326 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6327 /// ```
6328 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6329 where
6330 T: std::convert::Into<crate::model::NetworkPolicy>,
6331 {
6332 self.network_policy = v.map(|x| x.into());
6333 self
6334 }
6335
6336 /// Sets the value of [request_id][crate::model::CreateNetworkPolicyRequest::request_id].
6337 ///
6338 /// # Example
6339 /// ```ignore,no_run
6340 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6341 /// let x = CreateNetworkPolicyRequest::new().set_request_id("example");
6342 /// ```
6343 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6344 self.request_id = v.into();
6345 self
6346 }
6347}
6348
6349impl wkt::message::Message for CreateNetworkPolicyRequest {
6350 fn typename() -> &'static str {
6351 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"
6352 }
6353}
6354
6355/// Request message for
6356/// [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]
6357///
6358/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]: crate::client::VmwareEngine::delete_network_policy
6359#[derive(Clone, Default, PartialEq)]
6360#[non_exhaustive]
6361pub struct DeleteNetworkPolicyRequest {
6362 /// Required. The resource name of the network policy to delete.
6363 /// Resource names are schemeless URIs that follow the conventions in
6364 /// <https://cloud.google.com/apis/design/resource_names>.
6365 /// For example:
6366 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6367 pub name: std::string::String,
6368
6369 /// Optional. A request ID to identify requests. Specify a unique request ID
6370 /// so that if you must retry your request, the server will know to ignore
6371 /// the request if it has already been completed. The server guarantees that a
6372 /// request doesn't result in creation of duplicate commitments for at least 60
6373 /// minutes.
6374 ///
6375 /// For example, consider a situation where you make an initial request and the
6376 /// request times out. If you make the request again with the same request
6377 /// ID, the server can check if original operation with the same request ID
6378 /// was received, and if so, will ignore the second request. This prevents
6379 /// clients from accidentally creating duplicate commitments.
6380 ///
6381 /// The request ID must be a valid UUID with the exception that zero UUID is
6382 /// not supported (00000000-0000-0000-0000-000000000000).
6383 pub request_id: std::string::String,
6384
6385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6386}
6387
6388impl DeleteNetworkPolicyRequest {
6389 pub fn new() -> Self {
6390 std::default::Default::default()
6391 }
6392
6393 /// Sets the value of [name][crate::model::DeleteNetworkPolicyRequest::name].
6394 ///
6395 /// # Example
6396 /// ```ignore,no_run
6397 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6398 /// let x = DeleteNetworkPolicyRequest::new().set_name("example");
6399 /// ```
6400 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6401 self.name = v.into();
6402 self
6403 }
6404
6405 /// Sets the value of [request_id][crate::model::DeleteNetworkPolicyRequest::request_id].
6406 ///
6407 /// # Example
6408 /// ```ignore,no_run
6409 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6410 /// let x = DeleteNetworkPolicyRequest::new().set_request_id("example");
6411 /// ```
6412 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6413 self.request_id = v.into();
6414 self
6415 }
6416}
6417
6418impl wkt::message::Message for DeleteNetworkPolicyRequest {
6419 fn typename() -> &'static str {
6420 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"
6421 }
6422}
6423
6424/// Request message for
6425/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6426///
6427/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6428#[derive(Clone, Default, PartialEq)]
6429#[non_exhaustive]
6430pub struct ListManagementDnsZoneBindingsRequest {
6431 /// Required. The resource name of the private cloud to be queried for
6432 /// management DNS zone bindings.
6433 /// Resource names are schemeless URIs that follow the conventions in
6434 /// <https://cloud.google.com/apis/design/resource_names>.
6435 /// For example:
6436 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6437 pub parent: std::string::String,
6438
6439 /// The maximum number of management DNS zone bindings to return in one page.
6440 /// The service may return fewer than this value.
6441 /// The maximum value is coerced to 1000.
6442 /// The default value of this field is 500.
6443 pub page_size: i32,
6444
6445 /// A page token, received from a previous `ListManagementDnsZoneBindings`
6446 /// call. Provide this to retrieve the subsequent page.
6447 ///
6448 /// When paginating, all other parameters provided to
6449 /// `ListManagementDnsZoneBindings` must match the call that provided the page
6450 /// token.
6451 pub page_token: std::string::String,
6452
6453 /// A filter expression that matches resources returned in the response.
6454 /// The expression must specify the field name, a comparison
6455 /// operator, and the value that you want to use for filtering. The value
6456 /// must be a string, a number, or a boolean. The comparison operator
6457 /// must be `=`, `!=`, `>`, or `<`.
6458 ///
6459 /// For example, if you are filtering a list of Management DNS Zone Bindings,
6460 /// you can exclude the ones named `example-management-dns-zone-binding` by
6461 /// specifying `name != "example-management-dns-zone-binding"`.
6462 ///
6463 /// To filter on multiple expressions, provide each separate expression within
6464 /// parentheses. For example:
6465 ///
6466 /// ```norust
6467 /// (name = "example-management-dns-zone-binding")
6468 /// (createTime > "2021-04-12T08:15:10.40Z")
6469 /// ```
6470 ///
6471 /// By default, each expression is an `AND` expression. However, you
6472 /// can include `AND` and `OR` expressions explicitly.
6473 /// For example:
6474 ///
6475 /// ```norust
6476 /// (name = "example-management-dns-zone-binding-1") AND
6477 /// (createTime > "2021-04-12T08:15:10.40Z") OR
6478 /// (name = "example-management-dns-zone-binding-2")
6479 /// ```
6480 pub filter: std::string::String,
6481
6482 /// Sorts list results by a certain order. By default, returned results
6483 /// are ordered by `name` in ascending order.
6484 /// You can also sort results in descending order based on the `name` value
6485 /// using `orderBy="name desc"`.
6486 /// Currently, only ordering by `name` is supported.
6487 pub order_by: std::string::String,
6488
6489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6490}
6491
6492impl ListManagementDnsZoneBindingsRequest {
6493 pub fn new() -> Self {
6494 std::default::Default::default()
6495 }
6496
6497 /// Sets the value of [parent][crate::model::ListManagementDnsZoneBindingsRequest::parent].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6502 /// let x = ListManagementDnsZoneBindingsRequest::new().set_parent("example");
6503 /// ```
6504 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6505 self.parent = v.into();
6506 self
6507 }
6508
6509 /// Sets the value of [page_size][crate::model::ListManagementDnsZoneBindingsRequest::page_size].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6514 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_size(42);
6515 /// ```
6516 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6517 self.page_size = v.into();
6518 self
6519 }
6520
6521 /// Sets the value of [page_token][crate::model::ListManagementDnsZoneBindingsRequest::page_token].
6522 ///
6523 /// # Example
6524 /// ```ignore,no_run
6525 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6526 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_token("example");
6527 /// ```
6528 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6529 self.page_token = v.into();
6530 self
6531 }
6532
6533 /// Sets the value of [filter][crate::model::ListManagementDnsZoneBindingsRequest::filter].
6534 ///
6535 /// # Example
6536 /// ```ignore,no_run
6537 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6538 /// let x = ListManagementDnsZoneBindingsRequest::new().set_filter("example");
6539 /// ```
6540 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6541 self.filter = v.into();
6542 self
6543 }
6544
6545 /// Sets the value of [order_by][crate::model::ListManagementDnsZoneBindingsRequest::order_by].
6546 ///
6547 /// # Example
6548 /// ```ignore,no_run
6549 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6550 /// let x = ListManagementDnsZoneBindingsRequest::new().set_order_by("example");
6551 /// ```
6552 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6553 self.order_by = v.into();
6554 self
6555 }
6556}
6557
6558impl wkt::message::Message for ListManagementDnsZoneBindingsRequest {
6559 fn typename() -> &'static str {
6560 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest"
6561 }
6562}
6563
6564/// Response message for
6565/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6566///
6567/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6568#[derive(Clone, Default, PartialEq)]
6569#[non_exhaustive]
6570pub struct ListManagementDnsZoneBindingsResponse {
6571 /// A list of management DNS zone bindings.
6572 pub management_dns_zone_bindings: std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
6573
6574 /// A token, which can be sent as `page_token` to retrieve the next page.
6575 /// If this field is omitted, there are no subsequent pages.
6576 pub next_page_token: std::string::String,
6577
6578 /// Locations that could not be reached when making an aggregated query using
6579 /// wildcards.
6580 pub unreachable: std::vec::Vec<std::string::String>,
6581
6582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6583}
6584
6585impl ListManagementDnsZoneBindingsResponse {
6586 pub fn new() -> Self {
6587 std::default::Default::default()
6588 }
6589
6590 /// Sets the value of [management_dns_zone_bindings][crate::model::ListManagementDnsZoneBindingsResponse::management_dns_zone_bindings].
6591 ///
6592 /// # Example
6593 /// ```ignore,no_run
6594 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6595 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6596 /// let x = ListManagementDnsZoneBindingsResponse::new()
6597 /// .set_management_dns_zone_bindings([
6598 /// ManagementDnsZoneBinding::default()/* use setters */,
6599 /// ManagementDnsZoneBinding::default()/* use (different) setters */,
6600 /// ]);
6601 /// ```
6602 pub fn set_management_dns_zone_bindings<T, V>(mut self, v: T) -> Self
6603 where
6604 T: std::iter::IntoIterator<Item = V>,
6605 V: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6606 {
6607 use std::iter::Iterator;
6608 self.management_dns_zone_bindings = v.into_iter().map(|i| i.into()).collect();
6609 self
6610 }
6611
6612 /// Sets the value of [next_page_token][crate::model::ListManagementDnsZoneBindingsResponse::next_page_token].
6613 ///
6614 /// # Example
6615 /// ```ignore,no_run
6616 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6617 /// let x = ListManagementDnsZoneBindingsResponse::new().set_next_page_token("example");
6618 /// ```
6619 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6620 self.next_page_token = v.into();
6621 self
6622 }
6623
6624 /// Sets the value of [unreachable][crate::model::ListManagementDnsZoneBindingsResponse::unreachable].
6625 ///
6626 /// # Example
6627 /// ```ignore,no_run
6628 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6629 /// let x = ListManagementDnsZoneBindingsResponse::new().set_unreachable(["a", "b", "c"]);
6630 /// ```
6631 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6632 where
6633 T: std::iter::IntoIterator<Item = V>,
6634 V: std::convert::Into<std::string::String>,
6635 {
6636 use std::iter::Iterator;
6637 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6638 self
6639 }
6640}
6641
6642impl wkt::message::Message for ListManagementDnsZoneBindingsResponse {
6643 fn typename() -> &'static str {
6644 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse"
6645 }
6646}
6647
6648#[doc(hidden)]
6649impl gax::paginator::internal::PageableResponse for ListManagementDnsZoneBindingsResponse {
6650 type PageItem = crate::model::ManagementDnsZoneBinding;
6651
6652 fn items(self) -> std::vec::Vec<Self::PageItem> {
6653 self.management_dns_zone_bindings
6654 }
6655
6656 fn next_page_token(&self) -> std::string::String {
6657 use std::clone::Clone;
6658 self.next_page_token.clone()
6659 }
6660}
6661
6662/// Request message for
6663/// [VmwareEngine.GetManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]
6664///
6665/// [google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]: crate::client::VmwareEngine::get_management_dns_zone_binding
6666#[derive(Clone, Default, PartialEq)]
6667#[non_exhaustive]
6668pub struct GetManagementDnsZoneBindingRequest {
6669 /// Required. The resource name of the management DNS zone binding to
6670 /// retrieve. Resource names are schemeless URIs that follow the conventions in
6671 /// <https://cloud.google.com/apis/design/resource_names>.
6672 /// For example:
6673 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6674 pub name: std::string::String,
6675
6676 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6677}
6678
6679impl GetManagementDnsZoneBindingRequest {
6680 pub fn new() -> Self {
6681 std::default::Default::default()
6682 }
6683
6684 /// Sets the value of [name][crate::model::GetManagementDnsZoneBindingRequest::name].
6685 ///
6686 /// # Example
6687 /// ```ignore,no_run
6688 /// # use google_cloud_vmwareengine_v1::model::GetManagementDnsZoneBindingRequest;
6689 /// let x = GetManagementDnsZoneBindingRequest::new().set_name("example");
6690 /// ```
6691 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6692 self.name = v.into();
6693 self
6694 }
6695}
6696
6697impl wkt::message::Message for GetManagementDnsZoneBindingRequest {
6698 fn typename() -> &'static str {
6699 "type.googleapis.com/google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest"
6700 }
6701}
6702
6703/// Request message for [VmwareEngine.CreateManagementDnsZoneBindings][]
6704#[derive(Clone, Default, PartialEq)]
6705#[non_exhaustive]
6706pub struct CreateManagementDnsZoneBindingRequest {
6707 /// Required. The resource name of the private cloud
6708 /// to create a new management DNS zone binding for.
6709 /// Resource names are schemeless URIs that follow the conventions in
6710 /// <https://cloud.google.com/apis/design/resource_names>.
6711 /// For example:
6712 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6713 pub parent: std::string::String,
6714
6715 /// Required. The initial values for a new management DNS zone binding.
6716 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6717
6718 /// Required. The user-provided identifier of the `ManagementDnsZoneBinding`
6719 /// resource to be created. This identifier must be unique among
6720 /// `ManagementDnsZoneBinding` resources within the parent and becomes the
6721 /// final token in the name URI. The identifier must meet the following
6722 /// requirements:
6723 ///
6724 /// * Only contains 1-63 alphanumeric characters and hyphens
6725 /// * Begins with an alphabetical character
6726 /// * Ends with a non-hyphen character
6727 /// * Not formatted as a UUID
6728 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6729 /// (section 3.5)
6730 pub management_dns_zone_binding_id: std::string::String,
6731
6732 /// Optional. A request ID to identify requests. Specify a unique request ID
6733 /// so that if you must retry your request, the server will know to ignore
6734 /// the request if it has already been completed. The server guarantees that a
6735 /// request doesn't result in creation of duplicate commitments for at least 60
6736 /// minutes.
6737 ///
6738 /// For example, consider a situation where you make an initial request and the
6739 /// request times out. If you make the request again with the same request ID,
6740 /// the server can check if the original operation with the same request ID was
6741 /// received, and if so, will ignore the second request. This prevents clients
6742 /// from accidentally creating duplicate commitments.
6743 ///
6744 /// The request ID must be a valid UUID with the exception that zero UUID is
6745 /// not supported (00000000-0000-0000-0000-000000000000).
6746 pub request_id: std::string::String,
6747
6748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6749}
6750
6751impl CreateManagementDnsZoneBindingRequest {
6752 pub fn new() -> Self {
6753 std::default::Default::default()
6754 }
6755
6756 /// Sets the value of [parent][crate::model::CreateManagementDnsZoneBindingRequest::parent].
6757 ///
6758 /// # Example
6759 /// ```ignore,no_run
6760 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6761 /// let x = CreateManagementDnsZoneBindingRequest::new().set_parent("example");
6762 /// ```
6763 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6764 self.parent = v.into();
6765 self
6766 }
6767
6768 /// Sets the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6769 ///
6770 /// # Example
6771 /// ```ignore,no_run
6772 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6773 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6774 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6775 /// ```
6776 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6777 where
6778 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6779 {
6780 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6781 self
6782 }
6783
6784 /// Sets or clears the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6785 ///
6786 /// # Example
6787 /// ```ignore,no_run
6788 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6789 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6790 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6791 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6792 /// ```
6793 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6794 where
6795 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6796 {
6797 self.management_dns_zone_binding = v.map(|x| x.into());
6798 self
6799 }
6800
6801 /// Sets the value of [management_dns_zone_binding_id][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding_id].
6802 ///
6803 /// # Example
6804 /// ```ignore,no_run
6805 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6806 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding_id("example");
6807 /// ```
6808 pub fn set_management_dns_zone_binding_id<T: std::convert::Into<std::string::String>>(
6809 mut self,
6810 v: T,
6811 ) -> Self {
6812 self.management_dns_zone_binding_id = v.into();
6813 self
6814 }
6815
6816 /// Sets the value of [request_id][crate::model::CreateManagementDnsZoneBindingRequest::request_id].
6817 ///
6818 /// # Example
6819 /// ```ignore,no_run
6820 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6821 /// let x = CreateManagementDnsZoneBindingRequest::new().set_request_id("example");
6822 /// ```
6823 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6824 self.request_id = v.into();
6825 self
6826 }
6827}
6828
6829impl wkt::message::Message for CreateManagementDnsZoneBindingRequest {
6830 fn typename() -> &'static str {
6831 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest"
6832 }
6833}
6834
6835/// Request message for
6836/// [VmwareEngine.UpdateManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]
6837///
6838/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]: crate::client::VmwareEngine::update_management_dns_zone_binding
6839#[derive(Clone, Default, PartialEq)]
6840#[non_exhaustive]
6841pub struct UpdateManagementDnsZoneBindingRequest {
6842 /// Required. Field mask is used to specify the fields to be overwritten in the
6843 /// `ManagementDnsZoneBinding` resource by the update.
6844 /// The fields specified in the `update_mask` are relative to the resource, not
6845 /// the full request. A field will be overwritten if it is in the mask. If the
6846 /// user does not provide a mask then all fields will be overwritten.
6847 pub update_mask: std::option::Option<wkt::FieldMask>,
6848
6849 /// Required. New values to update the management DNS zone binding with.
6850 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6851
6852 /// Optional. A request ID to identify requests. Specify a unique request ID
6853 /// so that if you must retry your request, the server will know to ignore
6854 /// the request if it has already been completed. The server guarantees that a
6855 /// request doesn't result in creation of duplicate commitments for at least 60
6856 /// minutes.
6857 ///
6858 /// For example, consider a situation where you make an initial request and the
6859 /// request times out. If you make the request again with the same request ID,
6860 /// the server can check if the original operation with the same request ID was
6861 /// received, and if so, will ignore the second request. This prevents clients
6862 /// from accidentally creating duplicate commitments.
6863 ///
6864 /// The request ID must be a valid UUID with the exception that zero UUID is
6865 /// not supported (00000000-0000-0000-0000-000000000000).
6866 pub request_id: std::string::String,
6867
6868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6869}
6870
6871impl UpdateManagementDnsZoneBindingRequest {
6872 pub fn new() -> Self {
6873 std::default::Default::default()
6874 }
6875
6876 /// Sets the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6877 ///
6878 /// # Example
6879 /// ```ignore,no_run
6880 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6881 /// use wkt::FieldMask;
6882 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6883 /// ```
6884 pub fn set_update_mask<T>(mut self, v: T) -> Self
6885 where
6886 T: std::convert::Into<wkt::FieldMask>,
6887 {
6888 self.update_mask = std::option::Option::Some(v.into());
6889 self
6890 }
6891
6892 /// Sets or clears the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6893 ///
6894 /// # Example
6895 /// ```ignore,no_run
6896 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6897 /// use wkt::FieldMask;
6898 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6899 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6900 /// ```
6901 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6902 where
6903 T: std::convert::Into<wkt::FieldMask>,
6904 {
6905 self.update_mask = v.map(|x| x.into());
6906 self
6907 }
6908
6909 /// Sets the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6910 ///
6911 /// # Example
6912 /// ```ignore,no_run
6913 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6914 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6915 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6916 /// ```
6917 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6918 where
6919 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6920 {
6921 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6922 self
6923 }
6924
6925 /// Sets or clears the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6926 ///
6927 /// # Example
6928 /// ```ignore,no_run
6929 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6930 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6931 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6932 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6933 /// ```
6934 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6935 where
6936 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6937 {
6938 self.management_dns_zone_binding = v.map(|x| x.into());
6939 self
6940 }
6941
6942 /// Sets the value of [request_id][crate::model::UpdateManagementDnsZoneBindingRequest::request_id].
6943 ///
6944 /// # Example
6945 /// ```ignore,no_run
6946 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6947 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_request_id("example");
6948 /// ```
6949 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6950 self.request_id = v.into();
6951 self
6952 }
6953}
6954
6955impl wkt::message::Message for UpdateManagementDnsZoneBindingRequest {
6956 fn typename() -> &'static str {
6957 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest"
6958 }
6959}
6960
6961/// Request message for
6962/// [VmwareEngine.DeleteManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]
6963///
6964/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]: crate::client::VmwareEngine::delete_management_dns_zone_binding
6965#[derive(Clone, Default, PartialEq)]
6966#[non_exhaustive]
6967pub struct DeleteManagementDnsZoneBindingRequest {
6968 /// Required. The resource name of the management DNS zone binding to delete.
6969 /// Resource names are schemeless URIs that follow the conventions in
6970 /// <https://cloud.google.com/apis/design/resource_names>.
6971 /// For example:
6972 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6973 pub name: std::string::String,
6974
6975 /// Optional. A request ID to identify requests. Specify a unique request ID
6976 /// so that if you must retry your request, the server will know to ignore
6977 /// the request if it has already been completed. The server guarantees that a
6978 /// request doesn't result in creation of duplicate commitments for at least 60
6979 /// minutes.
6980 ///
6981 /// For example, consider a situation where you make an initial request and the
6982 /// request times out. If you make the request again with the same request
6983 /// ID, the server can check if the original operation with the same request ID
6984 /// was received, and if so, will ignore the second request. This prevents
6985 /// clients from accidentally creating duplicate commitments.
6986 ///
6987 /// The request ID must be a valid UUID with the exception that zero UUID is
6988 /// not supported (00000000-0000-0000-0000-000000000000).
6989 pub request_id: std::string::String,
6990
6991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6992}
6993
6994impl DeleteManagementDnsZoneBindingRequest {
6995 pub fn new() -> Self {
6996 std::default::Default::default()
6997 }
6998
6999 /// Sets the value of [name][crate::model::DeleteManagementDnsZoneBindingRequest::name].
7000 ///
7001 /// # Example
7002 /// ```ignore,no_run
7003 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7004 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_name("example");
7005 /// ```
7006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7007 self.name = v.into();
7008 self
7009 }
7010
7011 /// Sets the value of [request_id][crate::model::DeleteManagementDnsZoneBindingRequest::request_id].
7012 ///
7013 /// # Example
7014 /// ```ignore,no_run
7015 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7016 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_request_id("example");
7017 /// ```
7018 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7019 self.request_id = v.into();
7020 self
7021 }
7022}
7023
7024impl wkt::message::Message for DeleteManagementDnsZoneBindingRequest {
7025 fn typename() -> &'static str {
7026 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest"
7027 }
7028}
7029
7030/// Request message for [VmwareEngine.RepairManagementDnsZoneBindings][]
7031#[derive(Clone, Default, PartialEq)]
7032#[non_exhaustive]
7033pub struct RepairManagementDnsZoneBindingRequest {
7034 /// Required. The resource name of the management DNS zone binding to repair.
7035 /// Resource names are schemeless URIs that follow the conventions in
7036 /// <https://cloud.google.com/apis/design/resource_names>.
7037 /// For example:
7038 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
7039 pub name: std::string::String,
7040
7041 /// Optional. A request ID to identify requests. Specify a unique request ID
7042 /// so that if you must retry your request, the server will know to ignore
7043 /// the request if it has already been completed. The server guarantees that a
7044 /// request doesn't result in creation of duplicate commitments for at least 60
7045 /// minutes.
7046 ///
7047 /// For example, consider a situation where you make an initial request and the
7048 /// request times out. If you make the request again with the same request ID,
7049 /// the server can check if the original operation with the same request ID was
7050 /// received, and if so, will ignore the second request. This prevents clients
7051 /// from accidentally creating duplicate commitments.
7052 ///
7053 /// The request ID must be a valid UUID with the exception that zero UUID is
7054 /// not supported (00000000-0000-0000-0000-000000000000).
7055 pub request_id: std::string::String,
7056
7057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7058}
7059
7060impl RepairManagementDnsZoneBindingRequest {
7061 pub fn new() -> Self {
7062 std::default::Default::default()
7063 }
7064
7065 /// Sets the value of [name][crate::model::RepairManagementDnsZoneBindingRequest::name].
7066 ///
7067 /// # Example
7068 /// ```ignore,no_run
7069 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7070 /// let x = RepairManagementDnsZoneBindingRequest::new().set_name("example");
7071 /// ```
7072 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7073 self.name = v.into();
7074 self
7075 }
7076
7077 /// Sets the value of [request_id][crate::model::RepairManagementDnsZoneBindingRequest::request_id].
7078 ///
7079 /// # Example
7080 /// ```ignore,no_run
7081 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7082 /// let x = RepairManagementDnsZoneBindingRequest::new().set_request_id("example");
7083 /// ```
7084 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7085 self.request_id = v.into();
7086 self
7087 }
7088}
7089
7090impl wkt::message::Message for RepairManagementDnsZoneBindingRequest {
7091 fn typename() -> &'static str {
7092 "type.googleapis.com/google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest"
7093 }
7094}
7095
7096/// Request message for
7097/// [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]
7098///
7099/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]: crate::client::VmwareEngine::create_vmware_engine_network
7100#[derive(Clone, Default, PartialEq)]
7101#[non_exhaustive]
7102pub struct CreateVmwareEngineNetworkRequest {
7103 /// Required. The resource name of the location to create the new VMware Engine
7104 /// network in. A VMware Engine network of type
7105 /// `LEGACY` is a regional resource, and a VMware
7106 /// Engine network of type `STANDARD` is a global resource.
7107 /// Resource names are schemeless URIs that follow the conventions in
7108 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7109 /// `projects/my-project/locations/global`
7110 pub parent: std::string::String,
7111
7112 /// Required. The user-provided identifier of the new VMware Engine network.
7113 /// This identifier must be unique among VMware Engine network resources
7114 /// within the parent and becomes the final token in the name URI. The
7115 /// identifier must meet the following requirements:
7116 ///
7117 /// * For networks of type LEGACY, adheres to the format:
7118 /// `{region-id}-default`. Replace `{region-id}` with the region where you want
7119 /// to create the VMware Engine network. For example, "us-central1-default".
7120 /// * Only contains 1-63 alphanumeric characters and hyphens
7121 /// * Begins with an alphabetical character
7122 /// * Ends with a non-hyphen character
7123 /// * Not formatted as a UUID
7124 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7125 /// (section 3.5)
7126 pub vmware_engine_network_id: std::string::String,
7127
7128 /// Required. The initial description of the new VMware Engine network.
7129 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7130
7131 /// Optional. A request ID to identify requests. Specify a unique request ID
7132 /// so that if you must retry your request, the server will know to ignore
7133 /// the request if it has already been completed. The server guarantees that a
7134 /// request doesn't result in creation of duplicate commitments for at least 60
7135 /// minutes.
7136 ///
7137 /// For example, consider a situation where you make an initial request and the
7138 /// request times out. If you make the request again with the same request
7139 /// ID, the server can check if original operation with the same request ID
7140 /// was received, and if so, will ignore the second request. This prevents
7141 /// clients from accidentally creating duplicate commitments.
7142 ///
7143 /// The request ID must be a valid UUID with the exception that zero UUID is
7144 /// not supported (00000000-0000-0000-0000-000000000000).
7145 pub request_id: std::string::String,
7146
7147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7148}
7149
7150impl CreateVmwareEngineNetworkRequest {
7151 pub fn new() -> Self {
7152 std::default::Default::default()
7153 }
7154
7155 /// Sets the value of [parent][crate::model::CreateVmwareEngineNetworkRequest::parent].
7156 ///
7157 /// # Example
7158 /// ```ignore,no_run
7159 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7160 /// let x = CreateVmwareEngineNetworkRequest::new().set_parent("example");
7161 /// ```
7162 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7163 self.parent = v.into();
7164 self
7165 }
7166
7167 /// Sets the value of [vmware_engine_network_id][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network_id].
7168 ///
7169 /// # Example
7170 /// ```ignore,no_run
7171 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7172 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network_id("example");
7173 /// ```
7174 pub fn set_vmware_engine_network_id<T: std::convert::Into<std::string::String>>(
7175 mut self,
7176 v: T,
7177 ) -> Self {
7178 self.vmware_engine_network_id = v.into();
7179 self
7180 }
7181
7182 /// Sets the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7183 ///
7184 /// # Example
7185 /// ```ignore,no_run
7186 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7187 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7188 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7189 /// ```
7190 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7191 where
7192 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7193 {
7194 self.vmware_engine_network = std::option::Option::Some(v.into());
7195 self
7196 }
7197
7198 /// Sets or clears the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7199 ///
7200 /// # Example
7201 /// ```ignore,no_run
7202 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7203 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7204 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7205 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7206 /// ```
7207 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7208 where
7209 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7210 {
7211 self.vmware_engine_network = v.map(|x| x.into());
7212 self
7213 }
7214
7215 /// Sets the value of [request_id][crate::model::CreateVmwareEngineNetworkRequest::request_id].
7216 ///
7217 /// # Example
7218 /// ```ignore,no_run
7219 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7220 /// let x = CreateVmwareEngineNetworkRequest::new().set_request_id("example");
7221 /// ```
7222 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7223 self.request_id = v.into();
7224 self
7225 }
7226}
7227
7228impl wkt::message::Message for CreateVmwareEngineNetworkRequest {
7229 fn typename() -> &'static str {
7230 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"
7231 }
7232}
7233
7234/// Request message for
7235/// [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]
7236///
7237/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]: crate::client::VmwareEngine::update_vmware_engine_network
7238#[derive(Clone, Default, PartialEq)]
7239#[non_exhaustive]
7240pub struct UpdateVmwareEngineNetworkRequest {
7241 /// Required. VMware Engine network description.
7242 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7243
7244 /// Required. Field mask is used to specify the fields to be overwritten in the
7245 /// VMware Engine network resource by the update.
7246 /// The fields specified in the `update_mask` are relative to the resource, not
7247 /// the full request. A field will be overwritten if it is in the mask. If the
7248 /// user does not provide a mask then all fields will be overwritten. Only the
7249 /// following fields can be updated: `description`.
7250 pub update_mask: std::option::Option<wkt::FieldMask>,
7251
7252 /// Optional. A request ID to identify requests. Specify a unique request ID
7253 /// so that if you must retry your request, the server will know to ignore
7254 /// the request if it has already been completed. The server guarantees that a
7255 /// request doesn't result in creation of duplicate commitments for at least 60
7256 /// minutes.
7257 ///
7258 /// For example, consider a situation where you make an initial request and the
7259 /// request times out. If you make the request again with the same request
7260 /// ID, the server can check if original operation with the same request ID
7261 /// was received, and if so, will ignore the second request. This prevents
7262 /// clients from accidentally creating duplicate commitments.
7263 ///
7264 /// The request ID must be a valid UUID with the exception that zero UUID is
7265 /// not supported (00000000-0000-0000-0000-000000000000).
7266 pub request_id: std::string::String,
7267
7268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7269}
7270
7271impl UpdateVmwareEngineNetworkRequest {
7272 pub fn new() -> Self {
7273 std::default::Default::default()
7274 }
7275
7276 /// Sets the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7277 ///
7278 /// # Example
7279 /// ```ignore,no_run
7280 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7281 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7282 /// let x = UpdateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7283 /// ```
7284 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7285 where
7286 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7287 {
7288 self.vmware_engine_network = std::option::Option::Some(v.into());
7289 self
7290 }
7291
7292 /// Sets or clears the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7293 ///
7294 /// # Example
7295 /// ```ignore,no_run
7296 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7297 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7298 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7299 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7300 /// ```
7301 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7302 where
7303 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7304 {
7305 self.vmware_engine_network = v.map(|x| x.into());
7306 self
7307 }
7308
7309 /// Sets the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7310 ///
7311 /// # Example
7312 /// ```ignore,no_run
7313 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7314 /// use wkt::FieldMask;
7315 /// let x = UpdateVmwareEngineNetworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7316 /// ```
7317 pub fn set_update_mask<T>(mut self, v: T) -> Self
7318 where
7319 T: std::convert::Into<wkt::FieldMask>,
7320 {
7321 self.update_mask = std::option::Option::Some(v.into());
7322 self
7323 }
7324
7325 /// Sets or clears the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7326 ///
7327 /// # Example
7328 /// ```ignore,no_run
7329 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7330 /// use wkt::FieldMask;
7331 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7332 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7333 /// ```
7334 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7335 where
7336 T: std::convert::Into<wkt::FieldMask>,
7337 {
7338 self.update_mask = v.map(|x| x.into());
7339 self
7340 }
7341
7342 /// Sets the value of [request_id][crate::model::UpdateVmwareEngineNetworkRequest::request_id].
7343 ///
7344 /// # Example
7345 /// ```ignore,no_run
7346 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7347 /// let x = UpdateVmwareEngineNetworkRequest::new().set_request_id("example");
7348 /// ```
7349 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7350 self.request_id = v.into();
7351 self
7352 }
7353}
7354
7355impl wkt::message::Message for UpdateVmwareEngineNetworkRequest {
7356 fn typename() -> &'static str {
7357 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"
7358 }
7359}
7360
7361/// Request message for
7362/// [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]
7363///
7364/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]: crate::client::VmwareEngine::delete_vmware_engine_network
7365#[derive(Clone, Default, PartialEq)]
7366#[non_exhaustive]
7367pub struct DeleteVmwareEngineNetworkRequest {
7368 /// Required. The resource name of the VMware Engine network to be deleted.
7369 /// Resource names are schemeless URIs that follow the conventions in
7370 /// <https://cloud.google.com/apis/design/resource_names>.
7371 /// For example:
7372 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7373 pub name: std::string::String,
7374
7375 /// Optional. A request ID to identify requests. Specify a unique request ID
7376 /// so that if you must retry your request, the server will know to ignore
7377 /// the request if it has already been completed. The server guarantees that a
7378 /// request doesn't result in creation of duplicate commitments for at least 60
7379 /// minutes.
7380 ///
7381 /// For example, consider a situation where you make an initial request and the
7382 /// request times out. If you make the request again with the same request
7383 /// ID, the server can check if original operation with the same request ID
7384 /// was received, and if so, will ignore the second request. This prevents
7385 /// clients from accidentally creating duplicate commitments.
7386 ///
7387 /// The request ID must be a valid UUID with the exception that zero UUID is
7388 /// not supported (00000000-0000-0000-0000-000000000000).
7389 pub request_id: std::string::String,
7390
7391 /// Optional. Checksum used to ensure that the user-provided value is up to
7392 /// date before the server processes the request. The server compares provided
7393 /// checksum with the current checksum of the resource. If the user-provided
7394 /// value is out of date, this request returns an `ABORTED` error.
7395 pub etag: std::string::String,
7396
7397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7398}
7399
7400impl DeleteVmwareEngineNetworkRequest {
7401 pub fn new() -> Self {
7402 std::default::Default::default()
7403 }
7404
7405 /// Sets the value of [name][crate::model::DeleteVmwareEngineNetworkRequest::name].
7406 ///
7407 /// # Example
7408 /// ```ignore,no_run
7409 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7410 /// let x = DeleteVmwareEngineNetworkRequest::new().set_name("example");
7411 /// ```
7412 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7413 self.name = v.into();
7414 self
7415 }
7416
7417 /// Sets the value of [request_id][crate::model::DeleteVmwareEngineNetworkRequest::request_id].
7418 ///
7419 /// # Example
7420 /// ```ignore,no_run
7421 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7422 /// let x = DeleteVmwareEngineNetworkRequest::new().set_request_id("example");
7423 /// ```
7424 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7425 self.request_id = v.into();
7426 self
7427 }
7428
7429 /// Sets the value of [etag][crate::model::DeleteVmwareEngineNetworkRequest::etag].
7430 ///
7431 /// # Example
7432 /// ```ignore,no_run
7433 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7434 /// let x = DeleteVmwareEngineNetworkRequest::new().set_etag("example");
7435 /// ```
7436 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7437 self.etag = v.into();
7438 self
7439 }
7440}
7441
7442impl wkt::message::Message for DeleteVmwareEngineNetworkRequest {
7443 fn typename() -> &'static str {
7444 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"
7445 }
7446}
7447
7448/// Request message for
7449/// [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]
7450///
7451/// [google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]: crate::client::VmwareEngine::get_vmware_engine_network
7452#[derive(Clone, Default, PartialEq)]
7453#[non_exhaustive]
7454pub struct GetVmwareEngineNetworkRequest {
7455 /// Required. The resource name of the VMware Engine network to retrieve.
7456 /// Resource names are schemeless URIs that follow the conventions in
7457 /// <https://cloud.google.com/apis/design/resource_names>.
7458 /// For example:
7459 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7460 pub name: std::string::String,
7461
7462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7463}
7464
7465impl GetVmwareEngineNetworkRequest {
7466 pub fn new() -> Self {
7467 std::default::Default::default()
7468 }
7469
7470 /// Sets the value of [name][crate::model::GetVmwareEngineNetworkRequest::name].
7471 ///
7472 /// # Example
7473 /// ```ignore,no_run
7474 /// # use google_cloud_vmwareengine_v1::model::GetVmwareEngineNetworkRequest;
7475 /// let x = GetVmwareEngineNetworkRequest::new().set_name("example");
7476 /// ```
7477 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7478 self.name = v.into();
7479 self
7480 }
7481}
7482
7483impl wkt::message::Message for GetVmwareEngineNetworkRequest {
7484 fn typename() -> &'static str {
7485 "type.googleapis.com/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"
7486 }
7487}
7488
7489/// Request message for
7490/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7491///
7492/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7493#[derive(Clone, Default, PartialEq)]
7494#[non_exhaustive]
7495pub struct ListVmwareEngineNetworksRequest {
7496 /// Required. The resource name of the location to query for
7497 /// VMware Engine networks. Resource names are schemeless URIs that follow the
7498 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7499 /// example: `projects/my-project/locations/global`
7500 pub parent: std::string::String,
7501
7502 /// The maximum number of results to return in one page.
7503 /// The maximum value is coerced to 1000.
7504 /// The default value of this field is 500.
7505 pub page_size: i32,
7506
7507 /// A page token, received from a previous `ListVmwareEngineNetworks` call.
7508 /// Provide this to retrieve the subsequent page.
7509 ///
7510 /// When paginating, all other parameters provided to
7511 /// `ListVmwareEngineNetworks` must match the call that provided the page
7512 /// token.
7513 pub page_token: std::string::String,
7514
7515 /// A filter expression that matches resources returned in the response.
7516 /// The expression must specify the field name, a comparison
7517 /// operator, and the value that you want to use for filtering. The value
7518 /// must be a string, a number, or a boolean. The comparison operator
7519 /// must be `=`, `!=`, `>`, or `<`.
7520 ///
7521 /// For example, if you are filtering a list of network peerings, you can
7522 /// exclude the ones named `example-network` by specifying
7523 /// `name != "example-network"`.
7524 ///
7525 /// To filter on multiple expressions, provide each separate expression within
7526 /// parentheses. For example:
7527 ///
7528 /// ```norust
7529 /// (name = "example-network")
7530 /// (createTime > "2021-04-12T08:15:10.40Z")
7531 /// ```
7532 ///
7533 /// By default, each expression is an `AND` expression. However, you
7534 /// can include `AND` and `OR` expressions explicitly.
7535 /// For example:
7536 ///
7537 /// ```norust
7538 /// (name = "example-network-1") AND
7539 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7540 /// (name = "example-network-2")
7541 /// ```
7542 pub filter: std::string::String,
7543
7544 /// Sorts list results by a certain order. By default, returned results
7545 /// are ordered by `name` in ascending order.
7546 /// You can also sort results in descending order based on the `name` value
7547 /// using `orderBy="name desc"`.
7548 /// Currently, only ordering by `name` is supported.
7549 pub order_by: std::string::String,
7550
7551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7552}
7553
7554impl ListVmwareEngineNetworksRequest {
7555 pub fn new() -> Self {
7556 std::default::Default::default()
7557 }
7558
7559 /// Sets the value of [parent][crate::model::ListVmwareEngineNetworksRequest::parent].
7560 ///
7561 /// # Example
7562 /// ```ignore,no_run
7563 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7564 /// let x = ListVmwareEngineNetworksRequest::new().set_parent("example");
7565 /// ```
7566 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7567 self.parent = v.into();
7568 self
7569 }
7570
7571 /// Sets the value of [page_size][crate::model::ListVmwareEngineNetworksRequest::page_size].
7572 ///
7573 /// # Example
7574 /// ```ignore,no_run
7575 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7576 /// let x = ListVmwareEngineNetworksRequest::new().set_page_size(42);
7577 /// ```
7578 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7579 self.page_size = v.into();
7580 self
7581 }
7582
7583 /// Sets the value of [page_token][crate::model::ListVmwareEngineNetworksRequest::page_token].
7584 ///
7585 /// # Example
7586 /// ```ignore,no_run
7587 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7588 /// let x = ListVmwareEngineNetworksRequest::new().set_page_token("example");
7589 /// ```
7590 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7591 self.page_token = v.into();
7592 self
7593 }
7594
7595 /// Sets the value of [filter][crate::model::ListVmwareEngineNetworksRequest::filter].
7596 ///
7597 /// # Example
7598 /// ```ignore,no_run
7599 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7600 /// let x = ListVmwareEngineNetworksRequest::new().set_filter("example");
7601 /// ```
7602 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7603 self.filter = v.into();
7604 self
7605 }
7606
7607 /// Sets the value of [order_by][crate::model::ListVmwareEngineNetworksRequest::order_by].
7608 ///
7609 /// # Example
7610 /// ```ignore,no_run
7611 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7612 /// let x = ListVmwareEngineNetworksRequest::new().set_order_by("example");
7613 /// ```
7614 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7615 self.order_by = v.into();
7616 self
7617 }
7618}
7619
7620impl wkt::message::Message for ListVmwareEngineNetworksRequest {
7621 fn typename() -> &'static str {
7622 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"
7623 }
7624}
7625
7626/// Response message for
7627/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7628///
7629/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7630#[derive(Clone, Default, PartialEq)]
7631#[non_exhaustive]
7632pub struct ListVmwareEngineNetworksResponse {
7633 /// A list of VMware Engine networks.
7634 pub vmware_engine_networks: std::vec::Vec<crate::model::VmwareEngineNetwork>,
7635
7636 /// A token, which can be sent as `page_token` to retrieve the next page.
7637 /// If this field is omitted, there are no subsequent pages.
7638 pub next_page_token: std::string::String,
7639
7640 /// Unreachable resources.
7641 pub unreachable: std::vec::Vec<std::string::String>,
7642
7643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7644}
7645
7646impl ListVmwareEngineNetworksResponse {
7647 pub fn new() -> Self {
7648 std::default::Default::default()
7649 }
7650
7651 /// Sets the value of [vmware_engine_networks][crate::model::ListVmwareEngineNetworksResponse::vmware_engine_networks].
7652 ///
7653 /// # Example
7654 /// ```ignore,no_run
7655 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7656 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7657 /// let x = ListVmwareEngineNetworksResponse::new()
7658 /// .set_vmware_engine_networks([
7659 /// VmwareEngineNetwork::default()/* use setters */,
7660 /// VmwareEngineNetwork::default()/* use (different) setters */,
7661 /// ]);
7662 /// ```
7663 pub fn set_vmware_engine_networks<T, V>(mut self, v: T) -> Self
7664 where
7665 T: std::iter::IntoIterator<Item = V>,
7666 V: std::convert::Into<crate::model::VmwareEngineNetwork>,
7667 {
7668 use std::iter::Iterator;
7669 self.vmware_engine_networks = v.into_iter().map(|i| i.into()).collect();
7670 self
7671 }
7672
7673 /// Sets the value of [next_page_token][crate::model::ListVmwareEngineNetworksResponse::next_page_token].
7674 ///
7675 /// # Example
7676 /// ```ignore,no_run
7677 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7678 /// let x = ListVmwareEngineNetworksResponse::new().set_next_page_token("example");
7679 /// ```
7680 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7681 self.next_page_token = v.into();
7682 self
7683 }
7684
7685 /// Sets the value of [unreachable][crate::model::ListVmwareEngineNetworksResponse::unreachable].
7686 ///
7687 /// # Example
7688 /// ```ignore,no_run
7689 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7690 /// let x = ListVmwareEngineNetworksResponse::new().set_unreachable(["a", "b", "c"]);
7691 /// ```
7692 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7693 where
7694 T: std::iter::IntoIterator<Item = V>,
7695 V: std::convert::Into<std::string::String>,
7696 {
7697 use std::iter::Iterator;
7698 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7699 self
7700 }
7701}
7702
7703impl wkt::message::Message for ListVmwareEngineNetworksResponse {
7704 fn typename() -> &'static str {
7705 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"
7706 }
7707}
7708
7709#[doc(hidden)]
7710impl gax::paginator::internal::PageableResponse for ListVmwareEngineNetworksResponse {
7711 type PageItem = crate::model::VmwareEngineNetwork;
7712
7713 fn items(self) -> std::vec::Vec<Self::PageItem> {
7714 self.vmware_engine_networks
7715 }
7716
7717 fn next_page_token(&self) -> std::string::String {
7718 use std::clone::Clone;
7719 self.next_page_token.clone()
7720 }
7721}
7722
7723/// Request message for
7724/// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]
7725///
7726/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]: crate::client::VmwareEngine::create_private_connection
7727#[derive(Clone, Default, PartialEq)]
7728#[non_exhaustive]
7729pub struct CreatePrivateConnectionRequest {
7730 /// Required. The resource name of the location to create the new private
7731 /// connection in. Private connection is a regional resource.
7732 /// Resource names are schemeless URIs that follow the conventions in
7733 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7734 /// `projects/my-project/locations/us-central1`
7735 pub parent: std::string::String,
7736
7737 /// Required. The user-provided identifier of the new private connection.
7738 /// This identifier must be unique among private connection resources
7739 /// within the parent and becomes the final token in the name URI. The
7740 /// identifier must meet the following requirements:
7741 ///
7742 /// * Only contains 1-63 alphanumeric characters and hyphens
7743 /// * Begins with an alphabetical character
7744 /// * Ends with a non-hyphen character
7745 /// * Not formatted as a UUID
7746 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7747 /// (section 3.5)
7748 pub private_connection_id: std::string::String,
7749
7750 /// Required. The initial description of the new private connection.
7751 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
7752
7753 /// Optional. A request ID to identify requests. Specify a unique request ID
7754 /// so that if you must retry your request, the server will know to ignore
7755 /// the request if it has already been completed. The server guarantees that a
7756 /// request doesn't result in creation of duplicate commitments for at least 60
7757 /// minutes.
7758 ///
7759 /// For example, consider a situation where you make an initial request and the
7760 /// request times out. If you make the request again with the same request
7761 /// ID, the server can check if original operation with the same request ID
7762 /// was received, and if so, will ignore the second request. This prevents
7763 /// clients from accidentally creating duplicate commitments.
7764 ///
7765 /// The request ID must be a valid UUID with the exception that zero UUID is
7766 /// not supported (00000000-0000-0000-0000-000000000000).
7767 pub request_id: std::string::String,
7768
7769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7770}
7771
7772impl CreatePrivateConnectionRequest {
7773 pub fn new() -> Self {
7774 std::default::Default::default()
7775 }
7776
7777 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
7778 ///
7779 /// # Example
7780 /// ```ignore,no_run
7781 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7782 /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
7783 /// ```
7784 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7785 self.parent = v.into();
7786 self
7787 }
7788
7789 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
7790 ///
7791 /// # Example
7792 /// ```ignore,no_run
7793 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7794 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
7795 /// ```
7796 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
7797 mut self,
7798 v: T,
7799 ) -> Self {
7800 self.private_connection_id = v.into();
7801 self
7802 }
7803
7804 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7805 ///
7806 /// # Example
7807 /// ```ignore,no_run
7808 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7809 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7810 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
7811 /// ```
7812 pub fn set_private_connection<T>(mut self, v: T) -> Self
7813 where
7814 T: std::convert::Into<crate::model::PrivateConnection>,
7815 {
7816 self.private_connection = std::option::Option::Some(v.into());
7817 self
7818 }
7819
7820 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7821 ///
7822 /// # Example
7823 /// ```ignore,no_run
7824 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7825 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7826 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
7827 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
7828 /// ```
7829 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
7830 where
7831 T: std::convert::Into<crate::model::PrivateConnection>,
7832 {
7833 self.private_connection = v.map(|x| x.into());
7834 self
7835 }
7836
7837 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
7838 ///
7839 /// # Example
7840 /// ```ignore,no_run
7841 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7842 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
7843 /// ```
7844 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7845 self.request_id = v.into();
7846 self
7847 }
7848}
7849
7850impl wkt::message::Message for CreatePrivateConnectionRequest {
7851 fn typename() -> &'static str {
7852 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"
7853 }
7854}
7855
7856/// Request message for
7857/// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]
7858///
7859/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]: crate::client::VmwareEngine::get_private_connection
7860#[derive(Clone, Default, PartialEq)]
7861#[non_exhaustive]
7862pub struct GetPrivateConnectionRequest {
7863 /// Required. The resource name of the private connection to retrieve.
7864 /// Resource names are schemeless URIs that follow the conventions in
7865 /// <https://cloud.google.com/apis/design/resource_names>.
7866 /// For example:
7867 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
7868 pub name: std::string::String,
7869
7870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7871}
7872
7873impl GetPrivateConnectionRequest {
7874 pub fn new() -> Self {
7875 std::default::Default::default()
7876 }
7877
7878 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
7879 ///
7880 /// # Example
7881 /// ```ignore,no_run
7882 /// # use google_cloud_vmwareengine_v1::model::GetPrivateConnectionRequest;
7883 /// let x = GetPrivateConnectionRequest::new().set_name("example");
7884 /// ```
7885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7886 self.name = v.into();
7887 self
7888 }
7889}
7890
7891impl wkt::message::Message for GetPrivateConnectionRequest {
7892 fn typename() -> &'static str {
7893 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"
7894 }
7895}
7896
7897/// Request message for
7898/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
7899///
7900/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
7901#[derive(Clone, Default, PartialEq)]
7902#[non_exhaustive]
7903pub struct ListPrivateConnectionsRequest {
7904 /// Required. The resource name of the location to query for
7905 /// private connections. Resource names are schemeless URIs that follow the
7906 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7907 /// example: `projects/my-project/locations/us-central1`
7908 pub parent: std::string::String,
7909
7910 /// The maximum number of private connections to return in one page.
7911 /// The maximum value is coerced to 1000.
7912 /// The default value of this field is 500.
7913 pub page_size: i32,
7914
7915 /// A page token, received from a previous `ListPrivateConnections` call.
7916 /// Provide this to retrieve the subsequent page.
7917 ///
7918 /// When paginating, all other parameters provided to
7919 /// `ListPrivateConnections` must match the call that provided the page
7920 /// token.
7921 pub page_token: std::string::String,
7922
7923 /// A filter expression that matches resources returned in the response.
7924 /// The expression must specify the field name, a comparison
7925 /// operator, and the value that you want to use for filtering. The value
7926 /// must be a string, a number, or a boolean. The comparison operator
7927 /// must be `=`, `!=`, `>`, or `<`.
7928 ///
7929 /// For example, if you are filtering a list of private connections, you can
7930 /// exclude the ones named `example-connection` by specifying
7931 /// `name != "example-connection"`.
7932 ///
7933 /// To filter on multiple expressions, provide each separate expression within
7934 /// parentheses. For example:
7935 ///
7936 /// ```norust
7937 /// (name = "example-connection")
7938 /// (createTime > "2022-09-22T08:15:10.40Z")
7939 /// ```
7940 ///
7941 /// By default, each expression is an `AND` expression. However, you
7942 /// can include `AND` and `OR` expressions explicitly.
7943 /// For example:
7944 ///
7945 /// ```norust
7946 /// (name = "example-connection-1") AND
7947 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7948 /// (name = "example-connection-2")
7949 /// ```
7950 pub filter: std::string::String,
7951
7952 /// Sorts list results by a certain order. By default, returned results
7953 /// are ordered by `name` in ascending order.
7954 /// You can also sort results in descending order based on the `name` value
7955 /// using `orderBy="name desc"`.
7956 /// Currently, only ordering by `name` is supported.
7957 pub order_by: std::string::String,
7958
7959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7960}
7961
7962impl ListPrivateConnectionsRequest {
7963 pub fn new() -> Self {
7964 std::default::Default::default()
7965 }
7966
7967 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
7968 ///
7969 /// # Example
7970 /// ```ignore,no_run
7971 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7972 /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
7973 /// ```
7974 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7975 self.parent = v.into();
7976 self
7977 }
7978
7979 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
7980 ///
7981 /// # Example
7982 /// ```ignore,no_run
7983 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7984 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
7985 /// ```
7986 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7987 self.page_size = v.into();
7988 self
7989 }
7990
7991 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
7992 ///
7993 /// # Example
7994 /// ```ignore,no_run
7995 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7996 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
7997 /// ```
7998 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7999 self.page_token = v.into();
8000 self
8001 }
8002
8003 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
8004 ///
8005 /// # Example
8006 /// ```ignore,no_run
8007 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8008 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
8009 /// ```
8010 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8011 self.filter = v.into();
8012 self
8013 }
8014
8015 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
8016 ///
8017 /// # Example
8018 /// ```ignore,no_run
8019 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8020 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
8021 /// ```
8022 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8023 self.order_by = v.into();
8024 self
8025 }
8026}
8027
8028impl wkt::message::Message for ListPrivateConnectionsRequest {
8029 fn typename() -> &'static str {
8030 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"
8031 }
8032}
8033
8034/// Response message for
8035/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
8036///
8037/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
8038#[derive(Clone, Default, PartialEq)]
8039#[non_exhaustive]
8040pub struct ListPrivateConnectionsResponse {
8041 /// A list of private connections.
8042 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
8043
8044 /// A token, which can be sent as `page_token` to retrieve the next page.
8045 /// If this field is omitted, there are no subsequent pages.
8046 pub next_page_token: std::string::String,
8047
8048 /// Unreachable resources.
8049 pub unreachable: std::vec::Vec<std::string::String>,
8050
8051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8052}
8053
8054impl ListPrivateConnectionsResponse {
8055 pub fn new() -> Self {
8056 std::default::Default::default()
8057 }
8058
8059 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
8060 ///
8061 /// # Example
8062 /// ```ignore,no_run
8063 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8064 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8065 /// let x = ListPrivateConnectionsResponse::new()
8066 /// .set_private_connections([
8067 /// PrivateConnection::default()/* use setters */,
8068 /// PrivateConnection::default()/* use (different) setters */,
8069 /// ]);
8070 /// ```
8071 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
8072 where
8073 T: std::iter::IntoIterator<Item = V>,
8074 V: std::convert::Into<crate::model::PrivateConnection>,
8075 {
8076 use std::iter::Iterator;
8077 self.private_connections = v.into_iter().map(|i| i.into()).collect();
8078 self
8079 }
8080
8081 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
8082 ///
8083 /// # Example
8084 /// ```ignore,no_run
8085 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8086 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
8087 /// ```
8088 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8089 self.next_page_token = v.into();
8090 self
8091 }
8092
8093 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
8094 ///
8095 /// # Example
8096 /// ```ignore,no_run
8097 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8098 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
8099 /// ```
8100 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8101 where
8102 T: std::iter::IntoIterator<Item = V>,
8103 V: std::convert::Into<std::string::String>,
8104 {
8105 use std::iter::Iterator;
8106 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8107 self
8108 }
8109}
8110
8111impl wkt::message::Message for ListPrivateConnectionsResponse {
8112 fn typename() -> &'static str {
8113 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"
8114 }
8115}
8116
8117#[doc(hidden)]
8118impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
8119 type PageItem = crate::model::PrivateConnection;
8120
8121 fn items(self) -> std::vec::Vec<Self::PageItem> {
8122 self.private_connections
8123 }
8124
8125 fn next_page_token(&self) -> std::string::String {
8126 use std::clone::Clone;
8127 self.next_page_token.clone()
8128 }
8129}
8130
8131/// Request message for
8132/// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]
8133///
8134/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]: crate::client::VmwareEngine::update_private_connection
8135#[derive(Clone, Default, PartialEq)]
8136#[non_exhaustive]
8137pub struct UpdatePrivateConnectionRequest {
8138 /// Required. Private connection description.
8139 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
8140
8141 /// Required. Field mask is used to specify the fields to be overwritten in the
8142 /// `PrivateConnection` resource by the update.
8143 /// The fields specified in the `update_mask` are relative to the resource, not
8144 /// the full request. A field will be overwritten if it is in the mask. If the
8145 /// user does not provide a mask then all fields will be overwritten.
8146 pub update_mask: std::option::Option<wkt::FieldMask>,
8147
8148 /// Optional. A request ID to identify requests. Specify a unique request ID
8149 /// so that if you must retry your request, the server will know to ignore
8150 /// the request if it has already been completed. The server guarantees that a
8151 /// request doesn't result in creation of duplicate commitments for at least 60
8152 /// minutes.
8153 ///
8154 /// For example, consider a situation where you make an initial request and the
8155 /// request times out. If you make the request again with the same request
8156 /// ID, the server can check if original operation with the same request ID
8157 /// was received, and if so, will ignore the second request. This prevents
8158 /// clients from accidentally creating duplicate commitments.
8159 ///
8160 /// The request ID must be a valid UUID with the exception that zero UUID is
8161 /// not supported (00000000-0000-0000-0000-000000000000).
8162 pub request_id: std::string::String,
8163
8164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8165}
8166
8167impl UpdatePrivateConnectionRequest {
8168 pub fn new() -> Self {
8169 std::default::Default::default()
8170 }
8171
8172 /// Sets the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8173 ///
8174 /// # Example
8175 /// ```ignore,no_run
8176 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8177 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8178 /// let x = UpdatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
8179 /// ```
8180 pub fn set_private_connection<T>(mut self, v: T) -> Self
8181 where
8182 T: std::convert::Into<crate::model::PrivateConnection>,
8183 {
8184 self.private_connection = std::option::Option::Some(v.into());
8185 self
8186 }
8187
8188 /// Sets or clears the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8189 ///
8190 /// # Example
8191 /// ```ignore,no_run
8192 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8193 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8194 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
8195 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
8196 /// ```
8197 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
8198 where
8199 T: std::convert::Into<crate::model::PrivateConnection>,
8200 {
8201 self.private_connection = v.map(|x| x.into());
8202 self
8203 }
8204
8205 /// Sets the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8206 ///
8207 /// # Example
8208 /// ```ignore,no_run
8209 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8210 /// use wkt::FieldMask;
8211 /// let x = UpdatePrivateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8212 /// ```
8213 pub fn set_update_mask<T>(mut self, v: T) -> Self
8214 where
8215 T: std::convert::Into<wkt::FieldMask>,
8216 {
8217 self.update_mask = std::option::Option::Some(v.into());
8218 self
8219 }
8220
8221 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8222 ///
8223 /// # Example
8224 /// ```ignore,no_run
8225 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8226 /// use wkt::FieldMask;
8227 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8228 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8229 /// ```
8230 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8231 where
8232 T: std::convert::Into<wkt::FieldMask>,
8233 {
8234 self.update_mask = v.map(|x| x.into());
8235 self
8236 }
8237
8238 /// Sets the value of [request_id][crate::model::UpdatePrivateConnectionRequest::request_id].
8239 ///
8240 /// # Example
8241 /// ```ignore,no_run
8242 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8243 /// let x = UpdatePrivateConnectionRequest::new().set_request_id("example");
8244 /// ```
8245 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8246 self.request_id = v.into();
8247 self
8248 }
8249}
8250
8251impl wkt::message::Message for UpdatePrivateConnectionRequest {
8252 fn typename() -> &'static str {
8253 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"
8254 }
8255}
8256
8257/// Request message for
8258/// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]
8259///
8260/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]: crate::client::VmwareEngine::delete_private_connection
8261#[derive(Clone, Default, PartialEq)]
8262#[non_exhaustive]
8263pub struct DeletePrivateConnectionRequest {
8264 /// Required. The resource name of the private connection to be deleted.
8265 /// Resource names are schemeless URIs that follow the conventions in
8266 /// <https://cloud.google.com/apis/design/resource_names>.
8267 /// For example:
8268 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
8269 pub name: std::string::String,
8270
8271 /// Optional. A request ID to identify requests. Specify a unique request ID
8272 /// so that if you must retry your request, the server will know to ignore
8273 /// the request if it has already been completed. The server guarantees that a
8274 /// request doesn't result in creation of duplicate commitments for at least 60
8275 /// minutes.
8276 ///
8277 /// For example, consider a situation where you make an initial request and the
8278 /// request times out. If you make the request again with the same request
8279 /// ID, the server can check if original operation with the same request ID
8280 /// was received, and if so, will ignore the second request. This prevents
8281 /// clients from accidentally creating duplicate commitments.
8282 ///
8283 /// The request ID must be a valid UUID with the exception that zero UUID is
8284 /// not supported (00000000-0000-0000-0000-000000000000).
8285 pub request_id: std::string::String,
8286
8287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8288}
8289
8290impl DeletePrivateConnectionRequest {
8291 pub fn new() -> Self {
8292 std::default::Default::default()
8293 }
8294
8295 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
8296 ///
8297 /// # Example
8298 /// ```ignore,no_run
8299 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8300 /// let x = DeletePrivateConnectionRequest::new().set_name("example");
8301 /// ```
8302 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8303 self.name = v.into();
8304 self
8305 }
8306
8307 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
8308 ///
8309 /// # Example
8310 /// ```ignore,no_run
8311 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8312 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
8313 /// ```
8314 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8315 self.request_id = v.into();
8316 self
8317 }
8318}
8319
8320impl wkt::message::Message for DeletePrivateConnectionRequest {
8321 fn typename() -> &'static str {
8322 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"
8323 }
8324}
8325
8326/// Request message for
8327/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8328///
8329/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8330#[derive(Clone, Default, PartialEq)]
8331#[non_exhaustive]
8332pub struct ListPrivateConnectionPeeringRoutesRequest {
8333 /// Required. The resource name of the private connection to retrieve peering
8334 /// routes from. Resource names are schemeless URIs that follow the conventions
8335 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
8336 /// `projects/my-project/locations/us-west1/privateConnections/my-connection`
8337 pub parent: std::string::String,
8338
8339 /// The maximum number of peering routes to return in one page.
8340 /// The service may return fewer than this value.
8341 /// The maximum value is coerced to 1000.
8342 /// The default value of this field is 500.
8343 pub page_size: i32,
8344
8345 /// A page token, received from a previous `ListPrivateConnectionPeeringRoutes`
8346 /// call. Provide this to retrieve the subsequent page. When paginating, all
8347 /// other parameters provided to `ListPrivateConnectionPeeringRoutes` must
8348 /// match the call that provided the page token.
8349 pub page_token: std::string::String,
8350
8351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8352}
8353
8354impl ListPrivateConnectionPeeringRoutesRequest {
8355 pub fn new() -> Self {
8356 std::default::Default::default()
8357 }
8358
8359 /// Sets the value of [parent][crate::model::ListPrivateConnectionPeeringRoutesRequest::parent].
8360 ///
8361 /// # Example
8362 /// ```ignore,no_run
8363 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8364 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_parent("example");
8365 /// ```
8366 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8367 self.parent = v.into();
8368 self
8369 }
8370
8371 /// Sets the value of [page_size][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_size].
8372 ///
8373 /// # Example
8374 /// ```ignore,no_run
8375 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8376 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_size(42);
8377 /// ```
8378 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8379 self.page_size = v.into();
8380 self
8381 }
8382
8383 /// Sets the value of [page_token][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_token].
8384 ///
8385 /// # Example
8386 /// ```ignore,no_run
8387 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8388 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_token("example");
8389 /// ```
8390 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8391 self.page_token = v.into();
8392 self
8393 }
8394}
8395
8396impl wkt::message::Message for ListPrivateConnectionPeeringRoutesRequest {
8397 fn typename() -> &'static str {
8398 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"
8399 }
8400}
8401
8402/// Response message for
8403/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8404///
8405/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8406#[derive(Clone, Default, PartialEq)]
8407#[non_exhaustive]
8408pub struct ListPrivateConnectionPeeringRoutesResponse {
8409 /// A list of peering routes.
8410 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
8411
8412 /// A token, which can be sent as `page_token` to retrieve the next page.
8413 /// If this field is omitted, there are no subsequent pages.
8414 pub next_page_token: std::string::String,
8415
8416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8417}
8418
8419impl ListPrivateConnectionPeeringRoutesResponse {
8420 pub fn new() -> Self {
8421 std::default::Default::default()
8422 }
8423
8424 /// Sets the value of [peering_routes][crate::model::ListPrivateConnectionPeeringRoutesResponse::peering_routes].
8425 ///
8426 /// # Example
8427 /// ```ignore,no_run
8428 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8429 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
8430 /// let x = ListPrivateConnectionPeeringRoutesResponse::new()
8431 /// .set_peering_routes([
8432 /// PeeringRoute::default()/* use setters */,
8433 /// PeeringRoute::default()/* use (different) setters */,
8434 /// ]);
8435 /// ```
8436 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
8437 where
8438 T: std::iter::IntoIterator<Item = V>,
8439 V: std::convert::Into<crate::model::PeeringRoute>,
8440 {
8441 use std::iter::Iterator;
8442 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
8443 self
8444 }
8445
8446 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionPeeringRoutesResponse::next_page_token].
8447 ///
8448 /// # Example
8449 /// ```ignore,no_run
8450 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8451 /// let x = ListPrivateConnectionPeeringRoutesResponse::new().set_next_page_token("example");
8452 /// ```
8453 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8454 self.next_page_token = v.into();
8455 self
8456 }
8457}
8458
8459impl wkt::message::Message for ListPrivateConnectionPeeringRoutesResponse {
8460 fn typename() -> &'static str {
8461 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"
8462 }
8463}
8464
8465#[doc(hidden)]
8466impl gax::paginator::internal::PageableResponse for ListPrivateConnectionPeeringRoutesResponse {
8467 type PageItem = crate::model::PeeringRoute;
8468
8469 fn items(self) -> std::vec::Vec<Self::PageItem> {
8470 self.peering_routes
8471 }
8472
8473 fn next_page_token(&self) -> std::string::String {
8474 use std::clone::Clone;
8475 self.next_page_token.clone()
8476 }
8477}
8478
8479/// Request message for
8480/// [VmwareEngine.GrantDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]
8481///
8482/// [google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]: crate::client::VmwareEngine::grant_dns_bind_permission
8483#[derive(Clone, Default, PartialEq)]
8484#[non_exhaustive]
8485pub struct GrantDnsBindPermissionRequest {
8486 /// Required. The name of the resource which stores the users/service accounts
8487 /// having the permission to bind to the corresponding intranet VPC of the
8488 /// consumer project. DnsBindPermission is a global resource. Resource names
8489 /// are schemeless URIs that follow the conventions in
8490 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8491 /// `projects/my-project/locations/global/dnsBindPermission`
8492 pub name: std::string::String,
8493
8494 /// Required. The consumer provided user/service account which needs to be
8495 /// granted permission to bind with the intranet VPC corresponding to the
8496 /// consumer project.
8497 pub principal: std::option::Option<crate::model::Principal>,
8498
8499 /// Optional. A request ID to identify requests. Specify a unique request ID
8500 /// so that if you must retry your request, the server will know to ignore
8501 /// the request if it has already been completed. The server guarantees that a
8502 /// request doesn't result in creation of duplicate commitments for at least 60
8503 /// minutes.
8504 ///
8505 /// For example, consider a situation where you make an initial request and the
8506 /// request times out. If you make the request again with the same request
8507 /// ID, the server can check if original operation with the same request ID
8508 /// was received, and if so, will ignore the second request. This prevents
8509 /// clients from accidentally creating duplicate commitments.
8510 ///
8511 /// The request ID must be a valid UUID with the exception that zero UUID is
8512 /// not supported (00000000-0000-0000-0000-000000000000).
8513 pub request_id: std::string::String,
8514
8515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8516}
8517
8518impl GrantDnsBindPermissionRequest {
8519 pub fn new() -> Self {
8520 std::default::Default::default()
8521 }
8522
8523 /// Sets the value of [name][crate::model::GrantDnsBindPermissionRequest::name].
8524 ///
8525 /// # Example
8526 /// ```ignore,no_run
8527 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8528 /// let x = GrantDnsBindPermissionRequest::new().set_name("example");
8529 /// ```
8530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8531 self.name = v.into();
8532 self
8533 }
8534
8535 /// Sets the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8536 ///
8537 /// # Example
8538 /// ```ignore,no_run
8539 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8540 /// use google_cloud_vmwareengine_v1::model::Principal;
8541 /// let x = GrantDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8542 /// ```
8543 pub fn set_principal<T>(mut self, v: T) -> Self
8544 where
8545 T: std::convert::Into<crate::model::Principal>,
8546 {
8547 self.principal = std::option::Option::Some(v.into());
8548 self
8549 }
8550
8551 /// Sets or clears the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8552 ///
8553 /// # Example
8554 /// ```ignore,no_run
8555 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8556 /// use google_cloud_vmwareengine_v1::model::Principal;
8557 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8558 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8559 /// ```
8560 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8561 where
8562 T: std::convert::Into<crate::model::Principal>,
8563 {
8564 self.principal = v.map(|x| x.into());
8565 self
8566 }
8567
8568 /// Sets the value of [request_id][crate::model::GrantDnsBindPermissionRequest::request_id].
8569 ///
8570 /// # Example
8571 /// ```ignore,no_run
8572 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8573 /// let x = GrantDnsBindPermissionRequest::new().set_request_id("example");
8574 /// ```
8575 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8576 self.request_id = v.into();
8577 self
8578 }
8579}
8580
8581impl wkt::message::Message for GrantDnsBindPermissionRequest {
8582 fn typename() -> &'static str {
8583 "type.googleapis.com/google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest"
8584 }
8585}
8586
8587/// Request message for
8588/// [VmwareEngine.RevokeDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]
8589///
8590/// [google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]: crate::client::VmwareEngine::revoke_dns_bind_permission
8591#[derive(Clone, Default, PartialEq)]
8592#[non_exhaustive]
8593pub struct RevokeDnsBindPermissionRequest {
8594 /// Required. The name of the resource which stores the users/service accounts
8595 /// having the permission to bind to the corresponding intranet VPC of the
8596 /// consumer project. DnsBindPermission is a global resource. Resource names
8597 /// are schemeless URIs that follow the conventions in
8598 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8599 /// `projects/my-project/locations/global/dnsBindPermission`
8600 pub name: std::string::String,
8601
8602 /// Required. The consumer provided user/service account which needs to be
8603 /// granted permission to bind with the intranet VPC corresponding to the
8604 /// consumer project.
8605 pub principal: std::option::Option<crate::model::Principal>,
8606
8607 /// Optional. A request ID to identify requests. Specify a unique request ID
8608 /// so that if you must retry your request, the server will know to ignore
8609 /// the request if it has already been completed. The server guarantees that a
8610 /// request doesn't result in creation of duplicate commitments for at least 60
8611 /// minutes.
8612 ///
8613 /// For example, consider a situation where you make an initial request and the
8614 /// request times out. If you make the request again with the same request
8615 /// ID, the server can check if original operation with the same request ID
8616 /// was received, and if so, will ignore the second request. This prevents
8617 /// clients from accidentally creating duplicate commitments.
8618 ///
8619 /// The request ID must be a valid UUID with the exception that zero UUID is
8620 /// not supported (00000000-0000-0000-0000-000000000000).
8621 pub request_id: std::string::String,
8622
8623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8624}
8625
8626impl RevokeDnsBindPermissionRequest {
8627 pub fn new() -> Self {
8628 std::default::Default::default()
8629 }
8630
8631 /// Sets the value of [name][crate::model::RevokeDnsBindPermissionRequest::name].
8632 ///
8633 /// # Example
8634 /// ```ignore,no_run
8635 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8636 /// let x = RevokeDnsBindPermissionRequest::new().set_name("example");
8637 /// ```
8638 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8639 self.name = v.into();
8640 self
8641 }
8642
8643 /// Sets the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8644 ///
8645 /// # Example
8646 /// ```ignore,no_run
8647 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8648 /// use google_cloud_vmwareengine_v1::model::Principal;
8649 /// let x = RevokeDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8650 /// ```
8651 pub fn set_principal<T>(mut self, v: T) -> Self
8652 where
8653 T: std::convert::Into<crate::model::Principal>,
8654 {
8655 self.principal = std::option::Option::Some(v.into());
8656 self
8657 }
8658
8659 /// Sets or clears the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8660 ///
8661 /// # Example
8662 /// ```ignore,no_run
8663 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8664 /// use google_cloud_vmwareengine_v1::model::Principal;
8665 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8666 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8667 /// ```
8668 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8669 where
8670 T: std::convert::Into<crate::model::Principal>,
8671 {
8672 self.principal = v.map(|x| x.into());
8673 self
8674 }
8675
8676 /// Sets the value of [request_id][crate::model::RevokeDnsBindPermissionRequest::request_id].
8677 ///
8678 /// # Example
8679 /// ```ignore,no_run
8680 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8681 /// let x = RevokeDnsBindPermissionRequest::new().set_request_id("example");
8682 /// ```
8683 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8684 self.request_id = v.into();
8685 self
8686 }
8687}
8688
8689impl wkt::message::Message for RevokeDnsBindPermissionRequest {
8690 fn typename() -> &'static str {
8691 "type.googleapis.com/google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest"
8692 }
8693}
8694
8695/// Request message for
8696/// [VmwareEngine.GetDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]
8697///
8698/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]: crate::client::VmwareEngine::get_dns_bind_permission
8699#[derive(Clone, Default, PartialEq)]
8700#[non_exhaustive]
8701pub struct GetDnsBindPermissionRequest {
8702 /// Required. The name of the resource which stores the users/service accounts
8703 /// having the permission to bind to the corresponding intranet VPC of the
8704 /// consumer project. DnsBindPermission is a global resource. Resource names
8705 /// are schemeless URIs that follow the conventions in
8706 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8707 /// `projects/my-project/locations/global/dnsBindPermission`
8708 pub name: std::string::String,
8709
8710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8711}
8712
8713impl GetDnsBindPermissionRequest {
8714 pub fn new() -> Self {
8715 std::default::Default::default()
8716 }
8717
8718 /// Sets the value of [name][crate::model::GetDnsBindPermissionRequest::name].
8719 ///
8720 /// # Example
8721 /// ```ignore,no_run
8722 /// # use google_cloud_vmwareengine_v1::model::GetDnsBindPermissionRequest;
8723 /// let x = GetDnsBindPermissionRequest::new().set_name("example");
8724 /// ```
8725 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8726 self.name = v.into();
8727 self
8728 }
8729}
8730
8731impl wkt::message::Message for GetDnsBindPermissionRequest {
8732 fn typename() -> &'static str {
8733 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest"
8734 }
8735}
8736
8737/// Network configuration in the consumer project
8738/// with which the peering has to be done.
8739#[derive(Clone, Default, PartialEq)]
8740#[non_exhaustive]
8741pub struct NetworkConfig {
8742 /// Required. Management CIDR used by VMware management appliances.
8743 pub management_cidr: std::string::String,
8744
8745 /// Optional. The relative resource name of the VMware Engine network attached
8746 /// to the private cloud. Specify the name in the following form:
8747 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8748 /// where `{project}` can either be a project number or a project ID.
8749 pub vmware_engine_network: std::string::String,
8750
8751 /// Output only. The canonical name of the VMware Engine network in the form:
8752 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8753 pub vmware_engine_network_canonical: std::string::String,
8754
8755 /// Output only. The IP address layout version of the management IP address
8756 /// range. Possible versions include:
8757 ///
8758 /// * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address
8759 /// layout used by some existing private clouds. This is no longer supported
8760 /// for new private clouds as it does not support all features.
8761 /// * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address
8762 /// layout used by all newly created private clouds. This version supports all
8763 /// current features.
8764 pub management_ip_address_layout_version: i32,
8765
8766 /// Output only. DNS Server IP of the Private Cloud.
8767 /// All DNS queries can be forwarded to this address for name resolution of
8768 /// Private Cloud's management entities like vCenter, NSX-T Manager and
8769 /// ESXi hosts.
8770 pub dns_server_ip: std::string::String,
8771
8772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8773}
8774
8775impl NetworkConfig {
8776 pub fn new() -> Self {
8777 std::default::Default::default()
8778 }
8779
8780 /// Sets the value of [management_cidr][crate::model::NetworkConfig::management_cidr].
8781 ///
8782 /// # Example
8783 /// ```ignore,no_run
8784 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8785 /// let x = NetworkConfig::new().set_management_cidr("example");
8786 /// ```
8787 pub fn set_management_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8788 self.management_cidr = v.into();
8789 self
8790 }
8791
8792 /// Sets the value of [vmware_engine_network][crate::model::NetworkConfig::vmware_engine_network].
8793 ///
8794 /// # Example
8795 /// ```ignore,no_run
8796 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8797 /// let x = NetworkConfig::new().set_vmware_engine_network("example");
8798 /// ```
8799 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
8800 mut self,
8801 v: T,
8802 ) -> Self {
8803 self.vmware_engine_network = v.into();
8804 self
8805 }
8806
8807 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkConfig::vmware_engine_network_canonical].
8808 ///
8809 /// # Example
8810 /// ```ignore,no_run
8811 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8812 /// let x = NetworkConfig::new().set_vmware_engine_network_canonical("example");
8813 /// ```
8814 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
8815 mut self,
8816 v: T,
8817 ) -> Self {
8818 self.vmware_engine_network_canonical = v.into();
8819 self
8820 }
8821
8822 /// Sets the value of [management_ip_address_layout_version][crate::model::NetworkConfig::management_ip_address_layout_version].
8823 ///
8824 /// # Example
8825 /// ```ignore,no_run
8826 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8827 /// let x = NetworkConfig::new().set_management_ip_address_layout_version(42);
8828 /// ```
8829 pub fn set_management_ip_address_layout_version<T: std::convert::Into<i32>>(
8830 mut self,
8831 v: T,
8832 ) -> Self {
8833 self.management_ip_address_layout_version = v.into();
8834 self
8835 }
8836
8837 /// Sets the value of [dns_server_ip][crate::model::NetworkConfig::dns_server_ip].
8838 ///
8839 /// # Example
8840 /// ```ignore,no_run
8841 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8842 /// let x = NetworkConfig::new().set_dns_server_ip("example");
8843 /// ```
8844 pub fn set_dns_server_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8845 self.dns_server_ip = v.into();
8846 self
8847 }
8848}
8849
8850impl wkt::message::Message for NetworkConfig {
8851 fn typename() -> &'static str {
8852 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkConfig"
8853 }
8854}
8855
8856/// Information about the type and number of nodes associated with the cluster.
8857#[derive(Clone, Default, PartialEq)]
8858#[non_exhaustive]
8859pub struct NodeTypeConfig {
8860 /// Required. The number of nodes of this type in the cluster
8861 pub node_count: i32,
8862
8863 /// Optional. Customized number of cores available to each node of the type.
8864 /// This number must always be one of `nodeType.availableCustomCoreCounts`.
8865 /// If zero is provided max value from `nodeType.availableCustomCoreCounts`
8866 /// will be used.
8867 pub custom_core_count: i32,
8868
8869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8870}
8871
8872impl NodeTypeConfig {
8873 pub fn new() -> Self {
8874 std::default::Default::default()
8875 }
8876
8877 /// Sets the value of [node_count][crate::model::NodeTypeConfig::node_count].
8878 ///
8879 /// # Example
8880 /// ```ignore,no_run
8881 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8882 /// let x = NodeTypeConfig::new().set_node_count(42);
8883 /// ```
8884 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8885 self.node_count = v.into();
8886 self
8887 }
8888
8889 /// Sets the value of [custom_core_count][crate::model::NodeTypeConfig::custom_core_count].
8890 ///
8891 /// # Example
8892 /// ```ignore,no_run
8893 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8894 /// let x = NodeTypeConfig::new().set_custom_core_count(42);
8895 /// ```
8896 pub fn set_custom_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8897 self.custom_core_count = v.into();
8898 self
8899 }
8900}
8901
8902impl wkt::message::Message for NodeTypeConfig {
8903 fn typename() -> &'static str {
8904 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeTypeConfig"
8905 }
8906}
8907
8908/// Configuration of a stretched cluster.
8909#[derive(Clone, Default, PartialEq)]
8910#[non_exhaustive]
8911pub struct StretchedClusterConfig {
8912 /// Required. Zone that will remain operational when connection between the two
8913 /// zones is lost. Specify the resource name of a zone that belongs to the
8914 /// region of the private cloud. For example:
8915 /// `projects/{project}/locations/europe-west3-a` where `{project}` can either
8916 /// be a project number or a project ID.
8917 pub preferred_location: std::string::String,
8918
8919 /// Required. Additional zone for a higher level of availability and load
8920 /// balancing. Specify the resource name of a zone that belongs to the region
8921 /// of the private cloud. For example:
8922 /// `projects/{project}/locations/europe-west3-b` where `{project}` can either
8923 /// be a project number or a project ID.
8924 pub secondary_location: std::string::String,
8925
8926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8927}
8928
8929impl StretchedClusterConfig {
8930 pub fn new() -> Self {
8931 std::default::Default::default()
8932 }
8933
8934 /// Sets the value of [preferred_location][crate::model::StretchedClusterConfig::preferred_location].
8935 ///
8936 /// # Example
8937 /// ```ignore,no_run
8938 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8939 /// let x = StretchedClusterConfig::new().set_preferred_location("example");
8940 /// ```
8941 pub fn set_preferred_location<T: std::convert::Into<std::string::String>>(
8942 mut self,
8943 v: T,
8944 ) -> Self {
8945 self.preferred_location = v.into();
8946 self
8947 }
8948
8949 /// Sets the value of [secondary_location][crate::model::StretchedClusterConfig::secondary_location].
8950 ///
8951 /// # Example
8952 /// ```ignore,no_run
8953 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8954 /// let x = StretchedClusterConfig::new().set_secondary_location("example");
8955 /// ```
8956 pub fn set_secondary_location<T: std::convert::Into<std::string::String>>(
8957 mut self,
8958 v: T,
8959 ) -> Self {
8960 self.secondary_location = v.into();
8961 self
8962 }
8963}
8964
8965impl wkt::message::Message for StretchedClusterConfig {
8966 fn typename() -> &'static str {
8967 "type.googleapis.com/google.cloud.vmwareengine.v1.StretchedClusterConfig"
8968 }
8969}
8970
8971/// Represents a private cloud resource. Private clouds of type `STANDARD` and
8972/// `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are
8973/// regional.
8974#[derive(Clone, Default, PartialEq)]
8975#[non_exhaustive]
8976pub struct PrivateCloud {
8977 /// Output only. The resource name of this private cloud.
8978 /// Resource names are schemeless URIs that follow the conventions in
8979 /// <https://cloud.google.com/apis/design/resource_names>.
8980 /// For example:
8981 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
8982 pub name: std::string::String,
8983
8984 /// Output only. Creation time of this resource.
8985 pub create_time: std::option::Option<wkt::Timestamp>,
8986
8987 /// Output only. Last update time of this resource.
8988 pub update_time: std::option::Option<wkt::Timestamp>,
8989
8990 /// Output only. Time when the resource was scheduled for deletion.
8991 pub delete_time: std::option::Option<wkt::Timestamp>,
8992
8993 /// Output only. Time when the resource will be irreversibly deleted.
8994 pub expire_time: std::option::Option<wkt::Timestamp>,
8995
8996 /// Output only. State of the resource. New values may be added to this enum
8997 /// when appropriate.
8998 pub state: crate::model::private_cloud::State,
8999
9000 /// Required. Network configuration of the private cloud.
9001 pub network_config: std::option::Option<crate::model::NetworkConfig>,
9002
9003 /// Required. Input only. The management cluster for this private cloud.
9004 /// This field is required during creation of the private cloud to provide
9005 /// details for the default cluster.
9006 ///
9007 /// The following fields can't be changed after private cloud creation:
9008 /// `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.
9009 pub management_cluster: std::option::Option<crate::model::private_cloud::ManagementCluster>,
9010
9011 /// User-provided description for this private cloud.
9012 pub description: std::string::String,
9013
9014 /// Output only. HCX appliance.
9015 pub hcx: std::option::Option<crate::model::Hcx>,
9016
9017 /// Output only. NSX appliance.
9018 pub nsx: std::option::Option<crate::model::Nsx>,
9019
9020 /// Output only. Vcenter appliance.
9021 pub vcenter: std::option::Option<crate::model::Vcenter>,
9022
9023 /// Output only. System-generated unique identifier for the resource.
9024 pub uid: std::string::String,
9025
9026 /// Optional. Type of the private cloud. Defaults to STANDARD.
9027 pub r#type: crate::model::private_cloud::Type,
9028
9029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9030}
9031
9032impl PrivateCloud {
9033 pub fn new() -> Self {
9034 std::default::Default::default()
9035 }
9036
9037 /// Sets the value of [name][crate::model::PrivateCloud::name].
9038 ///
9039 /// # Example
9040 /// ```ignore,no_run
9041 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9042 /// let x = PrivateCloud::new().set_name("example");
9043 /// ```
9044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9045 self.name = v.into();
9046 self
9047 }
9048
9049 /// Sets the value of [create_time][crate::model::PrivateCloud::create_time].
9050 ///
9051 /// # Example
9052 /// ```ignore,no_run
9053 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9054 /// use wkt::Timestamp;
9055 /// let x = PrivateCloud::new().set_create_time(Timestamp::default()/* use setters */);
9056 /// ```
9057 pub fn set_create_time<T>(mut self, v: T) -> Self
9058 where
9059 T: std::convert::Into<wkt::Timestamp>,
9060 {
9061 self.create_time = std::option::Option::Some(v.into());
9062 self
9063 }
9064
9065 /// Sets or clears the value of [create_time][crate::model::PrivateCloud::create_time].
9066 ///
9067 /// # Example
9068 /// ```ignore,no_run
9069 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9070 /// use wkt::Timestamp;
9071 /// let x = PrivateCloud::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9072 /// let x = PrivateCloud::new().set_or_clear_create_time(None::<Timestamp>);
9073 /// ```
9074 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9075 where
9076 T: std::convert::Into<wkt::Timestamp>,
9077 {
9078 self.create_time = v.map(|x| x.into());
9079 self
9080 }
9081
9082 /// Sets the value of [update_time][crate::model::PrivateCloud::update_time].
9083 ///
9084 /// # Example
9085 /// ```ignore,no_run
9086 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9087 /// use wkt::Timestamp;
9088 /// let x = PrivateCloud::new().set_update_time(Timestamp::default()/* use setters */);
9089 /// ```
9090 pub fn set_update_time<T>(mut self, v: T) -> Self
9091 where
9092 T: std::convert::Into<wkt::Timestamp>,
9093 {
9094 self.update_time = std::option::Option::Some(v.into());
9095 self
9096 }
9097
9098 /// Sets or clears the value of [update_time][crate::model::PrivateCloud::update_time].
9099 ///
9100 /// # Example
9101 /// ```ignore,no_run
9102 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9103 /// use wkt::Timestamp;
9104 /// let x = PrivateCloud::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9105 /// let x = PrivateCloud::new().set_or_clear_update_time(None::<Timestamp>);
9106 /// ```
9107 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9108 where
9109 T: std::convert::Into<wkt::Timestamp>,
9110 {
9111 self.update_time = v.map(|x| x.into());
9112 self
9113 }
9114
9115 /// Sets the value of [delete_time][crate::model::PrivateCloud::delete_time].
9116 ///
9117 /// # Example
9118 /// ```ignore,no_run
9119 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9120 /// use wkt::Timestamp;
9121 /// let x = PrivateCloud::new().set_delete_time(Timestamp::default()/* use setters */);
9122 /// ```
9123 pub fn set_delete_time<T>(mut self, v: T) -> Self
9124 where
9125 T: std::convert::Into<wkt::Timestamp>,
9126 {
9127 self.delete_time = std::option::Option::Some(v.into());
9128 self
9129 }
9130
9131 /// Sets or clears the value of [delete_time][crate::model::PrivateCloud::delete_time].
9132 ///
9133 /// # Example
9134 /// ```ignore,no_run
9135 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9136 /// use wkt::Timestamp;
9137 /// let x = PrivateCloud::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
9138 /// let x = PrivateCloud::new().set_or_clear_delete_time(None::<Timestamp>);
9139 /// ```
9140 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9141 where
9142 T: std::convert::Into<wkt::Timestamp>,
9143 {
9144 self.delete_time = v.map(|x| x.into());
9145 self
9146 }
9147
9148 /// Sets the value of [expire_time][crate::model::PrivateCloud::expire_time].
9149 ///
9150 /// # Example
9151 /// ```ignore,no_run
9152 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9153 /// use wkt::Timestamp;
9154 /// let x = PrivateCloud::new().set_expire_time(Timestamp::default()/* use setters */);
9155 /// ```
9156 pub fn set_expire_time<T>(mut self, v: T) -> Self
9157 where
9158 T: std::convert::Into<wkt::Timestamp>,
9159 {
9160 self.expire_time = std::option::Option::Some(v.into());
9161 self
9162 }
9163
9164 /// Sets or clears the value of [expire_time][crate::model::PrivateCloud::expire_time].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9169 /// use wkt::Timestamp;
9170 /// let x = PrivateCloud::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
9171 /// let x = PrivateCloud::new().set_or_clear_expire_time(None::<Timestamp>);
9172 /// ```
9173 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9174 where
9175 T: std::convert::Into<wkt::Timestamp>,
9176 {
9177 self.expire_time = v.map(|x| x.into());
9178 self
9179 }
9180
9181 /// Sets the value of [state][crate::model::PrivateCloud::state].
9182 ///
9183 /// # Example
9184 /// ```ignore,no_run
9185 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9186 /// use google_cloud_vmwareengine_v1::model::private_cloud::State;
9187 /// let x0 = PrivateCloud::new().set_state(State::Active);
9188 /// let x1 = PrivateCloud::new().set_state(State::Creating);
9189 /// let x2 = PrivateCloud::new().set_state(State::Updating);
9190 /// ```
9191 pub fn set_state<T: std::convert::Into<crate::model::private_cloud::State>>(
9192 mut self,
9193 v: T,
9194 ) -> Self {
9195 self.state = v.into();
9196 self
9197 }
9198
9199 /// Sets the value of [network_config][crate::model::PrivateCloud::network_config].
9200 ///
9201 /// # Example
9202 /// ```ignore,no_run
9203 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9204 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9205 /// let x = PrivateCloud::new().set_network_config(NetworkConfig::default()/* use setters */);
9206 /// ```
9207 pub fn set_network_config<T>(mut self, v: T) -> Self
9208 where
9209 T: std::convert::Into<crate::model::NetworkConfig>,
9210 {
9211 self.network_config = std::option::Option::Some(v.into());
9212 self
9213 }
9214
9215 /// Sets or clears the value of [network_config][crate::model::PrivateCloud::network_config].
9216 ///
9217 /// # Example
9218 /// ```ignore,no_run
9219 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9220 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9221 /// let x = PrivateCloud::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
9222 /// let x = PrivateCloud::new().set_or_clear_network_config(None::<NetworkConfig>);
9223 /// ```
9224 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
9225 where
9226 T: std::convert::Into<crate::model::NetworkConfig>,
9227 {
9228 self.network_config = v.map(|x| x.into());
9229 self
9230 }
9231
9232 /// Sets the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9233 ///
9234 /// # Example
9235 /// ```ignore,no_run
9236 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9237 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9238 /// let x = PrivateCloud::new().set_management_cluster(ManagementCluster::default()/* use setters */);
9239 /// ```
9240 pub fn set_management_cluster<T>(mut self, v: T) -> Self
9241 where
9242 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9243 {
9244 self.management_cluster = std::option::Option::Some(v.into());
9245 self
9246 }
9247
9248 /// Sets or clears the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9249 ///
9250 /// # Example
9251 /// ```ignore,no_run
9252 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9253 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9254 /// let x = PrivateCloud::new().set_or_clear_management_cluster(Some(ManagementCluster::default()/* use setters */));
9255 /// let x = PrivateCloud::new().set_or_clear_management_cluster(None::<ManagementCluster>);
9256 /// ```
9257 pub fn set_or_clear_management_cluster<T>(mut self, v: std::option::Option<T>) -> Self
9258 where
9259 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9260 {
9261 self.management_cluster = v.map(|x| x.into());
9262 self
9263 }
9264
9265 /// Sets the value of [description][crate::model::PrivateCloud::description].
9266 ///
9267 /// # Example
9268 /// ```ignore,no_run
9269 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9270 /// let x = PrivateCloud::new().set_description("example");
9271 /// ```
9272 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9273 self.description = v.into();
9274 self
9275 }
9276
9277 /// Sets the value of [hcx][crate::model::PrivateCloud::hcx].
9278 ///
9279 /// # Example
9280 /// ```ignore,no_run
9281 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9282 /// use google_cloud_vmwareengine_v1::model::Hcx;
9283 /// let x = PrivateCloud::new().set_hcx(Hcx::default()/* use setters */);
9284 /// ```
9285 pub fn set_hcx<T>(mut self, v: T) -> Self
9286 where
9287 T: std::convert::Into<crate::model::Hcx>,
9288 {
9289 self.hcx = std::option::Option::Some(v.into());
9290 self
9291 }
9292
9293 /// Sets or clears the value of [hcx][crate::model::PrivateCloud::hcx].
9294 ///
9295 /// # Example
9296 /// ```ignore,no_run
9297 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9298 /// use google_cloud_vmwareengine_v1::model::Hcx;
9299 /// let x = PrivateCloud::new().set_or_clear_hcx(Some(Hcx::default()/* use setters */));
9300 /// let x = PrivateCloud::new().set_or_clear_hcx(None::<Hcx>);
9301 /// ```
9302 pub fn set_or_clear_hcx<T>(mut self, v: std::option::Option<T>) -> Self
9303 where
9304 T: std::convert::Into<crate::model::Hcx>,
9305 {
9306 self.hcx = v.map(|x| x.into());
9307 self
9308 }
9309
9310 /// Sets the value of [nsx][crate::model::PrivateCloud::nsx].
9311 ///
9312 /// # Example
9313 /// ```ignore,no_run
9314 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9315 /// use google_cloud_vmwareengine_v1::model::Nsx;
9316 /// let x = PrivateCloud::new().set_nsx(Nsx::default()/* use setters */);
9317 /// ```
9318 pub fn set_nsx<T>(mut self, v: T) -> Self
9319 where
9320 T: std::convert::Into<crate::model::Nsx>,
9321 {
9322 self.nsx = std::option::Option::Some(v.into());
9323 self
9324 }
9325
9326 /// Sets or clears the value of [nsx][crate::model::PrivateCloud::nsx].
9327 ///
9328 /// # Example
9329 /// ```ignore,no_run
9330 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9331 /// use google_cloud_vmwareengine_v1::model::Nsx;
9332 /// let x = PrivateCloud::new().set_or_clear_nsx(Some(Nsx::default()/* use setters */));
9333 /// let x = PrivateCloud::new().set_or_clear_nsx(None::<Nsx>);
9334 /// ```
9335 pub fn set_or_clear_nsx<T>(mut self, v: std::option::Option<T>) -> Self
9336 where
9337 T: std::convert::Into<crate::model::Nsx>,
9338 {
9339 self.nsx = v.map(|x| x.into());
9340 self
9341 }
9342
9343 /// Sets the value of [vcenter][crate::model::PrivateCloud::vcenter].
9344 ///
9345 /// # Example
9346 /// ```ignore,no_run
9347 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9348 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9349 /// let x = PrivateCloud::new().set_vcenter(Vcenter::default()/* use setters */);
9350 /// ```
9351 pub fn set_vcenter<T>(mut self, v: T) -> Self
9352 where
9353 T: std::convert::Into<crate::model::Vcenter>,
9354 {
9355 self.vcenter = std::option::Option::Some(v.into());
9356 self
9357 }
9358
9359 /// Sets or clears the value of [vcenter][crate::model::PrivateCloud::vcenter].
9360 ///
9361 /// # Example
9362 /// ```ignore,no_run
9363 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9364 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9365 /// let x = PrivateCloud::new().set_or_clear_vcenter(Some(Vcenter::default()/* use setters */));
9366 /// let x = PrivateCloud::new().set_or_clear_vcenter(None::<Vcenter>);
9367 /// ```
9368 pub fn set_or_clear_vcenter<T>(mut self, v: std::option::Option<T>) -> Self
9369 where
9370 T: std::convert::Into<crate::model::Vcenter>,
9371 {
9372 self.vcenter = v.map(|x| x.into());
9373 self
9374 }
9375
9376 /// Sets the value of [uid][crate::model::PrivateCloud::uid].
9377 ///
9378 /// # Example
9379 /// ```ignore,no_run
9380 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9381 /// let x = PrivateCloud::new().set_uid("example");
9382 /// ```
9383 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9384 self.uid = v.into();
9385 self
9386 }
9387
9388 /// Sets the value of [r#type][crate::model::PrivateCloud::type].
9389 ///
9390 /// # Example
9391 /// ```ignore,no_run
9392 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9393 /// use google_cloud_vmwareengine_v1::model::private_cloud::Type;
9394 /// let x0 = PrivateCloud::new().set_type(Type::TimeLimited);
9395 /// let x1 = PrivateCloud::new().set_type(Type::Stretched);
9396 /// ```
9397 pub fn set_type<T: std::convert::Into<crate::model::private_cloud::Type>>(
9398 mut self,
9399 v: T,
9400 ) -> Self {
9401 self.r#type = v.into();
9402 self
9403 }
9404}
9405
9406impl wkt::message::Message for PrivateCloud {
9407 fn typename() -> &'static str {
9408 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud"
9409 }
9410}
9411
9412/// Defines additional types related to [PrivateCloud].
9413pub mod private_cloud {
9414 #[allow(unused_imports)]
9415 use super::*;
9416
9417 /// Management cluster configuration.
9418 #[derive(Clone, Default, PartialEq)]
9419 #[non_exhaustive]
9420 pub struct ManagementCluster {
9421 /// Required. The user-provided identifier of the new `Cluster`.
9422 /// The identifier must meet the following requirements:
9423 ///
9424 /// * Only contains 1-63 alphanumeric characters and hyphens
9425 /// * Begins with an alphabetical character
9426 /// * Ends with a non-hyphen character
9427 /// * Not formatted as a UUID
9428 /// * Complies with [RFC
9429 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
9430 pub cluster_id: std::string::String,
9431
9432 /// Required. The map of cluster node types in this cluster, where the key is
9433 /// canonical identifier of the node type (corresponds to the `NodeType`).
9434 pub node_type_configs:
9435 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9436
9437 /// Optional. Configuration of a stretched cluster. Required for STRETCHED
9438 /// private clouds.
9439 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9440
9441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9442 }
9443
9444 impl ManagementCluster {
9445 pub fn new() -> Self {
9446 std::default::Default::default()
9447 }
9448
9449 /// Sets the value of [cluster_id][crate::model::private_cloud::ManagementCluster::cluster_id].
9450 ///
9451 /// # Example
9452 /// ```ignore,no_run
9453 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9454 /// let x = ManagementCluster::new().set_cluster_id("example");
9455 /// ```
9456 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9457 self.cluster_id = v.into();
9458 self
9459 }
9460
9461 /// Sets the value of [node_type_configs][crate::model::private_cloud::ManagementCluster::node_type_configs].
9462 ///
9463 /// # Example
9464 /// ```ignore,no_run
9465 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9466 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9467 /// let x = ManagementCluster::new().set_node_type_configs([
9468 /// ("key0", NodeTypeConfig::default()/* use setters */),
9469 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
9470 /// ]);
9471 /// ```
9472 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
9473 where
9474 T: std::iter::IntoIterator<Item = (K, V)>,
9475 K: std::convert::Into<std::string::String>,
9476 V: std::convert::Into<crate::model::NodeTypeConfig>,
9477 {
9478 use std::iter::Iterator;
9479 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9480 self
9481 }
9482
9483 /// Sets the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9484 ///
9485 /// # Example
9486 /// ```ignore,no_run
9487 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9488 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9489 /// let x = ManagementCluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
9490 /// ```
9491 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
9492 where
9493 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9494 {
9495 self.stretched_cluster_config = std::option::Option::Some(v.into());
9496 self
9497 }
9498
9499 /// Sets or clears the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9500 ///
9501 /// # Example
9502 /// ```ignore,no_run
9503 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9504 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9505 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
9506 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
9507 /// ```
9508 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
9509 where
9510 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9511 {
9512 self.stretched_cluster_config = v.map(|x| x.into());
9513 self
9514 }
9515 }
9516
9517 impl wkt::message::Message for ManagementCluster {
9518 fn typename() -> &'static str {
9519 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"
9520 }
9521 }
9522
9523 /// Enum State defines possible states of private clouds.
9524 ///
9525 /// # Working with unknown values
9526 ///
9527 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9528 /// additional enum variants at any time. Adding new variants is not considered
9529 /// a breaking change. Applications should write their code in anticipation of:
9530 ///
9531 /// - New values appearing in future releases of the client library, **and**
9532 /// - New values received dynamically, without application changes.
9533 ///
9534 /// Please consult the [Working with enums] section in the user guide for some
9535 /// guidelines.
9536 ///
9537 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9538 #[derive(Clone, Debug, PartialEq)]
9539 #[non_exhaustive]
9540 pub enum State {
9541 /// The default value. This value should never be used.
9542 Unspecified,
9543 /// The private cloud is ready.
9544 Active,
9545 /// The private cloud is being created.
9546 Creating,
9547 /// The private cloud is being updated.
9548 Updating,
9549 /// The private cloud is in failed state.
9550 Failed,
9551 /// The private cloud is scheduled for deletion. The deletion process can be
9552 /// cancelled by using the corresponding undelete method.
9553 Deleted,
9554 /// The private cloud is irreversibly deleted and is being removed from the
9555 /// system.
9556 Purging,
9557 /// If set, the enum was initialized with an unknown value.
9558 ///
9559 /// Applications can examine the value using [State::value] or
9560 /// [State::name].
9561 UnknownValue(state::UnknownValue),
9562 }
9563
9564 #[doc(hidden)]
9565 pub mod state {
9566 #[allow(unused_imports)]
9567 use super::*;
9568 #[derive(Clone, Debug, PartialEq)]
9569 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9570 }
9571
9572 impl State {
9573 /// Gets the enum value.
9574 ///
9575 /// Returns `None` if the enum contains an unknown value deserialized from
9576 /// the string representation of enums.
9577 pub fn value(&self) -> std::option::Option<i32> {
9578 match self {
9579 Self::Unspecified => std::option::Option::Some(0),
9580 Self::Active => std::option::Option::Some(1),
9581 Self::Creating => std::option::Option::Some(2),
9582 Self::Updating => std::option::Option::Some(3),
9583 Self::Failed => std::option::Option::Some(5),
9584 Self::Deleted => std::option::Option::Some(6),
9585 Self::Purging => std::option::Option::Some(7),
9586 Self::UnknownValue(u) => u.0.value(),
9587 }
9588 }
9589
9590 /// Gets the enum value as a string.
9591 ///
9592 /// Returns `None` if the enum contains an unknown value deserialized from
9593 /// the integer representation of enums.
9594 pub fn name(&self) -> std::option::Option<&str> {
9595 match self {
9596 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9597 Self::Active => std::option::Option::Some("ACTIVE"),
9598 Self::Creating => std::option::Option::Some("CREATING"),
9599 Self::Updating => std::option::Option::Some("UPDATING"),
9600 Self::Failed => std::option::Option::Some("FAILED"),
9601 Self::Deleted => std::option::Option::Some("DELETED"),
9602 Self::Purging => std::option::Option::Some("PURGING"),
9603 Self::UnknownValue(u) => u.0.name(),
9604 }
9605 }
9606 }
9607
9608 impl std::default::Default for State {
9609 fn default() -> Self {
9610 use std::convert::From;
9611 Self::from(0)
9612 }
9613 }
9614
9615 impl std::fmt::Display for State {
9616 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9617 wkt::internal::display_enum(f, self.name(), self.value())
9618 }
9619 }
9620
9621 impl std::convert::From<i32> for State {
9622 fn from(value: i32) -> Self {
9623 match value {
9624 0 => Self::Unspecified,
9625 1 => Self::Active,
9626 2 => Self::Creating,
9627 3 => Self::Updating,
9628 5 => Self::Failed,
9629 6 => Self::Deleted,
9630 7 => Self::Purging,
9631 _ => Self::UnknownValue(state::UnknownValue(
9632 wkt::internal::UnknownEnumValue::Integer(value),
9633 )),
9634 }
9635 }
9636 }
9637
9638 impl std::convert::From<&str> for State {
9639 fn from(value: &str) -> Self {
9640 use std::string::ToString;
9641 match value {
9642 "STATE_UNSPECIFIED" => Self::Unspecified,
9643 "ACTIVE" => Self::Active,
9644 "CREATING" => Self::Creating,
9645 "UPDATING" => Self::Updating,
9646 "FAILED" => Self::Failed,
9647 "DELETED" => Self::Deleted,
9648 "PURGING" => Self::Purging,
9649 _ => Self::UnknownValue(state::UnknownValue(
9650 wkt::internal::UnknownEnumValue::String(value.to_string()),
9651 )),
9652 }
9653 }
9654 }
9655
9656 impl serde::ser::Serialize for State {
9657 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9658 where
9659 S: serde::Serializer,
9660 {
9661 match self {
9662 Self::Unspecified => serializer.serialize_i32(0),
9663 Self::Active => serializer.serialize_i32(1),
9664 Self::Creating => serializer.serialize_i32(2),
9665 Self::Updating => serializer.serialize_i32(3),
9666 Self::Failed => serializer.serialize_i32(5),
9667 Self::Deleted => serializer.serialize_i32(6),
9668 Self::Purging => serializer.serialize_i32(7),
9669 Self::UnknownValue(u) => u.0.serialize(serializer),
9670 }
9671 }
9672 }
9673
9674 impl<'de> serde::de::Deserialize<'de> for State {
9675 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9676 where
9677 D: serde::Deserializer<'de>,
9678 {
9679 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9680 ".google.cloud.vmwareengine.v1.PrivateCloud.State",
9681 ))
9682 }
9683 }
9684
9685 /// Enum Type defines private cloud type.
9686 ///
9687 /// # Working with unknown values
9688 ///
9689 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9690 /// additional enum variants at any time. Adding new variants is not considered
9691 /// a breaking change. Applications should write their code in anticipation of:
9692 ///
9693 /// - New values appearing in future releases of the client library, **and**
9694 /// - New values received dynamically, without application changes.
9695 ///
9696 /// Please consult the [Working with enums] section in the user guide for some
9697 /// guidelines.
9698 ///
9699 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9700 #[derive(Clone, Debug, PartialEq)]
9701 #[non_exhaustive]
9702 pub enum Type {
9703 /// Standard private is a zonal resource, with 3+ nodes. Default type.
9704 Standard,
9705 /// Time limited private cloud is a zonal resource, can have only 1 node and
9706 /// has limited life span. Will be deleted after defined period of time,
9707 /// can be converted into standard private cloud by expanding it up to 3
9708 /// or more nodes.
9709 TimeLimited,
9710 /// Stretched private cloud is a regional resource with redundancy,
9711 /// with a minimum of 6 nodes, nodes count has to be even.
9712 Stretched,
9713 /// If set, the enum was initialized with an unknown value.
9714 ///
9715 /// Applications can examine the value using [Type::value] or
9716 /// [Type::name].
9717 UnknownValue(r#type::UnknownValue),
9718 }
9719
9720 #[doc(hidden)]
9721 pub mod r#type {
9722 #[allow(unused_imports)]
9723 use super::*;
9724 #[derive(Clone, Debug, PartialEq)]
9725 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9726 }
9727
9728 impl Type {
9729 /// Gets the enum value.
9730 ///
9731 /// Returns `None` if the enum contains an unknown value deserialized from
9732 /// the string representation of enums.
9733 pub fn value(&self) -> std::option::Option<i32> {
9734 match self {
9735 Self::Standard => std::option::Option::Some(0),
9736 Self::TimeLimited => std::option::Option::Some(1),
9737 Self::Stretched => std::option::Option::Some(2),
9738 Self::UnknownValue(u) => u.0.value(),
9739 }
9740 }
9741
9742 /// Gets the enum value as a string.
9743 ///
9744 /// Returns `None` if the enum contains an unknown value deserialized from
9745 /// the integer representation of enums.
9746 pub fn name(&self) -> std::option::Option<&str> {
9747 match self {
9748 Self::Standard => std::option::Option::Some("STANDARD"),
9749 Self::TimeLimited => std::option::Option::Some("TIME_LIMITED"),
9750 Self::Stretched => std::option::Option::Some("STRETCHED"),
9751 Self::UnknownValue(u) => u.0.name(),
9752 }
9753 }
9754 }
9755
9756 impl std::default::Default for Type {
9757 fn default() -> Self {
9758 use std::convert::From;
9759 Self::from(0)
9760 }
9761 }
9762
9763 impl std::fmt::Display for Type {
9764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9765 wkt::internal::display_enum(f, self.name(), self.value())
9766 }
9767 }
9768
9769 impl std::convert::From<i32> for Type {
9770 fn from(value: i32) -> Self {
9771 match value {
9772 0 => Self::Standard,
9773 1 => Self::TimeLimited,
9774 2 => Self::Stretched,
9775 _ => Self::UnknownValue(r#type::UnknownValue(
9776 wkt::internal::UnknownEnumValue::Integer(value),
9777 )),
9778 }
9779 }
9780 }
9781
9782 impl std::convert::From<&str> for Type {
9783 fn from(value: &str) -> Self {
9784 use std::string::ToString;
9785 match value {
9786 "STANDARD" => Self::Standard,
9787 "TIME_LIMITED" => Self::TimeLimited,
9788 "STRETCHED" => Self::Stretched,
9789 _ => Self::UnknownValue(r#type::UnknownValue(
9790 wkt::internal::UnknownEnumValue::String(value.to_string()),
9791 )),
9792 }
9793 }
9794 }
9795
9796 impl serde::ser::Serialize for Type {
9797 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9798 where
9799 S: serde::Serializer,
9800 {
9801 match self {
9802 Self::Standard => serializer.serialize_i32(0),
9803 Self::TimeLimited => serializer.serialize_i32(1),
9804 Self::Stretched => serializer.serialize_i32(2),
9805 Self::UnknownValue(u) => u.0.serialize(serializer),
9806 }
9807 }
9808 }
9809
9810 impl<'de> serde::de::Deserialize<'de> for Type {
9811 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9812 where
9813 D: serde::Deserializer<'de>,
9814 {
9815 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
9816 ".google.cloud.vmwareengine.v1.PrivateCloud.Type",
9817 ))
9818 }
9819 }
9820}
9821
9822/// A cluster in a private cloud.
9823#[derive(Clone, Default, PartialEq)]
9824#[non_exhaustive]
9825pub struct Cluster {
9826 /// Output only. The resource name of this cluster.
9827 /// Resource names are schemeless URIs that follow the conventions in
9828 /// <https://cloud.google.com/apis/design/resource_names>.
9829 /// For example:
9830 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
9831 pub name: std::string::String,
9832
9833 /// Output only. Creation time of this resource.
9834 pub create_time: std::option::Option<wkt::Timestamp>,
9835
9836 /// Output only. Last update time of this resource.
9837 pub update_time: std::option::Option<wkt::Timestamp>,
9838
9839 /// Output only. State of the resource.
9840 pub state: crate::model::cluster::State,
9841
9842 /// Output only. True if the cluster is a management cluster; false otherwise.
9843 /// There can only be one management cluster in a private cloud
9844 /// and it has to be the first one.
9845 pub management: bool,
9846
9847 /// Optional. Configuration of the autoscaling applied to this cluster.
9848 pub autoscaling_settings: std::option::Option<crate::model::AutoscalingSettings>,
9849
9850 /// Output only. System-generated unique identifier for the resource.
9851 pub uid: std::string::String,
9852
9853 /// Required. The map of cluster node types in this cluster, where the key is
9854 /// canonical identifier of the node type (corresponds to the `NodeType`).
9855 pub node_type_configs:
9856 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9857
9858 /// Optional. Configuration of a stretched cluster. Required for clusters that
9859 /// belong to a STRETCHED private cloud.
9860 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9861
9862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9863}
9864
9865impl Cluster {
9866 pub fn new() -> Self {
9867 std::default::Default::default()
9868 }
9869
9870 /// Sets the value of [name][crate::model::Cluster::name].
9871 ///
9872 /// # Example
9873 /// ```ignore,no_run
9874 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9875 /// let x = Cluster::new().set_name("example");
9876 /// ```
9877 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9878 self.name = v.into();
9879 self
9880 }
9881
9882 /// Sets the value of [create_time][crate::model::Cluster::create_time].
9883 ///
9884 /// # Example
9885 /// ```ignore,no_run
9886 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9887 /// use wkt::Timestamp;
9888 /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
9889 /// ```
9890 pub fn set_create_time<T>(mut self, v: T) -> Self
9891 where
9892 T: std::convert::Into<wkt::Timestamp>,
9893 {
9894 self.create_time = std::option::Option::Some(v.into());
9895 self
9896 }
9897
9898 /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
9899 ///
9900 /// # Example
9901 /// ```ignore,no_run
9902 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9903 /// use wkt::Timestamp;
9904 /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9905 /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
9906 /// ```
9907 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9908 where
9909 T: std::convert::Into<wkt::Timestamp>,
9910 {
9911 self.create_time = v.map(|x| x.into());
9912 self
9913 }
9914
9915 /// Sets the value of [update_time][crate::model::Cluster::update_time].
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9920 /// use wkt::Timestamp;
9921 /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
9922 /// ```
9923 pub fn set_update_time<T>(mut self, v: T) -> Self
9924 where
9925 T: std::convert::Into<wkt::Timestamp>,
9926 {
9927 self.update_time = std::option::Option::Some(v.into());
9928 self
9929 }
9930
9931 /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
9932 ///
9933 /// # Example
9934 /// ```ignore,no_run
9935 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9936 /// use wkt::Timestamp;
9937 /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9938 /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
9939 /// ```
9940 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9941 where
9942 T: std::convert::Into<wkt::Timestamp>,
9943 {
9944 self.update_time = v.map(|x| x.into());
9945 self
9946 }
9947
9948 /// Sets the value of [state][crate::model::Cluster::state].
9949 ///
9950 /// # Example
9951 /// ```ignore,no_run
9952 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9953 /// use google_cloud_vmwareengine_v1::model::cluster::State;
9954 /// let x0 = Cluster::new().set_state(State::Active);
9955 /// let x1 = Cluster::new().set_state(State::Creating);
9956 /// let x2 = Cluster::new().set_state(State::Updating);
9957 /// ```
9958 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
9959 self.state = v.into();
9960 self
9961 }
9962
9963 /// Sets the value of [management][crate::model::Cluster::management].
9964 ///
9965 /// # Example
9966 /// ```ignore,no_run
9967 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9968 /// let x = Cluster::new().set_management(true);
9969 /// ```
9970 pub fn set_management<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9971 self.management = v.into();
9972 self
9973 }
9974
9975 /// Sets the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9976 ///
9977 /// # Example
9978 /// ```ignore,no_run
9979 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9980 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
9981 /// let x = Cluster::new().set_autoscaling_settings(AutoscalingSettings::default()/* use setters */);
9982 /// ```
9983 pub fn set_autoscaling_settings<T>(mut self, v: T) -> Self
9984 where
9985 T: std::convert::Into<crate::model::AutoscalingSettings>,
9986 {
9987 self.autoscaling_settings = std::option::Option::Some(v.into());
9988 self
9989 }
9990
9991 /// Sets or clears the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9992 ///
9993 /// # Example
9994 /// ```ignore,no_run
9995 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9996 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
9997 /// let x = Cluster::new().set_or_clear_autoscaling_settings(Some(AutoscalingSettings::default()/* use setters */));
9998 /// let x = Cluster::new().set_or_clear_autoscaling_settings(None::<AutoscalingSettings>);
9999 /// ```
10000 pub fn set_or_clear_autoscaling_settings<T>(mut self, v: std::option::Option<T>) -> Self
10001 where
10002 T: std::convert::Into<crate::model::AutoscalingSettings>,
10003 {
10004 self.autoscaling_settings = v.map(|x| x.into());
10005 self
10006 }
10007
10008 /// Sets the value of [uid][crate::model::Cluster::uid].
10009 ///
10010 /// # Example
10011 /// ```ignore,no_run
10012 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10013 /// let x = Cluster::new().set_uid("example");
10014 /// ```
10015 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10016 self.uid = v.into();
10017 self
10018 }
10019
10020 /// Sets the value of [node_type_configs][crate::model::Cluster::node_type_configs].
10021 ///
10022 /// # Example
10023 /// ```ignore,no_run
10024 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10025 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
10026 /// let x = Cluster::new().set_node_type_configs([
10027 /// ("key0", NodeTypeConfig::default()/* use setters */),
10028 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
10029 /// ]);
10030 /// ```
10031 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
10032 where
10033 T: std::iter::IntoIterator<Item = (K, V)>,
10034 K: std::convert::Into<std::string::String>,
10035 V: std::convert::Into<crate::model::NodeTypeConfig>,
10036 {
10037 use std::iter::Iterator;
10038 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10039 self
10040 }
10041
10042 /// Sets the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10043 ///
10044 /// # Example
10045 /// ```ignore,no_run
10046 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10047 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10048 /// let x = Cluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
10049 /// ```
10050 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
10051 where
10052 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10053 {
10054 self.stretched_cluster_config = std::option::Option::Some(v.into());
10055 self
10056 }
10057
10058 /// Sets or clears the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10059 ///
10060 /// # Example
10061 /// ```ignore,no_run
10062 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10063 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10064 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
10065 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
10066 /// ```
10067 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
10068 where
10069 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10070 {
10071 self.stretched_cluster_config = v.map(|x| x.into());
10072 self
10073 }
10074}
10075
10076impl wkt::message::Message for Cluster {
10077 fn typename() -> &'static str {
10078 "type.googleapis.com/google.cloud.vmwareengine.v1.Cluster"
10079 }
10080}
10081
10082/// Defines additional types related to [Cluster].
10083pub mod cluster {
10084 #[allow(unused_imports)]
10085 use super::*;
10086
10087 /// Enum State defines possible states of private cloud clusters.
10088 ///
10089 /// # Working with unknown values
10090 ///
10091 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10092 /// additional enum variants at any time. Adding new variants is not considered
10093 /// a breaking change. Applications should write their code in anticipation of:
10094 ///
10095 /// - New values appearing in future releases of the client library, **and**
10096 /// - New values received dynamically, without application changes.
10097 ///
10098 /// Please consult the [Working with enums] section in the user guide for some
10099 /// guidelines.
10100 ///
10101 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10102 #[derive(Clone, Debug, PartialEq)]
10103 #[non_exhaustive]
10104 pub enum State {
10105 /// The default value. This value should never be used.
10106 Unspecified,
10107 /// The Cluster is operational and can be used by the user.
10108 Active,
10109 /// The Cluster is being deployed.
10110 Creating,
10111 /// Adding or removing of a node to the cluster, any other cluster specific
10112 /// updates.
10113 Updating,
10114 /// The Cluster is being deleted.
10115 Deleting,
10116 /// The Cluster is undergoing maintenance, for example: a failed node is
10117 /// getting replaced.
10118 Repairing,
10119 /// If set, the enum was initialized with an unknown value.
10120 ///
10121 /// Applications can examine the value using [State::value] or
10122 /// [State::name].
10123 UnknownValue(state::UnknownValue),
10124 }
10125
10126 #[doc(hidden)]
10127 pub mod state {
10128 #[allow(unused_imports)]
10129 use super::*;
10130 #[derive(Clone, Debug, PartialEq)]
10131 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10132 }
10133
10134 impl State {
10135 /// Gets the enum value.
10136 ///
10137 /// Returns `None` if the enum contains an unknown value deserialized from
10138 /// the string representation of enums.
10139 pub fn value(&self) -> std::option::Option<i32> {
10140 match self {
10141 Self::Unspecified => std::option::Option::Some(0),
10142 Self::Active => std::option::Option::Some(1),
10143 Self::Creating => std::option::Option::Some(2),
10144 Self::Updating => std::option::Option::Some(3),
10145 Self::Deleting => std::option::Option::Some(4),
10146 Self::Repairing => std::option::Option::Some(5),
10147 Self::UnknownValue(u) => u.0.value(),
10148 }
10149 }
10150
10151 /// Gets the enum value as a string.
10152 ///
10153 /// Returns `None` if the enum contains an unknown value deserialized from
10154 /// the integer representation of enums.
10155 pub fn name(&self) -> std::option::Option<&str> {
10156 match self {
10157 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10158 Self::Active => std::option::Option::Some("ACTIVE"),
10159 Self::Creating => std::option::Option::Some("CREATING"),
10160 Self::Updating => std::option::Option::Some("UPDATING"),
10161 Self::Deleting => std::option::Option::Some("DELETING"),
10162 Self::Repairing => std::option::Option::Some("REPAIRING"),
10163 Self::UnknownValue(u) => u.0.name(),
10164 }
10165 }
10166 }
10167
10168 impl std::default::Default for State {
10169 fn default() -> Self {
10170 use std::convert::From;
10171 Self::from(0)
10172 }
10173 }
10174
10175 impl std::fmt::Display for State {
10176 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10177 wkt::internal::display_enum(f, self.name(), self.value())
10178 }
10179 }
10180
10181 impl std::convert::From<i32> for State {
10182 fn from(value: i32) -> Self {
10183 match value {
10184 0 => Self::Unspecified,
10185 1 => Self::Active,
10186 2 => Self::Creating,
10187 3 => Self::Updating,
10188 4 => Self::Deleting,
10189 5 => Self::Repairing,
10190 _ => Self::UnknownValue(state::UnknownValue(
10191 wkt::internal::UnknownEnumValue::Integer(value),
10192 )),
10193 }
10194 }
10195 }
10196
10197 impl std::convert::From<&str> for State {
10198 fn from(value: &str) -> Self {
10199 use std::string::ToString;
10200 match value {
10201 "STATE_UNSPECIFIED" => Self::Unspecified,
10202 "ACTIVE" => Self::Active,
10203 "CREATING" => Self::Creating,
10204 "UPDATING" => Self::Updating,
10205 "DELETING" => Self::Deleting,
10206 "REPAIRING" => Self::Repairing,
10207 _ => Self::UnknownValue(state::UnknownValue(
10208 wkt::internal::UnknownEnumValue::String(value.to_string()),
10209 )),
10210 }
10211 }
10212 }
10213
10214 impl serde::ser::Serialize for State {
10215 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10216 where
10217 S: serde::Serializer,
10218 {
10219 match self {
10220 Self::Unspecified => serializer.serialize_i32(0),
10221 Self::Active => serializer.serialize_i32(1),
10222 Self::Creating => serializer.serialize_i32(2),
10223 Self::Updating => serializer.serialize_i32(3),
10224 Self::Deleting => serializer.serialize_i32(4),
10225 Self::Repairing => serializer.serialize_i32(5),
10226 Self::UnknownValue(u) => u.0.serialize(serializer),
10227 }
10228 }
10229 }
10230
10231 impl<'de> serde::de::Deserialize<'de> for State {
10232 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10233 where
10234 D: serde::Deserializer<'de>,
10235 {
10236 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10237 ".google.cloud.vmwareengine.v1.Cluster.State",
10238 ))
10239 }
10240 }
10241}
10242
10243/// Node in a cluster.
10244#[derive(Clone, Default, PartialEq)]
10245#[non_exhaustive]
10246pub struct Node {
10247 /// Output only. The resource name of this node.
10248 /// Resource names are schemeless URIs that follow the conventions in
10249 /// <https://cloud.google.com/apis/design/resource_names>.
10250 /// For example:
10251 /// projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node
10252 pub name: std::string::String,
10253
10254 /// Output only. Fully qualified domain name of the node.
10255 pub fqdn: std::string::String,
10256
10257 /// Output only. Internal IP address of the node.
10258 pub internal_ip: std::string::String,
10259
10260 /// Output only. The canonical identifier of the node type (corresponds to the
10261 /// `NodeType`).
10262 /// For example: standard-72.
10263 pub node_type_id: std::string::String,
10264
10265 /// Output only. The version number of the VMware ESXi
10266 /// management component in this cluster.
10267 pub version: std::string::String,
10268
10269 /// Output only. Customized number of cores
10270 pub custom_core_count: i64,
10271
10272 /// Output only. The state of the appliance.
10273 pub state: crate::model::node::State,
10274
10275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10276}
10277
10278impl Node {
10279 pub fn new() -> Self {
10280 std::default::Default::default()
10281 }
10282
10283 /// Sets the value of [name][crate::model::Node::name].
10284 ///
10285 /// # Example
10286 /// ```ignore,no_run
10287 /// # use google_cloud_vmwareengine_v1::model::Node;
10288 /// let x = Node::new().set_name("example");
10289 /// ```
10290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10291 self.name = v.into();
10292 self
10293 }
10294
10295 /// Sets the value of [fqdn][crate::model::Node::fqdn].
10296 ///
10297 /// # Example
10298 /// ```ignore,no_run
10299 /// # use google_cloud_vmwareengine_v1::model::Node;
10300 /// let x = Node::new().set_fqdn("example");
10301 /// ```
10302 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10303 self.fqdn = v.into();
10304 self
10305 }
10306
10307 /// Sets the value of [internal_ip][crate::model::Node::internal_ip].
10308 ///
10309 /// # Example
10310 /// ```ignore,no_run
10311 /// # use google_cloud_vmwareengine_v1::model::Node;
10312 /// let x = Node::new().set_internal_ip("example");
10313 /// ```
10314 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10315 self.internal_ip = v.into();
10316 self
10317 }
10318
10319 /// Sets the value of [node_type_id][crate::model::Node::node_type_id].
10320 ///
10321 /// # Example
10322 /// ```ignore,no_run
10323 /// # use google_cloud_vmwareengine_v1::model::Node;
10324 /// let x = Node::new().set_node_type_id("example");
10325 /// ```
10326 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10327 self.node_type_id = v.into();
10328 self
10329 }
10330
10331 /// Sets the value of [version][crate::model::Node::version].
10332 ///
10333 /// # Example
10334 /// ```ignore,no_run
10335 /// # use google_cloud_vmwareengine_v1::model::Node;
10336 /// let x = Node::new().set_version("example");
10337 /// ```
10338 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10339 self.version = v.into();
10340 self
10341 }
10342
10343 /// Sets the value of [custom_core_count][crate::model::Node::custom_core_count].
10344 ///
10345 /// # Example
10346 /// ```ignore,no_run
10347 /// # use google_cloud_vmwareengine_v1::model::Node;
10348 /// let x = Node::new().set_custom_core_count(42);
10349 /// ```
10350 pub fn set_custom_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10351 self.custom_core_count = v.into();
10352 self
10353 }
10354
10355 /// Sets the value of [state][crate::model::Node::state].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_vmwareengine_v1::model::Node;
10360 /// use google_cloud_vmwareengine_v1::model::node::State;
10361 /// let x0 = Node::new().set_state(State::Active);
10362 /// let x1 = Node::new().set_state(State::Creating);
10363 /// let x2 = Node::new().set_state(State::Failed);
10364 /// ```
10365 pub fn set_state<T: std::convert::Into<crate::model::node::State>>(mut self, v: T) -> Self {
10366 self.state = v.into();
10367 self
10368 }
10369}
10370
10371impl wkt::message::Message for Node {
10372 fn typename() -> &'static str {
10373 "type.googleapis.com/google.cloud.vmwareengine.v1.Node"
10374 }
10375}
10376
10377/// Defines additional types related to [Node].
10378pub mod node {
10379 #[allow(unused_imports)]
10380 use super::*;
10381
10382 /// Enum State defines possible states of a node in a cluster.
10383 ///
10384 /// # Working with unknown values
10385 ///
10386 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10387 /// additional enum variants at any time. Adding new variants is not considered
10388 /// a breaking change. Applications should write their code in anticipation of:
10389 ///
10390 /// - New values appearing in future releases of the client library, **and**
10391 /// - New values received dynamically, without application changes.
10392 ///
10393 /// Please consult the [Working with enums] section in the user guide for some
10394 /// guidelines.
10395 ///
10396 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10397 #[derive(Clone, Debug, PartialEq)]
10398 #[non_exhaustive]
10399 pub enum State {
10400 /// The default value. This value should never be used.
10401 Unspecified,
10402 /// Node is operational and can be used by the user.
10403 Active,
10404 /// Node is being provisioned.
10405 Creating,
10406 /// Node is in a failed state.
10407 Failed,
10408 /// Node is undergoing maintenance, e.g.: during private cloud upgrade.
10409 Upgrading,
10410 /// If set, the enum was initialized with an unknown value.
10411 ///
10412 /// Applications can examine the value using [State::value] or
10413 /// [State::name].
10414 UnknownValue(state::UnknownValue),
10415 }
10416
10417 #[doc(hidden)]
10418 pub mod state {
10419 #[allow(unused_imports)]
10420 use super::*;
10421 #[derive(Clone, Debug, PartialEq)]
10422 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10423 }
10424
10425 impl State {
10426 /// Gets the enum value.
10427 ///
10428 /// Returns `None` if the enum contains an unknown value deserialized from
10429 /// the string representation of enums.
10430 pub fn value(&self) -> std::option::Option<i32> {
10431 match self {
10432 Self::Unspecified => std::option::Option::Some(0),
10433 Self::Active => std::option::Option::Some(1),
10434 Self::Creating => std::option::Option::Some(2),
10435 Self::Failed => std::option::Option::Some(3),
10436 Self::Upgrading => std::option::Option::Some(4),
10437 Self::UnknownValue(u) => u.0.value(),
10438 }
10439 }
10440
10441 /// Gets the enum value as a string.
10442 ///
10443 /// Returns `None` if the enum contains an unknown value deserialized from
10444 /// the integer representation of enums.
10445 pub fn name(&self) -> std::option::Option<&str> {
10446 match self {
10447 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10448 Self::Active => std::option::Option::Some("ACTIVE"),
10449 Self::Creating => std::option::Option::Some("CREATING"),
10450 Self::Failed => std::option::Option::Some("FAILED"),
10451 Self::Upgrading => std::option::Option::Some("UPGRADING"),
10452 Self::UnknownValue(u) => u.0.name(),
10453 }
10454 }
10455 }
10456
10457 impl std::default::Default for State {
10458 fn default() -> Self {
10459 use std::convert::From;
10460 Self::from(0)
10461 }
10462 }
10463
10464 impl std::fmt::Display for State {
10465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10466 wkt::internal::display_enum(f, self.name(), self.value())
10467 }
10468 }
10469
10470 impl std::convert::From<i32> for State {
10471 fn from(value: i32) -> Self {
10472 match value {
10473 0 => Self::Unspecified,
10474 1 => Self::Active,
10475 2 => Self::Creating,
10476 3 => Self::Failed,
10477 4 => Self::Upgrading,
10478 _ => Self::UnknownValue(state::UnknownValue(
10479 wkt::internal::UnknownEnumValue::Integer(value),
10480 )),
10481 }
10482 }
10483 }
10484
10485 impl std::convert::From<&str> for State {
10486 fn from(value: &str) -> Self {
10487 use std::string::ToString;
10488 match value {
10489 "STATE_UNSPECIFIED" => Self::Unspecified,
10490 "ACTIVE" => Self::Active,
10491 "CREATING" => Self::Creating,
10492 "FAILED" => Self::Failed,
10493 "UPGRADING" => Self::Upgrading,
10494 _ => Self::UnknownValue(state::UnknownValue(
10495 wkt::internal::UnknownEnumValue::String(value.to_string()),
10496 )),
10497 }
10498 }
10499 }
10500
10501 impl serde::ser::Serialize for State {
10502 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10503 where
10504 S: serde::Serializer,
10505 {
10506 match self {
10507 Self::Unspecified => serializer.serialize_i32(0),
10508 Self::Active => serializer.serialize_i32(1),
10509 Self::Creating => serializer.serialize_i32(2),
10510 Self::Failed => serializer.serialize_i32(3),
10511 Self::Upgrading => serializer.serialize_i32(4),
10512 Self::UnknownValue(u) => u.0.serialize(serializer),
10513 }
10514 }
10515 }
10516
10517 impl<'de> serde::de::Deserialize<'de> for State {
10518 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10519 where
10520 D: serde::Deserializer<'de>,
10521 {
10522 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10523 ".google.cloud.vmwareengine.v1.Node.State",
10524 ))
10525 }
10526 }
10527}
10528
10529/// Represents an allocated external IP address and its corresponding internal IP
10530/// address in a private cloud.
10531#[derive(Clone, Default, PartialEq)]
10532#[non_exhaustive]
10533pub struct ExternalAddress {
10534 /// Output only. The resource name of this external IP address.
10535 /// Resource names are schemeless URIs that follow the conventions in
10536 /// <https://cloud.google.com/apis/design/resource_names>.
10537 /// For example:
10538 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`
10539 pub name: std::string::String,
10540
10541 /// Output only. Creation time of this resource.
10542 pub create_time: std::option::Option<wkt::Timestamp>,
10543
10544 /// Output only. Last update time of this resource.
10545 pub update_time: std::option::Option<wkt::Timestamp>,
10546
10547 /// The internal IP address of a workload VM.
10548 pub internal_ip: std::string::String,
10549
10550 /// Output only. The external IP address of a workload VM.
10551 pub external_ip: std::string::String,
10552
10553 /// Output only. The state of the resource.
10554 pub state: crate::model::external_address::State,
10555
10556 /// Output only. System-generated unique identifier for the resource.
10557 pub uid: std::string::String,
10558
10559 /// User-provided description for this resource.
10560 pub description: std::string::String,
10561
10562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10563}
10564
10565impl ExternalAddress {
10566 pub fn new() -> Self {
10567 std::default::Default::default()
10568 }
10569
10570 /// Sets the value of [name][crate::model::ExternalAddress::name].
10571 ///
10572 /// # Example
10573 /// ```ignore,no_run
10574 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10575 /// let x = ExternalAddress::new().set_name("example");
10576 /// ```
10577 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10578 self.name = v.into();
10579 self
10580 }
10581
10582 /// Sets the value of [create_time][crate::model::ExternalAddress::create_time].
10583 ///
10584 /// # Example
10585 /// ```ignore,no_run
10586 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10587 /// use wkt::Timestamp;
10588 /// let x = ExternalAddress::new().set_create_time(Timestamp::default()/* use setters */);
10589 /// ```
10590 pub fn set_create_time<T>(mut self, v: T) -> Self
10591 where
10592 T: std::convert::Into<wkt::Timestamp>,
10593 {
10594 self.create_time = std::option::Option::Some(v.into());
10595 self
10596 }
10597
10598 /// Sets or clears the value of [create_time][crate::model::ExternalAddress::create_time].
10599 ///
10600 /// # Example
10601 /// ```ignore,no_run
10602 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10603 /// use wkt::Timestamp;
10604 /// let x = ExternalAddress::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10605 /// let x = ExternalAddress::new().set_or_clear_create_time(None::<Timestamp>);
10606 /// ```
10607 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10608 where
10609 T: std::convert::Into<wkt::Timestamp>,
10610 {
10611 self.create_time = v.map(|x| x.into());
10612 self
10613 }
10614
10615 /// Sets the value of [update_time][crate::model::ExternalAddress::update_time].
10616 ///
10617 /// # Example
10618 /// ```ignore,no_run
10619 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10620 /// use wkt::Timestamp;
10621 /// let x = ExternalAddress::new().set_update_time(Timestamp::default()/* use setters */);
10622 /// ```
10623 pub fn set_update_time<T>(mut self, v: T) -> Self
10624 where
10625 T: std::convert::Into<wkt::Timestamp>,
10626 {
10627 self.update_time = std::option::Option::Some(v.into());
10628 self
10629 }
10630
10631 /// Sets or clears the value of [update_time][crate::model::ExternalAddress::update_time].
10632 ///
10633 /// # Example
10634 /// ```ignore,no_run
10635 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10636 /// use wkt::Timestamp;
10637 /// let x = ExternalAddress::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10638 /// let x = ExternalAddress::new().set_or_clear_update_time(None::<Timestamp>);
10639 /// ```
10640 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10641 where
10642 T: std::convert::Into<wkt::Timestamp>,
10643 {
10644 self.update_time = v.map(|x| x.into());
10645 self
10646 }
10647
10648 /// Sets the value of [internal_ip][crate::model::ExternalAddress::internal_ip].
10649 ///
10650 /// # Example
10651 /// ```ignore,no_run
10652 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10653 /// let x = ExternalAddress::new().set_internal_ip("example");
10654 /// ```
10655 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10656 self.internal_ip = v.into();
10657 self
10658 }
10659
10660 /// Sets the value of [external_ip][crate::model::ExternalAddress::external_ip].
10661 ///
10662 /// # Example
10663 /// ```ignore,no_run
10664 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10665 /// let x = ExternalAddress::new().set_external_ip("example");
10666 /// ```
10667 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10668 self.external_ip = v.into();
10669 self
10670 }
10671
10672 /// Sets the value of [state][crate::model::ExternalAddress::state].
10673 ///
10674 /// # Example
10675 /// ```ignore,no_run
10676 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10677 /// use google_cloud_vmwareengine_v1::model::external_address::State;
10678 /// let x0 = ExternalAddress::new().set_state(State::Active);
10679 /// let x1 = ExternalAddress::new().set_state(State::Creating);
10680 /// let x2 = ExternalAddress::new().set_state(State::Updating);
10681 /// ```
10682 pub fn set_state<T: std::convert::Into<crate::model::external_address::State>>(
10683 mut self,
10684 v: T,
10685 ) -> Self {
10686 self.state = v.into();
10687 self
10688 }
10689
10690 /// Sets the value of [uid][crate::model::ExternalAddress::uid].
10691 ///
10692 /// # Example
10693 /// ```ignore,no_run
10694 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10695 /// let x = ExternalAddress::new().set_uid("example");
10696 /// ```
10697 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10698 self.uid = v.into();
10699 self
10700 }
10701
10702 /// Sets the value of [description][crate::model::ExternalAddress::description].
10703 ///
10704 /// # Example
10705 /// ```ignore,no_run
10706 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10707 /// let x = ExternalAddress::new().set_description("example");
10708 /// ```
10709 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10710 self.description = v.into();
10711 self
10712 }
10713}
10714
10715impl wkt::message::Message for ExternalAddress {
10716 fn typename() -> &'static str {
10717 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAddress"
10718 }
10719}
10720
10721/// Defines additional types related to [ExternalAddress].
10722pub mod external_address {
10723 #[allow(unused_imports)]
10724 use super::*;
10725
10726 /// Enum State defines possible states of external addresses.
10727 ///
10728 /// # Working with unknown values
10729 ///
10730 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10731 /// additional enum variants at any time. Adding new variants is not considered
10732 /// a breaking change. Applications should write their code in anticipation of:
10733 ///
10734 /// - New values appearing in future releases of the client library, **and**
10735 /// - New values received dynamically, without application changes.
10736 ///
10737 /// Please consult the [Working with enums] section in the user guide for some
10738 /// guidelines.
10739 ///
10740 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10741 #[derive(Clone, Debug, PartialEq)]
10742 #[non_exhaustive]
10743 pub enum State {
10744 /// The default value. This value should never be used.
10745 Unspecified,
10746 /// The address is ready.
10747 Active,
10748 /// The address is being created.
10749 Creating,
10750 /// The address is being updated.
10751 Updating,
10752 /// The address is being deleted.
10753 Deleting,
10754 /// If set, the enum was initialized with an unknown value.
10755 ///
10756 /// Applications can examine the value using [State::value] or
10757 /// [State::name].
10758 UnknownValue(state::UnknownValue),
10759 }
10760
10761 #[doc(hidden)]
10762 pub mod state {
10763 #[allow(unused_imports)]
10764 use super::*;
10765 #[derive(Clone, Debug, PartialEq)]
10766 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10767 }
10768
10769 impl State {
10770 /// Gets the enum value.
10771 ///
10772 /// Returns `None` if the enum contains an unknown value deserialized from
10773 /// the string representation of enums.
10774 pub fn value(&self) -> std::option::Option<i32> {
10775 match self {
10776 Self::Unspecified => std::option::Option::Some(0),
10777 Self::Active => std::option::Option::Some(1),
10778 Self::Creating => std::option::Option::Some(2),
10779 Self::Updating => std::option::Option::Some(3),
10780 Self::Deleting => std::option::Option::Some(4),
10781 Self::UnknownValue(u) => u.0.value(),
10782 }
10783 }
10784
10785 /// Gets the enum value as a string.
10786 ///
10787 /// Returns `None` if the enum contains an unknown value deserialized from
10788 /// the integer representation of enums.
10789 pub fn name(&self) -> std::option::Option<&str> {
10790 match self {
10791 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10792 Self::Active => std::option::Option::Some("ACTIVE"),
10793 Self::Creating => std::option::Option::Some("CREATING"),
10794 Self::Updating => std::option::Option::Some("UPDATING"),
10795 Self::Deleting => std::option::Option::Some("DELETING"),
10796 Self::UnknownValue(u) => u.0.name(),
10797 }
10798 }
10799 }
10800
10801 impl std::default::Default for State {
10802 fn default() -> Self {
10803 use std::convert::From;
10804 Self::from(0)
10805 }
10806 }
10807
10808 impl std::fmt::Display for State {
10809 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10810 wkt::internal::display_enum(f, self.name(), self.value())
10811 }
10812 }
10813
10814 impl std::convert::From<i32> for State {
10815 fn from(value: i32) -> Self {
10816 match value {
10817 0 => Self::Unspecified,
10818 1 => Self::Active,
10819 2 => Self::Creating,
10820 3 => Self::Updating,
10821 4 => Self::Deleting,
10822 _ => Self::UnknownValue(state::UnknownValue(
10823 wkt::internal::UnknownEnumValue::Integer(value),
10824 )),
10825 }
10826 }
10827 }
10828
10829 impl std::convert::From<&str> for State {
10830 fn from(value: &str) -> Self {
10831 use std::string::ToString;
10832 match value {
10833 "STATE_UNSPECIFIED" => Self::Unspecified,
10834 "ACTIVE" => Self::Active,
10835 "CREATING" => Self::Creating,
10836 "UPDATING" => Self::Updating,
10837 "DELETING" => Self::Deleting,
10838 _ => Self::UnknownValue(state::UnknownValue(
10839 wkt::internal::UnknownEnumValue::String(value.to_string()),
10840 )),
10841 }
10842 }
10843 }
10844
10845 impl serde::ser::Serialize for State {
10846 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10847 where
10848 S: serde::Serializer,
10849 {
10850 match self {
10851 Self::Unspecified => serializer.serialize_i32(0),
10852 Self::Active => serializer.serialize_i32(1),
10853 Self::Creating => serializer.serialize_i32(2),
10854 Self::Updating => serializer.serialize_i32(3),
10855 Self::Deleting => serializer.serialize_i32(4),
10856 Self::UnknownValue(u) => u.0.serialize(serializer),
10857 }
10858 }
10859 }
10860
10861 impl<'de> serde::de::Deserialize<'de> for State {
10862 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10863 where
10864 D: serde::Deserializer<'de>,
10865 {
10866 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10867 ".google.cloud.vmwareengine.v1.ExternalAddress.State",
10868 ))
10869 }
10870 }
10871}
10872
10873/// Subnet in a private cloud. Either `management` subnets (such as vMotion) that
10874/// are read-only, or `userDefined`, which can also be updated.
10875#[derive(Clone, Default, PartialEq)]
10876#[non_exhaustive]
10877pub struct Subnet {
10878 /// Output only. The resource name of this subnet.
10879 /// Resource names are schemeless URIs that follow the conventions in
10880 /// <https://cloud.google.com/apis/design/resource_names>.
10881 /// For example:
10882 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
10883 pub name: std::string::String,
10884
10885 /// The IP address range of the subnet in CIDR format '10.0.0.0/24'.
10886 pub ip_cidr_range: std::string::String,
10887
10888 /// The IP address of the gateway of this subnet.
10889 /// Must fall within the IP prefix defined above.
10890 pub gateway_ip: std::string::String,
10891
10892 /// Output only. The type of the subnet. For example "management" or
10893 /// "userDefined".
10894 pub r#type: std::string::String,
10895
10896 /// Output only. The state of the resource.
10897 pub state: crate::model::subnet::State,
10898
10899 /// Output only. VLAN ID of the VLAN on which the subnet is configured
10900 pub vlan_id: i32,
10901
10902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10903}
10904
10905impl Subnet {
10906 pub fn new() -> Self {
10907 std::default::Default::default()
10908 }
10909
10910 /// Sets the value of [name][crate::model::Subnet::name].
10911 ///
10912 /// # Example
10913 /// ```ignore,no_run
10914 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10915 /// let x = Subnet::new().set_name("example");
10916 /// ```
10917 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918 self.name = v.into();
10919 self
10920 }
10921
10922 /// Sets the value of [ip_cidr_range][crate::model::Subnet::ip_cidr_range].
10923 ///
10924 /// # Example
10925 /// ```ignore,no_run
10926 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10927 /// let x = Subnet::new().set_ip_cidr_range("example");
10928 /// ```
10929 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10930 self.ip_cidr_range = v.into();
10931 self
10932 }
10933
10934 /// Sets the value of [gateway_ip][crate::model::Subnet::gateway_ip].
10935 ///
10936 /// # Example
10937 /// ```ignore,no_run
10938 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10939 /// let x = Subnet::new().set_gateway_ip("example");
10940 /// ```
10941 pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10942 self.gateway_ip = v.into();
10943 self
10944 }
10945
10946 /// Sets the value of [r#type][crate::model::Subnet::type].
10947 ///
10948 /// # Example
10949 /// ```ignore,no_run
10950 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10951 /// let x = Subnet::new().set_type("example");
10952 /// ```
10953 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10954 self.r#type = v.into();
10955 self
10956 }
10957
10958 /// Sets the value of [state][crate::model::Subnet::state].
10959 ///
10960 /// # Example
10961 /// ```ignore,no_run
10962 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10963 /// use google_cloud_vmwareengine_v1::model::subnet::State;
10964 /// let x0 = Subnet::new().set_state(State::Active);
10965 /// let x1 = Subnet::new().set_state(State::Creating);
10966 /// let x2 = Subnet::new().set_state(State::Updating);
10967 /// ```
10968 pub fn set_state<T: std::convert::Into<crate::model::subnet::State>>(mut self, v: T) -> Self {
10969 self.state = v.into();
10970 self
10971 }
10972
10973 /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
10974 ///
10975 /// # Example
10976 /// ```ignore,no_run
10977 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10978 /// let x = Subnet::new().set_vlan_id(42);
10979 /// ```
10980 pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10981 self.vlan_id = v.into();
10982 self
10983 }
10984}
10985
10986impl wkt::message::Message for Subnet {
10987 fn typename() -> &'static str {
10988 "type.googleapis.com/google.cloud.vmwareengine.v1.Subnet"
10989 }
10990}
10991
10992/// Defines additional types related to [Subnet].
10993pub mod subnet {
10994 #[allow(unused_imports)]
10995 use super::*;
10996
10997 /// Defines possible states of subnets.
10998 ///
10999 /// # Working with unknown values
11000 ///
11001 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11002 /// additional enum variants at any time. Adding new variants is not considered
11003 /// a breaking change. Applications should write their code in anticipation of:
11004 ///
11005 /// - New values appearing in future releases of the client library, **and**
11006 /// - New values received dynamically, without application changes.
11007 ///
11008 /// Please consult the [Working with enums] section in the user guide for some
11009 /// guidelines.
11010 ///
11011 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11012 #[derive(Clone, Debug, PartialEq)]
11013 #[non_exhaustive]
11014 pub enum State {
11015 /// The default value. This value should never be used.
11016 Unspecified,
11017 /// The subnet is ready.
11018 Active,
11019 /// The subnet is being created.
11020 Creating,
11021 /// The subnet is being updated.
11022 Updating,
11023 /// The subnet is being deleted.
11024 Deleting,
11025 /// Changes requested in the last operation are being propagated.
11026 Reconciling,
11027 /// Last operation on the subnet did not succeed. Subnet's payload is
11028 /// reverted back to its most recent working state.
11029 Failed,
11030 /// If set, the enum was initialized with an unknown value.
11031 ///
11032 /// Applications can examine the value using [State::value] or
11033 /// [State::name].
11034 UnknownValue(state::UnknownValue),
11035 }
11036
11037 #[doc(hidden)]
11038 pub mod state {
11039 #[allow(unused_imports)]
11040 use super::*;
11041 #[derive(Clone, Debug, PartialEq)]
11042 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11043 }
11044
11045 impl State {
11046 /// Gets the enum value.
11047 ///
11048 /// Returns `None` if the enum contains an unknown value deserialized from
11049 /// the string representation of enums.
11050 pub fn value(&self) -> std::option::Option<i32> {
11051 match self {
11052 Self::Unspecified => std::option::Option::Some(0),
11053 Self::Active => std::option::Option::Some(1),
11054 Self::Creating => std::option::Option::Some(2),
11055 Self::Updating => std::option::Option::Some(3),
11056 Self::Deleting => std::option::Option::Some(4),
11057 Self::Reconciling => std::option::Option::Some(5),
11058 Self::Failed => std::option::Option::Some(6),
11059 Self::UnknownValue(u) => u.0.value(),
11060 }
11061 }
11062
11063 /// Gets the enum value as a string.
11064 ///
11065 /// Returns `None` if the enum contains an unknown value deserialized from
11066 /// the integer representation of enums.
11067 pub fn name(&self) -> std::option::Option<&str> {
11068 match self {
11069 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11070 Self::Active => std::option::Option::Some("ACTIVE"),
11071 Self::Creating => std::option::Option::Some("CREATING"),
11072 Self::Updating => std::option::Option::Some("UPDATING"),
11073 Self::Deleting => std::option::Option::Some("DELETING"),
11074 Self::Reconciling => std::option::Option::Some("RECONCILING"),
11075 Self::Failed => std::option::Option::Some("FAILED"),
11076 Self::UnknownValue(u) => u.0.name(),
11077 }
11078 }
11079 }
11080
11081 impl std::default::Default for State {
11082 fn default() -> Self {
11083 use std::convert::From;
11084 Self::from(0)
11085 }
11086 }
11087
11088 impl std::fmt::Display for State {
11089 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11090 wkt::internal::display_enum(f, self.name(), self.value())
11091 }
11092 }
11093
11094 impl std::convert::From<i32> for State {
11095 fn from(value: i32) -> Self {
11096 match value {
11097 0 => Self::Unspecified,
11098 1 => Self::Active,
11099 2 => Self::Creating,
11100 3 => Self::Updating,
11101 4 => Self::Deleting,
11102 5 => Self::Reconciling,
11103 6 => Self::Failed,
11104 _ => Self::UnknownValue(state::UnknownValue(
11105 wkt::internal::UnknownEnumValue::Integer(value),
11106 )),
11107 }
11108 }
11109 }
11110
11111 impl std::convert::From<&str> for State {
11112 fn from(value: &str) -> Self {
11113 use std::string::ToString;
11114 match value {
11115 "STATE_UNSPECIFIED" => Self::Unspecified,
11116 "ACTIVE" => Self::Active,
11117 "CREATING" => Self::Creating,
11118 "UPDATING" => Self::Updating,
11119 "DELETING" => Self::Deleting,
11120 "RECONCILING" => Self::Reconciling,
11121 "FAILED" => Self::Failed,
11122 _ => Self::UnknownValue(state::UnknownValue(
11123 wkt::internal::UnknownEnumValue::String(value.to_string()),
11124 )),
11125 }
11126 }
11127 }
11128
11129 impl serde::ser::Serialize for State {
11130 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11131 where
11132 S: serde::Serializer,
11133 {
11134 match self {
11135 Self::Unspecified => serializer.serialize_i32(0),
11136 Self::Active => serializer.serialize_i32(1),
11137 Self::Creating => serializer.serialize_i32(2),
11138 Self::Updating => serializer.serialize_i32(3),
11139 Self::Deleting => serializer.serialize_i32(4),
11140 Self::Reconciling => serializer.serialize_i32(5),
11141 Self::Failed => serializer.serialize_i32(6),
11142 Self::UnknownValue(u) => u.0.serialize(serializer),
11143 }
11144 }
11145 }
11146
11147 impl<'de> serde::de::Deserialize<'de> for State {
11148 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11149 where
11150 D: serde::Deserializer<'de>,
11151 {
11152 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11153 ".google.cloud.vmwareengine.v1.Subnet.State",
11154 ))
11155 }
11156 }
11157}
11158
11159/// External access firewall rules for filtering incoming traffic destined to
11160/// `ExternalAddress` resources.
11161#[derive(Clone, Default, PartialEq)]
11162#[non_exhaustive]
11163pub struct ExternalAccessRule {
11164 /// Output only. The resource name of this external access rule.
11165 /// Resource names are schemeless URIs that follow the conventions in
11166 /// <https://cloud.google.com/apis/design/resource_names>.
11167 /// For example:
11168 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
11169 pub name: std::string::String,
11170
11171 /// Output only. Creation time of this resource.
11172 pub create_time: std::option::Option<wkt::Timestamp>,
11173
11174 /// Output only. Last update time of this resource.
11175 pub update_time: std::option::Option<wkt::Timestamp>,
11176
11177 /// User-provided description for this external access rule.
11178 pub description: std::string::String,
11179
11180 /// External access rule priority, which determines the external access rule to
11181 /// use when multiple rules apply. If multiple rules have the same priority,
11182 /// their ordering is non-deterministic. If specific ordering is required,
11183 /// assign unique priorities to enforce such ordering. The external access rule
11184 /// priority is an integer from 100 to 4096, both inclusive. Lower integers
11185 /// indicate higher precedence. For example, a rule with priority `100` has
11186 /// higher precedence than a rule with priority `101`.
11187 pub priority: i32,
11188
11189 /// The action that the external access rule performs.
11190 pub action: crate::model::external_access_rule::Action,
11191
11192 /// The IP protocol to which the external access rule applies. This value can
11193 /// be one of the following three protocol strings (not case-sensitive):
11194 /// `tcp`, `udp`, or `icmp`.
11195 pub ip_protocol: std::string::String,
11196
11197 /// If source ranges are specified, the external access rule applies only to
11198 /// traffic that has a source IP address in these ranges. These ranges can
11199 /// either be expressed in the CIDR format or as an IP address. As only inbound
11200 /// rules are supported, `ExternalAddress` resources cannot be the source IP
11201 /// addresses of an external access rule. To match all source addresses,
11202 /// specify `0.0.0.0/0`.
11203 pub source_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11204
11205 /// A list of source ports to which the external access rule applies. This
11206 /// field is only applicable for the UDP or TCP protocol.
11207 /// Each entry must be either an integer or a range. For example: `["22"]`,
11208 /// `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
11209 /// `["0-65535"]`.
11210 pub source_ports: std::vec::Vec<std::string::String>,
11211
11212 /// If destination ranges are specified, the external access rule applies only
11213 /// to the traffic that has a destination IP address in these ranges. The
11214 /// specified IP addresses must have reserved external IP addresses in the
11215 /// scope of the parent network policy. To match all external IP addresses in
11216 /// the scope of the parent network policy, specify `0.0.0.0/0`. To match a
11217 /// specific external IP address, specify it using the
11218 /// `IpRange.external_address` property.
11219 pub destination_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11220
11221 /// A list of destination ports to which the external access rule applies. This
11222 /// field is only applicable for the UDP or TCP protocol.
11223 /// Each entry must be either an integer or a range. For example: `["22"]`,
11224 /// `["80","443"]`, or `["12345-12349"]`. To match all destination ports,
11225 /// specify `["0-65535"]`.
11226 pub destination_ports: std::vec::Vec<std::string::String>,
11227
11228 /// Output only. The state of the resource.
11229 pub state: crate::model::external_access_rule::State,
11230
11231 /// Output only. System-generated unique identifier for the resource.
11232 pub uid: std::string::String,
11233
11234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11235}
11236
11237impl ExternalAccessRule {
11238 pub fn new() -> Self {
11239 std::default::Default::default()
11240 }
11241
11242 /// Sets the value of [name][crate::model::ExternalAccessRule::name].
11243 ///
11244 /// # Example
11245 /// ```ignore,no_run
11246 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11247 /// let x = ExternalAccessRule::new().set_name("example");
11248 /// ```
11249 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11250 self.name = v.into();
11251 self
11252 }
11253
11254 /// Sets the value of [create_time][crate::model::ExternalAccessRule::create_time].
11255 ///
11256 /// # Example
11257 /// ```ignore,no_run
11258 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11259 /// use wkt::Timestamp;
11260 /// let x = ExternalAccessRule::new().set_create_time(Timestamp::default()/* use setters */);
11261 /// ```
11262 pub fn set_create_time<T>(mut self, v: T) -> Self
11263 where
11264 T: std::convert::Into<wkt::Timestamp>,
11265 {
11266 self.create_time = std::option::Option::Some(v.into());
11267 self
11268 }
11269
11270 /// Sets or clears the value of [create_time][crate::model::ExternalAccessRule::create_time].
11271 ///
11272 /// # Example
11273 /// ```ignore,no_run
11274 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11275 /// use wkt::Timestamp;
11276 /// let x = ExternalAccessRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11277 /// let x = ExternalAccessRule::new().set_or_clear_create_time(None::<Timestamp>);
11278 /// ```
11279 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11280 where
11281 T: std::convert::Into<wkt::Timestamp>,
11282 {
11283 self.create_time = v.map(|x| x.into());
11284 self
11285 }
11286
11287 /// Sets the value of [update_time][crate::model::ExternalAccessRule::update_time].
11288 ///
11289 /// # Example
11290 /// ```ignore,no_run
11291 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11292 /// use wkt::Timestamp;
11293 /// let x = ExternalAccessRule::new().set_update_time(Timestamp::default()/* use setters */);
11294 /// ```
11295 pub fn set_update_time<T>(mut self, v: T) -> Self
11296 where
11297 T: std::convert::Into<wkt::Timestamp>,
11298 {
11299 self.update_time = std::option::Option::Some(v.into());
11300 self
11301 }
11302
11303 /// Sets or clears the value of [update_time][crate::model::ExternalAccessRule::update_time].
11304 ///
11305 /// # Example
11306 /// ```ignore,no_run
11307 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11308 /// use wkt::Timestamp;
11309 /// let x = ExternalAccessRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11310 /// let x = ExternalAccessRule::new().set_or_clear_update_time(None::<Timestamp>);
11311 /// ```
11312 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11313 where
11314 T: std::convert::Into<wkt::Timestamp>,
11315 {
11316 self.update_time = v.map(|x| x.into());
11317 self
11318 }
11319
11320 /// Sets the value of [description][crate::model::ExternalAccessRule::description].
11321 ///
11322 /// # Example
11323 /// ```ignore,no_run
11324 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11325 /// let x = ExternalAccessRule::new().set_description("example");
11326 /// ```
11327 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11328 self.description = v.into();
11329 self
11330 }
11331
11332 /// Sets the value of [priority][crate::model::ExternalAccessRule::priority].
11333 ///
11334 /// # Example
11335 /// ```ignore,no_run
11336 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11337 /// let x = ExternalAccessRule::new().set_priority(42);
11338 /// ```
11339 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11340 self.priority = v.into();
11341 self
11342 }
11343
11344 /// Sets the value of [action][crate::model::ExternalAccessRule::action].
11345 ///
11346 /// # Example
11347 /// ```ignore,no_run
11348 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11349 /// use google_cloud_vmwareengine_v1::model::external_access_rule::Action;
11350 /// let x0 = ExternalAccessRule::new().set_action(Action::Allow);
11351 /// let x1 = ExternalAccessRule::new().set_action(Action::Deny);
11352 /// ```
11353 pub fn set_action<T: std::convert::Into<crate::model::external_access_rule::Action>>(
11354 mut self,
11355 v: T,
11356 ) -> Self {
11357 self.action = v.into();
11358 self
11359 }
11360
11361 /// Sets the value of [ip_protocol][crate::model::ExternalAccessRule::ip_protocol].
11362 ///
11363 /// # Example
11364 /// ```ignore,no_run
11365 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11366 /// let x = ExternalAccessRule::new().set_ip_protocol("example");
11367 /// ```
11368 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11369 self.ip_protocol = v.into();
11370 self
11371 }
11372
11373 /// Sets the value of [source_ip_ranges][crate::model::ExternalAccessRule::source_ip_ranges].
11374 ///
11375 /// # Example
11376 /// ```ignore,no_run
11377 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11378 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11379 /// let x = ExternalAccessRule::new()
11380 /// .set_source_ip_ranges([
11381 /// IpRange::default()/* use setters */,
11382 /// IpRange::default()/* use (different) setters */,
11383 /// ]);
11384 /// ```
11385 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
11386 where
11387 T: std::iter::IntoIterator<Item = V>,
11388 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11389 {
11390 use std::iter::Iterator;
11391 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11392 self
11393 }
11394
11395 /// Sets the value of [source_ports][crate::model::ExternalAccessRule::source_ports].
11396 ///
11397 /// # Example
11398 /// ```ignore,no_run
11399 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11400 /// let x = ExternalAccessRule::new().set_source_ports(["a", "b", "c"]);
11401 /// ```
11402 pub fn set_source_ports<T, V>(mut self, v: T) -> Self
11403 where
11404 T: std::iter::IntoIterator<Item = V>,
11405 V: std::convert::Into<std::string::String>,
11406 {
11407 use std::iter::Iterator;
11408 self.source_ports = v.into_iter().map(|i| i.into()).collect();
11409 self
11410 }
11411
11412 /// Sets the value of [destination_ip_ranges][crate::model::ExternalAccessRule::destination_ip_ranges].
11413 ///
11414 /// # Example
11415 /// ```ignore,no_run
11416 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11417 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11418 /// let x = ExternalAccessRule::new()
11419 /// .set_destination_ip_ranges([
11420 /// IpRange::default()/* use setters */,
11421 /// IpRange::default()/* use (different) setters */,
11422 /// ]);
11423 /// ```
11424 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
11425 where
11426 T: std::iter::IntoIterator<Item = V>,
11427 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11428 {
11429 use std::iter::Iterator;
11430 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11431 self
11432 }
11433
11434 /// Sets the value of [destination_ports][crate::model::ExternalAccessRule::destination_ports].
11435 ///
11436 /// # Example
11437 /// ```ignore,no_run
11438 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11439 /// let x = ExternalAccessRule::new().set_destination_ports(["a", "b", "c"]);
11440 /// ```
11441 pub fn set_destination_ports<T, V>(mut self, v: T) -> Self
11442 where
11443 T: std::iter::IntoIterator<Item = V>,
11444 V: std::convert::Into<std::string::String>,
11445 {
11446 use std::iter::Iterator;
11447 self.destination_ports = v.into_iter().map(|i| i.into()).collect();
11448 self
11449 }
11450
11451 /// Sets the value of [state][crate::model::ExternalAccessRule::state].
11452 ///
11453 /// # Example
11454 /// ```ignore,no_run
11455 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11456 /// use google_cloud_vmwareengine_v1::model::external_access_rule::State;
11457 /// let x0 = ExternalAccessRule::new().set_state(State::Active);
11458 /// let x1 = ExternalAccessRule::new().set_state(State::Creating);
11459 /// let x2 = ExternalAccessRule::new().set_state(State::Updating);
11460 /// ```
11461 pub fn set_state<T: std::convert::Into<crate::model::external_access_rule::State>>(
11462 mut self,
11463 v: T,
11464 ) -> Self {
11465 self.state = v.into();
11466 self
11467 }
11468
11469 /// Sets the value of [uid][crate::model::ExternalAccessRule::uid].
11470 ///
11471 /// # Example
11472 /// ```ignore,no_run
11473 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11474 /// let x = ExternalAccessRule::new().set_uid("example");
11475 /// ```
11476 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11477 self.uid = v.into();
11478 self
11479 }
11480}
11481
11482impl wkt::message::Message for ExternalAccessRule {
11483 fn typename() -> &'static str {
11484 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule"
11485 }
11486}
11487
11488/// Defines additional types related to [ExternalAccessRule].
11489pub mod external_access_rule {
11490 #[allow(unused_imports)]
11491 use super::*;
11492
11493 /// An IP range provided in any one of the supported formats.
11494 #[derive(Clone, Default, PartialEq)]
11495 #[non_exhaustive]
11496 pub struct IpRange {
11497 pub ip_range: std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11498
11499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11500 }
11501
11502 impl IpRange {
11503 pub fn new() -> Self {
11504 std::default::Default::default()
11505 }
11506
11507 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range].
11508 ///
11509 /// Note that all the setters affecting `ip_range` are mutually
11510 /// exclusive.
11511 ///
11512 /// # Example
11513 /// ```ignore,no_run
11514 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11515 /// use google_cloud_vmwareengine_v1::model::external_access_rule::ip_range::IpRange as IpRangeOneOf;
11516 /// let x = IpRange::new().set_ip_range(Some(IpRangeOneOf::IpAddress("example".to_string())));
11517 /// ```
11518 pub fn set_ip_range<
11519 T: std::convert::Into<
11520 std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11521 >,
11522 >(
11523 mut self,
11524 v: T,
11525 ) -> Self {
11526 self.ip_range = v.into();
11527 self
11528 }
11529
11530 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11531 /// if it holds a `IpAddress`, `None` if the field is not set or
11532 /// holds a different branch.
11533 pub fn ip_address(&self) -> std::option::Option<&std::string::String> {
11534 #[allow(unreachable_patterns)]
11535 self.ip_range.as_ref().and_then(|v| match v {
11536 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v) => {
11537 std::option::Option::Some(v)
11538 }
11539 _ => std::option::Option::None,
11540 })
11541 }
11542
11543 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11544 /// to hold a `IpAddress`.
11545 ///
11546 /// Note that all the setters affecting `ip_range` are
11547 /// mutually exclusive.
11548 ///
11549 /// # Example
11550 /// ```ignore,no_run
11551 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11552 /// let x = IpRange::new().set_ip_address("example");
11553 /// assert!(x.ip_address().is_some());
11554 /// assert!(x.ip_address_range().is_none());
11555 /// assert!(x.external_address().is_none());
11556 /// ```
11557 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11558 self.ip_range = std::option::Option::Some(
11559 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v.into()),
11560 );
11561 self
11562 }
11563
11564 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11565 /// if it holds a `IpAddressRange`, `None` if the field is not set or
11566 /// holds a different branch.
11567 pub fn ip_address_range(&self) -> std::option::Option<&std::string::String> {
11568 #[allow(unreachable_patterns)]
11569 self.ip_range.as_ref().and_then(|v| match v {
11570 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v) => {
11571 std::option::Option::Some(v)
11572 }
11573 _ => std::option::Option::None,
11574 })
11575 }
11576
11577 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11578 /// to hold a `IpAddressRange`.
11579 ///
11580 /// Note that all the setters affecting `ip_range` are
11581 /// mutually exclusive.
11582 ///
11583 /// # Example
11584 /// ```ignore,no_run
11585 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11586 /// let x = IpRange::new().set_ip_address_range("example");
11587 /// assert!(x.ip_address_range().is_some());
11588 /// assert!(x.ip_address().is_none());
11589 /// assert!(x.external_address().is_none());
11590 /// ```
11591 pub fn set_ip_address_range<T: std::convert::Into<std::string::String>>(
11592 mut self,
11593 v: T,
11594 ) -> Self {
11595 self.ip_range = std::option::Option::Some(
11596 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v.into()),
11597 );
11598 self
11599 }
11600
11601 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11602 /// if it holds a `ExternalAddress`, `None` if the field is not set or
11603 /// holds a different branch.
11604 pub fn external_address(&self) -> std::option::Option<&std::string::String> {
11605 #[allow(unreachable_patterns)]
11606 self.ip_range.as_ref().and_then(|v| match v {
11607 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v) => {
11608 std::option::Option::Some(v)
11609 }
11610 _ => std::option::Option::None,
11611 })
11612 }
11613
11614 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11615 /// to hold a `ExternalAddress`.
11616 ///
11617 /// Note that all the setters affecting `ip_range` are
11618 /// mutually exclusive.
11619 ///
11620 /// # Example
11621 /// ```ignore,no_run
11622 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11623 /// let x = IpRange::new().set_external_address("example");
11624 /// assert!(x.external_address().is_some());
11625 /// assert!(x.ip_address().is_none());
11626 /// assert!(x.ip_address_range().is_none());
11627 /// ```
11628 pub fn set_external_address<T: std::convert::Into<std::string::String>>(
11629 mut self,
11630 v: T,
11631 ) -> Self {
11632 self.ip_range = std::option::Option::Some(
11633 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v.into()),
11634 );
11635 self
11636 }
11637 }
11638
11639 impl wkt::message::Message for IpRange {
11640 fn typename() -> &'static str {
11641 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange"
11642 }
11643 }
11644
11645 /// Defines additional types related to [IpRange].
11646 pub mod ip_range {
11647 #[allow(unused_imports)]
11648 use super::*;
11649
11650 #[derive(Clone, Debug, PartialEq)]
11651 #[non_exhaustive]
11652 pub enum IpRange {
11653 /// A single IP address. For example: `10.0.0.5`.
11654 IpAddress(std::string::String),
11655 /// An IP address range in the CIDR format. For example: `10.0.0.0/24`.
11656 IpAddressRange(std::string::String),
11657 /// The name of an `ExternalAddress` resource. The external address must
11658 /// have been reserved in the scope of this external access rule's parent
11659 /// network policy. Provide the external address name in the form of
11660 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`.
11661 /// For example:
11662 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
11663 ExternalAddress(std::string::String),
11664 }
11665 }
11666
11667 /// Action determines whether the external access rule permits or blocks
11668 /// traffic, subject to the other components of the rule matching the traffic.
11669 ///
11670 /// # Working with unknown values
11671 ///
11672 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11673 /// additional enum variants at any time. Adding new variants is not considered
11674 /// a breaking change. Applications should write their code in anticipation of:
11675 ///
11676 /// - New values appearing in future releases of the client library, **and**
11677 /// - New values received dynamically, without application changes.
11678 ///
11679 /// Please consult the [Working with enums] section in the user guide for some
11680 /// guidelines.
11681 ///
11682 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11683 #[derive(Clone, Debug, PartialEq)]
11684 #[non_exhaustive]
11685 pub enum Action {
11686 /// Defaults to allow.
11687 Unspecified,
11688 /// Allows connections that match the other specified components.
11689 Allow,
11690 /// Blocks connections that match the other specified components.
11691 Deny,
11692 /// If set, the enum was initialized with an unknown value.
11693 ///
11694 /// Applications can examine the value using [Action::value] or
11695 /// [Action::name].
11696 UnknownValue(action::UnknownValue),
11697 }
11698
11699 #[doc(hidden)]
11700 pub mod action {
11701 #[allow(unused_imports)]
11702 use super::*;
11703 #[derive(Clone, Debug, PartialEq)]
11704 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11705 }
11706
11707 impl Action {
11708 /// Gets the enum value.
11709 ///
11710 /// Returns `None` if the enum contains an unknown value deserialized from
11711 /// the string representation of enums.
11712 pub fn value(&self) -> std::option::Option<i32> {
11713 match self {
11714 Self::Unspecified => std::option::Option::Some(0),
11715 Self::Allow => std::option::Option::Some(1),
11716 Self::Deny => std::option::Option::Some(2),
11717 Self::UnknownValue(u) => u.0.value(),
11718 }
11719 }
11720
11721 /// Gets the enum value as a string.
11722 ///
11723 /// Returns `None` if the enum contains an unknown value deserialized from
11724 /// the integer representation of enums.
11725 pub fn name(&self) -> std::option::Option<&str> {
11726 match self {
11727 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
11728 Self::Allow => std::option::Option::Some("ALLOW"),
11729 Self::Deny => std::option::Option::Some("DENY"),
11730 Self::UnknownValue(u) => u.0.name(),
11731 }
11732 }
11733 }
11734
11735 impl std::default::Default for Action {
11736 fn default() -> Self {
11737 use std::convert::From;
11738 Self::from(0)
11739 }
11740 }
11741
11742 impl std::fmt::Display for Action {
11743 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11744 wkt::internal::display_enum(f, self.name(), self.value())
11745 }
11746 }
11747
11748 impl std::convert::From<i32> for Action {
11749 fn from(value: i32) -> Self {
11750 match value {
11751 0 => Self::Unspecified,
11752 1 => Self::Allow,
11753 2 => Self::Deny,
11754 _ => Self::UnknownValue(action::UnknownValue(
11755 wkt::internal::UnknownEnumValue::Integer(value),
11756 )),
11757 }
11758 }
11759 }
11760
11761 impl std::convert::From<&str> for Action {
11762 fn from(value: &str) -> Self {
11763 use std::string::ToString;
11764 match value {
11765 "ACTION_UNSPECIFIED" => Self::Unspecified,
11766 "ALLOW" => Self::Allow,
11767 "DENY" => Self::Deny,
11768 _ => Self::UnknownValue(action::UnknownValue(
11769 wkt::internal::UnknownEnumValue::String(value.to_string()),
11770 )),
11771 }
11772 }
11773 }
11774
11775 impl serde::ser::Serialize for Action {
11776 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11777 where
11778 S: serde::Serializer,
11779 {
11780 match self {
11781 Self::Unspecified => serializer.serialize_i32(0),
11782 Self::Allow => serializer.serialize_i32(1),
11783 Self::Deny => serializer.serialize_i32(2),
11784 Self::UnknownValue(u) => u.0.serialize(serializer),
11785 }
11786 }
11787 }
11788
11789 impl<'de> serde::de::Deserialize<'de> for Action {
11790 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11791 where
11792 D: serde::Deserializer<'de>,
11793 {
11794 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
11795 ".google.cloud.vmwareengine.v1.ExternalAccessRule.Action",
11796 ))
11797 }
11798 }
11799
11800 /// Defines possible states of external access firewall rules.
11801 ///
11802 /// # Working with unknown values
11803 ///
11804 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11805 /// additional enum variants at any time. Adding new variants is not considered
11806 /// a breaking change. Applications should write their code in anticipation of:
11807 ///
11808 /// - New values appearing in future releases of the client library, **and**
11809 /// - New values received dynamically, without application changes.
11810 ///
11811 /// Please consult the [Working with enums] section in the user guide for some
11812 /// guidelines.
11813 ///
11814 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11815 #[derive(Clone, Debug, PartialEq)]
11816 #[non_exhaustive]
11817 pub enum State {
11818 /// The default value. This value is used if the state is omitted.
11819 Unspecified,
11820 /// The rule is ready.
11821 Active,
11822 /// The rule is being created.
11823 Creating,
11824 /// The rule is being updated.
11825 Updating,
11826 /// The rule is being deleted.
11827 Deleting,
11828 /// If set, the enum was initialized with an unknown value.
11829 ///
11830 /// Applications can examine the value using [State::value] or
11831 /// [State::name].
11832 UnknownValue(state::UnknownValue),
11833 }
11834
11835 #[doc(hidden)]
11836 pub mod state {
11837 #[allow(unused_imports)]
11838 use super::*;
11839 #[derive(Clone, Debug, PartialEq)]
11840 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11841 }
11842
11843 impl State {
11844 /// Gets the enum value.
11845 ///
11846 /// Returns `None` if the enum contains an unknown value deserialized from
11847 /// the string representation of enums.
11848 pub fn value(&self) -> std::option::Option<i32> {
11849 match self {
11850 Self::Unspecified => std::option::Option::Some(0),
11851 Self::Active => std::option::Option::Some(1),
11852 Self::Creating => std::option::Option::Some(2),
11853 Self::Updating => std::option::Option::Some(3),
11854 Self::Deleting => std::option::Option::Some(4),
11855 Self::UnknownValue(u) => u.0.value(),
11856 }
11857 }
11858
11859 /// Gets the enum value as a string.
11860 ///
11861 /// Returns `None` if the enum contains an unknown value deserialized from
11862 /// the integer representation of enums.
11863 pub fn name(&self) -> std::option::Option<&str> {
11864 match self {
11865 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11866 Self::Active => std::option::Option::Some("ACTIVE"),
11867 Self::Creating => std::option::Option::Some("CREATING"),
11868 Self::Updating => std::option::Option::Some("UPDATING"),
11869 Self::Deleting => std::option::Option::Some("DELETING"),
11870 Self::UnknownValue(u) => u.0.name(),
11871 }
11872 }
11873 }
11874
11875 impl std::default::Default for State {
11876 fn default() -> Self {
11877 use std::convert::From;
11878 Self::from(0)
11879 }
11880 }
11881
11882 impl std::fmt::Display for State {
11883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11884 wkt::internal::display_enum(f, self.name(), self.value())
11885 }
11886 }
11887
11888 impl std::convert::From<i32> for State {
11889 fn from(value: i32) -> Self {
11890 match value {
11891 0 => Self::Unspecified,
11892 1 => Self::Active,
11893 2 => Self::Creating,
11894 3 => Self::Updating,
11895 4 => Self::Deleting,
11896 _ => Self::UnknownValue(state::UnknownValue(
11897 wkt::internal::UnknownEnumValue::Integer(value),
11898 )),
11899 }
11900 }
11901 }
11902
11903 impl std::convert::From<&str> for State {
11904 fn from(value: &str) -> Self {
11905 use std::string::ToString;
11906 match value {
11907 "STATE_UNSPECIFIED" => Self::Unspecified,
11908 "ACTIVE" => Self::Active,
11909 "CREATING" => Self::Creating,
11910 "UPDATING" => Self::Updating,
11911 "DELETING" => Self::Deleting,
11912 _ => Self::UnknownValue(state::UnknownValue(
11913 wkt::internal::UnknownEnumValue::String(value.to_string()),
11914 )),
11915 }
11916 }
11917 }
11918
11919 impl serde::ser::Serialize for State {
11920 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11921 where
11922 S: serde::Serializer,
11923 {
11924 match self {
11925 Self::Unspecified => serializer.serialize_i32(0),
11926 Self::Active => serializer.serialize_i32(1),
11927 Self::Creating => serializer.serialize_i32(2),
11928 Self::Updating => serializer.serialize_i32(3),
11929 Self::Deleting => serializer.serialize_i32(4),
11930 Self::UnknownValue(u) => u.0.serialize(serializer),
11931 }
11932 }
11933 }
11934
11935 impl<'de> serde::de::Deserialize<'de> for State {
11936 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11937 where
11938 D: serde::Deserializer<'de>,
11939 {
11940 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11941 ".google.cloud.vmwareengine.v1.ExternalAccessRule.State",
11942 ))
11943 }
11944 }
11945}
11946
11947/// Logging server to receive vCenter or ESXi logs.
11948#[derive(Clone, Default, PartialEq)]
11949#[non_exhaustive]
11950pub struct LoggingServer {
11951 /// Output only. The resource name of this logging server.
11952 /// Resource names are schemeless URIs that follow the conventions in
11953 /// <https://cloud.google.com/apis/design/resource_names>.
11954 /// For example:
11955 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
11956 pub name: std::string::String,
11957
11958 /// Output only. Creation time of this resource.
11959 pub create_time: std::option::Option<wkt::Timestamp>,
11960
11961 /// Output only. Last update time of this resource.
11962 pub update_time: std::option::Option<wkt::Timestamp>,
11963
11964 /// Required. Fully-qualified domain name (FQDN) or IP Address of the logging
11965 /// server.
11966 pub hostname: std::string::String,
11967
11968 /// Required. Port number at which the logging server receives logs.
11969 pub port: i32,
11970
11971 /// Required. Protocol used by vCenter to send logs to a logging server.
11972 pub protocol: crate::model::logging_server::Protocol,
11973
11974 /// Required. The type of component that produces logs that will be forwarded
11975 /// to this logging server.
11976 pub source_type: crate::model::logging_server::SourceType,
11977
11978 /// Output only. System-generated unique identifier for the resource.
11979 pub uid: std::string::String,
11980
11981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11982}
11983
11984impl LoggingServer {
11985 pub fn new() -> Self {
11986 std::default::Default::default()
11987 }
11988
11989 /// Sets the value of [name][crate::model::LoggingServer::name].
11990 ///
11991 /// # Example
11992 /// ```ignore,no_run
11993 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
11994 /// let x = LoggingServer::new().set_name("example");
11995 /// ```
11996 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11997 self.name = v.into();
11998 self
11999 }
12000
12001 /// Sets the value of [create_time][crate::model::LoggingServer::create_time].
12002 ///
12003 /// # Example
12004 /// ```ignore,no_run
12005 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12006 /// use wkt::Timestamp;
12007 /// let x = LoggingServer::new().set_create_time(Timestamp::default()/* use setters */);
12008 /// ```
12009 pub fn set_create_time<T>(mut self, v: T) -> Self
12010 where
12011 T: std::convert::Into<wkt::Timestamp>,
12012 {
12013 self.create_time = std::option::Option::Some(v.into());
12014 self
12015 }
12016
12017 /// Sets or clears the value of [create_time][crate::model::LoggingServer::create_time].
12018 ///
12019 /// # Example
12020 /// ```ignore,no_run
12021 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12022 /// use wkt::Timestamp;
12023 /// let x = LoggingServer::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12024 /// let x = LoggingServer::new().set_or_clear_create_time(None::<Timestamp>);
12025 /// ```
12026 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12027 where
12028 T: std::convert::Into<wkt::Timestamp>,
12029 {
12030 self.create_time = v.map(|x| x.into());
12031 self
12032 }
12033
12034 /// Sets the value of [update_time][crate::model::LoggingServer::update_time].
12035 ///
12036 /// # Example
12037 /// ```ignore,no_run
12038 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12039 /// use wkt::Timestamp;
12040 /// let x = LoggingServer::new().set_update_time(Timestamp::default()/* use setters */);
12041 /// ```
12042 pub fn set_update_time<T>(mut self, v: T) -> Self
12043 where
12044 T: std::convert::Into<wkt::Timestamp>,
12045 {
12046 self.update_time = std::option::Option::Some(v.into());
12047 self
12048 }
12049
12050 /// Sets or clears the value of [update_time][crate::model::LoggingServer::update_time].
12051 ///
12052 /// # Example
12053 /// ```ignore,no_run
12054 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12055 /// use wkt::Timestamp;
12056 /// let x = LoggingServer::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12057 /// let x = LoggingServer::new().set_or_clear_update_time(None::<Timestamp>);
12058 /// ```
12059 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12060 where
12061 T: std::convert::Into<wkt::Timestamp>,
12062 {
12063 self.update_time = v.map(|x| x.into());
12064 self
12065 }
12066
12067 /// Sets the value of [hostname][crate::model::LoggingServer::hostname].
12068 ///
12069 /// # Example
12070 /// ```ignore,no_run
12071 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12072 /// let x = LoggingServer::new().set_hostname("example");
12073 /// ```
12074 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12075 self.hostname = v.into();
12076 self
12077 }
12078
12079 /// Sets the value of [port][crate::model::LoggingServer::port].
12080 ///
12081 /// # Example
12082 /// ```ignore,no_run
12083 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12084 /// let x = LoggingServer::new().set_port(42);
12085 /// ```
12086 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12087 self.port = v.into();
12088 self
12089 }
12090
12091 /// Sets the value of [protocol][crate::model::LoggingServer::protocol].
12092 ///
12093 /// # Example
12094 /// ```ignore,no_run
12095 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12096 /// use google_cloud_vmwareengine_v1::model::logging_server::Protocol;
12097 /// let x0 = LoggingServer::new().set_protocol(Protocol::Udp);
12098 /// let x1 = LoggingServer::new().set_protocol(Protocol::Tcp);
12099 /// let x2 = LoggingServer::new().set_protocol(Protocol::Tls);
12100 /// ```
12101 pub fn set_protocol<T: std::convert::Into<crate::model::logging_server::Protocol>>(
12102 mut self,
12103 v: T,
12104 ) -> Self {
12105 self.protocol = v.into();
12106 self
12107 }
12108
12109 /// Sets the value of [source_type][crate::model::LoggingServer::source_type].
12110 ///
12111 /// # Example
12112 /// ```ignore,no_run
12113 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12114 /// use google_cloud_vmwareengine_v1::model::logging_server::SourceType;
12115 /// let x0 = LoggingServer::new().set_source_type(SourceType::Esxi);
12116 /// let x1 = LoggingServer::new().set_source_type(SourceType::Vcsa);
12117 /// ```
12118 pub fn set_source_type<T: std::convert::Into<crate::model::logging_server::SourceType>>(
12119 mut self,
12120 v: T,
12121 ) -> Self {
12122 self.source_type = v.into();
12123 self
12124 }
12125
12126 /// Sets the value of [uid][crate::model::LoggingServer::uid].
12127 ///
12128 /// # Example
12129 /// ```ignore,no_run
12130 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12131 /// let x = LoggingServer::new().set_uid("example");
12132 /// ```
12133 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12134 self.uid = v.into();
12135 self
12136 }
12137}
12138
12139impl wkt::message::Message for LoggingServer {
12140 fn typename() -> &'static str {
12141 "type.googleapis.com/google.cloud.vmwareengine.v1.LoggingServer"
12142 }
12143}
12144
12145/// Defines additional types related to [LoggingServer].
12146pub mod logging_server {
12147 #[allow(unused_imports)]
12148 use super::*;
12149
12150 /// Defines possible protocols used to send logs to
12151 /// a logging server.
12152 ///
12153 /// # Working with unknown values
12154 ///
12155 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12156 /// additional enum variants at any time. Adding new variants is not considered
12157 /// a breaking change. Applications should write their code in anticipation of:
12158 ///
12159 /// - New values appearing in future releases of the client library, **and**
12160 /// - New values received dynamically, without application changes.
12161 ///
12162 /// Please consult the [Working with enums] section in the user guide for some
12163 /// guidelines.
12164 ///
12165 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12166 #[derive(Clone, Debug, PartialEq)]
12167 #[non_exhaustive]
12168 pub enum Protocol {
12169 /// Unspecified communications protocol. This is the default value.
12170 Unspecified,
12171 /// UDP
12172 Udp,
12173 /// TCP
12174 Tcp,
12175 /// TLS
12176 Tls,
12177 /// SSL
12178 Ssl,
12179 /// RELP
12180 Relp,
12181 /// If set, the enum was initialized with an unknown value.
12182 ///
12183 /// Applications can examine the value using [Protocol::value] or
12184 /// [Protocol::name].
12185 UnknownValue(protocol::UnknownValue),
12186 }
12187
12188 #[doc(hidden)]
12189 pub mod protocol {
12190 #[allow(unused_imports)]
12191 use super::*;
12192 #[derive(Clone, Debug, PartialEq)]
12193 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12194 }
12195
12196 impl Protocol {
12197 /// Gets the enum value.
12198 ///
12199 /// Returns `None` if the enum contains an unknown value deserialized from
12200 /// the string representation of enums.
12201 pub fn value(&self) -> std::option::Option<i32> {
12202 match self {
12203 Self::Unspecified => std::option::Option::Some(0),
12204 Self::Udp => std::option::Option::Some(1),
12205 Self::Tcp => std::option::Option::Some(2),
12206 Self::Tls => std::option::Option::Some(3),
12207 Self::Ssl => std::option::Option::Some(4),
12208 Self::Relp => std::option::Option::Some(5),
12209 Self::UnknownValue(u) => u.0.value(),
12210 }
12211 }
12212
12213 /// Gets the enum value as a string.
12214 ///
12215 /// Returns `None` if the enum contains an unknown value deserialized from
12216 /// the integer representation of enums.
12217 pub fn name(&self) -> std::option::Option<&str> {
12218 match self {
12219 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
12220 Self::Udp => std::option::Option::Some("UDP"),
12221 Self::Tcp => std::option::Option::Some("TCP"),
12222 Self::Tls => std::option::Option::Some("TLS"),
12223 Self::Ssl => std::option::Option::Some("SSL"),
12224 Self::Relp => std::option::Option::Some("RELP"),
12225 Self::UnknownValue(u) => u.0.name(),
12226 }
12227 }
12228 }
12229
12230 impl std::default::Default for Protocol {
12231 fn default() -> Self {
12232 use std::convert::From;
12233 Self::from(0)
12234 }
12235 }
12236
12237 impl std::fmt::Display for Protocol {
12238 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12239 wkt::internal::display_enum(f, self.name(), self.value())
12240 }
12241 }
12242
12243 impl std::convert::From<i32> for Protocol {
12244 fn from(value: i32) -> Self {
12245 match value {
12246 0 => Self::Unspecified,
12247 1 => Self::Udp,
12248 2 => Self::Tcp,
12249 3 => Self::Tls,
12250 4 => Self::Ssl,
12251 5 => Self::Relp,
12252 _ => Self::UnknownValue(protocol::UnknownValue(
12253 wkt::internal::UnknownEnumValue::Integer(value),
12254 )),
12255 }
12256 }
12257 }
12258
12259 impl std::convert::From<&str> for Protocol {
12260 fn from(value: &str) -> Self {
12261 use std::string::ToString;
12262 match value {
12263 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
12264 "UDP" => Self::Udp,
12265 "TCP" => Self::Tcp,
12266 "TLS" => Self::Tls,
12267 "SSL" => Self::Ssl,
12268 "RELP" => Self::Relp,
12269 _ => Self::UnknownValue(protocol::UnknownValue(
12270 wkt::internal::UnknownEnumValue::String(value.to_string()),
12271 )),
12272 }
12273 }
12274 }
12275
12276 impl serde::ser::Serialize for Protocol {
12277 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12278 where
12279 S: serde::Serializer,
12280 {
12281 match self {
12282 Self::Unspecified => serializer.serialize_i32(0),
12283 Self::Udp => serializer.serialize_i32(1),
12284 Self::Tcp => serializer.serialize_i32(2),
12285 Self::Tls => serializer.serialize_i32(3),
12286 Self::Ssl => serializer.serialize_i32(4),
12287 Self::Relp => serializer.serialize_i32(5),
12288 Self::UnknownValue(u) => u.0.serialize(serializer),
12289 }
12290 }
12291 }
12292
12293 impl<'de> serde::de::Deserialize<'de> for Protocol {
12294 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12295 where
12296 D: serde::Deserializer<'de>,
12297 {
12298 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
12299 ".google.cloud.vmwareengine.v1.LoggingServer.Protocol",
12300 ))
12301 }
12302 }
12303
12304 /// Defines possible types of component that produces logs.
12305 ///
12306 /// # Working with unknown values
12307 ///
12308 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12309 /// additional enum variants at any time. Adding new variants is not considered
12310 /// a breaking change. Applications should write their code in anticipation of:
12311 ///
12312 /// - New values appearing in future releases of the client library, **and**
12313 /// - New values received dynamically, without application changes.
12314 ///
12315 /// Please consult the [Working with enums] section in the user guide for some
12316 /// guidelines.
12317 ///
12318 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12319 #[derive(Clone, Debug, PartialEq)]
12320 #[non_exhaustive]
12321 pub enum SourceType {
12322 /// The default value. This value should never be used.
12323 Unspecified,
12324 /// Logs produced by ESXI hosts
12325 Esxi,
12326 /// Logs produced by vCenter server
12327 Vcsa,
12328 /// If set, the enum was initialized with an unknown value.
12329 ///
12330 /// Applications can examine the value using [SourceType::value] or
12331 /// [SourceType::name].
12332 UnknownValue(source_type::UnknownValue),
12333 }
12334
12335 #[doc(hidden)]
12336 pub mod source_type {
12337 #[allow(unused_imports)]
12338 use super::*;
12339 #[derive(Clone, Debug, PartialEq)]
12340 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12341 }
12342
12343 impl SourceType {
12344 /// Gets the enum value.
12345 ///
12346 /// Returns `None` if the enum contains an unknown value deserialized from
12347 /// the string representation of enums.
12348 pub fn value(&self) -> std::option::Option<i32> {
12349 match self {
12350 Self::Unspecified => std::option::Option::Some(0),
12351 Self::Esxi => std::option::Option::Some(1),
12352 Self::Vcsa => std::option::Option::Some(2),
12353 Self::UnknownValue(u) => u.0.value(),
12354 }
12355 }
12356
12357 /// Gets the enum value as a string.
12358 ///
12359 /// Returns `None` if the enum contains an unknown value deserialized from
12360 /// the integer representation of enums.
12361 pub fn name(&self) -> std::option::Option<&str> {
12362 match self {
12363 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12364 Self::Esxi => std::option::Option::Some("ESXI"),
12365 Self::Vcsa => std::option::Option::Some("VCSA"),
12366 Self::UnknownValue(u) => u.0.name(),
12367 }
12368 }
12369 }
12370
12371 impl std::default::Default for SourceType {
12372 fn default() -> Self {
12373 use std::convert::From;
12374 Self::from(0)
12375 }
12376 }
12377
12378 impl std::fmt::Display for SourceType {
12379 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12380 wkt::internal::display_enum(f, self.name(), self.value())
12381 }
12382 }
12383
12384 impl std::convert::From<i32> for SourceType {
12385 fn from(value: i32) -> Self {
12386 match value {
12387 0 => Self::Unspecified,
12388 1 => Self::Esxi,
12389 2 => Self::Vcsa,
12390 _ => Self::UnknownValue(source_type::UnknownValue(
12391 wkt::internal::UnknownEnumValue::Integer(value),
12392 )),
12393 }
12394 }
12395 }
12396
12397 impl std::convert::From<&str> for SourceType {
12398 fn from(value: &str) -> Self {
12399 use std::string::ToString;
12400 match value {
12401 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12402 "ESXI" => Self::Esxi,
12403 "VCSA" => Self::Vcsa,
12404 _ => Self::UnknownValue(source_type::UnknownValue(
12405 wkt::internal::UnknownEnumValue::String(value.to_string()),
12406 )),
12407 }
12408 }
12409 }
12410
12411 impl serde::ser::Serialize for SourceType {
12412 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12413 where
12414 S: serde::Serializer,
12415 {
12416 match self {
12417 Self::Unspecified => serializer.serialize_i32(0),
12418 Self::Esxi => serializer.serialize_i32(1),
12419 Self::Vcsa => serializer.serialize_i32(2),
12420 Self::UnknownValue(u) => u.0.serialize(serializer),
12421 }
12422 }
12423 }
12424
12425 impl<'de> serde::de::Deserialize<'de> for SourceType {
12426 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12427 where
12428 D: serde::Deserializer<'de>,
12429 {
12430 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12431 ".google.cloud.vmwareengine.v1.LoggingServer.SourceType",
12432 ))
12433 }
12434 }
12435}
12436
12437/// Describes node type.
12438#[derive(Clone, Default, PartialEq)]
12439#[non_exhaustive]
12440pub struct NodeType {
12441 /// Output only. The resource name of this node type.
12442 /// Resource names are schemeless URIs that follow the conventions in
12443 /// <https://cloud.google.com/apis/design/resource_names>.
12444 /// For example:
12445 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
12446 pub name: std::string::String,
12447
12448 /// Output only. The canonical identifier of the node type
12449 /// (corresponds to the `NodeType`). For example: standard-72.
12450 pub node_type_id: std::string::String,
12451
12452 /// Output only. The friendly name for this node type.
12453 /// For example: ve1-standard-72
12454 pub display_name: std::string::String,
12455
12456 /// Output only. The total number of virtual CPUs in a single node.
12457 pub virtual_cpu_count: i32,
12458
12459 /// Output only. The total number of CPU cores in a single node.
12460 pub total_core_count: i32,
12461
12462 /// Output only. The amount of physical memory available, defined in GB.
12463 pub memory_gb: i32,
12464
12465 /// Output only. The amount of storage available, defined in GB.
12466 pub disk_size_gb: i32,
12467
12468 /// Output only. List of possible values of custom core count.
12469 pub available_custom_core_counts: std::vec::Vec<i32>,
12470
12471 /// Output only. The type of the resource.
12472 pub kind: crate::model::node_type::Kind,
12473
12474 /// Output only. Families of the node type.
12475 /// For node types to be in the same cluster
12476 /// they must share at least one element in the `families`.
12477 pub families: std::vec::Vec<std::string::String>,
12478
12479 /// Output only. Capabilities of this node type.
12480 pub capabilities: std::vec::Vec<crate::model::node_type::Capability>,
12481
12482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12483}
12484
12485impl NodeType {
12486 pub fn new() -> Self {
12487 std::default::Default::default()
12488 }
12489
12490 /// Sets the value of [name][crate::model::NodeType::name].
12491 ///
12492 /// # Example
12493 /// ```ignore,no_run
12494 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12495 /// let x = NodeType::new().set_name("example");
12496 /// ```
12497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12498 self.name = v.into();
12499 self
12500 }
12501
12502 /// Sets the value of [node_type_id][crate::model::NodeType::node_type_id].
12503 ///
12504 /// # Example
12505 /// ```ignore,no_run
12506 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12507 /// let x = NodeType::new().set_node_type_id("example");
12508 /// ```
12509 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12510 self.node_type_id = v.into();
12511 self
12512 }
12513
12514 /// Sets the value of [display_name][crate::model::NodeType::display_name].
12515 ///
12516 /// # Example
12517 /// ```ignore,no_run
12518 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12519 /// let x = NodeType::new().set_display_name("example");
12520 /// ```
12521 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12522 self.display_name = v.into();
12523 self
12524 }
12525
12526 /// Sets the value of [virtual_cpu_count][crate::model::NodeType::virtual_cpu_count].
12527 ///
12528 /// # Example
12529 /// ```ignore,no_run
12530 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12531 /// let x = NodeType::new().set_virtual_cpu_count(42);
12532 /// ```
12533 pub fn set_virtual_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12534 self.virtual_cpu_count = v.into();
12535 self
12536 }
12537
12538 /// Sets the value of [total_core_count][crate::model::NodeType::total_core_count].
12539 ///
12540 /// # Example
12541 /// ```ignore,no_run
12542 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12543 /// let x = NodeType::new().set_total_core_count(42);
12544 /// ```
12545 pub fn set_total_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12546 self.total_core_count = v.into();
12547 self
12548 }
12549
12550 /// Sets the value of [memory_gb][crate::model::NodeType::memory_gb].
12551 ///
12552 /// # Example
12553 /// ```ignore,no_run
12554 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12555 /// let x = NodeType::new().set_memory_gb(42);
12556 /// ```
12557 pub fn set_memory_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12558 self.memory_gb = v.into();
12559 self
12560 }
12561
12562 /// Sets the value of [disk_size_gb][crate::model::NodeType::disk_size_gb].
12563 ///
12564 /// # Example
12565 /// ```ignore,no_run
12566 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12567 /// let x = NodeType::new().set_disk_size_gb(42);
12568 /// ```
12569 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12570 self.disk_size_gb = v.into();
12571 self
12572 }
12573
12574 /// Sets the value of [available_custom_core_counts][crate::model::NodeType::available_custom_core_counts].
12575 ///
12576 /// # Example
12577 /// ```ignore,no_run
12578 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12579 /// let x = NodeType::new().set_available_custom_core_counts([1, 2, 3]);
12580 /// ```
12581 pub fn set_available_custom_core_counts<T, V>(mut self, v: T) -> Self
12582 where
12583 T: std::iter::IntoIterator<Item = V>,
12584 V: std::convert::Into<i32>,
12585 {
12586 use std::iter::Iterator;
12587 self.available_custom_core_counts = v.into_iter().map(|i| i.into()).collect();
12588 self
12589 }
12590
12591 /// Sets the value of [kind][crate::model::NodeType::kind].
12592 ///
12593 /// # Example
12594 /// ```ignore,no_run
12595 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12596 /// use google_cloud_vmwareengine_v1::model::node_type::Kind;
12597 /// let x0 = NodeType::new().set_kind(Kind::Standard);
12598 /// let x1 = NodeType::new().set_kind(Kind::StorageOnly);
12599 /// ```
12600 pub fn set_kind<T: std::convert::Into<crate::model::node_type::Kind>>(mut self, v: T) -> Self {
12601 self.kind = v.into();
12602 self
12603 }
12604
12605 /// Sets the value of [families][crate::model::NodeType::families].
12606 ///
12607 /// # Example
12608 /// ```ignore,no_run
12609 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12610 /// let x = NodeType::new().set_families(["a", "b", "c"]);
12611 /// ```
12612 pub fn set_families<T, V>(mut self, v: T) -> Self
12613 where
12614 T: std::iter::IntoIterator<Item = V>,
12615 V: std::convert::Into<std::string::String>,
12616 {
12617 use std::iter::Iterator;
12618 self.families = v.into_iter().map(|i| i.into()).collect();
12619 self
12620 }
12621
12622 /// Sets the value of [capabilities][crate::model::NodeType::capabilities].
12623 ///
12624 /// # Example
12625 /// ```ignore,no_run
12626 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12627 /// use google_cloud_vmwareengine_v1::model::node_type::Capability;
12628 /// let x = NodeType::new().set_capabilities([
12629 /// Capability::StretchedClusters,
12630 /// ]);
12631 /// ```
12632 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
12633 where
12634 T: std::iter::IntoIterator<Item = V>,
12635 V: std::convert::Into<crate::model::node_type::Capability>,
12636 {
12637 use std::iter::Iterator;
12638 self.capabilities = v.into_iter().map(|i| i.into()).collect();
12639 self
12640 }
12641}
12642
12643impl wkt::message::Message for NodeType {
12644 fn typename() -> &'static str {
12645 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeType"
12646 }
12647}
12648
12649/// Defines additional types related to [NodeType].
12650pub mod node_type {
12651 #[allow(unused_imports)]
12652 use super::*;
12653
12654 /// Enum Kind defines possible types of a NodeType.
12655 ///
12656 /// # Working with unknown values
12657 ///
12658 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12659 /// additional enum variants at any time. Adding new variants is not considered
12660 /// a breaking change. Applications should write their code in anticipation of:
12661 ///
12662 /// - New values appearing in future releases of the client library, **and**
12663 /// - New values received dynamically, without application changes.
12664 ///
12665 /// Please consult the [Working with enums] section in the user guide for some
12666 /// guidelines.
12667 ///
12668 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12669 #[derive(Clone, Debug, PartialEq)]
12670 #[non_exhaustive]
12671 pub enum Kind {
12672 /// The default value. This value should never be used.
12673 Unspecified,
12674 /// Standard HCI node.
12675 Standard,
12676 /// Storage only Node.
12677 StorageOnly,
12678 /// If set, the enum was initialized with an unknown value.
12679 ///
12680 /// Applications can examine the value using [Kind::value] or
12681 /// [Kind::name].
12682 UnknownValue(kind::UnknownValue),
12683 }
12684
12685 #[doc(hidden)]
12686 pub mod kind {
12687 #[allow(unused_imports)]
12688 use super::*;
12689 #[derive(Clone, Debug, PartialEq)]
12690 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12691 }
12692
12693 impl Kind {
12694 /// Gets the enum value.
12695 ///
12696 /// Returns `None` if the enum contains an unknown value deserialized from
12697 /// the string representation of enums.
12698 pub fn value(&self) -> std::option::Option<i32> {
12699 match self {
12700 Self::Unspecified => std::option::Option::Some(0),
12701 Self::Standard => std::option::Option::Some(1),
12702 Self::StorageOnly => std::option::Option::Some(2),
12703 Self::UnknownValue(u) => u.0.value(),
12704 }
12705 }
12706
12707 /// Gets the enum value as a string.
12708 ///
12709 /// Returns `None` if the enum contains an unknown value deserialized from
12710 /// the integer representation of enums.
12711 pub fn name(&self) -> std::option::Option<&str> {
12712 match self {
12713 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
12714 Self::Standard => std::option::Option::Some("STANDARD"),
12715 Self::StorageOnly => std::option::Option::Some("STORAGE_ONLY"),
12716 Self::UnknownValue(u) => u.0.name(),
12717 }
12718 }
12719 }
12720
12721 impl std::default::Default for Kind {
12722 fn default() -> Self {
12723 use std::convert::From;
12724 Self::from(0)
12725 }
12726 }
12727
12728 impl std::fmt::Display for Kind {
12729 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12730 wkt::internal::display_enum(f, self.name(), self.value())
12731 }
12732 }
12733
12734 impl std::convert::From<i32> for Kind {
12735 fn from(value: i32) -> Self {
12736 match value {
12737 0 => Self::Unspecified,
12738 1 => Self::Standard,
12739 2 => Self::StorageOnly,
12740 _ => Self::UnknownValue(kind::UnknownValue(
12741 wkt::internal::UnknownEnumValue::Integer(value),
12742 )),
12743 }
12744 }
12745 }
12746
12747 impl std::convert::From<&str> for Kind {
12748 fn from(value: &str) -> Self {
12749 use std::string::ToString;
12750 match value {
12751 "KIND_UNSPECIFIED" => Self::Unspecified,
12752 "STANDARD" => Self::Standard,
12753 "STORAGE_ONLY" => Self::StorageOnly,
12754 _ => Self::UnknownValue(kind::UnknownValue(
12755 wkt::internal::UnknownEnumValue::String(value.to_string()),
12756 )),
12757 }
12758 }
12759 }
12760
12761 impl serde::ser::Serialize for Kind {
12762 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12763 where
12764 S: serde::Serializer,
12765 {
12766 match self {
12767 Self::Unspecified => serializer.serialize_i32(0),
12768 Self::Standard => serializer.serialize_i32(1),
12769 Self::StorageOnly => serializer.serialize_i32(2),
12770 Self::UnknownValue(u) => u.0.serialize(serializer),
12771 }
12772 }
12773 }
12774
12775 impl<'de> serde::de::Deserialize<'de> for Kind {
12776 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12777 where
12778 D: serde::Deserializer<'de>,
12779 {
12780 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
12781 ".google.cloud.vmwareengine.v1.NodeType.Kind",
12782 ))
12783 }
12784 }
12785
12786 /// Capability of a node type.
12787 ///
12788 /// # Working with unknown values
12789 ///
12790 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12791 /// additional enum variants at any time. Adding new variants is not considered
12792 /// a breaking change. Applications should write their code in anticipation of:
12793 ///
12794 /// - New values appearing in future releases of the client library, **and**
12795 /// - New values received dynamically, without application changes.
12796 ///
12797 /// Please consult the [Working with enums] section in the user guide for some
12798 /// guidelines.
12799 ///
12800 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12801 #[derive(Clone, Debug, PartialEq)]
12802 #[non_exhaustive]
12803 pub enum Capability {
12804 /// The default value. This value is used if the capability is omitted or
12805 /// unknown.
12806 Unspecified,
12807 /// This node type supports stretch clusters.
12808 StretchedClusters,
12809 /// If set, the enum was initialized with an unknown value.
12810 ///
12811 /// Applications can examine the value using [Capability::value] or
12812 /// [Capability::name].
12813 UnknownValue(capability::UnknownValue),
12814 }
12815
12816 #[doc(hidden)]
12817 pub mod capability {
12818 #[allow(unused_imports)]
12819 use super::*;
12820 #[derive(Clone, Debug, PartialEq)]
12821 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12822 }
12823
12824 impl Capability {
12825 /// Gets the enum value.
12826 ///
12827 /// Returns `None` if the enum contains an unknown value deserialized from
12828 /// the string representation of enums.
12829 pub fn value(&self) -> std::option::Option<i32> {
12830 match self {
12831 Self::Unspecified => std::option::Option::Some(0),
12832 Self::StretchedClusters => std::option::Option::Some(1),
12833 Self::UnknownValue(u) => u.0.value(),
12834 }
12835 }
12836
12837 /// Gets the enum value as a string.
12838 ///
12839 /// Returns `None` if the enum contains an unknown value deserialized from
12840 /// the integer representation of enums.
12841 pub fn name(&self) -> std::option::Option<&str> {
12842 match self {
12843 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
12844 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
12845 Self::UnknownValue(u) => u.0.name(),
12846 }
12847 }
12848 }
12849
12850 impl std::default::Default for Capability {
12851 fn default() -> Self {
12852 use std::convert::From;
12853 Self::from(0)
12854 }
12855 }
12856
12857 impl std::fmt::Display for Capability {
12858 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12859 wkt::internal::display_enum(f, self.name(), self.value())
12860 }
12861 }
12862
12863 impl std::convert::From<i32> for Capability {
12864 fn from(value: i32) -> Self {
12865 match value {
12866 0 => Self::Unspecified,
12867 1 => Self::StretchedClusters,
12868 _ => Self::UnknownValue(capability::UnknownValue(
12869 wkt::internal::UnknownEnumValue::Integer(value),
12870 )),
12871 }
12872 }
12873 }
12874
12875 impl std::convert::From<&str> for Capability {
12876 fn from(value: &str) -> Self {
12877 use std::string::ToString;
12878 match value {
12879 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
12880 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
12881 _ => Self::UnknownValue(capability::UnknownValue(
12882 wkt::internal::UnknownEnumValue::String(value.to_string()),
12883 )),
12884 }
12885 }
12886 }
12887
12888 impl serde::ser::Serialize for Capability {
12889 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12890 where
12891 S: serde::Serializer,
12892 {
12893 match self {
12894 Self::Unspecified => serializer.serialize_i32(0),
12895 Self::StretchedClusters => serializer.serialize_i32(1),
12896 Self::UnknownValue(u) => u.0.serialize(serializer),
12897 }
12898 }
12899 }
12900
12901 impl<'de> serde::de::Deserialize<'de> for Capability {
12902 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12903 where
12904 D: serde::Deserializer<'de>,
12905 {
12906 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
12907 ".google.cloud.vmwareengine.v1.NodeType.Capability",
12908 ))
12909 }
12910 }
12911}
12912
12913/// Credentials for a private cloud.
12914#[derive(Clone, Default, PartialEq)]
12915#[non_exhaustive]
12916pub struct Credentials {
12917 /// Initial username.
12918 pub username: std::string::String,
12919
12920 /// Initial password.
12921 pub password: std::string::String,
12922
12923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12924}
12925
12926impl Credentials {
12927 pub fn new() -> Self {
12928 std::default::Default::default()
12929 }
12930
12931 /// Sets the value of [username][crate::model::Credentials::username].
12932 ///
12933 /// # Example
12934 /// ```ignore,no_run
12935 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12936 /// let x = Credentials::new().set_username("example");
12937 /// ```
12938 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12939 self.username = v.into();
12940 self
12941 }
12942
12943 /// Sets the value of [password][crate::model::Credentials::password].
12944 ///
12945 /// # Example
12946 /// ```ignore,no_run
12947 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12948 /// let x = Credentials::new().set_password("example");
12949 /// ```
12950 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12951 self.password = v.into();
12952 self
12953 }
12954}
12955
12956impl wkt::message::Message for Credentials {
12957 fn typename() -> &'static str {
12958 "type.googleapis.com/google.cloud.vmwareengine.v1.Credentials"
12959 }
12960}
12961
12962/// HCX activation key. A default key is created during
12963/// private cloud provisioning, but this behavior is subject to change
12964/// and you should always verify active keys.
12965/// Use
12966/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
12967/// to retrieve existing keys and
12968/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
12969/// to create new ones.
12970///
12971/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
12972/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
12973#[derive(Clone, Default, PartialEq)]
12974#[non_exhaustive]
12975pub struct HcxActivationKey {
12976 /// Output only. The resource name of this HcxActivationKey.
12977 /// Resource names are schemeless URIs that follow the conventions in
12978 /// <https://cloud.google.com/apis/design/resource_names>.
12979 /// For example:
12980 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
12981 pub name: std::string::String,
12982
12983 /// Output only. Creation time of HCX activation key.
12984 pub create_time: std::option::Option<wkt::Timestamp>,
12985
12986 /// Output only. State of HCX activation key.
12987 pub state: crate::model::hcx_activation_key::State,
12988
12989 /// Output only. HCX activation key.
12990 pub activation_key: std::string::String,
12991
12992 /// Output only. System-generated unique identifier for the resource.
12993 pub uid: std::string::String,
12994
12995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12996}
12997
12998impl HcxActivationKey {
12999 pub fn new() -> Self {
13000 std::default::Default::default()
13001 }
13002
13003 /// Sets the value of [name][crate::model::HcxActivationKey::name].
13004 ///
13005 /// # Example
13006 /// ```ignore,no_run
13007 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13008 /// let x = HcxActivationKey::new().set_name("example");
13009 /// ```
13010 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13011 self.name = v.into();
13012 self
13013 }
13014
13015 /// Sets the value of [create_time][crate::model::HcxActivationKey::create_time].
13016 ///
13017 /// # Example
13018 /// ```ignore,no_run
13019 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13020 /// use wkt::Timestamp;
13021 /// let x = HcxActivationKey::new().set_create_time(Timestamp::default()/* use setters */);
13022 /// ```
13023 pub fn set_create_time<T>(mut self, v: T) -> Self
13024 where
13025 T: std::convert::Into<wkt::Timestamp>,
13026 {
13027 self.create_time = std::option::Option::Some(v.into());
13028 self
13029 }
13030
13031 /// Sets or clears the value of [create_time][crate::model::HcxActivationKey::create_time].
13032 ///
13033 /// # Example
13034 /// ```ignore,no_run
13035 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13036 /// use wkt::Timestamp;
13037 /// let x = HcxActivationKey::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13038 /// let x = HcxActivationKey::new().set_or_clear_create_time(None::<Timestamp>);
13039 /// ```
13040 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13041 where
13042 T: std::convert::Into<wkt::Timestamp>,
13043 {
13044 self.create_time = v.map(|x| x.into());
13045 self
13046 }
13047
13048 /// Sets the value of [state][crate::model::HcxActivationKey::state].
13049 ///
13050 /// # Example
13051 /// ```ignore,no_run
13052 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13053 /// use google_cloud_vmwareengine_v1::model::hcx_activation_key::State;
13054 /// let x0 = HcxActivationKey::new().set_state(State::Available);
13055 /// let x1 = HcxActivationKey::new().set_state(State::Consumed);
13056 /// let x2 = HcxActivationKey::new().set_state(State::Creating);
13057 /// ```
13058 pub fn set_state<T: std::convert::Into<crate::model::hcx_activation_key::State>>(
13059 mut self,
13060 v: T,
13061 ) -> Self {
13062 self.state = v.into();
13063 self
13064 }
13065
13066 /// Sets the value of [activation_key][crate::model::HcxActivationKey::activation_key].
13067 ///
13068 /// # Example
13069 /// ```ignore,no_run
13070 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13071 /// let x = HcxActivationKey::new().set_activation_key("example");
13072 /// ```
13073 pub fn set_activation_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13074 self.activation_key = v.into();
13075 self
13076 }
13077
13078 /// Sets the value of [uid][crate::model::HcxActivationKey::uid].
13079 ///
13080 /// # Example
13081 /// ```ignore,no_run
13082 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13083 /// let x = HcxActivationKey::new().set_uid("example");
13084 /// ```
13085 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13086 self.uid = v.into();
13087 self
13088 }
13089}
13090
13091impl wkt::message::Message for HcxActivationKey {
13092 fn typename() -> &'static str {
13093 "type.googleapis.com/google.cloud.vmwareengine.v1.HcxActivationKey"
13094 }
13095}
13096
13097/// Defines additional types related to [HcxActivationKey].
13098pub mod hcx_activation_key {
13099 #[allow(unused_imports)]
13100 use super::*;
13101
13102 /// State of HCX activation key
13103 ///
13104 /// # Working with unknown values
13105 ///
13106 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13107 /// additional enum variants at any time. Adding new variants is not considered
13108 /// a breaking change. Applications should write their code in anticipation of:
13109 ///
13110 /// - New values appearing in future releases of the client library, **and**
13111 /// - New values received dynamically, without application changes.
13112 ///
13113 /// Please consult the [Working with enums] section in the user guide for some
13114 /// guidelines.
13115 ///
13116 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13117 #[derive(Clone, Debug, PartialEq)]
13118 #[non_exhaustive]
13119 pub enum State {
13120 /// Unspecified state.
13121 Unspecified,
13122 /// State of a newly generated activation key.
13123 Available,
13124 /// State of key when it has been used to activate HCX appliance.
13125 Consumed,
13126 /// State of key when it is being created.
13127 Creating,
13128 /// If set, the enum was initialized with an unknown value.
13129 ///
13130 /// Applications can examine the value using [State::value] or
13131 /// [State::name].
13132 UnknownValue(state::UnknownValue),
13133 }
13134
13135 #[doc(hidden)]
13136 pub mod state {
13137 #[allow(unused_imports)]
13138 use super::*;
13139 #[derive(Clone, Debug, PartialEq)]
13140 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13141 }
13142
13143 impl State {
13144 /// Gets the enum value.
13145 ///
13146 /// Returns `None` if the enum contains an unknown value deserialized from
13147 /// the string representation of enums.
13148 pub fn value(&self) -> std::option::Option<i32> {
13149 match self {
13150 Self::Unspecified => std::option::Option::Some(0),
13151 Self::Available => std::option::Option::Some(1),
13152 Self::Consumed => std::option::Option::Some(2),
13153 Self::Creating => std::option::Option::Some(3),
13154 Self::UnknownValue(u) => u.0.value(),
13155 }
13156 }
13157
13158 /// Gets the enum value as a string.
13159 ///
13160 /// Returns `None` if the enum contains an unknown value deserialized from
13161 /// the integer representation of enums.
13162 pub fn name(&self) -> std::option::Option<&str> {
13163 match self {
13164 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13165 Self::Available => std::option::Option::Some("AVAILABLE"),
13166 Self::Consumed => std::option::Option::Some("CONSUMED"),
13167 Self::Creating => std::option::Option::Some("CREATING"),
13168 Self::UnknownValue(u) => u.0.name(),
13169 }
13170 }
13171 }
13172
13173 impl std::default::Default for State {
13174 fn default() -> Self {
13175 use std::convert::From;
13176 Self::from(0)
13177 }
13178 }
13179
13180 impl std::fmt::Display for State {
13181 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13182 wkt::internal::display_enum(f, self.name(), self.value())
13183 }
13184 }
13185
13186 impl std::convert::From<i32> for State {
13187 fn from(value: i32) -> Self {
13188 match value {
13189 0 => Self::Unspecified,
13190 1 => Self::Available,
13191 2 => Self::Consumed,
13192 3 => Self::Creating,
13193 _ => Self::UnknownValue(state::UnknownValue(
13194 wkt::internal::UnknownEnumValue::Integer(value),
13195 )),
13196 }
13197 }
13198 }
13199
13200 impl std::convert::From<&str> for State {
13201 fn from(value: &str) -> Self {
13202 use std::string::ToString;
13203 match value {
13204 "STATE_UNSPECIFIED" => Self::Unspecified,
13205 "AVAILABLE" => Self::Available,
13206 "CONSUMED" => Self::Consumed,
13207 "CREATING" => Self::Creating,
13208 _ => Self::UnknownValue(state::UnknownValue(
13209 wkt::internal::UnknownEnumValue::String(value.to_string()),
13210 )),
13211 }
13212 }
13213 }
13214
13215 impl serde::ser::Serialize for State {
13216 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13217 where
13218 S: serde::Serializer,
13219 {
13220 match self {
13221 Self::Unspecified => serializer.serialize_i32(0),
13222 Self::Available => serializer.serialize_i32(1),
13223 Self::Consumed => serializer.serialize_i32(2),
13224 Self::Creating => serializer.serialize_i32(3),
13225 Self::UnknownValue(u) => u.0.serialize(serializer),
13226 }
13227 }
13228 }
13229
13230 impl<'de> serde::de::Deserialize<'de> for State {
13231 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13232 where
13233 D: serde::Deserializer<'de>,
13234 {
13235 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13236 ".google.cloud.vmwareengine.v1.HcxActivationKey.State",
13237 ))
13238 }
13239 }
13240}
13241
13242/// Details about a HCX Cloud Manager appliance.
13243#[derive(Clone, Default, PartialEq)]
13244#[non_exhaustive]
13245pub struct Hcx {
13246 /// Internal IP address of the appliance.
13247 pub internal_ip: std::string::String,
13248
13249 /// Version of the appliance.
13250 pub version: std::string::String,
13251
13252 /// Output only. The state of the appliance.
13253 pub state: crate::model::hcx::State,
13254
13255 /// Fully qualified domain name of the appliance.
13256 pub fqdn: std::string::String,
13257
13258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13259}
13260
13261impl Hcx {
13262 pub fn new() -> Self {
13263 std::default::Default::default()
13264 }
13265
13266 /// Sets the value of [internal_ip][crate::model::Hcx::internal_ip].
13267 ///
13268 /// # Example
13269 /// ```ignore,no_run
13270 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13271 /// let x = Hcx::new().set_internal_ip("example");
13272 /// ```
13273 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13274 self.internal_ip = v.into();
13275 self
13276 }
13277
13278 /// Sets the value of [version][crate::model::Hcx::version].
13279 ///
13280 /// # Example
13281 /// ```ignore,no_run
13282 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13283 /// let x = Hcx::new().set_version("example");
13284 /// ```
13285 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13286 self.version = v.into();
13287 self
13288 }
13289
13290 /// Sets the value of [state][crate::model::Hcx::state].
13291 ///
13292 /// # Example
13293 /// ```ignore,no_run
13294 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13295 /// use google_cloud_vmwareengine_v1::model::hcx::State;
13296 /// let x0 = Hcx::new().set_state(State::Active);
13297 /// let x1 = Hcx::new().set_state(State::Creating);
13298 /// let x2 = Hcx::new().set_state(State::Activating);
13299 /// ```
13300 pub fn set_state<T: std::convert::Into<crate::model::hcx::State>>(mut self, v: T) -> Self {
13301 self.state = v.into();
13302 self
13303 }
13304
13305 /// Sets the value of [fqdn][crate::model::Hcx::fqdn].
13306 ///
13307 /// # Example
13308 /// ```ignore,no_run
13309 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13310 /// let x = Hcx::new().set_fqdn("example");
13311 /// ```
13312 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13313 self.fqdn = v.into();
13314 self
13315 }
13316}
13317
13318impl wkt::message::Message for Hcx {
13319 fn typename() -> &'static str {
13320 "type.googleapis.com/google.cloud.vmwareengine.v1.Hcx"
13321 }
13322}
13323
13324/// Defines additional types related to [Hcx].
13325pub mod hcx {
13326 #[allow(unused_imports)]
13327 use super::*;
13328
13329 /// State of the appliance
13330 ///
13331 /// # Working with unknown values
13332 ///
13333 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13334 /// additional enum variants at any time. Adding new variants is not considered
13335 /// a breaking change. Applications should write their code in anticipation of:
13336 ///
13337 /// - New values appearing in future releases of the client library, **and**
13338 /// - New values received dynamically, without application changes.
13339 ///
13340 /// Please consult the [Working with enums] section in the user guide for some
13341 /// guidelines.
13342 ///
13343 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13344 #[derive(Clone, Debug, PartialEq)]
13345 #[non_exhaustive]
13346 pub enum State {
13347 /// Unspecified appliance state. This is the default value.
13348 Unspecified,
13349 /// The appliance is operational and can be used.
13350 Active,
13351 /// The appliance is being deployed.
13352 Creating,
13353 /// The appliance is being activated.
13354 Activating,
13355 /// If set, the enum was initialized with an unknown value.
13356 ///
13357 /// Applications can examine the value using [State::value] or
13358 /// [State::name].
13359 UnknownValue(state::UnknownValue),
13360 }
13361
13362 #[doc(hidden)]
13363 pub mod state {
13364 #[allow(unused_imports)]
13365 use super::*;
13366 #[derive(Clone, Debug, PartialEq)]
13367 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13368 }
13369
13370 impl State {
13371 /// Gets the enum value.
13372 ///
13373 /// Returns `None` if the enum contains an unknown value deserialized from
13374 /// the string representation of enums.
13375 pub fn value(&self) -> std::option::Option<i32> {
13376 match self {
13377 Self::Unspecified => std::option::Option::Some(0),
13378 Self::Active => std::option::Option::Some(1),
13379 Self::Creating => std::option::Option::Some(2),
13380 Self::Activating => std::option::Option::Some(3),
13381 Self::UnknownValue(u) => u.0.value(),
13382 }
13383 }
13384
13385 /// Gets the enum value as a string.
13386 ///
13387 /// Returns `None` if the enum contains an unknown value deserialized from
13388 /// the integer representation of enums.
13389 pub fn name(&self) -> std::option::Option<&str> {
13390 match self {
13391 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13392 Self::Active => std::option::Option::Some("ACTIVE"),
13393 Self::Creating => std::option::Option::Some("CREATING"),
13394 Self::Activating => std::option::Option::Some("ACTIVATING"),
13395 Self::UnknownValue(u) => u.0.name(),
13396 }
13397 }
13398 }
13399
13400 impl std::default::Default for State {
13401 fn default() -> Self {
13402 use std::convert::From;
13403 Self::from(0)
13404 }
13405 }
13406
13407 impl std::fmt::Display for State {
13408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13409 wkt::internal::display_enum(f, self.name(), self.value())
13410 }
13411 }
13412
13413 impl std::convert::From<i32> for State {
13414 fn from(value: i32) -> Self {
13415 match value {
13416 0 => Self::Unspecified,
13417 1 => Self::Active,
13418 2 => Self::Creating,
13419 3 => Self::Activating,
13420 _ => Self::UnknownValue(state::UnknownValue(
13421 wkt::internal::UnknownEnumValue::Integer(value),
13422 )),
13423 }
13424 }
13425 }
13426
13427 impl std::convert::From<&str> for State {
13428 fn from(value: &str) -> Self {
13429 use std::string::ToString;
13430 match value {
13431 "STATE_UNSPECIFIED" => Self::Unspecified,
13432 "ACTIVE" => Self::Active,
13433 "CREATING" => Self::Creating,
13434 "ACTIVATING" => Self::Activating,
13435 _ => Self::UnknownValue(state::UnknownValue(
13436 wkt::internal::UnknownEnumValue::String(value.to_string()),
13437 )),
13438 }
13439 }
13440 }
13441
13442 impl serde::ser::Serialize for State {
13443 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13444 where
13445 S: serde::Serializer,
13446 {
13447 match self {
13448 Self::Unspecified => serializer.serialize_i32(0),
13449 Self::Active => serializer.serialize_i32(1),
13450 Self::Creating => serializer.serialize_i32(2),
13451 Self::Activating => serializer.serialize_i32(3),
13452 Self::UnknownValue(u) => u.0.serialize(serializer),
13453 }
13454 }
13455 }
13456
13457 impl<'de> serde::de::Deserialize<'de> for State {
13458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13459 where
13460 D: serde::Deserializer<'de>,
13461 {
13462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13463 ".google.cloud.vmwareengine.v1.Hcx.State",
13464 ))
13465 }
13466 }
13467}
13468
13469/// Details about a NSX Manager appliance.
13470#[derive(Clone, Default, PartialEq)]
13471#[non_exhaustive]
13472pub struct Nsx {
13473 /// Internal IP address of the appliance.
13474 pub internal_ip: std::string::String,
13475
13476 /// Version of the appliance.
13477 pub version: std::string::String,
13478
13479 /// Output only. The state of the appliance.
13480 pub state: crate::model::nsx::State,
13481
13482 /// Fully qualified domain name of the appliance.
13483 pub fqdn: std::string::String,
13484
13485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13486}
13487
13488impl Nsx {
13489 pub fn new() -> Self {
13490 std::default::Default::default()
13491 }
13492
13493 /// Sets the value of [internal_ip][crate::model::Nsx::internal_ip].
13494 ///
13495 /// # Example
13496 /// ```ignore,no_run
13497 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13498 /// let x = Nsx::new().set_internal_ip("example");
13499 /// ```
13500 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13501 self.internal_ip = v.into();
13502 self
13503 }
13504
13505 /// Sets the value of [version][crate::model::Nsx::version].
13506 ///
13507 /// # Example
13508 /// ```ignore,no_run
13509 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13510 /// let x = Nsx::new().set_version("example");
13511 /// ```
13512 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13513 self.version = v.into();
13514 self
13515 }
13516
13517 /// Sets the value of [state][crate::model::Nsx::state].
13518 ///
13519 /// # Example
13520 /// ```ignore,no_run
13521 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13522 /// use google_cloud_vmwareengine_v1::model::nsx::State;
13523 /// let x0 = Nsx::new().set_state(State::Active);
13524 /// let x1 = Nsx::new().set_state(State::Creating);
13525 /// ```
13526 pub fn set_state<T: std::convert::Into<crate::model::nsx::State>>(mut self, v: T) -> Self {
13527 self.state = v.into();
13528 self
13529 }
13530
13531 /// Sets the value of [fqdn][crate::model::Nsx::fqdn].
13532 ///
13533 /// # Example
13534 /// ```ignore,no_run
13535 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13536 /// let x = Nsx::new().set_fqdn("example");
13537 /// ```
13538 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13539 self.fqdn = v.into();
13540 self
13541 }
13542}
13543
13544impl wkt::message::Message for Nsx {
13545 fn typename() -> &'static str {
13546 "type.googleapis.com/google.cloud.vmwareengine.v1.Nsx"
13547 }
13548}
13549
13550/// Defines additional types related to [Nsx].
13551pub mod nsx {
13552 #[allow(unused_imports)]
13553 use super::*;
13554
13555 /// State of the appliance
13556 ///
13557 /// # Working with unknown values
13558 ///
13559 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13560 /// additional enum variants at any time. Adding new variants is not considered
13561 /// a breaking change. Applications should write their code in anticipation of:
13562 ///
13563 /// - New values appearing in future releases of the client library, **and**
13564 /// - New values received dynamically, without application changes.
13565 ///
13566 /// Please consult the [Working with enums] section in the user guide for some
13567 /// guidelines.
13568 ///
13569 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13570 #[derive(Clone, Debug, PartialEq)]
13571 #[non_exhaustive]
13572 pub enum State {
13573 /// Unspecified appliance state. This is the default value.
13574 Unspecified,
13575 /// The appliance is operational and can be used.
13576 Active,
13577 /// The appliance is being deployed.
13578 Creating,
13579 /// If set, the enum was initialized with an unknown value.
13580 ///
13581 /// Applications can examine the value using [State::value] or
13582 /// [State::name].
13583 UnknownValue(state::UnknownValue),
13584 }
13585
13586 #[doc(hidden)]
13587 pub mod state {
13588 #[allow(unused_imports)]
13589 use super::*;
13590 #[derive(Clone, Debug, PartialEq)]
13591 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13592 }
13593
13594 impl State {
13595 /// Gets the enum value.
13596 ///
13597 /// Returns `None` if the enum contains an unknown value deserialized from
13598 /// the string representation of enums.
13599 pub fn value(&self) -> std::option::Option<i32> {
13600 match self {
13601 Self::Unspecified => std::option::Option::Some(0),
13602 Self::Active => std::option::Option::Some(1),
13603 Self::Creating => std::option::Option::Some(2),
13604 Self::UnknownValue(u) => u.0.value(),
13605 }
13606 }
13607
13608 /// Gets the enum value as a string.
13609 ///
13610 /// Returns `None` if the enum contains an unknown value deserialized from
13611 /// the integer representation of enums.
13612 pub fn name(&self) -> std::option::Option<&str> {
13613 match self {
13614 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13615 Self::Active => std::option::Option::Some("ACTIVE"),
13616 Self::Creating => std::option::Option::Some("CREATING"),
13617 Self::UnknownValue(u) => u.0.name(),
13618 }
13619 }
13620 }
13621
13622 impl std::default::Default for State {
13623 fn default() -> Self {
13624 use std::convert::From;
13625 Self::from(0)
13626 }
13627 }
13628
13629 impl std::fmt::Display for State {
13630 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13631 wkt::internal::display_enum(f, self.name(), self.value())
13632 }
13633 }
13634
13635 impl std::convert::From<i32> for State {
13636 fn from(value: i32) -> Self {
13637 match value {
13638 0 => Self::Unspecified,
13639 1 => Self::Active,
13640 2 => Self::Creating,
13641 _ => Self::UnknownValue(state::UnknownValue(
13642 wkt::internal::UnknownEnumValue::Integer(value),
13643 )),
13644 }
13645 }
13646 }
13647
13648 impl std::convert::From<&str> for State {
13649 fn from(value: &str) -> Self {
13650 use std::string::ToString;
13651 match value {
13652 "STATE_UNSPECIFIED" => Self::Unspecified,
13653 "ACTIVE" => Self::Active,
13654 "CREATING" => Self::Creating,
13655 _ => Self::UnknownValue(state::UnknownValue(
13656 wkt::internal::UnknownEnumValue::String(value.to_string()),
13657 )),
13658 }
13659 }
13660 }
13661
13662 impl serde::ser::Serialize for State {
13663 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13664 where
13665 S: serde::Serializer,
13666 {
13667 match self {
13668 Self::Unspecified => serializer.serialize_i32(0),
13669 Self::Active => serializer.serialize_i32(1),
13670 Self::Creating => serializer.serialize_i32(2),
13671 Self::UnknownValue(u) => u.0.serialize(serializer),
13672 }
13673 }
13674 }
13675
13676 impl<'de> serde::de::Deserialize<'de> for State {
13677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13678 where
13679 D: serde::Deserializer<'de>,
13680 {
13681 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13682 ".google.cloud.vmwareengine.v1.Nsx.State",
13683 ))
13684 }
13685 }
13686}
13687
13688/// Details about a vCenter Server management appliance.
13689#[derive(Clone, Default, PartialEq)]
13690#[non_exhaustive]
13691pub struct Vcenter {
13692 /// Internal IP address of the appliance.
13693 pub internal_ip: std::string::String,
13694
13695 /// Version of the appliance.
13696 pub version: std::string::String,
13697
13698 /// Output only. The state of the appliance.
13699 pub state: crate::model::vcenter::State,
13700
13701 /// Fully qualified domain name of the appliance.
13702 pub fqdn: std::string::String,
13703
13704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13705}
13706
13707impl Vcenter {
13708 pub fn new() -> Self {
13709 std::default::Default::default()
13710 }
13711
13712 /// Sets the value of [internal_ip][crate::model::Vcenter::internal_ip].
13713 ///
13714 /// # Example
13715 /// ```ignore,no_run
13716 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13717 /// let x = Vcenter::new().set_internal_ip("example");
13718 /// ```
13719 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13720 self.internal_ip = v.into();
13721 self
13722 }
13723
13724 /// Sets the value of [version][crate::model::Vcenter::version].
13725 ///
13726 /// # Example
13727 /// ```ignore,no_run
13728 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13729 /// let x = Vcenter::new().set_version("example");
13730 /// ```
13731 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13732 self.version = v.into();
13733 self
13734 }
13735
13736 /// Sets the value of [state][crate::model::Vcenter::state].
13737 ///
13738 /// # Example
13739 /// ```ignore,no_run
13740 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13741 /// use google_cloud_vmwareengine_v1::model::vcenter::State;
13742 /// let x0 = Vcenter::new().set_state(State::Active);
13743 /// let x1 = Vcenter::new().set_state(State::Creating);
13744 /// ```
13745 pub fn set_state<T: std::convert::Into<crate::model::vcenter::State>>(mut self, v: T) -> Self {
13746 self.state = v.into();
13747 self
13748 }
13749
13750 /// Sets the value of [fqdn][crate::model::Vcenter::fqdn].
13751 ///
13752 /// # Example
13753 /// ```ignore,no_run
13754 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13755 /// let x = Vcenter::new().set_fqdn("example");
13756 /// ```
13757 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13758 self.fqdn = v.into();
13759 self
13760 }
13761}
13762
13763impl wkt::message::Message for Vcenter {
13764 fn typename() -> &'static str {
13765 "type.googleapis.com/google.cloud.vmwareengine.v1.Vcenter"
13766 }
13767}
13768
13769/// Defines additional types related to [Vcenter].
13770pub mod vcenter {
13771 #[allow(unused_imports)]
13772 use super::*;
13773
13774 /// State of the appliance
13775 ///
13776 /// # Working with unknown values
13777 ///
13778 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13779 /// additional enum variants at any time. Adding new variants is not considered
13780 /// a breaking change. Applications should write their code in anticipation of:
13781 ///
13782 /// - New values appearing in future releases of the client library, **and**
13783 /// - New values received dynamically, without application changes.
13784 ///
13785 /// Please consult the [Working with enums] section in the user guide for some
13786 /// guidelines.
13787 ///
13788 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13789 #[derive(Clone, Debug, PartialEq)]
13790 #[non_exhaustive]
13791 pub enum State {
13792 /// Unspecified appliance state. This is the default value.
13793 Unspecified,
13794 /// The appliance is operational and can be used.
13795 Active,
13796 /// The appliance is being deployed.
13797 Creating,
13798 /// If set, the enum was initialized with an unknown value.
13799 ///
13800 /// Applications can examine the value using [State::value] or
13801 /// [State::name].
13802 UnknownValue(state::UnknownValue),
13803 }
13804
13805 #[doc(hidden)]
13806 pub mod state {
13807 #[allow(unused_imports)]
13808 use super::*;
13809 #[derive(Clone, Debug, PartialEq)]
13810 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13811 }
13812
13813 impl State {
13814 /// Gets the enum value.
13815 ///
13816 /// Returns `None` if the enum contains an unknown value deserialized from
13817 /// the string representation of enums.
13818 pub fn value(&self) -> std::option::Option<i32> {
13819 match self {
13820 Self::Unspecified => std::option::Option::Some(0),
13821 Self::Active => std::option::Option::Some(1),
13822 Self::Creating => std::option::Option::Some(2),
13823 Self::UnknownValue(u) => u.0.value(),
13824 }
13825 }
13826
13827 /// Gets the enum value as a string.
13828 ///
13829 /// Returns `None` if the enum contains an unknown value deserialized from
13830 /// the integer representation of enums.
13831 pub fn name(&self) -> std::option::Option<&str> {
13832 match self {
13833 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13834 Self::Active => std::option::Option::Some("ACTIVE"),
13835 Self::Creating => std::option::Option::Some("CREATING"),
13836 Self::UnknownValue(u) => u.0.name(),
13837 }
13838 }
13839 }
13840
13841 impl std::default::Default for State {
13842 fn default() -> Self {
13843 use std::convert::From;
13844 Self::from(0)
13845 }
13846 }
13847
13848 impl std::fmt::Display for State {
13849 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13850 wkt::internal::display_enum(f, self.name(), self.value())
13851 }
13852 }
13853
13854 impl std::convert::From<i32> for State {
13855 fn from(value: i32) -> Self {
13856 match value {
13857 0 => Self::Unspecified,
13858 1 => Self::Active,
13859 2 => Self::Creating,
13860 _ => Self::UnknownValue(state::UnknownValue(
13861 wkt::internal::UnknownEnumValue::Integer(value),
13862 )),
13863 }
13864 }
13865 }
13866
13867 impl std::convert::From<&str> for State {
13868 fn from(value: &str) -> Self {
13869 use std::string::ToString;
13870 match value {
13871 "STATE_UNSPECIFIED" => Self::Unspecified,
13872 "ACTIVE" => Self::Active,
13873 "CREATING" => Self::Creating,
13874 _ => Self::UnknownValue(state::UnknownValue(
13875 wkt::internal::UnknownEnumValue::String(value.to_string()),
13876 )),
13877 }
13878 }
13879 }
13880
13881 impl serde::ser::Serialize for State {
13882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13883 where
13884 S: serde::Serializer,
13885 {
13886 match self {
13887 Self::Unspecified => serializer.serialize_i32(0),
13888 Self::Active => serializer.serialize_i32(1),
13889 Self::Creating => serializer.serialize_i32(2),
13890 Self::UnknownValue(u) => u.0.serialize(serializer),
13891 }
13892 }
13893 }
13894
13895 impl<'de> serde::de::Deserialize<'de> for State {
13896 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13897 where
13898 D: serde::Deserializer<'de>,
13899 {
13900 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13901 ".google.cloud.vmwareengine.v1.Vcenter.State",
13902 ))
13903 }
13904 }
13905}
13906
13907/// Autoscaling settings define the rules used by VMware Engine to
13908/// automatically scale-out and scale-in the clusters in a private cloud.
13909#[derive(Clone, Default, PartialEq)]
13910#[non_exhaustive]
13911pub struct AutoscalingSettings {
13912 /// Required. The map with autoscaling policies applied to the cluster.
13913 /// The key is the identifier of the policy.
13914 /// It must meet the following requirements:
13915 ///
13916 /// * Only contains 1-63 alphanumeric characters and hyphens
13917 /// * Begins with an alphabetical character
13918 /// * Ends with a non-hyphen character
13919 /// * Not formatted as a UUID
13920 /// * Complies with [RFC
13921 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
13922 ///
13923 /// Currently there map must contain only one element
13924 /// that describes the autoscaling policy for compute nodes.
13925 pub autoscaling_policies: std::collections::HashMap<
13926 std::string::String,
13927 crate::model::autoscaling_settings::AutoscalingPolicy,
13928 >,
13929
13930 /// Optional. Minimum number of nodes of any type in a cluster.
13931 /// If not specified the default limits apply.
13932 pub min_cluster_node_count: i32,
13933
13934 /// Optional. Maximum number of nodes of any type in a cluster.
13935 /// If not specified the default limits apply.
13936 pub max_cluster_node_count: i32,
13937
13938 /// Optional. The minimum duration between consecutive autoscale operations.
13939 /// It starts once addition or removal of nodes is fully completed.
13940 /// Defaults to 30 minutes if not specified. Cool down period must be in whole
13941 /// minutes (for example, 30, 31, 50, 180 minutes).
13942 pub cool_down_period: std::option::Option<wkt::Duration>,
13943
13944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13945}
13946
13947impl AutoscalingSettings {
13948 pub fn new() -> Self {
13949 std::default::Default::default()
13950 }
13951
13952 /// Sets the value of [autoscaling_policies][crate::model::AutoscalingSettings::autoscaling_policies].
13953 ///
13954 /// # Example
13955 /// ```ignore,no_run
13956 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13957 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
13958 /// let x = AutoscalingSettings::new().set_autoscaling_policies([
13959 /// ("key0", AutoscalingPolicy::default()/* use setters */),
13960 /// ("key1", AutoscalingPolicy::default()/* use (different) setters */),
13961 /// ]);
13962 /// ```
13963 pub fn set_autoscaling_policies<T, K, V>(mut self, v: T) -> Self
13964 where
13965 T: std::iter::IntoIterator<Item = (K, V)>,
13966 K: std::convert::Into<std::string::String>,
13967 V: std::convert::Into<crate::model::autoscaling_settings::AutoscalingPolicy>,
13968 {
13969 use std::iter::Iterator;
13970 self.autoscaling_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13971 self
13972 }
13973
13974 /// Sets the value of [min_cluster_node_count][crate::model::AutoscalingSettings::min_cluster_node_count].
13975 ///
13976 /// # Example
13977 /// ```ignore,no_run
13978 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13979 /// let x = AutoscalingSettings::new().set_min_cluster_node_count(42);
13980 /// ```
13981 pub fn set_min_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13982 self.min_cluster_node_count = v.into();
13983 self
13984 }
13985
13986 /// Sets the value of [max_cluster_node_count][crate::model::AutoscalingSettings::max_cluster_node_count].
13987 ///
13988 /// # Example
13989 /// ```ignore,no_run
13990 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13991 /// let x = AutoscalingSettings::new().set_max_cluster_node_count(42);
13992 /// ```
13993 pub fn set_max_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13994 self.max_cluster_node_count = v.into();
13995 self
13996 }
13997
13998 /// Sets the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
13999 ///
14000 /// # Example
14001 /// ```ignore,no_run
14002 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14003 /// use wkt::Duration;
14004 /// let x = AutoscalingSettings::new().set_cool_down_period(Duration::default()/* use setters */);
14005 /// ```
14006 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
14007 where
14008 T: std::convert::Into<wkt::Duration>,
14009 {
14010 self.cool_down_period = std::option::Option::Some(v.into());
14011 self
14012 }
14013
14014 /// Sets or clears the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14015 ///
14016 /// # Example
14017 /// ```ignore,no_run
14018 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14019 /// use wkt::Duration;
14020 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
14021 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(None::<Duration>);
14022 /// ```
14023 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
14024 where
14025 T: std::convert::Into<wkt::Duration>,
14026 {
14027 self.cool_down_period = v.map(|x| x.into());
14028 self
14029 }
14030}
14031
14032impl wkt::message::Message for AutoscalingSettings {
14033 fn typename() -> &'static str {
14034 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings"
14035 }
14036}
14037
14038/// Defines additional types related to [AutoscalingSettings].
14039pub mod autoscaling_settings {
14040 #[allow(unused_imports)]
14041 use super::*;
14042
14043 /// Thresholds define the utilization of resources triggering
14044 /// scale-out and scale-in operations.
14045 #[derive(Clone, Default, PartialEq)]
14046 #[non_exhaustive]
14047 pub struct Thresholds {
14048 /// Required. The utilization triggering the scale-out operation in percent.
14049 pub scale_out: i32,
14050
14051 /// Required. The utilization triggering the scale-in operation in percent.
14052 pub scale_in: i32,
14053
14054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14055 }
14056
14057 impl Thresholds {
14058 pub fn new() -> Self {
14059 std::default::Default::default()
14060 }
14061
14062 /// Sets the value of [scale_out][crate::model::autoscaling_settings::Thresholds::scale_out].
14063 ///
14064 /// # Example
14065 /// ```ignore,no_run
14066 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14067 /// let x = Thresholds::new().set_scale_out(42);
14068 /// ```
14069 pub fn set_scale_out<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14070 self.scale_out = v.into();
14071 self
14072 }
14073
14074 /// Sets the value of [scale_in][crate::model::autoscaling_settings::Thresholds::scale_in].
14075 ///
14076 /// # Example
14077 /// ```ignore,no_run
14078 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14079 /// let x = Thresholds::new().set_scale_in(42);
14080 /// ```
14081 pub fn set_scale_in<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14082 self.scale_in = v.into();
14083 self
14084 }
14085 }
14086
14087 impl wkt::message::Message for Thresholds {
14088 fn typename() -> &'static str {
14089 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds"
14090 }
14091 }
14092
14093 /// Autoscaling policy describes the behavior of the autoscaling
14094 /// with respect to the resource utilization.
14095 /// The scale-out operation is initiated if the utilization
14096 /// exceeds ANY of the respective thresholds.
14097 /// The scale-in operation is initiated if the utilization
14098 /// is below ALL of the respective thresholds.
14099 #[derive(Clone, Default, PartialEq)]
14100 #[non_exhaustive]
14101 pub struct AutoscalingPolicy {
14102 /// Required. The canonical identifier of the node type to add or remove.
14103 /// Corresponds to the `NodeType`.
14104 pub node_type_id: std::string::String,
14105
14106 /// Required. Number of nodes to add to a cluster during a scale-out
14107 /// operation. Must be divisible by 2 for stretched clusters. During a
14108 /// scale-in operation only one node (or 2 for stretched clusters) are
14109 /// removed in a single iteration.
14110 pub scale_out_size: i32,
14111
14112 /// Optional. Utilization thresholds pertaining to CPU utilization.
14113 pub cpu_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14114
14115 /// Optional. Utilization thresholds pertaining to amount of granted memory.
14116 pub granted_memory_thresholds:
14117 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14118
14119 /// Optional. Utilization thresholds pertaining to amount of consumed memory.
14120 pub consumed_memory_thresholds:
14121 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14122
14123 /// Optional. Utilization thresholds pertaining to amount of consumed
14124 /// storage.
14125 pub storage_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14126
14127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14128 }
14129
14130 impl AutoscalingPolicy {
14131 pub fn new() -> Self {
14132 std::default::Default::default()
14133 }
14134
14135 /// Sets the value of [node_type_id][crate::model::autoscaling_settings::AutoscalingPolicy::node_type_id].
14136 ///
14137 /// # Example
14138 /// ```ignore,no_run
14139 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14140 /// let x = AutoscalingPolicy::new().set_node_type_id("example");
14141 /// ```
14142 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(
14143 mut self,
14144 v: T,
14145 ) -> Self {
14146 self.node_type_id = v.into();
14147 self
14148 }
14149
14150 /// Sets the value of [scale_out_size][crate::model::autoscaling_settings::AutoscalingPolicy::scale_out_size].
14151 ///
14152 /// # Example
14153 /// ```ignore,no_run
14154 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14155 /// let x = AutoscalingPolicy::new().set_scale_out_size(42);
14156 /// ```
14157 pub fn set_scale_out_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14158 self.scale_out_size = v.into();
14159 self
14160 }
14161
14162 /// Sets the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14163 ///
14164 /// # Example
14165 /// ```ignore,no_run
14166 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14167 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14168 /// let x = AutoscalingPolicy::new().set_cpu_thresholds(Thresholds::default()/* use setters */);
14169 /// ```
14170 pub fn set_cpu_thresholds<T>(mut self, v: T) -> Self
14171 where
14172 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14173 {
14174 self.cpu_thresholds = std::option::Option::Some(v.into());
14175 self
14176 }
14177
14178 /// Sets or clears the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14179 ///
14180 /// # Example
14181 /// ```ignore,no_run
14182 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14183 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14184 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(Some(Thresholds::default()/* use setters */));
14185 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(None::<Thresholds>);
14186 /// ```
14187 pub fn set_or_clear_cpu_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14188 where
14189 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14190 {
14191 self.cpu_thresholds = v.map(|x| x.into());
14192 self
14193 }
14194
14195 /// Sets the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14196 ///
14197 /// # Example
14198 /// ```ignore,no_run
14199 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14200 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14201 /// let x = AutoscalingPolicy::new().set_granted_memory_thresholds(Thresholds::default()/* use setters */);
14202 /// ```
14203 pub fn set_granted_memory_thresholds<T>(mut self, v: T) -> Self
14204 where
14205 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14206 {
14207 self.granted_memory_thresholds = std::option::Option::Some(v.into());
14208 self
14209 }
14210
14211 /// Sets or clears the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14212 ///
14213 /// # Example
14214 /// ```ignore,no_run
14215 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14216 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14217 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(Some(Thresholds::default()/* use setters */));
14218 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(None::<Thresholds>);
14219 /// ```
14220 pub fn set_or_clear_granted_memory_thresholds<T>(
14221 mut self,
14222 v: std::option::Option<T>,
14223 ) -> Self
14224 where
14225 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14226 {
14227 self.granted_memory_thresholds = v.map(|x| x.into());
14228 self
14229 }
14230
14231 /// Sets the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14232 ///
14233 /// # Example
14234 /// ```ignore,no_run
14235 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14236 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14237 /// let x = AutoscalingPolicy::new().set_consumed_memory_thresholds(Thresholds::default()/* use setters */);
14238 /// ```
14239 pub fn set_consumed_memory_thresholds<T>(mut self, v: T) -> Self
14240 where
14241 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14242 {
14243 self.consumed_memory_thresholds = std::option::Option::Some(v.into());
14244 self
14245 }
14246
14247 /// Sets or clears the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14252 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14253 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(Some(Thresholds::default()/* use setters */));
14254 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(None::<Thresholds>);
14255 /// ```
14256 pub fn set_or_clear_consumed_memory_thresholds<T>(
14257 mut self,
14258 v: std::option::Option<T>,
14259 ) -> Self
14260 where
14261 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14262 {
14263 self.consumed_memory_thresholds = v.map(|x| x.into());
14264 self
14265 }
14266
14267 /// Sets the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14268 ///
14269 /// # Example
14270 /// ```ignore,no_run
14271 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14272 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14273 /// let x = AutoscalingPolicy::new().set_storage_thresholds(Thresholds::default()/* use setters */);
14274 /// ```
14275 pub fn set_storage_thresholds<T>(mut self, v: T) -> Self
14276 where
14277 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14278 {
14279 self.storage_thresholds = std::option::Option::Some(v.into());
14280 self
14281 }
14282
14283 /// Sets or clears the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14284 ///
14285 /// # Example
14286 /// ```ignore,no_run
14287 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14288 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14289 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(Some(Thresholds::default()/* use setters */));
14290 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(None::<Thresholds>);
14291 /// ```
14292 pub fn set_or_clear_storage_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14293 where
14294 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14295 {
14296 self.storage_thresholds = v.map(|x| x.into());
14297 self
14298 }
14299 }
14300
14301 impl wkt::message::Message for AutoscalingPolicy {
14302 fn typename() -> &'static str {
14303 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy"
14304 }
14305 }
14306}
14307
14308/// DNS forwarding config.
14309/// This config defines a list of domain to name server mappings,
14310/// and is attached to the private cloud for custom domain resolution.
14311#[derive(Clone, Default, PartialEq)]
14312#[non_exhaustive]
14313pub struct DnsForwarding {
14314 /// Output only. The resource name of this DNS profile.
14315 /// Resource names are schemeless URIs that follow the conventions in
14316 /// <https://cloud.google.com/apis/design/resource_names>.
14317 /// For example:
14318 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
14319 pub name: std::string::String,
14320
14321 /// Output only. Creation time of this resource.
14322 pub create_time: std::option::Option<wkt::Timestamp>,
14323
14324 /// Output only. Last update time of this resource.
14325 pub update_time: std::option::Option<wkt::Timestamp>,
14326
14327 /// Required. List of domain mappings to configure
14328 pub forwarding_rules: std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
14329
14330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14331}
14332
14333impl DnsForwarding {
14334 pub fn new() -> Self {
14335 std::default::Default::default()
14336 }
14337
14338 /// Sets the value of [name][crate::model::DnsForwarding::name].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14343 /// let x = DnsForwarding::new().set_name("example");
14344 /// ```
14345 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14346 self.name = v.into();
14347 self
14348 }
14349
14350 /// Sets the value of [create_time][crate::model::DnsForwarding::create_time].
14351 ///
14352 /// # Example
14353 /// ```ignore,no_run
14354 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14355 /// use wkt::Timestamp;
14356 /// let x = DnsForwarding::new().set_create_time(Timestamp::default()/* use setters */);
14357 /// ```
14358 pub fn set_create_time<T>(mut self, v: T) -> Self
14359 where
14360 T: std::convert::Into<wkt::Timestamp>,
14361 {
14362 self.create_time = std::option::Option::Some(v.into());
14363 self
14364 }
14365
14366 /// Sets or clears the value of [create_time][crate::model::DnsForwarding::create_time].
14367 ///
14368 /// # Example
14369 /// ```ignore,no_run
14370 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14371 /// use wkt::Timestamp;
14372 /// let x = DnsForwarding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14373 /// let x = DnsForwarding::new().set_or_clear_create_time(None::<Timestamp>);
14374 /// ```
14375 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14376 where
14377 T: std::convert::Into<wkt::Timestamp>,
14378 {
14379 self.create_time = v.map(|x| x.into());
14380 self
14381 }
14382
14383 /// Sets the value of [update_time][crate::model::DnsForwarding::update_time].
14384 ///
14385 /// # Example
14386 /// ```ignore,no_run
14387 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14388 /// use wkt::Timestamp;
14389 /// let x = DnsForwarding::new().set_update_time(Timestamp::default()/* use setters */);
14390 /// ```
14391 pub fn set_update_time<T>(mut self, v: T) -> Self
14392 where
14393 T: std::convert::Into<wkt::Timestamp>,
14394 {
14395 self.update_time = std::option::Option::Some(v.into());
14396 self
14397 }
14398
14399 /// Sets or clears the value of [update_time][crate::model::DnsForwarding::update_time].
14400 ///
14401 /// # Example
14402 /// ```ignore,no_run
14403 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14404 /// use wkt::Timestamp;
14405 /// let x = DnsForwarding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14406 /// let x = DnsForwarding::new().set_or_clear_update_time(None::<Timestamp>);
14407 /// ```
14408 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14409 where
14410 T: std::convert::Into<wkt::Timestamp>,
14411 {
14412 self.update_time = v.map(|x| x.into());
14413 self
14414 }
14415
14416 /// Sets the value of [forwarding_rules][crate::model::DnsForwarding::forwarding_rules].
14417 ///
14418 /// # Example
14419 /// ```ignore,no_run
14420 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14421 /// use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14422 /// let x = DnsForwarding::new()
14423 /// .set_forwarding_rules([
14424 /// ForwardingRule::default()/* use setters */,
14425 /// ForwardingRule::default()/* use (different) setters */,
14426 /// ]);
14427 /// ```
14428 pub fn set_forwarding_rules<T, V>(mut self, v: T) -> Self
14429 where
14430 T: std::iter::IntoIterator<Item = V>,
14431 V: std::convert::Into<crate::model::dns_forwarding::ForwardingRule>,
14432 {
14433 use std::iter::Iterator;
14434 self.forwarding_rules = v.into_iter().map(|i| i.into()).collect();
14435 self
14436 }
14437}
14438
14439impl wkt::message::Message for DnsForwarding {
14440 fn typename() -> &'static str {
14441 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding"
14442 }
14443}
14444
14445/// Defines additional types related to [DnsForwarding].
14446pub mod dns_forwarding {
14447 #[allow(unused_imports)]
14448 use super::*;
14449
14450 /// A forwarding rule is a mapping of a `domain` to `name_servers`.
14451 /// This mapping allows VMware Engine to resolve domains for attached private
14452 /// clouds by forwarding DNS requests for a given domain to the specified
14453 /// nameservers.
14454 #[derive(Clone, Default, PartialEq)]
14455 #[non_exhaustive]
14456 pub struct ForwardingRule {
14457 /// Required. Domain used to resolve a `name_servers` list.
14458 pub domain: std::string::String,
14459
14460 /// Required. List of DNS servers to use for domain resolution
14461 pub name_servers: std::vec::Vec<std::string::String>,
14462
14463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14464 }
14465
14466 impl ForwardingRule {
14467 pub fn new() -> Self {
14468 std::default::Default::default()
14469 }
14470
14471 /// Sets the value of [domain][crate::model::dns_forwarding::ForwardingRule::domain].
14472 ///
14473 /// # Example
14474 /// ```ignore,no_run
14475 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14476 /// let x = ForwardingRule::new().set_domain("example");
14477 /// ```
14478 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14479 self.domain = v.into();
14480 self
14481 }
14482
14483 /// Sets the value of [name_servers][crate::model::dns_forwarding::ForwardingRule::name_servers].
14484 ///
14485 /// # Example
14486 /// ```ignore,no_run
14487 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14488 /// let x = ForwardingRule::new().set_name_servers(["a", "b", "c"]);
14489 /// ```
14490 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
14491 where
14492 T: std::iter::IntoIterator<Item = V>,
14493 V: std::convert::Into<std::string::String>,
14494 {
14495 use std::iter::Iterator;
14496 self.name_servers = v.into_iter().map(|i| i.into()).collect();
14497 self
14498 }
14499 }
14500
14501 impl wkt::message::Message for ForwardingRule {
14502 fn typename() -> &'static str {
14503 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule"
14504 }
14505 }
14506}
14507
14508/// Details of a network peering.
14509#[derive(Clone, Default, PartialEq)]
14510#[non_exhaustive]
14511pub struct NetworkPeering {
14512 /// Output only. The resource name of the network peering. NetworkPeering is a
14513 /// global resource and location can only be global. Resource names are
14514 /// scheme-less URIs that follow the conventions in
14515 /// <https://cloud.google.com/apis/design/resource_names>.
14516 /// For example:
14517 /// `projects/my-project/locations/global/networkPeerings/my-peering`
14518 pub name: std::string::String,
14519
14520 /// Output only. Creation time of this resource.
14521 pub create_time: std::option::Option<wkt::Timestamp>,
14522
14523 /// Output only. Last update time of this resource.
14524 pub update_time: std::option::Option<wkt::Timestamp>,
14525
14526 /// Required. The relative resource name of the network to peer with
14527 /// a standard VMware Engine network. The provided network can be a
14528 /// consumer VPC network or another standard VMware Engine network. If the
14529 /// `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form:
14530 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
14531 /// Otherwise specify the name in the form:
14532 /// `projects/{project}/global/networks/{network_id}`, where
14533 /// `{project}` can either be a project number or a project ID.
14534 pub peer_network: std::string::String,
14535
14536 /// Optional. True if custom routes are exported to the peered network;
14537 /// false otherwise. The default value is true.
14538 pub export_custom_routes: std::option::Option<bool>,
14539
14540 /// Optional. True if custom routes are imported from the peered network;
14541 /// false otherwise. The default value is true.
14542 pub import_custom_routes: std::option::Option<bool>,
14543
14544 /// Optional. True if full mesh connectivity is created and managed
14545 /// automatically between peered networks; false otherwise. Currently this
14546 /// field is always true because Google Compute Engine automatically creates
14547 /// and manages subnetwork routes between two VPC networks when peering state
14548 /// is 'ACTIVE'.
14549 pub exchange_subnet_routes: std::option::Option<bool>,
14550
14551 /// Optional. True if all subnet routes with a public IP address range are
14552 /// exported; false otherwise. The default value is true. IPv4 special-use
14553 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14554 /// exported to peers and are not controlled by this field.
14555 pub export_custom_routes_with_public_ip: std::option::Option<bool>,
14556
14557 /// Optional. True if all subnet routes with public IP address range are
14558 /// imported; false otherwise. The default value is true. IPv4 special-use
14559 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14560 /// imported to peers and are not controlled by this field.
14561 pub import_custom_routes_with_public_ip: std::option::Option<bool>,
14562
14563 /// Output only. State of the network peering. This field
14564 /// has a value of 'ACTIVE' when there's a matching configuration in the peer
14565 /// network. New values may be added to this enum when appropriate.
14566 pub state: crate::model::network_peering::State,
14567
14568 /// Output only. Output Only. Details about the current state of the network
14569 /// peering.
14570 pub state_details: std::string::String,
14571
14572 /// Optional. Maximum transmission unit (MTU) in bytes.
14573 /// The default value is `1500`. If a value of `0` is provided for this field,
14574 /// VMware Engine uses the default value instead.
14575 pub peer_mtu: i32,
14576
14577 /// Required. The type of the network to peer with the VMware Engine network.
14578 pub peer_network_type: crate::model::network_peering::PeerNetworkType,
14579
14580 /// Output only. System-generated unique identifier for the resource.
14581 pub uid: std::string::String,
14582
14583 /// Required. The relative resource name of the VMware Engine network.
14584 /// Specify the name in the following form:
14585 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
14586 /// where `{project}` can either be a project number or a project ID.
14587 pub vmware_engine_network: std::string::String,
14588
14589 /// Optional. User-provided description for this network peering.
14590 pub description: std::string::String,
14591
14592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14593}
14594
14595impl NetworkPeering {
14596 pub fn new() -> Self {
14597 std::default::Default::default()
14598 }
14599
14600 /// Sets the value of [name][crate::model::NetworkPeering::name].
14601 ///
14602 /// # Example
14603 /// ```ignore,no_run
14604 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14605 /// let x = NetworkPeering::new().set_name("example");
14606 /// ```
14607 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14608 self.name = v.into();
14609 self
14610 }
14611
14612 /// Sets the value of [create_time][crate::model::NetworkPeering::create_time].
14613 ///
14614 /// # Example
14615 /// ```ignore,no_run
14616 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14617 /// use wkt::Timestamp;
14618 /// let x = NetworkPeering::new().set_create_time(Timestamp::default()/* use setters */);
14619 /// ```
14620 pub fn set_create_time<T>(mut self, v: T) -> Self
14621 where
14622 T: std::convert::Into<wkt::Timestamp>,
14623 {
14624 self.create_time = std::option::Option::Some(v.into());
14625 self
14626 }
14627
14628 /// Sets or clears the value of [create_time][crate::model::NetworkPeering::create_time].
14629 ///
14630 /// # Example
14631 /// ```ignore,no_run
14632 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14633 /// use wkt::Timestamp;
14634 /// let x = NetworkPeering::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14635 /// let x = NetworkPeering::new().set_or_clear_create_time(None::<Timestamp>);
14636 /// ```
14637 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14638 where
14639 T: std::convert::Into<wkt::Timestamp>,
14640 {
14641 self.create_time = v.map(|x| x.into());
14642 self
14643 }
14644
14645 /// Sets the value of [update_time][crate::model::NetworkPeering::update_time].
14646 ///
14647 /// # Example
14648 /// ```ignore,no_run
14649 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14650 /// use wkt::Timestamp;
14651 /// let x = NetworkPeering::new().set_update_time(Timestamp::default()/* use setters */);
14652 /// ```
14653 pub fn set_update_time<T>(mut self, v: T) -> Self
14654 where
14655 T: std::convert::Into<wkt::Timestamp>,
14656 {
14657 self.update_time = std::option::Option::Some(v.into());
14658 self
14659 }
14660
14661 /// Sets or clears the value of [update_time][crate::model::NetworkPeering::update_time].
14662 ///
14663 /// # Example
14664 /// ```ignore,no_run
14665 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14666 /// use wkt::Timestamp;
14667 /// let x = NetworkPeering::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14668 /// let x = NetworkPeering::new().set_or_clear_update_time(None::<Timestamp>);
14669 /// ```
14670 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14671 where
14672 T: std::convert::Into<wkt::Timestamp>,
14673 {
14674 self.update_time = v.map(|x| x.into());
14675 self
14676 }
14677
14678 /// Sets the value of [peer_network][crate::model::NetworkPeering::peer_network].
14679 ///
14680 /// # Example
14681 /// ```ignore,no_run
14682 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14683 /// let x = NetworkPeering::new().set_peer_network("example");
14684 /// ```
14685 pub fn set_peer_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14686 self.peer_network = v.into();
14687 self
14688 }
14689
14690 /// Sets the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14691 ///
14692 /// # Example
14693 /// ```ignore,no_run
14694 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14695 /// let x = NetworkPeering::new().set_export_custom_routes(true);
14696 /// ```
14697 pub fn set_export_custom_routes<T>(mut self, v: T) -> Self
14698 where
14699 T: std::convert::Into<bool>,
14700 {
14701 self.export_custom_routes = std::option::Option::Some(v.into());
14702 self
14703 }
14704
14705 /// Sets or clears the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14706 ///
14707 /// # Example
14708 /// ```ignore,no_run
14709 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14710 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(Some(false));
14711 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(None::<bool>);
14712 /// ```
14713 pub fn set_or_clear_export_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14714 where
14715 T: std::convert::Into<bool>,
14716 {
14717 self.export_custom_routes = v.map(|x| x.into());
14718 self
14719 }
14720
14721 /// Sets the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14722 ///
14723 /// # Example
14724 /// ```ignore,no_run
14725 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14726 /// let x = NetworkPeering::new().set_import_custom_routes(true);
14727 /// ```
14728 pub fn set_import_custom_routes<T>(mut self, v: T) -> Self
14729 where
14730 T: std::convert::Into<bool>,
14731 {
14732 self.import_custom_routes = std::option::Option::Some(v.into());
14733 self
14734 }
14735
14736 /// Sets or clears the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14737 ///
14738 /// # Example
14739 /// ```ignore,no_run
14740 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14741 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(Some(false));
14742 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(None::<bool>);
14743 /// ```
14744 pub fn set_or_clear_import_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14745 where
14746 T: std::convert::Into<bool>,
14747 {
14748 self.import_custom_routes = v.map(|x| x.into());
14749 self
14750 }
14751
14752 /// Sets the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14753 ///
14754 /// # Example
14755 /// ```ignore,no_run
14756 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14757 /// let x = NetworkPeering::new().set_exchange_subnet_routes(true);
14758 /// ```
14759 pub fn set_exchange_subnet_routes<T>(mut self, v: T) -> Self
14760 where
14761 T: std::convert::Into<bool>,
14762 {
14763 self.exchange_subnet_routes = std::option::Option::Some(v.into());
14764 self
14765 }
14766
14767 /// Sets or clears the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14768 ///
14769 /// # Example
14770 /// ```ignore,no_run
14771 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14772 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(Some(false));
14773 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(None::<bool>);
14774 /// ```
14775 pub fn set_or_clear_exchange_subnet_routes<T>(mut self, v: std::option::Option<T>) -> Self
14776 where
14777 T: std::convert::Into<bool>,
14778 {
14779 self.exchange_subnet_routes = v.map(|x| x.into());
14780 self
14781 }
14782
14783 /// Sets the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14784 ///
14785 /// # Example
14786 /// ```ignore,no_run
14787 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14788 /// let x = NetworkPeering::new().set_export_custom_routes_with_public_ip(true);
14789 /// ```
14790 pub fn set_export_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14791 where
14792 T: std::convert::Into<bool>,
14793 {
14794 self.export_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14795 self
14796 }
14797
14798 /// Sets or clears the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14799 ///
14800 /// # Example
14801 /// ```ignore,no_run
14802 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14803 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(Some(false));
14804 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(None::<bool>);
14805 /// ```
14806 pub fn set_or_clear_export_custom_routes_with_public_ip<T>(
14807 mut self,
14808 v: std::option::Option<T>,
14809 ) -> Self
14810 where
14811 T: std::convert::Into<bool>,
14812 {
14813 self.export_custom_routes_with_public_ip = v.map(|x| x.into());
14814 self
14815 }
14816
14817 /// Sets the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14818 ///
14819 /// # Example
14820 /// ```ignore,no_run
14821 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14822 /// let x = NetworkPeering::new().set_import_custom_routes_with_public_ip(true);
14823 /// ```
14824 pub fn set_import_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14825 where
14826 T: std::convert::Into<bool>,
14827 {
14828 self.import_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14829 self
14830 }
14831
14832 /// Sets or clears the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14833 ///
14834 /// # Example
14835 /// ```ignore,no_run
14836 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14837 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(Some(false));
14838 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(None::<bool>);
14839 /// ```
14840 pub fn set_or_clear_import_custom_routes_with_public_ip<T>(
14841 mut self,
14842 v: std::option::Option<T>,
14843 ) -> Self
14844 where
14845 T: std::convert::Into<bool>,
14846 {
14847 self.import_custom_routes_with_public_ip = v.map(|x| x.into());
14848 self
14849 }
14850
14851 /// Sets the value of [state][crate::model::NetworkPeering::state].
14852 ///
14853 /// # Example
14854 /// ```ignore,no_run
14855 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14856 /// use google_cloud_vmwareengine_v1::model::network_peering::State;
14857 /// let x0 = NetworkPeering::new().set_state(State::Inactive);
14858 /// let x1 = NetworkPeering::new().set_state(State::Active);
14859 /// let x2 = NetworkPeering::new().set_state(State::Creating);
14860 /// ```
14861 pub fn set_state<T: std::convert::Into<crate::model::network_peering::State>>(
14862 mut self,
14863 v: T,
14864 ) -> Self {
14865 self.state = v.into();
14866 self
14867 }
14868
14869 /// Sets the value of [state_details][crate::model::NetworkPeering::state_details].
14870 ///
14871 /// # Example
14872 /// ```ignore,no_run
14873 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14874 /// let x = NetworkPeering::new().set_state_details("example");
14875 /// ```
14876 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14877 self.state_details = v.into();
14878 self
14879 }
14880
14881 /// Sets the value of [peer_mtu][crate::model::NetworkPeering::peer_mtu].
14882 ///
14883 /// # Example
14884 /// ```ignore,no_run
14885 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14886 /// let x = NetworkPeering::new().set_peer_mtu(42);
14887 /// ```
14888 pub fn set_peer_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14889 self.peer_mtu = v.into();
14890 self
14891 }
14892
14893 /// Sets the value of [peer_network_type][crate::model::NetworkPeering::peer_network_type].
14894 ///
14895 /// # Example
14896 /// ```ignore,no_run
14897 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14898 /// use google_cloud_vmwareengine_v1::model::network_peering::PeerNetworkType;
14899 /// let x0 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::Standard);
14900 /// let x1 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::VmwareEngineNetwork);
14901 /// let x2 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::PrivateServicesAccess);
14902 /// ```
14903 pub fn set_peer_network_type<
14904 T: std::convert::Into<crate::model::network_peering::PeerNetworkType>,
14905 >(
14906 mut self,
14907 v: T,
14908 ) -> Self {
14909 self.peer_network_type = v.into();
14910 self
14911 }
14912
14913 /// Sets the value of [uid][crate::model::NetworkPeering::uid].
14914 ///
14915 /// # Example
14916 /// ```ignore,no_run
14917 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14918 /// let x = NetworkPeering::new().set_uid("example");
14919 /// ```
14920 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14921 self.uid = v.into();
14922 self
14923 }
14924
14925 /// Sets the value of [vmware_engine_network][crate::model::NetworkPeering::vmware_engine_network].
14926 ///
14927 /// # Example
14928 /// ```ignore,no_run
14929 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14930 /// let x = NetworkPeering::new().set_vmware_engine_network("example");
14931 /// ```
14932 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
14933 mut self,
14934 v: T,
14935 ) -> Self {
14936 self.vmware_engine_network = v.into();
14937 self
14938 }
14939
14940 /// Sets the value of [description][crate::model::NetworkPeering::description].
14941 ///
14942 /// # Example
14943 /// ```ignore,no_run
14944 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14945 /// let x = NetworkPeering::new().set_description("example");
14946 /// ```
14947 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14948 self.description = v.into();
14949 self
14950 }
14951}
14952
14953impl wkt::message::Message for NetworkPeering {
14954 fn typename() -> &'static str {
14955 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPeering"
14956 }
14957}
14958
14959/// Defines additional types related to [NetworkPeering].
14960pub mod network_peering {
14961 #[allow(unused_imports)]
14962 use super::*;
14963
14964 /// Possible states of a network peering.
14965 ///
14966 /// # Working with unknown values
14967 ///
14968 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14969 /// additional enum variants at any time. Adding new variants is not considered
14970 /// a breaking change. Applications should write their code in anticipation of:
14971 ///
14972 /// - New values appearing in future releases of the client library, **and**
14973 /// - New values received dynamically, without application changes.
14974 ///
14975 /// Please consult the [Working with enums] section in the user guide for some
14976 /// guidelines.
14977 ///
14978 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14979 #[derive(Clone, Debug, PartialEq)]
14980 #[non_exhaustive]
14981 pub enum State {
14982 /// Unspecified network peering state. This is the default value.
14983 Unspecified,
14984 /// The peering is not active.
14985 Inactive,
14986 /// The peering is active.
14987 Active,
14988 /// The peering is being created.
14989 Creating,
14990 /// The peering is being deleted.
14991 Deleting,
14992 /// If set, the enum was initialized with an unknown value.
14993 ///
14994 /// Applications can examine the value using [State::value] or
14995 /// [State::name].
14996 UnknownValue(state::UnknownValue),
14997 }
14998
14999 #[doc(hidden)]
15000 pub mod state {
15001 #[allow(unused_imports)]
15002 use super::*;
15003 #[derive(Clone, Debug, PartialEq)]
15004 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15005 }
15006
15007 impl State {
15008 /// Gets the enum value.
15009 ///
15010 /// Returns `None` if the enum contains an unknown value deserialized from
15011 /// the string representation of enums.
15012 pub fn value(&self) -> std::option::Option<i32> {
15013 match self {
15014 Self::Unspecified => std::option::Option::Some(0),
15015 Self::Inactive => std::option::Option::Some(1),
15016 Self::Active => std::option::Option::Some(2),
15017 Self::Creating => std::option::Option::Some(3),
15018 Self::Deleting => std::option::Option::Some(4),
15019 Self::UnknownValue(u) => u.0.value(),
15020 }
15021 }
15022
15023 /// Gets the enum value as a string.
15024 ///
15025 /// Returns `None` if the enum contains an unknown value deserialized from
15026 /// the integer representation of enums.
15027 pub fn name(&self) -> std::option::Option<&str> {
15028 match self {
15029 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15030 Self::Inactive => std::option::Option::Some("INACTIVE"),
15031 Self::Active => std::option::Option::Some("ACTIVE"),
15032 Self::Creating => std::option::Option::Some("CREATING"),
15033 Self::Deleting => std::option::Option::Some("DELETING"),
15034 Self::UnknownValue(u) => u.0.name(),
15035 }
15036 }
15037 }
15038
15039 impl std::default::Default for State {
15040 fn default() -> Self {
15041 use std::convert::From;
15042 Self::from(0)
15043 }
15044 }
15045
15046 impl std::fmt::Display for State {
15047 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15048 wkt::internal::display_enum(f, self.name(), self.value())
15049 }
15050 }
15051
15052 impl std::convert::From<i32> for State {
15053 fn from(value: i32) -> Self {
15054 match value {
15055 0 => Self::Unspecified,
15056 1 => Self::Inactive,
15057 2 => Self::Active,
15058 3 => Self::Creating,
15059 4 => Self::Deleting,
15060 _ => Self::UnknownValue(state::UnknownValue(
15061 wkt::internal::UnknownEnumValue::Integer(value),
15062 )),
15063 }
15064 }
15065 }
15066
15067 impl std::convert::From<&str> for State {
15068 fn from(value: &str) -> Self {
15069 use std::string::ToString;
15070 match value {
15071 "STATE_UNSPECIFIED" => Self::Unspecified,
15072 "INACTIVE" => Self::Inactive,
15073 "ACTIVE" => Self::Active,
15074 "CREATING" => Self::Creating,
15075 "DELETING" => Self::Deleting,
15076 _ => Self::UnknownValue(state::UnknownValue(
15077 wkt::internal::UnknownEnumValue::String(value.to_string()),
15078 )),
15079 }
15080 }
15081 }
15082
15083 impl serde::ser::Serialize for State {
15084 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15085 where
15086 S: serde::Serializer,
15087 {
15088 match self {
15089 Self::Unspecified => serializer.serialize_i32(0),
15090 Self::Inactive => serializer.serialize_i32(1),
15091 Self::Active => serializer.serialize_i32(2),
15092 Self::Creating => serializer.serialize_i32(3),
15093 Self::Deleting => serializer.serialize_i32(4),
15094 Self::UnknownValue(u) => u.0.serialize(serializer),
15095 }
15096 }
15097 }
15098
15099 impl<'de> serde::de::Deserialize<'de> for State {
15100 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15101 where
15102 D: serde::Deserializer<'de>,
15103 {
15104 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15105 ".google.cloud.vmwareengine.v1.NetworkPeering.State",
15106 ))
15107 }
15108 }
15109
15110 /// Type or purpose of the network peering connection.
15111 ///
15112 /// # Working with unknown values
15113 ///
15114 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15115 /// additional enum variants at any time. Adding new variants is not considered
15116 /// a breaking change. Applications should write their code in anticipation of:
15117 ///
15118 /// - New values appearing in future releases of the client library, **and**
15119 /// - New values received dynamically, without application changes.
15120 ///
15121 /// Please consult the [Working with enums] section in the user guide for some
15122 /// guidelines.
15123 ///
15124 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15125 #[derive(Clone, Debug, PartialEq)]
15126 #[non_exhaustive]
15127 pub enum PeerNetworkType {
15128 /// Unspecified
15129 Unspecified,
15130 /// Peering connection used for connecting to another VPC network established
15131 /// by the same user. For example, a peering connection to another VPC
15132 /// network in the same project or to an on-premises network.
15133 Standard,
15134 /// Peering connection used for connecting to another VMware Engine network.
15135 VmwareEngineNetwork,
15136 /// Peering connection used for establishing [private services
15137 /// access](https://cloud.google.com/vpc/docs/private-services-access).
15138 PrivateServicesAccess,
15139 /// Peering connection used for connecting to NetApp Cloud Volumes.
15140 NetappCloudVolumes,
15141 /// Peering connection used for connecting to third-party services. Most
15142 /// third-party services require manual setup of reverse peering on the VPC
15143 /// network associated with the third-party service.
15144 ThirdPartyService,
15145 /// Peering connection used for connecting to Dell PowerScale Filers
15146 DellPowerscale,
15147 /// Peering connection used for connecting to Google Cloud NetApp Volumes.
15148 GoogleCloudNetappVolumes,
15149 /// If set, the enum was initialized with an unknown value.
15150 ///
15151 /// Applications can examine the value using [PeerNetworkType::value] or
15152 /// [PeerNetworkType::name].
15153 UnknownValue(peer_network_type::UnknownValue),
15154 }
15155
15156 #[doc(hidden)]
15157 pub mod peer_network_type {
15158 #[allow(unused_imports)]
15159 use super::*;
15160 #[derive(Clone, Debug, PartialEq)]
15161 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15162 }
15163
15164 impl PeerNetworkType {
15165 /// Gets the enum value.
15166 ///
15167 /// Returns `None` if the enum contains an unknown value deserialized from
15168 /// the string representation of enums.
15169 pub fn value(&self) -> std::option::Option<i32> {
15170 match self {
15171 Self::Unspecified => std::option::Option::Some(0),
15172 Self::Standard => std::option::Option::Some(1),
15173 Self::VmwareEngineNetwork => std::option::Option::Some(2),
15174 Self::PrivateServicesAccess => std::option::Option::Some(3),
15175 Self::NetappCloudVolumes => std::option::Option::Some(4),
15176 Self::ThirdPartyService => std::option::Option::Some(5),
15177 Self::DellPowerscale => std::option::Option::Some(6),
15178 Self::GoogleCloudNetappVolumes => std::option::Option::Some(7),
15179 Self::UnknownValue(u) => u.0.value(),
15180 }
15181 }
15182
15183 /// Gets the enum value as a string.
15184 ///
15185 /// Returns `None` if the enum contains an unknown value deserialized from
15186 /// the integer representation of enums.
15187 pub fn name(&self) -> std::option::Option<&str> {
15188 match self {
15189 Self::Unspecified => std::option::Option::Some("PEER_NETWORK_TYPE_UNSPECIFIED"),
15190 Self::Standard => std::option::Option::Some("STANDARD"),
15191 Self::VmwareEngineNetwork => std::option::Option::Some("VMWARE_ENGINE_NETWORK"),
15192 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
15193 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
15194 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
15195 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
15196 Self::GoogleCloudNetappVolumes => {
15197 std::option::Option::Some("GOOGLE_CLOUD_NETAPP_VOLUMES")
15198 }
15199 Self::UnknownValue(u) => u.0.name(),
15200 }
15201 }
15202 }
15203
15204 impl std::default::Default for PeerNetworkType {
15205 fn default() -> Self {
15206 use std::convert::From;
15207 Self::from(0)
15208 }
15209 }
15210
15211 impl std::fmt::Display for PeerNetworkType {
15212 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15213 wkt::internal::display_enum(f, self.name(), self.value())
15214 }
15215 }
15216
15217 impl std::convert::From<i32> for PeerNetworkType {
15218 fn from(value: i32) -> Self {
15219 match value {
15220 0 => Self::Unspecified,
15221 1 => Self::Standard,
15222 2 => Self::VmwareEngineNetwork,
15223 3 => Self::PrivateServicesAccess,
15224 4 => Self::NetappCloudVolumes,
15225 5 => Self::ThirdPartyService,
15226 6 => Self::DellPowerscale,
15227 7 => Self::GoogleCloudNetappVolumes,
15228 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15229 wkt::internal::UnknownEnumValue::Integer(value),
15230 )),
15231 }
15232 }
15233 }
15234
15235 impl std::convert::From<&str> for PeerNetworkType {
15236 fn from(value: &str) -> Self {
15237 use std::string::ToString;
15238 match value {
15239 "PEER_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
15240 "STANDARD" => Self::Standard,
15241 "VMWARE_ENGINE_NETWORK" => Self::VmwareEngineNetwork,
15242 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
15243 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
15244 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
15245 "DELL_POWERSCALE" => Self::DellPowerscale,
15246 "GOOGLE_CLOUD_NETAPP_VOLUMES" => Self::GoogleCloudNetappVolumes,
15247 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15248 wkt::internal::UnknownEnumValue::String(value.to_string()),
15249 )),
15250 }
15251 }
15252 }
15253
15254 impl serde::ser::Serialize for PeerNetworkType {
15255 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15256 where
15257 S: serde::Serializer,
15258 {
15259 match self {
15260 Self::Unspecified => serializer.serialize_i32(0),
15261 Self::Standard => serializer.serialize_i32(1),
15262 Self::VmwareEngineNetwork => serializer.serialize_i32(2),
15263 Self::PrivateServicesAccess => serializer.serialize_i32(3),
15264 Self::NetappCloudVolumes => serializer.serialize_i32(4),
15265 Self::ThirdPartyService => serializer.serialize_i32(5),
15266 Self::DellPowerscale => serializer.serialize_i32(6),
15267 Self::GoogleCloudNetappVolumes => serializer.serialize_i32(7),
15268 Self::UnknownValue(u) => u.0.serialize(serializer),
15269 }
15270 }
15271 }
15272
15273 impl<'de> serde::de::Deserialize<'de> for PeerNetworkType {
15274 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15275 where
15276 D: serde::Deserializer<'de>,
15277 {
15278 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeerNetworkType>::new(
15279 ".google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType",
15280 ))
15281 }
15282 }
15283}
15284
15285/// Exchanged network peering route.
15286#[derive(Clone, Default, PartialEq)]
15287#[non_exhaustive]
15288pub struct PeeringRoute {
15289 /// Output only. Destination range of the peering route in CIDR notation.
15290 pub dest_range: std::string::String,
15291
15292 /// Output only. Type of the route in the peer VPC network.
15293 pub r#type: crate::model::peering_route::Type,
15294
15295 /// Output only. Region containing the next hop of the peering route. This
15296 /// field only applies to dynamic routes in the peer VPC network.
15297 pub next_hop_region: std::string::String,
15298
15299 /// Output only. The priority of the peering route.
15300 pub priority: i64,
15301
15302 /// Output only. True if the peering route has been imported from a peered
15303 /// VPC network; false otherwise. The import happens if the field
15304 /// `NetworkPeering.importCustomRoutes` is true for this network,
15305 /// `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
15306 /// the import does not result in a route conflict.
15307 pub imported: bool,
15308
15309 /// Output only. Direction of the routes exchanged with the peer network, from
15310 /// the VMware Engine network perspective:
15311 ///
15312 /// * Routes of direction `INCOMING` are imported from the peer network.
15313 /// * Routes of direction `OUTGOING` are exported from the intranet VPC network
15314 /// of the VMware Engine network.
15315 pub direction: crate::model::peering_route::Direction,
15316
15317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15318}
15319
15320impl PeeringRoute {
15321 pub fn new() -> Self {
15322 std::default::Default::default()
15323 }
15324
15325 /// Sets the value of [dest_range][crate::model::PeeringRoute::dest_range].
15326 ///
15327 /// # Example
15328 /// ```ignore,no_run
15329 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15330 /// let x = PeeringRoute::new().set_dest_range("example");
15331 /// ```
15332 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15333 self.dest_range = v.into();
15334 self
15335 }
15336
15337 /// Sets the value of [r#type][crate::model::PeeringRoute::type].
15338 ///
15339 /// # Example
15340 /// ```ignore,no_run
15341 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15342 /// use google_cloud_vmwareengine_v1::model::peering_route::Type;
15343 /// let x0 = PeeringRoute::new().set_type(Type::DynamicPeeringRoute);
15344 /// let x1 = PeeringRoute::new().set_type(Type::StaticPeeringRoute);
15345 /// let x2 = PeeringRoute::new().set_type(Type::SubnetPeeringRoute);
15346 /// ```
15347 pub fn set_type<T: std::convert::Into<crate::model::peering_route::Type>>(
15348 mut self,
15349 v: T,
15350 ) -> Self {
15351 self.r#type = v.into();
15352 self
15353 }
15354
15355 /// Sets the value of [next_hop_region][crate::model::PeeringRoute::next_hop_region].
15356 ///
15357 /// # Example
15358 /// ```ignore,no_run
15359 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15360 /// let x = PeeringRoute::new().set_next_hop_region("example");
15361 /// ```
15362 pub fn set_next_hop_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15363 self.next_hop_region = v.into();
15364 self
15365 }
15366
15367 /// Sets the value of [priority][crate::model::PeeringRoute::priority].
15368 ///
15369 /// # Example
15370 /// ```ignore,no_run
15371 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15372 /// let x = PeeringRoute::new().set_priority(42);
15373 /// ```
15374 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15375 self.priority = v.into();
15376 self
15377 }
15378
15379 /// Sets the value of [imported][crate::model::PeeringRoute::imported].
15380 ///
15381 /// # Example
15382 /// ```ignore,no_run
15383 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15384 /// let x = PeeringRoute::new().set_imported(true);
15385 /// ```
15386 pub fn set_imported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15387 self.imported = v.into();
15388 self
15389 }
15390
15391 /// Sets the value of [direction][crate::model::PeeringRoute::direction].
15392 ///
15393 /// # Example
15394 /// ```ignore,no_run
15395 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15396 /// use google_cloud_vmwareengine_v1::model::peering_route::Direction;
15397 /// let x0 = PeeringRoute::new().set_direction(Direction::Incoming);
15398 /// let x1 = PeeringRoute::new().set_direction(Direction::Outgoing);
15399 /// ```
15400 pub fn set_direction<T: std::convert::Into<crate::model::peering_route::Direction>>(
15401 mut self,
15402 v: T,
15403 ) -> Self {
15404 self.direction = v.into();
15405 self
15406 }
15407}
15408
15409impl wkt::message::Message for PeeringRoute {
15410 fn typename() -> &'static str {
15411 "type.googleapis.com/google.cloud.vmwareengine.v1.PeeringRoute"
15412 }
15413}
15414
15415/// Defines additional types related to [PeeringRoute].
15416pub mod peering_route {
15417 #[allow(unused_imports)]
15418 use super::*;
15419
15420 /// The type of the peering route.
15421 ///
15422 /// # Working with unknown values
15423 ///
15424 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15425 /// additional enum variants at any time. Adding new variants is not considered
15426 /// a breaking change. Applications should write their code in anticipation of:
15427 ///
15428 /// - New values appearing in future releases of the client library, **and**
15429 /// - New values received dynamically, without application changes.
15430 ///
15431 /// Please consult the [Working with enums] section in the user guide for some
15432 /// guidelines.
15433 ///
15434 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15435 #[derive(Clone, Debug, PartialEq)]
15436 #[non_exhaustive]
15437 pub enum Type {
15438 /// Unspecified peering route type. This is the default value.
15439 Unspecified,
15440 /// Dynamic routes in the peer network.
15441 DynamicPeeringRoute,
15442 /// Static routes in the peer network.
15443 StaticPeeringRoute,
15444 /// Created, updated, and removed automatically by Google Cloud when subnets
15445 /// are created, modified, or deleted in the peer network.
15446 SubnetPeeringRoute,
15447 /// If set, the enum was initialized with an unknown value.
15448 ///
15449 /// Applications can examine the value using [Type::value] or
15450 /// [Type::name].
15451 UnknownValue(r#type::UnknownValue),
15452 }
15453
15454 #[doc(hidden)]
15455 pub mod r#type {
15456 #[allow(unused_imports)]
15457 use super::*;
15458 #[derive(Clone, Debug, PartialEq)]
15459 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15460 }
15461
15462 impl Type {
15463 /// Gets the enum value.
15464 ///
15465 /// Returns `None` if the enum contains an unknown value deserialized from
15466 /// the string representation of enums.
15467 pub fn value(&self) -> std::option::Option<i32> {
15468 match self {
15469 Self::Unspecified => std::option::Option::Some(0),
15470 Self::DynamicPeeringRoute => std::option::Option::Some(1),
15471 Self::StaticPeeringRoute => std::option::Option::Some(2),
15472 Self::SubnetPeeringRoute => std::option::Option::Some(3),
15473 Self::UnknownValue(u) => u.0.value(),
15474 }
15475 }
15476
15477 /// Gets the enum value as a string.
15478 ///
15479 /// Returns `None` if the enum contains an unknown value deserialized from
15480 /// the integer representation of enums.
15481 pub fn name(&self) -> std::option::Option<&str> {
15482 match self {
15483 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15484 Self::DynamicPeeringRoute => std::option::Option::Some("DYNAMIC_PEERING_ROUTE"),
15485 Self::StaticPeeringRoute => std::option::Option::Some("STATIC_PEERING_ROUTE"),
15486 Self::SubnetPeeringRoute => std::option::Option::Some("SUBNET_PEERING_ROUTE"),
15487 Self::UnknownValue(u) => u.0.name(),
15488 }
15489 }
15490 }
15491
15492 impl std::default::Default for Type {
15493 fn default() -> Self {
15494 use std::convert::From;
15495 Self::from(0)
15496 }
15497 }
15498
15499 impl std::fmt::Display for Type {
15500 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15501 wkt::internal::display_enum(f, self.name(), self.value())
15502 }
15503 }
15504
15505 impl std::convert::From<i32> for Type {
15506 fn from(value: i32) -> Self {
15507 match value {
15508 0 => Self::Unspecified,
15509 1 => Self::DynamicPeeringRoute,
15510 2 => Self::StaticPeeringRoute,
15511 3 => Self::SubnetPeeringRoute,
15512 _ => Self::UnknownValue(r#type::UnknownValue(
15513 wkt::internal::UnknownEnumValue::Integer(value),
15514 )),
15515 }
15516 }
15517 }
15518
15519 impl std::convert::From<&str> for Type {
15520 fn from(value: &str) -> Self {
15521 use std::string::ToString;
15522 match value {
15523 "TYPE_UNSPECIFIED" => Self::Unspecified,
15524 "DYNAMIC_PEERING_ROUTE" => Self::DynamicPeeringRoute,
15525 "STATIC_PEERING_ROUTE" => Self::StaticPeeringRoute,
15526 "SUBNET_PEERING_ROUTE" => Self::SubnetPeeringRoute,
15527 _ => Self::UnknownValue(r#type::UnknownValue(
15528 wkt::internal::UnknownEnumValue::String(value.to_string()),
15529 )),
15530 }
15531 }
15532 }
15533
15534 impl serde::ser::Serialize for Type {
15535 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15536 where
15537 S: serde::Serializer,
15538 {
15539 match self {
15540 Self::Unspecified => serializer.serialize_i32(0),
15541 Self::DynamicPeeringRoute => serializer.serialize_i32(1),
15542 Self::StaticPeeringRoute => serializer.serialize_i32(2),
15543 Self::SubnetPeeringRoute => serializer.serialize_i32(3),
15544 Self::UnknownValue(u) => u.0.serialize(serializer),
15545 }
15546 }
15547 }
15548
15549 impl<'de> serde::de::Deserialize<'de> for Type {
15550 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15551 where
15552 D: serde::Deserializer<'de>,
15553 {
15554 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15555 ".google.cloud.vmwareengine.v1.PeeringRoute.Type",
15556 ))
15557 }
15558 }
15559
15560 /// The direction of the exchanged routes.
15561 ///
15562 /// # Working with unknown values
15563 ///
15564 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15565 /// additional enum variants at any time. Adding new variants is not considered
15566 /// a breaking change. Applications should write their code in anticipation of:
15567 ///
15568 /// - New values appearing in future releases of the client library, **and**
15569 /// - New values received dynamically, without application changes.
15570 ///
15571 /// Please consult the [Working with enums] section in the user guide for some
15572 /// guidelines.
15573 ///
15574 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15575 #[derive(Clone, Debug, PartialEq)]
15576 #[non_exhaustive]
15577 pub enum Direction {
15578 /// Unspecified exchanged routes direction. This is default.
15579 Unspecified,
15580 /// Routes imported from the peer network.
15581 Incoming,
15582 /// Routes exported to the peer network.
15583 Outgoing,
15584 /// If set, the enum was initialized with an unknown value.
15585 ///
15586 /// Applications can examine the value using [Direction::value] or
15587 /// [Direction::name].
15588 UnknownValue(direction::UnknownValue),
15589 }
15590
15591 #[doc(hidden)]
15592 pub mod direction {
15593 #[allow(unused_imports)]
15594 use super::*;
15595 #[derive(Clone, Debug, PartialEq)]
15596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15597 }
15598
15599 impl Direction {
15600 /// Gets the enum value.
15601 ///
15602 /// Returns `None` if the enum contains an unknown value deserialized from
15603 /// the string representation of enums.
15604 pub fn value(&self) -> std::option::Option<i32> {
15605 match self {
15606 Self::Unspecified => std::option::Option::Some(0),
15607 Self::Incoming => std::option::Option::Some(1),
15608 Self::Outgoing => std::option::Option::Some(2),
15609 Self::UnknownValue(u) => u.0.value(),
15610 }
15611 }
15612
15613 /// Gets the enum value as a string.
15614 ///
15615 /// Returns `None` if the enum contains an unknown value deserialized from
15616 /// the integer representation of enums.
15617 pub fn name(&self) -> std::option::Option<&str> {
15618 match self {
15619 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
15620 Self::Incoming => std::option::Option::Some("INCOMING"),
15621 Self::Outgoing => std::option::Option::Some("OUTGOING"),
15622 Self::UnknownValue(u) => u.0.name(),
15623 }
15624 }
15625 }
15626
15627 impl std::default::Default for Direction {
15628 fn default() -> Self {
15629 use std::convert::From;
15630 Self::from(0)
15631 }
15632 }
15633
15634 impl std::fmt::Display for Direction {
15635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15636 wkt::internal::display_enum(f, self.name(), self.value())
15637 }
15638 }
15639
15640 impl std::convert::From<i32> for Direction {
15641 fn from(value: i32) -> Self {
15642 match value {
15643 0 => Self::Unspecified,
15644 1 => Self::Incoming,
15645 2 => Self::Outgoing,
15646 _ => Self::UnknownValue(direction::UnknownValue(
15647 wkt::internal::UnknownEnumValue::Integer(value),
15648 )),
15649 }
15650 }
15651 }
15652
15653 impl std::convert::From<&str> for Direction {
15654 fn from(value: &str) -> Self {
15655 use std::string::ToString;
15656 match value {
15657 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
15658 "INCOMING" => Self::Incoming,
15659 "OUTGOING" => Self::Outgoing,
15660 _ => Self::UnknownValue(direction::UnknownValue(
15661 wkt::internal::UnknownEnumValue::String(value.to_string()),
15662 )),
15663 }
15664 }
15665 }
15666
15667 impl serde::ser::Serialize for Direction {
15668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15669 where
15670 S: serde::Serializer,
15671 {
15672 match self {
15673 Self::Unspecified => serializer.serialize_i32(0),
15674 Self::Incoming => serializer.serialize_i32(1),
15675 Self::Outgoing => serializer.serialize_i32(2),
15676 Self::UnknownValue(u) => u.0.serialize(serializer),
15677 }
15678 }
15679 }
15680
15681 impl<'de> serde::de::Deserialize<'de> for Direction {
15682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15683 where
15684 D: serde::Deserializer<'de>,
15685 {
15686 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
15687 ".google.cloud.vmwareengine.v1.PeeringRoute.Direction",
15688 ))
15689 }
15690 }
15691}
15692
15693/// Represents a network policy resource. Network policies are regional
15694/// resources. You can use a network policy to enable or disable internet access
15695/// and external IP access. Network policies are associated with a VMware Engine
15696/// network, which might span across regions. For a given region, a network
15697/// policy applies to all private clouds in the VMware Engine network associated
15698/// with the policy.
15699#[derive(Clone, Default, PartialEq)]
15700#[non_exhaustive]
15701pub struct NetworkPolicy {
15702 /// Output only. The resource name of this network policy.
15703 /// Resource names are schemeless URIs that follow the conventions in
15704 /// <https://cloud.google.com/apis/design/resource_names>.
15705 /// For example:
15706 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
15707 pub name: std::string::String,
15708
15709 /// Output only. Creation time of this resource.
15710 pub create_time: std::option::Option<wkt::Timestamp>,
15711
15712 /// Output only. Last update time of this resource.
15713 pub update_time: std::option::Option<wkt::Timestamp>,
15714
15715 /// Network service that allows VMware workloads to access the internet.
15716 pub internet_access: std::option::Option<crate::model::network_policy::NetworkService>,
15717
15718 /// Network service that allows External IP addresses to be assigned to VMware
15719 /// workloads. This service can only be enabled when `internet_access` is also
15720 /// enabled.
15721 pub external_ip: std::option::Option<crate::model::network_policy::NetworkService>,
15722
15723 /// Required. IP address range in CIDR notation used to create internet access
15724 /// and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
15725 /// required. The range cannot overlap with any prefixes either in the consumer
15726 /// VPC network or in use by the private clouds attached to that VPC network.
15727 pub edge_services_cidr: std::string::String,
15728
15729 /// Output only. System-generated unique identifier for the resource.
15730 pub uid: std::string::String,
15731
15732 /// Optional. The relative resource name of the VMware Engine network.
15733 /// Specify the name in the following form:
15734 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15735 /// where `{project}` can either be a project number or a project ID.
15736 pub vmware_engine_network: std::string::String,
15737
15738 /// Optional. User-provided description for this network policy.
15739 pub description: std::string::String,
15740
15741 /// Output only. The canonical name of the VMware Engine network in the form:
15742 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15743 pub vmware_engine_network_canonical: std::string::String,
15744
15745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15746}
15747
15748impl NetworkPolicy {
15749 pub fn new() -> Self {
15750 std::default::Default::default()
15751 }
15752
15753 /// Sets the value of [name][crate::model::NetworkPolicy::name].
15754 ///
15755 /// # Example
15756 /// ```ignore,no_run
15757 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15758 /// let x = NetworkPolicy::new().set_name("example");
15759 /// ```
15760 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15761 self.name = v.into();
15762 self
15763 }
15764
15765 /// Sets the value of [create_time][crate::model::NetworkPolicy::create_time].
15766 ///
15767 /// # Example
15768 /// ```ignore,no_run
15769 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15770 /// use wkt::Timestamp;
15771 /// let x = NetworkPolicy::new().set_create_time(Timestamp::default()/* use setters */);
15772 /// ```
15773 pub fn set_create_time<T>(mut self, v: T) -> Self
15774 where
15775 T: std::convert::Into<wkt::Timestamp>,
15776 {
15777 self.create_time = std::option::Option::Some(v.into());
15778 self
15779 }
15780
15781 /// Sets or clears the value of [create_time][crate::model::NetworkPolicy::create_time].
15782 ///
15783 /// # Example
15784 /// ```ignore,no_run
15785 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15786 /// use wkt::Timestamp;
15787 /// let x = NetworkPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15788 /// let x = NetworkPolicy::new().set_or_clear_create_time(None::<Timestamp>);
15789 /// ```
15790 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15791 where
15792 T: std::convert::Into<wkt::Timestamp>,
15793 {
15794 self.create_time = v.map(|x| x.into());
15795 self
15796 }
15797
15798 /// Sets the value of [update_time][crate::model::NetworkPolicy::update_time].
15799 ///
15800 /// # Example
15801 /// ```ignore,no_run
15802 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15803 /// use wkt::Timestamp;
15804 /// let x = NetworkPolicy::new().set_update_time(Timestamp::default()/* use setters */);
15805 /// ```
15806 pub fn set_update_time<T>(mut self, v: T) -> Self
15807 where
15808 T: std::convert::Into<wkt::Timestamp>,
15809 {
15810 self.update_time = std::option::Option::Some(v.into());
15811 self
15812 }
15813
15814 /// Sets or clears the value of [update_time][crate::model::NetworkPolicy::update_time].
15815 ///
15816 /// # Example
15817 /// ```ignore,no_run
15818 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15819 /// use wkt::Timestamp;
15820 /// let x = NetworkPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15821 /// let x = NetworkPolicy::new().set_or_clear_update_time(None::<Timestamp>);
15822 /// ```
15823 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15824 where
15825 T: std::convert::Into<wkt::Timestamp>,
15826 {
15827 self.update_time = v.map(|x| x.into());
15828 self
15829 }
15830
15831 /// Sets the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15832 ///
15833 /// # Example
15834 /// ```ignore,no_run
15835 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15836 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15837 /// let x = NetworkPolicy::new().set_internet_access(NetworkService::default()/* use setters */);
15838 /// ```
15839 pub fn set_internet_access<T>(mut self, v: T) -> Self
15840 where
15841 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15842 {
15843 self.internet_access = std::option::Option::Some(v.into());
15844 self
15845 }
15846
15847 /// Sets or clears the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15848 ///
15849 /// # Example
15850 /// ```ignore,no_run
15851 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15852 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15853 /// let x = NetworkPolicy::new().set_or_clear_internet_access(Some(NetworkService::default()/* use setters */));
15854 /// let x = NetworkPolicy::new().set_or_clear_internet_access(None::<NetworkService>);
15855 /// ```
15856 pub fn set_or_clear_internet_access<T>(mut self, v: std::option::Option<T>) -> Self
15857 where
15858 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15859 {
15860 self.internet_access = v.map(|x| x.into());
15861 self
15862 }
15863
15864 /// Sets the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15865 ///
15866 /// # Example
15867 /// ```ignore,no_run
15868 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15869 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15870 /// let x = NetworkPolicy::new().set_external_ip(NetworkService::default()/* use setters */);
15871 /// ```
15872 pub fn set_external_ip<T>(mut self, v: T) -> Self
15873 where
15874 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15875 {
15876 self.external_ip = std::option::Option::Some(v.into());
15877 self
15878 }
15879
15880 /// Sets or clears the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15881 ///
15882 /// # Example
15883 /// ```ignore,no_run
15884 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15885 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15886 /// let x = NetworkPolicy::new().set_or_clear_external_ip(Some(NetworkService::default()/* use setters */));
15887 /// let x = NetworkPolicy::new().set_or_clear_external_ip(None::<NetworkService>);
15888 /// ```
15889 pub fn set_or_clear_external_ip<T>(mut self, v: std::option::Option<T>) -> Self
15890 where
15891 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15892 {
15893 self.external_ip = v.map(|x| x.into());
15894 self
15895 }
15896
15897 /// Sets the value of [edge_services_cidr][crate::model::NetworkPolicy::edge_services_cidr].
15898 ///
15899 /// # Example
15900 /// ```ignore,no_run
15901 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15902 /// let x = NetworkPolicy::new().set_edge_services_cidr("example");
15903 /// ```
15904 pub fn set_edge_services_cidr<T: std::convert::Into<std::string::String>>(
15905 mut self,
15906 v: T,
15907 ) -> Self {
15908 self.edge_services_cidr = v.into();
15909 self
15910 }
15911
15912 /// Sets the value of [uid][crate::model::NetworkPolicy::uid].
15913 ///
15914 /// # Example
15915 /// ```ignore,no_run
15916 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15917 /// let x = NetworkPolicy::new().set_uid("example");
15918 /// ```
15919 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15920 self.uid = v.into();
15921 self
15922 }
15923
15924 /// Sets the value of [vmware_engine_network][crate::model::NetworkPolicy::vmware_engine_network].
15925 ///
15926 /// # Example
15927 /// ```ignore,no_run
15928 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15929 /// let x = NetworkPolicy::new().set_vmware_engine_network("example");
15930 /// ```
15931 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
15932 mut self,
15933 v: T,
15934 ) -> Self {
15935 self.vmware_engine_network = v.into();
15936 self
15937 }
15938
15939 /// Sets the value of [description][crate::model::NetworkPolicy::description].
15940 ///
15941 /// # Example
15942 /// ```ignore,no_run
15943 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15944 /// let x = NetworkPolicy::new().set_description("example");
15945 /// ```
15946 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15947 self.description = v.into();
15948 self
15949 }
15950
15951 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkPolicy::vmware_engine_network_canonical].
15952 ///
15953 /// # Example
15954 /// ```ignore,no_run
15955 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15956 /// let x = NetworkPolicy::new().set_vmware_engine_network_canonical("example");
15957 /// ```
15958 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
15959 mut self,
15960 v: T,
15961 ) -> Self {
15962 self.vmware_engine_network_canonical = v.into();
15963 self
15964 }
15965}
15966
15967impl wkt::message::Message for NetworkPolicy {
15968 fn typename() -> &'static str {
15969 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy"
15970 }
15971}
15972
15973/// Defines additional types related to [NetworkPolicy].
15974pub mod network_policy {
15975 #[allow(unused_imports)]
15976 use super::*;
15977
15978 /// Represents a network service that is managed by a `NetworkPolicy` resource.
15979 /// A network service provides a way to control an aspect of external access to
15980 /// VMware workloads. For example, whether the VMware workloads in the
15981 /// private clouds governed by a network policy can access or be accessed from
15982 /// the internet.
15983 #[derive(Clone, Default, PartialEq)]
15984 #[non_exhaustive]
15985 pub struct NetworkService {
15986 /// True if the service is enabled; false otherwise.
15987 pub enabled: bool,
15988
15989 /// Output only. State of the service. New values may be added to this enum
15990 /// when appropriate.
15991 pub state: crate::model::network_policy::network_service::State,
15992
15993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15994 }
15995
15996 impl NetworkService {
15997 pub fn new() -> Self {
15998 std::default::Default::default()
15999 }
16000
16001 /// Sets the value of [enabled][crate::model::network_policy::NetworkService::enabled].
16002 ///
16003 /// # Example
16004 /// ```ignore,no_run
16005 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16006 /// let x = NetworkService::new().set_enabled(true);
16007 /// ```
16008 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16009 self.enabled = v.into();
16010 self
16011 }
16012
16013 /// Sets the value of [state][crate::model::network_policy::NetworkService::state].
16014 ///
16015 /// # Example
16016 /// ```ignore,no_run
16017 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16018 /// use google_cloud_vmwareengine_v1::model::network_policy::network_service::State;
16019 /// let x0 = NetworkService::new().set_state(State::Unprovisioned);
16020 /// let x1 = NetworkService::new().set_state(State::Reconciling);
16021 /// let x2 = NetworkService::new().set_state(State::Active);
16022 /// ```
16023 pub fn set_state<
16024 T: std::convert::Into<crate::model::network_policy::network_service::State>,
16025 >(
16026 mut self,
16027 v: T,
16028 ) -> Self {
16029 self.state = v.into();
16030 self
16031 }
16032 }
16033
16034 impl wkt::message::Message for NetworkService {
16035 fn typename() -> &'static str {
16036 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"
16037 }
16038 }
16039
16040 /// Defines additional types related to [NetworkService].
16041 pub mod network_service {
16042 #[allow(unused_imports)]
16043 use super::*;
16044
16045 /// Enum State defines possible states of a network policy controlled
16046 /// service.
16047 ///
16048 /// # Working with unknown values
16049 ///
16050 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16051 /// additional enum variants at any time. Adding new variants is not considered
16052 /// a breaking change. Applications should write their code in anticipation of:
16053 ///
16054 /// - New values appearing in future releases of the client library, **and**
16055 /// - New values received dynamically, without application changes.
16056 ///
16057 /// Please consult the [Working with enums] section in the user guide for some
16058 /// guidelines.
16059 ///
16060 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16061 #[derive(Clone, Debug, PartialEq)]
16062 #[non_exhaustive]
16063 pub enum State {
16064 /// Unspecified service state. This is the default value.
16065 Unspecified,
16066 /// Service is not provisioned.
16067 Unprovisioned,
16068 /// Service is in the process of being provisioned/deprovisioned.
16069 Reconciling,
16070 /// Service is active.
16071 Active,
16072 /// If set, the enum was initialized with an unknown value.
16073 ///
16074 /// Applications can examine the value using [State::value] or
16075 /// [State::name].
16076 UnknownValue(state::UnknownValue),
16077 }
16078
16079 #[doc(hidden)]
16080 pub mod state {
16081 #[allow(unused_imports)]
16082 use super::*;
16083 #[derive(Clone, Debug, PartialEq)]
16084 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16085 }
16086
16087 impl State {
16088 /// Gets the enum value.
16089 ///
16090 /// Returns `None` if the enum contains an unknown value deserialized from
16091 /// the string representation of enums.
16092 pub fn value(&self) -> std::option::Option<i32> {
16093 match self {
16094 Self::Unspecified => std::option::Option::Some(0),
16095 Self::Unprovisioned => std::option::Option::Some(1),
16096 Self::Reconciling => std::option::Option::Some(2),
16097 Self::Active => std::option::Option::Some(3),
16098 Self::UnknownValue(u) => u.0.value(),
16099 }
16100 }
16101
16102 /// Gets the enum value as a string.
16103 ///
16104 /// Returns `None` if the enum contains an unknown value deserialized from
16105 /// the integer representation of enums.
16106 pub fn name(&self) -> std::option::Option<&str> {
16107 match self {
16108 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16109 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
16110 Self::Reconciling => std::option::Option::Some("RECONCILING"),
16111 Self::Active => std::option::Option::Some("ACTIVE"),
16112 Self::UnknownValue(u) => u.0.name(),
16113 }
16114 }
16115 }
16116
16117 impl std::default::Default for State {
16118 fn default() -> Self {
16119 use std::convert::From;
16120 Self::from(0)
16121 }
16122 }
16123
16124 impl std::fmt::Display for State {
16125 fn fmt(
16126 &self,
16127 f: &mut std::fmt::Formatter<'_>,
16128 ) -> std::result::Result<(), std::fmt::Error> {
16129 wkt::internal::display_enum(f, self.name(), self.value())
16130 }
16131 }
16132
16133 impl std::convert::From<i32> for State {
16134 fn from(value: i32) -> Self {
16135 match value {
16136 0 => Self::Unspecified,
16137 1 => Self::Unprovisioned,
16138 2 => Self::Reconciling,
16139 3 => Self::Active,
16140 _ => Self::UnknownValue(state::UnknownValue(
16141 wkt::internal::UnknownEnumValue::Integer(value),
16142 )),
16143 }
16144 }
16145 }
16146
16147 impl std::convert::From<&str> for State {
16148 fn from(value: &str) -> Self {
16149 use std::string::ToString;
16150 match value {
16151 "STATE_UNSPECIFIED" => Self::Unspecified,
16152 "UNPROVISIONED" => Self::Unprovisioned,
16153 "RECONCILING" => Self::Reconciling,
16154 "ACTIVE" => Self::Active,
16155 _ => Self::UnknownValue(state::UnknownValue(
16156 wkt::internal::UnknownEnumValue::String(value.to_string()),
16157 )),
16158 }
16159 }
16160 }
16161
16162 impl serde::ser::Serialize for State {
16163 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16164 where
16165 S: serde::Serializer,
16166 {
16167 match self {
16168 Self::Unspecified => serializer.serialize_i32(0),
16169 Self::Unprovisioned => serializer.serialize_i32(1),
16170 Self::Reconciling => serializer.serialize_i32(2),
16171 Self::Active => serializer.serialize_i32(3),
16172 Self::UnknownValue(u) => u.0.serialize(serializer),
16173 }
16174 }
16175 }
16176
16177 impl<'de> serde::de::Deserialize<'de> for State {
16178 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16179 where
16180 D: serde::Deserializer<'de>,
16181 {
16182 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16183 ".google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State",
16184 ))
16185 }
16186 }
16187 }
16188}
16189
16190/// Represents a binding between a network and the management DNS zone.
16191/// A management DNS zone is the Cloud DNS cross-project binding zone that
16192/// VMware Engine creates for each private cloud. It contains FQDNs and
16193/// corresponding IP addresses for the private cloud's ESXi hosts and management
16194/// VM appliances like vCenter and NSX Manager.
16195#[derive(Clone, Default, PartialEq)]
16196#[non_exhaustive]
16197pub struct ManagementDnsZoneBinding {
16198 /// Output only. The resource name of this binding.
16199 /// Resource names are schemeless URIs that follow the conventions in
16200 /// <https://cloud.google.com/apis/design/resource_names>.
16201 /// For example:
16202 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16203 pub name: std::string::String,
16204
16205 /// Output only. Creation time of this resource.
16206 pub create_time: std::option::Option<wkt::Timestamp>,
16207
16208 /// Output only. Last update time of this resource.
16209 pub update_time: std::option::Option<wkt::Timestamp>,
16210
16211 /// Output only. The state of the resource.
16212 pub state: crate::model::management_dns_zone_binding::State,
16213
16214 /// User-provided description for this resource.
16215 pub description: std::string::String,
16216
16217 /// Output only. System-generated unique identifier for the resource.
16218 pub uid: std::string::String,
16219
16220 /// Required. The relative resource name of the network to bind to the
16221 /// management DNS zone. This network can be a consumer VPC network or a
16222 /// VMware engine network.
16223 pub bind_network: std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16224
16225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16226}
16227
16228impl ManagementDnsZoneBinding {
16229 pub fn new() -> Self {
16230 std::default::Default::default()
16231 }
16232
16233 /// Sets the value of [name][crate::model::ManagementDnsZoneBinding::name].
16234 ///
16235 /// # Example
16236 /// ```ignore,no_run
16237 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16238 /// let x = ManagementDnsZoneBinding::new().set_name("example");
16239 /// ```
16240 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16241 self.name = v.into();
16242 self
16243 }
16244
16245 /// Sets the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16246 ///
16247 /// # Example
16248 /// ```ignore,no_run
16249 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16250 /// use wkt::Timestamp;
16251 /// let x = ManagementDnsZoneBinding::new().set_create_time(Timestamp::default()/* use setters */);
16252 /// ```
16253 pub fn set_create_time<T>(mut self, v: T) -> Self
16254 where
16255 T: std::convert::Into<wkt::Timestamp>,
16256 {
16257 self.create_time = std::option::Option::Some(v.into());
16258 self
16259 }
16260
16261 /// Sets or clears the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16262 ///
16263 /// # Example
16264 /// ```ignore,no_run
16265 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16266 /// use wkt::Timestamp;
16267 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16268 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(None::<Timestamp>);
16269 /// ```
16270 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16271 where
16272 T: std::convert::Into<wkt::Timestamp>,
16273 {
16274 self.create_time = v.map(|x| x.into());
16275 self
16276 }
16277
16278 /// Sets the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16279 ///
16280 /// # Example
16281 /// ```ignore,no_run
16282 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16283 /// use wkt::Timestamp;
16284 /// let x = ManagementDnsZoneBinding::new().set_update_time(Timestamp::default()/* use setters */);
16285 /// ```
16286 pub fn set_update_time<T>(mut self, v: T) -> Self
16287 where
16288 T: std::convert::Into<wkt::Timestamp>,
16289 {
16290 self.update_time = std::option::Option::Some(v.into());
16291 self
16292 }
16293
16294 /// Sets or clears the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16295 ///
16296 /// # Example
16297 /// ```ignore,no_run
16298 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16299 /// use wkt::Timestamp;
16300 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16301 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(None::<Timestamp>);
16302 /// ```
16303 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16304 where
16305 T: std::convert::Into<wkt::Timestamp>,
16306 {
16307 self.update_time = v.map(|x| x.into());
16308 self
16309 }
16310
16311 /// Sets the value of [state][crate::model::ManagementDnsZoneBinding::state].
16312 ///
16313 /// # Example
16314 /// ```ignore,no_run
16315 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16316 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::State;
16317 /// let x0 = ManagementDnsZoneBinding::new().set_state(State::Active);
16318 /// let x1 = ManagementDnsZoneBinding::new().set_state(State::Creating);
16319 /// let x2 = ManagementDnsZoneBinding::new().set_state(State::Updating);
16320 /// ```
16321 pub fn set_state<T: std::convert::Into<crate::model::management_dns_zone_binding::State>>(
16322 mut self,
16323 v: T,
16324 ) -> Self {
16325 self.state = v.into();
16326 self
16327 }
16328
16329 /// Sets the value of [description][crate::model::ManagementDnsZoneBinding::description].
16330 ///
16331 /// # Example
16332 /// ```ignore,no_run
16333 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16334 /// let x = ManagementDnsZoneBinding::new().set_description("example");
16335 /// ```
16336 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16337 self.description = v.into();
16338 self
16339 }
16340
16341 /// Sets the value of [uid][crate::model::ManagementDnsZoneBinding::uid].
16342 ///
16343 /// # Example
16344 /// ```ignore,no_run
16345 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16346 /// let x = ManagementDnsZoneBinding::new().set_uid("example");
16347 /// ```
16348 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16349 self.uid = v.into();
16350 self
16351 }
16352
16353 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network].
16354 ///
16355 /// Note that all the setters affecting `bind_network` are mutually
16356 /// exclusive.
16357 ///
16358 /// # Example
16359 /// ```ignore,no_run
16360 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16361 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::BindNetwork;
16362 /// let x = ManagementDnsZoneBinding::new().set_bind_network(Some(BindNetwork::VpcNetwork("example".to_string())));
16363 /// ```
16364 pub fn set_bind_network<
16365 T: std::convert::Into<
16366 std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16367 >,
16368 >(
16369 mut self,
16370 v: T,
16371 ) -> Self {
16372 self.bind_network = v.into();
16373 self
16374 }
16375
16376 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16377 /// if it holds a `VpcNetwork`, `None` if the field is not set or
16378 /// holds a different branch.
16379 pub fn vpc_network(&self) -> std::option::Option<&std::string::String> {
16380 #[allow(unreachable_patterns)]
16381 self.bind_network.as_ref().and_then(|v| match v {
16382 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v) => {
16383 std::option::Option::Some(v)
16384 }
16385 _ => std::option::Option::None,
16386 })
16387 }
16388
16389 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16390 /// to hold a `VpcNetwork`.
16391 ///
16392 /// Note that all the setters affecting `bind_network` are
16393 /// mutually exclusive.
16394 ///
16395 /// # Example
16396 /// ```ignore,no_run
16397 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16398 /// let x = ManagementDnsZoneBinding::new().set_vpc_network("example");
16399 /// assert!(x.vpc_network().is_some());
16400 /// assert!(x.vmware_engine_network().is_none());
16401 /// ```
16402 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16403 self.bind_network = std::option::Option::Some(
16404 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v.into()),
16405 );
16406 self
16407 }
16408
16409 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16410 /// if it holds a `VmwareEngineNetwork`, `None` if the field is not set or
16411 /// holds a different branch.
16412 pub fn vmware_engine_network(&self) -> std::option::Option<&std::string::String> {
16413 #[allow(unreachable_patterns)]
16414 self.bind_network.as_ref().and_then(|v| match v {
16415 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v) => {
16416 std::option::Option::Some(v)
16417 }
16418 _ => std::option::Option::None,
16419 })
16420 }
16421
16422 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16423 /// to hold a `VmwareEngineNetwork`.
16424 ///
16425 /// Note that all the setters affecting `bind_network` are
16426 /// mutually exclusive.
16427 ///
16428 /// # Example
16429 /// ```ignore,no_run
16430 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16431 /// let x = ManagementDnsZoneBinding::new().set_vmware_engine_network("example");
16432 /// assert!(x.vmware_engine_network().is_some());
16433 /// assert!(x.vpc_network().is_none());
16434 /// ```
16435 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
16436 mut self,
16437 v: T,
16438 ) -> Self {
16439 self.bind_network = std::option::Option::Some(
16440 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v.into()),
16441 );
16442 self
16443 }
16444}
16445
16446impl wkt::message::Message for ManagementDnsZoneBinding {
16447 fn typename() -> &'static str {
16448 "type.googleapis.com/google.cloud.vmwareengine.v1.ManagementDnsZoneBinding"
16449 }
16450}
16451
16452/// Defines additional types related to [ManagementDnsZoneBinding].
16453pub mod management_dns_zone_binding {
16454 #[allow(unused_imports)]
16455 use super::*;
16456
16457 /// Enum State defines possible states of binding between the consumer VPC
16458 /// network and the management DNS zone.
16459 ///
16460 /// # Working with unknown values
16461 ///
16462 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16463 /// additional enum variants at any time. Adding new variants is not considered
16464 /// a breaking change. Applications should write their code in anticipation of:
16465 ///
16466 /// - New values appearing in future releases of the client library, **and**
16467 /// - New values received dynamically, without application changes.
16468 ///
16469 /// Please consult the [Working with enums] section in the user guide for some
16470 /// guidelines.
16471 ///
16472 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16473 #[derive(Clone, Debug, PartialEq)]
16474 #[non_exhaustive]
16475 pub enum State {
16476 /// The default value. This value should never be used.
16477 Unspecified,
16478 /// The binding is ready.
16479 Active,
16480 /// The binding is being created.
16481 Creating,
16482 /// The binding is being updated.
16483 Updating,
16484 /// The binding is being deleted.
16485 Deleting,
16486 /// The binding has failed.
16487 Failed,
16488 /// If set, the enum was initialized with an unknown value.
16489 ///
16490 /// Applications can examine the value using [State::value] or
16491 /// [State::name].
16492 UnknownValue(state::UnknownValue),
16493 }
16494
16495 #[doc(hidden)]
16496 pub mod state {
16497 #[allow(unused_imports)]
16498 use super::*;
16499 #[derive(Clone, Debug, PartialEq)]
16500 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16501 }
16502
16503 impl State {
16504 /// Gets the enum value.
16505 ///
16506 /// Returns `None` if the enum contains an unknown value deserialized from
16507 /// the string representation of enums.
16508 pub fn value(&self) -> std::option::Option<i32> {
16509 match self {
16510 Self::Unspecified => std::option::Option::Some(0),
16511 Self::Active => std::option::Option::Some(1),
16512 Self::Creating => std::option::Option::Some(2),
16513 Self::Updating => std::option::Option::Some(3),
16514 Self::Deleting => std::option::Option::Some(4),
16515 Self::Failed => std::option::Option::Some(5),
16516 Self::UnknownValue(u) => u.0.value(),
16517 }
16518 }
16519
16520 /// Gets the enum value as a string.
16521 ///
16522 /// Returns `None` if the enum contains an unknown value deserialized from
16523 /// the integer representation of enums.
16524 pub fn name(&self) -> std::option::Option<&str> {
16525 match self {
16526 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16527 Self::Active => std::option::Option::Some("ACTIVE"),
16528 Self::Creating => std::option::Option::Some("CREATING"),
16529 Self::Updating => std::option::Option::Some("UPDATING"),
16530 Self::Deleting => std::option::Option::Some("DELETING"),
16531 Self::Failed => std::option::Option::Some("FAILED"),
16532 Self::UnknownValue(u) => u.0.name(),
16533 }
16534 }
16535 }
16536
16537 impl std::default::Default for State {
16538 fn default() -> Self {
16539 use std::convert::From;
16540 Self::from(0)
16541 }
16542 }
16543
16544 impl std::fmt::Display for State {
16545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16546 wkt::internal::display_enum(f, self.name(), self.value())
16547 }
16548 }
16549
16550 impl std::convert::From<i32> for State {
16551 fn from(value: i32) -> Self {
16552 match value {
16553 0 => Self::Unspecified,
16554 1 => Self::Active,
16555 2 => Self::Creating,
16556 3 => Self::Updating,
16557 4 => Self::Deleting,
16558 5 => Self::Failed,
16559 _ => Self::UnknownValue(state::UnknownValue(
16560 wkt::internal::UnknownEnumValue::Integer(value),
16561 )),
16562 }
16563 }
16564 }
16565
16566 impl std::convert::From<&str> for State {
16567 fn from(value: &str) -> Self {
16568 use std::string::ToString;
16569 match value {
16570 "STATE_UNSPECIFIED" => Self::Unspecified,
16571 "ACTIVE" => Self::Active,
16572 "CREATING" => Self::Creating,
16573 "UPDATING" => Self::Updating,
16574 "DELETING" => Self::Deleting,
16575 "FAILED" => Self::Failed,
16576 _ => Self::UnknownValue(state::UnknownValue(
16577 wkt::internal::UnknownEnumValue::String(value.to_string()),
16578 )),
16579 }
16580 }
16581 }
16582
16583 impl serde::ser::Serialize for State {
16584 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16585 where
16586 S: serde::Serializer,
16587 {
16588 match self {
16589 Self::Unspecified => serializer.serialize_i32(0),
16590 Self::Active => serializer.serialize_i32(1),
16591 Self::Creating => serializer.serialize_i32(2),
16592 Self::Updating => serializer.serialize_i32(3),
16593 Self::Deleting => serializer.serialize_i32(4),
16594 Self::Failed => serializer.serialize_i32(5),
16595 Self::UnknownValue(u) => u.0.serialize(serializer),
16596 }
16597 }
16598 }
16599
16600 impl<'de> serde::de::Deserialize<'de> for State {
16601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16602 where
16603 D: serde::Deserializer<'de>,
16604 {
16605 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16606 ".google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State",
16607 ))
16608 }
16609 }
16610
16611 /// Required. The relative resource name of the network to bind to the
16612 /// management DNS zone. This network can be a consumer VPC network or a
16613 /// VMware engine network.
16614 #[derive(Clone, Debug, PartialEq)]
16615 #[non_exhaustive]
16616 pub enum BindNetwork {
16617 /// Network to bind is a standard consumer VPC.
16618 /// Specify the name in the following form for consumer
16619 /// VPC network: `projects/{project}/global/networks/{network_id}`.
16620 /// `{project}` can either be a project number or a project ID.
16621 VpcNetwork(std::string::String),
16622 /// Network to bind is a VMware Engine network.
16623 /// Specify the name in the following form for VMware engine network:
16624 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
16625 /// `{project}` can either be a project number or a project ID.
16626 VmwareEngineNetwork(std::string::String),
16627 }
16628}
16629
16630/// VMware Engine network resource that provides connectivity for VMware Engine
16631/// private clouds.
16632#[derive(Clone, Default, PartialEq)]
16633#[non_exhaustive]
16634pub struct VmwareEngineNetwork {
16635 /// Output only. The resource name of the VMware Engine network.
16636 /// Resource names are schemeless URIs that follow the conventions in
16637 /// <https://cloud.google.com/apis/design/resource_names>.
16638 /// For example:
16639 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
16640 pub name: std::string::String,
16641
16642 /// Output only. Creation time of this resource.
16643 pub create_time: std::option::Option<wkt::Timestamp>,
16644
16645 /// Output only. Last update time of this resource.
16646 pub update_time: std::option::Option<wkt::Timestamp>,
16647
16648 /// User-provided description for this VMware Engine network.
16649 pub description: std::string::String,
16650
16651 /// Output only. VMware Engine service VPC networks that provide connectivity
16652 /// from a private cloud to customer projects, the internet, and other Google
16653 /// Cloud services.
16654 pub vpc_networks: std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
16655
16656 /// Output only. State of the VMware Engine network.
16657 pub state: crate::model::vmware_engine_network::State,
16658
16659 /// Required. VMware Engine network type.
16660 pub r#type: crate::model::vmware_engine_network::Type,
16661
16662 /// Output only. System-generated unique identifier for the resource.
16663 pub uid: std::string::String,
16664
16665 /// Checksum that may be sent on update and delete requests to ensure that the
16666 /// user-provided value is up to date before the server processes a request.
16667 /// The server computes checksums based on the value of other fields in the
16668 /// request.
16669 pub etag: std::string::String,
16670
16671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16672}
16673
16674impl VmwareEngineNetwork {
16675 pub fn new() -> Self {
16676 std::default::Default::default()
16677 }
16678
16679 /// Sets the value of [name][crate::model::VmwareEngineNetwork::name].
16680 ///
16681 /// # Example
16682 /// ```ignore,no_run
16683 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16684 /// let x = VmwareEngineNetwork::new().set_name("example");
16685 /// ```
16686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16687 self.name = v.into();
16688 self
16689 }
16690
16691 /// Sets the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16692 ///
16693 /// # Example
16694 /// ```ignore,no_run
16695 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16696 /// use wkt::Timestamp;
16697 /// let x = VmwareEngineNetwork::new().set_create_time(Timestamp::default()/* use setters */);
16698 /// ```
16699 pub fn set_create_time<T>(mut self, v: T) -> Self
16700 where
16701 T: std::convert::Into<wkt::Timestamp>,
16702 {
16703 self.create_time = std::option::Option::Some(v.into());
16704 self
16705 }
16706
16707 /// Sets or clears the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16708 ///
16709 /// # Example
16710 /// ```ignore,no_run
16711 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16712 /// use wkt::Timestamp;
16713 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16714 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(None::<Timestamp>);
16715 /// ```
16716 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16717 where
16718 T: std::convert::Into<wkt::Timestamp>,
16719 {
16720 self.create_time = v.map(|x| x.into());
16721 self
16722 }
16723
16724 /// Sets the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16725 ///
16726 /// # Example
16727 /// ```ignore,no_run
16728 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16729 /// use wkt::Timestamp;
16730 /// let x = VmwareEngineNetwork::new().set_update_time(Timestamp::default()/* use setters */);
16731 /// ```
16732 pub fn set_update_time<T>(mut self, v: T) -> Self
16733 where
16734 T: std::convert::Into<wkt::Timestamp>,
16735 {
16736 self.update_time = std::option::Option::Some(v.into());
16737 self
16738 }
16739
16740 /// Sets or clears the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16741 ///
16742 /// # Example
16743 /// ```ignore,no_run
16744 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16745 /// use wkt::Timestamp;
16746 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16747 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(None::<Timestamp>);
16748 /// ```
16749 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16750 where
16751 T: std::convert::Into<wkt::Timestamp>,
16752 {
16753 self.update_time = v.map(|x| x.into());
16754 self
16755 }
16756
16757 /// Sets the value of [description][crate::model::VmwareEngineNetwork::description].
16758 ///
16759 /// # Example
16760 /// ```ignore,no_run
16761 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16762 /// let x = VmwareEngineNetwork::new().set_description("example");
16763 /// ```
16764 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16765 self.description = v.into();
16766 self
16767 }
16768
16769 /// Sets the value of [vpc_networks][crate::model::VmwareEngineNetwork::vpc_networks].
16770 ///
16771 /// # Example
16772 /// ```ignore,no_run
16773 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16774 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16775 /// let x = VmwareEngineNetwork::new()
16776 /// .set_vpc_networks([
16777 /// VpcNetwork::default()/* use setters */,
16778 /// VpcNetwork::default()/* use (different) setters */,
16779 /// ]);
16780 /// ```
16781 pub fn set_vpc_networks<T, V>(mut self, v: T) -> Self
16782 where
16783 T: std::iter::IntoIterator<Item = V>,
16784 V: std::convert::Into<crate::model::vmware_engine_network::VpcNetwork>,
16785 {
16786 use std::iter::Iterator;
16787 self.vpc_networks = v.into_iter().map(|i| i.into()).collect();
16788 self
16789 }
16790
16791 /// Sets the value of [state][crate::model::VmwareEngineNetwork::state].
16792 ///
16793 /// # Example
16794 /// ```ignore,no_run
16795 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16796 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::State;
16797 /// let x0 = VmwareEngineNetwork::new().set_state(State::Creating);
16798 /// let x1 = VmwareEngineNetwork::new().set_state(State::Active);
16799 /// let x2 = VmwareEngineNetwork::new().set_state(State::Updating);
16800 /// ```
16801 pub fn set_state<T: std::convert::Into<crate::model::vmware_engine_network::State>>(
16802 mut self,
16803 v: T,
16804 ) -> Self {
16805 self.state = v.into();
16806 self
16807 }
16808
16809 /// Sets the value of [r#type][crate::model::VmwareEngineNetwork::type].
16810 ///
16811 /// # Example
16812 /// ```ignore,no_run
16813 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16814 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::Type;
16815 /// let x0 = VmwareEngineNetwork::new().set_type(Type::Legacy);
16816 /// let x1 = VmwareEngineNetwork::new().set_type(Type::Standard);
16817 /// ```
16818 pub fn set_type<T: std::convert::Into<crate::model::vmware_engine_network::Type>>(
16819 mut self,
16820 v: T,
16821 ) -> Self {
16822 self.r#type = v.into();
16823 self
16824 }
16825
16826 /// Sets the value of [uid][crate::model::VmwareEngineNetwork::uid].
16827 ///
16828 /// # Example
16829 /// ```ignore,no_run
16830 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16831 /// let x = VmwareEngineNetwork::new().set_uid("example");
16832 /// ```
16833 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16834 self.uid = v.into();
16835 self
16836 }
16837
16838 /// Sets the value of [etag][crate::model::VmwareEngineNetwork::etag].
16839 ///
16840 /// # Example
16841 /// ```ignore,no_run
16842 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16843 /// let x = VmwareEngineNetwork::new().set_etag("example");
16844 /// ```
16845 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16846 self.etag = v.into();
16847 self
16848 }
16849}
16850
16851impl wkt::message::Message for VmwareEngineNetwork {
16852 fn typename() -> &'static str {
16853 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork"
16854 }
16855}
16856
16857/// Defines additional types related to [VmwareEngineNetwork].
16858pub mod vmware_engine_network {
16859 #[allow(unused_imports)]
16860 use super::*;
16861
16862 /// Represents a VMware Engine VPC network that is managed by a
16863 /// VMware Engine network resource.
16864 #[derive(Clone, Default, PartialEq)]
16865 #[non_exhaustive]
16866 pub struct VpcNetwork {
16867 /// Output only. Type of VPC network (INTRANET, INTERNET, or
16868 /// GOOGLE_CLOUD)
16869 pub r#type: crate::model::vmware_engine_network::vpc_network::Type,
16870
16871 /// Output only. The relative resource name of the service VPC network this
16872 /// VMware Engine network is attached to. For example:
16873 /// `projects/123123/global/networks/my-network`
16874 pub network: std::string::String,
16875
16876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16877 }
16878
16879 impl VpcNetwork {
16880 pub fn new() -> Self {
16881 std::default::Default::default()
16882 }
16883
16884 /// Sets the value of [r#type][crate::model::vmware_engine_network::VpcNetwork::type].
16885 ///
16886 /// # Example
16887 /// ```ignore,no_run
16888 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16889 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::vpc_network::Type;
16890 /// let x0 = VpcNetwork::new().set_type(Type::Intranet);
16891 /// let x1 = VpcNetwork::new().set_type(Type::Internet);
16892 /// let x2 = VpcNetwork::new().set_type(Type::GoogleCloud);
16893 /// ```
16894 pub fn set_type<
16895 T: std::convert::Into<crate::model::vmware_engine_network::vpc_network::Type>,
16896 >(
16897 mut self,
16898 v: T,
16899 ) -> Self {
16900 self.r#type = v.into();
16901 self
16902 }
16903
16904 /// Sets the value of [network][crate::model::vmware_engine_network::VpcNetwork::network].
16905 ///
16906 /// # Example
16907 /// ```ignore,no_run
16908 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16909 /// let x = VpcNetwork::new().set_network("example");
16910 /// ```
16911 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16912 self.network = v.into();
16913 self
16914 }
16915 }
16916
16917 impl wkt::message::Message for VpcNetwork {
16918 fn typename() -> &'static str {
16919 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"
16920 }
16921 }
16922
16923 /// Defines additional types related to [VpcNetwork].
16924 pub mod vpc_network {
16925 #[allow(unused_imports)]
16926 use super::*;
16927
16928 /// Enum Type defines possible types of a VMware Engine network controlled
16929 /// service.
16930 ///
16931 /// # Working with unknown values
16932 ///
16933 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16934 /// additional enum variants at any time. Adding new variants is not considered
16935 /// a breaking change. Applications should write their code in anticipation of:
16936 ///
16937 /// - New values appearing in future releases of the client library, **and**
16938 /// - New values received dynamically, without application changes.
16939 ///
16940 /// Please consult the [Working with enums] section in the user guide for some
16941 /// guidelines.
16942 ///
16943 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16944 #[derive(Clone, Debug, PartialEq)]
16945 #[non_exhaustive]
16946 pub enum Type {
16947 /// The default value. This value should never be used.
16948 Unspecified,
16949 /// VPC network that will be peered with a consumer VPC network or the
16950 /// intranet VPC of another VMware Engine network. Access a private cloud
16951 /// through Compute Engine VMs on a peered VPC network or an on-premises
16952 /// resource connected to a peered consumer VPC network.
16953 Intranet,
16954 /// VPC network used for internet access to and from a private cloud.
16955 Internet,
16956 /// VPC network used for access to Google Cloud services like
16957 /// Cloud Storage.
16958 GoogleCloud,
16959 /// If set, the enum was initialized with an unknown value.
16960 ///
16961 /// Applications can examine the value using [Type::value] or
16962 /// [Type::name].
16963 UnknownValue(r#type::UnknownValue),
16964 }
16965
16966 #[doc(hidden)]
16967 pub mod r#type {
16968 #[allow(unused_imports)]
16969 use super::*;
16970 #[derive(Clone, Debug, PartialEq)]
16971 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16972 }
16973
16974 impl Type {
16975 /// Gets the enum value.
16976 ///
16977 /// Returns `None` if the enum contains an unknown value deserialized from
16978 /// the string representation of enums.
16979 pub fn value(&self) -> std::option::Option<i32> {
16980 match self {
16981 Self::Unspecified => std::option::Option::Some(0),
16982 Self::Intranet => std::option::Option::Some(1),
16983 Self::Internet => std::option::Option::Some(2),
16984 Self::GoogleCloud => std::option::Option::Some(3),
16985 Self::UnknownValue(u) => u.0.value(),
16986 }
16987 }
16988
16989 /// Gets the enum value as a string.
16990 ///
16991 /// Returns `None` if the enum contains an unknown value deserialized from
16992 /// the integer representation of enums.
16993 pub fn name(&self) -> std::option::Option<&str> {
16994 match self {
16995 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
16996 Self::Intranet => std::option::Option::Some("INTRANET"),
16997 Self::Internet => std::option::Option::Some("INTERNET"),
16998 Self::GoogleCloud => std::option::Option::Some("GOOGLE_CLOUD"),
16999 Self::UnknownValue(u) => u.0.name(),
17000 }
17001 }
17002 }
17003
17004 impl std::default::Default for Type {
17005 fn default() -> Self {
17006 use std::convert::From;
17007 Self::from(0)
17008 }
17009 }
17010
17011 impl std::fmt::Display for Type {
17012 fn fmt(
17013 &self,
17014 f: &mut std::fmt::Formatter<'_>,
17015 ) -> std::result::Result<(), std::fmt::Error> {
17016 wkt::internal::display_enum(f, self.name(), self.value())
17017 }
17018 }
17019
17020 impl std::convert::From<i32> for Type {
17021 fn from(value: i32) -> Self {
17022 match value {
17023 0 => Self::Unspecified,
17024 1 => Self::Intranet,
17025 2 => Self::Internet,
17026 3 => Self::GoogleCloud,
17027 _ => Self::UnknownValue(r#type::UnknownValue(
17028 wkt::internal::UnknownEnumValue::Integer(value),
17029 )),
17030 }
17031 }
17032 }
17033
17034 impl std::convert::From<&str> for Type {
17035 fn from(value: &str) -> Self {
17036 use std::string::ToString;
17037 match value {
17038 "TYPE_UNSPECIFIED" => Self::Unspecified,
17039 "INTRANET" => Self::Intranet,
17040 "INTERNET" => Self::Internet,
17041 "GOOGLE_CLOUD" => Self::GoogleCloud,
17042 _ => Self::UnknownValue(r#type::UnknownValue(
17043 wkt::internal::UnknownEnumValue::String(value.to_string()),
17044 )),
17045 }
17046 }
17047 }
17048
17049 impl serde::ser::Serialize for Type {
17050 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17051 where
17052 S: serde::Serializer,
17053 {
17054 match self {
17055 Self::Unspecified => serializer.serialize_i32(0),
17056 Self::Intranet => serializer.serialize_i32(1),
17057 Self::Internet => serializer.serialize_i32(2),
17058 Self::GoogleCloud => serializer.serialize_i32(3),
17059 Self::UnknownValue(u) => u.0.serialize(serializer),
17060 }
17061 }
17062 }
17063
17064 impl<'de> serde::de::Deserialize<'de> for Type {
17065 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17066 where
17067 D: serde::Deserializer<'de>,
17068 {
17069 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17070 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type",
17071 ))
17072 }
17073 }
17074 }
17075
17076 /// Enum State defines possible states of VMware Engine network.
17077 ///
17078 /// # Working with unknown values
17079 ///
17080 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17081 /// additional enum variants at any time. Adding new variants is not considered
17082 /// a breaking change. Applications should write their code in anticipation of:
17083 ///
17084 /// - New values appearing in future releases of the client library, **and**
17085 /// - New values received dynamically, without application changes.
17086 ///
17087 /// Please consult the [Working with enums] section in the user guide for some
17088 /// guidelines.
17089 ///
17090 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17091 #[derive(Clone, Debug, PartialEq)]
17092 #[non_exhaustive]
17093 pub enum State {
17094 /// The default value. This value is used if the state is omitted.
17095 Unspecified,
17096 /// The VMware Engine network is being created.
17097 Creating,
17098 /// The VMware Engine network is ready.
17099 Active,
17100 /// The VMware Engine network is being updated.
17101 Updating,
17102 /// The VMware Engine network is being deleted.
17103 Deleting,
17104 /// If set, the enum was initialized with an unknown value.
17105 ///
17106 /// Applications can examine the value using [State::value] or
17107 /// [State::name].
17108 UnknownValue(state::UnknownValue),
17109 }
17110
17111 #[doc(hidden)]
17112 pub mod state {
17113 #[allow(unused_imports)]
17114 use super::*;
17115 #[derive(Clone, Debug, PartialEq)]
17116 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17117 }
17118
17119 impl State {
17120 /// Gets the enum value.
17121 ///
17122 /// Returns `None` if the enum contains an unknown value deserialized from
17123 /// the string representation of enums.
17124 pub fn value(&self) -> std::option::Option<i32> {
17125 match self {
17126 Self::Unspecified => std::option::Option::Some(0),
17127 Self::Creating => std::option::Option::Some(1),
17128 Self::Active => std::option::Option::Some(2),
17129 Self::Updating => std::option::Option::Some(3),
17130 Self::Deleting => std::option::Option::Some(4),
17131 Self::UnknownValue(u) => u.0.value(),
17132 }
17133 }
17134
17135 /// Gets the enum value as a string.
17136 ///
17137 /// Returns `None` if the enum contains an unknown value deserialized from
17138 /// the integer representation of enums.
17139 pub fn name(&self) -> std::option::Option<&str> {
17140 match self {
17141 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17142 Self::Creating => std::option::Option::Some("CREATING"),
17143 Self::Active => std::option::Option::Some("ACTIVE"),
17144 Self::Updating => std::option::Option::Some("UPDATING"),
17145 Self::Deleting => std::option::Option::Some("DELETING"),
17146 Self::UnknownValue(u) => u.0.name(),
17147 }
17148 }
17149 }
17150
17151 impl std::default::Default for State {
17152 fn default() -> Self {
17153 use std::convert::From;
17154 Self::from(0)
17155 }
17156 }
17157
17158 impl std::fmt::Display for State {
17159 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17160 wkt::internal::display_enum(f, self.name(), self.value())
17161 }
17162 }
17163
17164 impl std::convert::From<i32> for State {
17165 fn from(value: i32) -> Self {
17166 match value {
17167 0 => Self::Unspecified,
17168 1 => Self::Creating,
17169 2 => Self::Active,
17170 3 => Self::Updating,
17171 4 => Self::Deleting,
17172 _ => Self::UnknownValue(state::UnknownValue(
17173 wkt::internal::UnknownEnumValue::Integer(value),
17174 )),
17175 }
17176 }
17177 }
17178
17179 impl std::convert::From<&str> for State {
17180 fn from(value: &str) -> Self {
17181 use std::string::ToString;
17182 match value {
17183 "STATE_UNSPECIFIED" => Self::Unspecified,
17184 "CREATING" => Self::Creating,
17185 "ACTIVE" => Self::Active,
17186 "UPDATING" => Self::Updating,
17187 "DELETING" => Self::Deleting,
17188 _ => Self::UnknownValue(state::UnknownValue(
17189 wkt::internal::UnknownEnumValue::String(value.to_string()),
17190 )),
17191 }
17192 }
17193 }
17194
17195 impl serde::ser::Serialize for State {
17196 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17197 where
17198 S: serde::Serializer,
17199 {
17200 match self {
17201 Self::Unspecified => serializer.serialize_i32(0),
17202 Self::Creating => serializer.serialize_i32(1),
17203 Self::Active => serializer.serialize_i32(2),
17204 Self::Updating => serializer.serialize_i32(3),
17205 Self::Deleting => serializer.serialize_i32(4),
17206 Self::UnknownValue(u) => u.0.serialize(serializer),
17207 }
17208 }
17209 }
17210
17211 impl<'de> serde::de::Deserialize<'de> for State {
17212 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17213 where
17214 D: serde::Deserializer<'de>,
17215 {
17216 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17217 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.State",
17218 ))
17219 }
17220 }
17221
17222 /// Enum Type defines possible types of VMware Engine network.
17223 ///
17224 /// # Working with unknown values
17225 ///
17226 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17227 /// additional enum variants at any time. Adding new variants is not considered
17228 /// a breaking change. Applications should write their code in anticipation of:
17229 ///
17230 /// - New values appearing in future releases of the client library, **and**
17231 /// - New values received dynamically, without application changes.
17232 ///
17233 /// Please consult the [Working with enums] section in the user guide for some
17234 /// guidelines.
17235 ///
17236 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17237 #[derive(Clone, Debug, PartialEq)]
17238 #[non_exhaustive]
17239 pub enum Type {
17240 /// The default value. This value should never be used.
17241 Unspecified,
17242 /// Network type used by private clouds created in projects without a network
17243 /// of type `STANDARD`. This network type is no longer used for new VMware
17244 /// Engine private cloud deployments.
17245 Legacy,
17246 /// Standard network type used for private cloud connectivity.
17247 Standard,
17248 /// If set, the enum was initialized with an unknown value.
17249 ///
17250 /// Applications can examine the value using [Type::value] or
17251 /// [Type::name].
17252 UnknownValue(r#type::UnknownValue),
17253 }
17254
17255 #[doc(hidden)]
17256 pub mod r#type {
17257 #[allow(unused_imports)]
17258 use super::*;
17259 #[derive(Clone, Debug, PartialEq)]
17260 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17261 }
17262
17263 impl Type {
17264 /// Gets the enum value.
17265 ///
17266 /// Returns `None` if the enum contains an unknown value deserialized from
17267 /// the string representation of enums.
17268 pub fn value(&self) -> std::option::Option<i32> {
17269 match self {
17270 Self::Unspecified => std::option::Option::Some(0),
17271 Self::Legacy => std::option::Option::Some(1),
17272 Self::Standard => std::option::Option::Some(2),
17273 Self::UnknownValue(u) => u.0.value(),
17274 }
17275 }
17276
17277 /// Gets the enum value as a string.
17278 ///
17279 /// Returns `None` if the enum contains an unknown value deserialized from
17280 /// the integer representation of enums.
17281 pub fn name(&self) -> std::option::Option<&str> {
17282 match self {
17283 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17284 Self::Legacy => std::option::Option::Some("LEGACY"),
17285 Self::Standard => std::option::Option::Some("STANDARD"),
17286 Self::UnknownValue(u) => u.0.name(),
17287 }
17288 }
17289 }
17290
17291 impl std::default::Default for Type {
17292 fn default() -> Self {
17293 use std::convert::From;
17294 Self::from(0)
17295 }
17296 }
17297
17298 impl std::fmt::Display for Type {
17299 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17300 wkt::internal::display_enum(f, self.name(), self.value())
17301 }
17302 }
17303
17304 impl std::convert::From<i32> for Type {
17305 fn from(value: i32) -> Self {
17306 match value {
17307 0 => Self::Unspecified,
17308 1 => Self::Legacy,
17309 2 => Self::Standard,
17310 _ => Self::UnknownValue(r#type::UnknownValue(
17311 wkt::internal::UnknownEnumValue::Integer(value),
17312 )),
17313 }
17314 }
17315 }
17316
17317 impl std::convert::From<&str> for Type {
17318 fn from(value: &str) -> Self {
17319 use std::string::ToString;
17320 match value {
17321 "TYPE_UNSPECIFIED" => Self::Unspecified,
17322 "LEGACY" => Self::Legacy,
17323 "STANDARD" => Self::Standard,
17324 _ => Self::UnknownValue(r#type::UnknownValue(
17325 wkt::internal::UnknownEnumValue::String(value.to_string()),
17326 )),
17327 }
17328 }
17329 }
17330
17331 impl serde::ser::Serialize for Type {
17332 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17333 where
17334 S: serde::Serializer,
17335 {
17336 match self {
17337 Self::Unspecified => serializer.serialize_i32(0),
17338 Self::Legacy => serializer.serialize_i32(1),
17339 Self::Standard => serializer.serialize_i32(2),
17340 Self::UnknownValue(u) => u.0.serialize(serializer),
17341 }
17342 }
17343 }
17344
17345 impl<'de> serde::de::Deserialize<'de> for Type {
17346 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17347 where
17348 D: serde::Deserializer<'de>,
17349 {
17350 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17351 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type",
17352 ))
17353 }
17354 }
17355}
17356
17357/// Private connection resource that provides connectivity for VMware Engine
17358/// private clouds.
17359#[derive(Clone, Default, PartialEq)]
17360#[non_exhaustive]
17361pub struct PrivateConnection {
17362 /// Output only. The resource name of the private connection.
17363 /// Resource names are schemeless URIs that follow the conventions in
17364 /// <https://cloud.google.com/apis/design/resource_names>.
17365 /// For example:
17366 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
17367 pub name: std::string::String,
17368
17369 /// Output only. Creation time of this resource.
17370 pub create_time: std::option::Option<wkt::Timestamp>,
17371
17372 /// Output only. Last update time of this resource.
17373 pub update_time: std::option::Option<wkt::Timestamp>,
17374
17375 /// Optional. User-provided description for this private connection.
17376 pub description: std::string::String,
17377
17378 /// Output only. State of the private connection.
17379 pub state: crate::model::private_connection::State,
17380
17381 /// Required. The relative resource name of Legacy VMware Engine network.
17382 /// Specify the name in the following form:
17383 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17384 /// where `{project}`, `{location}` will be same as specified in private
17385 /// connection resource name and `{vmware_engine_network_id}` will be in the
17386 /// form of `{location}`-default e.g.
17387 /// projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
17388 pub vmware_engine_network: std::string::String,
17389
17390 /// Output only. The canonical name of the VMware Engine network in the form:
17391 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17392 pub vmware_engine_network_canonical: std::string::String,
17393
17394 /// Required. Private connection type.
17395 pub r#type: crate::model::private_connection::Type,
17396
17397 /// Output only. VPC network peering id between given network VPC and
17398 /// VMwareEngineNetwork.
17399 pub peering_id: std::string::String,
17400
17401 /// Optional. Routing Mode.
17402 /// Default value is set to GLOBAL.
17403 /// For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or
17404 /// REGIONAL, for other types only GLOBAL is supported.
17405 pub routing_mode: crate::model::private_connection::RoutingMode,
17406
17407 /// Output only. System-generated unique identifier for the resource.
17408 pub uid: std::string::String,
17409
17410 /// Required. Service network to create private connection.
17411 /// Specify the name in the following form:
17412 /// `projects/{project}/global/networks/{network_id}`
17413 /// For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
17414 /// VPC, e.g. projects/project-tp/global/networks/servicenetworking.
17415 /// For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
17416 /// e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
17417 /// For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
17418 /// projects/project-tp/global/networks/dell-tenant-vpc.
17419 /// For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
17420 /// any other producer VPC to which the VMware Engine Network needs to be
17421 /// connected, e.g. projects/project/global/networks/vpc.
17422 pub service_network: std::string::String,
17423
17424 /// Output only. Peering state between service network and VMware Engine
17425 /// network.
17426 pub peering_state: crate::model::private_connection::PeeringState,
17427
17428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17429}
17430
17431impl PrivateConnection {
17432 pub fn new() -> Self {
17433 std::default::Default::default()
17434 }
17435
17436 /// Sets the value of [name][crate::model::PrivateConnection::name].
17437 ///
17438 /// # Example
17439 /// ```ignore,no_run
17440 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17441 /// let x = PrivateConnection::new().set_name("example");
17442 /// ```
17443 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17444 self.name = v.into();
17445 self
17446 }
17447
17448 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
17449 ///
17450 /// # Example
17451 /// ```ignore,no_run
17452 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17453 /// use wkt::Timestamp;
17454 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
17455 /// ```
17456 pub fn set_create_time<T>(mut self, v: T) -> Self
17457 where
17458 T: std::convert::Into<wkt::Timestamp>,
17459 {
17460 self.create_time = std::option::Option::Some(v.into());
17461 self
17462 }
17463
17464 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
17465 ///
17466 /// # Example
17467 /// ```ignore,no_run
17468 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17469 /// use wkt::Timestamp;
17470 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17471 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
17472 /// ```
17473 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17474 where
17475 T: std::convert::Into<wkt::Timestamp>,
17476 {
17477 self.create_time = v.map(|x| x.into());
17478 self
17479 }
17480
17481 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
17482 ///
17483 /// # Example
17484 /// ```ignore,no_run
17485 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17486 /// use wkt::Timestamp;
17487 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
17488 /// ```
17489 pub fn set_update_time<T>(mut self, v: T) -> Self
17490 where
17491 T: std::convert::Into<wkt::Timestamp>,
17492 {
17493 self.update_time = std::option::Option::Some(v.into());
17494 self
17495 }
17496
17497 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
17498 ///
17499 /// # Example
17500 /// ```ignore,no_run
17501 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17502 /// use wkt::Timestamp;
17503 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17504 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
17505 /// ```
17506 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17507 where
17508 T: std::convert::Into<wkt::Timestamp>,
17509 {
17510 self.update_time = v.map(|x| x.into());
17511 self
17512 }
17513
17514 /// Sets the value of [description][crate::model::PrivateConnection::description].
17515 ///
17516 /// # Example
17517 /// ```ignore,no_run
17518 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17519 /// let x = PrivateConnection::new().set_description("example");
17520 /// ```
17521 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17522 self.description = v.into();
17523 self
17524 }
17525
17526 /// Sets the value of [state][crate::model::PrivateConnection::state].
17527 ///
17528 /// # Example
17529 /// ```ignore,no_run
17530 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17531 /// use google_cloud_vmwareengine_v1::model::private_connection::State;
17532 /// let x0 = PrivateConnection::new().set_state(State::Creating);
17533 /// let x1 = PrivateConnection::new().set_state(State::Active);
17534 /// let x2 = PrivateConnection::new().set_state(State::Updating);
17535 /// ```
17536 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
17537 mut self,
17538 v: T,
17539 ) -> Self {
17540 self.state = v.into();
17541 self
17542 }
17543
17544 /// Sets the value of [vmware_engine_network][crate::model::PrivateConnection::vmware_engine_network].
17545 ///
17546 /// # Example
17547 /// ```ignore,no_run
17548 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17549 /// let x = PrivateConnection::new().set_vmware_engine_network("example");
17550 /// ```
17551 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
17552 mut self,
17553 v: T,
17554 ) -> Self {
17555 self.vmware_engine_network = v.into();
17556 self
17557 }
17558
17559 /// Sets the value of [vmware_engine_network_canonical][crate::model::PrivateConnection::vmware_engine_network_canonical].
17560 ///
17561 /// # Example
17562 /// ```ignore,no_run
17563 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17564 /// let x = PrivateConnection::new().set_vmware_engine_network_canonical("example");
17565 /// ```
17566 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
17567 mut self,
17568 v: T,
17569 ) -> Self {
17570 self.vmware_engine_network_canonical = v.into();
17571 self
17572 }
17573
17574 /// Sets the value of [r#type][crate::model::PrivateConnection::type].
17575 ///
17576 /// # Example
17577 /// ```ignore,no_run
17578 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17579 /// use google_cloud_vmwareengine_v1::model::private_connection::Type;
17580 /// let x0 = PrivateConnection::new().set_type(Type::PrivateServiceAccess);
17581 /// let x1 = PrivateConnection::new().set_type(Type::NetappCloudVolumes);
17582 /// let x2 = PrivateConnection::new().set_type(Type::DellPowerscale);
17583 /// ```
17584 pub fn set_type<T: std::convert::Into<crate::model::private_connection::Type>>(
17585 mut self,
17586 v: T,
17587 ) -> Self {
17588 self.r#type = v.into();
17589 self
17590 }
17591
17592 /// Sets the value of [peering_id][crate::model::PrivateConnection::peering_id].
17593 ///
17594 /// # Example
17595 /// ```ignore,no_run
17596 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17597 /// let x = PrivateConnection::new().set_peering_id("example");
17598 /// ```
17599 pub fn set_peering_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17600 self.peering_id = v.into();
17601 self
17602 }
17603
17604 /// Sets the value of [routing_mode][crate::model::PrivateConnection::routing_mode].
17605 ///
17606 /// # Example
17607 /// ```ignore,no_run
17608 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17609 /// use google_cloud_vmwareengine_v1::model::private_connection::RoutingMode;
17610 /// let x0 = PrivateConnection::new().set_routing_mode(RoutingMode::Global);
17611 /// let x1 = PrivateConnection::new().set_routing_mode(RoutingMode::Regional);
17612 /// ```
17613 pub fn set_routing_mode<
17614 T: std::convert::Into<crate::model::private_connection::RoutingMode>,
17615 >(
17616 mut self,
17617 v: T,
17618 ) -> Self {
17619 self.routing_mode = v.into();
17620 self
17621 }
17622
17623 /// Sets the value of [uid][crate::model::PrivateConnection::uid].
17624 ///
17625 /// # Example
17626 /// ```ignore,no_run
17627 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17628 /// let x = PrivateConnection::new().set_uid("example");
17629 /// ```
17630 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17631 self.uid = v.into();
17632 self
17633 }
17634
17635 /// Sets the value of [service_network][crate::model::PrivateConnection::service_network].
17636 ///
17637 /// # Example
17638 /// ```ignore,no_run
17639 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17640 /// let x = PrivateConnection::new().set_service_network("example");
17641 /// ```
17642 pub fn set_service_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17643 self.service_network = v.into();
17644 self
17645 }
17646
17647 /// Sets the value of [peering_state][crate::model::PrivateConnection::peering_state].
17648 ///
17649 /// # Example
17650 /// ```ignore,no_run
17651 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17652 /// use google_cloud_vmwareengine_v1::model::private_connection::PeeringState;
17653 /// let x0 = PrivateConnection::new().set_peering_state(PeeringState::PeeringActive);
17654 /// let x1 = PrivateConnection::new().set_peering_state(PeeringState::PeeringInactive);
17655 /// ```
17656 pub fn set_peering_state<
17657 T: std::convert::Into<crate::model::private_connection::PeeringState>,
17658 >(
17659 mut self,
17660 v: T,
17661 ) -> Self {
17662 self.peering_state = v.into();
17663 self
17664 }
17665}
17666
17667impl wkt::message::Message for PrivateConnection {
17668 fn typename() -> &'static str {
17669 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateConnection"
17670 }
17671}
17672
17673/// Defines additional types related to [PrivateConnection].
17674pub mod private_connection {
17675 #[allow(unused_imports)]
17676 use super::*;
17677
17678 /// Enum State defines possible states of private connection.
17679 ///
17680 /// # Working with unknown values
17681 ///
17682 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17683 /// additional enum variants at any time. Adding new variants is not considered
17684 /// a breaking change. Applications should write their code in anticipation of:
17685 ///
17686 /// - New values appearing in future releases of the client library, **and**
17687 /// - New values received dynamically, without application changes.
17688 ///
17689 /// Please consult the [Working with enums] section in the user guide for some
17690 /// guidelines.
17691 ///
17692 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17693 #[derive(Clone, Debug, PartialEq)]
17694 #[non_exhaustive]
17695 pub enum State {
17696 /// The default value. This value is used if the state is omitted.
17697 Unspecified,
17698 /// The private connection is being created.
17699 Creating,
17700 /// The private connection is ready.
17701 Active,
17702 /// The private connection is being updated.
17703 Updating,
17704 /// The private connection is being deleted.
17705 Deleting,
17706 /// The private connection is not provisioned, since no private cloud is
17707 /// present for which this private connection is needed.
17708 Unprovisioned,
17709 /// The private connection is in failed state.
17710 Failed,
17711 /// If set, the enum was initialized with an unknown value.
17712 ///
17713 /// Applications can examine the value using [State::value] or
17714 /// [State::name].
17715 UnknownValue(state::UnknownValue),
17716 }
17717
17718 #[doc(hidden)]
17719 pub mod state {
17720 #[allow(unused_imports)]
17721 use super::*;
17722 #[derive(Clone, Debug, PartialEq)]
17723 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17724 }
17725
17726 impl State {
17727 /// Gets the enum value.
17728 ///
17729 /// Returns `None` if the enum contains an unknown value deserialized from
17730 /// the string representation of enums.
17731 pub fn value(&self) -> std::option::Option<i32> {
17732 match self {
17733 Self::Unspecified => std::option::Option::Some(0),
17734 Self::Creating => std::option::Option::Some(1),
17735 Self::Active => std::option::Option::Some(2),
17736 Self::Updating => std::option::Option::Some(3),
17737 Self::Deleting => std::option::Option::Some(4),
17738 Self::Unprovisioned => std::option::Option::Some(5),
17739 Self::Failed => std::option::Option::Some(6),
17740 Self::UnknownValue(u) => u.0.value(),
17741 }
17742 }
17743
17744 /// Gets the enum value as a string.
17745 ///
17746 /// Returns `None` if the enum contains an unknown value deserialized from
17747 /// the integer representation of enums.
17748 pub fn name(&self) -> std::option::Option<&str> {
17749 match self {
17750 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17751 Self::Creating => std::option::Option::Some("CREATING"),
17752 Self::Active => std::option::Option::Some("ACTIVE"),
17753 Self::Updating => std::option::Option::Some("UPDATING"),
17754 Self::Deleting => std::option::Option::Some("DELETING"),
17755 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
17756 Self::Failed => std::option::Option::Some("FAILED"),
17757 Self::UnknownValue(u) => u.0.name(),
17758 }
17759 }
17760 }
17761
17762 impl std::default::Default for State {
17763 fn default() -> Self {
17764 use std::convert::From;
17765 Self::from(0)
17766 }
17767 }
17768
17769 impl std::fmt::Display for State {
17770 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17771 wkt::internal::display_enum(f, self.name(), self.value())
17772 }
17773 }
17774
17775 impl std::convert::From<i32> for State {
17776 fn from(value: i32) -> Self {
17777 match value {
17778 0 => Self::Unspecified,
17779 1 => Self::Creating,
17780 2 => Self::Active,
17781 3 => Self::Updating,
17782 4 => Self::Deleting,
17783 5 => Self::Unprovisioned,
17784 6 => Self::Failed,
17785 _ => Self::UnknownValue(state::UnknownValue(
17786 wkt::internal::UnknownEnumValue::Integer(value),
17787 )),
17788 }
17789 }
17790 }
17791
17792 impl std::convert::From<&str> for State {
17793 fn from(value: &str) -> Self {
17794 use std::string::ToString;
17795 match value {
17796 "STATE_UNSPECIFIED" => Self::Unspecified,
17797 "CREATING" => Self::Creating,
17798 "ACTIVE" => Self::Active,
17799 "UPDATING" => Self::Updating,
17800 "DELETING" => Self::Deleting,
17801 "UNPROVISIONED" => Self::Unprovisioned,
17802 "FAILED" => Self::Failed,
17803 _ => Self::UnknownValue(state::UnknownValue(
17804 wkt::internal::UnknownEnumValue::String(value.to_string()),
17805 )),
17806 }
17807 }
17808 }
17809
17810 impl serde::ser::Serialize for State {
17811 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17812 where
17813 S: serde::Serializer,
17814 {
17815 match self {
17816 Self::Unspecified => serializer.serialize_i32(0),
17817 Self::Creating => serializer.serialize_i32(1),
17818 Self::Active => serializer.serialize_i32(2),
17819 Self::Updating => serializer.serialize_i32(3),
17820 Self::Deleting => serializer.serialize_i32(4),
17821 Self::Unprovisioned => serializer.serialize_i32(5),
17822 Self::Failed => serializer.serialize_i32(6),
17823 Self::UnknownValue(u) => u.0.serialize(serializer),
17824 }
17825 }
17826 }
17827
17828 impl<'de> serde::de::Deserialize<'de> for State {
17829 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17830 where
17831 D: serde::Deserializer<'de>,
17832 {
17833 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17834 ".google.cloud.vmwareengine.v1.PrivateConnection.State",
17835 ))
17836 }
17837 }
17838
17839 /// Enum Type defines possible types of private connection.
17840 ///
17841 /// # Working with unknown values
17842 ///
17843 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17844 /// additional enum variants at any time. Adding new variants is not considered
17845 /// a breaking change. Applications should write their code in anticipation of:
17846 ///
17847 /// - New values appearing in future releases of the client library, **and**
17848 /// - New values received dynamically, without application changes.
17849 ///
17850 /// Please consult the [Working with enums] section in the user guide for some
17851 /// guidelines.
17852 ///
17853 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17854 #[derive(Clone, Debug, PartialEq)]
17855 #[non_exhaustive]
17856 pub enum Type {
17857 /// The default value. This value should never be used.
17858 Unspecified,
17859 /// Connection used for establishing [private services
17860 /// access](https://cloud.google.com/vpc/docs/private-services-access).
17861 PrivateServiceAccess,
17862 /// Connection used for connecting to NetApp Cloud Volumes.
17863 NetappCloudVolumes,
17864 /// Connection used for connecting to Dell PowerScale.
17865 DellPowerscale,
17866 /// Connection used for connecting to third-party services.
17867 ThirdPartyService,
17868 /// If set, the enum was initialized with an unknown value.
17869 ///
17870 /// Applications can examine the value using [Type::value] or
17871 /// [Type::name].
17872 UnknownValue(r#type::UnknownValue),
17873 }
17874
17875 #[doc(hidden)]
17876 pub mod r#type {
17877 #[allow(unused_imports)]
17878 use super::*;
17879 #[derive(Clone, Debug, PartialEq)]
17880 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17881 }
17882
17883 impl Type {
17884 /// Gets the enum value.
17885 ///
17886 /// Returns `None` if the enum contains an unknown value deserialized from
17887 /// the string representation of enums.
17888 pub fn value(&self) -> std::option::Option<i32> {
17889 match self {
17890 Self::Unspecified => std::option::Option::Some(0),
17891 Self::PrivateServiceAccess => std::option::Option::Some(1),
17892 Self::NetappCloudVolumes => std::option::Option::Some(2),
17893 Self::DellPowerscale => std::option::Option::Some(3),
17894 Self::ThirdPartyService => std::option::Option::Some(4),
17895 Self::UnknownValue(u) => u.0.value(),
17896 }
17897 }
17898
17899 /// Gets the enum value as a string.
17900 ///
17901 /// Returns `None` if the enum contains an unknown value deserialized from
17902 /// the integer representation of enums.
17903 pub fn name(&self) -> std::option::Option<&str> {
17904 match self {
17905 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17906 Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
17907 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
17908 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
17909 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
17910 Self::UnknownValue(u) => u.0.name(),
17911 }
17912 }
17913 }
17914
17915 impl std::default::Default for Type {
17916 fn default() -> Self {
17917 use std::convert::From;
17918 Self::from(0)
17919 }
17920 }
17921
17922 impl std::fmt::Display for Type {
17923 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17924 wkt::internal::display_enum(f, self.name(), self.value())
17925 }
17926 }
17927
17928 impl std::convert::From<i32> for Type {
17929 fn from(value: i32) -> Self {
17930 match value {
17931 0 => Self::Unspecified,
17932 1 => Self::PrivateServiceAccess,
17933 2 => Self::NetappCloudVolumes,
17934 3 => Self::DellPowerscale,
17935 4 => Self::ThirdPartyService,
17936 _ => Self::UnknownValue(r#type::UnknownValue(
17937 wkt::internal::UnknownEnumValue::Integer(value),
17938 )),
17939 }
17940 }
17941 }
17942
17943 impl std::convert::From<&str> for Type {
17944 fn from(value: &str) -> Self {
17945 use std::string::ToString;
17946 match value {
17947 "TYPE_UNSPECIFIED" => Self::Unspecified,
17948 "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
17949 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
17950 "DELL_POWERSCALE" => Self::DellPowerscale,
17951 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
17952 _ => Self::UnknownValue(r#type::UnknownValue(
17953 wkt::internal::UnknownEnumValue::String(value.to_string()),
17954 )),
17955 }
17956 }
17957 }
17958
17959 impl serde::ser::Serialize for Type {
17960 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17961 where
17962 S: serde::Serializer,
17963 {
17964 match self {
17965 Self::Unspecified => serializer.serialize_i32(0),
17966 Self::PrivateServiceAccess => serializer.serialize_i32(1),
17967 Self::NetappCloudVolumes => serializer.serialize_i32(2),
17968 Self::DellPowerscale => serializer.serialize_i32(3),
17969 Self::ThirdPartyService => serializer.serialize_i32(4),
17970 Self::UnknownValue(u) => u.0.serialize(serializer),
17971 }
17972 }
17973 }
17974
17975 impl<'de> serde::de::Deserialize<'de> for Type {
17976 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17977 where
17978 D: serde::Deserializer<'de>,
17979 {
17980 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17981 ".google.cloud.vmwareengine.v1.PrivateConnection.Type",
17982 ))
17983 }
17984 }
17985
17986 /// Possible types for RoutingMode
17987 ///
17988 /// # Working with unknown values
17989 ///
17990 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17991 /// additional enum variants at any time. Adding new variants is not considered
17992 /// a breaking change. Applications should write their code in anticipation of:
17993 ///
17994 /// - New values appearing in future releases of the client library, **and**
17995 /// - New values received dynamically, without application changes.
17996 ///
17997 /// Please consult the [Working with enums] section in the user guide for some
17998 /// guidelines.
17999 ///
18000 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18001 #[derive(Clone, Debug, PartialEq)]
18002 #[non_exhaustive]
18003 pub enum RoutingMode {
18004 /// The default value. This value should never be used.
18005 Unspecified,
18006 /// Global Routing Mode
18007 Global,
18008 /// Regional Routing Mode
18009 Regional,
18010 /// If set, the enum was initialized with an unknown value.
18011 ///
18012 /// Applications can examine the value using [RoutingMode::value] or
18013 /// [RoutingMode::name].
18014 UnknownValue(routing_mode::UnknownValue),
18015 }
18016
18017 #[doc(hidden)]
18018 pub mod routing_mode {
18019 #[allow(unused_imports)]
18020 use super::*;
18021 #[derive(Clone, Debug, PartialEq)]
18022 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18023 }
18024
18025 impl RoutingMode {
18026 /// Gets the enum value.
18027 ///
18028 /// Returns `None` if the enum contains an unknown value deserialized from
18029 /// the string representation of enums.
18030 pub fn value(&self) -> std::option::Option<i32> {
18031 match self {
18032 Self::Unspecified => std::option::Option::Some(0),
18033 Self::Global => std::option::Option::Some(1),
18034 Self::Regional => std::option::Option::Some(2),
18035 Self::UnknownValue(u) => u.0.value(),
18036 }
18037 }
18038
18039 /// Gets the enum value as a string.
18040 ///
18041 /// Returns `None` if the enum contains an unknown value deserialized from
18042 /// the integer representation of enums.
18043 pub fn name(&self) -> std::option::Option<&str> {
18044 match self {
18045 Self::Unspecified => std::option::Option::Some("ROUTING_MODE_UNSPECIFIED"),
18046 Self::Global => std::option::Option::Some("GLOBAL"),
18047 Self::Regional => std::option::Option::Some("REGIONAL"),
18048 Self::UnknownValue(u) => u.0.name(),
18049 }
18050 }
18051 }
18052
18053 impl std::default::Default for RoutingMode {
18054 fn default() -> Self {
18055 use std::convert::From;
18056 Self::from(0)
18057 }
18058 }
18059
18060 impl std::fmt::Display for RoutingMode {
18061 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18062 wkt::internal::display_enum(f, self.name(), self.value())
18063 }
18064 }
18065
18066 impl std::convert::From<i32> for RoutingMode {
18067 fn from(value: i32) -> Self {
18068 match value {
18069 0 => Self::Unspecified,
18070 1 => Self::Global,
18071 2 => Self::Regional,
18072 _ => Self::UnknownValue(routing_mode::UnknownValue(
18073 wkt::internal::UnknownEnumValue::Integer(value),
18074 )),
18075 }
18076 }
18077 }
18078
18079 impl std::convert::From<&str> for RoutingMode {
18080 fn from(value: &str) -> Self {
18081 use std::string::ToString;
18082 match value {
18083 "ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
18084 "GLOBAL" => Self::Global,
18085 "REGIONAL" => Self::Regional,
18086 _ => Self::UnknownValue(routing_mode::UnknownValue(
18087 wkt::internal::UnknownEnumValue::String(value.to_string()),
18088 )),
18089 }
18090 }
18091 }
18092
18093 impl serde::ser::Serialize for RoutingMode {
18094 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18095 where
18096 S: serde::Serializer,
18097 {
18098 match self {
18099 Self::Unspecified => serializer.serialize_i32(0),
18100 Self::Global => serializer.serialize_i32(1),
18101 Self::Regional => serializer.serialize_i32(2),
18102 Self::UnknownValue(u) => u.0.serialize(serializer),
18103 }
18104 }
18105 }
18106
18107 impl<'de> serde::de::Deserialize<'de> for RoutingMode {
18108 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18109 where
18110 D: serde::Deserializer<'de>,
18111 {
18112 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingMode>::new(
18113 ".google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode",
18114 ))
18115 }
18116 }
18117
18118 /// Enum PeeringState defines the possible states of peering between service
18119 /// network and the vpc network peered to service network
18120 ///
18121 /// # Working with unknown values
18122 ///
18123 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18124 /// additional enum variants at any time. Adding new variants is not considered
18125 /// a breaking change. Applications should write their code in anticipation of:
18126 ///
18127 /// - New values appearing in future releases of the client library, **and**
18128 /// - New values received dynamically, without application changes.
18129 ///
18130 /// Please consult the [Working with enums] section in the user guide for some
18131 /// guidelines.
18132 ///
18133 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18134 #[derive(Clone, Debug, PartialEq)]
18135 #[non_exhaustive]
18136 pub enum PeeringState {
18137 /// The default value. This value is used if the peering state is omitted or
18138 /// unknown.
18139 Unspecified,
18140 /// The peering is in active state.
18141 PeeringActive,
18142 /// The peering is in inactive state.
18143 PeeringInactive,
18144 /// If set, the enum was initialized with an unknown value.
18145 ///
18146 /// Applications can examine the value using [PeeringState::value] or
18147 /// [PeeringState::name].
18148 UnknownValue(peering_state::UnknownValue),
18149 }
18150
18151 #[doc(hidden)]
18152 pub mod peering_state {
18153 #[allow(unused_imports)]
18154 use super::*;
18155 #[derive(Clone, Debug, PartialEq)]
18156 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18157 }
18158
18159 impl PeeringState {
18160 /// Gets the enum value.
18161 ///
18162 /// Returns `None` if the enum contains an unknown value deserialized from
18163 /// the string representation of enums.
18164 pub fn value(&self) -> std::option::Option<i32> {
18165 match self {
18166 Self::Unspecified => std::option::Option::Some(0),
18167 Self::PeeringActive => std::option::Option::Some(1),
18168 Self::PeeringInactive => std::option::Option::Some(2),
18169 Self::UnknownValue(u) => u.0.value(),
18170 }
18171 }
18172
18173 /// Gets the enum value as a string.
18174 ///
18175 /// Returns `None` if the enum contains an unknown value deserialized from
18176 /// the integer representation of enums.
18177 pub fn name(&self) -> std::option::Option<&str> {
18178 match self {
18179 Self::Unspecified => std::option::Option::Some("PEERING_STATE_UNSPECIFIED"),
18180 Self::PeeringActive => std::option::Option::Some("PEERING_ACTIVE"),
18181 Self::PeeringInactive => std::option::Option::Some("PEERING_INACTIVE"),
18182 Self::UnknownValue(u) => u.0.name(),
18183 }
18184 }
18185 }
18186
18187 impl std::default::Default for PeeringState {
18188 fn default() -> Self {
18189 use std::convert::From;
18190 Self::from(0)
18191 }
18192 }
18193
18194 impl std::fmt::Display for PeeringState {
18195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18196 wkt::internal::display_enum(f, self.name(), self.value())
18197 }
18198 }
18199
18200 impl std::convert::From<i32> for PeeringState {
18201 fn from(value: i32) -> Self {
18202 match value {
18203 0 => Self::Unspecified,
18204 1 => Self::PeeringActive,
18205 2 => Self::PeeringInactive,
18206 _ => Self::UnknownValue(peering_state::UnknownValue(
18207 wkt::internal::UnknownEnumValue::Integer(value),
18208 )),
18209 }
18210 }
18211 }
18212
18213 impl std::convert::From<&str> for PeeringState {
18214 fn from(value: &str) -> Self {
18215 use std::string::ToString;
18216 match value {
18217 "PEERING_STATE_UNSPECIFIED" => Self::Unspecified,
18218 "PEERING_ACTIVE" => Self::PeeringActive,
18219 "PEERING_INACTIVE" => Self::PeeringInactive,
18220 _ => Self::UnknownValue(peering_state::UnknownValue(
18221 wkt::internal::UnknownEnumValue::String(value.to_string()),
18222 )),
18223 }
18224 }
18225 }
18226
18227 impl serde::ser::Serialize for PeeringState {
18228 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18229 where
18230 S: serde::Serializer,
18231 {
18232 match self {
18233 Self::Unspecified => serializer.serialize_i32(0),
18234 Self::PeeringActive => serializer.serialize_i32(1),
18235 Self::PeeringInactive => serializer.serialize_i32(2),
18236 Self::UnknownValue(u) => u.0.serialize(serializer),
18237 }
18238 }
18239 }
18240
18241 impl<'de> serde::de::Deserialize<'de> for PeeringState {
18242 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18243 where
18244 D: serde::Deserializer<'de>,
18245 {
18246 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeeringState>::new(
18247 ".google.cloud.vmwareengine.v1.PrivateConnection.PeeringState",
18248 ))
18249 }
18250 }
18251}
18252
18253/// VmwareEngine specific metadata for the given
18254/// [google.cloud.location.Location][google.cloud.location.Location]. It is
18255/// returned as a content of the `google.cloud.location.Location.metadata` field.
18256///
18257/// [google.cloud.location.Location]: location::model::Location
18258#[derive(Clone, Default, PartialEq)]
18259#[non_exhaustive]
18260pub struct LocationMetadata {
18261 /// Output only. Capabilities of this location.
18262 pub capabilities: std::vec::Vec<crate::model::location_metadata::Capability>,
18263
18264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18265}
18266
18267impl LocationMetadata {
18268 pub fn new() -> Self {
18269 std::default::Default::default()
18270 }
18271
18272 /// Sets the value of [capabilities][crate::model::LocationMetadata::capabilities].
18273 ///
18274 /// # Example
18275 /// ```ignore,no_run
18276 /// # use google_cloud_vmwareengine_v1::model::LocationMetadata;
18277 /// use google_cloud_vmwareengine_v1::model::location_metadata::Capability;
18278 /// let x = LocationMetadata::new().set_capabilities([
18279 /// Capability::StretchedClusters,
18280 /// ]);
18281 /// ```
18282 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
18283 where
18284 T: std::iter::IntoIterator<Item = V>,
18285 V: std::convert::Into<crate::model::location_metadata::Capability>,
18286 {
18287 use std::iter::Iterator;
18288 self.capabilities = v.into_iter().map(|i| i.into()).collect();
18289 self
18290 }
18291}
18292
18293impl wkt::message::Message for LocationMetadata {
18294 fn typename() -> &'static str {
18295 "type.googleapis.com/google.cloud.vmwareengine.v1.LocationMetadata"
18296 }
18297}
18298
18299/// Defines additional types related to [LocationMetadata].
18300pub mod location_metadata {
18301 #[allow(unused_imports)]
18302 use super::*;
18303
18304 /// Capability of a location.
18305 ///
18306 /// # Working with unknown values
18307 ///
18308 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18309 /// additional enum variants at any time. Adding new variants is not considered
18310 /// a breaking change. Applications should write their code in anticipation of:
18311 ///
18312 /// - New values appearing in future releases of the client library, **and**
18313 /// - New values received dynamically, without application changes.
18314 ///
18315 /// Please consult the [Working with enums] section in the user guide for some
18316 /// guidelines.
18317 ///
18318 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18319 #[derive(Clone, Debug, PartialEq)]
18320 #[non_exhaustive]
18321 pub enum Capability {
18322 /// The default value. This value is used if the capability is omitted or
18323 /// unknown.
18324 Unspecified,
18325 /// Stretch clusters are supported in this location.
18326 StretchedClusters,
18327 /// If set, the enum was initialized with an unknown value.
18328 ///
18329 /// Applications can examine the value using [Capability::value] or
18330 /// [Capability::name].
18331 UnknownValue(capability::UnknownValue),
18332 }
18333
18334 #[doc(hidden)]
18335 pub mod capability {
18336 #[allow(unused_imports)]
18337 use super::*;
18338 #[derive(Clone, Debug, PartialEq)]
18339 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18340 }
18341
18342 impl Capability {
18343 /// Gets the enum value.
18344 ///
18345 /// Returns `None` if the enum contains an unknown value deserialized from
18346 /// the string representation of enums.
18347 pub fn value(&self) -> std::option::Option<i32> {
18348 match self {
18349 Self::Unspecified => std::option::Option::Some(0),
18350 Self::StretchedClusters => std::option::Option::Some(1),
18351 Self::UnknownValue(u) => u.0.value(),
18352 }
18353 }
18354
18355 /// Gets the enum value as a string.
18356 ///
18357 /// Returns `None` if the enum contains an unknown value deserialized from
18358 /// the integer representation of enums.
18359 pub fn name(&self) -> std::option::Option<&str> {
18360 match self {
18361 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
18362 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
18363 Self::UnknownValue(u) => u.0.name(),
18364 }
18365 }
18366 }
18367
18368 impl std::default::Default for Capability {
18369 fn default() -> Self {
18370 use std::convert::From;
18371 Self::from(0)
18372 }
18373 }
18374
18375 impl std::fmt::Display for Capability {
18376 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18377 wkt::internal::display_enum(f, self.name(), self.value())
18378 }
18379 }
18380
18381 impl std::convert::From<i32> for Capability {
18382 fn from(value: i32) -> Self {
18383 match value {
18384 0 => Self::Unspecified,
18385 1 => Self::StretchedClusters,
18386 _ => Self::UnknownValue(capability::UnknownValue(
18387 wkt::internal::UnknownEnumValue::Integer(value),
18388 )),
18389 }
18390 }
18391 }
18392
18393 impl std::convert::From<&str> for Capability {
18394 fn from(value: &str) -> Self {
18395 use std::string::ToString;
18396 match value {
18397 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
18398 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
18399 _ => Self::UnknownValue(capability::UnknownValue(
18400 wkt::internal::UnknownEnumValue::String(value.to_string()),
18401 )),
18402 }
18403 }
18404 }
18405
18406 impl serde::ser::Serialize for Capability {
18407 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18408 where
18409 S: serde::Serializer,
18410 {
18411 match self {
18412 Self::Unspecified => serializer.serialize_i32(0),
18413 Self::StretchedClusters => serializer.serialize_i32(1),
18414 Self::UnknownValue(u) => u.0.serialize(serializer),
18415 }
18416 }
18417 }
18418
18419 impl<'de> serde::de::Deserialize<'de> for Capability {
18420 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18421 where
18422 D: serde::Deserializer<'de>,
18423 {
18424 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
18425 ".google.cloud.vmwareengine.v1.LocationMetadata.Capability",
18426 ))
18427 }
18428 }
18429}
18430
18431/// DnsBindPermission resource that contains the accounts having the consumer DNS
18432/// bind permission on the corresponding intranet VPC of the consumer project.
18433#[derive(Clone, Default, PartialEq)]
18434#[non_exhaustive]
18435pub struct DnsBindPermission {
18436 /// Required. Output only. The name of the resource which stores the
18437 /// users/service accounts having the permission to bind to the corresponding
18438 /// intranet VPC of the consumer project. DnsBindPermission is a global
18439 /// resource and location can only be global. Resource names are schemeless
18440 /// URIs that follow the conventions in
18441 /// <https://cloud.google.com/apis/design/resource_names>. For example:
18442 /// `projects/my-project/locations/global/dnsBindPermission`
18443 pub name: std::string::String,
18444
18445 /// Output only. Users/Service accounts which have access for binding on the
18446 /// intranet VPC project corresponding to the consumer project.
18447 pub principals: std::vec::Vec<crate::model::Principal>,
18448
18449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18450}
18451
18452impl DnsBindPermission {
18453 pub fn new() -> Self {
18454 std::default::Default::default()
18455 }
18456
18457 /// Sets the value of [name][crate::model::DnsBindPermission::name].
18458 ///
18459 /// # Example
18460 /// ```ignore,no_run
18461 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18462 /// let x = DnsBindPermission::new().set_name("example");
18463 /// ```
18464 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18465 self.name = v.into();
18466 self
18467 }
18468
18469 /// Sets the value of [principals][crate::model::DnsBindPermission::principals].
18470 ///
18471 /// # Example
18472 /// ```ignore,no_run
18473 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18474 /// use google_cloud_vmwareengine_v1::model::Principal;
18475 /// let x = DnsBindPermission::new()
18476 /// .set_principals([
18477 /// Principal::default()/* use setters */,
18478 /// Principal::default()/* use (different) setters */,
18479 /// ]);
18480 /// ```
18481 pub fn set_principals<T, V>(mut self, v: T) -> Self
18482 where
18483 T: std::iter::IntoIterator<Item = V>,
18484 V: std::convert::Into<crate::model::Principal>,
18485 {
18486 use std::iter::Iterator;
18487 self.principals = v.into_iter().map(|i| i.into()).collect();
18488 self
18489 }
18490}
18491
18492impl wkt::message::Message for DnsBindPermission {
18493 fn typename() -> &'static str {
18494 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsBindPermission"
18495 }
18496}
18497
18498/// Users/Service accounts which have access for DNS binding on the intranet
18499/// VPC corresponding to the consumer project.
18500#[derive(Clone, Default, PartialEq)]
18501#[non_exhaustive]
18502pub struct Principal {
18503 /// The consumer provided user/service account which needs to be
18504 /// granted permission to DNS bind with the intranet VPC corresponding to the
18505 /// consumer project.
18506 pub principal: std::option::Option<crate::model::principal::Principal>,
18507
18508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18509}
18510
18511impl Principal {
18512 pub fn new() -> Self {
18513 std::default::Default::default()
18514 }
18515
18516 /// Sets the value of [principal][crate::model::Principal::principal].
18517 ///
18518 /// Note that all the setters affecting `principal` are mutually
18519 /// exclusive.
18520 ///
18521 /// # Example
18522 /// ```ignore,no_run
18523 /// # use google_cloud_vmwareengine_v1::model::Principal;
18524 /// use google_cloud_vmwareengine_v1::model::principal::Principal as PrincipalOneOf;
18525 /// let x = Principal::new().set_principal(Some(PrincipalOneOf::User("example".to_string())));
18526 /// ```
18527 pub fn set_principal<
18528 T: std::convert::Into<std::option::Option<crate::model::principal::Principal>>,
18529 >(
18530 mut self,
18531 v: T,
18532 ) -> Self {
18533 self.principal = v.into();
18534 self
18535 }
18536
18537 /// The value of [principal][crate::model::Principal::principal]
18538 /// if it holds a `User`, `None` if the field is not set or
18539 /// holds a different branch.
18540 pub fn user(&self) -> std::option::Option<&std::string::String> {
18541 #[allow(unreachable_patterns)]
18542 self.principal.as_ref().and_then(|v| match v {
18543 crate::model::principal::Principal::User(v) => std::option::Option::Some(v),
18544 _ => std::option::Option::None,
18545 })
18546 }
18547
18548 /// Sets the value of [principal][crate::model::Principal::principal]
18549 /// to hold a `User`.
18550 ///
18551 /// Note that all the setters affecting `principal` are
18552 /// mutually exclusive.
18553 ///
18554 /// # Example
18555 /// ```ignore,no_run
18556 /// # use google_cloud_vmwareengine_v1::model::Principal;
18557 /// let x = Principal::new().set_user("example");
18558 /// assert!(x.user().is_some());
18559 /// assert!(x.service_account().is_none());
18560 /// ```
18561 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18562 self.principal =
18563 std::option::Option::Some(crate::model::principal::Principal::User(v.into()));
18564 self
18565 }
18566
18567 /// The value of [principal][crate::model::Principal::principal]
18568 /// if it holds a `ServiceAccount`, `None` if the field is not set or
18569 /// holds a different branch.
18570 pub fn service_account(&self) -> std::option::Option<&std::string::String> {
18571 #[allow(unreachable_patterns)]
18572 self.principal.as_ref().and_then(|v| match v {
18573 crate::model::principal::Principal::ServiceAccount(v) => std::option::Option::Some(v),
18574 _ => std::option::Option::None,
18575 })
18576 }
18577
18578 /// Sets the value of [principal][crate::model::Principal::principal]
18579 /// to hold a `ServiceAccount`.
18580 ///
18581 /// Note that all the setters affecting `principal` are
18582 /// mutually exclusive.
18583 ///
18584 /// # Example
18585 /// ```ignore,no_run
18586 /// # use google_cloud_vmwareengine_v1::model::Principal;
18587 /// let x = Principal::new().set_service_account("example");
18588 /// assert!(x.service_account().is_some());
18589 /// assert!(x.user().is_none());
18590 /// ```
18591 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18592 self.principal =
18593 std::option::Option::Some(crate::model::principal::Principal::ServiceAccount(v.into()));
18594 self
18595 }
18596}
18597
18598impl wkt::message::Message for Principal {
18599 fn typename() -> &'static str {
18600 "type.googleapis.com/google.cloud.vmwareengine.v1.Principal"
18601 }
18602}
18603
18604/// Defines additional types related to [Principal].
18605pub mod principal {
18606 #[allow(unused_imports)]
18607 use super::*;
18608
18609 /// The consumer provided user/service account which needs to be
18610 /// granted permission to DNS bind with the intranet VPC corresponding to the
18611 /// consumer project.
18612 #[derive(Clone, Debug, PartialEq)]
18613 #[non_exhaustive]
18614 pub enum Principal {
18615 /// The user who needs to be granted permission.
18616 User(std::string::String),
18617 /// The service account which needs to be granted the permission.
18618 ServiceAccount(std::string::String),
18619 }
18620}