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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate lazy_static;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Request message for
41/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
42///
43/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct ListPrivateCloudsRequest {
47 /// Required. The resource name of the private cloud to be queried for
48 /// clusters. Resource names are schemeless URIs that follow the conventions in
49 /// <https://cloud.google.com/apis/design/resource_names>.
50 /// For example:
51 /// `projects/my-project/locations/us-central1-a`
52 pub parent: std::string::String,
53
54 /// The maximum number of private clouds to return in one page.
55 /// The service may return fewer than this value.
56 /// The maximum value is coerced to 1000.
57 /// The default value of this field is 500.
58 pub page_size: i32,
59
60 /// A page token, received from a previous `ListPrivateClouds` call.
61 /// Provide this to retrieve the subsequent page.
62 ///
63 /// When paginating, all other parameters provided to `ListPrivateClouds` must
64 /// match the call that provided the page token.
65 pub page_token: std::string::String,
66
67 /// A filter expression that matches resources returned in the response.
68 /// The expression must specify the field name, a comparison operator, and the
69 /// value that you want to use for filtering. The value must be a string, a
70 /// number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
71 /// `<`.
72 ///
73 /// For example, if you are filtering a list of private clouds, you can exclude
74 /// the ones named `example-pc` by specifying `name != "example-pc"`.
75 ///
76 /// You can also filter nested fields. For example, you could specify
77 /// `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
78 /// only if they have a matching address in their network configuration.
79 ///
80 /// To filter on multiple expressions, provide each separate expression within
81 /// parentheses. For example:
82 ///
83 /// ```norust
84 /// (name = "example-pc")
85 /// (createTime > "2021-04-12T08:15:10.40Z")
86 /// ```
87 ///
88 /// By default, each expression is an `AND` expression. However, you can
89 /// include `AND` and `OR` expressions explicitly. For example:
90 ///
91 /// ```norust
92 /// (name = "private-cloud-1") AND
93 /// (createTime > "2021-04-12T08:15:10.40Z") OR
94 /// (name = "private-cloud-2")
95 /// ```
96 pub filter: std::string::String,
97
98 /// Sorts list results by a certain order. By default, returned results are
99 /// ordered by `name` in ascending order. You can also sort results in
100 /// descending order based on the `name` value using `orderBy="name desc"`.
101 /// Currently, only ordering by `name` is supported.
102 pub order_by: std::string::String,
103
104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
105}
106
107impl ListPrivateCloudsRequest {
108 pub fn new() -> Self {
109 std::default::Default::default()
110 }
111
112 /// Sets the value of [parent][crate::model::ListPrivateCloudsRequest::parent].
113 ///
114 /// # Example
115 /// ```ignore,no_run
116 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
117 /// let x = ListPrivateCloudsRequest::new().set_parent("example");
118 /// ```
119 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.parent = v.into();
121 self
122 }
123
124 /// Sets the value of [page_size][crate::model::ListPrivateCloudsRequest::page_size].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
129 /// let x = ListPrivateCloudsRequest::new().set_page_size(42);
130 /// ```
131 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
132 self.page_size = v.into();
133 self
134 }
135
136 /// Sets the value of [page_token][crate::model::ListPrivateCloudsRequest::page_token].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
141 /// let x = ListPrivateCloudsRequest::new().set_page_token("example");
142 /// ```
143 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144 self.page_token = v.into();
145 self
146 }
147
148 /// Sets the value of [filter][crate::model::ListPrivateCloudsRequest::filter].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
153 /// let x = ListPrivateCloudsRequest::new().set_filter("example");
154 /// ```
155 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156 self.filter = v.into();
157 self
158 }
159
160 /// Sets the value of [order_by][crate::model::ListPrivateCloudsRequest::order_by].
161 ///
162 /// # Example
163 /// ```ignore,no_run
164 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
165 /// let x = ListPrivateCloudsRequest::new().set_order_by("example");
166 /// ```
167 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
168 self.order_by = v.into();
169 self
170 }
171}
172
173impl wkt::message::Message for ListPrivateCloudsRequest {
174 fn typename() -> &'static str {
175 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"
176 }
177}
178
179/// Response message for
180/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
181///
182/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
183#[derive(Clone, Default, PartialEq)]
184#[non_exhaustive]
185pub struct ListPrivateCloudsResponse {
186 /// A list of private clouds.
187 pub private_clouds: std::vec::Vec<crate::model::PrivateCloud>,
188
189 /// A token, which can be sent as `page_token` to retrieve the next page.
190 /// If this field is omitted, there are no subsequent pages.
191 pub next_page_token: std::string::String,
192
193 /// Locations that could not be reached when making an aggregated query using
194 /// wildcards.
195 pub unreachable: std::vec::Vec<std::string::String>,
196
197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
198}
199
200impl ListPrivateCloudsResponse {
201 pub fn new() -> Self {
202 std::default::Default::default()
203 }
204
205 /// Sets the value of [private_clouds][crate::model::ListPrivateCloudsResponse::private_clouds].
206 ///
207 /// # Example
208 /// ```ignore,no_run
209 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
210 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
211 /// let x = ListPrivateCloudsResponse::new()
212 /// .set_private_clouds([
213 /// PrivateCloud::default()/* use setters */,
214 /// PrivateCloud::default()/* use (different) setters */,
215 /// ]);
216 /// ```
217 pub fn set_private_clouds<T, V>(mut self, v: T) -> Self
218 where
219 T: std::iter::IntoIterator<Item = V>,
220 V: std::convert::Into<crate::model::PrivateCloud>,
221 {
222 use std::iter::Iterator;
223 self.private_clouds = v.into_iter().map(|i| i.into()).collect();
224 self
225 }
226
227 /// Sets the value of [next_page_token][crate::model::ListPrivateCloudsResponse::next_page_token].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
232 /// let x = ListPrivateCloudsResponse::new().set_next_page_token("example");
233 /// ```
234 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
235 self.next_page_token = v.into();
236 self
237 }
238
239 /// Sets the value of [unreachable][crate::model::ListPrivateCloudsResponse::unreachable].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
244 /// let x = ListPrivateCloudsResponse::new().set_unreachable(["a", "b", "c"]);
245 /// ```
246 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
247 where
248 T: std::iter::IntoIterator<Item = V>,
249 V: std::convert::Into<std::string::String>,
250 {
251 use std::iter::Iterator;
252 self.unreachable = v.into_iter().map(|i| i.into()).collect();
253 self
254 }
255}
256
257impl wkt::message::Message for ListPrivateCloudsResponse {
258 fn typename() -> &'static str {
259 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"
260 }
261}
262
263#[doc(hidden)]
264impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateCloudsResponse {
265 type PageItem = crate::model::PrivateCloud;
266
267 fn items(self) -> std::vec::Vec<Self::PageItem> {
268 self.private_clouds
269 }
270
271 fn next_page_token(&self) -> std::string::String {
272 use std::clone::Clone;
273 self.next_page_token.clone()
274 }
275}
276
277/// Request message for
278/// [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]
279///
280/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]: crate::client::VmwareEngine::get_private_cloud
281#[derive(Clone, Default, PartialEq)]
282#[non_exhaustive]
283pub struct GetPrivateCloudRequest {
284 /// Required. The resource name of the private cloud to retrieve.
285 /// Resource names are schemeless URIs that follow the conventions in
286 /// <https://cloud.google.com/apis/design/resource_names>.
287 /// For example:
288 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
289 pub name: std::string::String,
290
291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
292}
293
294impl GetPrivateCloudRequest {
295 pub fn new() -> Self {
296 std::default::Default::default()
297 }
298
299 /// Sets the value of [name][crate::model::GetPrivateCloudRequest::name].
300 ///
301 /// # Example
302 /// ```ignore,no_run
303 /// # use google_cloud_vmwareengine_v1::model::GetPrivateCloudRequest;
304 /// let x = GetPrivateCloudRequest::new().set_name("example");
305 /// ```
306 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
307 self.name = v.into();
308 self
309 }
310}
311
312impl wkt::message::Message for GetPrivateCloudRequest {
313 fn typename() -> &'static str {
314 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"
315 }
316}
317
318/// Request message for
319/// [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]
320///
321/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]: crate::client::VmwareEngine::create_private_cloud
322#[derive(Clone, Default, PartialEq)]
323#[non_exhaustive]
324pub struct CreatePrivateCloudRequest {
325 /// Required. The resource name of the location to create the new
326 /// private cloud in. Resource names are schemeless URIs that follow the
327 /// conventions in <https://cloud.google.com/apis/design/resource_names>.
328 /// For example:
329 /// `projects/my-project/locations/us-central1-a`
330 pub parent: std::string::String,
331
332 /// Required. The user-provided identifier of the private cloud to be created.
333 /// This identifier must be unique among each `PrivateCloud` within the parent
334 /// and becomes the final token in the name URI.
335 /// The identifier must meet the following requirements:
336 ///
337 /// * Only contains 1-63 alphanumeric characters and hyphens
338 /// * Begins with an alphabetical character
339 /// * Ends with a non-hyphen character
340 /// * Not formatted as a UUID
341 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
342 /// (section 3.5)
343 pub private_cloud_id: std::string::String,
344
345 /// Required. The initial description of the new private cloud.
346 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
347
348 /// Optional. The request ID must be a valid UUID with the exception that zero
349 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
350 pub request_id: std::string::String,
351
352 /// Optional. True if you want the request to be validated and not executed;
353 /// false otherwise.
354 pub validate_only: bool,
355
356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
357}
358
359impl CreatePrivateCloudRequest {
360 pub fn new() -> Self {
361 std::default::Default::default()
362 }
363
364 /// Sets the value of [parent][crate::model::CreatePrivateCloudRequest::parent].
365 ///
366 /// # Example
367 /// ```ignore,no_run
368 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
369 /// let x = CreatePrivateCloudRequest::new().set_parent("example");
370 /// ```
371 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
372 self.parent = v.into();
373 self
374 }
375
376 /// Sets the value of [private_cloud_id][crate::model::CreatePrivateCloudRequest::private_cloud_id].
377 ///
378 /// # Example
379 /// ```ignore,no_run
380 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
381 /// let x = CreatePrivateCloudRequest::new().set_private_cloud_id("example");
382 /// ```
383 pub fn set_private_cloud_id<T: std::convert::Into<std::string::String>>(
384 mut self,
385 v: T,
386 ) -> Self {
387 self.private_cloud_id = v.into();
388 self
389 }
390
391 /// Sets the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
392 ///
393 /// # Example
394 /// ```ignore,no_run
395 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
396 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
397 /// let x = CreatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
398 /// ```
399 pub fn set_private_cloud<T>(mut self, v: T) -> Self
400 where
401 T: std::convert::Into<crate::model::PrivateCloud>,
402 {
403 self.private_cloud = std::option::Option::Some(v.into());
404 self
405 }
406
407 /// Sets or clears the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
408 ///
409 /// # Example
410 /// ```ignore,no_run
411 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
412 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
413 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
414 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
415 /// ```
416 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
417 where
418 T: std::convert::Into<crate::model::PrivateCloud>,
419 {
420 self.private_cloud = v.map(|x| x.into());
421 self
422 }
423
424 /// Sets the value of [request_id][crate::model::CreatePrivateCloudRequest::request_id].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
429 /// let x = CreatePrivateCloudRequest::new().set_request_id("example");
430 /// ```
431 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
432 self.request_id = v.into();
433 self
434 }
435
436 /// Sets the value of [validate_only][crate::model::CreatePrivateCloudRequest::validate_only].
437 ///
438 /// # Example
439 /// ```ignore,no_run
440 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
441 /// let x = CreatePrivateCloudRequest::new().set_validate_only(true);
442 /// ```
443 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
444 self.validate_only = v.into();
445 self
446 }
447}
448
449impl wkt::message::Message for CreatePrivateCloudRequest {
450 fn typename() -> &'static str {
451 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"
452 }
453}
454
455/// Request message for
456/// [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]
457///
458/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]: crate::client::VmwareEngine::update_private_cloud
459#[derive(Clone, Default, PartialEq)]
460#[non_exhaustive]
461pub struct UpdatePrivateCloudRequest {
462 /// Required. Private cloud description.
463 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
464
465 /// Required. Field mask is used to specify the fields to be overwritten in the
466 /// `PrivateCloud` resource by the update. The fields specified in `updateMask`
467 /// are relative to the resource, not the full request. A field will be
468 /// overwritten if it is in the mask. If the user does not provide a mask then
469 /// all fields will be overwritten.
470 pub update_mask: std::option::Option<wkt::FieldMask>,
471
472 /// Optional. The request ID must be a valid UUID with the exception that zero
473 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
474 pub request_id: std::string::String,
475
476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
477}
478
479impl UpdatePrivateCloudRequest {
480 pub fn new() -> Self {
481 std::default::Default::default()
482 }
483
484 /// Sets the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
485 ///
486 /// # Example
487 /// ```ignore,no_run
488 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
489 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
490 /// let x = UpdatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
491 /// ```
492 pub fn set_private_cloud<T>(mut self, v: T) -> Self
493 where
494 T: std::convert::Into<crate::model::PrivateCloud>,
495 {
496 self.private_cloud = std::option::Option::Some(v.into());
497 self
498 }
499
500 /// Sets or clears the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
501 ///
502 /// # Example
503 /// ```ignore,no_run
504 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
505 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
506 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
507 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
508 /// ```
509 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
510 where
511 T: std::convert::Into<crate::model::PrivateCloud>,
512 {
513 self.private_cloud = v.map(|x| x.into());
514 self
515 }
516
517 /// Sets the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
518 ///
519 /// # Example
520 /// ```ignore,no_run
521 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
522 /// use wkt::FieldMask;
523 /// let x = UpdatePrivateCloudRequest::new().set_update_mask(FieldMask::default()/* use setters */);
524 /// ```
525 pub fn set_update_mask<T>(mut self, v: T) -> Self
526 where
527 T: std::convert::Into<wkt::FieldMask>,
528 {
529 self.update_mask = std::option::Option::Some(v.into());
530 self
531 }
532
533 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
534 ///
535 /// # Example
536 /// ```ignore,no_run
537 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
538 /// use wkt::FieldMask;
539 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
540 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(None::<FieldMask>);
541 /// ```
542 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
543 where
544 T: std::convert::Into<wkt::FieldMask>,
545 {
546 self.update_mask = v.map(|x| x.into());
547 self
548 }
549
550 /// Sets the value of [request_id][crate::model::UpdatePrivateCloudRequest::request_id].
551 ///
552 /// # Example
553 /// ```ignore,no_run
554 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
555 /// let x = UpdatePrivateCloudRequest::new().set_request_id("example");
556 /// ```
557 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
558 self.request_id = v.into();
559 self
560 }
561}
562
563impl wkt::message::Message for UpdatePrivateCloudRequest {
564 fn typename() -> &'static str {
565 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"
566 }
567}
568
569/// Request message for
570/// [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]
571///
572/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]: crate::client::VmwareEngine::delete_private_cloud
573#[derive(Clone, Default, PartialEq)]
574#[non_exhaustive]
575pub struct DeletePrivateCloudRequest {
576 /// Required. The resource name of the private cloud to delete.
577 /// Resource names are schemeless URIs that follow the conventions in
578 /// <https://cloud.google.com/apis/design/resource_names>.
579 /// For example:
580 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
581 pub name: std::string::String,
582
583 /// Optional. The request ID must be a valid UUID with the exception that zero
584 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
585 pub request_id: std::string::String,
586
587 /// Optional. If set to true, cascade delete is enabled and all children of
588 /// this private cloud resource are also deleted. When this flag is set to
589 /// false, the private cloud will not be deleted if there are any children
590 /// other than the management cluster. The management cluster is always
591 /// deleted.
592 pub force: bool,
593
594 /// Optional. Time delay of the deletion specified in hours. The default value
595 /// is `3`. Specifying a non-zero value for this field changes the value of
596 /// `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
597 /// deletion time. Deletion can be cancelled before `expire_time` elapses using
598 /// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud].
599 /// Specifying a value of `0` for this field instead begins the deletion
600 /// process and ceases billing immediately. During the final deletion process,
601 /// the value of `PrivateCloud.state` becomes `PURGING`.
602 ///
603 /// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
604 pub delay_hours: std::option::Option<i32>,
605
606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
607}
608
609impl DeletePrivateCloudRequest {
610 pub fn new() -> Self {
611 std::default::Default::default()
612 }
613
614 /// Sets the value of [name][crate::model::DeletePrivateCloudRequest::name].
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
619 /// let x = DeletePrivateCloudRequest::new().set_name("example");
620 /// ```
621 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
622 self.name = v.into();
623 self
624 }
625
626 /// Sets the value of [request_id][crate::model::DeletePrivateCloudRequest::request_id].
627 ///
628 /// # Example
629 /// ```ignore,no_run
630 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
631 /// let x = DeletePrivateCloudRequest::new().set_request_id("example");
632 /// ```
633 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
634 self.request_id = v.into();
635 self
636 }
637
638 /// Sets the value of [force][crate::model::DeletePrivateCloudRequest::force].
639 ///
640 /// # Example
641 /// ```ignore,no_run
642 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
643 /// let x = DeletePrivateCloudRequest::new().set_force(true);
644 /// ```
645 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
646 self.force = v.into();
647 self
648 }
649
650 /// Sets the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
655 /// let x = DeletePrivateCloudRequest::new().set_delay_hours(42);
656 /// ```
657 pub fn set_delay_hours<T>(mut self, v: T) -> Self
658 where
659 T: std::convert::Into<i32>,
660 {
661 self.delay_hours = std::option::Option::Some(v.into());
662 self
663 }
664
665 /// Sets or clears the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
666 ///
667 /// # Example
668 /// ```ignore,no_run
669 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
670 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(Some(42));
671 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(None::<i32>);
672 /// ```
673 pub fn set_or_clear_delay_hours<T>(mut self, v: std::option::Option<T>) -> Self
674 where
675 T: std::convert::Into<i32>,
676 {
677 self.delay_hours = v.map(|x| x.into());
678 self
679 }
680}
681
682impl wkt::message::Message for DeletePrivateCloudRequest {
683 fn typename() -> &'static str {
684 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"
685 }
686}
687
688/// Request message for
689/// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]
690///
691/// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
692#[derive(Clone, Default, PartialEq)]
693#[non_exhaustive]
694pub struct UndeletePrivateCloudRequest {
695 /// Required. The resource name of the private cloud scheduled for deletion.
696 /// Resource names are schemeless URIs that follow the conventions in
697 /// <https://cloud.google.com/apis/design/resource_names>.
698 /// For example:
699 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
700 pub name: std::string::String,
701
702 /// Optional. The request ID must be a valid UUID with the exception that zero
703 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
704 pub request_id: std::string::String,
705
706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
707}
708
709impl UndeletePrivateCloudRequest {
710 pub fn new() -> Self {
711 std::default::Default::default()
712 }
713
714 /// Sets the value of [name][crate::model::UndeletePrivateCloudRequest::name].
715 ///
716 /// # Example
717 /// ```ignore,no_run
718 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
719 /// let x = UndeletePrivateCloudRequest::new().set_name("example");
720 /// ```
721 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
722 self.name = v.into();
723 self
724 }
725
726 /// Sets the value of [request_id][crate::model::UndeletePrivateCloudRequest::request_id].
727 ///
728 /// # Example
729 /// ```ignore,no_run
730 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
731 /// let x = UndeletePrivateCloudRequest::new().set_request_id("example");
732 /// ```
733 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734 self.request_id = v.into();
735 self
736 }
737}
738
739impl wkt::message::Message for UndeletePrivateCloudRequest {
740 fn typename() -> &'static str {
741 "type.googleapis.com/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"
742 }
743}
744
745/// Request message for
746/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
747///
748/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
749#[derive(Clone, Default, PartialEq)]
750#[non_exhaustive]
751pub struct ListClustersRequest {
752 /// Required. The resource name of the private cloud to query for clusters.
753 /// Resource names are schemeless URIs that follow the conventions in
754 /// <https://cloud.google.com/apis/design/resource_names>.
755 /// For example:
756 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
757 pub parent: std::string::String,
758
759 /// The maximum number of clusters to return in one page.
760 /// The service may return fewer than this value.
761 /// The maximum value is coerced to 1000.
762 /// The default value of this field is 500.
763 pub page_size: i32,
764
765 /// A page token, received from a previous `ListClusters` call.
766 /// Provide this to retrieve the subsequent page.
767 ///
768 /// When paginating, all other parameters provided to `ListClusters`
769 /// must match the call that provided the page token.
770 pub page_token: std::string::String,
771
772 /// To filter on multiple expressions, provide each separate expression within
773 /// parentheses. For example:
774 ///
775 /// ```norust
776 /// (name = "example-cluster")
777 /// (nodeCount = "3")
778 /// ```
779 ///
780 /// By default, each expression is an `AND` expression. However, you can
781 /// include `AND` and `OR` expressions explicitly. For example:
782 ///
783 /// ```norust
784 /// (name = "example-cluster-1") AND
785 /// (createTime > "2021-04-12T08:15:10.40Z") OR
786 /// (name = "example-cluster-2")
787 /// ```
788 pub filter: std::string::String,
789
790 /// Sorts list results by a certain order. By default, returned results are
791 /// ordered by `name` in ascending order. You can also sort results in
792 /// descending order based on the `name` value using `orderBy="name desc"`.
793 /// Currently, only ordering by `name` is supported.
794 pub order_by: std::string::String,
795
796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
797}
798
799impl ListClustersRequest {
800 pub fn new() -> Self {
801 std::default::Default::default()
802 }
803
804 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
805 ///
806 /// # Example
807 /// ```ignore,no_run
808 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
809 /// let x = ListClustersRequest::new().set_parent("example");
810 /// ```
811 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
812 self.parent = v.into();
813 self
814 }
815
816 /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
817 ///
818 /// # Example
819 /// ```ignore,no_run
820 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
821 /// let x = ListClustersRequest::new().set_page_size(42);
822 /// ```
823 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
824 self.page_size = v.into();
825 self
826 }
827
828 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
829 ///
830 /// # Example
831 /// ```ignore,no_run
832 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
833 /// let x = ListClustersRequest::new().set_page_token("example");
834 /// ```
835 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
836 self.page_token = v.into();
837 self
838 }
839
840 /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
841 ///
842 /// # Example
843 /// ```ignore,no_run
844 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
845 /// let x = ListClustersRequest::new().set_filter("example");
846 /// ```
847 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
848 self.filter = v.into();
849 self
850 }
851
852 /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
853 ///
854 /// # Example
855 /// ```ignore,no_run
856 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
857 /// let x = ListClustersRequest::new().set_order_by("example");
858 /// ```
859 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
860 self.order_by = v.into();
861 self
862 }
863}
864
865impl wkt::message::Message for ListClustersRequest {
866 fn typename() -> &'static str {
867 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersRequest"
868 }
869}
870
871/// Response message for
872/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
873///
874/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
875#[derive(Clone, Default, PartialEq)]
876#[non_exhaustive]
877pub struct ListClustersResponse {
878 /// A list of private cloud clusters.
879 pub clusters: std::vec::Vec<crate::model::Cluster>,
880
881 /// A token, which can be sent as `page_token` to retrieve the next page.
882 /// If this field is omitted, there are no subsequent pages.
883 pub next_page_token: std::string::String,
884
885 /// Locations that could not be reached when making an aggregated query using
886 /// wildcards.
887 pub unreachable: std::vec::Vec<std::string::String>,
888
889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
890}
891
892impl ListClustersResponse {
893 pub fn new() -> Self {
894 std::default::Default::default()
895 }
896
897 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
898 ///
899 /// # Example
900 /// ```ignore,no_run
901 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
902 /// use google_cloud_vmwareengine_v1::model::Cluster;
903 /// let x = ListClustersResponse::new()
904 /// .set_clusters([
905 /// Cluster::default()/* use setters */,
906 /// Cluster::default()/* use (different) setters */,
907 /// ]);
908 /// ```
909 pub fn set_clusters<T, V>(mut self, v: T) -> Self
910 where
911 T: std::iter::IntoIterator<Item = V>,
912 V: std::convert::Into<crate::model::Cluster>,
913 {
914 use std::iter::Iterator;
915 self.clusters = v.into_iter().map(|i| i.into()).collect();
916 self
917 }
918
919 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
920 ///
921 /// # Example
922 /// ```ignore,no_run
923 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
924 /// let x = ListClustersResponse::new().set_next_page_token("example");
925 /// ```
926 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
927 self.next_page_token = v.into();
928 self
929 }
930
931 /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
932 ///
933 /// # Example
934 /// ```ignore,no_run
935 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
936 /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
937 /// ```
938 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
939 where
940 T: std::iter::IntoIterator<Item = V>,
941 V: std::convert::Into<std::string::String>,
942 {
943 use std::iter::Iterator;
944 self.unreachable = v.into_iter().map(|i| i.into()).collect();
945 self
946 }
947}
948
949impl wkt::message::Message for ListClustersResponse {
950 fn typename() -> &'static str {
951 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersResponse"
952 }
953}
954
955#[doc(hidden)]
956impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
957 type PageItem = crate::model::Cluster;
958
959 fn items(self) -> std::vec::Vec<Self::PageItem> {
960 self.clusters
961 }
962
963 fn next_page_token(&self) -> std::string::String {
964 use std::clone::Clone;
965 self.next_page_token.clone()
966 }
967}
968
969/// Request message for
970/// [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]
971///
972/// [google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]: crate::client::VmwareEngine::get_cluster
973#[derive(Clone, Default, PartialEq)]
974#[non_exhaustive]
975pub struct GetClusterRequest {
976 /// Required. The cluster resource name to retrieve.
977 /// Resource names are schemeless URIs that follow the conventions in
978 /// <https://cloud.google.com/apis/design/resource_names>.
979 /// For example:
980 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
981 pub name: std::string::String,
982
983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl GetClusterRequest {
987 pub fn new() -> Self {
988 std::default::Default::default()
989 }
990
991 /// Sets the value of [name][crate::model::GetClusterRequest::name].
992 ///
993 /// # Example
994 /// ```ignore,no_run
995 /// # use google_cloud_vmwareengine_v1::model::GetClusterRequest;
996 /// let x = GetClusterRequest::new().set_name("example");
997 /// ```
998 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999 self.name = v.into();
1000 self
1001 }
1002}
1003
1004impl wkt::message::Message for GetClusterRequest {
1005 fn typename() -> &'static str {
1006 "type.googleapis.com/google.cloud.vmwareengine.v1.GetClusterRequest"
1007 }
1008}
1009
1010/// Request message for
1011/// [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]
1012///
1013/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]: crate::client::VmwareEngine::create_cluster
1014#[derive(Clone, Default, PartialEq)]
1015#[non_exhaustive]
1016pub struct CreateClusterRequest {
1017 /// Required. The resource name of the private cloud to create a new cluster
1018 /// in. Resource names are schemeless URIs that follow the conventions in
1019 /// <https://cloud.google.com/apis/design/resource_names>.
1020 /// For example:
1021 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1022 pub parent: std::string::String,
1023
1024 /// Required. The user-provided identifier of the new `Cluster`.
1025 /// This identifier must be unique among clusters within the parent and becomes
1026 /// the final token in the name URI.
1027 /// The identifier must meet the following requirements:
1028 ///
1029 /// * Only contains 1-63 alphanumeric characters and hyphens
1030 /// * Begins with an alphabetical character
1031 /// * Ends with a non-hyphen character
1032 /// * Not formatted as a UUID
1033 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1034 /// (section 3.5)
1035 pub cluster_id: std::string::String,
1036
1037 /// Required. The initial description of the new cluster.
1038 pub cluster: std::option::Option<crate::model::Cluster>,
1039
1040 /// Optional. The request ID must be a valid UUID with the exception that zero
1041 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1042 pub request_id: std::string::String,
1043
1044 /// Optional. True if you want the request to be validated and not executed;
1045 /// false otherwise.
1046 pub validate_only: bool,
1047
1048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1049}
1050
1051impl CreateClusterRequest {
1052 pub fn new() -> Self {
1053 std::default::Default::default()
1054 }
1055
1056 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
1057 ///
1058 /// # Example
1059 /// ```ignore,no_run
1060 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1061 /// let x = CreateClusterRequest::new().set_parent("example");
1062 /// ```
1063 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1064 self.parent = v.into();
1065 self
1066 }
1067
1068 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
1069 ///
1070 /// # Example
1071 /// ```ignore,no_run
1072 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1073 /// let x = CreateClusterRequest::new().set_cluster_id("example");
1074 /// ```
1075 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1076 self.cluster_id = v.into();
1077 self
1078 }
1079
1080 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
1081 ///
1082 /// # Example
1083 /// ```ignore,no_run
1084 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1085 /// use google_cloud_vmwareengine_v1::model::Cluster;
1086 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1087 /// ```
1088 pub fn set_cluster<T>(mut self, v: T) -> Self
1089 where
1090 T: std::convert::Into<crate::model::Cluster>,
1091 {
1092 self.cluster = std::option::Option::Some(v.into());
1093 self
1094 }
1095
1096 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
1097 ///
1098 /// # Example
1099 /// ```ignore,no_run
1100 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1101 /// use google_cloud_vmwareengine_v1::model::Cluster;
1102 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1103 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1104 /// ```
1105 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1106 where
1107 T: std::convert::Into<crate::model::Cluster>,
1108 {
1109 self.cluster = v.map(|x| x.into());
1110 self
1111 }
1112
1113 /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
1114 ///
1115 /// # Example
1116 /// ```ignore,no_run
1117 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1118 /// let x = CreateClusterRequest::new().set_request_id("example");
1119 /// ```
1120 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.request_id = v.into();
1122 self
1123 }
1124
1125 /// Sets the value of [validate_only][crate::model::CreateClusterRequest::validate_only].
1126 ///
1127 /// # Example
1128 /// ```ignore,no_run
1129 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1130 /// let x = CreateClusterRequest::new().set_validate_only(true);
1131 /// ```
1132 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1133 self.validate_only = v.into();
1134 self
1135 }
1136}
1137
1138impl wkt::message::Message for CreateClusterRequest {
1139 fn typename() -> &'static str {
1140 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateClusterRequest"
1141 }
1142}
1143
1144/// Request message for
1145/// [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]
1146///
1147/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]: crate::client::VmwareEngine::update_cluster
1148#[derive(Clone, Default, PartialEq)]
1149#[non_exhaustive]
1150pub struct UpdateClusterRequest {
1151 /// Required. Field mask is used to specify the fields to be overwritten in the
1152 /// `Cluster` resource by the update. The fields specified in the `updateMask`
1153 /// are relative to the resource, not the full request. A field will be
1154 /// overwritten if it is in the mask. If the user does not provide a mask then
1155 /// all fields will be overwritten.
1156 pub update_mask: std::option::Option<wkt::FieldMask>,
1157
1158 /// Required. The description of the cluster.
1159 pub cluster: std::option::Option<crate::model::Cluster>,
1160
1161 /// Optional. The request ID must be a valid UUID with the exception that
1162 /// zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1163 pub request_id: std::string::String,
1164
1165 /// Optional. True if you want the request to be validated and not executed;
1166 /// false otherwise.
1167 pub validate_only: bool,
1168
1169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1170}
1171
1172impl UpdateClusterRequest {
1173 pub fn new() -> Self {
1174 std::default::Default::default()
1175 }
1176
1177 /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1178 ///
1179 /// # Example
1180 /// ```ignore,no_run
1181 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1182 /// use wkt::FieldMask;
1183 /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1184 /// ```
1185 pub fn set_update_mask<T>(mut self, v: T) -> Self
1186 where
1187 T: std::convert::Into<wkt::FieldMask>,
1188 {
1189 self.update_mask = std::option::Option::Some(v.into());
1190 self
1191 }
1192
1193 /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1194 ///
1195 /// # Example
1196 /// ```ignore,no_run
1197 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1198 /// use wkt::FieldMask;
1199 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1200 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1201 /// ```
1202 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1203 where
1204 T: std::convert::Into<wkt::FieldMask>,
1205 {
1206 self.update_mask = v.map(|x| x.into());
1207 self
1208 }
1209
1210 /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1211 ///
1212 /// # Example
1213 /// ```ignore,no_run
1214 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1215 /// use google_cloud_vmwareengine_v1::model::Cluster;
1216 /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1217 /// ```
1218 pub fn set_cluster<T>(mut self, v: T) -> Self
1219 where
1220 T: std::convert::Into<crate::model::Cluster>,
1221 {
1222 self.cluster = std::option::Option::Some(v.into());
1223 self
1224 }
1225
1226 /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1227 ///
1228 /// # Example
1229 /// ```ignore,no_run
1230 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1231 /// use google_cloud_vmwareengine_v1::model::Cluster;
1232 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1233 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1234 /// ```
1235 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1236 where
1237 T: std::convert::Into<crate::model::Cluster>,
1238 {
1239 self.cluster = v.map(|x| x.into());
1240 self
1241 }
1242
1243 /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
1244 ///
1245 /// # Example
1246 /// ```ignore,no_run
1247 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1248 /// let x = UpdateClusterRequest::new().set_request_id("example");
1249 /// ```
1250 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.request_id = v.into();
1252 self
1253 }
1254
1255 /// Sets the value of [validate_only][crate::model::UpdateClusterRequest::validate_only].
1256 ///
1257 /// # Example
1258 /// ```ignore,no_run
1259 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1260 /// let x = UpdateClusterRequest::new().set_validate_only(true);
1261 /// ```
1262 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1263 self.validate_only = v.into();
1264 self
1265 }
1266}
1267
1268impl wkt::message::Message for UpdateClusterRequest {
1269 fn typename() -> &'static str {
1270 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateClusterRequest"
1271 }
1272}
1273
1274/// Request message for
1275/// [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]
1276///
1277/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]: crate::client::VmwareEngine::delete_cluster
1278#[derive(Clone, Default, PartialEq)]
1279#[non_exhaustive]
1280pub struct DeleteClusterRequest {
1281 /// Required. The resource name of the cluster to delete.
1282 /// Resource names are schemeless URIs that follow the conventions in
1283 /// <https://cloud.google.com/apis/design/resource_names>.
1284 /// For example:
1285 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1286 pub name: std::string::String,
1287
1288 /// Optional. The request ID must be a valid UUID with the exception that zero
1289 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1290 pub request_id: std::string::String,
1291
1292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1293}
1294
1295impl DeleteClusterRequest {
1296 pub fn new() -> Self {
1297 std::default::Default::default()
1298 }
1299
1300 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1301 ///
1302 /// # Example
1303 /// ```ignore,no_run
1304 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1305 /// let x = DeleteClusterRequest::new().set_name("example");
1306 /// ```
1307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1308 self.name = v.into();
1309 self
1310 }
1311
1312 /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
1313 ///
1314 /// # Example
1315 /// ```ignore,no_run
1316 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1317 /// let x = DeleteClusterRequest::new().set_request_id("example");
1318 /// ```
1319 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1320 self.request_id = v.into();
1321 self
1322 }
1323}
1324
1325impl wkt::message::Message for DeleteClusterRequest {
1326 fn typename() -> &'static str {
1327 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteClusterRequest"
1328 }
1329}
1330
1331/// Request message for
1332/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1333///
1334/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1335#[derive(Clone, Default, PartialEq)]
1336#[non_exhaustive]
1337pub struct ListNodesRequest {
1338 /// Required. The resource name of the cluster to be queried for nodes.
1339 /// Resource names are schemeless URIs that follow the conventions in
1340 /// <https://cloud.google.com/apis/design/resource_names>.
1341 /// For example:
1342 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1343 pub parent: std::string::String,
1344
1345 /// The maximum number of nodes to return in one page.
1346 /// The service may return fewer than this value.
1347 /// The maximum value is coerced to 1000.
1348 /// The default value of this field is 500.
1349 pub page_size: i32,
1350
1351 /// A page token, received from a previous `ListNodes` call.
1352 /// Provide this to retrieve the subsequent page.
1353 ///
1354 /// When paginating, all other parameters provided to
1355 /// `ListNodes` must match the call that provided the page
1356 /// token.
1357 pub page_token: std::string::String,
1358
1359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1360}
1361
1362impl ListNodesRequest {
1363 pub fn new() -> Self {
1364 std::default::Default::default()
1365 }
1366
1367 /// Sets the value of [parent][crate::model::ListNodesRequest::parent].
1368 ///
1369 /// # Example
1370 /// ```ignore,no_run
1371 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1372 /// let x = ListNodesRequest::new().set_parent("example");
1373 /// ```
1374 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1375 self.parent = v.into();
1376 self
1377 }
1378
1379 /// Sets the value of [page_size][crate::model::ListNodesRequest::page_size].
1380 ///
1381 /// # Example
1382 /// ```ignore,no_run
1383 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1384 /// let x = ListNodesRequest::new().set_page_size(42);
1385 /// ```
1386 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1387 self.page_size = v.into();
1388 self
1389 }
1390
1391 /// Sets the value of [page_token][crate::model::ListNodesRequest::page_token].
1392 ///
1393 /// # Example
1394 /// ```ignore,no_run
1395 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1396 /// let x = ListNodesRequest::new().set_page_token("example");
1397 /// ```
1398 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1399 self.page_token = v.into();
1400 self
1401 }
1402}
1403
1404impl wkt::message::Message for ListNodesRequest {
1405 fn typename() -> &'static str {
1406 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesRequest"
1407 }
1408}
1409
1410/// Response message for
1411/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1412///
1413/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1414#[derive(Clone, Default, PartialEq)]
1415#[non_exhaustive]
1416pub struct ListNodesResponse {
1417 /// The nodes.
1418 pub nodes: std::vec::Vec<crate::model::Node>,
1419
1420 /// A token, which can be sent as `page_token` to retrieve the next page.
1421 /// If this field is omitted, there are no subsequent pages.
1422 pub next_page_token: std::string::String,
1423
1424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1425}
1426
1427impl ListNodesResponse {
1428 pub fn new() -> Self {
1429 std::default::Default::default()
1430 }
1431
1432 /// Sets the value of [nodes][crate::model::ListNodesResponse::nodes].
1433 ///
1434 /// # Example
1435 /// ```ignore,no_run
1436 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1437 /// use google_cloud_vmwareengine_v1::model::Node;
1438 /// let x = ListNodesResponse::new()
1439 /// .set_nodes([
1440 /// Node::default()/* use setters */,
1441 /// Node::default()/* use (different) setters */,
1442 /// ]);
1443 /// ```
1444 pub fn set_nodes<T, V>(mut self, v: T) -> Self
1445 where
1446 T: std::iter::IntoIterator<Item = V>,
1447 V: std::convert::Into<crate::model::Node>,
1448 {
1449 use std::iter::Iterator;
1450 self.nodes = v.into_iter().map(|i| i.into()).collect();
1451 self
1452 }
1453
1454 /// Sets the value of [next_page_token][crate::model::ListNodesResponse::next_page_token].
1455 ///
1456 /// # Example
1457 /// ```ignore,no_run
1458 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1459 /// let x = ListNodesResponse::new().set_next_page_token("example");
1460 /// ```
1461 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.next_page_token = v.into();
1463 self
1464 }
1465}
1466
1467impl wkt::message::Message for ListNodesResponse {
1468 fn typename() -> &'static str {
1469 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesResponse"
1470 }
1471}
1472
1473#[doc(hidden)]
1474impl google_cloud_gax::paginator::internal::PageableResponse for ListNodesResponse {
1475 type PageItem = crate::model::Node;
1476
1477 fn items(self) -> std::vec::Vec<Self::PageItem> {
1478 self.nodes
1479 }
1480
1481 fn next_page_token(&self) -> std::string::String {
1482 use std::clone::Clone;
1483 self.next_page_token.clone()
1484 }
1485}
1486
1487/// Request message for
1488/// [VmwareEngine.GetNode][google.cloud.vmwareengine.v1.VmwareEngine.GetNode]
1489///
1490/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNode]: crate::client::VmwareEngine::get_node
1491#[derive(Clone, Default, PartialEq)]
1492#[non_exhaustive]
1493pub struct GetNodeRequest {
1494 /// Required. The resource name of the node to retrieve.
1495 /// For example:
1496 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}`
1497 pub name: std::string::String,
1498
1499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1500}
1501
1502impl GetNodeRequest {
1503 pub fn new() -> Self {
1504 std::default::Default::default()
1505 }
1506
1507 /// Sets the value of [name][crate::model::GetNodeRequest::name].
1508 ///
1509 /// # Example
1510 /// ```ignore,no_run
1511 /// # use google_cloud_vmwareengine_v1::model::GetNodeRequest;
1512 /// let x = GetNodeRequest::new().set_name("example");
1513 /// ```
1514 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.name = v.into();
1516 self
1517 }
1518}
1519
1520impl wkt::message::Message for GetNodeRequest {
1521 fn typename() -> &'static str {
1522 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeRequest"
1523 }
1524}
1525
1526/// Request message for
1527/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1528///
1529/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1530#[derive(Clone, Default, PartialEq)]
1531#[non_exhaustive]
1532pub struct ListExternalAddressesRequest {
1533 /// Required. The resource name of the private cloud to be queried for
1534 /// external IP addresses.
1535 /// Resource names are schemeless URIs that follow the conventions in
1536 /// <https://cloud.google.com/apis/design/resource_names>.
1537 /// For example:
1538 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1539 pub parent: std::string::String,
1540
1541 /// The maximum number of external IP addresses to return in one page.
1542 /// The service may return fewer than this value.
1543 /// The maximum value is coerced to 1000.
1544 /// The default value of this field is 500.
1545 pub page_size: i32,
1546
1547 /// A page token, received from a previous `ListExternalAddresses` call.
1548 /// Provide this to retrieve the subsequent page.
1549 ///
1550 /// When paginating, all other parameters provided to
1551 /// `ListExternalAddresses` must match the call that provided the page token.
1552 pub page_token: std::string::String,
1553
1554 /// A filter expression that matches resources returned in the response.
1555 /// The expression must specify the field name, a comparison
1556 /// operator, and the value that you want to use for filtering. The value
1557 /// must be a string, a number, or a boolean. The comparison operator
1558 /// must be `=`, `!=`, `>`, or `<`.
1559 ///
1560 /// For example, if you are filtering a list of IP addresses, you can
1561 /// exclude the ones named `example-ip` by specifying
1562 /// `name != "example-ip"`.
1563 ///
1564 /// To filter on multiple expressions, provide each separate expression within
1565 /// parentheses. For example:
1566 ///
1567 /// ```norust
1568 /// (name = "example-ip")
1569 /// (createTime > "2021-04-12T08:15:10.40Z")
1570 /// ```
1571 ///
1572 /// By default, each expression is an `AND` expression. However, you
1573 /// can include `AND` and `OR` expressions explicitly.
1574 /// For example:
1575 ///
1576 /// ```norust
1577 /// (name = "example-ip-1") AND
1578 /// (createTime > "2021-04-12T08:15:10.40Z") OR
1579 /// (name = "example-ip-2")
1580 /// ```
1581 pub filter: std::string::String,
1582
1583 /// Sorts list results by a certain order. By default, returned results
1584 /// are ordered by `name` in ascending order.
1585 /// You can also sort results in descending order based on the `name` value
1586 /// using `orderBy="name desc"`.
1587 /// Currently, only ordering by `name` is supported.
1588 pub order_by: std::string::String,
1589
1590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1591}
1592
1593impl ListExternalAddressesRequest {
1594 pub fn new() -> Self {
1595 std::default::Default::default()
1596 }
1597
1598 /// Sets the value of [parent][crate::model::ListExternalAddressesRequest::parent].
1599 ///
1600 /// # Example
1601 /// ```ignore,no_run
1602 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1603 /// let x = ListExternalAddressesRequest::new().set_parent("example");
1604 /// ```
1605 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1606 self.parent = v.into();
1607 self
1608 }
1609
1610 /// Sets the value of [page_size][crate::model::ListExternalAddressesRequest::page_size].
1611 ///
1612 /// # Example
1613 /// ```ignore,no_run
1614 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1615 /// let x = ListExternalAddressesRequest::new().set_page_size(42);
1616 /// ```
1617 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1618 self.page_size = v.into();
1619 self
1620 }
1621
1622 /// Sets the value of [page_token][crate::model::ListExternalAddressesRequest::page_token].
1623 ///
1624 /// # Example
1625 /// ```ignore,no_run
1626 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1627 /// let x = ListExternalAddressesRequest::new().set_page_token("example");
1628 /// ```
1629 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1630 self.page_token = v.into();
1631 self
1632 }
1633
1634 /// Sets the value of [filter][crate::model::ListExternalAddressesRequest::filter].
1635 ///
1636 /// # Example
1637 /// ```ignore,no_run
1638 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1639 /// let x = ListExternalAddressesRequest::new().set_filter("example");
1640 /// ```
1641 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.filter = v.into();
1643 self
1644 }
1645
1646 /// Sets the value of [order_by][crate::model::ListExternalAddressesRequest::order_by].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1651 /// let x = ListExternalAddressesRequest::new().set_order_by("example");
1652 /// ```
1653 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.order_by = v.into();
1655 self
1656 }
1657}
1658
1659impl wkt::message::Message for ListExternalAddressesRequest {
1660 fn typename() -> &'static str {
1661 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesRequest"
1662 }
1663}
1664
1665/// Response message for
1666/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1667///
1668/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1669#[derive(Clone, Default, PartialEq)]
1670#[non_exhaustive]
1671pub struct ListExternalAddressesResponse {
1672 /// A list of external IP addresses.
1673 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1674
1675 /// A token, which can be sent as `page_token` to retrieve the next page.
1676 /// If this field is omitted, there are no subsequent pages.
1677 pub next_page_token: std::string::String,
1678
1679 /// Locations that could not be reached when making an aggregated query using
1680 /// wildcards.
1681 pub unreachable: std::vec::Vec<std::string::String>,
1682
1683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1684}
1685
1686impl ListExternalAddressesResponse {
1687 pub fn new() -> Self {
1688 std::default::Default::default()
1689 }
1690
1691 /// Sets the value of [external_addresses][crate::model::ListExternalAddressesResponse::external_addresses].
1692 ///
1693 /// # Example
1694 /// ```ignore,no_run
1695 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1696 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1697 /// let x = ListExternalAddressesResponse::new()
1698 /// .set_external_addresses([
1699 /// ExternalAddress::default()/* use setters */,
1700 /// ExternalAddress::default()/* use (different) setters */,
1701 /// ]);
1702 /// ```
1703 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1704 where
1705 T: std::iter::IntoIterator<Item = V>,
1706 V: std::convert::Into<crate::model::ExternalAddress>,
1707 {
1708 use std::iter::Iterator;
1709 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1710 self
1711 }
1712
1713 /// Sets the value of [next_page_token][crate::model::ListExternalAddressesResponse::next_page_token].
1714 ///
1715 /// # Example
1716 /// ```ignore,no_run
1717 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1718 /// let x = ListExternalAddressesResponse::new().set_next_page_token("example");
1719 /// ```
1720 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.next_page_token = v.into();
1722 self
1723 }
1724
1725 /// Sets the value of [unreachable][crate::model::ListExternalAddressesResponse::unreachable].
1726 ///
1727 /// # Example
1728 /// ```ignore,no_run
1729 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1730 /// let x = ListExternalAddressesResponse::new().set_unreachable(["a", "b", "c"]);
1731 /// ```
1732 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1733 where
1734 T: std::iter::IntoIterator<Item = V>,
1735 V: std::convert::Into<std::string::String>,
1736 {
1737 use std::iter::Iterator;
1738 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1739 self
1740 }
1741}
1742
1743impl wkt::message::Message for ListExternalAddressesResponse {
1744 fn typename() -> &'static str {
1745 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesResponse"
1746 }
1747}
1748
1749#[doc(hidden)]
1750impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAddressesResponse {
1751 type PageItem = crate::model::ExternalAddress;
1752
1753 fn items(self) -> std::vec::Vec<Self::PageItem> {
1754 self.external_addresses
1755 }
1756
1757 fn next_page_token(&self) -> std::string::String {
1758 use std::clone::Clone;
1759 self.next_page_token.clone()
1760 }
1761}
1762
1763/// Request message for
1764/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1765///
1766/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1767#[derive(Clone, Default, PartialEq)]
1768#[non_exhaustive]
1769pub struct FetchNetworkPolicyExternalAddressesRequest {
1770 /// Required. The resource name of the network policy to query for assigned
1771 /// external IP addresses. Resource names are schemeless URIs that follow the
1772 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
1773 /// example:
1774 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
1775 pub network_policy: std::string::String,
1776
1777 /// The maximum number of external IP addresses to return in one page.
1778 /// The service may return fewer than this value.
1779 /// The maximum value is coerced to 1000.
1780 /// The default value of this field is 500.
1781 pub page_size: i32,
1782
1783 /// A page token, received from a previous
1784 /// `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the
1785 /// subsequent page.
1786 ///
1787 /// When paginating, all parameters provided to
1788 /// `FetchNetworkPolicyExternalAddresses`, except for `page_size` and
1789 /// `page_token`, must match the call that provided the page token.
1790 pub page_token: std::string::String,
1791
1792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1793}
1794
1795impl FetchNetworkPolicyExternalAddressesRequest {
1796 pub fn new() -> Self {
1797 std::default::Default::default()
1798 }
1799
1800 /// Sets the value of [network_policy][crate::model::FetchNetworkPolicyExternalAddressesRequest::network_policy].
1801 ///
1802 /// # Example
1803 /// ```ignore,no_run
1804 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1805 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_network_policy("example");
1806 /// ```
1807 pub fn set_network_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1808 self.network_policy = v.into();
1809 self
1810 }
1811
1812 /// Sets the value of [page_size][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_size].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1817 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_size(42);
1818 /// ```
1819 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1820 self.page_size = v.into();
1821 self
1822 }
1823
1824 /// Sets the value of [page_token][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_token].
1825 ///
1826 /// # Example
1827 /// ```ignore,no_run
1828 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1829 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_token("example");
1830 /// ```
1831 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1832 self.page_token = v.into();
1833 self
1834 }
1835}
1836
1837impl wkt::message::Message for FetchNetworkPolicyExternalAddressesRequest {
1838 fn typename() -> &'static str {
1839 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest"
1840 }
1841}
1842
1843/// Response message for
1844/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1845///
1846/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1847#[derive(Clone, Default, PartialEq)]
1848#[non_exhaustive]
1849pub struct FetchNetworkPolicyExternalAddressesResponse {
1850 /// A list of external IP addresses assigned to VMware workload VMs within the
1851 /// scope of the given network policy.
1852 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1853
1854 /// A token, which can be sent as `page_token` to retrieve the next page.
1855 /// If this field is omitted, there are no subsequent pages.
1856 pub next_page_token: std::string::String,
1857
1858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859}
1860
1861impl FetchNetworkPolicyExternalAddressesResponse {
1862 pub fn new() -> Self {
1863 std::default::Default::default()
1864 }
1865
1866 /// Sets the value of [external_addresses][crate::model::FetchNetworkPolicyExternalAddressesResponse::external_addresses].
1867 ///
1868 /// # Example
1869 /// ```ignore,no_run
1870 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1871 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1872 /// let x = FetchNetworkPolicyExternalAddressesResponse::new()
1873 /// .set_external_addresses([
1874 /// ExternalAddress::default()/* use setters */,
1875 /// ExternalAddress::default()/* use (different) setters */,
1876 /// ]);
1877 /// ```
1878 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1879 where
1880 T: std::iter::IntoIterator<Item = V>,
1881 V: std::convert::Into<crate::model::ExternalAddress>,
1882 {
1883 use std::iter::Iterator;
1884 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1885 self
1886 }
1887
1888 /// Sets the value of [next_page_token][crate::model::FetchNetworkPolicyExternalAddressesResponse::next_page_token].
1889 ///
1890 /// # Example
1891 /// ```ignore,no_run
1892 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1893 /// let x = FetchNetworkPolicyExternalAddressesResponse::new().set_next_page_token("example");
1894 /// ```
1895 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1896 self.next_page_token = v.into();
1897 self
1898 }
1899}
1900
1901impl wkt::message::Message for FetchNetworkPolicyExternalAddressesResponse {
1902 fn typename() -> &'static str {
1903 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse"
1904 }
1905}
1906
1907#[doc(hidden)]
1908impl google_cloud_gax::paginator::internal::PageableResponse
1909 for FetchNetworkPolicyExternalAddressesResponse
1910{
1911 type PageItem = crate::model::ExternalAddress;
1912
1913 fn items(self) -> std::vec::Vec<Self::PageItem> {
1914 self.external_addresses
1915 }
1916
1917 fn next_page_token(&self) -> std::string::String {
1918 use std::clone::Clone;
1919 self.next_page_token.clone()
1920 }
1921}
1922
1923/// Request message for
1924/// [VmwareEngine.GetExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]
1925///
1926/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]: crate::client::VmwareEngine::get_external_address
1927#[derive(Clone, Default, PartialEq)]
1928#[non_exhaustive]
1929pub struct GetExternalAddressRequest {
1930 /// Required. The resource name of the external IP address to retrieve.
1931 /// Resource names are schemeless URIs that follow the conventions in
1932 /// <https://cloud.google.com/apis/design/resource_names>.
1933 /// For example:
1934 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
1935 pub name: std::string::String,
1936
1937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1938}
1939
1940impl GetExternalAddressRequest {
1941 pub fn new() -> Self {
1942 std::default::Default::default()
1943 }
1944
1945 /// Sets the value of [name][crate::model::GetExternalAddressRequest::name].
1946 ///
1947 /// # Example
1948 /// ```ignore,no_run
1949 /// # use google_cloud_vmwareengine_v1::model::GetExternalAddressRequest;
1950 /// let x = GetExternalAddressRequest::new().set_name("example");
1951 /// ```
1952 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1953 self.name = v.into();
1954 self
1955 }
1956}
1957
1958impl wkt::message::Message for GetExternalAddressRequest {
1959 fn typename() -> &'static str {
1960 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAddressRequest"
1961 }
1962}
1963
1964/// Request message for
1965/// [VmwareEngine.CreateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]
1966///
1967/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]: crate::client::VmwareEngine::create_external_address
1968#[derive(Clone, Default, PartialEq)]
1969#[non_exhaustive]
1970pub struct CreateExternalAddressRequest {
1971 /// Required. The resource name of the private cloud
1972 /// to create a new external IP address in.
1973 /// Resource names are schemeless URIs that follow the conventions in
1974 /// <https://cloud.google.com/apis/design/resource_names>.
1975 /// For example:
1976 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1977 pub parent: std::string::String,
1978
1979 /// Required. The initial description of a new external IP address.
1980 pub external_address: std::option::Option<crate::model::ExternalAddress>,
1981
1982 /// Required. The user-provided identifier of the `ExternalAddress` to be
1983 /// created. This identifier must be unique among `ExternalAddress` resources
1984 /// within the parent and becomes the final token in the name URI. The
1985 /// identifier must meet the following requirements:
1986 ///
1987 /// * Only contains 1-63 alphanumeric characters and hyphens
1988 /// * Begins with an alphabetical character
1989 /// * Ends with a non-hyphen character
1990 /// * Not formatted as a UUID
1991 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1992 /// (section 3.5)
1993 pub external_address_id: std::string::String,
1994
1995 /// Optional. A request ID to identify requests. Specify a unique request ID
1996 /// so that if you must retry your request, the server will know to ignore
1997 /// the request if it has already been completed. The server guarantees that a
1998 /// request doesn't result in creation of duplicate commitments for at least 60
1999 /// minutes.
2000 ///
2001 /// For example, consider a situation where you make an initial request and the
2002 /// request times out. If you make the request again with the same request ID,
2003 /// the server can check if the original operation with the same request ID was
2004 /// received, and if so, will ignore the second request. This prevents clients
2005 /// from accidentally creating duplicate commitments.
2006 ///
2007 /// The request ID must be a valid UUID with the exception that zero UUID is
2008 /// not supported (00000000-0000-0000-0000-000000000000).
2009 pub request_id: std::string::String,
2010
2011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2012}
2013
2014impl CreateExternalAddressRequest {
2015 pub fn new() -> Self {
2016 std::default::Default::default()
2017 }
2018
2019 /// Sets the value of [parent][crate::model::CreateExternalAddressRequest::parent].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2024 /// let x = CreateExternalAddressRequest::new().set_parent("example");
2025 /// ```
2026 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2027 self.parent = v.into();
2028 self
2029 }
2030
2031 /// Sets the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2032 ///
2033 /// # Example
2034 /// ```ignore,no_run
2035 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2036 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2037 /// let x = CreateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2038 /// ```
2039 pub fn set_external_address<T>(mut self, v: T) -> Self
2040 where
2041 T: std::convert::Into<crate::model::ExternalAddress>,
2042 {
2043 self.external_address = std::option::Option::Some(v.into());
2044 self
2045 }
2046
2047 /// Sets or clears the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2048 ///
2049 /// # Example
2050 /// ```ignore,no_run
2051 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2052 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2053 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2054 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2055 /// ```
2056 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2057 where
2058 T: std::convert::Into<crate::model::ExternalAddress>,
2059 {
2060 self.external_address = v.map(|x| x.into());
2061 self
2062 }
2063
2064 /// Sets the value of [external_address_id][crate::model::CreateExternalAddressRequest::external_address_id].
2065 ///
2066 /// # Example
2067 /// ```ignore,no_run
2068 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2069 /// let x = CreateExternalAddressRequest::new().set_external_address_id("example");
2070 /// ```
2071 pub fn set_external_address_id<T: std::convert::Into<std::string::String>>(
2072 mut self,
2073 v: T,
2074 ) -> Self {
2075 self.external_address_id = v.into();
2076 self
2077 }
2078
2079 /// Sets the value of [request_id][crate::model::CreateExternalAddressRequest::request_id].
2080 ///
2081 /// # Example
2082 /// ```ignore,no_run
2083 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2084 /// let x = CreateExternalAddressRequest::new().set_request_id("example");
2085 /// ```
2086 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2087 self.request_id = v.into();
2088 self
2089 }
2090}
2091
2092impl wkt::message::Message for CreateExternalAddressRequest {
2093 fn typename() -> &'static str {
2094 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAddressRequest"
2095 }
2096}
2097
2098/// Request message for
2099/// [VmwareEngine.UpdateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]
2100///
2101/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]: crate::client::VmwareEngine::update_external_address
2102#[derive(Clone, Default, PartialEq)]
2103#[non_exhaustive]
2104pub struct UpdateExternalAddressRequest {
2105 /// Required. Field mask is used to specify the fields to be overwritten in the
2106 /// `ExternalAddress` resource by the update.
2107 /// The fields specified in the `update_mask` are relative to the resource, not
2108 /// the full request. A field will be overwritten if it is in the mask. If the
2109 /// user does not provide a mask then all fields will be overwritten.
2110 pub update_mask: std::option::Option<wkt::FieldMask>,
2111
2112 /// Required. External IP address description.
2113 pub external_address: std::option::Option<crate::model::ExternalAddress>,
2114
2115 /// Optional. A request ID to identify requests. Specify a unique request ID
2116 /// so that if you must retry your request, the server will know to ignore
2117 /// the request if it has already been completed. The server guarantees that a
2118 /// request doesn't result in creation of duplicate commitments for at least 60
2119 /// minutes.
2120 ///
2121 /// For example, consider a situation where you make an initial request and the
2122 /// request times out. If you make the request again with the same request ID,
2123 /// the server can check if the original operation with the same request ID was
2124 /// received, and if so, will ignore the second request. This prevents clients
2125 /// from accidentally creating duplicate commitments.
2126 ///
2127 /// The request ID must be a valid UUID with the exception that zero UUID is
2128 /// not supported (00000000-0000-0000-0000-000000000000).
2129 pub request_id: std::string::String,
2130
2131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2132}
2133
2134impl UpdateExternalAddressRequest {
2135 pub fn new() -> Self {
2136 std::default::Default::default()
2137 }
2138
2139 /// Sets the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2140 ///
2141 /// # Example
2142 /// ```ignore,no_run
2143 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2144 /// use wkt::FieldMask;
2145 /// let x = UpdateExternalAddressRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2146 /// ```
2147 pub fn set_update_mask<T>(mut self, v: T) -> Self
2148 where
2149 T: std::convert::Into<wkt::FieldMask>,
2150 {
2151 self.update_mask = std::option::Option::Some(v.into());
2152 self
2153 }
2154
2155 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2156 ///
2157 /// # Example
2158 /// ```ignore,no_run
2159 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2160 /// use wkt::FieldMask;
2161 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2162 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2163 /// ```
2164 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2165 where
2166 T: std::convert::Into<wkt::FieldMask>,
2167 {
2168 self.update_mask = v.map(|x| x.into());
2169 self
2170 }
2171
2172 /// Sets the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2173 ///
2174 /// # Example
2175 /// ```ignore,no_run
2176 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2177 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2178 /// let x = UpdateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2179 /// ```
2180 pub fn set_external_address<T>(mut self, v: T) -> Self
2181 where
2182 T: std::convert::Into<crate::model::ExternalAddress>,
2183 {
2184 self.external_address = std::option::Option::Some(v.into());
2185 self
2186 }
2187
2188 /// Sets or clears the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2189 ///
2190 /// # Example
2191 /// ```ignore,no_run
2192 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2193 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2194 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2195 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2196 /// ```
2197 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2198 where
2199 T: std::convert::Into<crate::model::ExternalAddress>,
2200 {
2201 self.external_address = v.map(|x| x.into());
2202 self
2203 }
2204
2205 /// Sets the value of [request_id][crate::model::UpdateExternalAddressRequest::request_id].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2210 /// let x = UpdateExternalAddressRequest::new().set_request_id("example");
2211 /// ```
2212 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2213 self.request_id = v.into();
2214 self
2215 }
2216}
2217
2218impl wkt::message::Message for UpdateExternalAddressRequest {
2219 fn typename() -> &'static str {
2220 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAddressRequest"
2221 }
2222}
2223
2224/// Request message for
2225/// [VmwareEngine.DeleteExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]
2226///
2227/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]: crate::client::VmwareEngine::delete_external_address
2228#[derive(Clone, Default, PartialEq)]
2229#[non_exhaustive]
2230pub struct DeleteExternalAddressRequest {
2231 /// Required. The resource name of the external IP address to delete.
2232 /// Resource names are schemeless URIs that follow the conventions in
2233 /// <https://cloud.google.com/apis/design/resource_names>.
2234 /// For example:
2235 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
2236 pub name: std::string::String,
2237
2238 /// Optional. A request ID to identify requests. Specify a unique request ID
2239 /// so that if you must retry your request, the server will know to ignore
2240 /// the request if it has already been completed. The server guarantees that a
2241 /// request doesn't result in creation of duplicate commitments for at least 60
2242 /// minutes.
2243 ///
2244 /// For example, consider a situation where you make an initial request and the
2245 /// request times out. If you make the request again with the same request
2246 /// ID, the server can check if the original operation with the same request ID
2247 /// was received, and if so, will ignore the second request. This prevents
2248 /// clients from accidentally creating duplicate commitments.
2249 ///
2250 /// The request ID must be a valid UUID with the exception that zero UUID is
2251 /// not supported (00000000-0000-0000-0000-000000000000).
2252 pub request_id: std::string::String,
2253
2254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2255}
2256
2257impl DeleteExternalAddressRequest {
2258 pub fn new() -> Self {
2259 std::default::Default::default()
2260 }
2261
2262 /// Sets the value of [name][crate::model::DeleteExternalAddressRequest::name].
2263 ///
2264 /// # Example
2265 /// ```ignore,no_run
2266 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2267 /// let x = DeleteExternalAddressRequest::new().set_name("example");
2268 /// ```
2269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2270 self.name = v.into();
2271 self
2272 }
2273
2274 /// Sets the value of [request_id][crate::model::DeleteExternalAddressRequest::request_id].
2275 ///
2276 /// # Example
2277 /// ```ignore,no_run
2278 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2279 /// let x = DeleteExternalAddressRequest::new().set_request_id("example");
2280 /// ```
2281 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.request_id = v.into();
2283 self
2284 }
2285}
2286
2287impl wkt::message::Message for DeleteExternalAddressRequest {
2288 fn typename() -> &'static str {
2289 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAddressRequest"
2290 }
2291}
2292
2293/// Request message for
2294/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2295///
2296/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2297#[derive(Clone, Default, PartialEq)]
2298#[non_exhaustive]
2299pub struct ListSubnetsRequest {
2300 /// Required. The resource name of the private cloud to be queried for
2301 /// subnets.
2302 /// Resource names are schemeless URIs that follow the conventions in
2303 /// <https://cloud.google.com/apis/design/resource_names>.
2304 /// For example:
2305 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2306 pub parent: std::string::String,
2307
2308 /// The maximum number of subnets to return in one page.
2309 /// The service may return fewer than this value.
2310 /// The maximum value is coerced to 1000.
2311 /// The default value of this field is 500.
2312 pub page_size: i32,
2313
2314 /// A page token, received from a previous `ListSubnetsRequest` call.
2315 /// Provide this to retrieve the subsequent page.
2316 ///
2317 /// When paginating, all other parameters provided to
2318 /// `ListSubnetsRequest` must match the call that provided the page token.
2319 pub page_token: std::string::String,
2320
2321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl ListSubnetsRequest {
2325 pub fn new() -> Self {
2326 std::default::Default::default()
2327 }
2328
2329 /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
2330 ///
2331 /// # Example
2332 /// ```ignore,no_run
2333 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2334 /// let x = ListSubnetsRequest::new().set_parent("example");
2335 /// ```
2336 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337 self.parent = v.into();
2338 self
2339 }
2340
2341 /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
2342 ///
2343 /// # Example
2344 /// ```ignore,no_run
2345 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2346 /// let x = ListSubnetsRequest::new().set_page_size(42);
2347 /// ```
2348 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2349 self.page_size = v.into();
2350 self
2351 }
2352
2353 /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
2354 ///
2355 /// # Example
2356 /// ```ignore,no_run
2357 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2358 /// let x = ListSubnetsRequest::new().set_page_token("example");
2359 /// ```
2360 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2361 self.page_token = v.into();
2362 self
2363 }
2364}
2365
2366impl wkt::message::Message for ListSubnetsRequest {
2367 fn typename() -> &'static str {
2368 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsRequest"
2369 }
2370}
2371
2372/// Response message for
2373/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2374///
2375/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2376#[derive(Clone, Default, PartialEq)]
2377#[non_exhaustive]
2378pub struct ListSubnetsResponse {
2379 /// A list of subnets.
2380 pub subnets: std::vec::Vec<crate::model::Subnet>,
2381
2382 /// A token, which can be sent as `page_token` to retrieve the next page.
2383 /// If this field is omitted, there are no subsequent pages.
2384 pub next_page_token: std::string::String,
2385
2386 /// Locations that could not be reached when making an aggregated query using
2387 /// wildcards.
2388 pub unreachable: std::vec::Vec<std::string::String>,
2389
2390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2391}
2392
2393impl ListSubnetsResponse {
2394 pub fn new() -> Self {
2395 std::default::Default::default()
2396 }
2397
2398 /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
2399 ///
2400 /// # Example
2401 /// ```ignore,no_run
2402 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2403 /// use google_cloud_vmwareengine_v1::model::Subnet;
2404 /// let x = ListSubnetsResponse::new()
2405 /// .set_subnets([
2406 /// Subnet::default()/* use setters */,
2407 /// Subnet::default()/* use (different) setters */,
2408 /// ]);
2409 /// ```
2410 pub fn set_subnets<T, V>(mut self, v: T) -> Self
2411 where
2412 T: std::iter::IntoIterator<Item = V>,
2413 V: std::convert::Into<crate::model::Subnet>,
2414 {
2415 use std::iter::Iterator;
2416 self.subnets = v.into_iter().map(|i| i.into()).collect();
2417 self
2418 }
2419
2420 /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
2421 ///
2422 /// # Example
2423 /// ```ignore,no_run
2424 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2425 /// let x = ListSubnetsResponse::new().set_next_page_token("example");
2426 /// ```
2427 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2428 self.next_page_token = v.into();
2429 self
2430 }
2431
2432 /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
2433 ///
2434 /// # Example
2435 /// ```ignore,no_run
2436 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2437 /// let x = ListSubnetsResponse::new().set_unreachable(["a", "b", "c"]);
2438 /// ```
2439 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2440 where
2441 T: std::iter::IntoIterator<Item = V>,
2442 V: std::convert::Into<std::string::String>,
2443 {
2444 use std::iter::Iterator;
2445 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2446 self
2447 }
2448}
2449
2450impl wkt::message::Message for ListSubnetsResponse {
2451 fn typename() -> &'static str {
2452 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsResponse"
2453 }
2454}
2455
2456#[doc(hidden)]
2457impl google_cloud_gax::paginator::internal::PageableResponse for ListSubnetsResponse {
2458 type PageItem = crate::model::Subnet;
2459
2460 fn items(self) -> std::vec::Vec<Self::PageItem> {
2461 self.subnets
2462 }
2463
2464 fn next_page_token(&self) -> std::string::String {
2465 use std::clone::Clone;
2466 self.next_page_token.clone()
2467 }
2468}
2469
2470/// Request message for
2471/// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]
2472///
2473/// [google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]: crate::client::VmwareEngine::get_subnet
2474#[derive(Clone, Default, PartialEq)]
2475#[non_exhaustive]
2476pub struct GetSubnetRequest {
2477 /// Required. The resource name of the subnet to retrieve.
2478 /// Resource names are schemeless URIs that follow the conventions in
2479 /// <https://cloud.google.com/apis/design/resource_names>.
2480 /// For example:
2481 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
2482 pub name: std::string::String,
2483
2484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2485}
2486
2487impl GetSubnetRequest {
2488 pub fn new() -> Self {
2489 std::default::Default::default()
2490 }
2491
2492 /// Sets the value of [name][crate::model::GetSubnetRequest::name].
2493 ///
2494 /// # Example
2495 /// ```ignore,no_run
2496 /// # use google_cloud_vmwareengine_v1::model::GetSubnetRequest;
2497 /// let x = GetSubnetRequest::new().set_name("example");
2498 /// ```
2499 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2500 self.name = v.into();
2501 self
2502 }
2503}
2504
2505impl wkt::message::Message for GetSubnetRequest {
2506 fn typename() -> &'static str {
2507 "type.googleapis.com/google.cloud.vmwareengine.v1.GetSubnetRequest"
2508 }
2509}
2510
2511/// Request message for
2512/// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]
2513///
2514/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]: crate::client::VmwareEngine::update_subnet
2515#[derive(Clone, Default, PartialEq)]
2516#[non_exhaustive]
2517pub struct UpdateSubnetRequest {
2518 /// Required. Field mask is used to specify the fields to be overwritten in the
2519 /// `Subnet` resource by the update.
2520 /// The fields specified in the `update_mask` are relative to the resource, not
2521 /// the full request. A field will be overwritten if it is in the mask. If the
2522 /// user does not provide a mask then all fields will be overwritten.
2523 pub update_mask: std::option::Option<wkt::FieldMask>,
2524
2525 /// Required. Subnet description.
2526 pub subnet: std::option::Option<crate::model::Subnet>,
2527
2528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2529}
2530
2531impl UpdateSubnetRequest {
2532 pub fn new() -> Self {
2533 std::default::Default::default()
2534 }
2535
2536 /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2537 ///
2538 /// # Example
2539 /// ```ignore,no_run
2540 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2541 /// use wkt::FieldMask;
2542 /// let x = UpdateSubnetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2543 /// ```
2544 pub fn set_update_mask<T>(mut self, v: T) -> Self
2545 where
2546 T: std::convert::Into<wkt::FieldMask>,
2547 {
2548 self.update_mask = std::option::Option::Some(v.into());
2549 self
2550 }
2551
2552 /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2553 ///
2554 /// # Example
2555 /// ```ignore,no_run
2556 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2557 /// use wkt::FieldMask;
2558 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2559 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2560 /// ```
2561 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2562 where
2563 T: std::convert::Into<wkt::FieldMask>,
2564 {
2565 self.update_mask = v.map(|x| x.into());
2566 self
2567 }
2568
2569 /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2570 ///
2571 /// # Example
2572 /// ```ignore,no_run
2573 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2574 /// use google_cloud_vmwareengine_v1::model::Subnet;
2575 /// let x = UpdateSubnetRequest::new().set_subnet(Subnet::default()/* use setters */);
2576 /// ```
2577 pub fn set_subnet<T>(mut self, v: T) -> Self
2578 where
2579 T: std::convert::Into<crate::model::Subnet>,
2580 {
2581 self.subnet = std::option::Option::Some(v.into());
2582 self
2583 }
2584
2585 /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2586 ///
2587 /// # Example
2588 /// ```ignore,no_run
2589 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2590 /// use google_cloud_vmwareengine_v1::model::Subnet;
2591 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(Some(Subnet::default()/* use setters */));
2592 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(None::<Subnet>);
2593 /// ```
2594 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
2595 where
2596 T: std::convert::Into<crate::model::Subnet>,
2597 {
2598 self.subnet = v.map(|x| x.into());
2599 self
2600 }
2601}
2602
2603impl wkt::message::Message for UpdateSubnetRequest {
2604 fn typename() -> &'static str {
2605 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateSubnetRequest"
2606 }
2607}
2608
2609/// Request message for
2610/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2611///
2612/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2613#[derive(Clone, Default, PartialEq)]
2614#[non_exhaustive]
2615pub struct ListExternalAccessRulesRequest {
2616 /// Required. The resource name of the network policy to query for external
2617 /// access firewall rules. Resource names are schemeless URIs that follow the
2618 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
2619 /// example:
2620 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2621 pub parent: std::string::String,
2622
2623 /// The maximum number of external access rules to return in one page.
2624 /// The service may return fewer than this value.
2625 /// The maximum value is coerced to 1000.
2626 /// The default value of this field is 500.
2627 pub page_size: i32,
2628
2629 /// A page token, received from a previous `ListExternalAccessRulesRequest`
2630 /// call. Provide this to retrieve the subsequent page.
2631 ///
2632 /// When paginating, all other parameters provided to
2633 /// `ListExternalAccessRulesRequest` must match the call that provided the page
2634 /// token.
2635 pub page_token: std::string::String,
2636
2637 /// A filter expression that matches resources returned in the response.
2638 /// The expression must specify the field name, a comparison
2639 /// operator, and the value that you want to use for filtering. The value
2640 /// must be a string, a number, or a boolean. The comparison operator
2641 /// must be `=`, `!=`, `>`, or `<`.
2642 ///
2643 /// For example, if you are filtering a list of external access rules, you can
2644 /// exclude the ones named `example-rule` by specifying
2645 /// `name != "example-rule"`.
2646 ///
2647 /// To filter on multiple expressions, provide each separate expression within
2648 /// parentheses. For example:
2649 ///
2650 /// ```norust
2651 /// (name = "example-rule")
2652 /// (createTime > "2021-04-12T08:15:10.40Z")
2653 /// ```
2654 ///
2655 /// By default, each expression is an `AND` expression. However, you
2656 /// can include `AND` and `OR` expressions explicitly.
2657 /// For example:
2658 ///
2659 /// ```norust
2660 /// (name = "example-rule-1") AND
2661 /// (createTime > "2021-04-12T08:15:10.40Z") OR
2662 /// (name = "example-rule-2")
2663 /// ```
2664 pub filter: std::string::String,
2665
2666 /// Sorts list results by a certain order. By default, returned results
2667 /// are ordered by `name` in ascending order.
2668 /// You can also sort results in descending order based on the `name` value
2669 /// using `orderBy="name desc"`.
2670 /// Currently, only ordering by `name` is supported.
2671 pub order_by: std::string::String,
2672
2673 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2674}
2675
2676impl ListExternalAccessRulesRequest {
2677 pub fn new() -> Self {
2678 std::default::Default::default()
2679 }
2680
2681 /// Sets the value of [parent][crate::model::ListExternalAccessRulesRequest::parent].
2682 ///
2683 /// # Example
2684 /// ```ignore,no_run
2685 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2686 /// let x = ListExternalAccessRulesRequest::new().set_parent("example");
2687 /// ```
2688 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2689 self.parent = v.into();
2690 self
2691 }
2692
2693 /// Sets the value of [page_size][crate::model::ListExternalAccessRulesRequest::page_size].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2698 /// let x = ListExternalAccessRulesRequest::new().set_page_size(42);
2699 /// ```
2700 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2701 self.page_size = v.into();
2702 self
2703 }
2704
2705 /// Sets the value of [page_token][crate::model::ListExternalAccessRulesRequest::page_token].
2706 ///
2707 /// # Example
2708 /// ```ignore,no_run
2709 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2710 /// let x = ListExternalAccessRulesRequest::new().set_page_token("example");
2711 /// ```
2712 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2713 self.page_token = v.into();
2714 self
2715 }
2716
2717 /// Sets the value of [filter][crate::model::ListExternalAccessRulesRequest::filter].
2718 ///
2719 /// # Example
2720 /// ```ignore,no_run
2721 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2722 /// let x = ListExternalAccessRulesRequest::new().set_filter("example");
2723 /// ```
2724 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2725 self.filter = v.into();
2726 self
2727 }
2728
2729 /// Sets the value of [order_by][crate::model::ListExternalAccessRulesRequest::order_by].
2730 ///
2731 /// # Example
2732 /// ```ignore,no_run
2733 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2734 /// let x = ListExternalAccessRulesRequest::new().set_order_by("example");
2735 /// ```
2736 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2737 self.order_by = v.into();
2738 self
2739 }
2740}
2741
2742impl wkt::message::Message for ListExternalAccessRulesRequest {
2743 fn typename() -> &'static str {
2744 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest"
2745 }
2746}
2747
2748/// Response message for
2749/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2750///
2751/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2752#[derive(Clone, Default, PartialEq)]
2753#[non_exhaustive]
2754pub struct ListExternalAccessRulesResponse {
2755 /// A list of external access firewall rules.
2756 pub external_access_rules: std::vec::Vec<crate::model::ExternalAccessRule>,
2757
2758 /// A token, which can be sent as `page_token` to retrieve the next page.
2759 /// If this field is omitted, there are no subsequent pages.
2760 pub next_page_token: std::string::String,
2761
2762 /// Locations that could not be reached when making an aggregated query using
2763 /// wildcards.
2764 pub unreachable: std::vec::Vec<std::string::String>,
2765
2766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2767}
2768
2769impl ListExternalAccessRulesResponse {
2770 pub fn new() -> Self {
2771 std::default::Default::default()
2772 }
2773
2774 /// Sets the value of [external_access_rules][crate::model::ListExternalAccessRulesResponse::external_access_rules].
2775 ///
2776 /// # Example
2777 /// ```ignore,no_run
2778 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2779 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2780 /// let x = ListExternalAccessRulesResponse::new()
2781 /// .set_external_access_rules([
2782 /// ExternalAccessRule::default()/* use setters */,
2783 /// ExternalAccessRule::default()/* use (different) setters */,
2784 /// ]);
2785 /// ```
2786 pub fn set_external_access_rules<T, V>(mut self, v: T) -> Self
2787 where
2788 T: std::iter::IntoIterator<Item = V>,
2789 V: std::convert::Into<crate::model::ExternalAccessRule>,
2790 {
2791 use std::iter::Iterator;
2792 self.external_access_rules = v.into_iter().map(|i| i.into()).collect();
2793 self
2794 }
2795
2796 /// Sets the value of [next_page_token][crate::model::ListExternalAccessRulesResponse::next_page_token].
2797 ///
2798 /// # Example
2799 /// ```ignore,no_run
2800 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2801 /// let x = ListExternalAccessRulesResponse::new().set_next_page_token("example");
2802 /// ```
2803 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2804 self.next_page_token = v.into();
2805 self
2806 }
2807
2808 /// Sets the value of [unreachable][crate::model::ListExternalAccessRulesResponse::unreachable].
2809 ///
2810 /// # Example
2811 /// ```ignore,no_run
2812 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2813 /// let x = ListExternalAccessRulesResponse::new().set_unreachable(["a", "b", "c"]);
2814 /// ```
2815 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2816 where
2817 T: std::iter::IntoIterator<Item = V>,
2818 V: std::convert::Into<std::string::String>,
2819 {
2820 use std::iter::Iterator;
2821 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2822 self
2823 }
2824}
2825
2826impl wkt::message::Message for ListExternalAccessRulesResponse {
2827 fn typename() -> &'static str {
2828 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse"
2829 }
2830}
2831
2832#[doc(hidden)]
2833impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAccessRulesResponse {
2834 type PageItem = crate::model::ExternalAccessRule;
2835
2836 fn items(self) -> std::vec::Vec<Self::PageItem> {
2837 self.external_access_rules
2838 }
2839
2840 fn next_page_token(&self) -> std::string::String {
2841 use std::clone::Clone;
2842 self.next_page_token.clone()
2843 }
2844}
2845
2846/// Request message for
2847/// [VmwareEngine.GetExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]
2848///
2849/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]: crate::client::VmwareEngine::get_external_access_rule
2850#[derive(Clone, Default, PartialEq)]
2851#[non_exhaustive]
2852pub struct GetExternalAccessRuleRequest {
2853 /// Required. The resource name of the external access firewall rule to
2854 /// retrieve. Resource names are schemeless URIs that follow the conventions in
2855 /// <https://cloud.google.com/apis/design/resource_names>.
2856 /// For example:
2857 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
2858 pub name: std::string::String,
2859
2860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2861}
2862
2863impl GetExternalAccessRuleRequest {
2864 pub fn new() -> Self {
2865 std::default::Default::default()
2866 }
2867
2868 /// Sets the value of [name][crate::model::GetExternalAccessRuleRequest::name].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_vmwareengine_v1::model::GetExternalAccessRuleRequest;
2873 /// let x = GetExternalAccessRuleRequest::new().set_name("example");
2874 /// ```
2875 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2876 self.name = v.into();
2877 self
2878 }
2879}
2880
2881impl wkt::message::Message for GetExternalAccessRuleRequest {
2882 fn typename() -> &'static str {
2883 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest"
2884 }
2885}
2886
2887/// Request message for
2888/// [VmwareEngine.CreateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]
2889///
2890/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]: crate::client::VmwareEngine::create_external_access_rule
2891#[derive(Clone, Default, PartialEq)]
2892#[non_exhaustive]
2893pub struct CreateExternalAccessRuleRequest {
2894 /// Required. The resource name of the network policy
2895 /// to create a new external access firewall rule in.
2896 /// Resource names are schemeless URIs that follow the conventions in
2897 /// <https://cloud.google.com/apis/design/resource_names>.
2898 /// For example:
2899 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2900 pub parent: std::string::String,
2901
2902 /// Required. The initial description of a new external access rule.
2903 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
2904
2905 /// Required. The user-provided identifier of the `ExternalAccessRule` to be
2906 /// created. This identifier must be unique among `ExternalAccessRule`
2907 /// resources within the parent and becomes the final token in the name URI.
2908 /// The identifier must meet the following requirements:
2909 ///
2910 /// * Only contains 1-63 alphanumeric characters and hyphens
2911 /// * Begins with an alphabetical character
2912 /// * Ends with a non-hyphen character
2913 /// * Not formatted as a UUID
2914 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2915 /// (section 3.5)
2916 pub external_access_rule_id: std::string::String,
2917
2918 /// A request ID to identify requests. Specify a unique request ID
2919 /// so that if you must retry your request, the server will know to ignore
2920 /// the request if it has already been completed. The server guarantees that a
2921 /// request doesn't result in creation of duplicate commitments for at least 60
2922 /// minutes.
2923 ///
2924 /// For example, consider a situation where you make an initial request and the
2925 /// request times out. If you make the request again with the same request ID,
2926 /// the server can check if the original operation with the same request ID was
2927 /// received, and if so, will ignore the second request. This prevents clients
2928 /// from accidentally creating duplicate commitments.
2929 ///
2930 /// The request ID must be a valid UUID with the exception that zero UUID is
2931 /// not supported (00000000-0000-0000-0000-000000000000).
2932 pub request_id: std::string::String,
2933
2934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2935}
2936
2937impl CreateExternalAccessRuleRequest {
2938 pub fn new() -> Self {
2939 std::default::Default::default()
2940 }
2941
2942 /// Sets the value of [parent][crate::model::CreateExternalAccessRuleRequest::parent].
2943 ///
2944 /// # Example
2945 /// ```ignore,no_run
2946 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2947 /// let x = CreateExternalAccessRuleRequest::new().set_parent("example");
2948 /// ```
2949 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2950 self.parent = v.into();
2951 self
2952 }
2953
2954 /// Sets the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2955 ///
2956 /// # Example
2957 /// ```ignore,no_run
2958 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2959 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2960 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
2961 /// ```
2962 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
2963 where
2964 T: std::convert::Into<crate::model::ExternalAccessRule>,
2965 {
2966 self.external_access_rule = std::option::Option::Some(v.into());
2967 self
2968 }
2969
2970 /// Sets or clears the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2971 ///
2972 /// # Example
2973 /// ```ignore,no_run
2974 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2975 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2976 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
2977 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
2978 /// ```
2979 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
2980 where
2981 T: std::convert::Into<crate::model::ExternalAccessRule>,
2982 {
2983 self.external_access_rule = v.map(|x| x.into());
2984 self
2985 }
2986
2987 /// Sets the value of [external_access_rule_id][crate::model::CreateExternalAccessRuleRequest::external_access_rule_id].
2988 ///
2989 /// # Example
2990 /// ```ignore,no_run
2991 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2992 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule_id("example");
2993 /// ```
2994 pub fn set_external_access_rule_id<T: std::convert::Into<std::string::String>>(
2995 mut self,
2996 v: T,
2997 ) -> Self {
2998 self.external_access_rule_id = v.into();
2999 self
3000 }
3001
3002 /// Sets the value of [request_id][crate::model::CreateExternalAccessRuleRequest::request_id].
3003 ///
3004 /// # Example
3005 /// ```ignore,no_run
3006 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3007 /// let x = CreateExternalAccessRuleRequest::new().set_request_id("example");
3008 /// ```
3009 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3010 self.request_id = v.into();
3011 self
3012 }
3013}
3014
3015impl wkt::message::Message for CreateExternalAccessRuleRequest {
3016 fn typename() -> &'static str {
3017 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest"
3018 }
3019}
3020
3021/// Request message for
3022/// [VmwareEngine.UpdateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]
3023///
3024/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]: crate::client::VmwareEngine::update_external_access_rule
3025#[derive(Clone, Default, PartialEq)]
3026#[non_exhaustive]
3027pub struct UpdateExternalAccessRuleRequest {
3028 /// Required. Field mask is used to specify the fields to be overwritten in the
3029 /// `ExternalAccessRule` resource by the update.
3030 /// The fields specified in the `update_mask` are relative to the resource, not
3031 /// the full request. A field will be overwritten if it is in the mask. If the
3032 /// user does not provide a mask then all fields will be overwritten.
3033 pub update_mask: std::option::Option<wkt::FieldMask>,
3034
3035 /// Required. Description of the external access rule.
3036 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
3037
3038 /// Optional. A request ID to identify requests. Specify a unique request ID
3039 /// so that if you must retry your request, the server will know to ignore
3040 /// the request if it has already been completed. The server guarantees that a
3041 /// request doesn't result in creation of duplicate commitments for at least 60
3042 /// minutes.
3043 ///
3044 /// For example, consider a situation where you make an initial request and the
3045 /// request times out. If you make the request again with the same request ID,
3046 /// the server can check if the original operation with the same request ID was
3047 /// received, and if so, will ignore the second request. This prevents clients
3048 /// from accidentally creating duplicate commitments.
3049 ///
3050 /// The request ID must be a valid UUID with the exception that zero UUID is
3051 /// not supported (00000000-0000-0000-0000-000000000000).
3052 pub request_id: std::string::String,
3053
3054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3055}
3056
3057impl UpdateExternalAccessRuleRequest {
3058 pub fn new() -> Self {
3059 std::default::Default::default()
3060 }
3061
3062 /// Sets the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3063 ///
3064 /// # Example
3065 /// ```ignore,no_run
3066 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3067 /// use wkt::FieldMask;
3068 /// let x = UpdateExternalAccessRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3069 /// ```
3070 pub fn set_update_mask<T>(mut self, v: T) -> Self
3071 where
3072 T: std::convert::Into<wkt::FieldMask>,
3073 {
3074 self.update_mask = std::option::Option::Some(v.into());
3075 self
3076 }
3077
3078 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3079 ///
3080 /// # Example
3081 /// ```ignore,no_run
3082 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3083 /// use wkt::FieldMask;
3084 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3085 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3086 /// ```
3087 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3088 where
3089 T: std::convert::Into<wkt::FieldMask>,
3090 {
3091 self.update_mask = v.map(|x| x.into());
3092 self
3093 }
3094
3095 /// Sets the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3096 ///
3097 /// # Example
3098 /// ```ignore,no_run
3099 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3100 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3101 /// let x = UpdateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
3102 /// ```
3103 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
3104 where
3105 T: std::convert::Into<crate::model::ExternalAccessRule>,
3106 {
3107 self.external_access_rule = std::option::Option::Some(v.into());
3108 self
3109 }
3110
3111 /// Sets or clears the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3112 ///
3113 /// # Example
3114 /// ```ignore,no_run
3115 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3116 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3117 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
3118 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
3119 /// ```
3120 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
3121 where
3122 T: std::convert::Into<crate::model::ExternalAccessRule>,
3123 {
3124 self.external_access_rule = v.map(|x| x.into());
3125 self
3126 }
3127
3128 /// Sets the value of [request_id][crate::model::UpdateExternalAccessRuleRequest::request_id].
3129 ///
3130 /// # Example
3131 /// ```ignore,no_run
3132 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3133 /// let x = UpdateExternalAccessRuleRequest::new().set_request_id("example");
3134 /// ```
3135 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3136 self.request_id = v.into();
3137 self
3138 }
3139}
3140
3141impl wkt::message::Message for UpdateExternalAccessRuleRequest {
3142 fn typename() -> &'static str {
3143 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest"
3144 }
3145}
3146
3147/// Request message for
3148/// [VmwareEngine.DeleteExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]
3149///
3150/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]: crate::client::VmwareEngine::delete_external_access_rule
3151#[derive(Clone, Default, PartialEq)]
3152#[non_exhaustive]
3153pub struct DeleteExternalAccessRuleRequest {
3154 /// Required. The resource name of the external access firewall rule to delete.
3155 /// Resource names are schemeless URIs that follow the conventions in
3156 /// <https://cloud.google.com/apis/design/resource_names>.
3157 /// For example:
3158 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
3159 pub name: std::string::String,
3160
3161 /// Optional. A request ID to identify requests. Specify a unique request ID
3162 /// so that if you must retry your request, the server will know to ignore
3163 /// the request if it has already been completed. The server guarantees that a
3164 /// request doesn't result in creation of duplicate commitments for at least 60
3165 /// minutes.
3166 ///
3167 /// For example, consider a situation where you make an initial request and the
3168 /// request times out. If you make the request again with the same request
3169 /// ID, the server can check if the original operation with the same request ID
3170 /// was received, and if so, will ignore the second request. This prevents
3171 /// clients from accidentally creating duplicate commitments.
3172 ///
3173 /// The request ID must be a valid UUID with the exception that zero UUID is
3174 /// not supported (00000000-0000-0000-0000-000000000000).
3175 pub request_id: std::string::String,
3176
3177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3178}
3179
3180impl DeleteExternalAccessRuleRequest {
3181 pub fn new() -> Self {
3182 std::default::Default::default()
3183 }
3184
3185 /// Sets the value of [name][crate::model::DeleteExternalAccessRuleRequest::name].
3186 ///
3187 /// # Example
3188 /// ```ignore,no_run
3189 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3190 /// let x = DeleteExternalAccessRuleRequest::new().set_name("example");
3191 /// ```
3192 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3193 self.name = v.into();
3194 self
3195 }
3196
3197 /// Sets the value of [request_id][crate::model::DeleteExternalAccessRuleRequest::request_id].
3198 ///
3199 /// # Example
3200 /// ```ignore,no_run
3201 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3202 /// let x = DeleteExternalAccessRuleRequest::new().set_request_id("example");
3203 /// ```
3204 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3205 self.request_id = v.into();
3206 self
3207 }
3208}
3209
3210impl wkt::message::Message for DeleteExternalAccessRuleRequest {
3211 fn typename() -> &'static str {
3212 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest"
3213 }
3214}
3215
3216/// Request message for
3217/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3218///
3219/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3220#[derive(Clone, Default, PartialEq)]
3221#[non_exhaustive]
3222pub struct ListLoggingServersRequest {
3223 /// Required. The resource name of the private cloud to be queried for
3224 /// logging servers.
3225 /// Resource names are schemeless URIs that follow the conventions in
3226 /// <https://cloud.google.com/apis/design/resource_names>.
3227 /// For example:
3228 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3229 pub parent: std::string::String,
3230
3231 /// The maximum number of logging servers to return in one page.
3232 /// The service may return fewer than this value.
3233 /// The maximum value is coerced to 1000.
3234 /// The default value of this field is 500.
3235 pub page_size: i32,
3236
3237 /// A page token, received from a previous `ListLoggingServersRequest` call.
3238 /// Provide this to retrieve the subsequent page.
3239 ///
3240 /// When paginating, all other parameters provided to
3241 /// `ListLoggingServersRequest` must match the call that provided the page
3242 /// token.
3243 pub page_token: std::string::String,
3244
3245 /// A filter expression that matches resources returned in the response.
3246 /// The expression must specify the field name, a comparison
3247 /// operator, and the value that you want to use for filtering. The value
3248 /// must be a string, a number, or a boolean. The comparison operator
3249 /// must be `=`, `!=`, `>`, or `<`.
3250 ///
3251 /// For example, if you are filtering a list of logging servers, you can
3252 /// exclude the ones named `example-server` by specifying
3253 /// `name != "example-server"`.
3254 ///
3255 /// To filter on multiple expressions, provide each separate expression within
3256 /// parentheses. For example:
3257 ///
3258 /// ```norust
3259 /// (name = "example-server")
3260 /// (createTime > "2021-04-12T08:15:10.40Z")
3261 /// ```
3262 ///
3263 /// By default, each expression is an `AND` expression. However, you
3264 /// can include `AND` and `OR` expressions explicitly.
3265 /// For example:
3266 ///
3267 /// ```norust
3268 /// (name = "example-server-1") AND
3269 /// (createTime > "2021-04-12T08:15:10.40Z") OR
3270 /// (name = "example-server-2")
3271 /// ```
3272 pub filter: std::string::String,
3273
3274 /// Sorts list results by a certain order. By default, returned results
3275 /// are ordered by `name` in ascending order.
3276 /// You can also sort results in descending order based on the `name` value
3277 /// using `orderBy="name desc"`.
3278 /// Currently, only ordering by `name` is supported.
3279 pub order_by: std::string::String,
3280
3281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3282}
3283
3284impl ListLoggingServersRequest {
3285 pub fn new() -> Self {
3286 std::default::Default::default()
3287 }
3288
3289 /// Sets the value of [parent][crate::model::ListLoggingServersRequest::parent].
3290 ///
3291 /// # Example
3292 /// ```ignore,no_run
3293 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3294 /// let x = ListLoggingServersRequest::new().set_parent("example");
3295 /// ```
3296 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.parent = v.into();
3298 self
3299 }
3300
3301 /// Sets the value of [page_size][crate::model::ListLoggingServersRequest::page_size].
3302 ///
3303 /// # Example
3304 /// ```ignore,no_run
3305 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3306 /// let x = ListLoggingServersRequest::new().set_page_size(42);
3307 /// ```
3308 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3309 self.page_size = v.into();
3310 self
3311 }
3312
3313 /// Sets the value of [page_token][crate::model::ListLoggingServersRequest::page_token].
3314 ///
3315 /// # Example
3316 /// ```ignore,no_run
3317 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3318 /// let x = ListLoggingServersRequest::new().set_page_token("example");
3319 /// ```
3320 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3321 self.page_token = v.into();
3322 self
3323 }
3324
3325 /// Sets the value of [filter][crate::model::ListLoggingServersRequest::filter].
3326 ///
3327 /// # Example
3328 /// ```ignore,no_run
3329 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3330 /// let x = ListLoggingServersRequest::new().set_filter("example");
3331 /// ```
3332 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3333 self.filter = v.into();
3334 self
3335 }
3336
3337 /// Sets the value of [order_by][crate::model::ListLoggingServersRequest::order_by].
3338 ///
3339 /// # Example
3340 /// ```ignore,no_run
3341 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3342 /// let x = ListLoggingServersRequest::new().set_order_by("example");
3343 /// ```
3344 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3345 self.order_by = v.into();
3346 self
3347 }
3348}
3349
3350impl wkt::message::Message for ListLoggingServersRequest {
3351 fn typename() -> &'static str {
3352 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersRequest"
3353 }
3354}
3355
3356/// Response message for
3357/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3358///
3359/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3360#[derive(Clone, Default, PartialEq)]
3361#[non_exhaustive]
3362pub struct ListLoggingServersResponse {
3363 /// A list of Logging Servers.
3364 pub logging_servers: std::vec::Vec<crate::model::LoggingServer>,
3365
3366 /// A token, which can be send as `page_token` to retrieve the next page.
3367 /// If this field is omitted, there are no subsequent pages.
3368 pub next_page_token: std::string::String,
3369
3370 /// Locations that could not be reached when making an aggregated query using
3371 /// wildcards.
3372 pub unreachable: std::vec::Vec<std::string::String>,
3373
3374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3375}
3376
3377impl ListLoggingServersResponse {
3378 pub fn new() -> Self {
3379 std::default::Default::default()
3380 }
3381
3382 /// Sets the value of [logging_servers][crate::model::ListLoggingServersResponse::logging_servers].
3383 ///
3384 /// # Example
3385 /// ```ignore,no_run
3386 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3387 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3388 /// let x = ListLoggingServersResponse::new()
3389 /// .set_logging_servers([
3390 /// LoggingServer::default()/* use setters */,
3391 /// LoggingServer::default()/* use (different) setters */,
3392 /// ]);
3393 /// ```
3394 pub fn set_logging_servers<T, V>(mut self, v: T) -> Self
3395 where
3396 T: std::iter::IntoIterator<Item = V>,
3397 V: std::convert::Into<crate::model::LoggingServer>,
3398 {
3399 use std::iter::Iterator;
3400 self.logging_servers = v.into_iter().map(|i| i.into()).collect();
3401 self
3402 }
3403
3404 /// Sets the value of [next_page_token][crate::model::ListLoggingServersResponse::next_page_token].
3405 ///
3406 /// # Example
3407 /// ```ignore,no_run
3408 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3409 /// let x = ListLoggingServersResponse::new().set_next_page_token("example");
3410 /// ```
3411 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3412 self.next_page_token = v.into();
3413 self
3414 }
3415
3416 /// Sets the value of [unreachable][crate::model::ListLoggingServersResponse::unreachable].
3417 ///
3418 /// # Example
3419 /// ```ignore,no_run
3420 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3421 /// let x = ListLoggingServersResponse::new().set_unreachable(["a", "b", "c"]);
3422 /// ```
3423 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3424 where
3425 T: std::iter::IntoIterator<Item = V>,
3426 V: std::convert::Into<std::string::String>,
3427 {
3428 use std::iter::Iterator;
3429 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3430 self
3431 }
3432}
3433
3434impl wkt::message::Message for ListLoggingServersResponse {
3435 fn typename() -> &'static str {
3436 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersResponse"
3437 }
3438}
3439
3440#[doc(hidden)]
3441impl google_cloud_gax::paginator::internal::PageableResponse for ListLoggingServersResponse {
3442 type PageItem = crate::model::LoggingServer;
3443
3444 fn items(self) -> std::vec::Vec<Self::PageItem> {
3445 self.logging_servers
3446 }
3447
3448 fn next_page_token(&self) -> std::string::String {
3449 use std::clone::Clone;
3450 self.next_page_token.clone()
3451 }
3452}
3453
3454/// Request message for
3455/// [VmwareEngine.GetLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]
3456///
3457/// [google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]: crate::client::VmwareEngine::get_logging_server
3458#[derive(Clone, Default, PartialEq)]
3459#[non_exhaustive]
3460pub struct GetLoggingServerRequest {
3461 /// Required. The resource name of the Logging Server to retrieve.
3462 /// Resource names are schemeless URIs that follow the conventions in
3463 /// <https://cloud.google.com/apis/design/resource_names>.
3464 /// For example:
3465 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3466 pub name: std::string::String,
3467
3468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3469}
3470
3471impl GetLoggingServerRequest {
3472 pub fn new() -> Self {
3473 std::default::Default::default()
3474 }
3475
3476 /// Sets the value of [name][crate::model::GetLoggingServerRequest::name].
3477 ///
3478 /// # Example
3479 /// ```ignore,no_run
3480 /// # use google_cloud_vmwareengine_v1::model::GetLoggingServerRequest;
3481 /// let x = GetLoggingServerRequest::new().set_name("example");
3482 /// ```
3483 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3484 self.name = v.into();
3485 self
3486 }
3487}
3488
3489impl wkt::message::Message for GetLoggingServerRequest {
3490 fn typename() -> &'static str {
3491 "type.googleapis.com/google.cloud.vmwareengine.v1.GetLoggingServerRequest"
3492 }
3493}
3494
3495/// Request message for
3496/// [VmwareEngine.CreateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]
3497///
3498/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]: crate::client::VmwareEngine::create_logging_server
3499#[derive(Clone, Default, PartialEq)]
3500#[non_exhaustive]
3501pub struct CreateLoggingServerRequest {
3502 /// Required. The resource name of the private cloud
3503 /// to create a new Logging Server in.
3504 /// Resource names are schemeless URIs that follow the conventions in
3505 /// <https://cloud.google.com/apis/design/resource_names>.
3506 /// For example:
3507 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3508 pub parent: std::string::String,
3509
3510 /// Required. The initial description of a new logging server.
3511 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3512
3513 /// Required. The user-provided identifier of the `LoggingServer` to be
3514 /// created. This identifier must be unique among `LoggingServer` resources
3515 /// within the parent and becomes the final token in the name URI.
3516 /// The identifier must meet the following requirements:
3517 ///
3518 /// * Only contains 1-63 alphanumeric characters and hyphens
3519 /// * Begins with an alphabetical character
3520 /// * Ends with a non-hyphen character
3521 /// * Not formatted as a UUID
3522 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3523 /// (section 3.5)
3524 pub logging_server_id: std::string::String,
3525
3526 /// Optional. A request ID to identify requests. Specify a unique request ID
3527 /// so that if you must retry your request, the server will know to ignore
3528 /// the request if it has already been completed. The server guarantees that a
3529 /// request doesn't result in creation of duplicate commitments for at least 60
3530 /// minutes.
3531 ///
3532 /// For example, consider a situation where you make an initial request and the
3533 /// request times out. If you make the request again with the same request ID,
3534 /// the server can check if original operation with the same request ID was
3535 /// received, and if so, will ignore the second request. This prevents clients
3536 /// from accidentally creating duplicate commitments.
3537 ///
3538 /// The request ID must be a valid UUID with the exception that zero UUID is
3539 /// not supported (00000000-0000-0000-0000-000000000000).
3540 pub request_id: std::string::String,
3541
3542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3543}
3544
3545impl CreateLoggingServerRequest {
3546 pub fn new() -> Self {
3547 std::default::Default::default()
3548 }
3549
3550 /// Sets the value of [parent][crate::model::CreateLoggingServerRequest::parent].
3551 ///
3552 /// # Example
3553 /// ```ignore,no_run
3554 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3555 /// let x = CreateLoggingServerRequest::new().set_parent("example");
3556 /// ```
3557 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3558 self.parent = v.into();
3559 self
3560 }
3561
3562 /// Sets the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3563 ///
3564 /// # Example
3565 /// ```ignore,no_run
3566 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3567 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3568 /// let x = CreateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3569 /// ```
3570 pub fn set_logging_server<T>(mut self, v: T) -> Self
3571 where
3572 T: std::convert::Into<crate::model::LoggingServer>,
3573 {
3574 self.logging_server = std::option::Option::Some(v.into());
3575 self
3576 }
3577
3578 /// Sets or clears the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3579 ///
3580 /// # Example
3581 /// ```ignore,no_run
3582 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3583 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3584 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3585 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3586 /// ```
3587 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3588 where
3589 T: std::convert::Into<crate::model::LoggingServer>,
3590 {
3591 self.logging_server = v.map(|x| x.into());
3592 self
3593 }
3594
3595 /// Sets the value of [logging_server_id][crate::model::CreateLoggingServerRequest::logging_server_id].
3596 ///
3597 /// # Example
3598 /// ```ignore,no_run
3599 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3600 /// let x = CreateLoggingServerRequest::new().set_logging_server_id("example");
3601 /// ```
3602 pub fn set_logging_server_id<T: std::convert::Into<std::string::String>>(
3603 mut self,
3604 v: T,
3605 ) -> Self {
3606 self.logging_server_id = v.into();
3607 self
3608 }
3609
3610 /// Sets the value of [request_id][crate::model::CreateLoggingServerRequest::request_id].
3611 ///
3612 /// # Example
3613 /// ```ignore,no_run
3614 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3615 /// let x = CreateLoggingServerRequest::new().set_request_id("example");
3616 /// ```
3617 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.request_id = v.into();
3619 self
3620 }
3621}
3622
3623impl wkt::message::Message for CreateLoggingServerRequest {
3624 fn typename() -> &'static str {
3625 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateLoggingServerRequest"
3626 }
3627}
3628
3629/// Request message for
3630/// [VmwareEngine.UpdateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]
3631///
3632/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]: crate::client::VmwareEngine::update_logging_server
3633#[derive(Clone, Default, PartialEq)]
3634#[non_exhaustive]
3635pub struct UpdateLoggingServerRequest {
3636 /// Required. Field mask is used to specify the fields to be overwritten in the
3637 /// `LoggingServer` resource by the update.
3638 /// The fields specified in the `update_mask` are relative to the resource, not
3639 /// the full request. A field will be overwritten if it is in the mask. If the
3640 /// user does not provide a mask then all fields will be overwritten.
3641 pub update_mask: std::option::Option<wkt::FieldMask>,
3642
3643 /// Required. Logging server description.
3644 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3645
3646 /// Optional. A request ID to identify requests. Specify a unique request ID
3647 /// so that if you must retry your request, the server will know to ignore
3648 /// the request if it has already been completed. The server guarantees that a
3649 /// request doesn't result in creation of duplicate commitments for at least 60
3650 /// minutes.
3651 ///
3652 /// For example, consider a situation where you make an initial request and the
3653 /// request times out. If you make the request again with the same request ID,
3654 /// the server can check if original operation with the same request ID was
3655 /// received, and if so, will ignore the second request. This prevents clients
3656 /// from accidentally creating duplicate commitments.
3657 ///
3658 /// The request ID must be a valid UUID with the exception that zero UUID is
3659 /// not supported (00000000-0000-0000-0000-000000000000).
3660 pub request_id: std::string::String,
3661
3662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3663}
3664
3665impl UpdateLoggingServerRequest {
3666 pub fn new() -> Self {
3667 std::default::Default::default()
3668 }
3669
3670 /// Sets the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3671 ///
3672 /// # Example
3673 /// ```ignore,no_run
3674 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3675 /// use wkt::FieldMask;
3676 /// let x = UpdateLoggingServerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3677 /// ```
3678 pub fn set_update_mask<T>(mut self, v: T) -> Self
3679 where
3680 T: std::convert::Into<wkt::FieldMask>,
3681 {
3682 self.update_mask = std::option::Option::Some(v.into());
3683 self
3684 }
3685
3686 /// Sets or clears the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3687 ///
3688 /// # Example
3689 /// ```ignore,no_run
3690 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3691 /// use wkt::FieldMask;
3692 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3693 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3694 /// ```
3695 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3696 where
3697 T: std::convert::Into<wkt::FieldMask>,
3698 {
3699 self.update_mask = v.map(|x| x.into());
3700 self
3701 }
3702
3703 /// Sets the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3704 ///
3705 /// # Example
3706 /// ```ignore,no_run
3707 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3708 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3709 /// let x = UpdateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3710 /// ```
3711 pub fn set_logging_server<T>(mut self, v: T) -> Self
3712 where
3713 T: std::convert::Into<crate::model::LoggingServer>,
3714 {
3715 self.logging_server = std::option::Option::Some(v.into());
3716 self
3717 }
3718
3719 /// Sets or clears the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3720 ///
3721 /// # Example
3722 /// ```ignore,no_run
3723 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3724 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3725 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3726 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3727 /// ```
3728 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3729 where
3730 T: std::convert::Into<crate::model::LoggingServer>,
3731 {
3732 self.logging_server = v.map(|x| x.into());
3733 self
3734 }
3735
3736 /// Sets the value of [request_id][crate::model::UpdateLoggingServerRequest::request_id].
3737 ///
3738 /// # Example
3739 /// ```ignore,no_run
3740 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3741 /// let x = UpdateLoggingServerRequest::new().set_request_id("example");
3742 /// ```
3743 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3744 self.request_id = v.into();
3745 self
3746 }
3747}
3748
3749impl wkt::message::Message for UpdateLoggingServerRequest {
3750 fn typename() -> &'static str {
3751 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateLoggingServerRequest"
3752 }
3753}
3754
3755/// Request message for
3756/// [VmwareEngine.DeleteLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]
3757///
3758/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]: crate::client::VmwareEngine::delete_logging_server
3759#[derive(Clone, Default, PartialEq)]
3760#[non_exhaustive]
3761pub struct DeleteLoggingServerRequest {
3762 /// Required. The resource name of the logging server to delete.
3763 /// Resource names are schemeless URIs that follow the conventions in
3764 /// <https://cloud.google.com/apis/design/resource_names>.
3765 /// For example:
3766 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3767 pub name: std::string::String,
3768
3769 /// Optional. A request ID to identify requests. Specify a unique request ID
3770 /// so that if you must retry your request, the server will know to ignore
3771 /// the request if it has already been completed. The server guarantees that a
3772 /// request doesn't result in creation of duplicate commitments for at least 60
3773 /// minutes.
3774 ///
3775 /// For example, consider a situation where you make an initial request and the
3776 /// request times out. If you make the request again with the same request
3777 /// ID, the server can check if original operation with the same request ID
3778 /// was received, and if so, will ignore the second request. This prevents
3779 /// clients from accidentally creating duplicate commitments.
3780 ///
3781 /// The request ID must be a valid UUID with the exception that zero UUID is
3782 /// not supported (00000000-0000-0000-0000-000000000000).
3783 pub request_id: std::string::String,
3784
3785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3786}
3787
3788impl DeleteLoggingServerRequest {
3789 pub fn new() -> Self {
3790 std::default::Default::default()
3791 }
3792
3793 /// Sets the value of [name][crate::model::DeleteLoggingServerRequest::name].
3794 ///
3795 /// # Example
3796 /// ```ignore,no_run
3797 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3798 /// let x = DeleteLoggingServerRequest::new().set_name("example");
3799 /// ```
3800 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3801 self.name = v.into();
3802 self
3803 }
3804
3805 /// Sets the value of [request_id][crate::model::DeleteLoggingServerRequest::request_id].
3806 ///
3807 /// # Example
3808 /// ```ignore,no_run
3809 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3810 /// let x = DeleteLoggingServerRequest::new().set_request_id("example");
3811 /// ```
3812 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3813 self.request_id = v.into();
3814 self
3815 }
3816}
3817
3818impl wkt::message::Message for DeleteLoggingServerRequest {
3819 fn typename() -> &'static str {
3820 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteLoggingServerRequest"
3821 }
3822}
3823
3824/// Represents the metadata of the long-running operation.
3825#[derive(Clone, Default, PartialEq)]
3826#[non_exhaustive]
3827pub struct OperationMetadata {
3828 /// Output only. The time the operation was created.
3829 pub create_time: std::option::Option<wkt::Timestamp>,
3830
3831 /// Output only. The time the operation finished running.
3832 pub end_time: std::option::Option<wkt::Timestamp>,
3833
3834 /// Output only. Server-defined resource path for the target of the operation.
3835 pub target: std::string::String,
3836
3837 /// Output only. Name of the verb executed by the operation.
3838 pub verb: std::string::String,
3839
3840 /// Output only. Human-readable status of the operation, if any.
3841 pub status_message: std::string::String,
3842
3843 /// Output only. True if the user has requested cancellation
3844 /// of the operation; false otherwise.
3845 /// Operations that have successfully been cancelled
3846 /// have [Operation.error][] value with a
3847 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3848 /// `Code.CANCELLED`.
3849 ///
3850 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3851 pub requested_cancellation: bool,
3852
3853 /// Output only. API version used to start the operation.
3854 pub api_version: std::string::String,
3855
3856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3857}
3858
3859impl OperationMetadata {
3860 pub fn new() -> Self {
3861 std::default::Default::default()
3862 }
3863
3864 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3865 ///
3866 /// # Example
3867 /// ```ignore,no_run
3868 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3869 /// use wkt::Timestamp;
3870 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3871 /// ```
3872 pub fn set_create_time<T>(mut self, v: T) -> Self
3873 where
3874 T: std::convert::Into<wkt::Timestamp>,
3875 {
3876 self.create_time = std::option::Option::Some(v.into());
3877 self
3878 }
3879
3880 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3881 ///
3882 /// # Example
3883 /// ```ignore,no_run
3884 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3885 /// use wkt::Timestamp;
3886 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3887 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3888 /// ```
3889 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3890 where
3891 T: std::convert::Into<wkt::Timestamp>,
3892 {
3893 self.create_time = v.map(|x| x.into());
3894 self
3895 }
3896
3897 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3898 ///
3899 /// # Example
3900 /// ```ignore,no_run
3901 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3902 /// use wkt::Timestamp;
3903 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3904 /// ```
3905 pub fn set_end_time<T>(mut self, v: T) -> Self
3906 where
3907 T: std::convert::Into<wkt::Timestamp>,
3908 {
3909 self.end_time = std::option::Option::Some(v.into());
3910 self
3911 }
3912
3913 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3914 ///
3915 /// # Example
3916 /// ```ignore,no_run
3917 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3918 /// use wkt::Timestamp;
3919 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3920 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3921 /// ```
3922 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3923 where
3924 T: std::convert::Into<wkt::Timestamp>,
3925 {
3926 self.end_time = v.map(|x| x.into());
3927 self
3928 }
3929
3930 /// Sets the value of [target][crate::model::OperationMetadata::target].
3931 ///
3932 /// # Example
3933 /// ```ignore,no_run
3934 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3935 /// let x = OperationMetadata::new().set_target("example");
3936 /// ```
3937 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3938 self.target = v.into();
3939 self
3940 }
3941
3942 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3943 ///
3944 /// # Example
3945 /// ```ignore,no_run
3946 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3947 /// let x = OperationMetadata::new().set_verb("example");
3948 /// ```
3949 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3950 self.verb = v.into();
3951 self
3952 }
3953
3954 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3955 ///
3956 /// # Example
3957 /// ```ignore,no_run
3958 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3959 /// let x = OperationMetadata::new().set_status_message("example");
3960 /// ```
3961 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.status_message = v.into();
3963 self
3964 }
3965
3966 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3967 ///
3968 /// # Example
3969 /// ```ignore,no_run
3970 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3971 /// let x = OperationMetadata::new().set_requested_cancellation(true);
3972 /// ```
3973 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3974 self.requested_cancellation = v.into();
3975 self
3976 }
3977
3978 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3979 ///
3980 /// # Example
3981 /// ```ignore,no_run
3982 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3983 /// let x = OperationMetadata::new().set_api_version("example");
3984 /// ```
3985 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3986 self.api_version = v.into();
3987 self
3988 }
3989}
3990
3991impl wkt::message::Message for OperationMetadata {
3992 fn typename() -> &'static str {
3993 "type.googleapis.com/google.cloud.vmwareengine.v1.OperationMetadata"
3994 }
3995}
3996
3997/// Request message for
3998/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
3999///
4000/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4001#[derive(Clone, Default, PartialEq)]
4002#[non_exhaustive]
4003pub struct ListNodeTypesRequest {
4004 /// Required. The resource name of the location to be queried for node types.
4005 /// Resource names are schemeless URIs that follow the conventions in
4006 /// <https://cloud.google.com/apis/design/resource_names>.
4007 /// For example:
4008 /// `projects/my-project/locations/us-central1-a`
4009 pub parent: std::string::String,
4010
4011 /// The maximum number of node types to return in one page.
4012 /// The service may return fewer than this value.
4013 /// The maximum value is coerced to 1000.
4014 /// The default value of this field is 500.
4015 pub page_size: i32,
4016
4017 /// A page token, received from a previous `ListNodeTypes` call.
4018 /// Provide this to retrieve the subsequent page.
4019 ///
4020 /// When paginating, all other parameters provided to
4021 /// `ListNodeTypes` must match the call that provided the page token.
4022 pub page_token: std::string::String,
4023
4024 /// A filter expression that matches resources returned in the response.
4025 /// The expression must specify the field name, a comparison
4026 /// operator, and the value that you want to use for filtering. The value
4027 /// must be a string, a number, or a boolean. The comparison operator
4028 /// must be `=`, `!=`, `>`, or `<`.
4029 ///
4030 /// For example, if you are filtering a list of node types, you can
4031 /// exclude the ones named `standard-72` by specifying
4032 /// `name != "standard-72"`.
4033 ///
4034 /// To filter on multiple expressions, provide each separate expression within
4035 /// parentheses. For example:
4036 ///
4037 /// ```norust
4038 /// (name = "standard-72")
4039 /// (virtual_cpu_count > 2)
4040 /// ```
4041 ///
4042 /// By default, each expression is an `AND` expression. However, you
4043 /// can include `AND` and `OR` expressions explicitly.
4044 /// For example:
4045 ///
4046 /// ```norust
4047 /// (name = "standard-96") AND
4048 /// (virtual_cpu_count > 2) OR
4049 /// (name = "standard-72")
4050 /// ```
4051 pub filter: std::string::String,
4052
4053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4054}
4055
4056impl ListNodeTypesRequest {
4057 pub fn new() -> Self {
4058 std::default::Default::default()
4059 }
4060
4061 /// Sets the value of [parent][crate::model::ListNodeTypesRequest::parent].
4062 ///
4063 /// # Example
4064 /// ```ignore,no_run
4065 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4066 /// let x = ListNodeTypesRequest::new().set_parent("example");
4067 /// ```
4068 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4069 self.parent = v.into();
4070 self
4071 }
4072
4073 /// Sets the value of [page_size][crate::model::ListNodeTypesRequest::page_size].
4074 ///
4075 /// # Example
4076 /// ```ignore,no_run
4077 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4078 /// let x = ListNodeTypesRequest::new().set_page_size(42);
4079 /// ```
4080 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4081 self.page_size = v.into();
4082 self
4083 }
4084
4085 /// Sets the value of [page_token][crate::model::ListNodeTypesRequest::page_token].
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4090 /// let x = ListNodeTypesRequest::new().set_page_token("example");
4091 /// ```
4092 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.page_token = v.into();
4094 self
4095 }
4096
4097 /// Sets the value of [filter][crate::model::ListNodeTypesRequest::filter].
4098 ///
4099 /// # Example
4100 /// ```ignore,no_run
4101 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4102 /// let x = ListNodeTypesRequest::new().set_filter("example");
4103 /// ```
4104 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4105 self.filter = v.into();
4106 self
4107 }
4108}
4109
4110impl wkt::message::Message for ListNodeTypesRequest {
4111 fn typename() -> &'static str {
4112 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesRequest"
4113 }
4114}
4115
4116/// Response message for
4117/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
4118///
4119/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4120#[derive(Clone, Default, PartialEq)]
4121#[non_exhaustive]
4122pub struct ListNodeTypesResponse {
4123 /// A list of Node Types.
4124 pub node_types: std::vec::Vec<crate::model::NodeType>,
4125
4126 /// A token, which can be sent as `page_token` to retrieve the next page.
4127 /// If this field is omitted, there are no subsequent pages.
4128 pub next_page_token: std::string::String,
4129
4130 /// Locations that could not be reached when making an aggregated query using
4131 /// wildcards.
4132 pub unreachable: std::vec::Vec<std::string::String>,
4133
4134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4135}
4136
4137impl ListNodeTypesResponse {
4138 pub fn new() -> Self {
4139 std::default::Default::default()
4140 }
4141
4142 /// Sets the value of [node_types][crate::model::ListNodeTypesResponse::node_types].
4143 ///
4144 /// # Example
4145 /// ```ignore,no_run
4146 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4147 /// use google_cloud_vmwareengine_v1::model::NodeType;
4148 /// let x = ListNodeTypesResponse::new()
4149 /// .set_node_types([
4150 /// NodeType::default()/* use setters */,
4151 /// NodeType::default()/* use (different) setters */,
4152 /// ]);
4153 /// ```
4154 pub fn set_node_types<T, V>(mut self, v: T) -> Self
4155 where
4156 T: std::iter::IntoIterator<Item = V>,
4157 V: std::convert::Into<crate::model::NodeType>,
4158 {
4159 use std::iter::Iterator;
4160 self.node_types = v.into_iter().map(|i| i.into()).collect();
4161 self
4162 }
4163
4164 /// Sets the value of [next_page_token][crate::model::ListNodeTypesResponse::next_page_token].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4169 /// let x = ListNodeTypesResponse::new().set_next_page_token("example");
4170 /// ```
4171 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4172 self.next_page_token = v.into();
4173 self
4174 }
4175
4176 /// Sets the value of [unreachable][crate::model::ListNodeTypesResponse::unreachable].
4177 ///
4178 /// # Example
4179 /// ```ignore,no_run
4180 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4181 /// let x = ListNodeTypesResponse::new().set_unreachable(["a", "b", "c"]);
4182 /// ```
4183 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4184 where
4185 T: std::iter::IntoIterator<Item = V>,
4186 V: std::convert::Into<std::string::String>,
4187 {
4188 use std::iter::Iterator;
4189 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4190 self
4191 }
4192}
4193
4194impl wkt::message::Message for ListNodeTypesResponse {
4195 fn typename() -> &'static str {
4196 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesResponse"
4197 }
4198}
4199
4200#[doc(hidden)]
4201impl google_cloud_gax::paginator::internal::PageableResponse for ListNodeTypesResponse {
4202 type PageItem = crate::model::NodeType;
4203
4204 fn items(self) -> std::vec::Vec<Self::PageItem> {
4205 self.node_types
4206 }
4207
4208 fn next_page_token(&self) -> std::string::String {
4209 use std::clone::Clone;
4210 self.next_page_token.clone()
4211 }
4212}
4213
4214/// Request message for
4215/// [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]
4216///
4217/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]: crate::client::VmwareEngine::get_node_type
4218#[derive(Clone, Default, PartialEq)]
4219#[non_exhaustive]
4220pub struct GetNodeTypeRequest {
4221 /// Required. The resource name of the node type to retrieve.
4222 /// Resource names are schemeless URIs that follow the conventions in
4223 /// <https://cloud.google.com/apis/design/resource_names>.
4224 /// For example:
4225 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
4226 pub name: std::string::String,
4227
4228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4229}
4230
4231impl GetNodeTypeRequest {
4232 pub fn new() -> Self {
4233 std::default::Default::default()
4234 }
4235
4236 /// Sets the value of [name][crate::model::GetNodeTypeRequest::name].
4237 ///
4238 /// # Example
4239 /// ```ignore,no_run
4240 /// # use google_cloud_vmwareengine_v1::model::GetNodeTypeRequest;
4241 /// let x = GetNodeTypeRequest::new().set_name("example");
4242 /// ```
4243 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4244 self.name = v.into();
4245 self
4246 }
4247}
4248
4249impl wkt::message::Message for GetNodeTypeRequest {
4250 fn typename() -> &'static str {
4251 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeTypeRequest"
4252 }
4253}
4254
4255/// Request message for
4256/// [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]
4257///
4258/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]: crate::client::VmwareEngine::show_nsx_credentials
4259#[derive(Clone, Default, PartialEq)]
4260#[non_exhaustive]
4261pub struct ShowNsxCredentialsRequest {
4262 /// Required. The resource name of the private cloud
4263 /// to be queried for credentials.
4264 /// Resource names are schemeless URIs that follow the conventions in
4265 /// <https://cloud.google.com/apis/design/resource_names>.
4266 /// For example:
4267 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4268 pub private_cloud: std::string::String,
4269
4270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4271}
4272
4273impl ShowNsxCredentialsRequest {
4274 pub fn new() -> Self {
4275 std::default::Default::default()
4276 }
4277
4278 /// Sets the value of [private_cloud][crate::model::ShowNsxCredentialsRequest::private_cloud].
4279 ///
4280 /// # Example
4281 /// ```ignore,no_run
4282 /// # use google_cloud_vmwareengine_v1::model::ShowNsxCredentialsRequest;
4283 /// let x = ShowNsxCredentialsRequest::new().set_private_cloud("example");
4284 /// ```
4285 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4286 self.private_cloud = v.into();
4287 self
4288 }
4289}
4290
4291impl wkt::message::Message for ShowNsxCredentialsRequest {
4292 fn typename() -> &'static str {
4293 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"
4294 }
4295}
4296
4297/// Request message for
4298/// [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]
4299///
4300/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]: crate::client::VmwareEngine::show_vcenter_credentials
4301#[derive(Clone, Default, PartialEq)]
4302#[non_exhaustive]
4303pub struct ShowVcenterCredentialsRequest {
4304 /// Required. The resource name of the private cloud
4305 /// to be queried for credentials.
4306 /// Resource names are schemeless URIs that follow the conventions in
4307 /// <https://cloud.google.com/apis/design/resource_names>.
4308 /// For example:
4309 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4310 pub private_cloud: std::string::String,
4311
4312 /// Optional. The username of the user to be queried for credentials.
4313 /// The default value of this field is CloudOwner@gve.local.
4314 /// The provided value must be one of the following:
4315 /// CloudOwner@gve.local,
4316 /// solution-user-01@gve.local,
4317 /// solution-user-02@gve.local,
4318 /// solution-user-03@gve.local,
4319 /// solution-user-04@gve.local,
4320 /// solution-user-05@gve.local,
4321 /// zertoadmin@gve.local.
4322 pub username: std::string::String,
4323
4324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4325}
4326
4327impl ShowVcenterCredentialsRequest {
4328 pub fn new() -> Self {
4329 std::default::Default::default()
4330 }
4331
4332 /// Sets the value of [private_cloud][crate::model::ShowVcenterCredentialsRequest::private_cloud].
4333 ///
4334 /// # Example
4335 /// ```ignore,no_run
4336 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4337 /// let x = ShowVcenterCredentialsRequest::new().set_private_cloud("example");
4338 /// ```
4339 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.private_cloud = v.into();
4341 self
4342 }
4343
4344 /// Sets the value of [username][crate::model::ShowVcenterCredentialsRequest::username].
4345 ///
4346 /// # Example
4347 /// ```ignore,no_run
4348 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4349 /// let x = ShowVcenterCredentialsRequest::new().set_username("example");
4350 /// ```
4351 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4352 self.username = v.into();
4353 self
4354 }
4355}
4356
4357impl wkt::message::Message for ShowVcenterCredentialsRequest {
4358 fn typename() -> &'static str {
4359 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"
4360 }
4361}
4362
4363/// Request message for
4364/// [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]
4365///
4366/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]: crate::client::VmwareEngine::reset_nsx_credentials
4367#[derive(Clone, Default, PartialEq)]
4368#[non_exhaustive]
4369pub struct ResetNsxCredentialsRequest {
4370 /// Required. The resource name of the private cloud
4371 /// to reset credentials for.
4372 /// Resource names are schemeless URIs that follow the conventions in
4373 /// <https://cloud.google.com/apis/design/resource_names>.
4374 /// For example:
4375 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4376 pub private_cloud: std::string::String,
4377
4378 /// Optional. A request ID to identify requests. Specify a unique request ID
4379 /// so that if you must retry your request, the server will know to ignore
4380 /// the request if it has already been completed. The server guarantees that a
4381 /// request doesn't result in creation of duplicate commitments for at least 60
4382 /// minutes.
4383 ///
4384 /// For example, consider a situation where you make an initial request and the
4385 /// request times out. If you make the request again with the same request
4386 /// ID, the server can check if original operation with the same request ID
4387 /// was received, and if so, will ignore the second request. This prevents
4388 /// clients from accidentally creating duplicate commitments.
4389 ///
4390 /// The request ID must be a valid UUID with the exception that zero UUID is
4391 /// not supported (00000000-0000-0000-0000-000000000000).
4392 pub request_id: std::string::String,
4393
4394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4395}
4396
4397impl ResetNsxCredentialsRequest {
4398 pub fn new() -> Self {
4399 std::default::Default::default()
4400 }
4401
4402 /// Sets the value of [private_cloud][crate::model::ResetNsxCredentialsRequest::private_cloud].
4403 ///
4404 /// # Example
4405 /// ```ignore,no_run
4406 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4407 /// let x = ResetNsxCredentialsRequest::new().set_private_cloud("example");
4408 /// ```
4409 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4410 self.private_cloud = v.into();
4411 self
4412 }
4413
4414 /// Sets the value of [request_id][crate::model::ResetNsxCredentialsRequest::request_id].
4415 ///
4416 /// # Example
4417 /// ```ignore,no_run
4418 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4419 /// let x = ResetNsxCredentialsRequest::new().set_request_id("example");
4420 /// ```
4421 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4422 self.request_id = v.into();
4423 self
4424 }
4425}
4426
4427impl wkt::message::Message for ResetNsxCredentialsRequest {
4428 fn typename() -> &'static str {
4429 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"
4430 }
4431}
4432
4433/// Request message for
4434/// [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]
4435///
4436/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]: crate::client::VmwareEngine::reset_vcenter_credentials
4437#[derive(Clone, Default, PartialEq)]
4438#[non_exhaustive]
4439pub struct ResetVcenterCredentialsRequest {
4440 /// Required. The resource name of the private cloud
4441 /// to reset credentials for.
4442 /// Resource names are schemeless URIs that follow the conventions in
4443 /// <https://cloud.google.com/apis/design/resource_names>.
4444 /// For example:
4445 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4446 pub private_cloud: std::string::String,
4447
4448 /// Optional. A request ID to identify requests. Specify a unique request ID
4449 /// so that if you must retry your request, the server will know to ignore
4450 /// the request if it has already been completed. The server guarantees that a
4451 /// request doesn't result in creation of duplicate commitments for at least 60
4452 /// minutes.
4453 ///
4454 /// For example, consider a situation where you make an initial request and the
4455 /// request times out. If you make the request again with the same request
4456 /// ID, the server can check if original operation with the same request ID
4457 /// was received, and if so, will ignore the second request. This prevents
4458 /// clients from accidentally creating duplicate commitments.
4459 ///
4460 /// The request ID must be a valid UUID with the exception that zero UUID is
4461 /// not supported (00000000-0000-0000-0000-000000000000).
4462 pub request_id: std::string::String,
4463
4464 /// Optional. The username of the user to be to reset the credentials.
4465 /// The default value of this field is CloudOwner@gve.local.
4466 /// The provided value should be one of the following:
4467 /// solution-user-01@gve.local,
4468 /// solution-user-02@gve.local,
4469 /// solution-user-03@gve.local,
4470 /// solution-user-04@gve.local,
4471 /// solution-user-05@gve.local,
4472 /// zertoadmin@gve.local.
4473 pub username: std::string::String,
4474
4475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4476}
4477
4478impl ResetVcenterCredentialsRequest {
4479 pub fn new() -> Self {
4480 std::default::Default::default()
4481 }
4482
4483 /// Sets the value of [private_cloud][crate::model::ResetVcenterCredentialsRequest::private_cloud].
4484 ///
4485 /// # Example
4486 /// ```ignore,no_run
4487 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4488 /// let x = ResetVcenterCredentialsRequest::new().set_private_cloud("example");
4489 /// ```
4490 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4491 self.private_cloud = v.into();
4492 self
4493 }
4494
4495 /// Sets the value of [request_id][crate::model::ResetVcenterCredentialsRequest::request_id].
4496 ///
4497 /// # Example
4498 /// ```ignore,no_run
4499 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4500 /// let x = ResetVcenterCredentialsRequest::new().set_request_id("example");
4501 /// ```
4502 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.request_id = v.into();
4504 self
4505 }
4506
4507 /// Sets the value of [username][crate::model::ResetVcenterCredentialsRequest::username].
4508 ///
4509 /// # Example
4510 /// ```ignore,no_run
4511 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4512 /// let x = ResetVcenterCredentialsRequest::new().set_username("example");
4513 /// ```
4514 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4515 self.username = v.into();
4516 self
4517 }
4518}
4519
4520impl wkt::message::Message for ResetVcenterCredentialsRequest {
4521 fn typename() -> &'static str {
4522 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"
4523 }
4524}
4525
4526/// Response message for
4527/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4528///
4529/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4530#[derive(Clone, Default, PartialEq)]
4531#[non_exhaustive]
4532pub struct ListHcxActivationKeysResponse {
4533 /// List of HCX activation keys.
4534 pub hcx_activation_keys: std::vec::Vec<crate::model::HcxActivationKey>,
4535
4536 /// A token, which can be sent as `page_token` to retrieve the next page.
4537 /// If this field is omitted, there are no subsequent pages.
4538 pub next_page_token: std::string::String,
4539
4540 /// Locations that could not be reached when making an aggregated query using
4541 /// wildcards.
4542 pub unreachable: std::vec::Vec<std::string::String>,
4543
4544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4545}
4546
4547impl ListHcxActivationKeysResponse {
4548 pub fn new() -> Self {
4549 std::default::Default::default()
4550 }
4551
4552 /// Sets the value of [hcx_activation_keys][crate::model::ListHcxActivationKeysResponse::hcx_activation_keys].
4553 ///
4554 /// # Example
4555 /// ```ignore,no_run
4556 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4557 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4558 /// let x = ListHcxActivationKeysResponse::new()
4559 /// .set_hcx_activation_keys([
4560 /// HcxActivationKey::default()/* use setters */,
4561 /// HcxActivationKey::default()/* use (different) setters */,
4562 /// ]);
4563 /// ```
4564 pub fn set_hcx_activation_keys<T, V>(mut self, v: T) -> Self
4565 where
4566 T: std::iter::IntoIterator<Item = V>,
4567 V: std::convert::Into<crate::model::HcxActivationKey>,
4568 {
4569 use std::iter::Iterator;
4570 self.hcx_activation_keys = v.into_iter().map(|i| i.into()).collect();
4571 self
4572 }
4573
4574 /// Sets the value of [next_page_token][crate::model::ListHcxActivationKeysResponse::next_page_token].
4575 ///
4576 /// # Example
4577 /// ```ignore,no_run
4578 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4579 /// let x = ListHcxActivationKeysResponse::new().set_next_page_token("example");
4580 /// ```
4581 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4582 self.next_page_token = v.into();
4583 self
4584 }
4585
4586 /// Sets the value of [unreachable][crate::model::ListHcxActivationKeysResponse::unreachable].
4587 ///
4588 /// # Example
4589 /// ```ignore,no_run
4590 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4591 /// let x = ListHcxActivationKeysResponse::new().set_unreachable(["a", "b", "c"]);
4592 /// ```
4593 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4594 where
4595 T: std::iter::IntoIterator<Item = V>,
4596 V: std::convert::Into<std::string::String>,
4597 {
4598 use std::iter::Iterator;
4599 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4600 self
4601 }
4602}
4603
4604impl wkt::message::Message for ListHcxActivationKeysResponse {
4605 fn typename() -> &'static str {
4606 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"
4607 }
4608}
4609
4610#[doc(hidden)]
4611impl google_cloud_gax::paginator::internal::PageableResponse for ListHcxActivationKeysResponse {
4612 type PageItem = crate::model::HcxActivationKey;
4613
4614 fn items(self) -> std::vec::Vec<Self::PageItem> {
4615 self.hcx_activation_keys
4616 }
4617
4618 fn next_page_token(&self) -> std::string::String {
4619 use std::clone::Clone;
4620 self.next_page_token.clone()
4621 }
4622}
4623
4624/// Request message for
4625/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4626///
4627/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4628#[derive(Clone, Default, PartialEq)]
4629#[non_exhaustive]
4630pub struct ListHcxActivationKeysRequest {
4631 /// Required. The resource name of the private cloud
4632 /// to be queried for HCX activation keys.
4633 /// Resource names are schemeless URIs that follow the conventions in
4634 /// <https://cloud.google.com/apis/design/resource_names>.
4635 /// For example:
4636 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4637 pub parent: std::string::String,
4638
4639 /// The maximum number of HCX activation keys to return in one page.
4640 /// The service may return fewer than this value.
4641 /// The maximum value is coerced to 1000.
4642 /// The default value of this field is 500.
4643 pub page_size: i32,
4644
4645 /// A page token, received from a previous `ListHcxActivationKeys` call.
4646 /// Provide this to retrieve the subsequent page.
4647 ///
4648 /// When paginating, all other parameters provided to
4649 /// `ListHcxActivationKeys` must match the call that provided the page
4650 /// token.
4651 pub page_token: std::string::String,
4652
4653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4654}
4655
4656impl ListHcxActivationKeysRequest {
4657 pub fn new() -> Self {
4658 std::default::Default::default()
4659 }
4660
4661 /// Sets the value of [parent][crate::model::ListHcxActivationKeysRequest::parent].
4662 ///
4663 /// # Example
4664 /// ```ignore,no_run
4665 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4666 /// let x = ListHcxActivationKeysRequest::new().set_parent("example");
4667 /// ```
4668 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4669 self.parent = v.into();
4670 self
4671 }
4672
4673 /// Sets the value of [page_size][crate::model::ListHcxActivationKeysRequest::page_size].
4674 ///
4675 /// # Example
4676 /// ```ignore,no_run
4677 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4678 /// let x = ListHcxActivationKeysRequest::new().set_page_size(42);
4679 /// ```
4680 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4681 self.page_size = v.into();
4682 self
4683 }
4684
4685 /// Sets the value of [page_token][crate::model::ListHcxActivationKeysRequest::page_token].
4686 ///
4687 /// # Example
4688 /// ```ignore,no_run
4689 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4690 /// let x = ListHcxActivationKeysRequest::new().set_page_token("example");
4691 /// ```
4692 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4693 self.page_token = v.into();
4694 self
4695 }
4696}
4697
4698impl wkt::message::Message for ListHcxActivationKeysRequest {
4699 fn typename() -> &'static str {
4700 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"
4701 }
4702}
4703
4704/// Request message for [VmwareEngine.GetHcxActivationKeys][]
4705#[derive(Clone, Default, PartialEq)]
4706#[non_exhaustive]
4707pub struct GetHcxActivationKeyRequest {
4708 /// Required. The resource name of the HCX activation key to retrieve.
4709 /// Resource names are schemeless URIs that follow the conventions in
4710 /// <https://cloud.google.com/apis/design/resource_names>.
4711 /// For example:
4712 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
4713 pub name: std::string::String,
4714
4715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4716}
4717
4718impl GetHcxActivationKeyRequest {
4719 pub fn new() -> Self {
4720 std::default::Default::default()
4721 }
4722
4723 /// Sets the value of [name][crate::model::GetHcxActivationKeyRequest::name].
4724 ///
4725 /// # Example
4726 /// ```ignore,no_run
4727 /// # use google_cloud_vmwareengine_v1::model::GetHcxActivationKeyRequest;
4728 /// let x = GetHcxActivationKeyRequest::new().set_name("example");
4729 /// ```
4730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4731 self.name = v.into();
4732 self
4733 }
4734}
4735
4736impl wkt::message::Message for GetHcxActivationKeyRequest {
4737 fn typename() -> &'static str {
4738 "type.googleapis.com/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"
4739 }
4740}
4741
4742/// Request message for
4743/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
4744///
4745/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
4746#[derive(Clone, Default, PartialEq)]
4747#[non_exhaustive]
4748pub struct CreateHcxActivationKeyRequest {
4749 /// Required. The resource name of the private cloud to create the key for.
4750 /// Resource names are schemeless URIs that follow the conventions in
4751 /// <https://cloud.google.com/apis/design/resource_names>.
4752 /// For example:
4753 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4754 pub parent: std::string::String,
4755
4756 /// Required. The initial description of a new HCX activation key. When
4757 /// creating a new key, this field must be an empty object.
4758 pub hcx_activation_key: std::option::Option<crate::model::HcxActivationKey>,
4759
4760 /// Required. The user-provided identifier of the `HcxActivationKey` to be
4761 /// created. This identifier must be unique among `HcxActivationKey` resources
4762 /// within the parent and becomes the final token in the name URI.
4763 /// The identifier must meet the following requirements:
4764 ///
4765 /// * Only contains 1-63 alphanumeric characters and hyphens
4766 /// * Begins with an alphabetical character
4767 /// * Ends with a non-hyphen character
4768 /// * Not formatted as a UUID
4769 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
4770 /// (section 3.5)
4771 pub hcx_activation_key_id: std::string::String,
4772
4773 /// A request ID to identify requests. Specify a unique request ID
4774 /// so that if you must retry your request, the server will know to ignore
4775 /// the request if it has already been completed. The server guarantees that a
4776 /// request doesn't result in creation of duplicate commitments for at least 60
4777 /// minutes.
4778 ///
4779 /// For example, consider a situation where you make an initial request and the
4780 /// request times out. If you make the request again with the same request ID,
4781 /// the server can check if original operation with the same request ID was
4782 /// received, and if so, will ignore the second request. This prevents clients
4783 /// from accidentally creating duplicate commitments.
4784 ///
4785 /// The request ID must be a valid UUID with the exception that zero UUID is
4786 /// not supported (00000000-0000-0000-0000-000000000000).
4787 pub request_id: std::string::String,
4788
4789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4790}
4791
4792impl CreateHcxActivationKeyRequest {
4793 pub fn new() -> Self {
4794 std::default::Default::default()
4795 }
4796
4797 /// Sets the value of [parent][crate::model::CreateHcxActivationKeyRequest::parent].
4798 ///
4799 /// # Example
4800 /// ```ignore,no_run
4801 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4802 /// let x = CreateHcxActivationKeyRequest::new().set_parent("example");
4803 /// ```
4804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4805 self.parent = v.into();
4806 self
4807 }
4808
4809 /// Sets the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4810 ///
4811 /// # Example
4812 /// ```ignore,no_run
4813 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4814 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4815 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key(HcxActivationKey::default()/* use setters */);
4816 /// ```
4817 pub fn set_hcx_activation_key<T>(mut self, v: T) -> Self
4818 where
4819 T: std::convert::Into<crate::model::HcxActivationKey>,
4820 {
4821 self.hcx_activation_key = std::option::Option::Some(v.into());
4822 self
4823 }
4824
4825 /// Sets or clears the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4826 ///
4827 /// # Example
4828 /// ```ignore,no_run
4829 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4830 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4831 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(Some(HcxActivationKey::default()/* use setters */));
4832 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(None::<HcxActivationKey>);
4833 /// ```
4834 pub fn set_or_clear_hcx_activation_key<T>(mut self, v: std::option::Option<T>) -> Self
4835 where
4836 T: std::convert::Into<crate::model::HcxActivationKey>,
4837 {
4838 self.hcx_activation_key = v.map(|x| x.into());
4839 self
4840 }
4841
4842 /// Sets the value of [hcx_activation_key_id][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key_id].
4843 ///
4844 /// # Example
4845 /// ```ignore,no_run
4846 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4847 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key_id("example");
4848 /// ```
4849 pub fn set_hcx_activation_key_id<T: std::convert::Into<std::string::String>>(
4850 mut self,
4851 v: T,
4852 ) -> Self {
4853 self.hcx_activation_key_id = v.into();
4854 self
4855 }
4856
4857 /// Sets the value of [request_id][crate::model::CreateHcxActivationKeyRequest::request_id].
4858 ///
4859 /// # Example
4860 /// ```ignore,no_run
4861 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4862 /// let x = CreateHcxActivationKeyRequest::new().set_request_id("example");
4863 /// ```
4864 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4865 self.request_id = v.into();
4866 self
4867 }
4868}
4869
4870impl wkt::message::Message for CreateHcxActivationKeyRequest {
4871 fn typename() -> &'static str {
4872 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"
4873 }
4874}
4875
4876/// Request message for
4877/// [VmwareEngine.GetDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]
4878///
4879/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]: crate::client::VmwareEngine::get_dns_forwarding
4880#[derive(Clone, Default, PartialEq)]
4881#[non_exhaustive]
4882pub struct GetDnsForwardingRequest {
4883 /// Required. The resource name of a `DnsForwarding` to retrieve.
4884 /// Resource names are schemeless URIs that follow the conventions in
4885 /// <https://cloud.google.com/apis/design/resource_names>.
4886 /// For example:
4887 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
4888 pub name: std::string::String,
4889
4890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4891}
4892
4893impl GetDnsForwardingRequest {
4894 pub fn new() -> Self {
4895 std::default::Default::default()
4896 }
4897
4898 /// Sets the value of [name][crate::model::GetDnsForwardingRequest::name].
4899 ///
4900 /// # Example
4901 /// ```ignore,no_run
4902 /// # use google_cloud_vmwareengine_v1::model::GetDnsForwardingRequest;
4903 /// let x = GetDnsForwardingRequest::new().set_name("example");
4904 /// ```
4905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4906 self.name = v.into();
4907 self
4908 }
4909}
4910
4911impl wkt::message::Message for GetDnsForwardingRequest {
4912 fn typename() -> &'static str {
4913 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsForwardingRequest"
4914 }
4915}
4916
4917/// Request message for
4918/// [VmwareEngine.UpdateDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]
4919///
4920/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]: crate::client::VmwareEngine::update_dns_forwarding
4921#[derive(Clone, Default, PartialEq)]
4922#[non_exhaustive]
4923pub struct UpdateDnsForwardingRequest {
4924 /// Required. DnsForwarding config details.
4925 pub dns_forwarding: std::option::Option<crate::model::DnsForwarding>,
4926
4927 /// Required. Field mask is used to specify the fields to be overwritten in the
4928 /// `DnsForwarding` resource by the update.
4929 /// The fields specified in the `update_mask` are relative to the resource, not
4930 /// the full request. A field will be overwritten if it is in the mask. If the
4931 /// user does not provide a mask then all fields will be overwritten.
4932 pub update_mask: std::option::Option<wkt::FieldMask>,
4933
4934 /// Optional. A request ID to identify requests. Specify a unique request ID
4935 /// so that if you must retry your request, the server will know to ignore
4936 /// the request if it has already been completed. The server guarantees that a
4937 /// request doesn't result in creation of duplicate commitments for at least 60
4938 /// minutes.
4939 ///
4940 /// For example, consider a situation where you make an initial request and the
4941 /// request times out. If you make the request again with the same request ID,
4942 /// the server can check if original operation with the same request ID was
4943 /// received, and if so, will ignore the second request. This prevents clients
4944 /// from accidentally creating duplicate commitments.
4945 ///
4946 /// The request ID must be a valid UUID with the exception that zero UUID is
4947 /// not supported (00000000-0000-0000-0000-000000000000).
4948 pub request_id: std::string::String,
4949
4950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4951}
4952
4953impl UpdateDnsForwardingRequest {
4954 pub fn new() -> Self {
4955 std::default::Default::default()
4956 }
4957
4958 /// Sets the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4959 ///
4960 /// # Example
4961 /// ```ignore,no_run
4962 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4963 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4964 /// let x = UpdateDnsForwardingRequest::new().set_dns_forwarding(DnsForwarding::default()/* use setters */);
4965 /// ```
4966 pub fn set_dns_forwarding<T>(mut self, v: T) -> Self
4967 where
4968 T: std::convert::Into<crate::model::DnsForwarding>,
4969 {
4970 self.dns_forwarding = std::option::Option::Some(v.into());
4971 self
4972 }
4973
4974 /// Sets or clears the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4975 ///
4976 /// # Example
4977 /// ```ignore,no_run
4978 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4979 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4980 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(Some(DnsForwarding::default()/* use setters */));
4981 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(None::<DnsForwarding>);
4982 /// ```
4983 pub fn set_or_clear_dns_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
4984 where
4985 T: std::convert::Into<crate::model::DnsForwarding>,
4986 {
4987 self.dns_forwarding = v.map(|x| x.into());
4988 self
4989 }
4990
4991 /// Sets the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
4992 ///
4993 /// # Example
4994 /// ```ignore,no_run
4995 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4996 /// use wkt::FieldMask;
4997 /// let x = UpdateDnsForwardingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4998 /// ```
4999 pub fn set_update_mask<T>(mut self, v: T) -> Self
5000 where
5001 T: std::convert::Into<wkt::FieldMask>,
5002 {
5003 self.update_mask = std::option::Option::Some(v.into());
5004 self
5005 }
5006
5007 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
5008 ///
5009 /// # Example
5010 /// ```ignore,no_run
5011 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5012 /// use wkt::FieldMask;
5013 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5014 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5015 /// ```
5016 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5017 where
5018 T: std::convert::Into<wkt::FieldMask>,
5019 {
5020 self.update_mask = v.map(|x| x.into());
5021 self
5022 }
5023
5024 /// Sets the value of [request_id][crate::model::UpdateDnsForwardingRequest::request_id].
5025 ///
5026 /// # Example
5027 /// ```ignore,no_run
5028 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5029 /// let x = UpdateDnsForwardingRequest::new().set_request_id("example");
5030 /// ```
5031 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5032 self.request_id = v.into();
5033 self
5034 }
5035}
5036
5037impl wkt::message::Message for UpdateDnsForwardingRequest {
5038 fn typename() -> &'static str {
5039 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest"
5040 }
5041}
5042
5043/// Request message for
5044/// [VmwareEngine.CreateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]
5045///
5046/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]: crate::client::VmwareEngine::create_network_peering
5047#[derive(Clone, Default, PartialEq)]
5048#[non_exhaustive]
5049pub struct CreateNetworkPeeringRequest {
5050 /// Required. The resource name of the location to create the new network
5051 /// peering in. This value is always `global`, because `NetworkPeering` is a
5052 /// global resource. Resource names are schemeless URIs that follow the
5053 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5054 /// example: `projects/my-project/locations/global`
5055 pub parent: std::string::String,
5056
5057 /// Required. The user-provided identifier of the new `NetworkPeering`.
5058 /// This identifier must be unique among `NetworkPeering` resources within the
5059 /// parent and becomes the final token in the name URI.
5060 /// The identifier must meet the following requirements:
5061 ///
5062 /// * Only contains 1-63 alphanumeric characters and hyphens
5063 /// * Begins with an alphabetical character
5064 /// * Ends with a non-hyphen character
5065 /// * Not formatted as a UUID
5066 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
5067 /// (section 3.5)
5068 pub network_peering_id: std::string::String,
5069
5070 /// Required. The initial description of the new network peering.
5071 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5072
5073 /// Optional. A request ID to identify requests. Specify a unique request ID
5074 /// so that if you must retry your request, the server will know to ignore
5075 /// the request if it has already been completed. The server guarantees that a
5076 /// request doesn't result in creation of duplicate commitments for at least 60
5077 /// minutes.
5078 ///
5079 /// For example, consider a situation where you make an initial request and the
5080 /// request times out. If you make the request again with the same request
5081 /// ID, the server can check if original operation with the same request ID
5082 /// was received, and if so, will ignore the second request. This prevents
5083 /// clients from accidentally creating duplicate commitments.
5084 ///
5085 /// The request ID must be a valid UUID with the exception that zero UUID is
5086 /// not supported (00000000-0000-0000-0000-000000000000).
5087 pub request_id: std::string::String,
5088
5089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5090}
5091
5092impl CreateNetworkPeeringRequest {
5093 pub fn new() -> Self {
5094 std::default::Default::default()
5095 }
5096
5097 /// Sets the value of [parent][crate::model::CreateNetworkPeeringRequest::parent].
5098 ///
5099 /// # Example
5100 /// ```ignore,no_run
5101 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5102 /// let x = CreateNetworkPeeringRequest::new().set_parent("example");
5103 /// ```
5104 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5105 self.parent = v.into();
5106 self
5107 }
5108
5109 /// Sets the value of [network_peering_id][crate::model::CreateNetworkPeeringRequest::network_peering_id].
5110 ///
5111 /// # Example
5112 /// ```ignore,no_run
5113 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5114 /// let x = CreateNetworkPeeringRequest::new().set_network_peering_id("example");
5115 /// ```
5116 pub fn set_network_peering_id<T: std::convert::Into<std::string::String>>(
5117 mut self,
5118 v: T,
5119 ) -> Self {
5120 self.network_peering_id = v.into();
5121 self
5122 }
5123
5124 /// Sets the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5125 ///
5126 /// # Example
5127 /// ```ignore,no_run
5128 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5129 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5130 /// let x = CreateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5131 /// ```
5132 pub fn set_network_peering<T>(mut self, v: T) -> Self
5133 where
5134 T: std::convert::Into<crate::model::NetworkPeering>,
5135 {
5136 self.network_peering = std::option::Option::Some(v.into());
5137 self
5138 }
5139
5140 /// Sets or clears the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5141 ///
5142 /// # Example
5143 /// ```ignore,no_run
5144 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5145 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5146 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5147 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5148 /// ```
5149 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5150 where
5151 T: std::convert::Into<crate::model::NetworkPeering>,
5152 {
5153 self.network_peering = v.map(|x| x.into());
5154 self
5155 }
5156
5157 /// Sets the value of [request_id][crate::model::CreateNetworkPeeringRequest::request_id].
5158 ///
5159 /// # Example
5160 /// ```ignore,no_run
5161 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5162 /// let x = CreateNetworkPeeringRequest::new().set_request_id("example");
5163 /// ```
5164 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5165 self.request_id = v.into();
5166 self
5167 }
5168}
5169
5170impl wkt::message::Message for CreateNetworkPeeringRequest {
5171 fn typename() -> &'static str {
5172 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest"
5173 }
5174}
5175
5176/// Request message for
5177/// [VmwareEngine.DeleteNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]
5178///
5179/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]: crate::client::VmwareEngine::delete_network_peering
5180#[derive(Clone, Default, PartialEq)]
5181#[non_exhaustive]
5182pub struct DeleteNetworkPeeringRequest {
5183 /// Required. The resource name of the network peering to be deleted.
5184 /// Resource names are schemeless URIs that follow the conventions in
5185 /// <https://cloud.google.com/apis/design/resource_names>.
5186 /// For example:
5187 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5188 pub name: std::string::String,
5189
5190 /// Optional. A request ID to identify requests. Specify a unique request ID
5191 /// so that if you must retry your request, the server will know to ignore
5192 /// the request if it has already been completed. The server guarantees that a
5193 /// request doesn't result in creation of duplicate commitments for at least 60
5194 /// minutes.
5195 ///
5196 /// For example, consider a situation where you make an initial request and the
5197 /// request times out. If you make the request again with the same request
5198 /// ID, the server can check if original operation with the same request ID
5199 /// was received, and if so, will ignore the second request. This prevents
5200 /// clients from accidentally creating duplicate commitments.
5201 ///
5202 /// The request ID must be a valid UUID with the exception that zero UUID is
5203 /// not supported (00000000-0000-0000-0000-000000000000).
5204 pub request_id: std::string::String,
5205
5206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5207}
5208
5209impl DeleteNetworkPeeringRequest {
5210 pub fn new() -> Self {
5211 std::default::Default::default()
5212 }
5213
5214 /// Sets the value of [name][crate::model::DeleteNetworkPeeringRequest::name].
5215 ///
5216 /// # Example
5217 /// ```ignore,no_run
5218 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5219 /// let x = DeleteNetworkPeeringRequest::new().set_name("example");
5220 /// ```
5221 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5222 self.name = v.into();
5223 self
5224 }
5225
5226 /// Sets the value of [request_id][crate::model::DeleteNetworkPeeringRequest::request_id].
5227 ///
5228 /// # Example
5229 /// ```ignore,no_run
5230 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5231 /// let x = DeleteNetworkPeeringRequest::new().set_request_id("example");
5232 /// ```
5233 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5234 self.request_id = v.into();
5235 self
5236 }
5237}
5238
5239impl wkt::message::Message for DeleteNetworkPeeringRequest {
5240 fn typename() -> &'static str {
5241 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest"
5242 }
5243}
5244
5245/// Request message for
5246/// [VmwareEngine.GetNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]
5247///
5248/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]: crate::client::VmwareEngine::get_network_peering
5249#[derive(Clone, Default, PartialEq)]
5250#[non_exhaustive]
5251pub struct GetNetworkPeeringRequest {
5252 /// Required. The resource name of the network peering to retrieve.
5253 /// Resource names are schemeless URIs that follow the conventions in
5254 /// <https://cloud.google.com/apis/design/resource_names>.
5255 /// For example:
5256 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5257 pub name: std::string::String,
5258
5259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5260}
5261
5262impl GetNetworkPeeringRequest {
5263 pub fn new() -> Self {
5264 std::default::Default::default()
5265 }
5266
5267 /// Sets the value of [name][crate::model::GetNetworkPeeringRequest::name].
5268 ///
5269 /// # Example
5270 /// ```ignore,no_run
5271 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPeeringRequest;
5272 /// let x = GetNetworkPeeringRequest::new().set_name("example");
5273 /// ```
5274 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5275 self.name = v.into();
5276 self
5277 }
5278}
5279
5280impl wkt::message::Message for GetNetworkPeeringRequest {
5281 fn typename() -> &'static str {
5282 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPeeringRequest"
5283 }
5284}
5285
5286/// Request message for
5287/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5288///
5289/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5290#[derive(Clone, Default, PartialEq)]
5291#[non_exhaustive]
5292pub struct ListNetworkPeeringsRequest {
5293 /// Required. The resource name of the location (global) to query for
5294 /// network peerings. Resource names are schemeless URIs that follow the
5295 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5296 /// example: `projects/my-project/locations/global`
5297 pub parent: std::string::String,
5298
5299 /// The maximum number of network peerings to return in one page.
5300 /// The maximum value is coerced to 1000.
5301 /// The default value of this field is 500.
5302 pub page_size: i32,
5303
5304 /// A page token, received from a previous `ListNetworkPeerings` call.
5305 /// Provide this to retrieve the subsequent page.
5306 ///
5307 /// When paginating, all other parameters provided to
5308 /// `ListNetworkPeerings` must match the call that provided the page
5309 /// token.
5310 pub page_token: std::string::String,
5311
5312 /// A filter expression that matches resources returned in the response.
5313 /// The expression must specify the field name, a comparison
5314 /// operator, and the value that you want to use for filtering. The value
5315 /// must be a string, a number, or a boolean. The comparison operator
5316 /// must be `=`, `!=`, `>`, or `<`.
5317 ///
5318 /// For example, if you are filtering a list of network peerings, you can
5319 /// exclude the ones named `example-peering` by specifying
5320 /// `name != "example-peering"`.
5321 ///
5322 /// To filter on multiple expressions, provide each separate expression within
5323 /// parentheses. For example:
5324 ///
5325 /// ```norust
5326 /// (name = "example-peering")
5327 /// (createTime > "2021-04-12T08:15:10.40Z")
5328 /// ```
5329 ///
5330 /// By default, each expression is an `AND` expression. However, you
5331 /// can include `AND` and `OR` expressions explicitly.
5332 /// For example:
5333 ///
5334 /// ```norust
5335 /// (name = "example-peering-1") AND
5336 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5337 /// (name = "example-peering-2")
5338 /// ```
5339 pub filter: std::string::String,
5340
5341 /// Sorts list results by a certain order. By default, returned results
5342 /// are ordered by `name` in ascending order.
5343 /// You can also sort results in descending order based on the `name` value
5344 /// using `orderBy="name desc"`.
5345 /// Currently, only ordering by `name` is supported.
5346 pub order_by: std::string::String,
5347
5348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5349}
5350
5351impl ListNetworkPeeringsRequest {
5352 pub fn new() -> Self {
5353 std::default::Default::default()
5354 }
5355
5356 /// Sets the value of [parent][crate::model::ListNetworkPeeringsRequest::parent].
5357 ///
5358 /// # Example
5359 /// ```ignore,no_run
5360 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5361 /// let x = ListNetworkPeeringsRequest::new().set_parent("example");
5362 /// ```
5363 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364 self.parent = v.into();
5365 self
5366 }
5367
5368 /// Sets the value of [page_size][crate::model::ListNetworkPeeringsRequest::page_size].
5369 ///
5370 /// # Example
5371 /// ```ignore,no_run
5372 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5373 /// let x = ListNetworkPeeringsRequest::new().set_page_size(42);
5374 /// ```
5375 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5376 self.page_size = v.into();
5377 self
5378 }
5379
5380 /// Sets the value of [page_token][crate::model::ListNetworkPeeringsRequest::page_token].
5381 ///
5382 /// # Example
5383 /// ```ignore,no_run
5384 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5385 /// let x = ListNetworkPeeringsRequest::new().set_page_token("example");
5386 /// ```
5387 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.page_token = v.into();
5389 self
5390 }
5391
5392 /// Sets the value of [filter][crate::model::ListNetworkPeeringsRequest::filter].
5393 ///
5394 /// # Example
5395 /// ```ignore,no_run
5396 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5397 /// let x = ListNetworkPeeringsRequest::new().set_filter("example");
5398 /// ```
5399 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5400 self.filter = v.into();
5401 self
5402 }
5403
5404 /// Sets the value of [order_by][crate::model::ListNetworkPeeringsRequest::order_by].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5409 /// let x = ListNetworkPeeringsRequest::new().set_order_by("example");
5410 /// ```
5411 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5412 self.order_by = v.into();
5413 self
5414 }
5415}
5416
5417impl wkt::message::Message for ListNetworkPeeringsRequest {
5418 fn typename() -> &'static str {
5419 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest"
5420 }
5421}
5422
5423/// Request message for
5424/// [VmwareEngine.UpdateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]
5425///
5426/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]: crate::client::VmwareEngine::update_network_peering
5427#[derive(Clone, Default, PartialEq)]
5428#[non_exhaustive]
5429pub struct UpdateNetworkPeeringRequest {
5430 /// Required. Network peering description.
5431 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5432
5433 /// Required. Field mask is used to specify the fields to be overwritten in the
5434 /// `NetworkPeering` resource by the update.
5435 /// The fields specified in the `update_mask` are relative to the resource, not
5436 /// the full request. A field will be overwritten if it is in the mask. If the
5437 /// user does not provide a mask then all fields will be overwritten.
5438 pub update_mask: std::option::Option<wkt::FieldMask>,
5439
5440 /// Optional. A request ID to identify requests. Specify a unique request ID
5441 /// so that if you must retry your request, the server will know to ignore
5442 /// the request if it has already been completed. The server guarantees that a
5443 /// request doesn't result in creation of duplicate commitments for at least 60
5444 /// minutes.
5445 ///
5446 /// For example, consider a situation where you make an initial request and the
5447 /// request times out. If you make the request again with the same request
5448 /// ID, the server can check if original operation with the same request ID
5449 /// was received, and if so, will ignore the second request. This prevents
5450 /// clients from accidentally creating duplicate commitments.
5451 ///
5452 /// The request ID must be a valid UUID with the exception that zero UUID is
5453 /// not supported (00000000-0000-0000-0000-000000000000).
5454 pub request_id: std::string::String,
5455
5456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5457}
5458
5459impl UpdateNetworkPeeringRequest {
5460 pub fn new() -> Self {
5461 std::default::Default::default()
5462 }
5463
5464 /// Sets the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5465 ///
5466 /// # Example
5467 /// ```ignore,no_run
5468 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5469 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5470 /// let x = UpdateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5471 /// ```
5472 pub fn set_network_peering<T>(mut self, v: T) -> Self
5473 where
5474 T: std::convert::Into<crate::model::NetworkPeering>,
5475 {
5476 self.network_peering = std::option::Option::Some(v.into());
5477 self
5478 }
5479
5480 /// Sets or clears the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5481 ///
5482 /// # Example
5483 /// ```ignore,no_run
5484 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5485 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5486 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5487 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5488 /// ```
5489 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5490 where
5491 T: std::convert::Into<crate::model::NetworkPeering>,
5492 {
5493 self.network_peering = v.map(|x| x.into());
5494 self
5495 }
5496
5497 /// Sets the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5498 ///
5499 /// # Example
5500 /// ```ignore,no_run
5501 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5502 /// use wkt::FieldMask;
5503 /// let x = UpdateNetworkPeeringRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5504 /// ```
5505 pub fn set_update_mask<T>(mut self, v: T) -> Self
5506 where
5507 T: std::convert::Into<wkt::FieldMask>,
5508 {
5509 self.update_mask = std::option::Option::Some(v.into());
5510 self
5511 }
5512
5513 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5514 ///
5515 /// # Example
5516 /// ```ignore,no_run
5517 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5518 /// use wkt::FieldMask;
5519 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5520 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5521 /// ```
5522 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5523 where
5524 T: std::convert::Into<wkt::FieldMask>,
5525 {
5526 self.update_mask = v.map(|x| x.into());
5527 self
5528 }
5529
5530 /// Sets the value of [request_id][crate::model::UpdateNetworkPeeringRequest::request_id].
5531 ///
5532 /// # Example
5533 /// ```ignore,no_run
5534 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5535 /// let x = UpdateNetworkPeeringRequest::new().set_request_id("example");
5536 /// ```
5537 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5538 self.request_id = v.into();
5539 self
5540 }
5541}
5542
5543impl wkt::message::Message for UpdateNetworkPeeringRequest {
5544 fn typename() -> &'static str {
5545 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest"
5546 }
5547}
5548
5549/// Response message for
5550/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5551///
5552/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5553#[derive(Clone, Default, PartialEq)]
5554#[non_exhaustive]
5555pub struct ListNetworkPeeringsResponse {
5556 /// A list of network peerings.
5557 pub network_peerings: std::vec::Vec<crate::model::NetworkPeering>,
5558
5559 /// A token, which can be sent as `page_token` to retrieve the next page.
5560 /// If this field is omitted, there are no subsequent pages.
5561 pub next_page_token: std::string::String,
5562
5563 /// Unreachable resources.
5564 pub unreachable: std::vec::Vec<std::string::String>,
5565
5566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5567}
5568
5569impl ListNetworkPeeringsResponse {
5570 pub fn new() -> Self {
5571 std::default::Default::default()
5572 }
5573
5574 /// Sets the value of [network_peerings][crate::model::ListNetworkPeeringsResponse::network_peerings].
5575 ///
5576 /// # Example
5577 /// ```ignore,no_run
5578 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5579 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5580 /// let x = ListNetworkPeeringsResponse::new()
5581 /// .set_network_peerings([
5582 /// NetworkPeering::default()/* use setters */,
5583 /// NetworkPeering::default()/* use (different) setters */,
5584 /// ]);
5585 /// ```
5586 pub fn set_network_peerings<T, V>(mut self, v: T) -> Self
5587 where
5588 T: std::iter::IntoIterator<Item = V>,
5589 V: std::convert::Into<crate::model::NetworkPeering>,
5590 {
5591 use std::iter::Iterator;
5592 self.network_peerings = v.into_iter().map(|i| i.into()).collect();
5593 self
5594 }
5595
5596 /// Sets the value of [next_page_token][crate::model::ListNetworkPeeringsResponse::next_page_token].
5597 ///
5598 /// # Example
5599 /// ```ignore,no_run
5600 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5601 /// let x = ListNetworkPeeringsResponse::new().set_next_page_token("example");
5602 /// ```
5603 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5604 self.next_page_token = v.into();
5605 self
5606 }
5607
5608 /// Sets the value of [unreachable][crate::model::ListNetworkPeeringsResponse::unreachable].
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5613 /// let x = ListNetworkPeeringsResponse::new().set_unreachable(["a", "b", "c"]);
5614 /// ```
5615 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5616 where
5617 T: std::iter::IntoIterator<Item = V>,
5618 V: std::convert::Into<std::string::String>,
5619 {
5620 use std::iter::Iterator;
5621 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5622 self
5623 }
5624}
5625
5626impl wkt::message::Message for ListNetworkPeeringsResponse {
5627 fn typename() -> &'static str {
5628 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse"
5629 }
5630}
5631
5632#[doc(hidden)]
5633impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPeeringsResponse {
5634 type PageItem = crate::model::NetworkPeering;
5635
5636 fn items(self) -> std::vec::Vec<Self::PageItem> {
5637 self.network_peerings
5638 }
5639
5640 fn next_page_token(&self) -> std::string::String {
5641 use std::clone::Clone;
5642 self.next_page_token.clone()
5643 }
5644}
5645
5646/// Request message for
5647/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5648///
5649/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5650#[derive(Clone, Default, PartialEq)]
5651#[non_exhaustive]
5652pub struct ListPeeringRoutesRequest {
5653 /// Required. The resource name of the network peering to retrieve peering
5654 /// routes from. Resource names are schemeless URIs that follow the conventions
5655 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
5656 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5657 pub parent: std::string::String,
5658
5659 /// The maximum number of peering routes to return in one page.
5660 /// The service may return fewer than this value.
5661 /// The maximum value is coerced to 1000.
5662 /// The default value of this field is 500.
5663 pub page_size: i32,
5664
5665 /// A page token, received from a previous `ListPeeringRoutes` call.
5666 /// Provide this to retrieve the subsequent page.
5667 /// When paginating, all other parameters provided to `ListPeeringRoutes` must
5668 /// match the call that provided the page token.
5669 pub page_token: std::string::String,
5670
5671 /// A filter expression that matches resources returned in the response.
5672 /// Currently, only filtering on the `direction` field is supported. To return
5673 /// routes imported from the peer network, provide "direction=INCOMING". To
5674 /// return routes exported from the VMware Engine network, provide
5675 /// "direction=OUTGOING". Other filter expressions return an error.
5676 pub filter: std::string::String,
5677
5678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5679}
5680
5681impl ListPeeringRoutesRequest {
5682 pub fn new() -> Self {
5683 std::default::Default::default()
5684 }
5685
5686 /// Sets the value of [parent][crate::model::ListPeeringRoutesRequest::parent].
5687 ///
5688 /// # Example
5689 /// ```ignore,no_run
5690 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5691 /// let x = ListPeeringRoutesRequest::new().set_parent("example");
5692 /// ```
5693 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5694 self.parent = v.into();
5695 self
5696 }
5697
5698 /// Sets the value of [page_size][crate::model::ListPeeringRoutesRequest::page_size].
5699 ///
5700 /// # Example
5701 /// ```ignore,no_run
5702 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5703 /// let x = ListPeeringRoutesRequest::new().set_page_size(42);
5704 /// ```
5705 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5706 self.page_size = v.into();
5707 self
5708 }
5709
5710 /// Sets the value of [page_token][crate::model::ListPeeringRoutesRequest::page_token].
5711 ///
5712 /// # Example
5713 /// ```ignore,no_run
5714 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5715 /// let x = ListPeeringRoutesRequest::new().set_page_token("example");
5716 /// ```
5717 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5718 self.page_token = v.into();
5719 self
5720 }
5721
5722 /// Sets the value of [filter][crate::model::ListPeeringRoutesRequest::filter].
5723 ///
5724 /// # Example
5725 /// ```ignore,no_run
5726 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5727 /// let x = ListPeeringRoutesRequest::new().set_filter("example");
5728 /// ```
5729 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5730 self.filter = v.into();
5731 self
5732 }
5733}
5734
5735impl wkt::message::Message for ListPeeringRoutesRequest {
5736 fn typename() -> &'static str {
5737 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesRequest"
5738 }
5739}
5740
5741/// Response message for
5742/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5743///
5744/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5745#[derive(Clone, Default, PartialEq)]
5746#[non_exhaustive]
5747pub struct ListPeeringRoutesResponse {
5748 /// A list of peering routes.
5749 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
5750
5751 /// A token, which can be sent as `page_token` to retrieve the next page.
5752 /// If this field is omitted, there are no subsequent pages.
5753 pub next_page_token: std::string::String,
5754
5755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5756}
5757
5758impl ListPeeringRoutesResponse {
5759 pub fn new() -> Self {
5760 std::default::Default::default()
5761 }
5762
5763 /// Sets the value of [peering_routes][crate::model::ListPeeringRoutesResponse::peering_routes].
5764 ///
5765 /// # Example
5766 /// ```ignore,no_run
5767 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5768 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
5769 /// let x = ListPeeringRoutesResponse::new()
5770 /// .set_peering_routes([
5771 /// PeeringRoute::default()/* use setters */,
5772 /// PeeringRoute::default()/* use (different) setters */,
5773 /// ]);
5774 /// ```
5775 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
5776 where
5777 T: std::iter::IntoIterator<Item = V>,
5778 V: std::convert::Into<crate::model::PeeringRoute>,
5779 {
5780 use std::iter::Iterator;
5781 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
5782 self
5783 }
5784
5785 /// Sets the value of [next_page_token][crate::model::ListPeeringRoutesResponse::next_page_token].
5786 ///
5787 /// # Example
5788 /// ```ignore,no_run
5789 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5790 /// let x = ListPeeringRoutesResponse::new().set_next_page_token("example");
5791 /// ```
5792 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5793 self.next_page_token = v.into();
5794 self
5795 }
5796}
5797
5798impl wkt::message::Message for ListPeeringRoutesResponse {
5799 fn typename() -> &'static str {
5800 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesResponse"
5801 }
5802}
5803
5804#[doc(hidden)]
5805impl google_cloud_gax::paginator::internal::PageableResponse for ListPeeringRoutesResponse {
5806 type PageItem = crate::model::PeeringRoute;
5807
5808 fn items(self) -> std::vec::Vec<Self::PageItem> {
5809 self.peering_routes
5810 }
5811
5812 fn next_page_token(&self) -> std::string::String {
5813 use std::clone::Clone;
5814 self.next_page_token.clone()
5815 }
5816}
5817
5818/// Request message for
5819/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5820///
5821/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5822#[derive(Clone, Default, PartialEq)]
5823#[non_exhaustive]
5824pub struct ListNetworkPoliciesRequest {
5825 /// Required. The resource name of the location (region) to query for
5826 /// network policies. Resource names are schemeless URIs that follow the
5827 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5828 /// example: `projects/my-project/locations/us-central1`
5829 pub parent: std::string::String,
5830
5831 /// The maximum number of network policies to return in one page.
5832 /// The service may return fewer than this value.
5833 /// The maximum value is coerced to 1000.
5834 /// The default value of this field is 500.
5835 pub page_size: i32,
5836
5837 /// A page token, received from a previous `ListNetworkPolicies` call.
5838 /// Provide this to retrieve the subsequent page.
5839 ///
5840 /// When paginating, all other parameters provided to
5841 /// `ListNetworkPolicies` must match the call that provided the page
5842 /// token.
5843 pub page_token: std::string::String,
5844
5845 /// A filter expression that matches resources returned in the response.
5846 /// The expression must specify the field name, a comparison
5847 /// operator, and the value that you want to use for filtering. The value
5848 /// must be a string, a number, or a boolean. The comparison operator
5849 /// must be `=`, `!=`, `>`, or `<`.
5850 ///
5851 /// For example, if you are filtering a list of network policies, you can
5852 /// exclude the ones named `example-policy` by specifying
5853 /// `name != "example-policy"`.
5854 ///
5855 /// To filter on multiple expressions, provide each separate expression within
5856 /// parentheses. For example:
5857 ///
5858 /// ```norust
5859 /// (name = "example-policy")
5860 /// (createTime > "2021-04-12T08:15:10.40Z")
5861 /// ```
5862 ///
5863 /// By default, each expression is an `AND` expression. However, you
5864 /// can include `AND` and `OR` expressions explicitly.
5865 /// For example:
5866 ///
5867 /// ```norust
5868 /// (name = "example-policy-1") AND
5869 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5870 /// (name = "example-policy-2")
5871 /// ```
5872 pub filter: std::string::String,
5873
5874 /// Sorts list results by a certain order. By default, returned results
5875 /// are ordered by `name` in ascending order.
5876 /// You can also sort results in descending order based on the `name` value
5877 /// using `orderBy="name desc"`.
5878 /// Currently, only ordering by `name` is supported.
5879 pub order_by: std::string::String,
5880
5881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5882}
5883
5884impl ListNetworkPoliciesRequest {
5885 pub fn new() -> Self {
5886 std::default::Default::default()
5887 }
5888
5889 /// Sets the value of [parent][crate::model::ListNetworkPoliciesRequest::parent].
5890 ///
5891 /// # Example
5892 /// ```ignore,no_run
5893 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5894 /// let x = ListNetworkPoliciesRequest::new().set_parent("example");
5895 /// ```
5896 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5897 self.parent = v.into();
5898 self
5899 }
5900
5901 /// Sets the value of [page_size][crate::model::ListNetworkPoliciesRequest::page_size].
5902 ///
5903 /// # Example
5904 /// ```ignore,no_run
5905 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5906 /// let x = ListNetworkPoliciesRequest::new().set_page_size(42);
5907 /// ```
5908 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5909 self.page_size = v.into();
5910 self
5911 }
5912
5913 /// Sets the value of [page_token][crate::model::ListNetworkPoliciesRequest::page_token].
5914 ///
5915 /// # Example
5916 /// ```ignore,no_run
5917 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5918 /// let x = ListNetworkPoliciesRequest::new().set_page_token("example");
5919 /// ```
5920 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5921 self.page_token = v.into();
5922 self
5923 }
5924
5925 /// Sets the value of [filter][crate::model::ListNetworkPoliciesRequest::filter].
5926 ///
5927 /// # Example
5928 /// ```ignore,no_run
5929 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5930 /// let x = ListNetworkPoliciesRequest::new().set_filter("example");
5931 /// ```
5932 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5933 self.filter = v.into();
5934 self
5935 }
5936
5937 /// Sets the value of [order_by][crate::model::ListNetworkPoliciesRequest::order_by].
5938 ///
5939 /// # Example
5940 /// ```ignore,no_run
5941 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5942 /// let x = ListNetworkPoliciesRequest::new().set_order_by("example");
5943 /// ```
5944 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5945 self.order_by = v.into();
5946 self
5947 }
5948}
5949
5950impl wkt::message::Message for ListNetworkPoliciesRequest {
5951 fn typename() -> &'static str {
5952 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"
5953 }
5954}
5955
5956/// Response message for
5957/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5958///
5959/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5960#[derive(Clone, Default, PartialEq)]
5961#[non_exhaustive]
5962pub struct ListNetworkPoliciesResponse {
5963 /// A list of network policies.
5964 pub network_policies: std::vec::Vec<crate::model::NetworkPolicy>,
5965
5966 /// A token, which can be send as `page_token` to retrieve the next page.
5967 /// If this field is omitted, there are no subsequent pages.
5968 pub next_page_token: std::string::String,
5969
5970 /// Locations that could not be reached when making an aggregated query using
5971 /// wildcards.
5972 pub unreachable: std::vec::Vec<std::string::String>,
5973
5974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5975}
5976
5977impl ListNetworkPoliciesResponse {
5978 pub fn new() -> Self {
5979 std::default::Default::default()
5980 }
5981
5982 /// Sets the value of [network_policies][crate::model::ListNetworkPoliciesResponse::network_policies].
5983 ///
5984 /// # Example
5985 /// ```ignore,no_run
5986 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
5987 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
5988 /// let x = ListNetworkPoliciesResponse::new()
5989 /// .set_network_policies([
5990 /// NetworkPolicy::default()/* use setters */,
5991 /// NetworkPolicy::default()/* use (different) setters */,
5992 /// ]);
5993 /// ```
5994 pub fn set_network_policies<T, V>(mut self, v: T) -> Self
5995 where
5996 T: std::iter::IntoIterator<Item = V>,
5997 V: std::convert::Into<crate::model::NetworkPolicy>,
5998 {
5999 use std::iter::Iterator;
6000 self.network_policies = v.into_iter().map(|i| i.into()).collect();
6001 self
6002 }
6003
6004 /// Sets the value of [next_page_token][crate::model::ListNetworkPoliciesResponse::next_page_token].
6005 ///
6006 /// # Example
6007 /// ```ignore,no_run
6008 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6009 /// let x = ListNetworkPoliciesResponse::new().set_next_page_token("example");
6010 /// ```
6011 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6012 self.next_page_token = v.into();
6013 self
6014 }
6015
6016 /// Sets the value of [unreachable][crate::model::ListNetworkPoliciesResponse::unreachable].
6017 ///
6018 /// # Example
6019 /// ```ignore,no_run
6020 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6021 /// let x = ListNetworkPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
6022 /// ```
6023 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6024 where
6025 T: std::iter::IntoIterator<Item = V>,
6026 V: std::convert::Into<std::string::String>,
6027 {
6028 use std::iter::Iterator;
6029 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6030 self
6031 }
6032}
6033
6034impl wkt::message::Message for ListNetworkPoliciesResponse {
6035 fn typename() -> &'static str {
6036 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"
6037 }
6038}
6039
6040#[doc(hidden)]
6041impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPoliciesResponse {
6042 type PageItem = crate::model::NetworkPolicy;
6043
6044 fn items(self) -> std::vec::Vec<Self::PageItem> {
6045 self.network_policies
6046 }
6047
6048 fn next_page_token(&self) -> std::string::String {
6049 use std::clone::Clone;
6050 self.next_page_token.clone()
6051 }
6052}
6053
6054/// Request message for
6055/// [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]
6056///
6057/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]: crate::client::VmwareEngine::get_network_policy
6058#[derive(Clone, Default, PartialEq)]
6059#[non_exhaustive]
6060pub struct GetNetworkPolicyRequest {
6061 /// Required. The resource name of the network policy to retrieve.
6062 /// Resource names are schemeless URIs that follow the conventions in
6063 /// <https://cloud.google.com/apis/design/resource_names>.
6064 /// For example:
6065 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6066 pub name: std::string::String,
6067
6068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6069}
6070
6071impl GetNetworkPolicyRequest {
6072 pub fn new() -> Self {
6073 std::default::Default::default()
6074 }
6075
6076 /// Sets the value of [name][crate::model::GetNetworkPolicyRequest::name].
6077 ///
6078 /// # Example
6079 /// ```ignore,no_run
6080 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPolicyRequest;
6081 /// let x = GetNetworkPolicyRequest::new().set_name("example");
6082 /// ```
6083 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6084 self.name = v.into();
6085 self
6086 }
6087}
6088
6089impl wkt::message::Message for GetNetworkPolicyRequest {
6090 fn typename() -> &'static str {
6091 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"
6092 }
6093}
6094
6095/// Request message for
6096/// [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]
6097///
6098/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]: crate::client::VmwareEngine::update_network_policy
6099#[derive(Clone, Default, PartialEq)]
6100#[non_exhaustive]
6101pub struct UpdateNetworkPolicyRequest {
6102 /// Required. Network policy description.
6103 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6104
6105 /// Required. Field mask is used to specify the fields to be overwritten in the
6106 /// `NetworkPolicy` resource by the update.
6107 /// The fields specified in the `update_mask` are relative to the resource, not
6108 /// the full request. A field will be overwritten if it is in the mask. If the
6109 /// user does not provide a mask then all fields will be overwritten.
6110 pub update_mask: std::option::Option<wkt::FieldMask>,
6111
6112 /// Optional. A request ID to identify requests. Specify a unique request ID
6113 /// so that if you must retry your request, the server will know to ignore
6114 /// the request if it has already been completed. The server guarantees that a
6115 /// request doesn't result in creation of duplicate commitments for at least 60
6116 /// minutes.
6117 ///
6118 /// For example, consider a situation where you make an initial request and the
6119 /// request times out. If you make the request again with the same request
6120 /// ID, the server can check if original operation with the same request ID
6121 /// was received, and if so, will ignore the second request. This prevents
6122 /// clients from accidentally creating duplicate commitments.
6123 ///
6124 /// The request ID must be a valid UUID with the exception that zero UUID is
6125 /// not supported (00000000-0000-0000-0000-000000000000).
6126 pub request_id: std::string::String,
6127
6128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6129}
6130
6131impl UpdateNetworkPolicyRequest {
6132 pub fn new() -> Self {
6133 std::default::Default::default()
6134 }
6135
6136 /// Sets the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6141 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6142 /// let x = UpdateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6143 /// ```
6144 pub fn set_network_policy<T>(mut self, v: T) -> Self
6145 where
6146 T: std::convert::Into<crate::model::NetworkPolicy>,
6147 {
6148 self.network_policy = std::option::Option::Some(v.into());
6149 self
6150 }
6151
6152 /// Sets or clears the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6153 ///
6154 /// # Example
6155 /// ```ignore,no_run
6156 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6157 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6158 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6159 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6160 /// ```
6161 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6162 where
6163 T: std::convert::Into<crate::model::NetworkPolicy>,
6164 {
6165 self.network_policy = v.map(|x| x.into());
6166 self
6167 }
6168
6169 /// Sets the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6170 ///
6171 /// # Example
6172 /// ```ignore,no_run
6173 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6174 /// use wkt::FieldMask;
6175 /// let x = UpdateNetworkPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6176 /// ```
6177 pub fn set_update_mask<T>(mut self, v: T) -> Self
6178 where
6179 T: std::convert::Into<wkt::FieldMask>,
6180 {
6181 self.update_mask = std::option::Option::Some(v.into());
6182 self
6183 }
6184
6185 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6186 ///
6187 /// # Example
6188 /// ```ignore,no_run
6189 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6190 /// use wkt::FieldMask;
6191 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6192 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6193 /// ```
6194 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6195 where
6196 T: std::convert::Into<wkt::FieldMask>,
6197 {
6198 self.update_mask = v.map(|x| x.into());
6199 self
6200 }
6201
6202 /// Sets the value of [request_id][crate::model::UpdateNetworkPolicyRequest::request_id].
6203 ///
6204 /// # Example
6205 /// ```ignore,no_run
6206 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6207 /// let x = UpdateNetworkPolicyRequest::new().set_request_id("example");
6208 /// ```
6209 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6210 self.request_id = v.into();
6211 self
6212 }
6213}
6214
6215impl wkt::message::Message for UpdateNetworkPolicyRequest {
6216 fn typename() -> &'static str {
6217 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"
6218 }
6219}
6220
6221/// Request message for
6222/// [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]
6223///
6224/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]: crate::client::VmwareEngine::create_network_policy
6225#[derive(Clone, Default, PartialEq)]
6226#[non_exhaustive]
6227pub struct CreateNetworkPolicyRequest {
6228 /// Required. The resource name of the location (region)
6229 /// to create the new network policy in.
6230 /// Resource names are schemeless URIs that follow the conventions in
6231 /// <https://cloud.google.com/apis/design/resource_names>.
6232 /// For example:
6233 /// `projects/my-project/locations/us-central1`
6234 pub parent: std::string::String,
6235
6236 /// Required. The user-provided identifier of the network policy to be created.
6237 /// This identifier must be unique within parent
6238 /// `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
6239 /// the final token in the name URI.
6240 /// The identifier must meet the following requirements:
6241 ///
6242 /// * Only contains 1-63 alphanumeric characters and hyphens
6243 /// * Begins with an alphabetical character
6244 /// * Ends with a non-hyphen character
6245 /// * Not formatted as a UUID
6246 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6247 /// (section 3.5)
6248 pub network_policy_id: std::string::String,
6249
6250 /// Required. The network policy configuration to use in the request.
6251 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6252
6253 /// Optional. A request ID to identify requests. Specify a unique request ID
6254 /// so that if you must retry your request, the server will know to ignore
6255 /// the request if it has already been completed. The server guarantees that a
6256 /// request doesn't result in creation of duplicate commitments for at least 60
6257 /// minutes.
6258 ///
6259 /// For example, consider a situation where you make an initial request and the
6260 /// request times out. If you make the request again with the same request
6261 /// ID, the server can check if original operation with the same request ID
6262 /// was received, and if so, will ignore the second request. This prevents
6263 /// clients from accidentally creating duplicate commitments.
6264 ///
6265 /// The request ID must be a valid UUID with the exception that zero UUID is
6266 /// not supported (00000000-0000-0000-0000-000000000000).
6267 pub request_id: std::string::String,
6268
6269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6270}
6271
6272impl CreateNetworkPolicyRequest {
6273 pub fn new() -> Self {
6274 std::default::Default::default()
6275 }
6276
6277 /// Sets the value of [parent][crate::model::CreateNetworkPolicyRequest::parent].
6278 ///
6279 /// # Example
6280 /// ```ignore,no_run
6281 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6282 /// let x = CreateNetworkPolicyRequest::new().set_parent("example");
6283 /// ```
6284 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6285 self.parent = v.into();
6286 self
6287 }
6288
6289 /// Sets the value of [network_policy_id][crate::model::CreateNetworkPolicyRequest::network_policy_id].
6290 ///
6291 /// # Example
6292 /// ```ignore,no_run
6293 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6294 /// let x = CreateNetworkPolicyRequest::new().set_network_policy_id("example");
6295 /// ```
6296 pub fn set_network_policy_id<T: std::convert::Into<std::string::String>>(
6297 mut self,
6298 v: T,
6299 ) -> Self {
6300 self.network_policy_id = v.into();
6301 self
6302 }
6303
6304 /// Sets the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6305 ///
6306 /// # Example
6307 /// ```ignore,no_run
6308 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6309 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6310 /// let x = CreateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6311 /// ```
6312 pub fn set_network_policy<T>(mut self, v: T) -> Self
6313 where
6314 T: std::convert::Into<crate::model::NetworkPolicy>,
6315 {
6316 self.network_policy = std::option::Option::Some(v.into());
6317 self
6318 }
6319
6320 /// Sets or clears the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6321 ///
6322 /// # Example
6323 /// ```ignore,no_run
6324 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6325 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6326 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6327 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6328 /// ```
6329 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6330 where
6331 T: std::convert::Into<crate::model::NetworkPolicy>,
6332 {
6333 self.network_policy = v.map(|x| x.into());
6334 self
6335 }
6336
6337 /// Sets the value of [request_id][crate::model::CreateNetworkPolicyRequest::request_id].
6338 ///
6339 /// # Example
6340 /// ```ignore,no_run
6341 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6342 /// let x = CreateNetworkPolicyRequest::new().set_request_id("example");
6343 /// ```
6344 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6345 self.request_id = v.into();
6346 self
6347 }
6348}
6349
6350impl wkt::message::Message for CreateNetworkPolicyRequest {
6351 fn typename() -> &'static str {
6352 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"
6353 }
6354}
6355
6356/// Request message for
6357/// [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]
6358///
6359/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]: crate::client::VmwareEngine::delete_network_policy
6360#[derive(Clone, Default, PartialEq)]
6361#[non_exhaustive]
6362pub struct DeleteNetworkPolicyRequest {
6363 /// Required. The resource name of the network policy to delete.
6364 /// Resource names are schemeless URIs that follow the conventions in
6365 /// <https://cloud.google.com/apis/design/resource_names>.
6366 /// For example:
6367 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6368 pub name: std::string::String,
6369
6370 /// Optional. A request ID to identify requests. Specify a unique request ID
6371 /// so that if you must retry your request, the server will know to ignore
6372 /// the request if it has already been completed. The server guarantees that a
6373 /// request doesn't result in creation of duplicate commitments for at least 60
6374 /// minutes.
6375 ///
6376 /// For example, consider a situation where you make an initial request and the
6377 /// request times out. If you make the request again with the same request
6378 /// ID, the server can check if original operation with the same request ID
6379 /// was received, and if so, will ignore the second request. This prevents
6380 /// clients from accidentally creating duplicate commitments.
6381 ///
6382 /// The request ID must be a valid UUID with the exception that zero UUID is
6383 /// not supported (00000000-0000-0000-0000-000000000000).
6384 pub request_id: std::string::String,
6385
6386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6387}
6388
6389impl DeleteNetworkPolicyRequest {
6390 pub fn new() -> Self {
6391 std::default::Default::default()
6392 }
6393
6394 /// Sets the value of [name][crate::model::DeleteNetworkPolicyRequest::name].
6395 ///
6396 /// # Example
6397 /// ```ignore,no_run
6398 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6399 /// let x = DeleteNetworkPolicyRequest::new().set_name("example");
6400 /// ```
6401 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6402 self.name = v.into();
6403 self
6404 }
6405
6406 /// Sets the value of [request_id][crate::model::DeleteNetworkPolicyRequest::request_id].
6407 ///
6408 /// # Example
6409 /// ```ignore,no_run
6410 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6411 /// let x = DeleteNetworkPolicyRequest::new().set_request_id("example");
6412 /// ```
6413 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6414 self.request_id = v.into();
6415 self
6416 }
6417}
6418
6419impl wkt::message::Message for DeleteNetworkPolicyRequest {
6420 fn typename() -> &'static str {
6421 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"
6422 }
6423}
6424
6425/// Request message for
6426/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6427///
6428/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6429#[derive(Clone, Default, PartialEq)]
6430#[non_exhaustive]
6431pub struct ListManagementDnsZoneBindingsRequest {
6432 /// Required. The resource name of the private cloud to be queried for
6433 /// management DNS zone bindings.
6434 /// Resource names are schemeless URIs that follow the conventions in
6435 /// <https://cloud.google.com/apis/design/resource_names>.
6436 /// For example:
6437 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6438 pub parent: std::string::String,
6439
6440 /// The maximum number of management DNS zone bindings to return in one page.
6441 /// The service may return fewer than this value.
6442 /// The maximum value is coerced to 1000.
6443 /// The default value of this field is 500.
6444 pub page_size: i32,
6445
6446 /// A page token, received from a previous `ListManagementDnsZoneBindings`
6447 /// call. Provide this to retrieve the subsequent page.
6448 ///
6449 /// When paginating, all other parameters provided to
6450 /// `ListManagementDnsZoneBindings` must match the call that provided the page
6451 /// token.
6452 pub page_token: std::string::String,
6453
6454 /// A filter expression that matches resources returned in the response.
6455 /// The expression must specify the field name, a comparison
6456 /// operator, and the value that you want to use for filtering. The value
6457 /// must be a string, a number, or a boolean. The comparison operator
6458 /// must be `=`, `!=`, `>`, or `<`.
6459 ///
6460 /// For example, if you are filtering a list of Management DNS Zone Bindings,
6461 /// you can exclude the ones named `example-management-dns-zone-binding` by
6462 /// specifying `name != "example-management-dns-zone-binding"`.
6463 ///
6464 /// To filter on multiple expressions, provide each separate expression within
6465 /// parentheses. For example:
6466 ///
6467 /// ```norust
6468 /// (name = "example-management-dns-zone-binding")
6469 /// (createTime > "2021-04-12T08:15:10.40Z")
6470 /// ```
6471 ///
6472 /// By default, each expression is an `AND` expression. However, you
6473 /// can include `AND` and `OR` expressions explicitly.
6474 /// For example:
6475 ///
6476 /// ```norust
6477 /// (name = "example-management-dns-zone-binding-1") AND
6478 /// (createTime > "2021-04-12T08:15:10.40Z") OR
6479 /// (name = "example-management-dns-zone-binding-2")
6480 /// ```
6481 pub filter: std::string::String,
6482
6483 /// Sorts list results by a certain order. By default, returned results
6484 /// are ordered by `name` in ascending order.
6485 /// You can also sort results in descending order based on the `name` value
6486 /// using `orderBy="name desc"`.
6487 /// Currently, only ordering by `name` is supported.
6488 pub order_by: std::string::String,
6489
6490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6491}
6492
6493impl ListManagementDnsZoneBindingsRequest {
6494 pub fn new() -> Self {
6495 std::default::Default::default()
6496 }
6497
6498 /// Sets the value of [parent][crate::model::ListManagementDnsZoneBindingsRequest::parent].
6499 ///
6500 /// # Example
6501 /// ```ignore,no_run
6502 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6503 /// let x = ListManagementDnsZoneBindingsRequest::new().set_parent("example");
6504 /// ```
6505 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506 self.parent = v.into();
6507 self
6508 }
6509
6510 /// Sets the value of [page_size][crate::model::ListManagementDnsZoneBindingsRequest::page_size].
6511 ///
6512 /// # Example
6513 /// ```ignore,no_run
6514 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6515 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_size(42);
6516 /// ```
6517 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6518 self.page_size = v.into();
6519 self
6520 }
6521
6522 /// Sets the value of [page_token][crate::model::ListManagementDnsZoneBindingsRequest::page_token].
6523 ///
6524 /// # Example
6525 /// ```ignore,no_run
6526 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6527 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_token("example");
6528 /// ```
6529 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6530 self.page_token = v.into();
6531 self
6532 }
6533
6534 /// Sets the value of [filter][crate::model::ListManagementDnsZoneBindingsRequest::filter].
6535 ///
6536 /// # Example
6537 /// ```ignore,no_run
6538 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6539 /// let x = ListManagementDnsZoneBindingsRequest::new().set_filter("example");
6540 /// ```
6541 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6542 self.filter = v.into();
6543 self
6544 }
6545
6546 /// Sets the value of [order_by][crate::model::ListManagementDnsZoneBindingsRequest::order_by].
6547 ///
6548 /// # Example
6549 /// ```ignore,no_run
6550 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6551 /// let x = ListManagementDnsZoneBindingsRequest::new().set_order_by("example");
6552 /// ```
6553 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6554 self.order_by = v.into();
6555 self
6556 }
6557}
6558
6559impl wkt::message::Message for ListManagementDnsZoneBindingsRequest {
6560 fn typename() -> &'static str {
6561 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest"
6562 }
6563}
6564
6565/// Response message for
6566/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6567///
6568/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6569#[derive(Clone, Default, PartialEq)]
6570#[non_exhaustive]
6571pub struct ListManagementDnsZoneBindingsResponse {
6572 /// A list of management DNS zone bindings.
6573 pub management_dns_zone_bindings: std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
6574
6575 /// A token, which can be sent as `page_token` to retrieve the next page.
6576 /// If this field is omitted, there are no subsequent pages.
6577 pub next_page_token: std::string::String,
6578
6579 /// Locations that could not be reached when making an aggregated query using
6580 /// wildcards.
6581 pub unreachable: std::vec::Vec<std::string::String>,
6582
6583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6584}
6585
6586impl ListManagementDnsZoneBindingsResponse {
6587 pub fn new() -> Self {
6588 std::default::Default::default()
6589 }
6590
6591 /// Sets the value of [management_dns_zone_bindings][crate::model::ListManagementDnsZoneBindingsResponse::management_dns_zone_bindings].
6592 ///
6593 /// # Example
6594 /// ```ignore,no_run
6595 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6596 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6597 /// let x = ListManagementDnsZoneBindingsResponse::new()
6598 /// .set_management_dns_zone_bindings([
6599 /// ManagementDnsZoneBinding::default()/* use setters */,
6600 /// ManagementDnsZoneBinding::default()/* use (different) setters */,
6601 /// ]);
6602 /// ```
6603 pub fn set_management_dns_zone_bindings<T, V>(mut self, v: T) -> Self
6604 where
6605 T: std::iter::IntoIterator<Item = V>,
6606 V: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6607 {
6608 use std::iter::Iterator;
6609 self.management_dns_zone_bindings = v.into_iter().map(|i| i.into()).collect();
6610 self
6611 }
6612
6613 /// Sets the value of [next_page_token][crate::model::ListManagementDnsZoneBindingsResponse::next_page_token].
6614 ///
6615 /// # Example
6616 /// ```ignore,no_run
6617 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6618 /// let x = ListManagementDnsZoneBindingsResponse::new().set_next_page_token("example");
6619 /// ```
6620 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6621 self.next_page_token = v.into();
6622 self
6623 }
6624
6625 /// Sets the value of [unreachable][crate::model::ListManagementDnsZoneBindingsResponse::unreachable].
6626 ///
6627 /// # Example
6628 /// ```ignore,no_run
6629 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6630 /// let x = ListManagementDnsZoneBindingsResponse::new().set_unreachable(["a", "b", "c"]);
6631 /// ```
6632 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6633 where
6634 T: std::iter::IntoIterator<Item = V>,
6635 V: std::convert::Into<std::string::String>,
6636 {
6637 use std::iter::Iterator;
6638 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6639 self
6640 }
6641}
6642
6643impl wkt::message::Message for ListManagementDnsZoneBindingsResponse {
6644 fn typename() -> &'static str {
6645 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse"
6646 }
6647}
6648
6649#[doc(hidden)]
6650impl google_cloud_gax::paginator::internal::PageableResponse
6651 for ListManagementDnsZoneBindingsResponse
6652{
6653 type PageItem = crate::model::ManagementDnsZoneBinding;
6654
6655 fn items(self) -> std::vec::Vec<Self::PageItem> {
6656 self.management_dns_zone_bindings
6657 }
6658
6659 fn next_page_token(&self) -> std::string::String {
6660 use std::clone::Clone;
6661 self.next_page_token.clone()
6662 }
6663}
6664
6665/// Request message for
6666/// [VmwareEngine.GetManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]
6667///
6668/// [google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]: crate::client::VmwareEngine::get_management_dns_zone_binding
6669#[derive(Clone, Default, PartialEq)]
6670#[non_exhaustive]
6671pub struct GetManagementDnsZoneBindingRequest {
6672 /// Required. The resource name of the management DNS zone binding to
6673 /// retrieve. Resource names are schemeless URIs that follow the conventions in
6674 /// <https://cloud.google.com/apis/design/resource_names>.
6675 /// For example:
6676 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6677 pub name: std::string::String,
6678
6679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6680}
6681
6682impl GetManagementDnsZoneBindingRequest {
6683 pub fn new() -> Self {
6684 std::default::Default::default()
6685 }
6686
6687 /// Sets the value of [name][crate::model::GetManagementDnsZoneBindingRequest::name].
6688 ///
6689 /// # Example
6690 /// ```ignore,no_run
6691 /// # use google_cloud_vmwareengine_v1::model::GetManagementDnsZoneBindingRequest;
6692 /// let x = GetManagementDnsZoneBindingRequest::new().set_name("example");
6693 /// ```
6694 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6695 self.name = v.into();
6696 self
6697 }
6698}
6699
6700impl wkt::message::Message for GetManagementDnsZoneBindingRequest {
6701 fn typename() -> &'static str {
6702 "type.googleapis.com/google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest"
6703 }
6704}
6705
6706/// Request message for [VmwareEngine.CreateManagementDnsZoneBindings][]
6707#[derive(Clone, Default, PartialEq)]
6708#[non_exhaustive]
6709pub struct CreateManagementDnsZoneBindingRequest {
6710 /// Required. The resource name of the private cloud
6711 /// to create a new management DNS zone binding for.
6712 /// Resource names are schemeless URIs that follow the conventions in
6713 /// <https://cloud.google.com/apis/design/resource_names>.
6714 /// For example:
6715 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6716 pub parent: std::string::String,
6717
6718 /// Required. The initial values for a new management DNS zone binding.
6719 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6720
6721 /// Required. The user-provided identifier of the `ManagementDnsZoneBinding`
6722 /// resource to be created. This identifier must be unique among
6723 /// `ManagementDnsZoneBinding` resources within the parent and becomes the
6724 /// final token in the name URI. The identifier must meet the following
6725 /// requirements:
6726 ///
6727 /// * Only contains 1-63 alphanumeric characters and hyphens
6728 /// * Begins with an alphabetical character
6729 /// * Ends with a non-hyphen character
6730 /// * Not formatted as a UUID
6731 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6732 /// (section 3.5)
6733 pub management_dns_zone_binding_id: std::string::String,
6734
6735 /// Optional. A request ID to identify requests. Specify a unique request ID
6736 /// so that if you must retry your request, the server will know to ignore
6737 /// the request if it has already been completed. The server guarantees that a
6738 /// request doesn't result in creation of duplicate commitments for at least 60
6739 /// minutes.
6740 ///
6741 /// For example, consider a situation where you make an initial request and the
6742 /// request times out. If you make the request again with the same request ID,
6743 /// the server can check if the original operation with the same request ID was
6744 /// received, and if so, will ignore the second request. This prevents clients
6745 /// from accidentally creating duplicate commitments.
6746 ///
6747 /// The request ID must be a valid UUID with the exception that zero UUID is
6748 /// not supported (00000000-0000-0000-0000-000000000000).
6749 pub request_id: std::string::String,
6750
6751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6752}
6753
6754impl CreateManagementDnsZoneBindingRequest {
6755 pub fn new() -> Self {
6756 std::default::Default::default()
6757 }
6758
6759 /// Sets the value of [parent][crate::model::CreateManagementDnsZoneBindingRequest::parent].
6760 ///
6761 /// # Example
6762 /// ```ignore,no_run
6763 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6764 /// let x = CreateManagementDnsZoneBindingRequest::new().set_parent("example");
6765 /// ```
6766 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6767 self.parent = v.into();
6768 self
6769 }
6770
6771 /// Sets the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6772 ///
6773 /// # Example
6774 /// ```ignore,no_run
6775 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6776 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6777 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6778 /// ```
6779 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6780 where
6781 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6782 {
6783 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6784 self
6785 }
6786
6787 /// Sets or clears the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6788 ///
6789 /// # Example
6790 /// ```ignore,no_run
6791 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6792 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6793 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6794 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6795 /// ```
6796 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6797 where
6798 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6799 {
6800 self.management_dns_zone_binding = v.map(|x| x.into());
6801 self
6802 }
6803
6804 /// Sets the value of [management_dns_zone_binding_id][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding_id].
6805 ///
6806 /// # Example
6807 /// ```ignore,no_run
6808 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6809 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding_id("example");
6810 /// ```
6811 pub fn set_management_dns_zone_binding_id<T: std::convert::Into<std::string::String>>(
6812 mut self,
6813 v: T,
6814 ) -> Self {
6815 self.management_dns_zone_binding_id = v.into();
6816 self
6817 }
6818
6819 /// Sets the value of [request_id][crate::model::CreateManagementDnsZoneBindingRequest::request_id].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6824 /// let x = CreateManagementDnsZoneBindingRequest::new().set_request_id("example");
6825 /// ```
6826 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827 self.request_id = v.into();
6828 self
6829 }
6830}
6831
6832impl wkt::message::Message for CreateManagementDnsZoneBindingRequest {
6833 fn typename() -> &'static str {
6834 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest"
6835 }
6836}
6837
6838/// Request message for
6839/// [VmwareEngine.UpdateManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]
6840///
6841/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]: crate::client::VmwareEngine::update_management_dns_zone_binding
6842#[derive(Clone, Default, PartialEq)]
6843#[non_exhaustive]
6844pub struct UpdateManagementDnsZoneBindingRequest {
6845 /// Required. Field mask is used to specify the fields to be overwritten in the
6846 /// `ManagementDnsZoneBinding` resource by the update.
6847 /// The fields specified in the `update_mask` are relative to the resource, not
6848 /// the full request. A field will be overwritten if it is in the mask. If the
6849 /// user does not provide a mask then all fields will be overwritten.
6850 pub update_mask: std::option::Option<wkt::FieldMask>,
6851
6852 /// Required. New values to update the management DNS zone binding with.
6853 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6854
6855 /// Optional. A request ID to identify requests. Specify a unique request ID
6856 /// so that if you must retry your request, the server will know to ignore
6857 /// the request if it has already been completed. The server guarantees that a
6858 /// request doesn't result in creation of duplicate commitments for at least 60
6859 /// minutes.
6860 ///
6861 /// For example, consider a situation where you make an initial request and the
6862 /// request times out. If you make the request again with the same request ID,
6863 /// the server can check if the original operation with the same request ID was
6864 /// received, and if so, will ignore the second request. This prevents clients
6865 /// from accidentally creating duplicate commitments.
6866 ///
6867 /// The request ID must be a valid UUID with the exception that zero UUID is
6868 /// not supported (00000000-0000-0000-0000-000000000000).
6869 pub request_id: std::string::String,
6870
6871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6872}
6873
6874impl UpdateManagementDnsZoneBindingRequest {
6875 pub fn new() -> Self {
6876 std::default::Default::default()
6877 }
6878
6879 /// Sets the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6880 ///
6881 /// # Example
6882 /// ```ignore,no_run
6883 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6884 /// use wkt::FieldMask;
6885 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6886 /// ```
6887 pub fn set_update_mask<T>(mut self, v: T) -> Self
6888 where
6889 T: std::convert::Into<wkt::FieldMask>,
6890 {
6891 self.update_mask = std::option::Option::Some(v.into());
6892 self
6893 }
6894
6895 /// Sets or clears the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6896 ///
6897 /// # Example
6898 /// ```ignore,no_run
6899 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6900 /// use wkt::FieldMask;
6901 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6902 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6903 /// ```
6904 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6905 where
6906 T: std::convert::Into<wkt::FieldMask>,
6907 {
6908 self.update_mask = v.map(|x| x.into());
6909 self
6910 }
6911
6912 /// Sets the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6913 ///
6914 /// # Example
6915 /// ```ignore,no_run
6916 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6917 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6918 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6919 /// ```
6920 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6921 where
6922 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6923 {
6924 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6925 self
6926 }
6927
6928 /// Sets or clears the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6929 ///
6930 /// # Example
6931 /// ```ignore,no_run
6932 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6933 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6934 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6935 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6936 /// ```
6937 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6938 where
6939 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6940 {
6941 self.management_dns_zone_binding = v.map(|x| x.into());
6942 self
6943 }
6944
6945 /// Sets the value of [request_id][crate::model::UpdateManagementDnsZoneBindingRequest::request_id].
6946 ///
6947 /// # Example
6948 /// ```ignore,no_run
6949 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6950 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_request_id("example");
6951 /// ```
6952 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6953 self.request_id = v.into();
6954 self
6955 }
6956}
6957
6958impl wkt::message::Message for UpdateManagementDnsZoneBindingRequest {
6959 fn typename() -> &'static str {
6960 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest"
6961 }
6962}
6963
6964/// Request message for
6965/// [VmwareEngine.DeleteManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]
6966///
6967/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]: crate::client::VmwareEngine::delete_management_dns_zone_binding
6968#[derive(Clone, Default, PartialEq)]
6969#[non_exhaustive]
6970pub struct DeleteManagementDnsZoneBindingRequest {
6971 /// Required. The resource name of the management DNS zone binding to delete.
6972 /// Resource names are schemeless URIs that follow the conventions in
6973 /// <https://cloud.google.com/apis/design/resource_names>.
6974 /// For example:
6975 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6976 pub name: std::string::String,
6977
6978 /// Optional. A request ID to identify requests. Specify a unique request ID
6979 /// so that if you must retry your request, the server will know to ignore
6980 /// the request if it has already been completed. The server guarantees that a
6981 /// request doesn't result in creation of duplicate commitments for at least 60
6982 /// minutes.
6983 ///
6984 /// For example, consider a situation where you make an initial request and the
6985 /// request times out. If you make the request again with the same request
6986 /// ID, the server can check if the original operation with the same request ID
6987 /// was received, and if so, will ignore the second request. This prevents
6988 /// clients from accidentally creating duplicate commitments.
6989 ///
6990 /// The request ID must be a valid UUID with the exception that zero UUID is
6991 /// not supported (00000000-0000-0000-0000-000000000000).
6992 pub request_id: std::string::String,
6993
6994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6995}
6996
6997impl DeleteManagementDnsZoneBindingRequest {
6998 pub fn new() -> Self {
6999 std::default::Default::default()
7000 }
7001
7002 /// Sets the value of [name][crate::model::DeleteManagementDnsZoneBindingRequest::name].
7003 ///
7004 /// # Example
7005 /// ```ignore,no_run
7006 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7007 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_name("example");
7008 /// ```
7009 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7010 self.name = v.into();
7011 self
7012 }
7013
7014 /// Sets the value of [request_id][crate::model::DeleteManagementDnsZoneBindingRequest::request_id].
7015 ///
7016 /// # Example
7017 /// ```ignore,no_run
7018 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7019 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_request_id("example");
7020 /// ```
7021 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7022 self.request_id = v.into();
7023 self
7024 }
7025}
7026
7027impl wkt::message::Message for DeleteManagementDnsZoneBindingRequest {
7028 fn typename() -> &'static str {
7029 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest"
7030 }
7031}
7032
7033/// Request message for [VmwareEngine.RepairManagementDnsZoneBindings][]
7034#[derive(Clone, Default, PartialEq)]
7035#[non_exhaustive]
7036pub struct RepairManagementDnsZoneBindingRequest {
7037 /// Required. The resource name of the management DNS zone binding to repair.
7038 /// Resource names are schemeless URIs that follow the conventions in
7039 /// <https://cloud.google.com/apis/design/resource_names>.
7040 /// For example:
7041 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
7042 pub name: std::string::String,
7043
7044 /// Optional. A request ID to identify requests. Specify a unique request ID
7045 /// so that if you must retry your request, the server will know to ignore
7046 /// the request if it has already been completed. The server guarantees that a
7047 /// request doesn't result in creation of duplicate commitments for at least 60
7048 /// minutes.
7049 ///
7050 /// For example, consider a situation where you make an initial request and the
7051 /// request times out. If you make the request again with the same request ID,
7052 /// the server can check if the original operation with the same request ID was
7053 /// received, and if so, will ignore the second request. This prevents clients
7054 /// from accidentally creating duplicate commitments.
7055 ///
7056 /// The request ID must be a valid UUID with the exception that zero UUID is
7057 /// not supported (00000000-0000-0000-0000-000000000000).
7058 pub request_id: std::string::String,
7059
7060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7061}
7062
7063impl RepairManagementDnsZoneBindingRequest {
7064 pub fn new() -> Self {
7065 std::default::Default::default()
7066 }
7067
7068 /// Sets the value of [name][crate::model::RepairManagementDnsZoneBindingRequest::name].
7069 ///
7070 /// # Example
7071 /// ```ignore,no_run
7072 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7073 /// let x = RepairManagementDnsZoneBindingRequest::new().set_name("example");
7074 /// ```
7075 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7076 self.name = v.into();
7077 self
7078 }
7079
7080 /// Sets the value of [request_id][crate::model::RepairManagementDnsZoneBindingRequest::request_id].
7081 ///
7082 /// # Example
7083 /// ```ignore,no_run
7084 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7085 /// let x = RepairManagementDnsZoneBindingRequest::new().set_request_id("example");
7086 /// ```
7087 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7088 self.request_id = v.into();
7089 self
7090 }
7091}
7092
7093impl wkt::message::Message for RepairManagementDnsZoneBindingRequest {
7094 fn typename() -> &'static str {
7095 "type.googleapis.com/google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest"
7096 }
7097}
7098
7099/// Request message for
7100/// [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]
7101///
7102/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]: crate::client::VmwareEngine::create_vmware_engine_network
7103#[derive(Clone, Default, PartialEq)]
7104#[non_exhaustive]
7105pub struct CreateVmwareEngineNetworkRequest {
7106 /// Required. The resource name of the location to create the new VMware Engine
7107 /// network in. A VMware Engine network of type
7108 /// `LEGACY` is a regional resource, and a VMware
7109 /// Engine network of type `STANDARD` is a global resource.
7110 /// Resource names are schemeless URIs that follow the conventions in
7111 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7112 /// `projects/my-project/locations/global`
7113 pub parent: std::string::String,
7114
7115 /// Required. The user-provided identifier of the new VMware Engine network.
7116 /// This identifier must be unique among VMware Engine network resources
7117 /// within the parent and becomes the final token in the name URI. The
7118 /// identifier must meet the following requirements:
7119 ///
7120 /// * For networks of type LEGACY, adheres to the format:
7121 /// `{region-id}-default`. Replace `{region-id}` with the region where you want
7122 /// to create the VMware Engine network. For example, "us-central1-default".
7123 /// * Only contains 1-63 alphanumeric characters and hyphens
7124 /// * Begins with an alphabetical character
7125 /// * Ends with a non-hyphen character
7126 /// * Not formatted as a UUID
7127 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7128 /// (section 3.5)
7129 pub vmware_engine_network_id: std::string::String,
7130
7131 /// Required. The initial description of the new VMware Engine network.
7132 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7133
7134 /// Optional. A request ID to identify requests. Specify a unique request ID
7135 /// so that if you must retry your request, the server will know to ignore
7136 /// the request if it has already been completed. The server guarantees that a
7137 /// request doesn't result in creation of duplicate commitments for at least 60
7138 /// minutes.
7139 ///
7140 /// For example, consider a situation where you make an initial request and the
7141 /// request times out. If you make the request again with the same request
7142 /// ID, the server can check if original operation with the same request ID
7143 /// was received, and if so, will ignore the second request. This prevents
7144 /// clients from accidentally creating duplicate commitments.
7145 ///
7146 /// The request ID must be a valid UUID with the exception that zero UUID is
7147 /// not supported (00000000-0000-0000-0000-000000000000).
7148 pub request_id: std::string::String,
7149
7150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7151}
7152
7153impl CreateVmwareEngineNetworkRequest {
7154 pub fn new() -> Self {
7155 std::default::Default::default()
7156 }
7157
7158 /// Sets the value of [parent][crate::model::CreateVmwareEngineNetworkRequest::parent].
7159 ///
7160 /// # Example
7161 /// ```ignore,no_run
7162 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7163 /// let x = CreateVmwareEngineNetworkRequest::new().set_parent("example");
7164 /// ```
7165 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7166 self.parent = v.into();
7167 self
7168 }
7169
7170 /// Sets the value of [vmware_engine_network_id][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network_id].
7171 ///
7172 /// # Example
7173 /// ```ignore,no_run
7174 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7175 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network_id("example");
7176 /// ```
7177 pub fn set_vmware_engine_network_id<T: std::convert::Into<std::string::String>>(
7178 mut self,
7179 v: T,
7180 ) -> Self {
7181 self.vmware_engine_network_id = v.into();
7182 self
7183 }
7184
7185 /// Sets the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7190 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7191 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7192 /// ```
7193 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7194 where
7195 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7196 {
7197 self.vmware_engine_network = std::option::Option::Some(v.into());
7198 self
7199 }
7200
7201 /// Sets or clears the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7202 ///
7203 /// # Example
7204 /// ```ignore,no_run
7205 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7206 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7207 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7208 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7209 /// ```
7210 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7211 where
7212 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7213 {
7214 self.vmware_engine_network = v.map(|x| x.into());
7215 self
7216 }
7217
7218 /// Sets the value of [request_id][crate::model::CreateVmwareEngineNetworkRequest::request_id].
7219 ///
7220 /// # Example
7221 /// ```ignore,no_run
7222 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7223 /// let x = CreateVmwareEngineNetworkRequest::new().set_request_id("example");
7224 /// ```
7225 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7226 self.request_id = v.into();
7227 self
7228 }
7229}
7230
7231impl wkt::message::Message for CreateVmwareEngineNetworkRequest {
7232 fn typename() -> &'static str {
7233 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"
7234 }
7235}
7236
7237/// Request message for
7238/// [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]
7239///
7240/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]: crate::client::VmwareEngine::update_vmware_engine_network
7241#[derive(Clone, Default, PartialEq)]
7242#[non_exhaustive]
7243pub struct UpdateVmwareEngineNetworkRequest {
7244 /// Required. VMware Engine network description.
7245 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7246
7247 /// Required. Field mask is used to specify the fields to be overwritten in the
7248 /// VMware Engine network resource by the update.
7249 /// The fields specified in the `update_mask` are relative to the resource, not
7250 /// the full request. A field will be overwritten if it is in the mask. If the
7251 /// user does not provide a mask then all fields will be overwritten. Only the
7252 /// following fields can be updated: `description`.
7253 pub update_mask: std::option::Option<wkt::FieldMask>,
7254
7255 /// Optional. A request ID to identify requests. Specify a unique request ID
7256 /// so that if you must retry your request, the server will know to ignore
7257 /// the request if it has already been completed. The server guarantees that a
7258 /// request doesn't result in creation of duplicate commitments for at least 60
7259 /// minutes.
7260 ///
7261 /// For example, consider a situation where you make an initial request and the
7262 /// request times out. If you make the request again with the same request
7263 /// ID, the server can check if original operation with the same request ID
7264 /// was received, and if so, will ignore the second request. This prevents
7265 /// clients from accidentally creating duplicate commitments.
7266 ///
7267 /// The request ID must be a valid UUID with the exception that zero UUID is
7268 /// not supported (00000000-0000-0000-0000-000000000000).
7269 pub request_id: std::string::String,
7270
7271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7272}
7273
7274impl UpdateVmwareEngineNetworkRequest {
7275 pub fn new() -> Self {
7276 std::default::Default::default()
7277 }
7278
7279 /// Sets the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7284 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7285 /// let x = UpdateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7286 /// ```
7287 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7288 where
7289 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7290 {
7291 self.vmware_engine_network = std::option::Option::Some(v.into());
7292 self
7293 }
7294
7295 /// Sets or clears the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7296 ///
7297 /// # Example
7298 /// ```ignore,no_run
7299 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7300 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7301 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7302 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7303 /// ```
7304 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7305 where
7306 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7307 {
7308 self.vmware_engine_network = v.map(|x| x.into());
7309 self
7310 }
7311
7312 /// Sets the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7313 ///
7314 /// # Example
7315 /// ```ignore,no_run
7316 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7317 /// use wkt::FieldMask;
7318 /// let x = UpdateVmwareEngineNetworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7319 /// ```
7320 pub fn set_update_mask<T>(mut self, v: T) -> Self
7321 where
7322 T: std::convert::Into<wkt::FieldMask>,
7323 {
7324 self.update_mask = std::option::Option::Some(v.into());
7325 self
7326 }
7327
7328 /// Sets or clears the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7329 ///
7330 /// # Example
7331 /// ```ignore,no_run
7332 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7333 /// use wkt::FieldMask;
7334 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7335 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7336 /// ```
7337 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7338 where
7339 T: std::convert::Into<wkt::FieldMask>,
7340 {
7341 self.update_mask = v.map(|x| x.into());
7342 self
7343 }
7344
7345 /// Sets the value of [request_id][crate::model::UpdateVmwareEngineNetworkRequest::request_id].
7346 ///
7347 /// # Example
7348 /// ```ignore,no_run
7349 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7350 /// let x = UpdateVmwareEngineNetworkRequest::new().set_request_id("example");
7351 /// ```
7352 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7353 self.request_id = v.into();
7354 self
7355 }
7356}
7357
7358impl wkt::message::Message for UpdateVmwareEngineNetworkRequest {
7359 fn typename() -> &'static str {
7360 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"
7361 }
7362}
7363
7364/// Request message for
7365/// [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]
7366///
7367/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]: crate::client::VmwareEngine::delete_vmware_engine_network
7368#[derive(Clone, Default, PartialEq)]
7369#[non_exhaustive]
7370pub struct DeleteVmwareEngineNetworkRequest {
7371 /// Required. The resource name of the VMware Engine network to be deleted.
7372 /// Resource names are schemeless URIs that follow the conventions in
7373 /// <https://cloud.google.com/apis/design/resource_names>.
7374 /// For example:
7375 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7376 pub name: std::string::String,
7377
7378 /// Optional. A request ID to identify requests. Specify a unique request ID
7379 /// so that if you must retry your request, the server will know to ignore
7380 /// the request if it has already been completed. The server guarantees that a
7381 /// request doesn't result in creation of duplicate commitments for at least 60
7382 /// minutes.
7383 ///
7384 /// For example, consider a situation where you make an initial request and the
7385 /// request times out. If you make the request again with the same request
7386 /// ID, the server can check if original operation with the same request ID
7387 /// was received, and if so, will ignore the second request. This prevents
7388 /// clients from accidentally creating duplicate commitments.
7389 ///
7390 /// The request ID must be a valid UUID with the exception that zero UUID is
7391 /// not supported (00000000-0000-0000-0000-000000000000).
7392 pub request_id: std::string::String,
7393
7394 /// Optional. Checksum used to ensure that the user-provided value is up to
7395 /// date before the server processes the request. The server compares provided
7396 /// checksum with the current checksum of the resource. If the user-provided
7397 /// value is out of date, this request returns an `ABORTED` error.
7398 pub etag: std::string::String,
7399
7400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7401}
7402
7403impl DeleteVmwareEngineNetworkRequest {
7404 pub fn new() -> Self {
7405 std::default::Default::default()
7406 }
7407
7408 /// Sets the value of [name][crate::model::DeleteVmwareEngineNetworkRequest::name].
7409 ///
7410 /// # Example
7411 /// ```ignore,no_run
7412 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7413 /// let x = DeleteVmwareEngineNetworkRequest::new().set_name("example");
7414 /// ```
7415 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7416 self.name = v.into();
7417 self
7418 }
7419
7420 /// Sets the value of [request_id][crate::model::DeleteVmwareEngineNetworkRequest::request_id].
7421 ///
7422 /// # Example
7423 /// ```ignore,no_run
7424 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7425 /// let x = DeleteVmwareEngineNetworkRequest::new().set_request_id("example");
7426 /// ```
7427 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7428 self.request_id = v.into();
7429 self
7430 }
7431
7432 /// Sets the value of [etag][crate::model::DeleteVmwareEngineNetworkRequest::etag].
7433 ///
7434 /// # Example
7435 /// ```ignore,no_run
7436 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7437 /// let x = DeleteVmwareEngineNetworkRequest::new().set_etag("example");
7438 /// ```
7439 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7440 self.etag = v.into();
7441 self
7442 }
7443}
7444
7445impl wkt::message::Message for DeleteVmwareEngineNetworkRequest {
7446 fn typename() -> &'static str {
7447 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"
7448 }
7449}
7450
7451/// Request message for
7452/// [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]
7453///
7454/// [google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]: crate::client::VmwareEngine::get_vmware_engine_network
7455#[derive(Clone, Default, PartialEq)]
7456#[non_exhaustive]
7457pub struct GetVmwareEngineNetworkRequest {
7458 /// Required. The resource name of the VMware Engine network to retrieve.
7459 /// Resource names are schemeless URIs that follow the conventions in
7460 /// <https://cloud.google.com/apis/design/resource_names>.
7461 /// For example:
7462 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7463 pub name: std::string::String,
7464
7465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7466}
7467
7468impl GetVmwareEngineNetworkRequest {
7469 pub fn new() -> Self {
7470 std::default::Default::default()
7471 }
7472
7473 /// Sets the value of [name][crate::model::GetVmwareEngineNetworkRequest::name].
7474 ///
7475 /// # Example
7476 /// ```ignore,no_run
7477 /// # use google_cloud_vmwareengine_v1::model::GetVmwareEngineNetworkRequest;
7478 /// let x = GetVmwareEngineNetworkRequest::new().set_name("example");
7479 /// ```
7480 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7481 self.name = v.into();
7482 self
7483 }
7484}
7485
7486impl wkt::message::Message for GetVmwareEngineNetworkRequest {
7487 fn typename() -> &'static str {
7488 "type.googleapis.com/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"
7489 }
7490}
7491
7492/// Request message for
7493/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7494///
7495/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7496#[derive(Clone, Default, PartialEq)]
7497#[non_exhaustive]
7498pub struct ListVmwareEngineNetworksRequest {
7499 /// Required. The resource name of the location to query for
7500 /// VMware Engine networks. Resource names are schemeless URIs that follow the
7501 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7502 /// example: `projects/my-project/locations/global`
7503 pub parent: std::string::String,
7504
7505 /// The maximum number of results to return in one page.
7506 /// The maximum value is coerced to 1000.
7507 /// The default value of this field is 500.
7508 pub page_size: i32,
7509
7510 /// A page token, received from a previous `ListVmwareEngineNetworks` call.
7511 /// Provide this to retrieve the subsequent page.
7512 ///
7513 /// When paginating, all other parameters provided to
7514 /// `ListVmwareEngineNetworks` must match the call that provided the page
7515 /// token.
7516 pub page_token: std::string::String,
7517
7518 /// A filter expression that matches resources returned in the response.
7519 /// The expression must specify the field name, a comparison
7520 /// operator, and the value that you want to use for filtering. The value
7521 /// must be a string, a number, or a boolean. The comparison operator
7522 /// must be `=`, `!=`, `>`, or `<`.
7523 ///
7524 /// For example, if you are filtering a list of network peerings, you can
7525 /// exclude the ones named `example-network` by specifying
7526 /// `name != "example-network"`.
7527 ///
7528 /// To filter on multiple expressions, provide each separate expression within
7529 /// parentheses. For example:
7530 ///
7531 /// ```norust
7532 /// (name = "example-network")
7533 /// (createTime > "2021-04-12T08:15:10.40Z")
7534 /// ```
7535 ///
7536 /// By default, each expression is an `AND` expression. However, you
7537 /// can include `AND` and `OR` expressions explicitly.
7538 /// For example:
7539 ///
7540 /// ```norust
7541 /// (name = "example-network-1") AND
7542 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7543 /// (name = "example-network-2")
7544 /// ```
7545 pub filter: std::string::String,
7546
7547 /// Sorts list results by a certain order. By default, returned results
7548 /// are ordered by `name` in ascending order.
7549 /// You can also sort results in descending order based on the `name` value
7550 /// using `orderBy="name desc"`.
7551 /// Currently, only ordering by `name` is supported.
7552 pub order_by: std::string::String,
7553
7554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7555}
7556
7557impl ListVmwareEngineNetworksRequest {
7558 pub fn new() -> Self {
7559 std::default::Default::default()
7560 }
7561
7562 /// Sets the value of [parent][crate::model::ListVmwareEngineNetworksRequest::parent].
7563 ///
7564 /// # Example
7565 /// ```ignore,no_run
7566 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7567 /// let x = ListVmwareEngineNetworksRequest::new().set_parent("example");
7568 /// ```
7569 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7570 self.parent = v.into();
7571 self
7572 }
7573
7574 /// Sets the value of [page_size][crate::model::ListVmwareEngineNetworksRequest::page_size].
7575 ///
7576 /// # Example
7577 /// ```ignore,no_run
7578 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7579 /// let x = ListVmwareEngineNetworksRequest::new().set_page_size(42);
7580 /// ```
7581 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7582 self.page_size = v.into();
7583 self
7584 }
7585
7586 /// Sets the value of [page_token][crate::model::ListVmwareEngineNetworksRequest::page_token].
7587 ///
7588 /// # Example
7589 /// ```ignore,no_run
7590 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7591 /// let x = ListVmwareEngineNetworksRequest::new().set_page_token("example");
7592 /// ```
7593 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7594 self.page_token = v.into();
7595 self
7596 }
7597
7598 /// Sets the value of [filter][crate::model::ListVmwareEngineNetworksRequest::filter].
7599 ///
7600 /// # Example
7601 /// ```ignore,no_run
7602 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7603 /// let x = ListVmwareEngineNetworksRequest::new().set_filter("example");
7604 /// ```
7605 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7606 self.filter = v.into();
7607 self
7608 }
7609
7610 /// Sets the value of [order_by][crate::model::ListVmwareEngineNetworksRequest::order_by].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7615 /// let x = ListVmwareEngineNetworksRequest::new().set_order_by("example");
7616 /// ```
7617 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7618 self.order_by = v.into();
7619 self
7620 }
7621}
7622
7623impl wkt::message::Message for ListVmwareEngineNetworksRequest {
7624 fn typename() -> &'static str {
7625 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"
7626 }
7627}
7628
7629/// Response message for
7630/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7631///
7632/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7633#[derive(Clone, Default, PartialEq)]
7634#[non_exhaustive]
7635pub struct ListVmwareEngineNetworksResponse {
7636 /// A list of VMware Engine networks.
7637 pub vmware_engine_networks: std::vec::Vec<crate::model::VmwareEngineNetwork>,
7638
7639 /// A token, which can be sent as `page_token` to retrieve the next page.
7640 /// If this field is omitted, there are no subsequent pages.
7641 pub next_page_token: std::string::String,
7642
7643 /// Unreachable resources.
7644 pub unreachable: std::vec::Vec<std::string::String>,
7645
7646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7647}
7648
7649impl ListVmwareEngineNetworksResponse {
7650 pub fn new() -> Self {
7651 std::default::Default::default()
7652 }
7653
7654 /// Sets the value of [vmware_engine_networks][crate::model::ListVmwareEngineNetworksResponse::vmware_engine_networks].
7655 ///
7656 /// # Example
7657 /// ```ignore,no_run
7658 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7659 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7660 /// let x = ListVmwareEngineNetworksResponse::new()
7661 /// .set_vmware_engine_networks([
7662 /// VmwareEngineNetwork::default()/* use setters */,
7663 /// VmwareEngineNetwork::default()/* use (different) setters */,
7664 /// ]);
7665 /// ```
7666 pub fn set_vmware_engine_networks<T, V>(mut self, v: T) -> Self
7667 where
7668 T: std::iter::IntoIterator<Item = V>,
7669 V: std::convert::Into<crate::model::VmwareEngineNetwork>,
7670 {
7671 use std::iter::Iterator;
7672 self.vmware_engine_networks = v.into_iter().map(|i| i.into()).collect();
7673 self
7674 }
7675
7676 /// Sets the value of [next_page_token][crate::model::ListVmwareEngineNetworksResponse::next_page_token].
7677 ///
7678 /// # Example
7679 /// ```ignore,no_run
7680 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7681 /// let x = ListVmwareEngineNetworksResponse::new().set_next_page_token("example");
7682 /// ```
7683 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7684 self.next_page_token = v.into();
7685 self
7686 }
7687
7688 /// Sets the value of [unreachable][crate::model::ListVmwareEngineNetworksResponse::unreachable].
7689 ///
7690 /// # Example
7691 /// ```ignore,no_run
7692 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7693 /// let x = ListVmwareEngineNetworksResponse::new().set_unreachable(["a", "b", "c"]);
7694 /// ```
7695 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7696 where
7697 T: std::iter::IntoIterator<Item = V>,
7698 V: std::convert::Into<std::string::String>,
7699 {
7700 use std::iter::Iterator;
7701 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7702 self
7703 }
7704}
7705
7706impl wkt::message::Message for ListVmwareEngineNetworksResponse {
7707 fn typename() -> &'static str {
7708 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"
7709 }
7710}
7711
7712#[doc(hidden)]
7713impl google_cloud_gax::paginator::internal::PageableResponse for ListVmwareEngineNetworksResponse {
7714 type PageItem = crate::model::VmwareEngineNetwork;
7715
7716 fn items(self) -> std::vec::Vec<Self::PageItem> {
7717 self.vmware_engine_networks
7718 }
7719
7720 fn next_page_token(&self) -> std::string::String {
7721 use std::clone::Clone;
7722 self.next_page_token.clone()
7723 }
7724}
7725
7726/// Request message for
7727/// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]
7728///
7729/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]: crate::client::VmwareEngine::create_private_connection
7730#[derive(Clone, Default, PartialEq)]
7731#[non_exhaustive]
7732pub struct CreatePrivateConnectionRequest {
7733 /// Required. The resource name of the location to create the new private
7734 /// connection in. Private connection is a regional resource.
7735 /// Resource names are schemeless URIs that follow the conventions in
7736 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7737 /// `projects/my-project/locations/us-central1`
7738 pub parent: std::string::String,
7739
7740 /// Required. The user-provided identifier of the new private connection.
7741 /// This identifier must be unique among private connection resources
7742 /// within the parent and becomes the final token in the name URI. The
7743 /// identifier must meet the following requirements:
7744 ///
7745 /// * Only contains 1-63 alphanumeric characters and hyphens
7746 /// * Begins with an alphabetical character
7747 /// * Ends with a non-hyphen character
7748 /// * Not formatted as a UUID
7749 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7750 /// (section 3.5)
7751 pub private_connection_id: std::string::String,
7752
7753 /// Required. The initial description of the new private connection.
7754 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
7755
7756 /// Optional. A request ID to identify requests. Specify a unique request ID
7757 /// so that if you must retry your request, the server will know to ignore
7758 /// the request if it has already been completed. The server guarantees that a
7759 /// request doesn't result in creation of duplicate commitments for at least 60
7760 /// minutes.
7761 ///
7762 /// For example, consider a situation where you make an initial request and the
7763 /// request times out. If you make the request again with the same request
7764 /// ID, the server can check if original operation with the same request ID
7765 /// was received, and if so, will ignore the second request. This prevents
7766 /// clients from accidentally creating duplicate commitments.
7767 ///
7768 /// The request ID must be a valid UUID with the exception that zero UUID is
7769 /// not supported (00000000-0000-0000-0000-000000000000).
7770 pub request_id: std::string::String,
7771
7772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7773}
7774
7775impl CreatePrivateConnectionRequest {
7776 pub fn new() -> Self {
7777 std::default::Default::default()
7778 }
7779
7780 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
7781 ///
7782 /// # Example
7783 /// ```ignore,no_run
7784 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7785 /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
7786 /// ```
7787 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7788 self.parent = v.into();
7789 self
7790 }
7791
7792 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
7793 ///
7794 /// # Example
7795 /// ```ignore,no_run
7796 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7797 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
7798 /// ```
7799 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
7800 mut self,
7801 v: T,
7802 ) -> Self {
7803 self.private_connection_id = v.into();
7804 self
7805 }
7806
7807 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7808 ///
7809 /// # Example
7810 /// ```ignore,no_run
7811 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7812 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7813 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
7814 /// ```
7815 pub fn set_private_connection<T>(mut self, v: T) -> Self
7816 where
7817 T: std::convert::Into<crate::model::PrivateConnection>,
7818 {
7819 self.private_connection = std::option::Option::Some(v.into());
7820 self
7821 }
7822
7823 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7824 ///
7825 /// # Example
7826 /// ```ignore,no_run
7827 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7828 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7829 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
7830 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
7831 /// ```
7832 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
7833 where
7834 T: std::convert::Into<crate::model::PrivateConnection>,
7835 {
7836 self.private_connection = v.map(|x| x.into());
7837 self
7838 }
7839
7840 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
7841 ///
7842 /// # Example
7843 /// ```ignore,no_run
7844 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7845 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
7846 /// ```
7847 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7848 self.request_id = v.into();
7849 self
7850 }
7851}
7852
7853impl wkt::message::Message for CreatePrivateConnectionRequest {
7854 fn typename() -> &'static str {
7855 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"
7856 }
7857}
7858
7859/// Request message for
7860/// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]
7861///
7862/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]: crate::client::VmwareEngine::get_private_connection
7863#[derive(Clone, Default, PartialEq)]
7864#[non_exhaustive]
7865pub struct GetPrivateConnectionRequest {
7866 /// Required. The resource name of the private connection to retrieve.
7867 /// Resource names are schemeless URIs that follow the conventions in
7868 /// <https://cloud.google.com/apis/design/resource_names>.
7869 /// For example:
7870 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
7871 pub name: std::string::String,
7872
7873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7874}
7875
7876impl GetPrivateConnectionRequest {
7877 pub fn new() -> Self {
7878 std::default::Default::default()
7879 }
7880
7881 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
7882 ///
7883 /// # Example
7884 /// ```ignore,no_run
7885 /// # use google_cloud_vmwareengine_v1::model::GetPrivateConnectionRequest;
7886 /// let x = GetPrivateConnectionRequest::new().set_name("example");
7887 /// ```
7888 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7889 self.name = v.into();
7890 self
7891 }
7892}
7893
7894impl wkt::message::Message for GetPrivateConnectionRequest {
7895 fn typename() -> &'static str {
7896 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"
7897 }
7898}
7899
7900/// Request message for
7901/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
7902///
7903/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
7904#[derive(Clone, Default, PartialEq)]
7905#[non_exhaustive]
7906pub struct ListPrivateConnectionsRequest {
7907 /// Required. The resource name of the location to query for
7908 /// private connections. Resource names are schemeless URIs that follow the
7909 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7910 /// example: `projects/my-project/locations/us-central1`
7911 pub parent: std::string::String,
7912
7913 /// The maximum number of private connections to return in one page.
7914 /// The maximum value is coerced to 1000.
7915 /// The default value of this field is 500.
7916 pub page_size: i32,
7917
7918 /// A page token, received from a previous `ListPrivateConnections` call.
7919 /// Provide this to retrieve the subsequent page.
7920 ///
7921 /// When paginating, all other parameters provided to
7922 /// `ListPrivateConnections` must match the call that provided the page
7923 /// token.
7924 pub page_token: std::string::String,
7925
7926 /// A filter expression that matches resources returned in the response.
7927 /// The expression must specify the field name, a comparison
7928 /// operator, and the value that you want to use for filtering. The value
7929 /// must be a string, a number, or a boolean. The comparison operator
7930 /// must be `=`, `!=`, `>`, or `<`.
7931 ///
7932 /// For example, if you are filtering a list of private connections, you can
7933 /// exclude the ones named `example-connection` by specifying
7934 /// `name != "example-connection"`.
7935 ///
7936 /// To filter on multiple expressions, provide each separate expression within
7937 /// parentheses. For example:
7938 ///
7939 /// ```norust
7940 /// (name = "example-connection")
7941 /// (createTime > "2022-09-22T08:15:10.40Z")
7942 /// ```
7943 ///
7944 /// By default, each expression is an `AND` expression. However, you
7945 /// can include `AND` and `OR` expressions explicitly.
7946 /// For example:
7947 ///
7948 /// ```norust
7949 /// (name = "example-connection-1") AND
7950 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7951 /// (name = "example-connection-2")
7952 /// ```
7953 pub filter: std::string::String,
7954
7955 /// Sorts list results by a certain order. By default, returned results
7956 /// are ordered by `name` in ascending order.
7957 /// You can also sort results in descending order based on the `name` value
7958 /// using `orderBy="name desc"`.
7959 /// Currently, only ordering by `name` is supported.
7960 pub order_by: std::string::String,
7961
7962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7963}
7964
7965impl ListPrivateConnectionsRequest {
7966 pub fn new() -> Self {
7967 std::default::Default::default()
7968 }
7969
7970 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
7971 ///
7972 /// # Example
7973 /// ```ignore,no_run
7974 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7975 /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
7976 /// ```
7977 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7978 self.parent = v.into();
7979 self
7980 }
7981
7982 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
7983 ///
7984 /// # Example
7985 /// ```ignore,no_run
7986 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7987 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
7988 /// ```
7989 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7990 self.page_size = v.into();
7991 self
7992 }
7993
7994 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
7995 ///
7996 /// # Example
7997 /// ```ignore,no_run
7998 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7999 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
8000 /// ```
8001 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8002 self.page_token = v.into();
8003 self
8004 }
8005
8006 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
8007 ///
8008 /// # Example
8009 /// ```ignore,no_run
8010 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8011 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
8012 /// ```
8013 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8014 self.filter = v.into();
8015 self
8016 }
8017
8018 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
8019 ///
8020 /// # Example
8021 /// ```ignore,no_run
8022 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8023 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
8024 /// ```
8025 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8026 self.order_by = v.into();
8027 self
8028 }
8029}
8030
8031impl wkt::message::Message for ListPrivateConnectionsRequest {
8032 fn typename() -> &'static str {
8033 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"
8034 }
8035}
8036
8037/// Response message for
8038/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
8039///
8040/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
8041#[derive(Clone, Default, PartialEq)]
8042#[non_exhaustive]
8043pub struct ListPrivateConnectionsResponse {
8044 /// A list of private connections.
8045 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
8046
8047 /// A token, which can be sent as `page_token` to retrieve the next page.
8048 /// If this field is omitted, there are no subsequent pages.
8049 pub next_page_token: std::string::String,
8050
8051 /// Unreachable resources.
8052 pub unreachable: std::vec::Vec<std::string::String>,
8053
8054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8055}
8056
8057impl ListPrivateConnectionsResponse {
8058 pub fn new() -> Self {
8059 std::default::Default::default()
8060 }
8061
8062 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
8063 ///
8064 /// # Example
8065 /// ```ignore,no_run
8066 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8067 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8068 /// let x = ListPrivateConnectionsResponse::new()
8069 /// .set_private_connections([
8070 /// PrivateConnection::default()/* use setters */,
8071 /// PrivateConnection::default()/* use (different) setters */,
8072 /// ]);
8073 /// ```
8074 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
8075 where
8076 T: std::iter::IntoIterator<Item = V>,
8077 V: std::convert::Into<crate::model::PrivateConnection>,
8078 {
8079 use std::iter::Iterator;
8080 self.private_connections = v.into_iter().map(|i| i.into()).collect();
8081 self
8082 }
8083
8084 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
8085 ///
8086 /// # Example
8087 /// ```ignore,no_run
8088 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8089 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
8090 /// ```
8091 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8092 self.next_page_token = v.into();
8093 self
8094 }
8095
8096 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
8097 ///
8098 /// # Example
8099 /// ```ignore,no_run
8100 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8101 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
8102 /// ```
8103 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8104 where
8105 T: std::iter::IntoIterator<Item = V>,
8106 V: std::convert::Into<std::string::String>,
8107 {
8108 use std::iter::Iterator;
8109 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8110 self
8111 }
8112}
8113
8114impl wkt::message::Message for ListPrivateConnectionsResponse {
8115 fn typename() -> &'static str {
8116 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"
8117 }
8118}
8119
8120#[doc(hidden)]
8121impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
8122 type PageItem = crate::model::PrivateConnection;
8123
8124 fn items(self) -> std::vec::Vec<Self::PageItem> {
8125 self.private_connections
8126 }
8127
8128 fn next_page_token(&self) -> std::string::String {
8129 use std::clone::Clone;
8130 self.next_page_token.clone()
8131 }
8132}
8133
8134/// Request message for
8135/// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]
8136///
8137/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]: crate::client::VmwareEngine::update_private_connection
8138#[derive(Clone, Default, PartialEq)]
8139#[non_exhaustive]
8140pub struct UpdatePrivateConnectionRequest {
8141 /// Required. Private connection description.
8142 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
8143
8144 /// Required. Field mask is used to specify the fields to be overwritten in the
8145 /// `PrivateConnection` resource by the update.
8146 /// The fields specified in the `update_mask` are relative to the resource, not
8147 /// the full request. A field will be overwritten if it is in the mask. If the
8148 /// user does not provide a mask then all fields will be overwritten.
8149 pub update_mask: std::option::Option<wkt::FieldMask>,
8150
8151 /// Optional. A request ID to identify requests. Specify a unique request ID
8152 /// so that if you must retry your request, the server will know to ignore
8153 /// the request if it has already been completed. The server guarantees that a
8154 /// request doesn't result in creation of duplicate commitments for at least 60
8155 /// minutes.
8156 ///
8157 /// For example, consider a situation where you make an initial request and the
8158 /// request times out. If you make the request again with the same request
8159 /// ID, the server can check if original operation with the same request ID
8160 /// was received, and if so, will ignore the second request. This prevents
8161 /// clients from accidentally creating duplicate commitments.
8162 ///
8163 /// The request ID must be a valid UUID with the exception that zero UUID is
8164 /// not supported (00000000-0000-0000-0000-000000000000).
8165 pub request_id: std::string::String,
8166
8167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8168}
8169
8170impl UpdatePrivateConnectionRequest {
8171 pub fn new() -> Self {
8172 std::default::Default::default()
8173 }
8174
8175 /// Sets the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8176 ///
8177 /// # Example
8178 /// ```ignore,no_run
8179 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8180 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8181 /// let x = UpdatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
8182 /// ```
8183 pub fn set_private_connection<T>(mut self, v: T) -> Self
8184 where
8185 T: std::convert::Into<crate::model::PrivateConnection>,
8186 {
8187 self.private_connection = std::option::Option::Some(v.into());
8188 self
8189 }
8190
8191 /// Sets or clears the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8192 ///
8193 /// # Example
8194 /// ```ignore,no_run
8195 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8196 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8197 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
8198 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
8199 /// ```
8200 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
8201 where
8202 T: std::convert::Into<crate::model::PrivateConnection>,
8203 {
8204 self.private_connection = v.map(|x| x.into());
8205 self
8206 }
8207
8208 /// Sets the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8209 ///
8210 /// # Example
8211 /// ```ignore,no_run
8212 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8213 /// use wkt::FieldMask;
8214 /// let x = UpdatePrivateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8215 /// ```
8216 pub fn set_update_mask<T>(mut self, v: T) -> Self
8217 where
8218 T: std::convert::Into<wkt::FieldMask>,
8219 {
8220 self.update_mask = std::option::Option::Some(v.into());
8221 self
8222 }
8223
8224 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8225 ///
8226 /// # Example
8227 /// ```ignore,no_run
8228 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8229 /// use wkt::FieldMask;
8230 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8231 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8232 /// ```
8233 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8234 where
8235 T: std::convert::Into<wkt::FieldMask>,
8236 {
8237 self.update_mask = v.map(|x| x.into());
8238 self
8239 }
8240
8241 /// Sets the value of [request_id][crate::model::UpdatePrivateConnectionRequest::request_id].
8242 ///
8243 /// # Example
8244 /// ```ignore,no_run
8245 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8246 /// let x = UpdatePrivateConnectionRequest::new().set_request_id("example");
8247 /// ```
8248 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8249 self.request_id = v.into();
8250 self
8251 }
8252}
8253
8254impl wkt::message::Message for UpdatePrivateConnectionRequest {
8255 fn typename() -> &'static str {
8256 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"
8257 }
8258}
8259
8260/// Request message for
8261/// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]
8262///
8263/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]: crate::client::VmwareEngine::delete_private_connection
8264#[derive(Clone, Default, PartialEq)]
8265#[non_exhaustive]
8266pub struct DeletePrivateConnectionRequest {
8267 /// Required. The resource name of the private connection to be deleted.
8268 /// Resource names are schemeless URIs that follow the conventions in
8269 /// <https://cloud.google.com/apis/design/resource_names>.
8270 /// For example:
8271 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
8272 pub name: std::string::String,
8273
8274 /// Optional. A request ID to identify requests. Specify a unique request ID
8275 /// so that if you must retry your request, the server will know to ignore
8276 /// the request if it has already been completed. The server guarantees that a
8277 /// request doesn't result in creation of duplicate commitments for at least 60
8278 /// minutes.
8279 ///
8280 /// For example, consider a situation where you make an initial request and the
8281 /// request times out. If you make the request again with the same request
8282 /// ID, the server can check if original operation with the same request ID
8283 /// was received, and if so, will ignore the second request. This prevents
8284 /// clients from accidentally creating duplicate commitments.
8285 ///
8286 /// The request ID must be a valid UUID with the exception that zero UUID is
8287 /// not supported (00000000-0000-0000-0000-000000000000).
8288 pub request_id: std::string::String,
8289
8290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8291}
8292
8293impl DeletePrivateConnectionRequest {
8294 pub fn new() -> Self {
8295 std::default::Default::default()
8296 }
8297
8298 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
8299 ///
8300 /// # Example
8301 /// ```ignore,no_run
8302 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8303 /// let x = DeletePrivateConnectionRequest::new().set_name("example");
8304 /// ```
8305 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8306 self.name = v.into();
8307 self
8308 }
8309
8310 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
8311 ///
8312 /// # Example
8313 /// ```ignore,no_run
8314 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8315 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
8316 /// ```
8317 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8318 self.request_id = v.into();
8319 self
8320 }
8321}
8322
8323impl wkt::message::Message for DeletePrivateConnectionRequest {
8324 fn typename() -> &'static str {
8325 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"
8326 }
8327}
8328
8329/// Request message for
8330/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8331///
8332/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8333#[derive(Clone, Default, PartialEq)]
8334#[non_exhaustive]
8335pub struct ListPrivateConnectionPeeringRoutesRequest {
8336 /// Required. The resource name of the private connection to retrieve peering
8337 /// routes from. Resource names are schemeless URIs that follow the conventions
8338 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
8339 /// `projects/my-project/locations/us-west1/privateConnections/my-connection`
8340 pub parent: std::string::String,
8341
8342 /// The maximum number of peering routes to return in one page.
8343 /// The service may return fewer than this value.
8344 /// The maximum value is coerced to 1000.
8345 /// The default value of this field is 500.
8346 pub page_size: i32,
8347
8348 /// A page token, received from a previous `ListPrivateConnectionPeeringRoutes`
8349 /// call. Provide this to retrieve the subsequent page. When paginating, all
8350 /// other parameters provided to `ListPrivateConnectionPeeringRoutes` must
8351 /// match the call that provided the page token.
8352 pub page_token: std::string::String,
8353
8354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8355}
8356
8357impl ListPrivateConnectionPeeringRoutesRequest {
8358 pub fn new() -> Self {
8359 std::default::Default::default()
8360 }
8361
8362 /// Sets the value of [parent][crate::model::ListPrivateConnectionPeeringRoutesRequest::parent].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8367 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_parent("example");
8368 /// ```
8369 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8370 self.parent = v.into();
8371 self
8372 }
8373
8374 /// Sets the value of [page_size][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_size].
8375 ///
8376 /// # Example
8377 /// ```ignore,no_run
8378 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8379 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_size(42);
8380 /// ```
8381 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8382 self.page_size = v.into();
8383 self
8384 }
8385
8386 /// Sets the value of [page_token][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_token].
8387 ///
8388 /// # Example
8389 /// ```ignore,no_run
8390 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8391 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_token("example");
8392 /// ```
8393 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8394 self.page_token = v.into();
8395 self
8396 }
8397}
8398
8399impl wkt::message::Message for ListPrivateConnectionPeeringRoutesRequest {
8400 fn typename() -> &'static str {
8401 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"
8402 }
8403}
8404
8405/// Response message for
8406/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8407///
8408/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8409#[derive(Clone, Default, PartialEq)]
8410#[non_exhaustive]
8411pub struct ListPrivateConnectionPeeringRoutesResponse {
8412 /// A list of peering routes.
8413 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
8414
8415 /// A token, which can be sent as `page_token` to retrieve the next page.
8416 /// If this field is omitted, there are no subsequent pages.
8417 pub next_page_token: std::string::String,
8418
8419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8420}
8421
8422impl ListPrivateConnectionPeeringRoutesResponse {
8423 pub fn new() -> Self {
8424 std::default::Default::default()
8425 }
8426
8427 /// Sets the value of [peering_routes][crate::model::ListPrivateConnectionPeeringRoutesResponse::peering_routes].
8428 ///
8429 /// # Example
8430 /// ```ignore,no_run
8431 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8432 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
8433 /// let x = ListPrivateConnectionPeeringRoutesResponse::new()
8434 /// .set_peering_routes([
8435 /// PeeringRoute::default()/* use setters */,
8436 /// PeeringRoute::default()/* use (different) setters */,
8437 /// ]);
8438 /// ```
8439 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
8440 where
8441 T: std::iter::IntoIterator<Item = V>,
8442 V: std::convert::Into<crate::model::PeeringRoute>,
8443 {
8444 use std::iter::Iterator;
8445 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
8446 self
8447 }
8448
8449 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionPeeringRoutesResponse::next_page_token].
8450 ///
8451 /// # Example
8452 /// ```ignore,no_run
8453 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8454 /// let x = ListPrivateConnectionPeeringRoutesResponse::new().set_next_page_token("example");
8455 /// ```
8456 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8457 self.next_page_token = v.into();
8458 self
8459 }
8460}
8461
8462impl wkt::message::Message for ListPrivateConnectionPeeringRoutesResponse {
8463 fn typename() -> &'static str {
8464 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"
8465 }
8466}
8467
8468#[doc(hidden)]
8469impl google_cloud_gax::paginator::internal::PageableResponse
8470 for ListPrivateConnectionPeeringRoutesResponse
8471{
8472 type PageItem = crate::model::PeeringRoute;
8473
8474 fn items(self) -> std::vec::Vec<Self::PageItem> {
8475 self.peering_routes
8476 }
8477
8478 fn next_page_token(&self) -> std::string::String {
8479 use std::clone::Clone;
8480 self.next_page_token.clone()
8481 }
8482}
8483
8484/// Request message for
8485/// [VmwareEngine.GrantDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]
8486///
8487/// [google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]: crate::client::VmwareEngine::grant_dns_bind_permission
8488#[derive(Clone, Default, PartialEq)]
8489#[non_exhaustive]
8490pub struct GrantDnsBindPermissionRequest {
8491 /// Required. The name of the resource which stores the users/service accounts
8492 /// having the permission to bind to the corresponding intranet VPC of the
8493 /// consumer project. DnsBindPermission is a global resource. Resource names
8494 /// are schemeless URIs that follow the conventions in
8495 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8496 /// `projects/my-project/locations/global/dnsBindPermission`
8497 pub name: std::string::String,
8498
8499 /// Required. The consumer provided user/service account which needs to be
8500 /// granted permission to bind with the intranet VPC corresponding to the
8501 /// consumer project.
8502 pub principal: std::option::Option<crate::model::Principal>,
8503
8504 /// Optional. A request ID to identify requests. Specify a unique request ID
8505 /// so that if you must retry your request, the server will know to ignore
8506 /// the request if it has already been completed. The server guarantees that a
8507 /// request doesn't result in creation of duplicate commitments for at least 60
8508 /// minutes.
8509 ///
8510 /// For example, consider a situation where you make an initial request and the
8511 /// request times out. If you make the request again with the same request
8512 /// ID, the server can check if original operation with the same request ID
8513 /// was received, and if so, will ignore the second request. This prevents
8514 /// clients from accidentally creating duplicate commitments.
8515 ///
8516 /// The request ID must be a valid UUID with the exception that zero UUID is
8517 /// not supported (00000000-0000-0000-0000-000000000000).
8518 pub request_id: std::string::String,
8519
8520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8521}
8522
8523impl GrantDnsBindPermissionRequest {
8524 pub fn new() -> Self {
8525 std::default::Default::default()
8526 }
8527
8528 /// Sets the value of [name][crate::model::GrantDnsBindPermissionRequest::name].
8529 ///
8530 /// # Example
8531 /// ```ignore,no_run
8532 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8533 /// let x = GrantDnsBindPermissionRequest::new().set_name("example");
8534 /// ```
8535 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8536 self.name = v.into();
8537 self
8538 }
8539
8540 /// Sets the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8541 ///
8542 /// # Example
8543 /// ```ignore,no_run
8544 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8545 /// use google_cloud_vmwareengine_v1::model::Principal;
8546 /// let x = GrantDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8547 /// ```
8548 pub fn set_principal<T>(mut self, v: T) -> Self
8549 where
8550 T: std::convert::Into<crate::model::Principal>,
8551 {
8552 self.principal = std::option::Option::Some(v.into());
8553 self
8554 }
8555
8556 /// Sets or clears the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8557 ///
8558 /// # Example
8559 /// ```ignore,no_run
8560 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8561 /// use google_cloud_vmwareengine_v1::model::Principal;
8562 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8563 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8564 /// ```
8565 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8566 where
8567 T: std::convert::Into<crate::model::Principal>,
8568 {
8569 self.principal = v.map(|x| x.into());
8570 self
8571 }
8572
8573 /// Sets the value of [request_id][crate::model::GrantDnsBindPermissionRequest::request_id].
8574 ///
8575 /// # Example
8576 /// ```ignore,no_run
8577 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8578 /// let x = GrantDnsBindPermissionRequest::new().set_request_id("example");
8579 /// ```
8580 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8581 self.request_id = v.into();
8582 self
8583 }
8584}
8585
8586impl wkt::message::Message for GrantDnsBindPermissionRequest {
8587 fn typename() -> &'static str {
8588 "type.googleapis.com/google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest"
8589 }
8590}
8591
8592/// Request message for
8593/// [VmwareEngine.RevokeDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]
8594///
8595/// [google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]: crate::client::VmwareEngine::revoke_dns_bind_permission
8596#[derive(Clone, Default, PartialEq)]
8597#[non_exhaustive]
8598pub struct RevokeDnsBindPermissionRequest {
8599 /// Required. The name of the resource which stores the users/service accounts
8600 /// having the permission to bind to the corresponding intranet VPC of the
8601 /// consumer project. DnsBindPermission is a global resource. Resource names
8602 /// are schemeless URIs that follow the conventions in
8603 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8604 /// `projects/my-project/locations/global/dnsBindPermission`
8605 pub name: std::string::String,
8606
8607 /// Required. The consumer provided user/service account which needs to be
8608 /// granted permission to bind with the intranet VPC corresponding to the
8609 /// consumer project.
8610 pub principal: std::option::Option<crate::model::Principal>,
8611
8612 /// Optional. A request ID to identify requests. Specify a unique request ID
8613 /// so that if you must retry your request, the server will know to ignore
8614 /// the request if it has already been completed. The server guarantees that a
8615 /// request doesn't result in creation of duplicate commitments for at least 60
8616 /// minutes.
8617 ///
8618 /// For example, consider a situation where you make an initial request and the
8619 /// request times out. If you make the request again with the same request
8620 /// ID, the server can check if original operation with the same request ID
8621 /// was received, and if so, will ignore the second request. This prevents
8622 /// clients from accidentally creating duplicate commitments.
8623 ///
8624 /// The request ID must be a valid UUID with the exception that zero UUID is
8625 /// not supported (00000000-0000-0000-0000-000000000000).
8626 pub request_id: std::string::String,
8627
8628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8629}
8630
8631impl RevokeDnsBindPermissionRequest {
8632 pub fn new() -> Self {
8633 std::default::Default::default()
8634 }
8635
8636 /// Sets the value of [name][crate::model::RevokeDnsBindPermissionRequest::name].
8637 ///
8638 /// # Example
8639 /// ```ignore,no_run
8640 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8641 /// let x = RevokeDnsBindPermissionRequest::new().set_name("example");
8642 /// ```
8643 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8644 self.name = v.into();
8645 self
8646 }
8647
8648 /// Sets the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8649 ///
8650 /// # Example
8651 /// ```ignore,no_run
8652 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8653 /// use google_cloud_vmwareengine_v1::model::Principal;
8654 /// let x = RevokeDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8655 /// ```
8656 pub fn set_principal<T>(mut self, v: T) -> Self
8657 where
8658 T: std::convert::Into<crate::model::Principal>,
8659 {
8660 self.principal = std::option::Option::Some(v.into());
8661 self
8662 }
8663
8664 /// Sets or clears the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8665 ///
8666 /// # Example
8667 /// ```ignore,no_run
8668 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8669 /// use google_cloud_vmwareengine_v1::model::Principal;
8670 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8671 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8672 /// ```
8673 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8674 where
8675 T: std::convert::Into<crate::model::Principal>,
8676 {
8677 self.principal = v.map(|x| x.into());
8678 self
8679 }
8680
8681 /// Sets the value of [request_id][crate::model::RevokeDnsBindPermissionRequest::request_id].
8682 ///
8683 /// # Example
8684 /// ```ignore,no_run
8685 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8686 /// let x = RevokeDnsBindPermissionRequest::new().set_request_id("example");
8687 /// ```
8688 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8689 self.request_id = v.into();
8690 self
8691 }
8692}
8693
8694impl wkt::message::Message for RevokeDnsBindPermissionRequest {
8695 fn typename() -> &'static str {
8696 "type.googleapis.com/google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest"
8697 }
8698}
8699
8700/// Request message for
8701/// [VmwareEngine.GetDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]
8702///
8703/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]: crate::client::VmwareEngine::get_dns_bind_permission
8704#[derive(Clone, Default, PartialEq)]
8705#[non_exhaustive]
8706pub struct GetDnsBindPermissionRequest {
8707 /// Required. The name of the resource which stores the users/service accounts
8708 /// having the permission to bind to the corresponding intranet VPC of the
8709 /// consumer project. DnsBindPermission is a global resource. Resource names
8710 /// are schemeless URIs that follow the conventions in
8711 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8712 /// `projects/my-project/locations/global/dnsBindPermission`
8713 pub name: std::string::String,
8714
8715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8716}
8717
8718impl GetDnsBindPermissionRequest {
8719 pub fn new() -> Self {
8720 std::default::Default::default()
8721 }
8722
8723 /// Sets the value of [name][crate::model::GetDnsBindPermissionRequest::name].
8724 ///
8725 /// # Example
8726 /// ```ignore,no_run
8727 /// # use google_cloud_vmwareengine_v1::model::GetDnsBindPermissionRequest;
8728 /// let x = GetDnsBindPermissionRequest::new().set_name("example");
8729 /// ```
8730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8731 self.name = v.into();
8732 self
8733 }
8734}
8735
8736impl wkt::message::Message for GetDnsBindPermissionRequest {
8737 fn typename() -> &'static str {
8738 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest"
8739 }
8740}
8741
8742/// Network configuration in the consumer project
8743/// with which the peering has to be done.
8744#[derive(Clone, Default, PartialEq)]
8745#[non_exhaustive]
8746pub struct NetworkConfig {
8747 /// Required. Management CIDR used by VMware management appliances.
8748 pub management_cidr: std::string::String,
8749
8750 /// Optional. The relative resource name of the VMware Engine network attached
8751 /// to the private cloud. Specify the name in the following form:
8752 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8753 /// where `{project}` can either be a project number or a project ID.
8754 pub vmware_engine_network: std::string::String,
8755
8756 /// Output only. The canonical name of the VMware Engine network in the form:
8757 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8758 pub vmware_engine_network_canonical: std::string::String,
8759
8760 /// Output only. The IP address layout version of the management IP address
8761 /// range. Possible versions include:
8762 ///
8763 /// * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address
8764 /// layout used by some existing private clouds. This is no longer supported
8765 /// for new private clouds as it does not support all features.
8766 /// * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address
8767 /// layout used by all newly created private clouds. This version supports all
8768 /// current features.
8769 pub management_ip_address_layout_version: i32,
8770
8771 /// Output only. DNS Server IP of the Private Cloud.
8772 /// All DNS queries can be forwarded to this address for name resolution of
8773 /// Private Cloud's management entities like vCenter, NSX-T Manager and
8774 /// ESXi hosts.
8775 pub dns_server_ip: std::string::String,
8776
8777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8778}
8779
8780impl NetworkConfig {
8781 pub fn new() -> Self {
8782 std::default::Default::default()
8783 }
8784
8785 /// Sets the value of [management_cidr][crate::model::NetworkConfig::management_cidr].
8786 ///
8787 /// # Example
8788 /// ```ignore,no_run
8789 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8790 /// let x = NetworkConfig::new().set_management_cidr("example");
8791 /// ```
8792 pub fn set_management_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8793 self.management_cidr = v.into();
8794 self
8795 }
8796
8797 /// Sets the value of [vmware_engine_network][crate::model::NetworkConfig::vmware_engine_network].
8798 ///
8799 /// # Example
8800 /// ```ignore,no_run
8801 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8802 /// let x = NetworkConfig::new().set_vmware_engine_network("example");
8803 /// ```
8804 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
8805 mut self,
8806 v: T,
8807 ) -> Self {
8808 self.vmware_engine_network = v.into();
8809 self
8810 }
8811
8812 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkConfig::vmware_engine_network_canonical].
8813 ///
8814 /// # Example
8815 /// ```ignore,no_run
8816 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8817 /// let x = NetworkConfig::new().set_vmware_engine_network_canonical("example");
8818 /// ```
8819 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
8820 mut self,
8821 v: T,
8822 ) -> Self {
8823 self.vmware_engine_network_canonical = v.into();
8824 self
8825 }
8826
8827 /// Sets the value of [management_ip_address_layout_version][crate::model::NetworkConfig::management_ip_address_layout_version].
8828 ///
8829 /// # Example
8830 /// ```ignore,no_run
8831 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8832 /// let x = NetworkConfig::new().set_management_ip_address_layout_version(42);
8833 /// ```
8834 pub fn set_management_ip_address_layout_version<T: std::convert::Into<i32>>(
8835 mut self,
8836 v: T,
8837 ) -> Self {
8838 self.management_ip_address_layout_version = v.into();
8839 self
8840 }
8841
8842 /// Sets the value of [dns_server_ip][crate::model::NetworkConfig::dns_server_ip].
8843 ///
8844 /// # Example
8845 /// ```ignore,no_run
8846 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8847 /// let x = NetworkConfig::new().set_dns_server_ip("example");
8848 /// ```
8849 pub fn set_dns_server_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8850 self.dns_server_ip = v.into();
8851 self
8852 }
8853}
8854
8855impl wkt::message::Message for NetworkConfig {
8856 fn typename() -> &'static str {
8857 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkConfig"
8858 }
8859}
8860
8861/// Information about the type and number of nodes associated with the cluster.
8862#[derive(Clone, Default, PartialEq)]
8863#[non_exhaustive]
8864pub struct NodeTypeConfig {
8865 /// Required. The number of nodes of this type in the cluster
8866 pub node_count: i32,
8867
8868 /// Optional. Customized number of cores available to each node of the type.
8869 /// This number must always be one of `nodeType.availableCustomCoreCounts`.
8870 /// If zero is provided max value from `nodeType.availableCustomCoreCounts`
8871 /// will be used.
8872 pub custom_core_count: i32,
8873
8874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8875}
8876
8877impl NodeTypeConfig {
8878 pub fn new() -> Self {
8879 std::default::Default::default()
8880 }
8881
8882 /// Sets the value of [node_count][crate::model::NodeTypeConfig::node_count].
8883 ///
8884 /// # Example
8885 /// ```ignore,no_run
8886 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8887 /// let x = NodeTypeConfig::new().set_node_count(42);
8888 /// ```
8889 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8890 self.node_count = v.into();
8891 self
8892 }
8893
8894 /// Sets the value of [custom_core_count][crate::model::NodeTypeConfig::custom_core_count].
8895 ///
8896 /// # Example
8897 /// ```ignore,no_run
8898 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8899 /// let x = NodeTypeConfig::new().set_custom_core_count(42);
8900 /// ```
8901 pub fn set_custom_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8902 self.custom_core_count = v.into();
8903 self
8904 }
8905}
8906
8907impl wkt::message::Message for NodeTypeConfig {
8908 fn typename() -> &'static str {
8909 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeTypeConfig"
8910 }
8911}
8912
8913/// Configuration of a stretched cluster.
8914#[derive(Clone, Default, PartialEq)]
8915#[non_exhaustive]
8916pub struct StretchedClusterConfig {
8917 /// Required. Zone that will remain operational when connection between the two
8918 /// zones is lost. Specify the resource name of a zone that belongs to the
8919 /// region of the private cloud. For example:
8920 /// `projects/{project}/locations/europe-west3-a` where `{project}` can either
8921 /// be a project number or a project ID.
8922 pub preferred_location: std::string::String,
8923
8924 /// Required. Additional zone for a higher level of availability and load
8925 /// balancing. Specify the resource name of a zone that belongs to the region
8926 /// of the private cloud. For example:
8927 /// `projects/{project}/locations/europe-west3-b` where `{project}` can either
8928 /// be a project number or a project ID.
8929 pub secondary_location: std::string::String,
8930
8931 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8932}
8933
8934impl StretchedClusterConfig {
8935 pub fn new() -> Self {
8936 std::default::Default::default()
8937 }
8938
8939 /// Sets the value of [preferred_location][crate::model::StretchedClusterConfig::preferred_location].
8940 ///
8941 /// # Example
8942 /// ```ignore,no_run
8943 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8944 /// let x = StretchedClusterConfig::new().set_preferred_location("example");
8945 /// ```
8946 pub fn set_preferred_location<T: std::convert::Into<std::string::String>>(
8947 mut self,
8948 v: T,
8949 ) -> Self {
8950 self.preferred_location = v.into();
8951 self
8952 }
8953
8954 /// Sets the value of [secondary_location][crate::model::StretchedClusterConfig::secondary_location].
8955 ///
8956 /// # Example
8957 /// ```ignore,no_run
8958 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8959 /// let x = StretchedClusterConfig::new().set_secondary_location("example");
8960 /// ```
8961 pub fn set_secondary_location<T: std::convert::Into<std::string::String>>(
8962 mut self,
8963 v: T,
8964 ) -> Self {
8965 self.secondary_location = v.into();
8966 self
8967 }
8968}
8969
8970impl wkt::message::Message for StretchedClusterConfig {
8971 fn typename() -> &'static str {
8972 "type.googleapis.com/google.cloud.vmwareengine.v1.StretchedClusterConfig"
8973 }
8974}
8975
8976/// Represents a private cloud resource. Private clouds of type `STANDARD` and
8977/// `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are
8978/// regional.
8979#[derive(Clone, Default, PartialEq)]
8980#[non_exhaustive]
8981pub struct PrivateCloud {
8982 /// Output only. The resource name of this private cloud.
8983 /// Resource names are schemeless URIs that follow the conventions in
8984 /// <https://cloud.google.com/apis/design/resource_names>.
8985 /// For example:
8986 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
8987 pub name: std::string::String,
8988
8989 /// Output only. Creation time of this resource.
8990 pub create_time: std::option::Option<wkt::Timestamp>,
8991
8992 /// Output only. Last update time of this resource.
8993 pub update_time: std::option::Option<wkt::Timestamp>,
8994
8995 /// Output only. Time when the resource was scheduled for deletion.
8996 pub delete_time: std::option::Option<wkt::Timestamp>,
8997
8998 /// Output only. Time when the resource will be irreversibly deleted.
8999 pub expire_time: std::option::Option<wkt::Timestamp>,
9000
9001 /// Output only. State of the resource. New values may be added to this enum
9002 /// when appropriate.
9003 pub state: crate::model::private_cloud::State,
9004
9005 /// Required. Network configuration of the private cloud.
9006 pub network_config: std::option::Option<crate::model::NetworkConfig>,
9007
9008 /// Required. Input only. The management cluster for this private cloud.
9009 /// This field is required during creation of the private cloud to provide
9010 /// details for the default cluster.
9011 ///
9012 /// The following fields can't be changed after private cloud creation:
9013 /// `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.
9014 pub management_cluster: std::option::Option<crate::model::private_cloud::ManagementCluster>,
9015
9016 /// User-provided description for this private cloud.
9017 pub description: std::string::String,
9018
9019 /// Output only. HCX appliance.
9020 pub hcx: std::option::Option<crate::model::Hcx>,
9021
9022 /// Output only. NSX appliance.
9023 pub nsx: std::option::Option<crate::model::Nsx>,
9024
9025 /// Output only. Vcenter appliance.
9026 pub vcenter: std::option::Option<crate::model::Vcenter>,
9027
9028 /// Output only. System-generated unique identifier for the resource.
9029 pub uid: std::string::String,
9030
9031 /// Optional. Type of the private cloud. Defaults to STANDARD.
9032 pub r#type: crate::model::private_cloud::Type,
9033
9034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9035}
9036
9037impl PrivateCloud {
9038 pub fn new() -> Self {
9039 std::default::Default::default()
9040 }
9041
9042 /// Sets the value of [name][crate::model::PrivateCloud::name].
9043 ///
9044 /// # Example
9045 /// ```ignore,no_run
9046 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9047 /// let x = PrivateCloud::new().set_name("example");
9048 /// ```
9049 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9050 self.name = v.into();
9051 self
9052 }
9053
9054 /// Sets the value of [create_time][crate::model::PrivateCloud::create_time].
9055 ///
9056 /// # Example
9057 /// ```ignore,no_run
9058 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9059 /// use wkt::Timestamp;
9060 /// let x = PrivateCloud::new().set_create_time(Timestamp::default()/* use setters */);
9061 /// ```
9062 pub fn set_create_time<T>(mut self, v: T) -> Self
9063 where
9064 T: std::convert::Into<wkt::Timestamp>,
9065 {
9066 self.create_time = std::option::Option::Some(v.into());
9067 self
9068 }
9069
9070 /// Sets or clears the value of [create_time][crate::model::PrivateCloud::create_time].
9071 ///
9072 /// # Example
9073 /// ```ignore,no_run
9074 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9075 /// use wkt::Timestamp;
9076 /// let x = PrivateCloud::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9077 /// let x = PrivateCloud::new().set_or_clear_create_time(None::<Timestamp>);
9078 /// ```
9079 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9080 where
9081 T: std::convert::Into<wkt::Timestamp>,
9082 {
9083 self.create_time = v.map(|x| x.into());
9084 self
9085 }
9086
9087 /// Sets the value of [update_time][crate::model::PrivateCloud::update_time].
9088 ///
9089 /// # Example
9090 /// ```ignore,no_run
9091 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9092 /// use wkt::Timestamp;
9093 /// let x = PrivateCloud::new().set_update_time(Timestamp::default()/* use setters */);
9094 /// ```
9095 pub fn set_update_time<T>(mut self, v: T) -> Self
9096 where
9097 T: std::convert::Into<wkt::Timestamp>,
9098 {
9099 self.update_time = std::option::Option::Some(v.into());
9100 self
9101 }
9102
9103 /// Sets or clears the value of [update_time][crate::model::PrivateCloud::update_time].
9104 ///
9105 /// # Example
9106 /// ```ignore,no_run
9107 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9108 /// use wkt::Timestamp;
9109 /// let x = PrivateCloud::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9110 /// let x = PrivateCloud::new().set_or_clear_update_time(None::<Timestamp>);
9111 /// ```
9112 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9113 where
9114 T: std::convert::Into<wkt::Timestamp>,
9115 {
9116 self.update_time = v.map(|x| x.into());
9117 self
9118 }
9119
9120 /// Sets the value of [delete_time][crate::model::PrivateCloud::delete_time].
9121 ///
9122 /// # Example
9123 /// ```ignore,no_run
9124 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9125 /// use wkt::Timestamp;
9126 /// let x = PrivateCloud::new().set_delete_time(Timestamp::default()/* use setters */);
9127 /// ```
9128 pub fn set_delete_time<T>(mut self, v: T) -> Self
9129 where
9130 T: std::convert::Into<wkt::Timestamp>,
9131 {
9132 self.delete_time = std::option::Option::Some(v.into());
9133 self
9134 }
9135
9136 /// Sets or clears the value of [delete_time][crate::model::PrivateCloud::delete_time].
9137 ///
9138 /// # Example
9139 /// ```ignore,no_run
9140 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9141 /// use wkt::Timestamp;
9142 /// let x = PrivateCloud::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
9143 /// let x = PrivateCloud::new().set_or_clear_delete_time(None::<Timestamp>);
9144 /// ```
9145 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9146 where
9147 T: std::convert::Into<wkt::Timestamp>,
9148 {
9149 self.delete_time = v.map(|x| x.into());
9150 self
9151 }
9152
9153 /// Sets the value of [expire_time][crate::model::PrivateCloud::expire_time].
9154 ///
9155 /// # Example
9156 /// ```ignore,no_run
9157 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9158 /// use wkt::Timestamp;
9159 /// let x = PrivateCloud::new().set_expire_time(Timestamp::default()/* use setters */);
9160 /// ```
9161 pub fn set_expire_time<T>(mut self, v: T) -> Self
9162 where
9163 T: std::convert::Into<wkt::Timestamp>,
9164 {
9165 self.expire_time = std::option::Option::Some(v.into());
9166 self
9167 }
9168
9169 /// Sets or clears the value of [expire_time][crate::model::PrivateCloud::expire_time].
9170 ///
9171 /// # Example
9172 /// ```ignore,no_run
9173 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9174 /// use wkt::Timestamp;
9175 /// let x = PrivateCloud::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
9176 /// let x = PrivateCloud::new().set_or_clear_expire_time(None::<Timestamp>);
9177 /// ```
9178 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9179 where
9180 T: std::convert::Into<wkt::Timestamp>,
9181 {
9182 self.expire_time = v.map(|x| x.into());
9183 self
9184 }
9185
9186 /// Sets the value of [state][crate::model::PrivateCloud::state].
9187 ///
9188 /// # Example
9189 /// ```ignore,no_run
9190 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9191 /// use google_cloud_vmwareengine_v1::model::private_cloud::State;
9192 /// let x0 = PrivateCloud::new().set_state(State::Active);
9193 /// let x1 = PrivateCloud::new().set_state(State::Creating);
9194 /// let x2 = PrivateCloud::new().set_state(State::Updating);
9195 /// ```
9196 pub fn set_state<T: std::convert::Into<crate::model::private_cloud::State>>(
9197 mut self,
9198 v: T,
9199 ) -> Self {
9200 self.state = v.into();
9201 self
9202 }
9203
9204 /// Sets the value of [network_config][crate::model::PrivateCloud::network_config].
9205 ///
9206 /// # Example
9207 /// ```ignore,no_run
9208 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9209 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9210 /// let x = PrivateCloud::new().set_network_config(NetworkConfig::default()/* use setters */);
9211 /// ```
9212 pub fn set_network_config<T>(mut self, v: T) -> Self
9213 where
9214 T: std::convert::Into<crate::model::NetworkConfig>,
9215 {
9216 self.network_config = std::option::Option::Some(v.into());
9217 self
9218 }
9219
9220 /// Sets or clears the value of [network_config][crate::model::PrivateCloud::network_config].
9221 ///
9222 /// # Example
9223 /// ```ignore,no_run
9224 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9225 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9226 /// let x = PrivateCloud::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
9227 /// let x = PrivateCloud::new().set_or_clear_network_config(None::<NetworkConfig>);
9228 /// ```
9229 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
9230 where
9231 T: std::convert::Into<crate::model::NetworkConfig>,
9232 {
9233 self.network_config = v.map(|x| x.into());
9234 self
9235 }
9236
9237 /// Sets the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9238 ///
9239 /// # Example
9240 /// ```ignore,no_run
9241 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9242 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9243 /// let x = PrivateCloud::new().set_management_cluster(ManagementCluster::default()/* use setters */);
9244 /// ```
9245 pub fn set_management_cluster<T>(mut self, v: T) -> Self
9246 where
9247 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9248 {
9249 self.management_cluster = std::option::Option::Some(v.into());
9250 self
9251 }
9252
9253 /// Sets or clears the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9254 ///
9255 /// # Example
9256 /// ```ignore,no_run
9257 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9258 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9259 /// let x = PrivateCloud::new().set_or_clear_management_cluster(Some(ManagementCluster::default()/* use setters */));
9260 /// let x = PrivateCloud::new().set_or_clear_management_cluster(None::<ManagementCluster>);
9261 /// ```
9262 pub fn set_or_clear_management_cluster<T>(mut self, v: std::option::Option<T>) -> Self
9263 where
9264 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9265 {
9266 self.management_cluster = v.map(|x| x.into());
9267 self
9268 }
9269
9270 /// Sets the value of [description][crate::model::PrivateCloud::description].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9275 /// let x = PrivateCloud::new().set_description("example");
9276 /// ```
9277 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9278 self.description = v.into();
9279 self
9280 }
9281
9282 /// Sets the value of [hcx][crate::model::PrivateCloud::hcx].
9283 ///
9284 /// # Example
9285 /// ```ignore,no_run
9286 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9287 /// use google_cloud_vmwareengine_v1::model::Hcx;
9288 /// let x = PrivateCloud::new().set_hcx(Hcx::default()/* use setters */);
9289 /// ```
9290 pub fn set_hcx<T>(mut self, v: T) -> Self
9291 where
9292 T: std::convert::Into<crate::model::Hcx>,
9293 {
9294 self.hcx = std::option::Option::Some(v.into());
9295 self
9296 }
9297
9298 /// Sets or clears the value of [hcx][crate::model::PrivateCloud::hcx].
9299 ///
9300 /// # Example
9301 /// ```ignore,no_run
9302 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9303 /// use google_cloud_vmwareengine_v1::model::Hcx;
9304 /// let x = PrivateCloud::new().set_or_clear_hcx(Some(Hcx::default()/* use setters */));
9305 /// let x = PrivateCloud::new().set_or_clear_hcx(None::<Hcx>);
9306 /// ```
9307 pub fn set_or_clear_hcx<T>(mut self, v: std::option::Option<T>) -> Self
9308 where
9309 T: std::convert::Into<crate::model::Hcx>,
9310 {
9311 self.hcx = v.map(|x| x.into());
9312 self
9313 }
9314
9315 /// Sets the value of [nsx][crate::model::PrivateCloud::nsx].
9316 ///
9317 /// # Example
9318 /// ```ignore,no_run
9319 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9320 /// use google_cloud_vmwareengine_v1::model::Nsx;
9321 /// let x = PrivateCloud::new().set_nsx(Nsx::default()/* use setters */);
9322 /// ```
9323 pub fn set_nsx<T>(mut self, v: T) -> Self
9324 where
9325 T: std::convert::Into<crate::model::Nsx>,
9326 {
9327 self.nsx = std::option::Option::Some(v.into());
9328 self
9329 }
9330
9331 /// Sets or clears the value of [nsx][crate::model::PrivateCloud::nsx].
9332 ///
9333 /// # Example
9334 /// ```ignore,no_run
9335 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9336 /// use google_cloud_vmwareengine_v1::model::Nsx;
9337 /// let x = PrivateCloud::new().set_or_clear_nsx(Some(Nsx::default()/* use setters */));
9338 /// let x = PrivateCloud::new().set_or_clear_nsx(None::<Nsx>);
9339 /// ```
9340 pub fn set_or_clear_nsx<T>(mut self, v: std::option::Option<T>) -> Self
9341 where
9342 T: std::convert::Into<crate::model::Nsx>,
9343 {
9344 self.nsx = v.map(|x| x.into());
9345 self
9346 }
9347
9348 /// Sets the value of [vcenter][crate::model::PrivateCloud::vcenter].
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9353 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9354 /// let x = PrivateCloud::new().set_vcenter(Vcenter::default()/* use setters */);
9355 /// ```
9356 pub fn set_vcenter<T>(mut self, v: T) -> Self
9357 where
9358 T: std::convert::Into<crate::model::Vcenter>,
9359 {
9360 self.vcenter = std::option::Option::Some(v.into());
9361 self
9362 }
9363
9364 /// Sets or clears the value of [vcenter][crate::model::PrivateCloud::vcenter].
9365 ///
9366 /// # Example
9367 /// ```ignore,no_run
9368 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9369 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9370 /// let x = PrivateCloud::new().set_or_clear_vcenter(Some(Vcenter::default()/* use setters */));
9371 /// let x = PrivateCloud::new().set_or_clear_vcenter(None::<Vcenter>);
9372 /// ```
9373 pub fn set_or_clear_vcenter<T>(mut self, v: std::option::Option<T>) -> Self
9374 where
9375 T: std::convert::Into<crate::model::Vcenter>,
9376 {
9377 self.vcenter = v.map(|x| x.into());
9378 self
9379 }
9380
9381 /// Sets the value of [uid][crate::model::PrivateCloud::uid].
9382 ///
9383 /// # Example
9384 /// ```ignore,no_run
9385 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9386 /// let x = PrivateCloud::new().set_uid("example");
9387 /// ```
9388 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9389 self.uid = v.into();
9390 self
9391 }
9392
9393 /// Sets the value of [r#type][crate::model::PrivateCloud::type].
9394 ///
9395 /// # Example
9396 /// ```ignore,no_run
9397 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9398 /// use google_cloud_vmwareengine_v1::model::private_cloud::Type;
9399 /// let x0 = PrivateCloud::new().set_type(Type::TimeLimited);
9400 /// let x1 = PrivateCloud::new().set_type(Type::Stretched);
9401 /// ```
9402 pub fn set_type<T: std::convert::Into<crate::model::private_cloud::Type>>(
9403 mut self,
9404 v: T,
9405 ) -> Self {
9406 self.r#type = v.into();
9407 self
9408 }
9409}
9410
9411impl wkt::message::Message for PrivateCloud {
9412 fn typename() -> &'static str {
9413 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud"
9414 }
9415}
9416
9417/// Defines additional types related to [PrivateCloud].
9418pub mod private_cloud {
9419 #[allow(unused_imports)]
9420 use super::*;
9421
9422 /// Management cluster configuration.
9423 #[derive(Clone, Default, PartialEq)]
9424 #[non_exhaustive]
9425 pub struct ManagementCluster {
9426 /// Required. The user-provided identifier of the new `Cluster`.
9427 /// The identifier must meet the following requirements:
9428 ///
9429 /// * Only contains 1-63 alphanumeric characters and hyphens
9430 /// * Begins with an alphabetical character
9431 /// * Ends with a non-hyphen character
9432 /// * Not formatted as a UUID
9433 /// * Complies with [RFC
9434 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
9435 pub cluster_id: std::string::String,
9436
9437 /// Required. The map of cluster node types in this cluster, where the key is
9438 /// canonical identifier of the node type (corresponds to the `NodeType`).
9439 pub node_type_configs:
9440 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9441
9442 /// Optional. Configuration of a stretched cluster. Required for STRETCHED
9443 /// private clouds.
9444 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9445
9446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9447 }
9448
9449 impl ManagementCluster {
9450 pub fn new() -> Self {
9451 std::default::Default::default()
9452 }
9453
9454 /// Sets the value of [cluster_id][crate::model::private_cloud::ManagementCluster::cluster_id].
9455 ///
9456 /// # Example
9457 /// ```ignore,no_run
9458 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9459 /// let x = ManagementCluster::new().set_cluster_id("example");
9460 /// ```
9461 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9462 self.cluster_id = v.into();
9463 self
9464 }
9465
9466 /// Sets the value of [node_type_configs][crate::model::private_cloud::ManagementCluster::node_type_configs].
9467 ///
9468 /// # Example
9469 /// ```ignore,no_run
9470 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9471 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9472 /// let x = ManagementCluster::new().set_node_type_configs([
9473 /// ("key0", NodeTypeConfig::default()/* use setters */),
9474 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
9475 /// ]);
9476 /// ```
9477 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
9478 where
9479 T: std::iter::IntoIterator<Item = (K, V)>,
9480 K: std::convert::Into<std::string::String>,
9481 V: std::convert::Into<crate::model::NodeTypeConfig>,
9482 {
9483 use std::iter::Iterator;
9484 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9485 self
9486 }
9487
9488 /// Sets the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9489 ///
9490 /// # Example
9491 /// ```ignore,no_run
9492 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9493 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9494 /// let x = ManagementCluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
9495 /// ```
9496 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
9497 where
9498 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9499 {
9500 self.stretched_cluster_config = std::option::Option::Some(v.into());
9501 self
9502 }
9503
9504 /// Sets or clears the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9505 ///
9506 /// # Example
9507 /// ```ignore,no_run
9508 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9509 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9510 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
9511 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
9512 /// ```
9513 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
9514 where
9515 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9516 {
9517 self.stretched_cluster_config = v.map(|x| x.into());
9518 self
9519 }
9520 }
9521
9522 impl wkt::message::Message for ManagementCluster {
9523 fn typename() -> &'static str {
9524 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"
9525 }
9526 }
9527
9528 /// Enum State defines possible states of private clouds.
9529 ///
9530 /// # Working with unknown values
9531 ///
9532 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9533 /// additional enum variants at any time. Adding new variants is not considered
9534 /// a breaking change. Applications should write their code in anticipation of:
9535 ///
9536 /// - New values appearing in future releases of the client library, **and**
9537 /// - New values received dynamically, without application changes.
9538 ///
9539 /// Please consult the [Working with enums] section in the user guide for some
9540 /// guidelines.
9541 ///
9542 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9543 #[derive(Clone, Debug, PartialEq)]
9544 #[non_exhaustive]
9545 pub enum State {
9546 /// The default value. This value should never be used.
9547 Unspecified,
9548 /// The private cloud is ready.
9549 Active,
9550 /// The private cloud is being created.
9551 Creating,
9552 /// The private cloud is being updated.
9553 Updating,
9554 /// The private cloud is in failed state.
9555 Failed,
9556 /// The private cloud is scheduled for deletion. The deletion process can be
9557 /// cancelled by using the corresponding undelete method.
9558 Deleted,
9559 /// The private cloud is irreversibly deleted and is being removed from the
9560 /// system.
9561 Purging,
9562 /// If set, the enum was initialized with an unknown value.
9563 ///
9564 /// Applications can examine the value using [State::value] or
9565 /// [State::name].
9566 UnknownValue(state::UnknownValue),
9567 }
9568
9569 #[doc(hidden)]
9570 pub mod state {
9571 #[allow(unused_imports)]
9572 use super::*;
9573 #[derive(Clone, Debug, PartialEq)]
9574 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9575 }
9576
9577 impl State {
9578 /// Gets the enum value.
9579 ///
9580 /// Returns `None` if the enum contains an unknown value deserialized from
9581 /// the string representation of enums.
9582 pub fn value(&self) -> std::option::Option<i32> {
9583 match self {
9584 Self::Unspecified => std::option::Option::Some(0),
9585 Self::Active => std::option::Option::Some(1),
9586 Self::Creating => std::option::Option::Some(2),
9587 Self::Updating => std::option::Option::Some(3),
9588 Self::Failed => std::option::Option::Some(5),
9589 Self::Deleted => std::option::Option::Some(6),
9590 Self::Purging => std::option::Option::Some(7),
9591 Self::UnknownValue(u) => u.0.value(),
9592 }
9593 }
9594
9595 /// Gets the enum value as a string.
9596 ///
9597 /// Returns `None` if the enum contains an unknown value deserialized from
9598 /// the integer representation of enums.
9599 pub fn name(&self) -> std::option::Option<&str> {
9600 match self {
9601 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9602 Self::Active => std::option::Option::Some("ACTIVE"),
9603 Self::Creating => std::option::Option::Some("CREATING"),
9604 Self::Updating => std::option::Option::Some("UPDATING"),
9605 Self::Failed => std::option::Option::Some("FAILED"),
9606 Self::Deleted => std::option::Option::Some("DELETED"),
9607 Self::Purging => std::option::Option::Some("PURGING"),
9608 Self::UnknownValue(u) => u.0.name(),
9609 }
9610 }
9611 }
9612
9613 impl std::default::Default for State {
9614 fn default() -> Self {
9615 use std::convert::From;
9616 Self::from(0)
9617 }
9618 }
9619
9620 impl std::fmt::Display for State {
9621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9622 wkt::internal::display_enum(f, self.name(), self.value())
9623 }
9624 }
9625
9626 impl std::convert::From<i32> for State {
9627 fn from(value: i32) -> Self {
9628 match value {
9629 0 => Self::Unspecified,
9630 1 => Self::Active,
9631 2 => Self::Creating,
9632 3 => Self::Updating,
9633 5 => Self::Failed,
9634 6 => Self::Deleted,
9635 7 => Self::Purging,
9636 _ => Self::UnknownValue(state::UnknownValue(
9637 wkt::internal::UnknownEnumValue::Integer(value),
9638 )),
9639 }
9640 }
9641 }
9642
9643 impl std::convert::From<&str> for State {
9644 fn from(value: &str) -> Self {
9645 use std::string::ToString;
9646 match value {
9647 "STATE_UNSPECIFIED" => Self::Unspecified,
9648 "ACTIVE" => Self::Active,
9649 "CREATING" => Self::Creating,
9650 "UPDATING" => Self::Updating,
9651 "FAILED" => Self::Failed,
9652 "DELETED" => Self::Deleted,
9653 "PURGING" => Self::Purging,
9654 _ => Self::UnknownValue(state::UnknownValue(
9655 wkt::internal::UnknownEnumValue::String(value.to_string()),
9656 )),
9657 }
9658 }
9659 }
9660
9661 impl serde::ser::Serialize for State {
9662 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9663 where
9664 S: serde::Serializer,
9665 {
9666 match self {
9667 Self::Unspecified => serializer.serialize_i32(0),
9668 Self::Active => serializer.serialize_i32(1),
9669 Self::Creating => serializer.serialize_i32(2),
9670 Self::Updating => serializer.serialize_i32(3),
9671 Self::Failed => serializer.serialize_i32(5),
9672 Self::Deleted => serializer.serialize_i32(6),
9673 Self::Purging => serializer.serialize_i32(7),
9674 Self::UnknownValue(u) => u.0.serialize(serializer),
9675 }
9676 }
9677 }
9678
9679 impl<'de> serde::de::Deserialize<'de> for State {
9680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9681 where
9682 D: serde::Deserializer<'de>,
9683 {
9684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9685 ".google.cloud.vmwareengine.v1.PrivateCloud.State",
9686 ))
9687 }
9688 }
9689
9690 /// Enum Type defines private cloud type.
9691 ///
9692 /// # Working with unknown values
9693 ///
9694 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9695 /// additional enum variants at any time. Adding new variants is not considered
9696 /// a breaking change. Applications should write their code in anticipation of:
9697 ///
9698 /// - New values appearing in future releases of the client library, **and**
9699 /// - New values received dynamically, without application changes.
9700 ///
9701 /// Please consult the [Working with enums] section in the user guide for some
9702 /// guidelines.
9703 ///
9704 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9705 #[derive(Clone, Debug, PartialEq)]
9706 #[non_exhaustive]
9707 pub enum Type {
9708 /// Standard private is a zonal resource, with 3+ nodes. Default type.
9709 Standard,
9710 /// Time limited private cloud is a zonal resource, can have only 1 node and
9711 /// has limited life span. Will be deleted after defined period of time,
9712 /// can be converted into standard private cloud by expanding it up to 3
9713 /// or more nodes.
9714 TimeLimited,
9715 /// Stretched private cloud is a regional resource with redundancy,
9716 /// with a minimum of 6 nodes, nodes count has to be even.
9717 Stretched,
9718 /// If set, the enum was initialized with an unknown value.
9719 ///
9720 /// Applications can examine the value using [Type::value] or
9721 /// [Type::name].
9722 UnknownValue(r#type::UnknownValue),
9723 }
9724
9725 #[doc(hidden)]
9726 pub mod r#type {
9727 #[allow(unused_imports)]
9728 use super::*;
9729 #[derive(Clone, Debug, PartialEq)]
9730 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9731 }
9732
9733 impl Type {
9734 /// Gets the enum value.
9735 ///
9736 /// Returns `None` if the enum contains an unknown value deserialized from
9737 /// the string representation of enums.
9738 pub fn value(&self) -> std::option::Option<i32> {
9739 match self {
9740 Self::Standard => std::option::Option::Some(0),
9741 Self::TimeLimited => std::option::Option::Some(1),
9742 Self::Stretched => std::option::Option::Some(2),
9743 Self::UnknownValue(u) => u.0.value(),
9744 }
9745 }
9746
9747 /// Gets the enum value as a string.
9748 ///
9749 /// Returns `None` if the enum contains an unknown value deserialized from
9750 /// the integer representation of enums.
9751 pub fn name(&self) -> std::option::Option<&str> {
9752 match self {
9753 Self::Standard => std::option::Option::Some("STANDARD"),
9754 Self::TimeLimited => std::option::Option::Some("TIME_LIMITED"),
9755 Self::Stretched => std::option::Option::Some("STRETCHED"),
9756 Self::UnknownValue(u) => u.0.name(),
9757 }
9758 }
9759 }
9760
9761 impl std::default::Default for Type {
9762 fn default() -> Self {
9763 use std::convert::From;
9764 Self::from(0)
9765 }
9766 }
9767
9768 impl std::fmt::Display for Type {
9769 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9770 wkt::internal::display_enum(f, self.name(), self.value())
9771 }
9772 }
9773
9774 impl std::convert::From<i32> for Type {
9775 fn from(value: i32) -> Self {
9776 match value {
9777 0 => Self::Standard,
9778 1 => Self::TimeLimited,
9779 2 => Self::Stretched,
9780 _ => Self::UnknownValue(r#type::UnknownValue(
9781 wkt::internal::UnknownEnumValue::Integer(value),
9782 )),
9783 }
9784 }
9785 }
9786
9787 impl std::convert::From<&str> for Type {
9788 fn from(value: &str) -> Self {
9789 use std::string::ToString;
9790 match value {
9791 "STANDARD" => Self::Standard,
9792 "TIME_LIMITED" => Self::TimeLimited,
9793 "STRETCHED" => Self::Stretched,
9794 _ => Self::UnknownValue(r#type::UnknownValue(
9795 wkt::internal::UnknownEnumValue::String(value.to_string()),
9796 )),
9797 }
9798 }
9799 }
9800
9801 impl serde::ser::Serialize for Type {
9802 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9803 where
9804 S: serde::Serializer,
9805 {
9806 match self {
9807 Self::Standard => serializer.serialize_i32(0),
9808 Self::TimeLimited => serializer.serialize_i32(1),
9809 Self::Stretched => serializer.serialize_i32(2),
9810 Self::UnknownValue(u) => u.0.serialize(serializer),
9811 }
9812 }
9813 }
9814
9815 impl<'de> serde::de::Deserialize<'de> for Type {
9816 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9817 where
9818 D: serde::Deserializer<'de>,
9819 {
9820 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
9821 ".google.cloud.vmwareengine.v1.PrivateCloud.Type",
9822 ))
9823 }
9824 }
9825}
9826
9827/// A cluster in a private cloud.
9828#[derive(Clone, Default, PartialEq)]
9829#[non_exhaustive]
9830pub struct Cluster {
9831 /// Output only. The resource name of this cluster.
9832 /// Resource names are schemeless URIs that follow the conventions in
9833 /// <https://cloud.google.com/apis/design/resource_names>.
9834 /// For example:
9835 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
9836 pub name: std::string::String,
9837
9838 /// Output only. Creation time of this resource.
9839 pub create_time: std::option::Option<wkt::Timestamp>,
9840
9841 /// Output only. Last update time of this resource.
9842 pub update_time: std::option::Option<wkt::Timestamp>,
9843
9844 /// Output only. State of the resource.
9845 pub state: crate::model::cluster::State,
9846
9847 /// Output only. True if the cluster is a management cluster; false otherwise.
9848 /// There can only be one management cluster in a private cloud
9849 /// and it has to be the first one.
9850 pub management: bool,
9851
9852 /// Optional. Configuration of the autoscaling applied to this cluster.
9853 pub autoscaling_settings: std::option::Option<crate::model::AutoscalingSettings>,
9854
9855 /// Output only. System-generated unique identifier for the resource.
9856 pub uid: std::string::String,
9857
9858 /// Required. The map of cluster node types in this cluster, where the key is
9859 /// canonical identifier of the node type (corresponds to the `NodeType`).
9860 pub node_type_configs:
9861 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9862
9863 /// Optional. Configuration of a stretched cluster. Required for clusters that
9864 /// belong to a STRETCHED private cloud.
9865 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9866
9867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9868}
9869
9870impl Cluster {
9871 pub fn new() -> Self {
9872 std::default::Default::default()
9873 }
9874
9875 /// Sets the value of [name][crate::model::Cluster::name].
9876 ///
9877 /// # Example
9878 /// ```ignore,no_run
9879 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9880 /// let x = Cluster::new().set_name("example");
9881 /// ```
9882 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9883 self.name = v.into();
9884 self
9885 }
9886
9887 /// Sets the value of [create_time][crate::model::Cluster::create_time].
9888 ///
9889 /// # Example
9890 /// ```ignore,no_run
9891 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9892 /// use wkt::Timestamp;
9893 /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
9894 /// ```
9895 pub fn set_create_time<T>(mut self, v: T) -> Self
9896 where
9897 T: std::convert::Into<wkt::Timestamp>,
9898 {
9899 self.create_time = std::option::Option::Some(v.into());
9900 self
9901 }
9902
9903 /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9908 /// use wkt::Timestamp;
9909 /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9910 /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
9911 /// ```
9912 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9913 where
9914 T: std::convert::Into<wkt::Timestamp>,
9915 {
9916 self.create_time = v.map(|x| x.into());
9917 self
9918 }
9919
9920 /// Sets the value of [update_time][crate::model::Cluster::update_time].
9921 ///
9922 /// # Example
9923 /// ```ignore,no_run
9924 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9925 /// use wkt::Timestamp;
9926 /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
9927 /// ```
9928 pub fn set_update_time<T>(mut self, v: T) -> Self
9929 where
9930 T: std::convert::Into<wkt::Timestamp>,
9931 {
9932 self.update_time = std::option::Option::Some(v.into());
9933 self
9934 }
9935
9936 /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
9937 ///
9938 /// # Example
9939 /// ```ignore,no_run
9940 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9941 /// use wkt::Timestamp;
9942 /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9943 /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
9944 /// ```
9945 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9946 where
9947 T: std::convert::Into<wkt::Timestamp>,
9948 {
9949 self.update_time = v.map(|x| x.into());
9950 self
9951 }
9952
9953 /// Sets the value of [state][crate::model::Cluster::state].
9954 ///
9955 /// # Example
9956 /// ```ignore,no_run
9957 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9958 /// use google_cloud_vmwareengine_v1::model::cluster::State;
9959 /// let x0 = Cluster::new().set_state(State::Active);
9960 /// let x1 = Cluster::new().set_state(State::Creating);
9961 /// let x2 = Cluster::new().set_state(State::Updating);
9962 /// ```
9963 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
9964 self.state = v.into();
9965 self
9966 }
9967
9968 /// Sets the value of [management][crate::model::Cluster::management].
9969 ///
9970 /// # Example
9971 /// ```ignore,no_run
9972 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9973 /// let x = Cluster::new().set_management(true);
9974 /// ```
9975 pub fn set_management<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9976 self.management = v.into();
9977 self
9978 }
9979
9980 /// Sets the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9981 ///
9982 /// # Example
9983 /// ```ignore,no_run
9984 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9985 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
9986 /// let x = Cluster::new().set_autoscaling_settings(AutoscalingSettings::default()/* use setters */);
9987 /// ```
9988 pub fn set_autoscaling_settings<T>(mut self, v: T) -> Self
9989 where
9990 T: std::convert::Into<crate::model::AutoscalingSettings>,
9991 {
9992 self.autoscaling_settings = std::option::Option::Some(v.into());
9993 self
9994 }
9995
9996 /// Sets or clears the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9997 ///
9998 /// # Example
9999 /// ```ignore,no_run
10000 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10001 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
10002 /// let x = Cluster::new().set_or_clear_autoscaling_settings(Some(AutoscalingSettings::default()/* use setters */));
10003 /// let x = Cluster::new().set_or_clear_autoscaling_settings(None::<AutoscalingSettings>);
10004 /// ```
10005 pub fn set_or_clear_autoscaling_settings<T>(mut self, v: std::option::Option<T>) -> Self
10006 where
10007 T: std::convert::Into<crate::model::AutoscalingSettings>,
10008 {
10009 self.autoscaling_settings = v.map(|x| x.into());
10010 self
10011 }
10012
10013 /// Sets the value of [uid][crate::model::Cluster::uid].
10014 ///
10015 /// # Example
10016 /// ```ignore,no_run
10017 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10018 /// let x = Cluster::new().set_uid("example");
10019 /// ```
10020 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10021 self.uid = v.into();
10022 self
10023 }
10024
10025 /// Sets the value of [node_type_configs][crate::model::Cluster::node_type_configs].
10026 ///
10027 /// # Example
10028 /// ```ignore,no_run
10029 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10030 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
10031 /// let x = Cluster::new().set_node_type_configs([
10032 /// ("key0", NodeTypeConfig::default()/* use setters */),
10033 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
10034 /// ]);
10035 /// ```
10036 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
10037 where
10038 T: std::iter::IntoIterator<Item = (K, V)>,
10039 K: std::convert::Into<std::string::String>,
10040 V: std::convert::Into<crate::model::NodeTypeConfig>,
10041 {
10042 use std::iter::Iterator;
10043 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10044 self
10045 }
10046
10047 /// Sets the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10048 ///
10049 /// # Example
10050 /// ```ignore,no_run
10051 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10052 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10053 /// let x = Cluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
10054 /// ```
10055 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
10056 where
10057 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10058 {
10059 self.stretched_cluster_config = std::option::Option::Some(v.into());
10060 self
10061 }
10062
10063 /// Sets or clears the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10064 ///
10065 /// # Example
10066 /// ```ignore,no_run
10067 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10068 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10069 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
10070 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
10071 /// ```
10072 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
10073 where
10074 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10075 {
10076 self.stretched_cluster_config = v.map(|x| x.into());
10077 self
10078 }
10079}
10080
10081impl wkt::message::Message for Cluster {
10082 fn typename() -> &'static str {
10083 "type.googleapis.com/google.cloud.vmwareengine.v1.Cluster"
10084 }
10085}
10086
10087/// Defines additional types related to [Cluster].
10088pub mod cluster {
10089 #[allow(unused_imports)]
10090 use super::*;
10091
10092 /// Enum State defines possible states of private cloud clusters.
10093 ///
10094 /// # Working with unknown values
10095 ///
10096 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10097 /// additional enum variants at any time. Adding new variants is not considered
10098 /// a breaking change. Applications should write their code in anticipation of:
10099 ///
10100 /// - New values appearing in future releases of the client library, **and**
10101 /// - New values received dynamically, without application changes.
10102 ///
10103 /// Please consult the [Working with enums] section in the user guide for some
10104 /// guidelines.
10105 ///
10106 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10107 #[derive(Clone, Debug, PartialEq)]
10108 #[non_exhaustive]
10109 pub enum State {
10110 /// The default value. This value should never be used.
10111 Unspecified,
10112 /// The Cluster is operational and can be used by the user.
10113 Active,
10114 /// The Cluster is being deployed.
10115 Creating,
10116 /// Adding or removing of a node to the cluster, any other cluster specific
10117 /// updates.
10118 Updating,
10119 /// The Cluster is being deleted.
10120 Deleting,
10121 /// The Cluster is undergoing maintenance, for example: a failed node is
10122 /// getting replaced.
10123 Repairing,
10124 /// If set, the enum was initialized with an unknown value.
10125 ///
10126 /// Applications can examine the value using [State::value] or
10127 /// [State::name].
10128 UnknownValue(state::UnknownValue),
10129 }
10130
10131 #[doc(hidden)]
10132 pub mod state {
10133 #[allow(unused_imports)]
10134 use super::*;
10135 #[derive(Clone, Debug, PartialEq)]
10136 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10137 }
10138
10139 impl State {
10140 /// Gets the enum value.
10141 ///
10142 /// Returns `None` if the enum contains an unknown value deserialized from
10143 /// the string representation of enums.
10144 pub fn value(&self) -> std::option::Option<i32> {
10145 match self {
10146 Self::Unspecified => std::option::Option::Some(0),
10147 Self::Active => std::option::Option::Some(1),
10148 Self::Creating => std::option::Option::Some(2),
10149 Self::Updating => std::option::Option::Some(3),
10150 Self::Deleting => std::option::Option::Some(4),
10151 Self::Repairing => std::option::Option::Some(5),
10152 Self::UnknownValue(u) => u.0.value(),
10153 }
10154 }
10155
10156 /// Gets the enum value as a string.
10157 ///
10158 /// Returns `None` if the enum contains an unknown value deserialized from
10159 /// the integer representation of enums.
10160 pub fn name(&self) -> std::option::Option<&str> {
10161 match self {
10162 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10163 Self::Active => std::option::Option::Some("ACTIVE"),
10164 Self::Creating => std::option::Option::Some("CREATING"),
10165 Self::Updating => std::option::Option::Some("UPDATING"),
10166 Self::Deleting => std::option::Option::Some("DELETING"),
10167 Self::Repairing => std::option::Option::Some("REPAIRING"),
10168 Self::UnknownValue(u) => u.0.name(),
10169 }
10170 }
10171 }
10172
10173 impl std::default::Default for State {
10174 fn default() -> Self {
10175 use std::convert::From;
10176 Self::from(0)
10177 }
10178 }
10179
10180 impl std::fmt::Display for State {
10181 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10182 wkt::internal::display_enum(f, self.name(), self.value())
10183 }
10184 }
10185
10186 impl std::convert::From<i32> for State {
10187 fn from(value: i32) -> Self {
10188 match value {
10189 0 => Self::Unspecified,
10190 1 => Self::Active,
10191 2 => Self::Creating,
10192 3 => Self::Updating,
10193 4 => Self::Deleting,
10194 5 => Self::Repairing,
10195 _ => Self::UnknownValue(state::UnknownValue(
10196 wkt::internal::UnknownEnumValue::Integer(value),
10197 )),
10198 }
10199 }
10200 }
10201
10202 impl std::convert::From<&str> for State {
10203 fn from(value: &str) -> Self {
10204 use std::string::ToString;
10205 match value {
10206 "STATE_UNSPECIFIED" => Self::Unspecified,
10207 "ACTIVE" => Self::Active,
10208 "CREATING" => Self::Creating,
10209 "UPDATING" => Self::Updating,
10210 "DELETING" => Self::Deleting,
10211 "REPAIRING" => Self::Repairing,
10212 _ => Self::UnknownValue(state::UnknownValue(
10213 wkt::internal::UnknownEnumValue::String(value.to_string()),
10214 )),
10215 }
10216 }
10217 }
10218
10219 impl serde::ser::Serialize for State {
10220 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10221 where
10222 S: serde::Serializer,
10223 {
10224 match self {
10225 Self::Unspecified => serializer.serialize_i32(0),
10226 Self::Active => serializer.serialize_i32(1),
10227 Self::Creating => serializer.serialize_i32(2),
10228 Self::Updating => serializer.serialize_i32(3),
10229 Self::Deleting => serializer.serialize_i32(4),
10230 Self::Repairing => serializer.serialize_i32(5),
10231 Self::UnknownValue(u) => u.0.serialize(serializer),
10232 }
10233 }
10234 }
10235
10236 impl<'de> serde::de::Deserialize<'de> for State {
10237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10238 where
10239 D: serde::Deserializer<'de>,
10240 {
10241 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10242 ".google.cloud.vmwareengine.v1.Cluster.State",
10243 ))
10244 }
10245 }
10246}
10247
10248/// Node in a cluster.
10249#[derive(Clone, Default, PartialEq)]
10250#[non_exhaustive]
10251pub struct Node {
10252 /// Output only. The resource name of this node.
10253 /// Resource names are schemeless URIs that follow the conventions in
10254 /// <https://cloud.google.com/apis/design/resource_names>.
10255 /// For example:
10256 /// projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node
10257 pub name: std::string::String,
10258
10259 /// Output only. Fully qualified domain name of the node.
10260 pub fqdn: std::string::String,
10261
10262 /// Output only. Internal IP address of the node.
10263 pub internal_ip: std::string::String,
10264
10265 /// Output only. The canonical identifier of the node type (corresponds to the
10266 /// `NodeType`).
10267 /// For example: standard-72.
10268 pub node_type_id: std::string::String,
10269
10270 /// Output only. The version number of the VMware ESXi
10271 /// management component in this cluster.
10272 pub version: std::string::String,
10273
10274 /// Output only. Customized number of cores
10275 pub custom_core_count: i64,
10276
10277 /// Output only. The state of the appliance.
10278 pub state: crate::model::node::State,
10279
10280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10281}
10282
10283impl Node {
10284 pub fn new() -> Self {
10285 std::default::Default::default()
10286 }
10287
10288 /// Sets the value of [name][crate::model::Node::name].
10289 ///
10290 /// # Example
10291 /// ```ignore,no_run
10292 /// # use google_cloud_vmwareengine_v1::model::Node;
10293 /// let x = Node::new().set_name("example");
10294 /// ```
10295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10296 self.name = v.into();
10297 self
10298 }
10299
10300 /// Sets the value of [fqdn][crate::model::Node::fqdn].
10301 ///
10302 /// # Example
10303 /// ```ignore,no_run
10304 /// # use google_cloud_vmwareengine_v1::model::Node;
10305 /// let x = Node::new().set_fqdn("example");
10306 /// ```
10307 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10308 self.fqdn = v.into();
10309 self
10310 }
10311
10312 /// Sets the value of [internal_ip][crate::model::Node::internal_ip].
10313 ///
10314 /// # Example
10315 /// ```ignore,no_run
10316 /// # use google_cloud_vmwareengine_v1::model::Node;
10317 /// let x = Node::new().set_internal_ip("example");
10318 /// ```
10319 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10320 self.internal_ip = v.into();
10321 self
10322 }
10323
10324 /// Sets the value of [node_type_id][crate::model::Node::node_type_id].
10325 ///
10326 /// # Example
10327 /// ```ignore,no_run
10328 /// # use google_cloud_vmwareengine_v1::model::Node;
10329 /// let x = Node::new().set_node_type_id("example");
10330 /// ```
10331 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10332 self.node_type_id = v.into();
10333 self
10334 }
10335
10336 /// Sets the value of [version][crate::model::Node::version].
10337 ///
10338 /// # Example
10339 /// ```ignore,no_run
10340 /// # use google_cloud_vmwareengine_v1::model::Node;
10341 /// let x = Node::new().set_version("example");
10342 /// ```
10343 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10344 self.version = v.into();
10345 self
10346 }
10347
10348 /// Sets the value of [custom_core_count][crate::model::Node::custom_core_count].
10349 ///
10350 /// # Example
10351 /// ```ignore,no_run
10352 /// # use google_cloud_vmwareengine_v1::model::Node;
10353 /// let x = Node::new().set_custom_core_count(42);
10354 /// ```
10355 pub fn set_custom_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10356 self.custom_core_count = v.into();
10357 self
10358 }
10359
10360 /// Sets the value of [state][crate::model::Node::state].
10361 ///
10362 /// # Example
10363 /// ```ignore,no_run
10364 /// # use google_cloud_vmwareengine_v1::model::Node;
10365 /// use google_cloud_vmwareengine_v1::model::node::State;
10366 /// let x0 = Node::new().set_state(State::Active);
10367 /// let x1 = Node::new().set_state(State::Creating);
10368 /// let x2 = Node::new().set_state(State::Failed);
10369 /// ```
10370 pub fn set_state<T: std::convert::Into<crate::model::node::State>>(mut self, v: T) -> Self {
10371 self.state = v.into();
10372 self
10373 }
10374}
10375
10376impl wkt::message::Message for Node {
10377 fn typename() -> &'static str {
10378 "type.googleapis.com/google.cloud.vmwareengine.v1.Node"
10379 }
10380}
10381
10382/// Defines additional types related to [Node].
10383pub mod node {
10384 #[allow(unused_imports)]
10385 use super::*;
10386
10387 /// Enum State defines possible states of a node in a cluster.
10388 ///
10389 /// # Working with unknown values
10390 ///
10391 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10392 /// additional enum variants at any time. Adding new variants is not considered
10393 /// a breaking change. Applications should write their code in anticipation of:
10394 ///
10395 /// - New values appearing in future releases of the client library, **and**
10396 /// - New values received dynamically, without application changes.
10397 ///
10398 /// Please consult the [Working with enums] section in the user guide for some
10399 /// guidelines.
10400 ///
10401 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10402 #[derive(Clone, Debug, PartialEq)]
10403 #[non_exhaustive]
10404 pub enum State {
10405 /// The default value. This value should never be used.
10406 Unspecified,
10407 /// Node is operational and can be used by the user.
10408 Active,
10409 /// Node is being provisioned.
10410 Creating,
10411 /// Node is in a failed state.
10412 Failed,
10413 /// Node is undergoing maintenance, e.g.: during private cloud upgrade.
10414 Upgrading,
10415 /// If set, the enum was initialized with an unknown value.
10416 ///
10417 /// Applications can examine the value using [State::value] or
10418 /// [State::name].
10419 UnknownValue(state::UnknownValue),
10420 }
10421
10422 #[doc(hidden)]
10423 pub mod state {
10424 #[allow(unused_imports)]
10425 use super::*;
10426 #[derive(Clone, Debug, PartialEq)]
10427 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10428 }
10429
10430 impl State {
10431 /// Gets the enum value.
10432 ///
10433 /// Returns `None` if the enum contains an unknown value deserialized from
10434 /// the string representation of enums.
10435 pub fn value(&self) -> std::option::Option<i32> {
10436 match self {
10437 Self::Unspecified => std::option::Option::Some(0),
10438 Self::Active => std::option::Option::Some(1),
10439 Self::Creating => std::option::Option::Some(2),
10440 Self::Failed => std::option::Option::Some(3),
10441 Self::Upgrading => std::option::Option::Some(4),
10442 Self::UnknownValue(u) => u.0.value(),
10443 }
10444 }
10445
10446 /// Gets the enum value as a string.
10447 ///
10448 /// Returns `None` if the enum contains an unknown value deserialized from
10449 /// the integer representation of enums.
10450 pub fn name(&self) -> std::option::Option<&str> {
10451 match self {
10452 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10453 Self::Active => std::option::Option::Some("ACTIVE"),
10454 Self::Creating => std::option::Option::Some("CREATING"),
10455 Self::Failed => std::option::Option::Some("FAILED"),
10456 Self::Upgrading => std::option::Option::Some("UPGRADING"),
10457 Self::UnknownValue(u) => u.0.name(),
10458 }
10459 }
10460 }
10461
10462 impl std::default::Default for State {
10463 fn default() -> Self {
10464 use std::convert::From;
10465 Self::from(0)
10466 }
10467 }
10468
10469 impl std::fmt::Display for State {
10470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10471 wkt::internal::display_enum(f, self.name(), self.value())
10472 }
10473 }
10474
10475 impl std::convert::From<i32> for State {
10476 fn from(value: i32) -> Self {
10477 match value {
10478 0 => Self::Unspecified,
10479 1 => Self::Active,
10480 2 => Self::Creating,
10481 3 => Self::Failed,
10482 4 => Self::Upgrading,
10483 _ => Self::UnknownValue(state::UnknownValue(
10484 wkt::internal::UnknownEnumValue::Integer(value),
10485 )),
10486 }
10487 }
10488 }
10489
10490 impl std::convert::From<&str> for State {
10491 fn from(value: &str) -> Self {
10492 use std::string::ToString;
10493 match value {
10494 "STATE_UNSPECIFIED" => Self::Unspecified,
10495 "ACTIVE" => Self::Active,
10496 "CREATING" => Self::Creating,
10497 "FAILED" => Self::Failed,
10498 "UPGRADING" => Self::Upgrading,
10499 _ => Self::UnknownValue(state::UnknownValue(
10500 wkt::internal::UnknownEnumValue::String(value.to_string()),
10501 )),
10502 }
10503 }
10504 }
10505
10506 impl serde::ser::Serialize for State {
10507 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10508 where
10509 S: serde::Serializer,
10510 {
10511 match self {
10512 Self::Unspecified => serializer.serialize_i32(0),
10513 Self::Active => serializer.serialize_i32(1),
10514 Self::Creating => serializer.serialize_i32(2),
10515 Self::Failed => serializer.serialize_i32(3),
10516 Self::Upgrading => serializer.serialize_i32(4),
10517 Self::UnknownValue(u) => u.0.serialize(serializer),
10518 }
10519 }
10520 }
10521
10522 impl<'de> serde::de::Deserialize<'de> for State {
10523 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10524 where
10525 D: serde::Deserializer<'de>,
10526 {
10527 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10528 ".google.cloud.vmwareengine.v1.Node.State",
10529 ))
10530 }
10531 }
10532}
10533
10534/// Represents an allocated external IP address and its corresponding internal IP
10535/// address in a private cloud.
10536#[derive(Clone, Default, PartialEq)]
10537#[non_exhaustive]
10538pub struct ExternalAddress {
10539 /// Output only. The resource name of this external IP address.
10540 /// Resource names are schemeless URIs that follow the conventions in
10541 /// <https://cloud.google.com/apis/design/resource_names>.
10542 /// For example:
10543 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`
10544 pub name: std::string::String,
10545
10546 /// Output only. Creation time of this resource.
10547 pub create_time: std::option::Option<wkt::Timestamp>,
10548
10549 /// Output only. Last update time of this resource.
10550 pub update_time: std::option::Option<wkt::Timestamp>,
10551
10552 /// The internal IP address of a workload VM.
10553 pub internal_ip: std::string::String,
10554
10555 /// Output only. The external IP address of a workload VM.
10556 pub external_ip: std::string::String,
10557
10558 /// Output only. The state of the resource.
10559 pub state: crate::model::external_address::State,
10560
10561 /// Output only. System-generated unique identifier for the resource.
10562 pub uid: std::string::String,
10563
10564 /// User-provided description for this resource.
10565 pub description: std::string::String,
10566
10567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10568}
10569
10570impl ExternalAddress {
10571 pub fn new() -> Self {
10572 std::default::Default::default()
10573 }
10574
10575 /// Sets the value of [name][crate::model::ExternalAddress::name].
10576 ///
10577 /// # Example
10578 /// ```ignore,no_run
10579 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10580 /// let x = ExternalAddress::new().set_name("example");
10581 /// ```
10582 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10583 self.name = v.into();
10584 self
10585 }
10586
10587 /// Sets the value of [create_time][crate::model::ExternalAddress::create_time].
10588 ///
10589 /// # Example
10590 /// ```ignore,no_run
10591 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10592 /// use wkt::Timestamp;
10593 /// let x = ExternalAddress::new().set_create_time(Timestamp::default()/* use setters */);
10594 /// ```
10595 pub fn set_create_time<T>(mut self, v: T) -> Self
10596 where
10597 T: std::convert::Into<wkt::Timestamp>,
10598 {
10599 self.create_time = std::option::Option::Some(v.into());
10600 self
10601 }
10602
10603 /// Sets or clears the value of [create_time][crate::model::ExternalAddress::create_time].
10604 ///
10605 /// # Example
10606 /// ```ignore,no_run
10607 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10608 /// use wkt::Timestamp;
10609 /// let x = ExternalAddress::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10610 /// let x = ExternalAddress::new().set_or_clear_create_time(None::<Timestamp>);
10611 /// ```
10612 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10613 where
10614 T: std::convert::Into<wkt::Timestamp>,
10615 {
10616 self.create_time = v.map(|x| x.into());
10617 self
10618 }
10619
10620 /// Sets the value of [update_time][crate::model::ExternalAddress::update_time].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10625 /// use wkt::Timestamp;
10626 /// let x = ExternalAddress::new().set_update_time(Timestamp::default()/* use setters */);
10627 /// ```
10628 pub fn set_update_time<T>(mut self, v: T) -> Self
10629 where
10630 T: std::convert::Into<wkt::Timestamp>,
10631 {
10632 self.update_time = std::option::Option::Some(v.into());
10633 self
10634 }
10635
10636 /// Sets or clears the value of [update_time][crate::model::ExternalAddress::update_time].
10637 ///
10638 /// # Example
10639 /// ```ignore,no_run
10640 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10641 /// use wkt::Timestamp;
10642 /// let x = ExternalAddress::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10643 /// let x = ExternalAddress::new().set_or_clear_update_time(None::<Timestamp>);
10644 /// ```
10645 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10646 where
10647 T: std::convert::Into<wkt::Timestamp>,
10648 {
10649 self.update_time = v.map(|x| x.into());
10650 self
10651 }
10652
10653 /// Sets the value of [internal_ip][crate::model::ExternalAddress::internal_ip].
10654 ///
10655 /// # Example
10656 /// ```ignore,no_run
10657 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10658 /// let x = ExternalAddress::new().set_internal_ip("example");
10659 /// ```
10660 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10661 self.internal_ip = v.into();
10662 self
10663 }
10664
10665 /// Sets the value of [external_ip][crate::model::ExternalAddress::external_ip].
10666 ///
10667 /// # Example
10668 /// ```ignore,no_run
10669 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10670 /// let x = ExternalAddress::new().set_external_ip("example");
10671 /// ```
10672 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10673 self.external_ip = v.into();
10674 self
10675 }
10676
10677 /// Sets the value of [state][crate::model::ExternalAddress::state].
10678 ///
10679 /// # Example
10680 /// ```ignore,no_run
10681 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10682 /// use google_cloud_vmwareengine_v1::model::external_address::State;
10683 /// let x0 = ExternalAddress::new().set_state(State::Active);
10684 /// let x1 = ExternalAddress::new().set_state(State::Creating);
10685 /// let x2 = ExternalAddress::new().set_state(State::Updating);
10686 /// ```
10687 pub fn set_state<T: std::convert::Into<crate::model::external_address::State>>(
10688 mut self,
10689 v: T,
10690 ) -> Self {
10691 self.state = v.into();
10692 self
10693 }
10694
10695 /// Sets the value of [uid][crate::model::ExternalAddress::uid].
10696 ///
10697 /// # Example
10698 /// ```ignore,no_run
10699 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10700 /// let x = ExternalAddress::new().set_uid("example");
10701 /// ```
10702 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10703 self.uid = v.into();
10704 self
10705 }
10706
10707 /// Sets the value of [description][crate::model::ExternalAddress::description].
10708 ///
10709 /// # Example
10710 /// ```ignore,no_run
10711 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10712 /// let x = ExternalAddress::new().set_description("example");
10713 /// ```
10714 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10715 self.description = v.into();
10716 self
10717 }
10718}
10719
10720impl wkt::message::Message for ExternalAddress {
10721 fn typename() -> &'static str {
10722 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAddress"
10723 }
10724}
10725
10726/// Defines additional types related to [ExternalAddress].
10727pub mod external_address {
10728 #[allow(unused_imports)]
10729 use super::*;
10730
10731 /// Enum State defines possible states of external addresses.
10732 ///
10733 /// # Working with unknown values
10734 ///
10735 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10736 /// additional enum variants at any time. Adding new variants is not considered
10737 /// a breaking change. Applications should write their code in anticipation of:
10738 ///
10739 /// - New values appearing in future releases of the client library, **and**
10740 /// - New values received dynamically, without application changes.
10741 ///
10742 /// Please consult the [Working with enums] section in the user guide for some
10743 /// guidelines.
10744 ///
10745 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10746 #[derive(Clone, Debug, PartialEq)]
10747 #[non_exhaustive]
10748 pub enum State {
10749 /// The default value. This value should never be used.
10750 Unspecified,
10751 /// The address is ready.
10752 Active,
10753 /// The address is being created.
10754 Creating,
10755 /// The address is being updated.
10756 Updating,
10757 /// The address is being deleted.
10758 Deleting,
10759 /// If set, the enum was initialized with an unknown value.
10760 ///
10761 /// Applications can examine the value using [State::value] or
10762 /// [State::name].
10763 UnknownValue(state::UnknownValue),
10764 }
10765
10766 #[doc(hidden)]
10767 pub mod state {
10768 #[allow(unused_imports)]
10769 use super::*;
10770 #[derive(Clone, Debug, PartialEq)]
10771 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10772 }
10773
10774 impl State {
10775 /// Gets the enum value.
10776 ///
10777 /// Returns `None` if the enum contains an unknown value deserialized from
10778 /// the string representation of enums.
10779 pub fn value(&self) -> std::option::Option<i32> {
10780 match self {
10781 Self::Unspecified => std::option::Option::Some(0),
10782 Self::Active => std::option::Option::Some(1),
10783 Self::Creating => std::option::Option::Some(2),
10784 Self::Updating => std::option::Option::Some(3),
10785 Self::Deleting => std::option::Option::Some(4),
10786 Self::UnknownValue(u) => u.0.value(),
10787 }
10788 }
10789
10790 /// Gets the enum value as a string.
10791 ///
10792 /// Returns `None` if the enum contains an unknown value deserialized from
10793 /// the integer representation of enums.
10794 pub fn name(&self) -> std::option::Option<&str> {
10795 match self {
10796 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10797 Self::Active => std::option::Option::Some("ACTIVE"),
10798 Self::Creating => std::option::Option::Some("CREATING"),
10799 Self::Updating => std::option::Option::Some("UPDATING"),
10800 Self::Deleting => std::option::Option::Some("DELETING"),
10801 Self::UnknownValue(u) => u.0.name(),
10802 }
10803 }
10804 }
10805
10806 impl std::default::Default for State {
10807 fn default() -> Self {
10808 use std::convert::From;
10809 Self::from(0)
10810 }
10811 }
10812
10813 impl std::fmt::Display for State {
10814 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10815 wkt::internal::display_enum(f, self.name(), self.value())
10816 }
10817 }
10818
10819 impl std::convert::From<i32> for State {
10820 fn from(value: i32) -> Self {
10821 match value {
10822 0 => Self::Unspecified,
10823 1 => Self::Active,
10824 2 => Self::Creating,
10825 3 => Self::Updating,
10826 4 => Self::Deleting,
10827 _ => Self::UnknownValue(state::UnknownValue(
10828 wkt::internal::UnknownEnumValue::Integer(value),
10829 )),
10830 }
10831 }
10832 }
10833
10834 impl std::convert::From<&str> for State {
10835 fn from(value: &str) -> Self {
10836 use std::string::ToString;
10837 match value {
10838 "STATE_UNSPECIFIED" => Self::Unspecified,
10839 "ACTIVE" => Self::Active,
10840 "CREATING" => Self::Creating,
10841 "UPDATING" => Self::Updating,
10842 "DELETING" => Self::Deleting,
10843 _ => Self::UnknownValue(state::UnknownValue(
10844 wkt::internal::UnknownEnumValue::String(value.to_string()),
10845 )),
10846 }
10847 }
10848 }
10849
10850 impl serde::ser::Serialize for State {
10851 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10852 where
10853 S: serde::Serializer,
10854 {
10855 match self {
10856 Self::Unspecified => serializer.serialize_i32(0),
10857 Self::Active => serializer.serialize_i32(1),
10858 Self::Creating => serializer.serialize_i32(2),
10859 Self::Updating => serializer.serialize_i32(3),
10860 Self::Deleting => serializer.serialize_i32(4),
10861 Self::UnknownValue(u) => u.0.serialize(serializer),
10862 }
10863 }
10864 }
10865
10866 impl<'de> serde::de::Deserialize<'de> for State {
10867 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10868 where
10869 D: serde::Deserializer<'de>,
10870 {
10871 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10872 ".google.cloud.vmwareengine.v1.ExternalAddress.State",
10873 ))
10874 }
10875 }
10876}
10877
10878/// Subnet in a private cloud. Either `management` subnets (such as vMotion) that
10879/// are read-only, or `userDefined`, which can also be updated.
10880#[derive(Clone, Default, PartialEq)]
10881#[non_exhaustive]
10882pub struct Subnet {
10883 /// Output only. The resource name of this subnet.
10884 /// Resource names are schemeless URIs that follow the conventions in
10885 /// <https://cloud.google.com/apis/design/resource_names>.
10886 /// For example:
10887 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
10888 pub name: std::string::String,
10889
10890 /// The IP address range of the subnet in CIDR format '10.0.0.0/24'.
10891 pub ip_cidr_range: std::string::String,
10892
10893 /// The IP address of the gateway of this subnet.
10894 /// Must fall within the IP prefix defined above.
10895 pub gateway_ip: std::string::String,
10896
10897 /// Output only. The type of the subnet. For example "management" or
10898 /// "userDefined".
10899 pub r#type: std::string::String,
10900
10901 /// Output only. The state of the resource.
10902 pub state: crate::model::subnet::State,
10903
10904 /// Output only. VLAN ID of the VLAN on which the subnet is configured
10905 pub vlan_id: i32,
10906
10907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10908}
10909
10910impl Subnet {
10911 pub fn new() -> Self {
10912 std::default::Default::default()
10913 }
10914
10915 /// Sets the value of [name][crate::model::Subnet::name].
10916 ///
10917 /// # Example
10918 /// ```ignore,no_run
10919 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10920 /// let x = Subnet::new().set_name("example");
10921 /// ```
10922 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10923 self.name = v.into();
10924 self
10925 }
10926
10927 /// Sets the value of [ip_cidr_range][crate::model::Subnet::ip_cidr_range].
10928 ///
10929 /// # Example
10930 /// ```ignore,no_run
10931 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10932 /// let x = Subnet::new().set_ip_cidr_range("example");
10933 /// ```
10934 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10935 self.ip_cidr_range = v.into();
10936 self
10937 }
10938
10939 /// Sets the value of [gateway_ip][crate::model::Subnet::gateway_ip].
10940 ///
10941 /// # Example
10942 /// ```ignore,no_run
10943 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10944 /// let x = Subnet::new().set_gateway_ip("example");
10945 /// ```
10946 pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10947 self.gateway_ip = v.into();
10948 self
10949 }
10950
10951 /// Sets the value of [r#type][crate::model::Subnet::type].
10952 ///
10953 /// # Example
10954 /// ```ignore,no_run
10955 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10956 /// let x = Subnet::new().set_type("example");
10957 /// ```
10958 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10959 self.r#type = v.into();
10960 self
10961 }
10962
10963 /// Sets the value of [state][crate::model::Subnet::state].
10964 ///
10965 /// # Example
10966 /// ```ignore,no_run
10967 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10968 /// use google_cloud_vmwareengine_v1::model::subnet::State;
10969 /// let x0 = Subnet::new().set_state(State::Active);
10970 /// let x1 = Subnet::new().set_state(State::Creating);
10971 /// let x2 = Subnet::new().set_state(State::Updating);
10972 /// ```
10973 pub fn set_state<T: std::convert::Into<crate::model::subnet::State>>(mut self, v: T) -> Self {
10974 self.state = v.into();
10975 self
10976 }
10977
10978 /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
10979 ///
10980 /// # Example
10981 /// ```ignore,no_run
10982 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10983 /// let x = Subnet::new().set_vlan_id(42);
10984 /// ```
10985 pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10986 self.vlan_id = v.into();
10987 self
10988 }
10989}
10990
10991impl wkt::message::Message for Subnet {
10992 fn typename() -> &'static str {
10993 "type.googleapis.com/google.cloud.vmwareengine.v1.Subnet"
10994 }
10995}
10996
10997/// Defines additional types related to [Subnet].
10998pub mod subnet {
10999 #[allow(unused_imports)]
11000 use super::*;
11001
11002 /// Defines possible states of subnets.
11003 ///
11004 /// # Working with unknown values
11005 ///
11006 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11007 /// additional enum variants at any time. Adding new variants is not considered
11008 /// a breaking change. Applications should write their code in anticipation of:
11009 ///
11010 /// - New values appearing in future releases of the client library, **and**
11011 /// - New values received dynamically, without application changes.
11012 ///
11013 /// Please consult the [Working with enums] section in the user guide for some
11014 /// guidelines.
11015 ///
11016 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11017 #[derive(Clone, Debug, PartialEq)]
11018 #[non_exhaustive]
11019 pub enum State {
11020 /// The default value. This value should never be used.
11021 Unspecified,
11022 /// The subnet is ready.
11023 Active,
11024 /// The subnet is being created.
11025 Creating,
11026 /// The subnet is being updated.
11027 Updating,
11028 /// The subnet is being deleted.
11029 Deleting,
11030 /// Changes requested in the last operation are being propagated.
11031 Reconciling,
11032 /// Last operation on the subnet did not succeed. Subnet's payload is
11033 /// reverted back to its most recent working state.
11034 Failed,
11035 /// If set, the enum was initialized with an unknown value.
11036 ///
11037 /// Applications can examine the value using [State::value] or
11038 /// [State::name].
11039 UnknownValue(state::UnknownValue),
11040 }
11041
11042 #[doc(hidden)]
11043 pub mod state {
11044 #[allow(unused_imports)]
11045 use super::*;
11046 #[derive(Clone, Debug, PartialEq)]
11047 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11048 }
11049
11050 impl State {
11051 /// Gets the enum value.
11052 ///
11053 /// Returns `None` if the enum contains an unknown value deserialized from
11054 /// the string representation of enums.
11055 pub fn value(&self) -> std::option::Option<i32> {
11056 match self {
11057 Self::Unspecified => std::option::Option::Some(0),
11058 Self::Active => std::option::Option::Some(1),
11059 Self::Creating => std::option::Option::Some(2),
11060 Self::Updating => std::option::Option::Some(3),
11061 Self::Deleting => std::option::Option::Some(4),
11062 Self::Reconciling => std::option::Option::Some(5),
11063 Self::Failed => std::option::Option::Some(6),
11064 Self::UnknownValue(u) => u.0.value(),
11065 }
11066 }
11067
11068 /// Gets the enum value as a string.
11069 ///
11070 /// Returns `None` if the enum contains an unknown value deserialized from
11071 /// the integer representation of enums.
11072 pub fn name(&self) -> std::option::Option<&str> {
11073 match self {
11074 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11075 Self::Active => std::option::Option::Some("ACTIVE"),
11076 Self::Creating => std::option::Option::Some("CREATING"),
11077 Self::Updating => std::option::Option::Some("UPDATING"),
11078 Self::Deleting => std::option::Option::Some("DELETING"),
11079 Self::Reconciling => std::option::Option::Some("RECONCILING"),
11080 Self::Failed => std::option::Option::Some("FAILED"),
11081 Self::UnknownValue(u) => u.0.name(),
11082 }
11083 }
11084 }
11085
11086 impl std::default::Default for State {
11087 fn default() -> Self {
11088 use std::convert::From;
11089 Self::from(0)
11090 }
11091 }
11092
11093 impl std::fmt::Display for State {
11094 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11095 wkt::internal::display_enum(f, self.name(), self.value())
11096 }
11097 }
11098
11099 impl std::convert::From<i32> for State {
11100 fn from(value: i32) -> Self {
11101 match value {
11102 0 => Self::Unspecified,
11103 1 => Self::Active,
11104 2 => Self::Creating,
11105 3 => Self::Updating,
11106 4 => Self::Deleting,
11107 5 => Self::Reconciling,
11108 6 => Self::Failed,
11109 _ => Self::UnknownValue(state::UnknownValue(
11110 wkt::internal::UnknownEnumValue::Integer(value),
11111 )),
11112 }
11113 }
11114 }
11115
11116 impl std::convert::From<&str> for State {
11117 fn from(value: &str) -> Self {
11118 use std::string::ToString;
11119 match value {
11120 "STATE_UNSPECIFIED" => Self::Unspecified,
11121 "ACTIVE" => Self::Active,
11122 "CREATING" => Self::Creating,
11123 "UPDATING" => Self::Updating,
11124 "DELETING" => Self::Deleting,
11125 "RECONCILING" => Self::Reconciling,
11126 "FAILED" => Self::Failed,
11127 _ => Self::UnknownValue(state::UnknownValue(
11128 wkt::internal::UnknownEnumValue::String(value.to_string()),
11129 )),
11130 }
11131 }
11132 }
11133
11134 impl serde::ser::Serialize for State {
11135 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11136 where
11137 S: serde::Serializer,
11138 {
11139 match self {
11140 Self::Unspecified => serializer.serialize_i32(0),
11141 Self::Active => serializer.serialize_i32(1),
11142 Self::Creating => serializer.serialize_i32(2),
11143 Self::Updating => serializer.serialize_i32(3),
11144 Self::Deleting => serializer.serialize_i32(4),
11145 Self::Reconciling => serializer.serialize_i32(5),
11146 Self::Failed => serializer.serialize_i32(6),
11147 Self::UnknownValue(u) => u.0.serialize(serializer),
11148 }
11149 }
11150 }
11151
11152 impl<'de> serde::de::Deserialize<'de> for State {
11153 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11154 where
11155 D: serde::Deserializer<'de>,
11156 {
11157 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11158 ".google.cloud.vmwareengine.v1.Subnet.State",
11159 ))
11160 }
11161 }
11162}
11163
11164/// External access firewall rules for filtering incoming traffic destined to
11165/// `ExternalAddress` resources.
11166#[derive(Clone, Default, PartialEq)]
11167#[non_exhaustive]
11168pub struct ExternalAccessRule {
11169 /// Output only. The resource name of this external access rule.
11170 /// Resource names are schemeless URIs that follow the conventions in
11171 /// <https://cloud.google.com/apis/design/resource_names>.
11172 /// For example:
11173 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
11174 pub name: std::string::String,
11175
11176 /// Output only. Creation time of this resource.
11177 pub create_time: std::option::Option<wkt::Timestamp>,
11178
11179 /// Output only. Last update time of this resource.
11180 pub update_time: std::option::Option<wkt::Timestamp>,
11181
11182 /// User-provided description for this external access rule.
11183 pub description: std::string::String,
11184
11185 /// External access rule priority, which determines the external access rule to
11186 /// use when multiple rules apply. If multiple rules have the same priority,
11187 /// their ordering is non-deterministic. If specific ordering is required,
11188 /// assign unique priorities to enforce such ordering. The external access rule
11189 /// priority is an integer from 100 to 4096, both inclusive. Lower integers
11190 /// indicate higher precedence. For example, a rule with priority `100` has
11191 /// higher precedence than a rule with priority `101`.
11192 pub priority: i32,
11193
11194 /// The action that the external access rule performs.
11195 pub action: crate::model::external_access_rule::Action,
11196
11197 /// The IP protocol to which the external access rule applies. This value can
11198 /// be one of the following three protocol strings (not case-sensitive):
11199 /// `tcp`, `udp`, or `icmp`.
11200 pub ip_protocol: std::string::String,
11201
11202 /// If source ranges are specified, the external access rule applies only to
11203 /// traffic that has a source IP address in these ranges. These ranges can
11204 /// either be expressed in the CIDR format or as an IP address. As only inbound
11205 /// rules are supported, `ExternalAddress` resources cannot be the source IP
11206 /// addresses of an external access rule. To match all source addresses,
11207 /// specify `0.0.0.0/0`.
11208 pub source_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11209
11210 /// A list of source ports to which the external access rule applies. This
11211 /// field is only applicable for the UDP or TCP protocol.
11212 /// Each entry must be either an integer or a range. For example: `["22"]`,
11213 /// `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
11214 /// `["0-65535"]`.
11215 pub source_ports: std::vec::Vec<std::string::String>,
11216
11217 /// If destination ranges are specified, the external access rule applies only
11218 /// to the traffic that has a destination IP address in these ranges. The
11219 /// specified IP addresses must have reserved external IP addresses in the
11220 /// scope of the parent network policy. To match all external IP addresses in
11221 /// the scope of the parent network policy, specify `0.0.0.0/0`. To match a
11222 /// specific external IP address, specify it using the
11223 /// `IpRange.external_address` property.
11224 pub destination_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11225
11226 /// A list of destination ports to which the external access rule applies. This
11227 /// field is only applicable for the UDP or TCP protocol.
11228 /// Each entry must be either an integer or a range. For example: `["22"]`,
11229 /// `["80","443"]`, or `["12345-12349"]`. To match all destination ports,
11230 /// specify `["0-65535"]`.
11231 pub destination_ports: std::vec::Vec<std::string::String>,
11232
11233 /// Output only. The state of the resource.
11234 pub state: crate::model::external_access_rule::State,
11235
11236 /// Output only. System-generated unique identifier for the resource.
11237 pub uid: std::string::String,
11238
11239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11240}
11241
11242impl ExternalAccessRule {
11243 pub fn new() -> Self {
11244 std::default::Default::default()
11245 }
11246
11247 /// Sets the value of [name][crate::model::ExternalAccessRule::name].
11248 ///
11249 /// # Example
11250 /// ```ignore,no_run
11251 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11252 /// let x = ExternalAccessRule::new().set_name("example");
11253 /// ```
11254 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11255 self.name = v.into();
11256 self
11257 }
11258
11259 /// Sets the value of [create_time][crate::model::ExternalAccessRule::create_time].
11260 ///
11261 /// # Example
11262 /// ```ignore,no_run
11263 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11264 /// use wkt::Timestamp;
11265 /// let x = ExternalAccessRule::new().set_create_time(Timestamp::default()/* use setters */);
11266 /// ```
11267 pub fn set_create_time<T>(mut self, v: T) -> Self
11268 where
11269 T: std::convert::Into<wkt::Timestamp>,
11270 {
11271 self.create_time = std::option::Option::Some(v.into());
11272 self
11273 }
11274
11275 /// Sets or clears the value of [create_time][crate::model::ExternalAccessRule::create_time].
11276 ///
11277 /// # Example
11278 /// ```ignore,no_run
11279 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11280 /// use wkt::Timestamp;
11281 /// let x = ExternalAccessRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11282 /// let x = ExternalAccessRule::new().set_or_clear_create_time(None::<Timestamp>);
11283 /// ```
11284 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11285 where
11286 T: std::convert::Into<wkt::Timestamp>,
11287 {
11288 self.create_time = v.map(|x| x.into());
11289 self
11290 }
11291
11292 /// Sets the value of [update_time][crate::model::ExternalAccessRule::update_time].
11293 ///
11294 /// # Example
11295 /// ```ignore,no_run
11296 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11297 /// use wkt::Timestamp;
11298 /// let x = ExternalAccessRule::new().set_update_time(Timestamp::default()/* use setters */);
11299 /// ```
11300 pub fn set_update_time<T>(mut self, v: T) -> Self
11301 where
11302 T: std::convert::Into<wkt::Timestamp>,
11303 {
11304 self.update_time = std::option::Option::Some(v.into());
11305 self
11306 }
11307
11308 /// Sets or clears the value of [update_time][crate::model::ExternalAccessRule::update_time].
11309 ///
11310 /// # Example
11311 /// ```ignore,no_run
11312 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11313 /// use wkt::Timestamp;
11314 /// let x = ExternalAccessRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11315 /// let x = ExternalAccessRule::new().set_or_clear_update_time(None::<Timestamp>);
11316 /// ```
11317 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11318 where
11319 T: std::convert::Into<wkt::Timestamp>,
11320 {
11321 self.update_time = v.map(|x| x.into());
11322 self
11323 }
11324
11325 /// Sets the value of [description][crate::model::ExternalAccessRule::description].
11326 ///
11327 /// # Example
11328 /// ```ignore,no_run
11329 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11330 /// let x = ExternalAccessRule::new().set_description("example");
11331 /// ```
11332 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11333 self.description = v.into();
11334 self
11335 }
11336
11337 /// Sets the value of [priority][crate::model::ExternalAccessRule::priority].
11338 ///
11339 /// # Example
11340 /// ```ignore,no_run
11341 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11342 /// let x = ExternalAccessRule::new().set_priority(42);
11343 /// ```
11344 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11345 self.priority = v.into();
11346 self
11347 }
11348
11349 /// Sets the value of [action][crate::model::ExternalAccessRule::action].
11350 ///
11351 /// # Example
11352 /// ```ignore,no_run
11353 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11354 /// use google_cloud_vmwareengine_v1::model::external_access_rule::Action;
11355 /// let x0 = ExternalAccessRule::new().set_action(Action::Allow);
11356 /// let x1 = ExternalAccessRule::new().set_action(Action::Deny);
11357 /// ```
11358 pub fn set_action<T: std::convert::Into<crate::model::external_access_rule::Action>>(
11359 mut self,
11360 v: T,
11361 ) -> Self {
11362 self.action = v.into();
11363 self
11364 }
11365
11366 /// Sets the value of [ip_protocol][crate::model::ExternalAccessRule::ip_protocol].
11367 ///
11368 /// # Example
11369 /// ```ignore,no_run
11370 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11371 /// let x = ExternalAccessRule::new().set_ip_protocol("example");
11372 /// ```
11373 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11374 self.ip_protocol = v.into();
11375 self
11376 }
11377
11378 /// Sets the value of [source_ip_ranges][crate::model::ExternalAccessRule::source_ip_ranges].
11379 ///
11380 /// # Example
11381 /// ```ignore,no_run
11382 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11383 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11384 /// let x = ExternalAccessRule::new()
11385 /// .set_source_ip_ranges([
11386 /// IpRange::default()/* use setters */,
11387 /// IpRange::default()/* use (different) setters */,
11388 /// ]);
11389 /// ```
11390 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
11391 where
11392 T: std::iter::IntoIterator<Item = V>,
11393 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11394 {
11395 use std::iter::Iterator;
11396 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11397 self
11398 }
11399
11400 /// Sets the value of [source_ports][crate::model::ExternalAccessRule::source_ports].
11401 ///
11402 /// # Example
11403 /// ```ignore,no_run
11404 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11405 /// let x = ExternalAccessRule::new().set_source_ports(["a", "b", "c"]);
11406 /// ```
11407 pub fn set_source_ports<T, V>(mut self, v: T) -> Self
11408 where
11409 T: std::iter::IntoIterator<Item = V>,
11410 V: std::convert::Into<std::string::String>,
11411 {
11412 use std::iter::Iterator;
11413 self.source_ports = v.into_iter().map(|i| i.into()).collect();
11414 self
11415 }
11416
11417 /// Sets the value of [destination_ip_ranges][crate::model::ExternalAccessRule::destination_ip_ranges].
11418 ///
11419 /// # Example
11420 /// ```ignore,no_run
11421 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11422 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11423 /// let x = ExternalAccessRule::new()
11424 /// .set_destination_ip_ranges([
11425 /// IpRange::default()/* use setters */,
11426 /// IpRange::default()/* use (different) setters */,
11427 /// ]);
11428 /// ```
11429 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
11430 where
11431 T: std::iter::IntoIterator<Item = V>,
11432 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11433 {
11434 use std::iter::Iterator;
11435 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11436 self
11437 }
11438
11439 /// Sets the value of [destination_ports][crate::model::ExternalAccessRule::destination_ports].
11440 ///
11441 /// # Example
11442 /// ```ignore,no_run
11443 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11444 /// let x = ExternalAccessRule::new().set_destination_ports(["a", "b", "c"]);
11445 /// ```
11446 pub fn set_destination_ports<T, V>(mut self, v: T) -> Self
11447 where
11448 T: std::iter::IntoIterator<Item = V>,
11449 V: std::convert::Into<std::string::String>,
11450 {
11451 use std::iter::Iterator;
11452 self.destination_ports = v.into_iter().map(|i| i.into()).collect();
11453 self
11454 }
11455
11456 /// Sets the value of [state][crate::model::ExternalAccessRule::state].
11457 ///
11458 /// # Example
11459 /// ```ignore,no_run
11460 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11461 /// use google_cloud_vmwareengine_v1::model::external_access_rule::State;
11462 /// let x0 = ExternalAccessRule::new().set_state(State::Active);
11463 /// let x1 = ExternalAccessRule::new().set_state(State::Creating);
11464 /// let x2 = ExternalAccessRule::new().set_state(State::Updating);
11465 /// ```
11466 pub fn set_state<T: std::convert::Into<crate::model::external_access_rule::State>>(
11467 mut self,
11468 v: T,
11469 ) -> Self {
11470 self.state = v.into();
11471 self
11472 }
11473
11474 /// Sets the value of [uid][crate::model::ExternalAccessRule::uid].
11475 ///
11476 /// # Example
11477 /// ```ignore,no_run
11478 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11479 /// let x = ExternalAccessRule::new().set_uid("example");
11480 /// ```
11481 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11482 self.uid = v.into();
11483 self
11484 }
11485}
11486
11487impl wkt::message::Message for ExternalAccessRule {
11488 fn typename() -> &'static str {
11489 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule"
11490 }
11491}
11492
11493/// Defines additional types related to [ExternalAccessRule].
11494pub mod external_access_rule {
11495 #[allow(unused_imports)]
11496 use super::*;
11497
11498 /// An IP range provided in any one of the supported formats.
11499 #[derive(Clone, Default, PartialEq)]
11500 #[non_exhaustive]
11501 pub struct IpRange {
11502 pub ip_range: std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11503
11504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11505 }
11506
11507 impl IpRange {
11508 pub fn new() -> Self {
11509 std::default::Default::default()
11510 }
11511
11512 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range].
11513 ///
11514 /// Note that all the setters affecting `ip_range` are mutually
11515 /// exclusive.
11516 ///
11517 /// # Example
11518 /// ```ignore,no_run
11519 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11520 /// use google_cloud_vmwareengine_v1::model::external_access_rule::ip_range::IpRange as IpRangeOneOf;
11521 /// let x = IpRange::new().set_ip_range(Some(IpRangeOneOf::IpAddress("example".to_string())));
11522 /// ```
11523 pub fn set_ip_range<
11524 T: std::convert::Into<
11525 std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11526 >,
11527 >(
11528 mut self,
11529 v: T,
11530 ) -> Self {
11531 self.ip_range = v.into();
11532 self
11533 }
11534
11535 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11536 /// if it holds a `IpAddress`, `None` if the field is not set or
11537 /// holds a different branch.
11538 pub fn ip_address(&self) -> std::option::Option<&std::string::String> {
11539 #[allow(unreachable_patterns)]
11540 self.ip_range.as_ref().and_then(|v| match v {
11541 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v) => {
11542 std::option::Option::Some(v)
11543 }
11544 _ => std::option::Option::None,
11545 })
11546 }
11547
11548 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11549 /// to hold a `IpAddress`.
11550 ///
11551 /// Note that all the setters affecting `ip_range` are
11552 /// mutually exclusive.
11553 ///
11554 /// # Example
11555 /// ```ignore,no_run
11556 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11557 /// let x = IpRange::new().set_ip_address("example");
11558 /// assert!(x.ip_address().is_some());
11559 /// assert!(x.ip_address_range().is_none());
11560 /// assert!(x.external_address().is_none());
11561 /// ```
11562 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11563 self.ip_range = std::option::Option::Some(
11564 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v.into()),
11565 );
11566 self
11567 }
11568
11569 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11570 /// if it holds a `IpAddressRange`, `None` if the field is not set or
11571 /// holds a different branch.
11572 pub fn ip_address_range(&self) -> std::option::Option<&std::string::String> {
11573 #[allow(unreachable_patterns)]
11574 self.ip_range.as_ref().and_then(|v| match v {
11575 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v) => {
11576 std::option::Option::Some(v)
11577 }
11578 _ => std::option::Option::None,
11579 })
11580 }
11581
11582 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11583 /// to hold a `IpAddressRange`.
11584 ///
11585 /// Note that all the setters affecting `ip_range` are
11586 /// mutually exclusive.
11587 ///
11588 /// # Example
11589 /// ```ignore,no_run
11590 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11591 /// let x = IpRange::new().set_ip_address_range("example");
11592 /// assert!(x.ip_address_range().is_some());
11593 /// assert!(x.ip_address().is_none());
11594 /// assert!(x.external_address().is_none());
11595 /// ```
11596 pub fn set_ip_address_range<T: std::convert::Into<std::string::String>>(
11597 mut self,
11598 v: T,
11599 ) -> Self {
11600 self.ip_range = std::option::Option::Some(
11601 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v.into()),
11602 );
11603 self
11604 }
11605
11606 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11607 /// if it holds a `ExternalAddress`, `None` if the field is not set or
11608 /// holds a different branch.
11609 pub fn external_address(&self) -> std::option::Option<&std::string::String> {
11610 #[allow(unreachable_patterns)]
11611 self.ip_range.as_ref().and_then(|v| match v {
11612 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v) => {
11613 std::option::Option::Some(v)
11614 }
11615 _ => std::option::Option::None,
11616 })
11617 }
11618
11619 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11620 /// to hold a `ExternalAddress`.
11621 ///
11622 /// Note that all the setters affecting `ip_range` are
11623 /// mutually exclusive.
11624 ///
11625 /// # Example
11626 /// ```ignore,no_run
11627 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11628 /// let x = IpRange::new().set_external_address("example");
11629 /// assert!(x.external_address().is_some());
11630 /// assert!(x.ip_address().is_none());
11631 /// assert!(x.ip_address_range().is_none());
11632 /// ```
11633 pub fn set_external_address<T: std::convert::Into<std::string::String>>(
11634 mut self,
11635 v: T,
11636 ) -> Self {
11637 self.ip_range = std::option::Option::Some(
11638 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v.into()),
11639 );
11640 self
11641 }
11642 }
11643
11644 impl wkt::message::Message for IpRange {
11645 fn typename() -> &'static str {
11646 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange"
11647 }
11648 }
11649
11650 /// Defines additional types related to [IpRange].
11651 pub mod ip_range {
11652 #[allow(unused_imports)]
11653 use super::*;
11654
11655 #[derive(Clone, Debug, PartialEq)]
11656 #[non_exhaustive]
11657 pub enum IpRange {
11658 /// A single IP address. For example: `10.0.0.5`.
11659 IpAddress(std::string::String),
11660 /// An IP address range in the CIDR format. For example: `10.0.0.0/24`.
11661 IpAddressRange(std::string::String),
11662 /// The name of an `ExternalAddress` resource. The external address must
11663 /// have been reserved in the scope of this external access rule's parent
11664 /// network policy. Provide the external address name in the form of
11665 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`.
11666 /// For example:
11667 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
11668 ExternalAddress(std::string::String),
11669 }
11670 }
11671
11672 /// Action determines whether the external access rule permits or blocks
11673 /// traffic, subject to the other components of the rule matching the traffic.
11674 ///
11675 /// # Working with unknown values
11676 ///
11677 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11678 /// additional enum variants at any time. Adding new variants is not considered
11679 /// a breaking change. Applications should write their code in anticipation of:
11680 ///
11681 /// - New values appearing in future releases of the client library, **and**
11682 /// - New values received dynamically, without application changes.
11683 ///
11684 /// Please consult the [Working with enums] section in the user guide for some
11685 /// guidelines.
11686 ///
11687 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11688 #[derive(Clone, Debug, PartialEq)]
11689 #[non_exhaustive]
11690 pub enum Action {
11691 /// Defaults to allow.
11692 Unspecified,
11693 /// Allows connections that match the other specified components.
11694 Allow,
11695 /// Blocks connections that match the other specified components.
11696 Deny,
11697 /// If set, the enum was initialized with an unknown value.
11698 ///
11699 /// Applications can examine the value using [Action::value] or
11700 /// [Action::name].
11701 UnknownValue(action::UnknownValue),
11702 }
11703
11704 #[doc(hidden)]
11705 pub mod action {
11706 #[allow(unused_imports)]
11707 use super::*;
11708 #[derive(Clone, Debug, PartialEq)]
11709 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11710 }
11711
11712 impl Action {
11713 /// Gets the enum value.
11714 ///
11715 /// Returns `None` if the enum contains an unknown value deserialized from
11716 /// the string representation of enums.
11717 pub fn value(&self) -> std::option::Option<i32> {
11718 match self {
11719 Self::Unspecified => std::option::Option::Some(0),
11720 Self::Allow => std::option::Option::Some(1),
11721 Self::Deny => std::option::Option::Some(2),
11722 Self::UnknownValue(u) => u.0.value(),
11723 }
11724 }
11725
11726 /// Gets the enum value as a string.
11727 ///
11728 /// Returns `None` if the enum contains an unknown value deserialized from
11729 /// the integer representation of enums.
11730 pub fn name(&self) -> std::option::Option<&str> {
11731 match self {
11732 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
11733 Self::Allow => std::option::Option::Some("ALLOW"),
11734 Self::Deny => std::option::Option::Some("DENY"),
11735 Self::UnknownValue(u) => u.0.name(),
11736 }
11737 }
11738 }
11739
11740 impl std::default::Default for Action {
11741 fn default() -> Self {
11742 use std::convert::From;
11743 Self::from(0)
11744 }
11745 }
11746
11747 impl std::fmt::Display for Action {
11748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11749 wkt::internal::display_enum(f, self.name(), self.value())
11750 }
11751 }
11752
11753 impl std::convert::From<i32> for Action {
11754 fn from(value: i32) -> Self {
11755 match value {
11756 0 => Self::Unspecified,
11757 1 => Self::Allow,
11758 2 => Self::Deny,
11759 _ => Self::UnknownValue(action::UnknownValue(
11760 wkt::internal::UnknownEnumValue::Integer(value),
11761 )),
11762 }
11763 }
11764 }
11765
11766 impl std::convert::From<&str> for Action {
11767 fn from(value: &str) -> Self {
11768 use std::string::ToString;
11769 match value {
11770 "ACTION_UNSPECIFIED" => Self::Unspecified,
11771 "ALLOW" => Self::Allow,
11772 "DENY" => Self::Deny,
11773 _ => Self::UnknownValue(action::UnknownValue(
11774 wkt::internal::UnknownEnumValue::String(value.to_string()),
11775 )),
11776 }
11777 }
11778 }
11779
11780 impl serde::ser::Serialize for Action {
11781 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11782 where
11783 S: serde::Serializer,
11784 {
11785 match self {
11786 Self::Unspecified => serializer.serialize_i32(0),
11787 Self::Allow => serializer.serialize_i32(1),
11788 Self::Deny => serializer.serialize_i32(2),
11789 Self::UnknownValue(u) => u.0.serialize(serializer),
11790 }
11791 }
11792 }
11793
11794 impl<'de> serde::de::Deserialize<'de> for Action {
11795 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11796 where
11797 D: serde::Deserializer<'de>,
11798 {
11799 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
11800 ".google.cloud.vmwareengine.v1.ExternalAccessRule.Action",
11801 ))
11802 }
11803 }
11804
11805 /// Defines possible states of external access firewall rules.
11806 ///
11807 /// # Working with unknown values
11808 ///
11809 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11810 /// additional enum variants at any time. Adding new variants is not considered
11811 /// a breaking change. Applications should write their code in anticipation of:
11812 ///
11813 /// - New values appearing in future releases of the client library, **and**
11814 /// - New values received dynamically, without application changes.
11815 ///
11816 /// Please consult the [Working with enums] section in the user guide for some
11817 /// guidelines.
11818 ///
11819 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11820 #[derive(Clone, Debug, PartialEq)]
11821 #[non_exhaustive]
11822 pub enum State {
11823 /// The default value. This value is used if the state is omitted.
11824 Unspecified,
11825 /// The rule is ready.
11826 Active,
11827 /// The rule is being created.
11828 Creating,
11829 /// The rule is being updated.
11830 Updating,
11831 /// The rule is being deleted.
11832 Deleting,
11833 /// If set, the enum was initialized with an unknown value.
11834 ///
11835 /// Applications can examine the value using [State::value] or
11836 /// [State::name].
11837 UnknownValue(state::UnknownValue),
11838 }
11839
11840 #[doc(hidden)]
11841 pub mod state {
11842 #[allow(unused_imports)]
11843 use super::*;
11844 #[derive(Clone, Debug, PartialEq)]
11845 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11846 }
11847
11848 impl State {
11849 /// Gets the enum value.
11850 ///
11851 /// Returns `None` if the enum contains an unknown value deserialized from
11852 /// the string representation of enums.
11853 pub fn value(&self) -> std::option::Option<i32> {
11854 match self {
11855 Self::Unspecified => std::option::Option::Some(0),
11856 Self::Active => std::option::Option::Some(1),
11857 Self::Creating => std::option::Option::Some(2),
11858 Self::Updating => std::option::Option::Some(3),
11859 Self::Deleting => std::option::Option::Some(4),
11860 Self::UnknownValue(u) => u.0.value(),
11861 }
11862 }
11863
11864 /// Gets the enum value as a string.
11865 ///
11866 /// Returns `None` if the enum contains an unknown value deserialized from
11867 /// the integer representation of enums.
11868 pub fn name(&self) -> std::option::Option<&str> {
11869 match self {
11870 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11871 Self::Active => std::option::Option::Some("ACTIVE"),
11872 Self::Creating => std::option::Option::Some("CREATING"),
11873 Self::Updating => std::option::Option::Some("UPDATING"),
11874 Self::Deleting => std::option::Option::Some("DELETING"),
11875 Self::UnknownValue(u) => u.0.name(),
11876 }
11877 }
11878 }
11879
11880 impl std::default::Default for State {
11881 fn default() -> Self {
11882 use std::convert::From;
11883 Self::from(0)
11884 }
11885 }
11886
11887 impl std::fmt::Display for State {
11888 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11889 wkt::internal::display_enum(f, self.name(), self.value())
11890 }
11891 }
11892
11893 impl std::convert::From<i32> for State {
11894 fn from(value: i32) -> Self {
11895 match value {
11896 0 => Self::Unspecified,
11897 1 => Self::Active,
11898 2 => Self::Creating,
11899 3 => Self::Updating,
11900 4 => Self::Deleting,
11901 _ => Self::UnknownValue(state::UnknownValue(
11902 wkt::internal::UnknownEnumValue::Integer(value),
11903 )),
11904 }
11905 }
11906 }
11907
11908 impl std::convert::From<&str> for State {
11909 fn from(value: &str) -> Self {
11910 use std::string::ToString;
11911 match value {
11912 "STATE_UNSPECIFIED" => Self::Unspecified,
11913 "ACTIVE" => Self::Active,
11914 "CREATING" => Self::Creating,
11915 "UPDATING" => Self::Updating,
11916 "DELETING" => Self::Deleting,
11917 _ => Self::UnknownValue(state::UnknownValue(
11918 wkt::internal::UnknownEnumValue::String(value.to_string()),
11919 )),
11920 }
11921 }
11922 }
11923
11924 impl serde::ser::Serialize for State {
11925 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11926 where
11927 S: serde::Serializer,
11928 {
11929 match self {
11930 Self::Unspecified => serializer.serialize_i32(0),
11931 Self::Active => serializer.serialize_i32(1),
11932 Self::Creating => serializer.serialize_i32(2),
11933 Self::Updating => serializer.serialize_i32(3),
11934 Self::Deleting => serializer.serialize_i32(4),
11935 Self::UnknownValue(u) => u.0.serialize(serializer),
11936 }
11937 }
11938 }
11939
11940 impl<'de> serde::de::Deserialize<'de> for State {
11941 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11942 where
11943 D: serde::Deserializer<'de>,
11944 {
11945 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11946 ".google.cloud.vmwareengine.v1.ExternalAccessRule.State",
11947 ))
11948 }
11949 }
11950}
11951
11952/// Logging server to receive vCenter or ESXi logs.
11953#[derive(Clone, Default, PartialEq)]
11954#[non_exhaustive]
11955pub struct LoggingServer {
11956 /// Output only. The resource name of this logging server.
11957 /// Resource names are schemeless URIs that follow the conventions in
11958 /// <https://cloud.google.com/apis/design/resource_names>.
11959 /// For example:
11960 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
11961 pub name: std::string::String,
11962
11963 /// Output only. Creation time of this resource.
11964 pub create_time: std::option::Option<wkt::Timestamp>,
11965
11966 /// Output only. Last update time of this resource.
11967 pub update_time: std::option::Option<wkt::Timestamp>,
11968
11969 /// Required. Fully-qualified domain name (FQDN) or IP Address of the logging
11970 /// server.
11971 pub hostname: std::string::String,
11972
11973 /// Required. Port number at which the logging server receives logs.
11974 pub port: i32,
11975
11976 /// Required. Protocol used by vCenter to send logs to a logging server.
11977 pub protocol: crate::model::logging_server::Protocol,
11978
11979 /// Required. The type of component that produces logs that will be forwarded
11980 /// to this logging server.
11981 pub source_type: crate::model::logging_server::SourceType,
11982
11983 /// Output only. System-generated unique identifier for the resource.
11984 pub uid: std::string::String,
11985
11986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11987}
11988
11989impl LoggingServer {
11990 pub fn new() -> Self {
11991 std::default::Default::default()
11992 }
11993
11994 /// Sets the value of [name][crate::model::LoggingServer::name].
11995 ///
11996 /// # Example
11997 /// ```ignore,no_run
11998 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
11999 /// let x = LoggingServer::new().set_name("example");
12000 /// ```
12001 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12002 self.name = v.into();
12003 self
12004 }
12005
12006 /// Sets the value of [create_time][crate::model::LoggingServer::create_time].
12007 ///
12008 /// # Example
12009 /// ```ignore,no_run
12010 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12011 /// use wkt::Timestamp;
12012 /// let x = LoggingServer::new().set_create_time(Timestamp::default()/* use setters */);
12013 /// ```
12014 pub fn set_create_time<T>(mut self, v: T) -> Self
12015 where
12016 T: std::convert::Into<wkt::Timestamp>,
12017 {
12018 self.create_time = std::option::Option::Some(v.into());
12019 self
12020 }
12021
12022 /// Sets or clears the value of [create_time][crate::model::LoggingServer::create_time].
12023 ///
12024 /// # Example
12025 /// ```ignore,no_run
12026 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12027 /// use wkt::Timestamp;
12028 /// let x = LoggingServer::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12029 /// let x = LoggingServer::new().set_or_clear_create_time(None::<Timestamp>);
12030 /// ```
12031 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12032 where
12033 T: std::convert::Into<wkt::Timestamp>,
12034 {
12035 self.create_time = v.map(|x| x.into());
12036 self
12037 }
12038
12039 /// Sets the value of [update_time][crate::model::LoggingServer::update_time].
12040 ///
12041 /// # Example
12042 /// ```ignore,no_run
12043 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12044 /// use wkt::Timestamp;
12045 /// let x = LoggingServer::new().set_update_time(Timestamp::default()/* use setters */);
12046 /// ```
12047 pub fn set_update_time<T>(mut self, v: T) -> Self
12048 where
12049 T: std::convert::Into<wkt::Timestamp>,
12050 {
12051 self.update_time = std::option::Option::Some(v.into());
12052 self
12053 }
12054
12055 /// Sets or clears the value of [update_time][crate::model::LoggingServer::update_time].
12056 ///
12057 /// # Example
12058 /// ```ignore,no_run
12059 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12060 /// use wkt::Timestamp;
12061 /// let x = LoggingServer::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12062 /// let x = LoggingServer::new().set_or_clear_update_time(None::<Timestamp>);
12063 /// ```
12064 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12065 where
12066 T: std::convert::Into<wkt::Timestamp>,
12067 {
12068 self.update_time = v.map(|x| x.into());
12069 self
12070 }
12071
12072 /// Sets the value of [hostname][crate::model::LoggingServer::hostname].
12073 ///
12074 /// # Example
12075 /// ```ignore,no_run
12076 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12077 /// let x = LoggingServer::new().set_hostname("example");
12078 /// ```
12079 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12080 self.hostname = v.into();
12081 self
12082 }
12083
12084 /// Sets the value of [port][crate::model::LoggingServer::port].
12085 ///
12086 /// # Example
12087 /// ```ignore,no_run
12088 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12089 /// let x = LoggingServer::new().set_port(42);
12090 /// ```
12091 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12092 self.port = v.into();
12093 self
12094 }
12095
12096 /// Sets the value of [protocol][crate::model::LoggingServer::protocol].
12097 ///
12098 /// # Example
12099 /// ```ignore,no_run
12100 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12101 /// use google_cloud_vmwareengine_v1::model::logging_server::Protocol;
12102 /// let x0 = LoggingServer::new().set_protocol(Protocol::Udp);
12103 /// let x1 = LoggingServer::new().set_protocol(Protocol::Tcp);
12104 /// let x2 = LoggingServer::new().set_protocol(Protocol::Tls);
12105 /// ```
12106 pub fn set_protocol<T: std::convert::Into<crate::model::logging_server::Protocol>>(
12107 mut self,
12108 v: T,
12109 ) -> Self {
12110 self.protocol = v.into();
12111 self
12112 }
12113
12114 /// Sets the value of [source_type][crate::model::LoggingServer::source_type].
12115 ///
12116 /// # Example
12117 /// ```ignore,no_run
12118 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12119 /// use google_cloud_vmwareengine_v1::model::logging_server::SourceType;
12120 /// let x0 = LoggingServer::new().set_source_type(SourceType::Esxi);
12121 /// let x1 = LoggingServer::new().set_source_type(SourceType::Vcsa);
12122 /// ```
12123 pub fn set_source_type<T: std::convert::Into<crate::model::logging_server::SourceType>>(
12124 mut self,
12125 v: T,
12126 ) -> Self {
12127 self.source_type = v.into();
12128 self
12129 }
12130
12131 /// Sets the value of [uid][crate::model::LoggingServer::uid].
12132 ///
12133 /// # Example
12134 /// ```ignore,no_run
12135 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12136 /// let x = LoggingServer::new().set_uid("example");
12137 /// ```
12138 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12139 self.uid = v.into();
12140 self
12141 }
12142}
12143
12144impl wkt::message::Message for LoggingServer {
12145 fn typename() -> &'static str {
12146 "type.googleapis.com/google.cloud.vmwareengine.v1.LoggingServer"
12147 }
12148}
12149
12150/// Defines additional types related to [LoggingServer].
12151pub mod logging_server {
12152 #[allow(unused_imports)]
12153 use super::*;
12154
12155 /// Defines possible protocols used to send logs to
12156 /// a logging server.
12157 ///
12158 /// # Working with unknown values
12159 ///
12160 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12161 /// additional enum variants at any time. Adding new variants is not considered
12162 /// a breaking change. Applications should write their code in anticipation of:
12163 ///
12164 /// - New values appearing in future releases of the client library, **and**
12165 /// - New values received dynamically, without application changes.
12166 ///
12167 /// Please consult the [Working with enums] section in the user guide for some
12168 /// guidelines.
12169 ///
12170 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12171 #[derive(Clone, Debug, PartialEq)]
12172 #[non_exhaustive]
12173 pub enum Protocol {
12174 /// Unspecified communications protocol. This is the default value.
12175 Unspecified,
12176 /// UDP
12177 Udp,
12178 /// TCP
12179 Tcp,
12180 /// TLS
12181 Tls,
12182 /// SSL
12183 Ssl,
12184 /// RELP
12185 Relp,
12186 /// If set, the enum was initialized with an unknown value.
12187 ///
12188 /// Applications can examine the value using [Protocol::value] or
12189 /// [Protocol::name].
12190 UnknownValue(protocol::UnknownValue),
12191 }
12192
12193 #[doc(hidden)]
12194 pub mod protocol {
12195 #[allow(unused_imports)]
12196 use super::*;
12197 #[derive(Clone, Debug, PartialEq)]
12198 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12199 }
12200
12201 impl Protocol {
12202 /// Gets the enum value.
12203 ///
12204 /// Returns `None` if the enum contains an unknown value deserialized from
12205 /// the string representation of enums.
12206 pub fn value(&self) -> std::option::Option<i32> {
12207 match self {
12208 Self::Unspecified => std::option::Option::Some(0),
12209 Self::Udp => std::option::Option::Some(1),
12210 Self::Tcp => std::option::Option::Some(2),
12211 Self::Tls => std::option::Option::Some(3),
12212 Self::Ssl => std::option::Option::Some(4),
12213 Self::Relp => std::option::Option::Some(5),
12214 Self::UnknownValue(u) => u.0.value(),
12215 }
12216 }
12217
12218 /// Gets the enum value as a string.
12219 ///
12220 /// Returns `None` if the enum contains an unknown value deserialized from
12221 /// the integer representation of enums.
12222 pub fn name(&self) -> std::option::Option<&str> {
12223 match self {
12224 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
12225 Self::Udp => std::option::Option::Some("UDP"),
12226 Self::Tcp => std::option::Option::Some("TCP"),
12227 Self::Tls => std::option::Option::Some("TLS"),
12228 Self::Ssl => std::option::Option::Some("SSL"),
12229 Self::Relp => std::option::Option::Some("RELP"),
12230 Self::UnknownValue(u) => u.0.name(),
12231 }
12232 }
12233 }
12234
12235 impl std::default::Default for Protocol {
12236 fn default() -> Self {
12237 use std::convert::From;
12238 Self::from(0)
12239 }
12240 }
12241
12242 impl std::fmt::Display for Protocol {
12243 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12244 wkt::internal::display_enum(f, self.name(), self.value())
12245 }
12246 }
12247
12248 impl std::convert::From<i32> for Protocol {
12249 fn from(value: i32) -> Self {
12250 match value {
12251 0 => Self::Unspecified,
12252 1 => Self::Udp,
12253 2 => Self::Tcp,
12254 3 => Self::Tls,
12255 4 => Self::Ssl,
12256 5 => Self::Relp,
12257 _ => Self::UnknownValue(protocol::UnknownValue(
12258 wkt::internal::UnknownEnumValue::Integer(value),
12259 )),
12260 }
12261 }
12262 }
12263
12264 impl std::convert::From<&str> for Protocol {
12265 fn from(value: &str) -> Self {
12266 use std::string::ToString;
12267 match value {
12268 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
12269 "UDP" => Self::Udp,
12270 "TCP" => Self::Tcp,
12271 "TLS" => Self::Tls,
12272 "SSL" => Self::Ssl,
12273 "RELP" => Self::Relp,
12274 _ => Self::UnknownValue(protocol::UnknownValue(
12275 wkt::internal::UnknownEnumValue::String(value.to_string()),
12276 )),
12277 }
12278 }
12279 }
12280
12281 impl serde::ser::Serialize for Protocol {
12282 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12283 where
12284 S: serde::Serializer,
12285 {
12286 match self {
12287 Self::Unspecified => serializer.serialize_i32(0),
12288 Self::Udp => serializer.serialize_i32(1),
12289 Self::Tcp => serializer.serialize_i32(2),
12290 Self::Tls => serializer.serialize_i32(3),
12291 Self::Ssl => serializer.serialize_i32(4),
12292 Self::Relp => serializer.serialize_i32(5),
12293 Self::UnknownValue(u) => u.0.serialize(serializer),
12294 }
12295 }
12296 }
12297
12298 impl<'de> serde::de::Deserialize<'de> for Protocol {
12299 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12300 where
12301 D: serde::Deserializer<'de>,
12302 {
12303 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
12304 ".google.cloud.vmwareengine.v1.LoggingServer.Protocol",
12305 ))
12306 }
12307 }
12308
12309 /// Defines possible types of component that produces logs.
12310 ///
12311 /// # Working with unknown values
12312 ///
12313 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12314 /// additional enum variants at any time. Adding new variants is not considered
12315 /// a breaking change. Applications should write their code in anticipation of:
12316 ///
12317 /// - New values appearing in future releases of the client library, **and**
12318 /// - New values received dynamically, without application changes.
12319 ///
12320 /// Please consult the [Working with enums] section in the user guide for some
12321 /// guidelines.
12322 ///
12323 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12324 #[derive(Clone, Debug, PartialEq)]
12325 #[non_exhaustive]
12326 pub enum SourceType {
12327 /// The default value. This value should never be used.
12328 Unspecified,
12329 /// Logs produced by ESXI hosts
12330 Esxi,
12331 /// Logs produced by vCenter server
12332 Vcsa,
12333 /// If set, the enum was initialized with an unknown value.
12334 ///
12335 /// Applications can examine the value using [SourceType::value] or
12336 /// [SourceType::name].
12337 UnknownValue(source_type::UnknownValue),
12338 }
12339
12340 #[doc(hidden)]
12341 pub mod source_type {
12342 #[allow(unused_imports)]
12343 use super::*;
12344 #[derive(Clone, Debug, PartialEq)]
12345 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12346 }
12347
12348 impl SourceType {
12349 /// Gets the enum value.
12350 ///
12351 /// Returns `None` if the enum contains an unknown value deserialized from
12352 /// the string representation of enums.
12353 pub fn value(&self) -> std::option::Option<i32> {
12354 match self {
12355 Self::Unspecified => std::option::Option::Some(0),
12356 Self::Esxi => std::option::Option::Some(1),
12357 Self::Vcsa => std::option::Option::Some(2),
12358 Self::UnknownValue(u) => u.0.value(),
12359 }
12360 }
12361
12362 /// Gets the enum value as a string.
12363 ///
12364 /// Returns `None` if the enum contains an unknown value deserialized from
12365 /// the integer representation of enums.
12366 pub fn name(&self) -> std::option::Option<&str> {
12367 match self {
12368 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12369 Self::Esxi => std::option::Option::Some("ESXI"),
12370 Self::Vcsa => std::option::Option::Some("VCSA"),
12371 Self::UnknownValue(u) => u.0.name(),
12372 }
12373 }
12374 }
12375
12376 impl std::default::Default for SourceType {
12377 fn default() -> Self {
12378 use std::convert::From;
12379 Self::from(0)
12380 }
12381 }
12382
12383 impl std::fmt::Display for SourceType {
12384 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12385 wkt::internal::display_enum(f, self.name(), self.value())
12386 }
12387 }
12388
12389 impl std::convert::From<i32> for SourceType {
12390 fn from(value: i32) -> Self {
12391 match value {
12392 0 => Self::Unspecified,
12393 1 => Self::Esxi,
12394 2 => Self::Vcsa,
12395 _ => Self::UnknownValue(source_type::UnknownValue(
12396 wkt::internal::UnknownEnumValue::Integer(value),
12397 )),
12398 }
12399 }
12400 }
12401
12402 impl std::convert::From<&str> for SourceType {
12403 fn from(value: &str) -> Self {
12404 use std::string::ToString;
12405 match value {
12406 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12407 "ESXI" => Self::Esxi,
12408 "VCSA" => Self::Vcsa,
12409 _ => Self::UnknownValue(source_type::UnknownValue(
12410 wkt::internal::UnknownEnumValue::String(value.to_string()),
12411 )),
12412 }
12413 }
12414 }
12415
12416 impl serde::ser::Serialize for SourceType {
12417 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12418 where
12419 S: serde::Serializer,
12420 {
12421 match self {
12422 Self::Unspecified => serializer.serialize_i32(0),
12423 Self::Esxi => serializer.serialize_i32(1),
12424 Self::Vcsa => serializer.serialize_i32(2),
12425 Self::UnknownValue(u) => u.0.serialize(serializer),
12426 }
12427 }
12428 }
12429
12430 impl<'de> serde::de::Deserialize<'de> for SourceType {
12431 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12432 where
12433 D: serde::Deserializer<'de>,
12434 {
12435 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12436 ".google.cloud.vmwareengine.v1.LoggingServer.SourceType",
12437 ))
12438 }
12439 }
12440}
12441
12442/// Describes node type.
12443#[derive(Clone, Default, PartialEq)]
12444#[non_exhaustive]
12445pub struct NodeType {
12446 /// Output only. The resource name of this node type.
12447 /// Resource names are schemeless URIs that follow the conventions in
12448 /// <https://cloud.google.com/apis/design/resource_names>.
12449 /// For example:
12450 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
12451 pub name: std::string::String,
12452
12453 /// Output only. The canonical identifier of the node type
12454 /// (corresponds to the `NodeType`). For example: standard-72.
12455 pub node_type_id: std::string::String,
12456
12457 /// Output only. The friendly name for this node type.
12458 /// For example: ve1-standard-72
12459 pub display_name: std::string::String,
12460
12461 /// Output only. The total number of virtual CPUs in a single node.
12462 pub virtual_cpu_count: i32,
12463
12464 /// Output only. The total number of CPU cores in a single node.
12465 pub total_core_count: i32,
12466
12467 /// Output only. The amount of physical memory available, defined in GB.
12468 pub memory_gb: i32,
12469
12470 /// Output only. The amount of storage available, defined in GB.
12471 pub disk_size_gb: i32,
12472
12473 /// Output only. List of possible values of custom core count.
12474 pub available_custom_core_counts: std::vec::Vec<i32>,
12475
12476 /// Output only. The type of the resource.
12477 pub kind: crate::model::node_type::Kind,
12478
12479 /// Output only. Families of the node type.
12480 /// For node types to be in the same cluster
12481 /// they must share at least one element in the `families`.
12482 pub families: std::vec::Vec<std::string::String>,
12483
12484 /// Output only. Capabilities of this node type.
12485 pub capabilities: std::vec::Vec<crate::model::node_type::Capability>,
12486
12487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12488}
12489
12490impl NodeType {
12491 pub fn new() -> Self {
12492 std::default::Default::default()
12493 }
12494
12495 /// Sets the value of [name][crate::model::NodeType::name].
12496 ///
12497 /// # Example
12498 /// ```ignore,no_run
12499 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12500 /// let x = NodeType::new().set_name("example");
12501 /// ```
12502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12503 self.name = v.into();
12504 self
12505 }
12506
12507 /// Sets the value of [node_type_id][crate::model::NodeType::node_type_id].
12508 ///
12509 /// # Example
12510 /// ```ignore,no_run
12511 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12512 /// let x = NodeType::new().set_node_type_id("example");
12513 /// ```
12514 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12515 self.node_type_id = v.into();
12516 self
12517 }
12518
12519 /// Sets the value of [display_name][crate::model::NodeType::display_name].
12520 ///
12521 /// # Example
12522 /// ```ignore,no_run
12523 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12524 /// let x = NodeType::new().set_display_name("example");
12525 /// ```
12526 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12527 self.display_name = v.into();
12528 self
12529 }
12530
12531 /// Sets the value of [virtual_cpu_count][crate::model::NodeType::virtual_cpu_count].
12532 ///
12533 /// # Example
12534 /// ```ignore,no_run
12535 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12536 /// let x = NodeType::new().set_virtual_cpu_count(42);
12537 /// ```
12538 pub fn set_virtual_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12539 self.virtual_cpu_count = v.into();
12540 self
12541 }
12542
12543 /// Sets the value of [total_core_count][crate::model::NodeType::total_core_count].
12544 ///
12545 /// # Example
12546 /// ```ignore,no_run
12547 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12548 /// let x = NodeType::new().set_total_core_count(42);
12549 /// ```
12550 pub fn set_total_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12551 self.total_core_count = v.into();
12552 self
12553 }
12554
12555 /// Sets the value of [memory_gb][crate::model::NodeType::memory_gb].
12556 ///
12557 /// # Example
12558 /// ```ignore,no_run
12559 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12560 /// let x = NodeType::new().set_memory_gb(42);
12561 /// ```
12562 pub fn set_memory_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12563 self.memory_gb = v.into();
12564 self
12565 }
12566
12567 /// Sets the value of [disk_size_gb][crate::model::NodeType::disk_size_gb].
12568 ///
12569 /// # Example
12570 /// ```ignore,no_run
12571 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12572 /// let x = NodeType::new().set_disk_size_gb(42);
12573 /// ```
12574 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12575 self.disk_size_gb = v.into();
12576 self
12577 }
12578
12579 /// Sets the value of [available_custom_core_counts][crate::model::NodeType::available_custom_core_counts].
12580 ///
12581 /// # Example
12582 /// ```ignore,no_run
12583 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12584 /// let x = NodeType::new().set_available_custom_core_counts([1, 2, 3]);
12585 /// ```
12586 pub fn set_available_custom_core_counts<T, V>(mut self, v: T) -> Self
12587 where
12588 T: std::iter::IntoIterator<Item = V>,
12589 V: std::convert::Into<i32>,
12590 {
12591 use std::iter::Iterator;
12592 self.available_custom_core_counts = v.into_iter().map(|i| i.into()).collect();
12593 self
12594 }
12595
12596 /// Sets the value of [kind][crate::model::NodeType::kind].
12597 ///
12598 /// # Example
12599 /// ```ignore,no_run
12600 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12601 /// use google_cloud_vmwareengine_v1::model::node_type::Kind;
12602 /// let x0 = NodeType::new().set_kind(Kind::Standard);
12603 /// let x1 = NodeType::new().set_kind(Kind::StorageOnly);
12604 /// ```
12605 pub fn set_kind<T: std::convert::Into<crate::model::node_type::Kind>>(mut self, v: T) -> Self {
12606 self.kind = v.into();
12607 self
12608 }
12609
12610 /// Sets the value of [families][crate::model::NodeType::families].
12611 ///
12612 /// # Example
12613 /// ```ignore,no_run
12614 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12615 /// let x = NodeType::new().set_families(["a", "b", "c"]);
12616 /// ```
12617 pub fn set_families<T, V>(mut self, v: T) -> Self
12618 where
12619 T: std::iter::IntoIterator<Item = V>,
12620 V: std::convert::Into<std::string::String>,
12621 {
12622 use std::iter::Iterator;
12623 self.families = v.into_iter().map(|i| i.into()).collect();
12624 self
12625 }
12626
12627 /// Sets the value of [capabilities][crate::model::NodeType::capabilities].
12628 ///
12629 /// # Example
12630 /// ```ignore,no_run
12631 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12632 /// use google_cloud_vmwareengine_v1::model::node_type::Capability;
12633 /// let x = NodeType::new().set_capabilities([
12634 /// Capability::StretchedClusters,
12635 /// ]);
12636 /// ```
12637 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
12638 where
12639 T: std::iter::IntoIterator<Item = V>,
12640 V: std::convert::Into<crate::model::node_type::Capability>,
12641 {
12642 use std::iter::Iterator;
12643 self.capabilities = v.into_iter().map(|i| i.into()).collect();
12644 self
12645 }
12646}
12647
12648impl wkt::message::Message for NodeType {
12649 fn typename() -> &'static str {
12650 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeType"
12651 }
12652}
12653
12654/// Defines additional types related to [NodeType].
12655pub mod node_type {
12656 #[allow(unused_imports)]
12657 use super::*;
12658
12659 /// Enum Kind defines possible types of a NodeType.
12660 ///
12661 /// # Working with unknown values
12662 ///
12663 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12664 /// additional enum variants at any time. Adding new variants is not considered
12665 /// a breaking change. Applications should write their code in anticipation of:
12666 ///
12667 /// - New values appearing in future releases of the client library, **and**
12668 /// - New values received dynamically, without application changes.
12669 ///
12670 /// Please consult the [Working with enums] section in the user guide for some
12671 /// guidelines.
12672 ///
12673 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12674 #[derive(Clone, Debug, PartialEq)]
12675 #[non_exhaustive]
12676 pub enum Kind {
12677 /// The default value. This value should never be used.
12678 Unspecified,
12679 /// Standard HCI node.
12680 Standard,
12681 /// Storage only Node.
12682 StorageOnly,
12683 /// If set, the enum was initialized with an unknown value.
12684 ///
12685 /// Applications can examine the value using [Kind::value] or
12686 /// [Kind::name].
12687 UnknownValue(kind::UnknownValue),
12688 }
12689
12690 #[doc(hidden)]
12691 pub mod kind {
12692 #[allow(unused_imports)]
12693 use super::*;
12694 #[derive(Clone, Debug, PartialEq)]
12695 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12696 }
12697
12698 impl Kind {
12699 /// Gets the enum value.
12700 ///
12701 /// Returns `None` if the enum contains an unknown value deserialized from
12702 /// the string representation of enums.
12703 pub fn value(&self) -> std::option::Option<i32> {
12704 match self {
12705 Self::Unspecified => std::option::Option::Some(0),
12706 Self::Standard => std::option::Option::Some(1),
12707 Self::StorageOnly => std::option::Option::Some(2),
12708 Self::UnknownValue(u) => u.0.value(),
12709 }
12710 }
12711
12712 /// Gets the enum value as a string.
12713 ///
12714 /// Returns `None` if the enum contains an unknown value deserialized from
12715 /// the integer representation of enums.
12716 pub fn name(&self) -> std::option::Option<&str> {
12717 match self {
12718 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
12719 Self::Standard => std::option::Option::Some("STANDARD"),
12720 Self::StorageOnly => std::option::Option::Some("STORAGE_ONLY"),
12721 Self::UnknownValue(u) => u.0.name(),
12722 }
12723 }
12724 }
12725
12726 impl std::default::Default for Kind {
12727 fn default() -> Self {
12728 use std::convert::From;
12729 Self::from(0)
12730 }
12731 }
12732
12733 impl std::fmt::Display for Kind {
12734 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12735 wkt::internal::display_enum(f, self.name(), self.value())
12736 }
12737 }
12738
12739 impl std::convert::From<i32> for Kind {
12740 fn from(value: i32) -> Self {
12741 match value {
12742 0 => Self::Unspecified,
12743 1 => Self::Standard,
12744 2 => Self::StorageOnly,
12745 _ => Self::UnknownValue(kind::UnknownValue(
12746 wkt::internal::UnknownEnumValue::Integer(value),
12747 )),
12748 }
12749 }
12750 }
12751
12752 impl std::convert::From<&str> for Kind {
12753 fn from(value: &str) -> Self {
12754 use std::string::ToString;
12755 match value {
12756 "KIND_UNSPECIFIED" => Self::Unspecified,
12757 "STANDARD" => Self::Standard,
12758 "STORAGE_ONLY" => Self::StorageOnly,
12759 _ => Self::UnknownValue(kind::UnknownValue(
12760 wkt::internal::UnknownEnumValue::String(value.to_string()),
12761 )),
12762 }
12763 }
12764 }
12765
12766 impl serde::ser::Serialize for Kind {
12767 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12768 where
12769 S: serde::Serializer,
12770 {
12771 match self {
12772 Self::Unspecified => serializer.serialize_i32(0),
12773 Self::Standard => serializer.serialize_i32(1),
12774 Self::StorageOnly => serializer.serialize_i32(2),
12775 Self::UnknownValue(u) => u.0.serialize(serializer),
12776 }
12777 }
12778 }
12779
12780 impl<'de> serde::de::Deserialize<'de> for Kind {
12781 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12782 where
12783 D: serde::Deserializer<'de>,
12784 {
12785 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
12786 ".google.cloud.vmwareengine.v1.NodeType.Kind",
12787 ))
12788 }
12789 }
12790
12791 /// Capability of a node type.
12792 ///
12793 /// # Working with unknown values
12794 ///
12795 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12796 /// additional enum variants at any time. Adding new variants is not considered
12797 /// a breaking change. Applications should write their code in anticipation of:
12798 ///
12799 /// - New values appearing in future releases of the client library, **and**
12800 /// - New values received dynamically, without application changes.
12801 ///
12802 /// Please consult the [Working with enums] section in the user guide for some
12803 /// guidelines.
12804 ///
12805 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12806 #[derive(Clone, Debug, PartialEq)]
12807 #[non_exhaustive]
12808 pub enum Capability {
12809 /// The default value. This value is used if the capability is omitted or
12810 /// unknown.
12811 Unspecified,
12812 /// This node type supports stretch clusters.
12813 StretchedClusters,
12814 /// If set, the enum was initialized with an unknown value.
12815 ///
12816 /// Applications can examine the value using [Capability::value] or
12817 /// [Capability::name].
12818 UnknownValue(capability::UnknownValue),
12819 }
12820
12821 #[doc(hidden)]
12822 pub mod capability {
12823 #[allow(unused_imports)]
12824 use super::*;
12825 #[derive(Clone, Debug, PartialEq)]
12826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12827 }
12828
12829 impl Capability {
12830 /// Gets the enum value.
12831 ///
12832 /// Returns `None` if the enum contains an unknown value deserialized from
12833 /// the string representation of enums.
12834 pub fn value(&self) -> std::option::Option<i32> {
12835 match self {
12836 Self::Unspecified => std::option::Option::Some(0),
12837 Self::StretchedClusters => std::option::Option::Some(1),
12838 Self::UnknownValue(u) => u.0.value(),
12839 }
12840 }
12841
12842 /// Gets the enum value as a string.
12843 ///
12844 /// Returns `None` if the enum contains an unknown value deserialized from
12845 /// the integer representation of enums.
12846 pub fn name(&self) -> std::option::Option<&str> {
12847 match self {
12848 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
12849 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
12850 Self::UnknownValue(u) => u.0.name(),
12851 }
12852 }
12853 }
12854
12855 impl std::default::Default for Capability {
12856 fn default() -> Self {
12857 use std::convert::From;
12858 Self::from(0)
12859 }
12860 }
12861
12862 impl std::fmt::Display for Capability {
12863 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12864 wkt::internal::display_enum(f, self.name(), self.value())
12865 }
12866 }
12867
12868 impl std::convert::From<i32> for Capability {
12869 fn from(value: i32) -> Self {
12870 match value {
12871 0 => Self::Unspecified,
12872 1 => Self::StretchedClusters,
12873 _ => Self::UnknownValue(capability::UnknownValue(
12874 wkt::internal::UnknownEnumValue::Integer(value),
12875 )),
12876 }
12877 }
12878 }
12879
12880 impl std::convert::From<&str> for Capability {
12881 fn from(value: &str) -> Self {
12882 use std::string::ToString;
12883 match value {
12884 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
12885 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
12886 _ => Self::UnknownValue(capability::UnknownValue(
12887 wkt::internal::UnknownEnumValue::String(value.to_string()),
12888 )),
12889 }
12890 }
12891 }
12892
12893 impl serde::ser::Serialize for Capability {
12894 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12895 where
12896 S: serde::Serializer,
12897 {
12898 match self {
12899 Self::Unspecified => serializer.serialize_i32(0),
12900 Self::StretchedClusters => serializer.serialize_i32(1),
12901 Self::UnknownValue(u) => u.0.serialize(serializer),
12902 }
12903 }
12904 }
12905
12906 impl<'de> serde::de::Deserialize<'de> for Capability {
12907 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12908 where
12909 D: serde::Deserializer<'de>,
12910 {
12911 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
12912 ".google.cloud.vmwareengine.v1.NodeType.Capability",
12913 ))
12914 }
12915 }
12916}
12917
12918/// Credentials for a private cloud.
12919#[derive(Clone, Default, PartialEq)]
12920#[non_exhaustive]
12921pub struct Credentials {
12922 /// Initial username.
12923 pub username: std::string::String,
12924
12925 /// Initial password.
12926 pub password: std::string::String,
12927
12928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12929}
12930
12931impl Credentials {
12932 pub fn new() -> Self {
12933 std::default::Default::default()
12934 }
12935
12936 /// Sets the value of [username][crate::model::Credentials::username].
12937 ///
12938 /// # Example
12939 /// ```ignore,no_run
12940 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12941 /// let x = Credentials::new().set_username("example");
12942 /// ```
12943 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12944 self.username = v.into();
12945 self
12946 }
12947
12948 /// Sets the value of [password][crate::model::Credentials::password].
12949 ///
12950 /// # Example
12951 /// ```ignore,no_run
12952 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12953 /// let x = Credentials::new().set_password("example");
12954 /// ```
12955 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12956 self.password = v.into();
12957 self
12958 }
12959}
12960
12961impl wkt::message::Message for Credentials {
12962 fn typename() -> &'static str {
12963 "type.googleapis.com/google.cloud.vmwareengine.v1.Credentials"
12964 }
12965}
12966
12967/// HCX activation key. A default key is created during
12968/// private cloud provisioning, but this behavior is subject to change
12969/// and you should always verify active keys.
12970/// Use
12971/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
12972/// to retrieve existing keys and
12973/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
12974/// to create new ones.
12975///
12976/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
12977/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
12978#[derive(Clone, Default, PartialEq)]
12979#[non_exhaustive]
12980pub struct HcxActivationKey {
12981 /// Output only. The resource name of this HcxActivationKey.
12982 /// Resource names are schemeless URIs that follow the conventions in
12983 /// <https://cloud.google.com/apis/design/resource_names>.
12984 /// For example:
12985 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
12986 pub name: std::string::String,
12987
12988 /// Output only. Creation time of HCX activation key.
12989 pub create_time: std::option::Option<wkt::Timestamp>,
12990
12991 /// Output only. State of HCX activation key.
12992 pub state: crate::model::hcx_activation_key::State,
12993
12994 /// Output only. HCX activation key.
12995 pub activation_key: std::string::String,
12996
12997 /// Output only. System-generated unique identifier for the resource.
12998 pub uid: std::string::String,
12999
13000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13001}
13002
13003impl HcxActivationKey {
13004 pub fn new() -> Self {
13005 std::default::Default::default()
13006 }
13007
13008 /// Sets the value of [name][crate::model::HcxActivationKey::name].
13009 ///
13010 /// # Example
13011 /// ```ignore,no_run
13012 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13013 /// let x = HcxActivationKey::new().set_name("example");
13014 /// ```
13015 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13016 self.name = v.into();
13017 self
13018 }
13019
13020 /// Sets the value of [create_time][crate::model::HcxActivationKey::create_time].
13021 ///
13022 /// # Example
13023 /// ```ignore,no_run
13024 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13025 /// use wkt::Timestamp;
13026 /// let x = HcxActivationKey::new().set_create_time(Timestamp::default()/* use setters */);
13027 /// ```
13028 pub fn set_create_time<T>(mut self, v: T) -> Self
13029 where
13030 T: std::convert::Into<wkt::Timestamp>,
13031 {
13032 self.create_time = std::option::Option::Some(v.into());
13033 self
13034 }
13035
13036 /// Sets or clears the value of [create_time][crate::model::HcxActivationKey::create_time].
13037 ///
13038 /// # Example
13039 /// ```ignore,no_run
13040 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13041 /// use wkt::Timestamp;
13042 /// let x = HcxActivationKey::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13043 /// let x = HcxActivationKey::new().set_or_clear_create_time(None::<Timestamp>);
13044 /// ```
13045 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13046 where
13047 T: std::convert::Into<wkt::Timestamp>,
13048 {
13049 self.create_time = v.map(|x| x.into());
13050 self
13051 }
13052
13053 /// Sets the value of [state][crate::model::HcxActivationKey::state].
13054 ///
13055 /// # Example
13056 /// ```ignore,no_run
13057 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13058 /// use google_cloud_vmwareengine_v1::model::hcx_activation_key::State;
13059 /// let x0 = HcxActivationKey::new().set_state(State::Available);
13060 /// let x1 = HcxActivationKey::new().set_state(State::Consumed);
13061 /// let x2 = HcxActivationKey::new().set_state(State::Creating);
13062 /// ```
13063 pub fn set_state<T: std::convert::Into<crate::model::hcx_activation_key::State>>(
13064 mut self,
13065 v: T,
13066 ) -> Self {
13067 self.state = v.into();
13068 self
13069 }
13070
13071 /// Sets the value of [activation_key][crate::model::HcxActivationKey::activation_key].
13072 ///
13073 /// # Example
13074 /// ```ignore,no_run
13075 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13076 /// let x = HcxActivationKey::new().set_activation_key("example");
13077 /// ```
13078 pub fn set_activation_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13079 self.activation_key = v.into();
13080 self
13081 }
13082
13083 /// Sets the value of [uid][crate::model::HcxActivationKey::uid].
13084 ///
13085 /// # Example
13086 /// ```ignore,no_run
13087 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13088 /// let x = HcxActivationKey::new().set_uid("example");
13089 /// ```
13090 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13091 self.uid = v.into();
13092 self
13093 }
13094}
13095
13096impl wkt::message::Message for HcxActivationKey {
13097 fn typename() -> &'static str {
13098 "type.googleapis.com/google.cloud.vmwareengine.v1.HcxActivationKey"
13099 }
13100}
13101
13102/// Defines additional types related to [HcxActivationKey].
13103pub mod hcx_activation_key {
13104 #[allow(unused_imports)]
13105 use super::*;
13106
13107 /// State of HCX activation key
13108 ///
13109 /// # Working with unknown values
13110 ///
13111 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13112 /// additional enum variants at any time. Adding new variants is not considered
13113 /// a breaking change. Applications should write their code in anticipation of:
13114 ///
13115 /// - New values appearing in future releases of the client library, **and**
13116 /// - New values received dynamically, without application changes.
13117 ///
13118 /// Please consult the [Working with enums] section in the user guide for some
13119 /// guidelines.
13120 ///
13121 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13122 #[derive(Clone, Debug, PartialEq)]
13123 #[non_exhaustive]
13124 pub enum State {
13125 /// Unspecified state.
13126 Unspecified,
13127 /// State of a newly generated activation key.
13128 Available,
13129 /// State of key when it has been used to activate HCX appliance.
13130 Consumed,
13131 /// State of key when it is being created.
13132 Creating,
13133 /// If set, the enum was initialized with an unknown value.
13134 ///
13135 /// Applications can examine the value using [State::value] or
13136 /// [State::name].
13137 UnknownValue(state::UnknownValue),
13138 }
13139
13140 #[doc(hidden)]
13141 pub mod state {
13142 #[allow(unused_imports)]
13143 use super::*;
13144 #[derive(Clone, Debug, PartialEq)]
13145 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13146 }
13147
13148 impl State {
13149 /// Gets the enum value.
13150 ///
13151 /// Returns `None` if the enum contains an unknown value deserialized from
13152 /// the string representation of enums.
13153 pub fn value(&self) -> std::option::Option<i32> {
13154 match self {
13155 Self::Unspecified => std::option::Option::Some(0),
13156 Self::Available => std::option::Option::Some(1),
13157 Self::Consumed => std::option::Option::Some(2),
13158 Self::Creating => std::option::Option::Some(3),
13159 Self::UnknownValue(u) => u.0.value(),
13160 }
13161 }
13162
13163 /// Gets the enum value as a string.
13164 ///
13165 /// Returns `None` if the enum contains an unknown value deserialized from
13166 /// the integer representation of enums.
13167 pub fn name(&self) -> std::option::Option<&str> {
13168 match self {
13169 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13170 Self::Available => std::option::Option::Some("AVAILABLE"),
13171 Self::Consumed => std::option::Option::Some("CONSUMED"),
13172 Self::Creating => std::option::Option::Some("CREATING"),
13173 Self::UnknownValue(u) => u.0.name(),
13174 }
13175 }
13176 }
13177
13178 impl std::default::Default for State {
13179 fn default() -> Self {
13180 use std::convert::From;
13181 Self::from(0)
13182 }
13183 }
13184
13185 impl std::fmt::Display for State {
13186 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13187 wkt::internal::display_enum(f, self.name(), self.value())
13188 }
13189 }
13190
13191 impl std::convert::From<i32> for State {
13192 fn from(value: i32) -> Self {
13193 match value {
13194 0 => Self::Unspecified,
13195 1 => Self::Available,
13196 2 => Self::Consumed,
13197 3 => Self::Creating,
13198 _ => Self::UnknownValue(state::UnknownValue(
13199 wkt::internal::UnknownEnumValue::Integer(value),
13200 )),
13201 }
13202 }
13203 }
13204
13205 impl std::convert::From<&str> for State {
13206 fn from(value: &str) -> Self {
13207 use std::string::ToString;
13208 match value {
13209 "STATE_UNSPECIFIED" => Self::Unspecified,
13210 "AVAILABLE" => Self::Available,
13211 "CONSUMED" => Self::Consumed,
13212 "CREATING" => Self::Creating,
13213 _ => Self::UnknownValue(state::UnknownValue(
13214 wkt::internal::UnknownEnumValue::String(value.to_string()),
13215 )),
13216 }
13217 }
13218 }
13219
13220 impl serde::ser::Serialize for State {
13221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13222 where
13223 S: serde::Serializer,
13224 {
13225 match self {
13226 Self::Unspecified => serializer.serialize_i32(0),
13227 Self::Available => serializer.serialize_i32(1),
13228 Self::Consumed => serializer.serialize_i32(2),
13229 Self::Creating => serializer.serialize_i32(3),
13230 Self::UnknownValue(u) => u.0.serialize(serializer),
13231 }
13232 }
13233 }
13234
13235 impl<'de> serde::de::Deserialize<'de> for State {
13236 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13237 where
13238 D: serde::Deserializer<'de>,
13239 {
13240 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13241 ".google.cloud.vmwareengine.v1.HcxActivationKey.State",
13242 ))
13243 }
13244 }
13245}
13246
13247/// Details about a HCX Cloud Manager appliance.
13248#[derive(Clone, Default, PartialEq)]
13249#[non_exhaustive]
13250pub struct Hcx {
13251 /// Internal IP address of the appliance.
13252 pub internal_ip: std::string::String,
13253
13254 /// Version of the appliance.
13255 pub version: std::string::String,
13256
13257 /// Output only. The state of the appliance.
13258 pub state: crate::model::hcx::State,
13259
13260 /// Fully qualified domain name of the appliance.
13261 pub fqdn: std::string::String,
13262
13263 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13264}
13265
13266impl Hcx {
13267 pub fn new() -> Self {
13268 std::default::Default::default()
13269 }
13270
13271 /// Sets the value of [internal_ip][crate::model::Hcx::internal_ip].
13272 ///
13273 /// # Example
13274 /// ```ignore,no_run
13275 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13276 /// let x = Hcx::new().set_internal_ip("example");
13277 /// ```
13278 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13279 self.internal_ip = v.into();
13280 self
13281 }
13282
13283 /// Sets the value of [version][crate::model::Hcx::version].
13284 ///
13285 /// # Example
13286 /// ```ignore,no_run
13287 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13288 /// let x = Hcx::new().set_version("example");
13289 /// ```
13290 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13291 self.version = v.into();
13292 self
13293 }
13294
13295 /// Sets the value of [state][crate::model::Hcx::state].
13296 ///
13297 /// # Example
13298 /// ```ignore,no_run
13299 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13300 /// use google_cloud_vmwareengine_v1::model::hcx::State;
13301 /// let x0 = Hcx::new().set_state(State::Active);
13302 /// let x1 = Hcx::new().set_state(State::Creating);
13303 /// let x2 = Hcx::new().set_state(State::Activating);
13304 /// ```
13305 pub fn set_state<T: std::convert::Into<crate::model::hcx::State>>(mut self, v: T) -> Self {
13306 self.state = v.into();
13307 self
13308 }
13309
13310 /// Sets the value of [fqdn][crate::model::Hcx::fqdn].
13311 ///
13312 /// # Example
13313 /// ```ignore,no_run
13314 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13315 /// let x = Hcx::new().set_fqdn("example");
13316 /// ```
13317 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13318 self.fqdn = v.into();
13319 self
13320 }
13321}
13322
13323impl wkt::message::Message for Hcx {
13324 fn typename() -> &'static str {
13325 "type.googleapis.com/google.cloud.vmwareengine.v1.Hcx"
13326 }
13327}
13328
13329/// Defines additional types related to [Hcx].
13330pub mod hcx {
13331 #[allow(unused_imports)]
13332 use super::*;
13333
13334 /// State of the appliance
13335 ///
13336 /// # Working with unknown values
13337 ///
13338 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13339 /// additional enum variants at any time. Adding new variants is not considered
13340 /// a breaking change. Applications should write their code in anticipation of:
13341 ///
13342 /// - New values appearing in future releases of the client library, **and**
13343 /// - New values received dynamically, without application changes.
13344 ///
13345 /// Please consult the [Working with enums] section in the user guide for some
13346 /// guidelines.
13347 ///
13348 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13349 #[derive(Clone, Debug, PartialEq)]
13350 #[non_exhaustive]
13351 pub enum State {
13352 /// Unspecified appliance state. This is the default value.
13353 Unspecified,
13354 /// The appliance is operational and can be used.
13355 Active,
13356 /// The appliance is being deployed.
13357 Creating,
13358 /// The appliance is being activated.
13359 Activating,
13360 /// If set, the enum was initialized with an unknown value.
13361 ///
13362 /// Applications can examine the value using [State::value] or
13363 /// [State::name].
13364 UnknownValue(state::UnknownValue),
13365 }
13366
13367 #[doc(hidden)]
13368 pub mod state {
13369 #[allow(unused_imports)]
13370 use super::*;
13371 #[derive(Clone, Debug, PartialEq)]
13372 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13373 }
13374
13375 impl State {
13376 /// Gets the enum value.
13377 ///
13378 /// Returns `None` if the enum contains an unknown value deserialized from
13379 /// the string representation of enums.
13380 pub fn value(&self) -> std::option::Option<i32> {
13381 match self {
13382 Self::Unspecified => std::option::Option::Some(0),
13383 Self::Active => std::option::Option::Some(1),
13384 Self::Creating => std::option::Option::Some(2),
13385 Self::Activating => std::option::Option::Some(3),
13386 Self::UnknownValue(u) => u.0.value(),
13387 }
13388 }
13389
13390 /// Gets the enum value as a string.
13391 ///
13392 /// Returns `None` if the enum contains an unknown value deserialized from
13393 /// the integer representation of enums.
13394 pub fn name(&self) -> std::option::Option<&str> {
13395 match self {
13396 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13397 Self::Active => std::option::Option::Some("ACTIVE"),
13398 Self::Creating => std::option::Option::Some("CREATING"),
13399 Self::Activating => std::option::Option::Some("ACTIVATING"),
13400 Self::UnknownValue(u) => u.0.name(),
13401 }
13402 }
13403 }
13404
13405 impl std::default::Default for State {
13406 fn default() -> Self {
13407 use std::convert::From;
13408 Self::from(0)
13409 }
13410 }
13411
13412 impl std::fmt::Display for State {
13413 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13414 wkt::internal::display_enum(f, self.name(), self.value())
13415 }
13416 }
13417
13418 impl std::convert::From<i32> for State {
13419 fn from(value: i32) -> Self {
13420 match value {
13421 0 => Self::Unspecified,
13422 1 => Self::Active,
13423 2 => Self::Creating,
13424 3 => Self::Activating,
13425 _ => Self::UnknownValue(state::UnknownValue(
13426 wkt::internal::UnknownEnumValue::Integer(value),
13427 )),
13428 }
13429 }
13430 }
13431
13432 impl std::convert::From<&str> for State {
13433 fn from(value: &str) -> Self {
13434 use std::string::ToString;
13435 match value {
13436 "STATE_UNSPECIFIED" => Self::Unspecified,
13437 "ACTIVE" => Self::Active,
13438 "CREATING" => Self::Creating,
13439 "ACTIVATING" => Self::Activating,
13440 _ => Self::UnknownValue(state::UnknownValue(
13441 wkt::internal::UnknownEnumValue::String(value.to_string()),
13442 )),
13443 }
13444 }
13445 }
13446
13447 impl serde::ser::Serialize for State {
13448 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13449 where
13450 S: serde::Serializer,
13451 {
13452 match self {
13453 Self::Unspecified => serializer.serialize_i32(0),
13454 Self::Active => serializer.serialize_i32(1),
13455 Self::Creating => serializer.serialize_i32(2),
13456 Self::Activating => serializer.serialize_i32(3),
13457 Self::UnknownValue(u) => u.0.serialize(serializer),
13458 }
13459 }
13460 }
13461
13462 impl<'de> serde::de::Deserialize<'de> for State {
13463 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13464 where
13465 D: serde::Deserializer<'de>,
13466 {
13467 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13468 ".google.cloud.vmwareengine.v1.Hcx.State",
13469 ))
13470 }
13471 }
13472}
13473
13474/// Details about a NSX Manager appliance.
13475#[derive(Clone, Default, PartialEq)]
13476#[non_exhaustive]
13477pub struct Nsx {
13478 /// Internal IP address of the appliance.
13479 pub internal_ip: std::string::String,
13480
13481 /// Version of the appliance.
13482 pub version: std::string::String,
13483
13484 /// Output only. The state of the appliance.
13485 pub state: crate::model::nsx::State,
13486
13487 /// Fully qualified domain name of the appliance.
13488 pub fqdn: std::string::String,
13489
13490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13491}
13492
13493impl Nsx {
13494 pub fn new() -> Self {
13495 std::default::Default::default()
13496 }
13497
13498 /// Sets the value of [internal_ip][crate::model::Nsx::internal_ip].
13499 ///
13500 /// # Example
13501 /// ```ignore,no_run
13502 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13503 /// let x = Nsx::new().set_internal_ip("example");
13504 /// ```
13505 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13506 self.internal_ip = v.into();
13507 self
13508 }
13509
13510 /// Sets the value of [version][crate::model::Nsx::version].
13511 ///
13512 /// # Example
13513 /// ```ignore,no_run
13514 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13515 /// let x = Nsx::new().set_version("example");
13516 /// ```
13517 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13518 self.version = v.into();
13519 self
13520 }
13521
13522 /// Sets the value of [state][crate::model::Nsx::state].
13523 ///
13524 /// # Example
13525 /// ```ignore,no_run
13526 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13527 /// use google_cloud_vmwareengine_v1::model::nsx::State;
13528 /// let x0 = Nsx::new().set_state(State::Active);
13529 /// let x1 = Nsx::new().set_state(State::Creating);
13530 /// ```
13531 pub fn set_state<T: std::convert::Into<crate::model::nsx::State>>(mut self, v: T) -> Self {
13532 self.state = v.into();
13533 self
13534 }
13535
13536 /// Sets the value of [fqdn][crate::model::Nsx::fqdn].
13537 ///
13538 /// # Example
13539 /// ```ignore,no_run
13540 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13541 /// let x = Nsx::new().set_fqdn("example");
13542 /// ```
13543 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13544 self.fqdn = v.into();
13545 self
13546 }
13547}
13548
13549impl wkt::message::Message for Nsx {
13550 fn typename() -> &'static str {
13551 "type.googleapis.com/google.cloud.vmwareengine.v1.Nsx"
13552 }
13553}
13554
13555/// Defines additional types related to [Nsx].
13556pub mod nsx {
13557 #[allow(unused_imports)]
13558 use super::*;
13559
13560 /// State of the appliance
13561 ///
13562 /// # Working with unknown values
13563 ///
13564 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13565 /// additional enum variants at any time. Adding new variants is not considered
13566 /// a breaking change. Applications should write their code in anticipation of:
13567 ///
13568 /// - New values appearing in future releases of the client library, **and**
13569 /// - New values received dynamically, without application changes.
13570 ///
13571 /// Please consult the [Working with enums] section in the user guide for some
13572 /// guidelines.
13573 ///
13574 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13575 #[derive(Clone, Debug, PartialEq)]
13576 #[non_exhaustive]
13577 pub enum State {
13578 /// Unspecified appliance state. This is the default value.
13579 Unspecified,
13580 /// The appliance is operational and can be used.
13581 Active,
13582 /// The appliance is being deployed.
13583 Creating,
13584 /// If set, the enum was initialized with an unknown value.
13585 ///
13586 /// Applications can examine the value using [State::value] or
13587 /// [State::name].
13588 UnknownValue(state::UnknownValue),
13589 }
13590
13591 #[doc(hidden)]
13592 pub mod state {
13593 #[allow(unused_imports)]
13594 use super::*;
13595 #[derive(Clone, Debug, PartialEq)]
13596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13597 }
13598
13599 impl State {
13600 /// Gets the enum value.
13601 ///
13602 /// Returns `None` if the enum contains an unknown value deserialized from
13603 /// the string representation of enums.
13604 pub fn value(&self) -> std::option::Option<i32> {
13605 match self {
13606 Self::Unspecified => std::option::Option::Some(0),
13607 Self::Active => std::option::Option::Some(1),
13608 Self::Creating => std::option::Option::Some(2),
13609 Self::UnknownValue(u) => u.0.value(),
13610 }
13611 }
13612
13613 /// Gets the enum value as a string.
13614 ///
13615 /// Returns `None` if the enum contains an unknown value deserialized from
13616 /// the integer representation of enums.
13617 pub fn name(&self) -> std::option::Option<&str> {
13618 match self {
13619 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13620 Self::Active => std::option::Option::Some("ACTIVE"),
13621 Self::Creating => std::option::Option::Some("CREATING"),
13622 Self::UnknownValue(u) => u.0.name(),
13623 }
13624 }
13625 }
13626
13627 impl std::default::Default for State {
13628 fn default() -> Self {
13629 use std::convert::From;
13630 Self::from(0)
13631 }
13632 }
13633
13634 impl std::fmt::Display for State {
13635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13636 wkt::internal::display_enum(f, self.name(), self.value())
13637 }
13638 }
13639
13640 impl std::convert::From<i32> for State {
13641 fn from(value: i32) -> Self {
13642 match value {
13643 0 => Self::Unspecified,
13644 1 => Self::Active,
13645 2 => Self::Creating,
13646 _ => Self::UnknownValue(state::UnknownValue(
13647 wkt::internal::UnknownEnumValue::Integer(value),
13648 )),
13649 }
13650 }
13651 }
13652
13653 impl std::convert::From<&str> for State {
13654 fn from(value: &str) -> Self {
13655 use std::string::ToString;
13656 match value {
13657 "STATE_UNSPECIFIED" => Self::Unspecified,
13658 "ACTIVE" => Self::Active,
13659 "CREATING" => Self::Creating,
13660 _ => Self::UnknownValue(state::UnknownValue(
13661 wkt::internal::UnknownEnumValue::String(value.to_string()),
13662 )),
13663 }
13664 }
13665 }
13666
13667 impl serde::ser::Serialize for State {
13668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13669 where
13670 S: serde::Serializer,
13671 {
13672 match self {
13673 Self::Unspecified => serializer.serialize_i32(0),
13674 Self::Active => serializer.serialize_i32(1),
13675 Self::Creating => serializer.serialize_i32(2),
13676 Self::UnknownValue(u) => u.0.serialize(serializer),
13677 }
13678 }
13679 }
13680
13681 impl<'de> serde::de::Deserialize<'de> for State {
13682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13683 where
13684 D: serde::Deserializer<'de>,
13685 {
13686 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13687 ".google.cloud.vmwareengine.v1.Nsx.State",
13688 ))
13689 }
13690 }
13691}
13692
13693/// Details about a vCenter Server management appliance.
13694#[derive(Clone, Default, PartialEq)]
13695#[non_exhaustive]
13696pub struct Vcenter {
13697 /// Internal IP address of the appliance.
13698 pub internal_ip: std::string::String,
13699
13700 /// Version of the appliance.
13701 pub version: std::string::String,
13702
13703 /// Output only. The state of the appliance.
13704 pub state: crate::model::vcenter::State,
13705
13706 /// Fully qualified domain name of the appliance.
13707 pub fqdn: std::string::String,
13708
13709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13710}
13711
13712impl Vcenter {
13713 pub fn new() -> Self {
13714 std::default::Default::default()
13715 }
13716
13717 /// Sets the value of [internal_ip][crate::model::Vcenter::internal_ip].
13718 ///
13719 /// # Example
13720 /// ```ignore,no_run
13721 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13722 /// let x = Vcenter::new().set_internal_ip("example");
13723 /// ```
13724 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13725 self.internal_ip = v.into();
13726 self
13727 }
13728
13729 /// Sets the value of [version][crate::model::Vcenter::version].
13730 ///
13731 /// # Example
13732 /// ```ignore,no_run
13733 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13734 /// let x = Vcenter::new().set_version("example");
13735 /// ```
13736 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13737 self.version = v.into();
13738 self
13739 }
13740
13741 /// Sets the value of [state][crate::model::Vcenter::state].
13742 ///
13743 /// # Example
13744 /// ```ignore,no_run
13745 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13746 /// use google_cloud_vmwareengine_v1::model::vcenter::State;
13747 /// let x0 = Vcenter::new().set_state(State::Active);
13748 /// let x1 = Vcenter::new().set_state(State::Creating);
13749 /// ```
13750 pub fn set_state<T: std::convert::Into<crate::model::vcenter::State>>(mut self, v: T) -> Self {
13751 self.state = v.into();
13752 self
13753 }
13754
13755 /// Sets the value of [fqdn][crate::model::Vcenter::fqdn].
13756 ///
13757 /// # Example
13758 /// ```ignore,no_run
13759 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13760 /// let x = Vcenter::new().set_fqdn("example");
13761 /// ```
13762 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13763 self.fqdn = v.into();
13764 self
13765 }
13766}
13767
13768impl wkt::message::Message for Vcenter {
13769 fn typename() -> &'static str {
13770 "type.googleapis.com/google.cloud.vmwareengine.v1.Vcenter"
13771 }
13772}
13773
13774/// Defines additional types related to [Vcenter].
13775pub mod vcenter {
13776 #[allow(unused_imports)]
13777 use super::*;
13778
13779 /// State of the appliance
13780 ///
13781 /// # Working with unknown values
13782 ///
13783 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13784 /// additional enum variants at any time. Adding new variants is not considered
13785 /// a breaking change. Applications should write their code in anticipation of:
13786 ///
13787 /// - New values appearing in future releases of the client library, **and**
13788 /// - New values received dynamically, without application changes.
13789 ///
13790 /// Please consult the [Working with enums] section in the user guide for some
13791 /// guidelines.
13792 ///
13793 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13794 #[derive(Clone, Debug, PartialEq)]
13795 #[non_exhaustive]
13796 pub enum State {
13797 /// Unspecified appliance state. This is the default value.
13798 Unspecified,
13799 /// The appliance is operational and can be used.
13800 Active,
13801 /// The appliance is being deployed.
13802 Creating,
13803 /// If set, the enum was initialized with an unknown value.
13804 ///
13805 /// Applications can examine the value using [State::value] or
13806 /// [State::name].
13807 UnknownValue(state::UnknownValue),
13808 }
13809
13810 #[doc(hidden)]
13811 pub mod state {
13812 #[allow(unused_imports)]
13813 use super::*;
13814 #[derive(Clone, Debug, PartialEq)]
13815 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13816 }
13817
13818 impl State {
13819 /// Gets the enum value.
13820 ///
13821 /// Returns `None` if the enum contains an unknown value deserialized from
13822 /// the string representation of enums.
13823 pub fn value(&self) -> std::option::Option<i32> {
13824 match self {
13825 Self::Unspecified => std::option::Option::Some(0),
13826 Self::Active => std::option::Option::Some(1),
13827 Self::Creating => std::option::Option::Some(2),
13828 Self::UnknownValue(u) => u.0.value(),
13829 }
13830 }
13831
13832 /// Gets the enum value as a string.
13833 ///
13834 /// Returns `None` if the enum contains an unknown value deserialized from
13835 /// the integer representation of enums.
13836 pub fn name(&self) -> std::option::Option<&str> {
13837 match self {
13838 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13839 Self::Active => std::option::Option::Some("ACTIVE"),
13840 Self::Creating => std::option::Option::Some("CREATING"),
13841 Self::UnknownValue(u) => u.0.name(),
13842 }
13843 }
13844 }
13845
13846 impl std::default::Default for State {
13847 fn default() -> Self {
13848 use std::convert::From;
13849 Self::from(0)
13850 }
13851 }
13852
13853 impl std::fmt::Display for State {
13854 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13855 wkt::internal::display_enum(f, self.name(), self.value())
13856 }
13857 }
13858
13859 impl std::convert::From<i32> for State {
13860 fn from(value: i32) -> Self {
13861 match value {
13862 0 => Self::Unspecified,
13863 1 => Self::Active,
13864 2 => Self::Creating,
13865 _ => Self::UnknownValue(state::UnknownValue(
13866 wkt::internal::UnknownEnumValue::Integer(value),
13867 )),
13868 }
13869 }
13870 }
13871
13872 impl std::convert::From<&str> for State {
13873 fn from(value: &str) -> Self {
13874 use std::string::ToString;
13875 match value {
13876 "STATE_UNSPECIFIED" => Self::Unspecified,
13877 "ACTIVE" => Self::Active,
13878 "CREATING" => Self::Creating,
13879 _ => Self::UnknownValue(state::UnknownValue(
13880 wkt::internal::UnknownEnumValue::String(value.to_string()),
13881 )),
13882 }
13883 }
13884 }
13885
13886 impl serde::ser::Serialize for State {
13887 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13888 where
13889 S: serde::Serializer,
13890 {
13891 match self {
13892 Self::Unspecified => serializer.serialize_i32(0),
13893 Self::Active => serializer.serialize_i32(1),
13894 Self::Creating => serializer.serialize_i32(2),
13895 Self::UnknownValue(u) => u.0.serialize(serializer),
13896 }
13897 }
13898 }
13899
13900 impl<'de> serde::de::Deserialize<'de> for State {
13901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13902 where
13903 D: serde::Deserializer<'de>,
13904 {
13905 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13906 ".google.cloud.vmwareengine.v1.Vcenter.State",
13907 ))
13908 }
13909 }
13910}
13911
13912/// Autoscaling settings define the rules used by VMware Engine to
13913/// automatically scale-out and scale-in the clusters in a private cloud.
13914#[derive(Clone, Default, PartialEq)]
13915#[non_exhaustive]
13916pub struct AutoscalingSettings {
13917 /// Required. The map with autoscaling policies applied to the cluster.
13918 /// The key is the identifier of the policy.
13919 /// It must meet the following requirements:
13920 ///
13921 /// * Only contains 1-63 alphanumeric characters and hyphens
13922 /// * Begins with an alphabetical character
13923 /// * Ends with a non-hyphen character
13924 /// * Not formatted as a UUID
13925 /// * Complies with [RFC
13926 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
13927 ///
13928 /// Currently there map must contain only one element
13929 /// that describes the autoscaling policy for compute nodes.
13930 pub autoscaling_policies: std::collections::HashMap<
13931 std::string::String,
13932 crate::model::autoscaling_settings::AutoscalingPolicy,
13933 >,
13934
13935 /// Optional. Minimum number of nodes of any type in a cluster.
13936 /// If not specified the default limits apply.
13937 pub min_cluster_node_count: i32,
13938
13939 /// Optional. Maximum number of nodes of any type in a cluster.
13940 /// If not specified the default limits apply.
13941 pub max_cluster_node_count: i32,
13942
13943 /// Optional. The minimum duration between consecutive autoscale operations.
13944 /// It starts once addition or removal of nodes is fully completed.
13945 /// Defaults to 30 minutes if not specified. Cool down period must be in whole
13946 /// minutes (for example, 30, 31, 50, 180 minutes).
13947 pub cool_down_period: std::option::Option<wkt::Duration>,
13948
13949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13950}
13951
13952impl AutoscalingSettings {
13953 pub fn new() -> Self {
13954 std::default::Default::default()
13955 }
13956
13957 /// Sets the value of [autoscaling_policies][crate::model::AutoscalingSettings::autoscaling_policies].
13958 ///
13959 /// # Example
13960 /// ```ignore,no_run
13961 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13962 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
13963 /// let x = AutoscalingSettings::new().set_autoscaling_policies([
13964 /// ("key0", AutoscalingPolicy::default()/* use setters */),
13965 /// ("key1", AutoscalingPolicy::default()/* use (different) setters */),
13966 /// ]);
13967 /// ```
13968 pub fn set_autoscaling_policies<T, K, V>(mut self, v: T) -> Self
13969 where
13970 T: std::iter::IntoIterator<Item = (K, V)>,
13971 K: std::convert::Into<std::string::String>,
13972 V: std::convert::Into<crate::model::autoscaling_settings::AutoscalingPolicy>,
13973 {
13974 use std::iter::Iterator;
13975 self.autoscaling_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13976 self
13977 }
13978
13979 /// Sets the value of [min_cluster_node_count][crate::model::AutoscalingSettings::min_cluster_node_count].
13980 ///
13981 /// # Example
13982 /// ```ignore,no_run
13983 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13984 /// let x = AutoscalingSettings::new().set_min_cluster_node_count(42);
13985 /// ```
13986 pub fn set_min_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13987 self.min_cluster_node_count = v.into();
13988 self
13989 }
13990
13991 /// Sets the value of [max_cluster_node_count][crate::model::AutoscalingSettings::max_cluster_node_count].
13992 ///
13993 /// # Example
13994 /// ```ignore,no_run
13995 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13996 /// let x = AutoscalingSettings::new().set_max_cluster_node_count(42);
13997 /// ```
13998 pub fn set_max_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13999 self.max_cluster_node_count = v.into();
14000 self
14001 }
14002
14003 /// Sets the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14008 /// use wkt::Duration;
14009 /// let x = AutoscalingSettings::new().set_cool_down_period(Duration::default()/* use setters */);
14010 /// ```
14011 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
14012 where
14013 T: std::convert::Into<wkt::Duration>,
14014 {
14015 self.cool_down_period = std::option::Option::Some(v.into());
14016 self
14017 }
14018
14019 /// Sets or clears the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14020 ///
14021 /// # Example
14022 /// ```ignore,no_run
14023 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14024 /// use wkt::Duration;
14025 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
14026 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(None::<Duration>);
14027 /// ```
14028 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
14029 where
14030 T: std::convert::Into<wkt::Duration>,
14031 {
14032 self.cool_down_period = v.map(|x| x.into());
14033 self
14034 }
14035}
14036
14037impl wkt::message::Message for AutoscalingSettings {
14038 fn typename() -> &'static str {
14039 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings"
14040 }
14041}
14042
14043/// Defines additional types related to [AutoscalingSettings].
14044pub mod autoscaling_settings {
14045 #[allow(unused_imports)]
14046 use super::*;
14047
14048 /// Thresholds define the utilization of resources triggering
14049 /// scale-out and scale-in operations.
14050 #[derive(Clone, Default, PartialEq)]
14051 #[non_exhaustive]
14052 pub struct Thresholds {
14053 /// Required. The utilization triggering the scale-out operation in percent.
14054 pub scale_out: i32,
14055
14056 /// Required. The utilization triggering the scale-in operation in percent.
14057 pub scale_in: i32,
14058
14059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14060 }
14061
14062 impl Thresholds {
14063 pub fn new() -> Self {
14064 std::default::Default::default()
14065 }
14066
14067 /// Sets the value of [scale_out][crate::model::autoscaling_settings::Thresholds::scale_out].
14068 ///
14069 /// # Example
14070 /// ```ignore,no_run
14071 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14072 /// let x = Thresholds::new().set_scale_out(42);
14073 /// ```
14074 pub fn set_scale_out<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14075 self.scale_out = v.into();
14076 self
14077 }
14078
14079 /// Sets the value of [scale_in][crate::model::autoscaling_settings::Thresholds::scale_in].
14080 ///
14081 /// # Example
14082 /// ```ignore,no_run
14083 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14084 /// let x = Thresholds::new().set_scale_in(42);
14085 /// ```
14086 pub fn set_scale_in<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14087 self.scale_in = v.into();
14088 self
14089 }
14090 }
14091
14092 impl wkt::message::Message for Thresholds {
14093 fn typename() -> &'static str {
14094 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds"
14095 }
14096 }
14097
14098 /// Autoscaling policy describes the behavior of the autoscaling
14099 /// with respect to the resource utilization.
14100 /// The scale-out operation is initiated if the utilization
14101 /// exceeds ANY of the respective thresholds.
14102 /// The scale-in operation is initiated if the utilization
14103 /// is below ALL of the respective thresholds.
14104 #[derive(Clone, Default, PartialEq)]
14105 #[non_exhaustive]
14106 pub struct AutoscalingPolicy {
14107 /// Required. The canonical identifier of the node type to add or remove.
14108 /// Corresponds to the `NodeType`.
14109 pub node_type_id: std::string::String,
14110
14111 /// Required. Number of nodes to add to a cluster during a scale-out
14112 /// operation. Must be divisible by 2 for stretched clusters. During a
14113 /// scale-in operation only one node (or 2 for stretched clusters) are
14114 /// removed in a single iteration.
14115 pub scale_out_size: i32,
14116
14117 /// Optional. Utilization thresholds pertaining to CPU utilization.
14118 pub cpu_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14119
14120 /// Optional. Utilization thresholds pertaining to amount of granted memory.
14121 pub granted_memory_thresholds:
14122 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14123
14124 /// Optional. Utilization thresholds pertaining to amount of consumed memory.
14125 pub consumed_memory_thresholds:
14126 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14127
14128 /// Optional. Utilization thresholds pertaining to amount of consumed
14129 /// storage.
14130 pub storage_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14131
14132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14133 }
14134
14135 impl AutoscalingPolicy {
14136 pub fn new() -> Self {
14137 std::default::Default::default()
14138 }
14139
14140 /// Sets the value of [node_type_id][crate::model::autoscaling_settings::AutoscalingPolicy::node_type_id].
14141 ///
14142 /// # Example
14143 /// ```ignore,no_run
14144 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14145 /// let x = AutoscalingPolicy::new().set_node_type_id("example");
14146 /// ```
14147 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(
14148 mut self,
14149 v: T,
14150 ) -> Self {
14151 self.node_type_id = v.into();
14152 self
14153 }
14154
14155 /// Sets the value of [scale_out_size][crate::model::autoscaling_settings::AutoscalingPolicy::scale_out_size].
14156 ///
14157 /// # Example
14158 /// ```ignore,no_run
14159 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14160 /// let x = AutoscalingPolicy::new().set_scale_out_size(42);
14161 /// ```
14162 pub fn set_scale_out_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14163 self.scale_out_size = v.into();
14164 self
14165 }
14166
14167 /// Sets the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14168 ///
14169 /// # Example
14170 /// ```ignore,no_run
14171 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14172 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14173 /// let x = AutoscalingPolicy::new().set_cpu_thresholds(Thresholds::default()/* use setters */);
14174 /// ```
14175 pub fn set_cpu_thresholds<T>(mut self, v: T) -> Self
14176 where
14177 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14178 {
14179 self.cpu_thresholds = std::option::Option::Some(v.into());
14180 self
14181 }
14182
14183 /// Sets or clears the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14184 ///
14185 /// # Example
14186 /// ```ignore,no_run
14187 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14188 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14189 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(Some(Thresholds::default()/* use setters */));
14190 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(None::<Thresholds>);
14191 /// ```
14192 pub fn set_or_clear_cpu_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14193 where
14194 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14195 {
14196 self.cpu_thresholds = v.map(|x| x.into());
14197 self
14198 }
14199
14200 /// Sets the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14201 ///
14202 /// # Example
14203 /// ```ignore,no_run
14204 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14205 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14206 /// let x = AutoscalingPolicy::new().set_granted_memory_thresholds(Thresholds::default()/* use setters */);
14207 /// ```
14208 pub fn set_granted_memory_thresholds<T>(mut self, v: T) -> Self
14209 where
14210 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14211 {
14212 self.granted_memory_thresholds = std::option::Option::Some(v.into());
14213 self
14214 }
14215
14216 /// Sets or clears the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14217 ///
14218 /// # Example
14219 /// ```ignore,no_run
14220 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14221 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14222 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(Some(Thresholds::default()/* use setters */));
14223 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(None::<Thresholds>);
14224 /// ```
14225 pub fn set_or_clear_granted_memory_thresholds<T>(
14226 mut self,
14227 v: std::option::Option<T>,
14228 ) -> Self
14229 where
14230 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14231 {
14232 self.granted_memory_thresholds = v.map(|x| x.into());
14233 self
14234 }
14235
14236 /// Sets the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14237 ///
14238 /// # Example
14239 /// ```ignore,no_run
14240 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14241 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14242 /// let x = AutoscalingPolicy::new().set_consumed_memory_thresholds(Thresholds::default()/* use setters */);
14243 /// ```
14244 pub fn set_consumed_memory_thresholds<T>(mut self, v: T) -> Self
14245 where
14246 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14247 {
14248 self.consumed_memory_thresholds = std::option::Option::Some(v.into());
14249 self
14250 }
14251
14252 /// Sets or clears the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14253 ///
14254 /// # Example
14255 /// ```ignore,no_run
14256 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14257 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14258 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(Some(Thresholds::default()/* use setters */));
14259 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(None::<Thresholds>);
14260 /// ```
14261 pub fn set_or_clear_consumed_memory_thresholds<T>(
14262 mut self,
14263 v: std::option::Option<T>,
14264 ) -> Self
14265 where
14266 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14267 {
14268 self.consumed_memory_thresholds = v.map(|x| x.into());
14269 self
14270 }
14271
14272 /// Sets the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14273 ///
14274 /// # Example
14275 /// ```ignore,no_run
14276 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14277 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14278 /// let x = AutoscalingPolicy::new().set_storage_thresholds(Thresholds::default()/* use setters */);
14279 /// ```
14280 pub fn set_storage_thresholds<T>(mut self, v: T) -> Self
14281 where
14282 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14283 {
14284 self.storage_thresholds = std::option::Option::Some(v.into());
14285 self
14286 }
14287
14288 /// Sets or clears the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14289 ///
14290 /// # Example
14291 /// ```ignore,no_run
14292 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14293 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14294 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(Some(Thresholds::default()/* use setters */));
14295 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(None::<Thresholds>);
14296 /// ```
14297 pub fn set_or_clear_storage_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14298 where
14299 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14300 {
14301 self.storage_thresholds = v.map(|x| x.into());
14302 self
14303 }
14304 }
14305
14306 impl wkt::message::Message for AutoscalingPolicy {
14307 fn typename() -> &'static str {
14308 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy"
14309 }
14310 }
14311}
14312
14313/// DNS forwarding config.
14314/// This config defines a list of domain to name server mappings,
14315/// and is attached to the private cloud for custom domain resolution.
14316#[derive(Clone, Default, PartialEq)]
14317#[non_exhaustive]
14318pub struct DnsForwarding {
14319 /// Output only. The resource name of this DNS profile.
14320 /// Resource names are schemeless URIs that follow the conventions in
14321 /// <https://cloud.google.com/apis/design/resource_names>.
14322 /// For example:
14323 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
14324 pub name: std::string::String,
14325
14326 /// Output only. Creation time of this resource.
14327 pub create_time: std::option::Option<wkt::Timestamp>,
14328
14329 /// Output only. Last update time of this resource.
14330 pub update_time: std::option::Option<wkt::Timestamp>,
14331
14332 /// Required. List of domain mappings to configure
14333 pub forwarding_rules: std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
14334
14335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14336}
14337
14338impl DnsForwarding {
14339 pub fn new() -> Self {
14340 std::default::Default::default()
14341 }
14342
14343 /// Sets the value of [name][crate::model::DnsForwarding::name].
14344 ///
14345 /// # Example
14346 /// ```ignore,no_run
14347 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14348 /// let x = DnsForwarding::new().set_name("example");
14349 /// ```
14350 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14351 self.name = v.into();
14352 self
14353 }
14354
14355 /// Sets the value of [create_time][crate::model::DnsForwarding::create_time].
14356 ///
14357 /// # Example
14358 /// ```ignore,no_run
14359 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14360 /// use wkt::Timestamp;
14361 /// let x = DnsForwarding::new().set_create_time(Timestamp::default()/* use setters */);
14362 /// ```
14363 pub fn set_create_time<T>(mut self, v: T) -> Self
14364 where
14365 T: std::convert::Into<wkt::Timestamp>,
14366 {
14367 self.create_time = std::option::Option::Some(v.into());
14368 self
14369 }
14370
14371 /// Sets or clears the value of [create_time][crate::model::DnsForwarding::create_time].
14372 ///
14373 /// # Example
14374 /// ```ignore,no_run
14375 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14376 /// use wkt::Timestamp;
14377 /// let x = DnsForwarding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14378 /// let x = DnsForwarding::new().set_or_clear_create_time(None::<Timestamp>);
14379 /// ```
14380 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14381 where
14382 T: std::convert::Into<wkt::Timestamp>,
14383 {
14384 self.create_time = v.map(|x| x.into());
14385 self
14386 }
14387
14388 /// Sets the value of [update_time][crate::model::DnsForwarding::update_time].
14389 ///
14390 /// # Example
14391 /// ```ignore,no_run
14392 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14393 /// use wkt::Timestamp;
14394 /// let x = DnsForwarding::new().set_update_time(Timestamp::default()/* use setters */);
14395 /// ```
14396 pub fn set_update_time<T>(mut self, v: T) -> Self
14397 where
14398 T: std::convert::Into<wkt::Timestamp>,
14399 {
14400 self.update_time = std::option::Option::Some(v.into());
14401 self
14402 }
14403
14404 /// Sets or clears the value of [update_time][crate::model::DnsForwarding::update_time].
14405 ///
14406 /// # Example
14407 /// ```ignore,no_run
14408 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14409 /// use wkt::Timestamp;
14410 /// let x = DnsForwarding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14411 /// let x = DnsForwarding::new().set_or_clear_update_time(None::<Timestamp>);
14412 /// ```
14413 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14414 where
14415 T: std::convert::Into<wkt::Timestamp>,
14416 {
14417 self.update_time = v.map(|x| x.into());
14418 self
14419 }
14420
14421 /// Sets the value of [forwarding_rules][crate::model::DnsForwarding::forwarding_rules].
14422 ///
14423 /// # Example
14424 /// ```ignore,no_run
14425 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14426 /// use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14427 /// let x = DnsForwarding::new()
14428 /// .set_forwarding_rules([
14429 /// ForwardingRule::default()/* use setters */,
14430 /// ForwardingRule::default()/* use (different) setters */,
14431 /// ]);
14432 /// ```
14433 pub fn set_forwarding_rules<T, V>(mut self, v: T) -> Self
14434 where
14435 T: std::iter::IntoIterator<Item = V>,
14436 V: std::convert::Into<crate::model::dns_forwarding::ForwardingRule>,
14437 {
14438 use std::iter::Iterator;
14439 self.forwarding_rules = v.into_iter().map(|i| i.into()).collect();
14440 self
14441 }
14442}
14443
14444impl wkt::message::Message for DnsForwarding {
14445 fn typename() -> &'static str {
14446 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding"
14447 }
14448}
14449
14450/// Defines additional types related to [DnsForwarding].
14451pub mod dns_forwarding {
14452 #[allow(unused_imports)]
14453 use super::*;
14454
14455 /// A forwarding rule is a mapping of a `domain` to `name_servers`.
14456 /// This mapping allows VMware Engine to resolve domains for attached private
14457 /// clouds by forwarding DNS requests for a given domain to the specified
14458 /// nameservers.
14459 #[derive(Clone, Default, PartialEq)]
14460 #[non_exhaustive]
14461 pub struct ForwardingRule {
14462 /// Required. Domain used to resolve a `name_servers` list.
14463 pub domain: std::string::String,
14464
14465 /// Required. List of DNS servers to use for domain resolution
14466 pub name_servers: std::vec::Vec<std::string::String>,
14467
14468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14469 }
14470
14471 impl ForwardingRule {
14472 pub fn new() -> Self {
14473 std::default::Default::default()
14474 }
14475
14476 /// Sets the value of [domain][crate::model::dns_forwarding::ForwardingRule::domain].
14477 ///
14478 /// # Example
14479 /// ```ignore,no_run
14480 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14481 /// let x = ForwardingRule::new().set_domain("example");
14482 /// ```
14483 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14484 self.domain = v.into();
14485 self
14486 }
14487
14488 /// Sets the value of [name_servers][crate::model::dns_forwarding::ForwardingRule::name_servers].
14489 ///
14490 /// # Example
14491 /// ```ignore,no_run
14492 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14493 /// let x = ForwardingRule::new().set_name_servers(["a", "b", "c"]);
14494 /// ```
14495 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
14496 where
14497 T: std::iter::IntoIterator<Item = V>,
14498 V: std::convert::Into<std::string::String>,
14499 {
14500 use std::iter::Iterator;
14501 self.name_servers = v.into_iter().map(|i| i.into()).collect();
14502 self
14503 }
14504 }
14505
14506 impl wkt::message::Message for ForwardingRule {
14507 fn typename() -> &'static str {
14508 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule"
14509 }
14510 }
14511}
14512
14513/// Details of a network peering.
14514#[derive(Clone, Default, PartialEq)]
14515#[non_exhaustive]
14516pub struct NetworkPeering {
14517 /// Output only. The resource name of the network peering. NetworkPeering is a
14518 /// global resource and location can only be global. Resource names are
14519 /// scheme-less URIs that follow the conventions in
14520 /// <https://cloud.google.com/apis/design/resource_names>.
14521 /// For example:
14522 /// `projects/my-project/locations/global/networkPeerings/my-peering`
14523 pub name: std::string::String,
14524
14525 /// Output only. Creation time of this resource.
14526 pub create_time: std::option::Option<wkt::Timestamp>,
14527
14528 /// Output only. Last update time of this resource.
14529 pub update_time: std::option::Option<wkt::Timestamp>,
14530
14531 /// Required. The relative resource name of the network to peer with
14532 /// a standard VMware Engine network. The provided network can be a
14533 /// consumer VPC network or another standard VMware Engine network. If the
14534 /// `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form:
14535 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
14536 /// Otherwise specify the name in the form:
14537 /// `projects/{project}/global/networks/{network_id}`, where
14538 /// `{project}` can either be a project number or a project ID.
14539 pub peer_network: std::string::String,
14540
14541 /// Optional. True if custom routes are exported to the peered network;
14542 /// false otherwise. The default value is true.
14543 pub export_custom_routes: std::option::Option<bool>,
14544
14545 /// Optional. True if custom routes are imported from the peered network;
14546 /// false otherwise. The default value is true.
14547 pub import_custom_routes: std::option::Option<bool>,
14548
14549 /// Optional. True if full mesh connectivity is created and managed
14550 /// automatically between peered networks; false otherwise. Currently this
14551 /// field is always true because Google Compute Engine automatically creates
14552 /// and manages subnetwork routes between two VPC networks when peering state
14553 /// is 'ACTIVE'.
14554 pub exchange_subnet_routes: std::option::Option<bool>,
14555
14556 /// Optional. True if all subnet routes with a public IP address range are
14557 /// exported; false otherwise. The default value is true. IPv4 special-use
14558 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14559 /// exported to peers and are not controlled by this field.
14560 pub export_custom_routes_with_public_ip: std::option::Option<bool>,
14561
14562 /// Optional. True if all subnet routes with public IP address range are
14563 /// imported; false otherwise. The default value is true. IPv4 special-use
14564 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14565 /// imported to peers and are not controlled by this field.
14566 pub import_custom_routes_with_public_ip: std::option::Option<bool>,
14567
14568 /// Output only. State of the network peering. This field
14569 /// has a value of 'ACTIVE' when there's a matching configuration in the peer
14570 /// network. New values may be added to this enum when appropriate.
14571 pub state: crate::model::network_peering::State,
14572
14573 /// Output only. Output Only. Details about the current state of the network
14574 /// peering.
14575 pub state_details: std::string::String,
14576
14577 /// Optional. Maximum transmission unit (MTU) in bytes.
14578 /// The default value is `1500`. If a value of `0` is provided for this field,
14579 /// VMware Engine uses the default value instead.
14580 pub peer_mtu: i32,
14581
14582 /// Required. The type of the network to peer with the VMware Engine network.
14583 pub peer_network_type: crate::model::network_peering::PeerNetworkType,
14584
14585 /// Output only. System-generated unique identifier for the resource.
14586 pub uid: std::string::String,
14587
14588 /// Required. The relative resource name of the VMware Engine network.
14589 /// Specify the name in the following form:
14590 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
14591 /// where `{project}` can either be a project number or a project ID.
14592 pub vmware_engine_network: std::string::String,
14593
14594 /// Optional. User-provided description for this network peering.
14595 pub description: std::string::String,
14596
14597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14598}
14599
14600impl NetworkPeering {
14601 pub fn new() -> Self {
14602 std::default::Default::default()
14603 }
14604
14605 /// Sets the value of [name][crate::model::NetworkPeering::name].
14606 ///
14607 /// # Example
14608 /// ```ignore,no_run
14609 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14610 /// let x = NetworkPeering::new().set_name("example");
14611 /// ```
14612 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14613 self.name = v.into();
14614 self
14615 }
14616
14617 /// Sets the value of [create_time][crate::model::NetworkPeering::create_time].
14618 ///
14619 /// # Example
14620 /// ```ignore,no_run
14621 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14622 /// use wkt::Timestamp;
14623 /// let x = NetworkPeering::new().set_create_time(Timestamp::default()/* use setters */);
14624 /// ```
14625 pub fn set_create_time<T>(mut self, v: T) -> Self
14626 where
14627 T: std::convert::Into<wkt::Timestamp>,
14628 {
14629 self.create_time = std::option::Option::Some(v.into());
14630 self
14631 }
14632
14633 /// Sets or clears the value of [create_time][crate::model::NetworkPeering::create_time].
14634 ///
14635 /// # Example
14636 /// ```ignore,no_run
14637 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14638 /// use wkt::Timestamp;
14639 /// let x = NetworkPeering::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14640 /// let x = NetworkPeering::new().set_or_clear_create_time(None::<Timestamp>);
14641 /// ```
14642 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14643 where
14644 T: std::convert::Into<wkt::Timestamp>,
14645 {
14646 self.create_time = v.map(|x| x.into());
14647 self
14648 }
14649
14650 /// Sets the value of [update_time][crate::model::NetworkPeering::update_time].
14651 ///
14652 /// # Example
14653 /// ```ignore,no_run
14654 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14655 /// use wkt::Timestamp;
14656 /// let x = NetworkPeering::new().set_update_time(Timestamp::default()/* use setters */);
14657 /// ```
14658 pub fn set_update_time<T>(mut self, v: T) -> Self
14659 where
14660 T: std::convert::Into<wkt::Timestamp>,
14661 {
14662 self.update_time = std::option::Option::Some(v.into());
14663 self
14664 }
14665
14666 /// Sets or clears the value of [update_time][crate::model::NetworkPeering::update_time].
14667 ///
14668 /// # Example
14669 /// ```ignore,no_run
14670 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14671 /// use wkt::Timestamp;
14672 /// let x = NetworkPeering::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14673 /// let x = NetworkPeering::new().set_or_clear_update_time(None::<Timestamp>);
14674 /// ```
14675 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14676 where
14677 T: std::convert::Into<wkt::Timestamp>,
14678 {
14679 self.update_time = v.map(|x| x.into());
14680 self
14681 }
14682
14683 /// Sets the value of [peer_network][crate::model::NetworkPeering::peer_network].
14684 ///
14685 /// # Example
14686 /// ```ignore,no_run
14687 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14688 /// let x = NetworkPeering::new().set_peer_network("example");
14689 /// ```
14690 pub fn set_peer_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14691 self.peer_network = v.into();
14692 self
14693 }
14694
14695 /// Sets the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14696 ///
14697 /// # Example
14698 /// ```ignore,no_run
14699 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14700 /// let x = NetworkPeering::new().set_export_custom_routes(true);
14701 /// ```
14702 pub fn set_export_custom_routes<T>(mut self, v: T) -> Self
14703 where
14704 T: std::convert::Into<bool>,
14705 {
14706 self.export_custom_routes = std::option::Option::Some(v.into());
14707 self
14708 }
14709
14710 /// Sets or clears the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14711 ///
14712 /// # Example
14713 /// ```ignore,no_run
14714 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14715 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(Some(false));
14716 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(None::<bool>);
14717 /// ```
14718 pub fn set_or_clear_export_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14719 where
14720 T: std::convert::Into<bool>,
14721 {
14722 self.export_custom_routes = v.map(|x| x.into());
14723 self
14724 }
14725
14726 /// Sets the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14727 ///
14728 /// # Example
14729 /// ```ignore,no_run
14730 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14731 /// let x = NetworkPeering::new().set_import_custom_routes(true);
14732 /// ```
14733 pub fn set_import_custom_routes<T>(mut self, v: T) -> Self
14734 where
14735 T: std::convert::Into<bool>,
14736 {
14737 self.import_custom_routes = std::option::Option::Some(v.into());
14738 self
14739 }
14740
14741 /// Sets or clears the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14742 ///
14743 /// # Example
14744 /// ```ignore,no_run
14745 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14746 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(Some(false));
14747 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(None::<bool>);
14748 /// ```
14749 pub fn set_or_clear_import_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14750 where
14751 T: std::convert::Into<bool>,
14752 {
14753 self.import_custom_routes = v.map(|x| x.into());
14754 self
14755 }
14756
14757 /// Sets the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14758 ///
14759 /// # Example
14760 /// ```ignore,no_run
14761 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14762 /// let x = NetworkPeering::new().set_exchange_subnet_routes(true);
14763 /// ```
14764 pub fn set_exchange_subnet_routes<T>(mut self, v: T) -> Self
14765 where
14766 T: std::convert::Into<bool>,
14767 {
14768 self.exchange_subnet_routes = std::option::Option::Some(v.into());
14769 self
14770 }
14771
14772 /// Sets or clears the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14773 ///
14774 /// # Example
14775 /// ```ignore,no_run
14776 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14777 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(Some(false));
14778 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(None::<bool>);
14779 /// ```
14780 pub fn set_or_clear_exchange_subnet_routes<T>(mut self, v: std::option::Option<T>) -> Self
14781 where
14782 T: std::convert::Into<bool>,
14783 {
14784 self.exchange_subnet_routes = v.map(|x| x.into());
14785 self
14786 }
14787
14788 /// Sets the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14789 ///
14790 /// # Example
14791 /// ```ignore,no_run
14792 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14793 /// let x = NetworkPeering::new().set_export_custom_routes_with_public_ip(true);
14794 /// ```
14795 pub fn set_export_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14796 where
14797 T: std::convert::Into<bool>,
14798 {
14799 self.export_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14800 self
14801 }
14802
14803 /// Sets or clears the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14804 ///
14805 /// # Example
14806 /// ```ignore,no_run
14807 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14808 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(Some(false));
14809 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(None::<bool>);
14810 /// ```
14811 pub fn set_or_clear_export_custom_routes_with_public_ip<T>(
14812 mut self,
14813 v: std::option::Option<T>,
14814 ) -> Self
14815 where
14816 T: std::convert::Into<bool>,
14817 {
14818 self.export_custom_routes_with_public_ip = v.map(|x| x.into());
14819 self
14820 }
14821
14822 /// Sets the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14823 ///
14824 /// # Example
14825 /// ```ignore,no_run
14826 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14827 /// let x = NetworkPeering::new().set_import_custom_routes_with_public_ip(true);
14828 /// ```
14829 pub fn set_import_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14830 where
14831 T: std::convert::Into<bool>,
14832 {
14833 self.import_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14834 self
14835 }
14836
14837 /// Sets or clears the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14838 ///
14839 /// # Example
14840 /// ```ignore,no_run
14841 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14842 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(Some(false));
14843 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(None::<bool>);
14844 /// ```
14845 pub fn set_or_clear_import_custom_routes_with_public_ip<T>(
14846 mut self,
14847 v: std::option::Option<T>,
14848 ) -> Self
14849 where
14850 T: std::convert::Into<bool>,
14851 {
14852 self.import_custom_routes_with_public_ip = v.map(|x| x.into());
14853 self
14854 }
14855
14856 /// Sets the value of [state][crate::model::NetworkPeering::state].
14857 ///
14858 /// # Example
14859 /// ```ignore,no_run
14860 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14861 /// use google_cloud_vmwareengine_v1::model::network_peering::State;
14862 /// let x0 = NetworkPeering::new().set_state(State::Inactive);
14863 /// let x1 = NetworkPeering::new().set_state(State::Active);
14864 /// let x2 = NetworkPeering::new().set_state(State::Creating);
14865 /// ```
14866 pub fn set_state<T: std::convert::Into<crate::model::network_peering::State>>(
14867 mut self,
14868 v: T,
14869 ) -> Self {
14870 self.state = v.into();
14871 self
14872 }
14873
14874 /// Sets the value of [state_details][crate::model::NetworkPeering::state_details].
14875 ///
14876 /// # Example
14877 /// ```ignore,no_run
14878 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14879 /// let x = NetworkPeering::new().set_state_details("example");
14880 /// ```
14881 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14882 self.state_details = v.into();
14883 self
14884 }
14885
14886 /// Sets the value of [peer_mtu][crate::model::NetworkPeering::peer_mtu].
14887 ///
14888 /// # Example
14889 /// ```ignore,no_run
14890 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14891 /// let x = NetworkPeering::new().set_peer_mtu(42);
14892 /// ```
14893 pub fn set_peer_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14894 self.peer_mtu = v.into();
14895 self
14896 }
14897
14898 /// Sets the value of [peer_network_type][crate::model::NetworkPeering::peer_network_type].
14899 ///
14900 /// # Example
14901 /// ```ignore,no_run
14902 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14903 /// use google_cloud_vmwareengine_v1::model::network_peering::PeerNetworkType;
14904 /// let x0 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::Standard);
14905 /// let x1 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::VmwareEngineNetwork);
14906 /// let x2 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::PrivateServicesAccess);
14907 /// ```
14908 pub fn set_peer_network_type<
14909 T: std::convert::Into<crate::model::network_peering::PeerNetworkType>,
14910 >(
14911 mut self,
14912 v: T,
14913 ) -> Self {
14914 self.peer_network_type = v.into();
14915 self
14916 }
14917
14918 /// Sets the value of [uid][crate::model::NetworkPeering::uid].
14919 ///
14920 /// # Example
14921 /// ```ignore,no_run
14922 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14923 /// let x = NetworkPeering::new().set_uid("example");
14924 /// ```
14925 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14926 self.uid = v.into();
14927 self
14928 }
14929
14930 /// Sets the value of [vmware_engine_network][crate::model::NetworkPeering::vmware_engine_network].
14931 ///
14932 /// # Example
14933 /// ```ignore,no_run
14934 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14935 /// let x = NetworkPeering::new().set_vmware_engine_network("example");
14936 /// ```
14937 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
14938 mut self,
14939 v: T,
14940 ) -> Self {
14941 self.vmware_engine_network = v.into();
14942 self
14943 }
14944
14945 /// Sets the value of [description][crate::model::NetworkPeering::description].
14946 ///
14947 /// # Example
14948 /// ```ignore,no_run
14949 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14950 /// let x = NetworkPeering::new().set_description("example");
14951 /// ```
14952 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14953 self.description = v.into();
14954 self
14955 }
14956}
14957
14958impl wkt::message::Message for NetworkPeering {
14959 fn typename() -> &'static str {
14960 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPeering"
14961 }
14962}
14963
14964/// Defines additional types related to [NetworkPeering].
14965pub mod network_peering {
14966 #[allow(unused_imports)]
14967 use super::*;
14968
14969 /// Possible states of a network peering.
14970 ///
14971 /// # Working with unknown values
14972 ///
14973 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14974 /// additional enum variants at any time. Adding new variants is not considered
14975 /// a breaking change. Applications should write their code in anticipation of:
14976 ///
14977 /// - New values appearing in future releases of the client library, **and**
14978 /// - New values received dynamically, without application changes.
14979 ///
14980 /// Please consult the [Working with enums] section in the user guide for some
14981 /// guidelines.
14982 ///
14983 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14984 #[derive(Clone, Debug, PartialEq)]
14985 #[non_exhaustive]
14986 pub enum State {
14987 /// Unspecified network peering state. This is the default value.
14988 Unspecified,
14989 /// The peering is not active.
14990 Inactive,
14991 /// The peering is active.
14992 Active,
14993 /// The peering is being created.
14994 Creating,
14995 /// The peering is being deleted.
14996 Deleting,
14997 /// If set, the enum was initialized with an unknown value.
14998 ///
14999 /// Applications can examine the value using [State::value] or
15000 /// [State::name].
15001 UnknownValue(state::UnknownValue),
15002 }
15003
15004 #[doc(hidden)]
15005 pub mod state {
15006 #[allow(unused_imports)]
15007 use super::*;
15008 #[derive(Clone, Debug, PartialEq)]
15009 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15010 }
15011
15012 impl State {
15013 /// Gets the enum value.
15014 ///
15015 /// Returns `None` if the enum contains an unknown value deserialized from
15016 /// the string representation of enums.
15017 pub fn value(&self) -> std::option::Option<i32> {
15018 match self {
15019 Self::Unspecified => std::option::Option::Some(0),
15020 Self::Inactive => std::option::Option::Some(1),
15021 Self::Active => std::option::Option::Some(2),
15022 Self::Creating => std::option::Option::Some(3),
15023 Self::Deleting => std::option::Option::Some(4),
15024 Self::UnknownValue(u) => u.0.value(),
15025 }
15026 }
15027
15028 /// Gets the enum value as a string.
15029 ///
15030 /// Returns `None` if the enum contains an unknown value deserialized from
15031 /// the integer representation of enums.
15032 pub fn name(&self) -> std::option::Option<&str> {
15033 match self {
15034 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15035 Self::Inactive => std::option::Option::Some("INACTIVE"),
15036 Self::Active => std::option::Option::Some("ACTIVE"),
15037 Self::Creating => std::option::Option::Some("CREATING"),
15038 Self::Deleting => std::option::Option::Some("DELETING"),
15039 Self::UnknownValue(u) => u.0.name(),
15040 }
15041 }
15042 }
15043
15044 impl std::default::Default for State {
15045 fn default() -> Self {
15046 use std::convert::From;
15047 Self::from(0)
15048 }
15049 }
15050
15051 impl std::fmt::Display for State {
15052 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15053 wkt::internal::display_enum(f, self.name(), self.value())
15054 }
15055 }
15056
15057 impl std::convert::From<i32> for State {
15058 fn from(value: i32) -> Self {
15059 match value {
15060 0 => Self::Unspecified,
15061 1 => Self::Inactive,
15062 2 => Self::Active,
15063 3 => Self::Creating,
15064 4 => Self::Deleting,
15065 _ => Self::UnknownValue(state::UnknownValue(
15066 wkt::internal::UnknownEnumValue::Integer(value),
15067 )),
15068 }
15069 }
15070 }
15071
15072 impl std::convert::From<&str> for State {
15073 fn from(value: &str) -> Self {
15074 use std::string::ToString;
15075 match value {
15076 "STATE_UNSPECIFIED" => Self::Unspecified,
15077 "INACTIVE" => Self::Inactive,
15078 "ACTIVE" => Self::Active,
15079 "CREATING" => Self::Creating,
15080 "DELETING" => Self::Deleting,
15081 _ => Self::UnknownValue(state::UnknownValue(
15082 wkt::internal::UnknownEnumValue::String(value.to_string()),
15083 )),
15084 }
15085 }
15086 }
15087
15088 impl serde::ser::Serialize for State {
15089 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15090 where
15091 S: serde::Serializer,
15092 {
15093 match self {
15094 Self::Unspecified => serializer.serialize_i32(0),
15095 Self::Inactive => serializer.serialize_i32(1),
15096 Self::Active => serializer.serialize_i32(2),
15097 Self::Creating => serializer.serialize_i32(3),
15098 Self::Deleting => serializer.serialize_i32(4),
15099 Self::UnknownValue(u) => u.0.serialize(serializer),
15100 }
15101 }
15102 }
15103
15104 impl<'de> serde::de::Deserialize<'de> for State {
15105 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15106 where
15107 D: serde::Deserializer<'de>,
15108 {
15109 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15110 ".google.cloud.vmwareengine.v1.NetworkPeering.State",
15111 ))
15112 }
15113 }
15114
15115 /// Type or purpose of the network peering connection.
15116 ///
15117 /// # Working with unknown values
15118 ///
15119 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15120 /// additional enum variants at any time. Adding new variants is not considered
15121 /// a breaking change. Applications should write their code in anticipation of:
15122 ///
15123 /// - New values appearing in future releases of the client library, **and**
15124 /// - New values received dynamically, without application changes.
15125 ///
15126 /// Please consult the [Working with enums] section in the user guide for some
15127 /// guidelines.
15128 ///
15129 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15130 #[derive(Clone, Debug, PartialEq)]
15131 #[non_exhaustive]
15132 pub enum PeerNetworkType {
15133 /// Unspecified
15134 Unspecified,
15135 /// Peering connection used for connecting to another VPC network established
15136 /// by the same user. For example, a peering connection to another VPC
15137 /// network in the same project or to an on-premises network.
15138 Standard,
15139 /// Peering connection used for connecting to another VMware Engine network.
15140 VmwareEngineNetwork,
15141 /// Peering connection used for establishing [private services
15142 /// access](https://cloud.google.com/vpc/docs/private-services-access).
15143 PrivateServicesAccess,
15144 /// Peering connection used for connecting to NetApp Cloud Volumes.
15145 NetappCloudVolumes,
15146 /// Peering connection used for connecting to third-party services. Most
15147 /// third-party services require manual setup of reverse peering on the VPC
15148 /// network associated with the third-party service.
15149 ThirdPartyService,
15150 /// Peering connection used for connecting to Dell PowerScale Filers
15151 DellPowerscale,
15152 /// Peering connection used for connecting to Google Cloud NetApp Volumes.
15153 GoogleCloudNetappVolumes,
15154 /// If set, the enum was initialized with an unknown value.
15155 ///
15156 /// Applications can examine the value using [PeerNetworkType::value] or
15157 /// [PeerNetworkType::name].
15158 UnknownValue(peer_network_type::UnknownValue),
15159 }
15160
15161 #[doc(hidden)]
15162 pub mod peer_network_type {
15163 #[allow(unused_imports)]
15164 use super::*;
15165 #[derive(Clone, Debug, PartialEq)]
15166 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15167 }
15168
15169 impl PeerNetworkType {
15170 /// Gets the enum value.
15171 ///
15172 /// Returns `None` if the enum contains an unknown value deserialized from
15173 /// the string representation of enums.
15174 pub fn value(&self) -> std::option::Option<i32> {
15175 match self {
15176 Self::Unspecified => std::option::Option::Some(0),
15177 Self::Standard => std::option::Option::Some(1),
15178 Self::VmwareEngineNetwork => std::option::Option::Some(2),
15179 Self::PrivateServicesAccess => std::option::Option::Some(3),
15180 Self::NetappCloudVolumes => std::option::Option::Some(4),
15181 Self::ThirdPartyService => std::option::Option::Some(5),
15182 Self::DellPowerscale => std::option::Option::Some(6),
15183 Self::GoogleCloudNetappVolumes => std::option::Option::Some(7),
15184 Self::UnknownValue(u) => u.0.value(),
15185 }
15186 }
15187
15188 /// Gets the enum value as a string.
15189 ///
15190 /// Returns `None` if the enum contains an unknown value deserialized from
15191 /// the integer representation of enums.
15192 pub fn name(&self) -> std::option::Option<&str> {
15193 match self {
15194 Self::Unspecified => std::option::Option::Some("PEER_NETWORK_TYPE_UNSPECIFIED"),
15195 Self::Standard => std::option::Option::Some("STANDARD"),
15196 Self::VmwareEngineNetwork => std::option::Option::Some("VMWARE_ENGINE_NETWORK"),
15197 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
15198 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
15199 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
15200 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
15201 Self::GoogleCloudNetappVolumes => {
15202 std::option::Option::Some("GOOGLE_CLOUD_NETAPP_VOLUMES")
15203 }
15204 Self::UnknownValue(u) => u.0.name(),
15205 }
15206 }
15207 }
15208
15209 impl std::default::Default for PeerNetworkType {
15210 fn default() -> Self {
15211 use std::convert::From;
15212 Self::from(0)
15213 }
15214 }
15215
15216 impl std::fmt::Display for PeerNetworkType {
15217 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15218 wkt::internal::display_enum(f, self.name(), self.value())
15219 }
15220 }
15221
15222 impl std::convert::From<i32> for PeerNetworkType {
15223 fn from(value: i32) -> Self {
15224 match value {
15225 0 => Self::Unspecified,
15226 1 => Self::Standard,
15227 2 => Self::VmwareEngineNetwork,
15228 3 => Self::PrivateServicesAccess,
15229 4 => Self::NetappCloudVolumes,
15230 5 => Self::ThirdPartyService,
15231 6 => Self::DellPowerscale,
15232 7 => Self::GoogleCloudNetappVolumes,
15233 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15234 wkt::internal::UnknownEnumValue::Integer(value),
15235 )),
15236 }
15237 }
15238 }
15239
15240 impl std::convert::From<&str> for PeerNetworkType {
15241 fn from(value: &str) -> Self {
15242 use std::string::ToString;
15243 match value {
15244 "PEER_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
15245 "STANDARD" => Self::Standard,
15246 "VMWARE_ENGINE_NETWORK" => Self::VmwareEngineNetwork,
15247 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
15248 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
15249 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
15250 "DELL_POWERSCALE" => Self::DellPowerscale,
15251 "GOOGLE_CLOUD_NETAPP_VOLUMES" => Self::GoogleCloudNetappVolumes,
15252 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15253 wkt::internal::UnknownEnumValue::String(value.to_string()),
15254 )),
15255 }
15256 }
15257 }
15258
15259 impl serde::ser::Serialize for PeerNetworkType {
15260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15261 where
15262 S: serde::Serializer,
15263 {
15264 match self {
15265 Self::Unspecified => serializer.serialize_i32(0),
15266 Self::Standard => serializer.serialize_i32(1),
15267 Self::VmwareEngineNetwork => serializer.serialize_i32(2),
15268 Self::PrivateServicesAccess => serializer.serialize_i32(3),
15269 Self::NetappCloudVolumes => serializer.serialize_i32(4),
15270 Self::ThirdPartyService => serializer.serialize_i32(5),
15271 Self::DellPowerscale => serializer.serialize_i32(6),
15272 Self::GoogleCloudNetappVolumes => serializer.serialize_i32(7),
15273 Self::UnknownValue(u) => u.0.serialize(serializer),
15274 }
15275 }
15276 }
15277
15278 impl<'de> serde::de::Deserialize<'de> for PeerNetworkType {
15279 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15280 where
15281 D: serde::Deserializer<'de>,
15282 {
15283 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeerNetworkType>::new(
15284 ".google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType",
15285 ))
15286 }
15287 }
15288}
15289
15290/// Exchanged network peering route.
15291#[derive(Clone, Default, PartialEq)]
15292#[non_exhaustive]
15293pub struct PeeringRoute {
15294 /// Output only. Destination range of the peering route in CIDR notation.
15295 pub dest_range: std::string::String,
15296
15297 /// Output only. Type of the route in the peer VPC network.
15298 pub r#type: crate::model::peering_route::Type,
15299
15300 /// Output only. Region containing the next hop of the peering route. This
15301 /// field only applies to dynamic routes in the peer VPC network.
15302 pub next_hop_region: std::string::String,
15303
15304 /// Output only. The priority of the peering route.
15305 pub priority: i64,
15306
15307 /// Output only. True if the peering route has been imported from a peered
15308 /// VPC network; false otherwise. The import happens if the field
15309 /// `NetworkPeering.importCustomRoutes` is true for this network,
15310 /// `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
15311 /// the import does not result in a route conflict.
15312 pub imported: bool,
15313
15314 /// Output only. Direction of the routes exchanged with the peer network, from
15315 /// the VMware Engine network perspective:
15316 ///
15317 /// * Routes of direction `INCOMING` are imported from the peer network.
15318 /// * Routes of direction `OUTGOING` are exported from the intranet VPC network
15319 /// of the VMware Engine network.
15320 pub direction: crate::model::peering_route::Direction,
15321
15322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15323}
15324
15325impl PeeringRoute {
15326 pub fn new() -> Self {
15327 std::default::Default::default()
15328 }
15329
15330 /// Sets the value of [dest_range][crate::model::PeeringRoute::dest_range].
15331 ///
15332 /// # Example
15333 /// ```ignore,no_run
15334 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15335 /// let x = PeeringRoute::new().set_dest_range("example");
15336 /// ```
15337 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15338 self.dest_range = v.into();
15339 self
15340 }
15341
15342 /// Sets the value of [r#type][crate::model::PeeringRoute::type].
15343 ///
15344 /// # Example
15345 /// ```ignore,no_run
15346 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15347 /// use google_cloud_vmwareengine_v1::model::peering_route::Type;
15348 /// let x0 = PeeringRoute::new().set_type(Type::DynamicPeeringRoute);
15349 /// let x1 = PeeringRoute::new().set_type(Type::StaticPeeringRoute);
15350 /// let x2 = PeeringRoute::new().set_type(Type::SubnetPeeringRoute);
15351 /// ```
15352 pub fn set_type<T: std::convert::Into<crate::model::peering_route::Type>>(
15353 mut self,
15354 v: T,
15355 ) -> Self {
15356 self.r#type = v.into();
15357 self
15358 }
15359
15360 /// Sets the value of [next_hop_region][crate::model::PeeringRoute::next_hop_region].
15361 ///
15362 /// # Example
15363 /// ```ignore,no_run
15364 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15365 /// let x = PeeringRoute::new().set_next_hop_region("example");
15366 /// ```
15367 pub fn set_next_hop_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15368 self.next_hop_region = v.into();
15369 self
15370 }
15371
15372 /// Sets the value of [priority][crate::model::PeeringRoute::priority].
15373 ///
15374 /// # Example
15375 /// ```ignore,no_run
15376 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15377 /// let x = PeeringRoute::new().set_priority(42);
15378 /// ```
15379 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15380 self.priority = v.into();
15381 self
15382 }
15383
15384 /// Sets the value of [imported][crate::model::PeeringRoute::imported].
15385 ///
15386 /// # Example
15387 /// ```ignore,no_run
15388 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15389 /// let x = PeeringRoute::new().set_imported(true);
15390 /// ```
15391 pub fn set_imported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15392 self.imported = v.into();
15393 self
15394 }
15395
15396 /// Sets the value of [direction][crate::model::PeeringRoute::direction].
15397 ///
15398 /// # Example
15399 /// ```ignore,no_run
15400 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15401 /// use google_cloud_vmwareengine_v1::model::peering_route::Direction;
15402 /// let x0 = PeeringRoute::new().set_direction(Direction::Incoming);
15403 /// let x1 = PeeringRoute::new().set_direction(Direction::Outgoing);
15404 /// ```
15405 pub fn set_direction<T: std::convert::Into<crate::model::peering_route::Direction>>(
15406 mut self,
15407 v: T,
15408 ) -> Self {
15409 self.direction = v.into();
15410 self
15411 }
15412}
15413
15414impl wkt::message::Message for PeeringRoute {
15415 fn typename() -> &'static str {
15416 "type.googleapis.com/google.cloud.vmwareengine.v1.PeeringRoute"
15417 }
15418}
15419
15420/// Defines additional types related to [PeeringRoute].
15421pub mod peering_route {
15422 #[allow(unused_imports)]
15423 use super::*;
15424
15425 /// The type of the peering route.
15426 ///
15427 /// # Working with unknown values
15428 ///
15429 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15430 /// additional enum variants at any time. Adding new variants is not considered
15431 /// a breaking change. Applications should write their code in anticipation of:
15432 ///
15433 /// - New values appearing in future releases of the client library, **and**
15434 /// - New values received dynamically, without application changes.
15435 ///
15436 /// Please consult the [Working with enums] section in the user guide for some
15437 /// guidelines.
15438 ///
15439 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15440 #[derive(Clone, Debug, PartialEq)]
15441 #[non_exhaustive]
15442 pub enum Type {
15443 /// Unspecified peering route type. This is the default value.
15444 Unspecified,
15445 /// Dynamic routes in the peer network.
15446 DynamicPeeringRoute,
15447 /// Static routes in the peer network.
15448 StaticPeeringRoute,
15449 /// Created, updated, and removed automatically by Google Cloud when subnets
15450 /// are created, modified, or deleted in the peer network.
15451 SubnetPeeringRoute,
15452 /// If set, the enum was initialized with an unknown value.
15453 ///
15454 /// Applications can examine the value using [Type::value] or
15455 /// [Type::name].
15456 UnknownValue(r#type::UnknownValue),
15457 }
15458
15459 #[doc(hidden)]
15460 pub mod r#type {
15461 #[allow(unused_imports)]
15462 use super::*;
15463 #[derive(Clone, Debug, PartialEq)]
15464 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15465 }
15466
15467 impl Type {
15468 /// Gets the enum value.
15469 ///
15470 /// Returns `None` if the enum contains an unknown value deserialized from
15471 /// the string representation of enums.
15472 pub fn value(&self) -> std::option::Option<i32> {
15473 match self {
15474 Self::Unspecified => std::option::Option::Some(0),
15475 Self::DynamicPeeringRoute => std::option::Option::Some(1),
15476 Self::StaticPeeringRoute => std::option::Option::Some(2),
15477 Self::SubnetPeeringRoute => std::option::Option::Some(3),
15478 Self::UnknownValue(u) => u.0.value(),
15479 }
15480 }
15481
15482 /// Gets the enum value as a string.
15483 ///
15484 /// Returns `None` if the enum contains an unknown value deserialized from
15485 /// the integer representation of enums.
15486 pub fn name(&self) -> std::option::Option<&str> {
15487 match self {
15488 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15489 Self::DynamicPeeringRoute => std::option::Option::Some("DYNAMIC_PEERING_ROUTE"),
15490 Self::StaticPeeringRoute => std::option::Option::Some("STATIC_PEERING_ROUTE"),
15491 Self::SubnetPeeringRoute => std::option::Option::Some("SUBNET_PEERING_ROUTE"),
15492 Self::UnknownValue(u) => u.0.name(),
15493 }
15494 }
15495 }
15496
15497 impl std::default::Default for Type {
15498 fn default() -> Self {
15499 use std::convert::From;
15500 Self::from(0)
15501 }
15502 }
15503
15504 impl std::fmt::Display for Type {
15505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15506 wkt::internal::display_enum(f, self.name(), self.value())
15507 }
15508 }
15509
15510 impl std::convert::From<i32> for Type {
15511 fn from(value: i32) -> Self {
15512 match value {
15513 0 => Self::Unspecified,
15514 1 => Self::DynamicPeeringRoute,
15515 2 => Self::StaticPeeringRoute,
15516 3 => Self::SubnetPeeringRoute,
15517 _ => Self::UnknownValue(r#type::UnknownValue(
15518 wkt::internal::UnknownEnumValue::Integer(value),
15519 )),
15520 }
15521 }
15522 }
15523
15524 impl std::convert::From<&str> for Type {
15525 fn from(value: &str) -> Self {
15526 use std::string::ToString;
15527 match value {
15528 "TYPE_UNSPECIFIED" => Self::Unspecified,
15529 "DYNAMIC_PEERING_ROUTE" => Self::DynamicPeeringRoute,
15530 "STATIC_PEERING_ROUTE" => Self::StaticPeeringRoute,
15531 "SUBNET_PEERING_ROUTE" => Self::SubnetPeeringRoute,
15532 _ => Self::UnknownValue(r#type::UnknownValue(
15533 wkt::internal::UnknownEnumValue::String(value.to_string()),
15534 )),
15535 }
15536 }
15537 }
15538
15539 impl serde::ser::Serialize for Type {
15540 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15541 where
15542 S: serde::Serializer,
15543 {
15544 match self {
15545 Self::Unspecified => serializer.serialize_i32(0),
15546 Self::DynamicPeeringRoute => serializer.serialize_i32(1),
15547 Self::StaticPeeringRoute => serializer.serialize_i32(2),
15548 Self::SubnetPeeringRoute => serializer.serialize_i32(3),
15549 Self::UnknownValue(u) => u.0.serialize(serializer),
15550 }
15551 }
15552 }
15553
15554 impl<'de> serde::de::Deserialize<'de> for Type {
15555 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15556 where
15557 D: serde::Deserializer<'de>,
15558 {
15559 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15560 ".google.cloud.vmwareengine.v1.PeeringRoute.Type",
15561 ))
15562 }
15563 }
15564
15565 /// The direction of the exchanged routes.
15566 ///
15567 /// # Working with unknown values
15568 ///
15569 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15570 /// additional enum variants at any time. Adding new variants is not considered
15571 /// a breaking change. Applications should write their code in anticipation of:
15572 ///
15573 /// - New values appearing in future releases of the client library, **and**
15574 /// - New values received dynamically, without application changes.
15575 ///
15576 /// Please consult the [Working with enums] section in the user guide for some
15577 /// guidelines.
15578 ///
15579 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15580 #[derive(Clone, Debug, PartialEq)]
15581 #[non_exhaustive]
15582 pub enum Direction {
15583 /// Unspecified exchanged routes direction. This is default.
15584 Unspecified,
15585 /// Routes imported from the peer network.
15586 Incoming,
15587 /// Routes exported to the peer network.
15588 Outgoing,
15589 /// If set, the enum was initialized with an unknown value.
15590 ///
15591 /// Applications can examine the value using [Direction::value] or
15592 /// [Direction::name].
15593 UnknownValue(direction::UnknownValue),
15594 }
15595
15596 #[doc(hidden)]
15597 pub mod direction {
15598 #[allow(unused_imports)]
15599 use super::*;
15600 #[derive(Clone, Debug, PartialEq)]
15601 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15602 }
15603
15604 impl Direction {
15605 /// Gets the enum value.
15606 ///
15607 /// Returns `None` if the enum contains an unknown value deserialized from
15608 /// the string representation of enums.
15609 pub fn value(&self) -> std::option::Option<i32> {
15610 match self {
15611 Self::Unspecified => std::option::Option::Some(0),
15612 Self::Incoming => std::option::Option::Some(1),
15613 Self::Outgoing => std::option::Option::Some(2),
15614 Self::UnknownValue(u) => u.0.value(),
15615 }
15616 }
15617
15618 /// Gets the enum value as a string.
15619 ///
15620 /// Returns `None` if the enum contains an unknown value deserialized from
15621 /// the integer representation of enums.
15622 pub fn name(&self) -> std::option::Option<&str> {
15623 match self {
15624 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
15625 Self::Incoming => std::option::Option::Some("INCOMING"),
15626 Self::Outgoing => std::option::Option::Some("OUTGOING"),
15627 Self::UnknownValue(u) => u.0.name(),
15628 }
15629 }
15630 }
15631
15632 impl std::default::Default for Direction {
15633 fn default() -> Self {
15634 use std::convert::From;
15635 Self::from(0)
15636 }
15637 }
15638
15639 impl std::fmt::Display for Direction {
15640 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15641 wkt::internal::display_enum(f, self.name(), self.value())
15642 }
15643 }
15644
15645 impl std::convert::From<i32> for Direction {
15646 fn from(value: i32) -> Self {
15647 match value {
15648 0 => Self::Unspecified,
15649 1 => Self::Incoming,
15650 2 => Self::Outgoing,
15651 _ => Self::UnknownValue(direction::UnknownValue(
15652 wkt::internal::UnknownEnumValue::Integer(value),
15653 )),
15654 }
15655 }
15656 }
15657
15658 impl std::convert::From<&str> for Direction {
15659 fn from(value: &str) -> Self {
15660 use std::string::ToString;
15661 match value {
15662 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
15663 "INCOMING" => Self::Incoming,
15664 "OUTGOING" => Self::Outgoing,
15665 _ => Self::UnknownValue(direction::UnknownValue(
15666 wkt::internal::UnknownEnumValue::String(value.to_string()),
15667 )),
15668 }
15669 }
15670 }
15671
15672 impl serde::ser::Serialize for Direction {
15673 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15674 where
15675 S: serde::Serializer,
15676 {
15677 match self {
15678 Self::Unspecified => serializer.serialize_i32(0),
15679 Self::Incoming => serializer.serialize_i32(1),
15680 Self::Outgoing => serializer.serialize_i32(2),
15681 Self::UnknownValue(u) => u.0.serialize(serializer),
15682 }
15683 }
15684 }
15685
15686 impl<'de> serde::de::Deserialize<'de> for Direction {
15687 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15688 where
15689 D: serde::Deserializer<'de>,
15690 {
15691 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
15692 ".google.cloud.vmwareengine.v1.PeeringRoute.Direction",
15693 ))
15694 }
15695 }
15696}
15697
15698/// Represents a network policy resource. Network policies are regional
15699/// resources. You can use a network policy to enable or disable internet access
15700/// and external IP access. Network policies are associated with a VMware Engine
15701/// network, which might span across regions. For a given region, a network
15702/// policy applies to all private clouds in the VMware Engine network associated
15703/// with the policy.
15704#[derive(Clone, Default, PartialEq)]
15705#[non_exhaustive]
15706pub struct NetworkPolicy {
15707 /// Output only. The resource name of this network policy.
15708 /// Resource names are schemeless URIs that follow the conventions in
15709 /// <https://cloud.google.com/apis/design/resource_names>.
15710 /// For example:
15711 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
15712 pub name: std::string::String,
15713
15714 /// Output only. Creation time of this resource.
15715 pub create_time: std::option::Option<wkt::Timestamp>,
15716
15717 /// Output only. Last update time of this resource.
15718 pub update_time: std::option::Option<wkt::Timestamp>,
15719
15720 /// Network service that allows VMware workloads to access the internet.
15721 pub internet_access: std::option::Option<crate::model::network_policy::NetworkService>,
15722
15723 /// Network service that allows External IP addresses to be assigned to VMware
15724 /// workloads. This service can only be enabled when `internet_access` is also
15725 /// enabled.
15726 pub external_ip: std::option::Option<crate::model::network_policy::NetworkService>,
15727
15728 /// Required. IP address range in CIDR notation used to create internet access
15729 /// and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
15730 /// required. The range cannot overlap with any prefixes either in the consumer
15731 /// VPC network or in use by the private clouds attached to that VPC network.
15732 pub edge_services_cidr: std::string::String,
15733
15734 /// Output only. System-generated unique identifier for the resource.
15735 pub uid: std::string::String,
15736
15737 /// Optional. The relative resource name of the VMware Engine network.
15738 /// Specify the name in the following form:
15739 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15740 /// where `{project}` can either be a project number or a project ID.
15741 pub vmware_engine_network: std::string::String,
15742
15743 /// Optional. User-provided description for this network policy.
15744 pub description: std::string::String,
15745
15746 /// Output only. The canonical name of the VMware Engine network in the form:
15747 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15748 pub vmware_engine_network_canonical: std::string::String,
15749
15750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15751}
15752
15753impl NetworkPolicy {
15754 pub fn new() -> Self {
15755 std::default::Default::default()
15756 }
15757
15758 /// Sets the value of [name][crate::model::NetworkPolicy::name].
15759 ///
15760 /// # Example
15761 /// ```ignore,no_run
15762 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15763 /// let x = NetworkPolicy::new().set_name("example");
15764 /// ```
15765 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15766 self.name = v.into();
15767 self
15768 }
15769
15770 /// Sets the value of [create_time][crate::model::NetworkPolicy::create_time].
15771 ///
15772 /// # Example
15773 /// ```ignore,no_run
15774 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15775 /// use wkt::Timestamp;
15776 /// let x = NetworkPolicy::new().set_create_time(Timestamp::default()/* use setters */);
15777 /// ```
15778 pub fn set_create_time<T>(mut self, v: T) -> Self
15779 where
15780 T: std::convert::Into<wkt::Timestamp>,
15781 {
15782 self.create_time = std::option::Option::Some(v.into());
15783 self
15784 }
15785
15786 /// Sets or clears the value of [create_time][crate::model::NetworkPolicy::create_time].
15787 ///
15788 /// # Example
15789 /// ```ignore,no_run
15790 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15791 /// use wkt::Timestamp;
15792 /// let x = NetworkPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15793 /// let x = NetworkPolicy::new().set_or_clear_create_time(None::<Timestamp>);
15794 /// ```
15795 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15796 where
15797 T: std::convert::Into<wkt::Timestamp>,
15798 {
15799 self.create_time = v.map(|x| x.into());
15800 self
15801 }
15802
15803 /// Sets the value of [update_time][crate::model::NetworkPolicy::update_time].
15804 ///
15805 /// # Example
15806 /// ```ignore,no_run
15807 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15808 /// use wkt::Timestamp;
15809 /// let x = NetworkPolicy::new().set_update_time(Timestamp::default()/* use setters */);
15810 /// ```
15811 pub fn set_update_time<T>(mut self, v: T) -> Self
15812 where
15813 T: std::convert::Into<wkt::Timestamp>,
15814 {
15815 self.update_time = std::option::Option::Some(v.into());
15816 self
15817 }
15818
15819 /// Sets or clears the value of [update_time][crate::model::NetworkPolicy::update_time].
15820 ///
15821 /// # Example
15822 /// ```ignore,no_run
15823 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15824 /// use wkt::Timestamp;
15825 /// let x = NetworkPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15826 /// let x = NetworkPolicy::new().set_or_clear_update_time(None::<Timestamp>);
15827 /// ```
15828 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15829 where
15830 T: std::convert::Into<wkt::Timestamp>,
15831 {
15832 self.update_time = v.map(|x| x.into());
15833 self
15834 }
15835
15836 /// Sets the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15837 ///
15838 /// # Example
15839 /// ```ignore,no_run
15840 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15841 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15842 /// let x = NetworkPolicy::new().set_internet_access(NetworkService::default()/* use setters */);
15843 /// ```
15844 pub fn set_internet_access<T>(mut self, v: T) -> Self
15845 where
15846 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15847 {
15848 self.internet_access = std::option::Option::Some(v.into());
15849 self
15850 }
15851
15852 /// Sets or clears the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15853 ///
15854 /// # Example
15855 /// ```ignore,no_run
15856 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15857 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15858 /// let x = NetworkPolicy::new().set_or_clear_internet_access(Some(NetworkService::default()/* use setters */));
15859 /// let x = NetworkPolicy::new().set_or_clear_internet_access(None::<NetworkService>);
15860 /// ```
15861 pub fn set_or_clear_internet_access<T>(mut self, v: std::option::Option<T>) -> Self
15862 where
15863 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15864 {
15865 self.internet_access = v.map(|x| x.into());
15866 self
15867 }
15868
15869 /// Sets the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15870 ///
15871 /// # Example
15872 /// ```ignore,no_run
15873 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15874 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15875 /// let x = NetworkPolicy::new().set_external_ip(NetworkService::default()/* use setters */);
15876 /// ```
15877 pub fn set_external_ip<T>(mut self, v: T) -> Self
15878 where
15879 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15880 {
15881 self.external_ip = std::option::Option::Some(v.into());
15882 self
15883 }
15884
15885 /// Sets or clears the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15886 ///
15887 /// # Example
15888 /// ```ignore,no_run
15889 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15890 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15891 /// let x = NetworkPolicy::new().set_or_clear_external_ip(Some(NetworkService::default()/* use setters */));
15892 /// let x = NetworkPolicy::new().set_or_clear_external_ip(None::<NetworkService>);
15893 /// ```
15894 pub fn set_or_clear_external_ip<T>(mut self, v: std::option::Option<T>) -> Self
15895 where
15896 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15897 {
15898 self.external_ip = v.map(|x| x.into());
15899 self
15900 }
15901
15902 /// Sets the value of [edge_services_cidr][crate::model::NetworkPolicy::edge_services_cidr].
15903 ///
15904 /// # Example
15905 /// ```ignore,no_run
15906 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15907 /// let x = NetworkPolicy::new().set_edge_services_cidr("example");
15908 /// ```
15909 pub fn set_edge_services_cidr<T: std::convert::Into<std::string::String>>(
15910 mut self,
15911 v: T,
15912 ) -> Self {
15913 self.edge_services_cidr = v.into();
15914 self
15915 }
15916
15917 /// Sets the value of [uid][crate::model::NetworkPolicy::uid].
15918 ///
15919 /// # Example
15920 /// ```ignore,no_run
15921 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15922 /// let x = NetworkPolicy::new().set_uid("example");
15923 /// ```
15924 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15925 self.uid = v.into();
15926 self
15927 }
15928
15929 /// Sets the value of [vmware_engine_network][crate::model::NetworkPolicy::vmware_engine_network].
15930 ///
15931 /// # Example
15932 /// ```ignore,no_run
15933 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15934 /// let x = NetworkPolicy::new().set_vmware_engine_network("example");
15935 /// ```
15936 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
15937 mut self,
15938 v: T,
15939 ) -> Self {
15940 self.vmware_engine_network = v.into();
15941 self
15942 }
15943
15944 /// Sets the value of [description][crate::model::NetworkPolicy::description].
15945 ///
15946 /// # Example
15947 /// ```ignore,no_run
15948 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15949 /// let x = NetworkPolicy::new().set_description("example");
15950 /// ```
15951 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15952 self.description = v.into();
15953 self
15954 }
15955
15956 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkPolicy::vmware_engine_network_canonical].
15957 ///
15958 /// # Example
15959 /// ```ignore,no_run
15960 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15961 /// let x = NetworkPolicy::new().set_vmware_engine_network_canonical("example");
15962 /// ```
15963 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
15964 mut self,
15965 v: T,
15966 ) -> Self {
15967 self.vmware_engine_network_canonical = v.into();
15968 self
15969 }
15970}
15971
15972impl wkt::message::Message for NetworkPolicy {
15973 fn typename() -> &'static str {
15974 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy"
15975 }
15976}
15977
15978/// Defines additional types related to [NetworkPolicy].
15979pub mod network_policy {
15980 #[allow(unused_imports)]
15981 use super::*;
15982
15983 /// Represents a network service that is managed by a `NetworkPolicy` resource.
15984 /// A network service provides a way to control an aspect of external access to
15985 /// VMware workloads. For example, whether the VMware workloads in the
15986 /// private clouds governed by a network policy can access or be accessed from
15987 /// the internet.
15988 #[derive(Clone, Default, PartialEq)]
15989 #[non_exhaustive]
15990 pub struct NetworkService {
15991 /// True if the service is enabled; false otherwise.
15992 pub enabled: bool,
15993
15994 /// Output only. State of the service. New values may be added to this enum
15995 /// when appropriate.
15996 pub state: crate::model::network_policy::network_service::State,
15997
15998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15999 }
16000
16001 impl NetworkService {
16002 pub fn new() -> Self {
16003 std::default::Default::default()
16004 }
16005
16006 /// Sets the value of [enabled][crate::model::network_policy::NetworkService::enabled].
16007 ///
16008 /// # Example
16009 /// ```ignore,no_run
16010 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16011 /// let x = NetworkService::new().set_enabled(true);
16012 /// ```
16013 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16014 self.enabled = v.into();
16015 self
16016 }
16017
16018 /// Sets the value of [state][crate::model::network_policy::NetworkService::state].
16019 ///
16020 /// # Example
16021 /// ```ignore,no_run
16022 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16023 /// use google_cloud_vmwareengine_v1::model::network_policy::network_service::State;
16024 /// let x0 = NetworkService::new().set_state(State::Unprovisioned);
16025 /// let x1 = NetworkService::new().set_state(State::Reconciling);
16026 /// let x2 = NetworkService::new().set_state(State::Active);
16027 /// ```
16028 pub fn set_state<
16029 T: std::convert::Into<crate::model::network_policy::network_service::State>,
16030 >(
16031 mut self,
16032 v: T,
16033 ) -> Self {
16034 self.state = v.into();
16035 self
16036 }
16037 }
16038
16039 impl wkt::message::Message for NetworkService {
16040 fn typename() -> &'static str {
16041 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"
16042 }
16043 }
16044
16045 /// Defines additional types related to [NetworkService].
16046 pub mod network_service {
16047 #[allow(unused_imports)]
16048 use super::*;
16049
16050 /// Enum State defines possible states of a network policy controlled
16051 /// service.
16052 ///
16053 /// # Working with unknown values
16054 ///
16055 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16056 /// additional enum variants at any time. Adding new variants is not considered
16057 /// a breaking change. Applications should write their code in anticipation of:
16058 ///
16059 /// - New values appearing in future releases of the client library, **and**
16060 /// - New values received dynamically, without application changes.
16061 ///
16062 /// Please consult the [Working with enums] section in the user guide for some
16063 /// guidelines.
16064 ///
16065 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16066 #[derive(Clone, Debug, PartialEq)]
16067 #[non_exhaustive]
16068 pub enum State {
16069 /// Unspecified service state. This is the default value.
16070 Unspecified,
16071 /// Service is not provisioned.
16072 Unprovisioned,
16073 /// Service is in the process of being provisioned/deprovisioned.
16074 Reconciling,
16075 /// Service is active.
16076 Active,
16077 /// If set, the enum was initialized with an unknown value.
16078 ///
16079 /// Applications can examine the value using [State::value] or
16080 /// [State::name].
16081 UnknownValue(state::UnknownValue),
16082 }
16083
16084 #[doc(hidden)]
16085 pub mod state {
16086 #[allow(unused_imports)]
16087 use super::*;
16088 #[derive(Clone, Debug, PartialEq)]
16089 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16090 }
16091
16092 impl State {
16093 /// Gets the enum value.
16094 ///
16095 /// Returns `None` if the enum contains an unknown value deserialized from
16096 /// the string representation of enums.
16097 pub fn value(&self) -> std::option::Option<i32> {
16098 match self {
16099 Self::Unspecified => std::option::Option::Some(0),
16100 Self::Unprovisioned => std::option::Option::Some(1),
16101 Self::Reconciling => std::option::Option::Some(2),
16102 Self::Active => std::option::Option::Some(3),
16103 Self::UnknownValue(u) => u.0.value(),
16104 }
16105 }
16106
16107 /// Gets the enum value as a string.
16108 ///
16109 /// Returns `None` if the enum contains an unknown value deserialized from
16110 /// the integer representation of enums.
16111 pub fn name(&self) -> std::option::Option<&str> {
16112 match self {
16113 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16114 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
16115 Self::Reconciling => std::option::Option::Some("RECONCILING"),
16116 Self::Active => std::option::Option::Some("ACTIVE"),
16117 Self::UnknownValue(u) => u.0.name(),
16118 }
16119 }
16120 }
16121
16122 impl std::default::Default for State {
16123 fn default() -> Self {
16124 use std::convert::From;
16125 Self::from(0)
16126 }
16127 }
16128
16129 impl std::fmt::Display for State {
16130 fn fmt(
16131 &self,
16132 f: &mut std::fmt::Formatter<'_>,
16133 ) -> std::result::Result<(), std::fmt::Error> {
16134 wkt::internal::display_enum(f, self.name(), self.value())
16135 }
16136 }
16137
16138 impl std::convert::From<i32> for State {
16139 fn from(value: i32) -> Self {
16140 match value {
16141 0 => Self::Unspecified,
16142 1 => Self::Unprovisioned,
16143 2 => Self::Reconciling,
16144 3 => Self::Active,
16145 _ => Self::UnknownValue(state::UnknownValue(
16146 wkt::internal::UnknownEnumValue::Integer(value),
16147 )),
16148 }
16149 }
16150 }
16151
16152 impl std::convert::From<&str> for State {
16153 fn from(value: &str) -> Self {
16154 use std::string::ToString;
16155 match value {
16156 "STATE_UNSPECIFIED" => Self::Unspecified,
16157 "UNPROVISIONED" => Self::Unprovisioned,
16158 "RECONCILING" => Self::Reconciling,
16159 "ACTIVE" => Self::Active,
16160 _ => Self::UnknownValue(state::UnknownValue(
16161 wkt::internal::UnknownEnumValue::String(value.to_string()),
16162 )),
16163 }
16164 }
16165 }
16166
16167 impl serde::ser::Serialize for State {
16168 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16169 where
16170 S: serde::Serializer,
16171 {
16172 match self {
16173 Self::Unspecified => serializer.serialize_i32(0),
16174 Self::Unprovisioned => serializer.serialize_i32(1),
16175 Self::Reconciling => serializer.serialize_i32(2),
16176 Self::Active => serializer.serialize_i32(3),
16177 Self::UnknownValue(u) => u.0.serialize(serializer),
16178 }
16179 }
16180 }
16181
16182 impl<'de> serde::de::Deserialize<'de> for State {
16183 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16184 where
16185 D: serde::Deserializer<'de>,
16186 {
16187 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16188 ".google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State",
16189 ))
16190 }
16191 }
16192 }
16193}
16194
16195/// Represents a binding between a network and the management DNS zone.
16196/// A management DNS zone is the Cloud DNS cross-project binding zone that
16197/// VMware Engine creates for each private cloud. It contains FQDNs and
16198/// corresponding IP addresses for the private cloud's ESXi hosts and management
16199/// VM appliances like vCenter and NSX Manager.
16200#[derive(Clone, Default, PartialEq)]
16201#[non_exhaustive]
16202pub struct ManagementDnsZoneBinding {
16203 /// Output only. The resource name of this binding.
16204 /// Resource names are schemeless URIs that follow the conventions in
16205 /// <https://cloud.google.com/apis/design/resource_names>.
16206 /// For example:
16207 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16208 pub name: std::string::String,
16209
16210 /// Output only. Creation time of this resource.
16211 pub create_time: std::option::Option<wkt::Timestamp>,
16212
16213 /// Output only. Last update time of this resource.
16214 pub update_time: std::option::Option<wkt::Timestamp>,
16215
16216 /// Output only. The state of the resource.
16217 pub state: crate::model::management_dns_zone_binding::State,
16218
16219 /// User-provided description for this resource.
16220 pub description: std::string::String,
16221
16222 /// Output only. System-generated unique identifier for the resource.
16223 pub uid: std::string::String,
16224
16225 /// Required. The relative resource name of the network to bind to the
16226 /// management DNS zone. This network can be a consumer VPC network or a
16227 /// VMware engine network.
16228 pub bind_network: std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16229
16230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16231}
16232
16233impl ManagementDnsZoneBinding {
16234 pub fn new() -> Self {
16235 std::default::Default::default()
16236 }
16237
16238 /// Sets the value of [name][crate::model::ManagementDnsZoneBinding::name].
16239 ///
16240 /// # Example
16241 /// ```ignore,no_run
16242 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16243 /// let x = ManagementDnsZoneBinding::new().set_name("example");
16244 /// ```
16245 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16246 self.name = v.into();
16247 self
16248 }
16249
16250 /// Sets the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16251 ///
16252 /// # Example
16253 /// ```ignore,no_run
16254 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16255 /// use wkt::Timestamp;
16256 /// let x = ManagementDnsZoneBinding::new().set_create_time(Timestamp::default()/* use setters */);
16257 /// ```
16258 pub fn set_create_time<T>(mut self, v: T) -> Self
16259 where
16260 T: std::convert::Into<wkt::Timestamp>,
16261 {
16262 self.create_time = std::option::Option::Some(v.into());
16263 self
16264 }
16265
16266 /// Sets or clears the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16267 ///
16268 /// # Example
16269 /// ```ignore,no_run
16270 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16271 /// use wkt::Timestamp;
16272 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16273 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(None::<Timestamp>);
16274 /// ```
16275 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16276 where
16277 T: std::convert::Into<wkt::Timestamp>,
16278 {
16279 self.create_time = v.map(|x| x.into());
16280 self
16281 }
16282
16283 /// Sets the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16284 ///
16285 /// # Example
16286 /// ```ignore,no_run
16287 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16288 /// use wkt::Timestamp;
16289 /// let x = ManagementDnsZoneBinding::new().set_update_time(Timestamp::default()/* use setters */);
16290 /// ```
16291 pub fn set_update_time<T>(mut self, v: T) -> Self
16292 where
16293 T: std::convert::Into<wkt::Timestamp>,
16294 {
16295 self.update_time = std::option::Option::Some(v.into());
16296 self
16297 }
16298
16299 /// Sets or clears the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16300 ///
16301 /// # Example
16302 /// ```ignore,no_run
16303 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16304 /// use wkt::Timestamp;
16305 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16306 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(None::<Timestamp>);
16307 /// ```
16308 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16309 where
16310 T: std::convert::Into<wkt::Timestamp>,
16311 {
16312 self.update_time = v.map(|x| x.into());
16313 self
16314 }
16315
16316 /// Sets the value of [state][crate::model::ManagementDnsZoneBinding::state].
16317 ///
16318 /// # Example
16319 /// ```ignore,no_run
16320 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16321 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::State;
16322 /// let x0 = ManagementDnsZoneBinding::new().set_state(State::Active);
16323 /// let x1 = ManagementDnsZoneBinding::new().set_state(State::Creating);
16324 /// let x2 = ManagementDnsZoneBinding::new().set_state(State::Updating);
16325 /// ```
16326 pub fn set_state<T: std::convert::Into<crate::model::management_dns_zone_binding::State>>(
16327 mut self,
16328 v: T,
16329 ) -> Self {
16330 self.state = v.into();
16331 self
16332 }
16333
16334 /// Sets the value of [description][crate::model::ManagementDnsZoneBinding::description].
16335 ///
16336 /// # Example
16337 /// ```ignore,no_run
16338 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16339 /// let x = ManagementDnsZoneBinding::new().set_description("example");
16340 /// ```
16341 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16342 self.description = v.into();
16343 self
16344 }
16345
16346 /// Sets the value of [uid][crate::model::ManagementDnsZoneBinding::uid].
16347 ///
16348 /// # Example
16349 /// ```ignore,no_run
16350 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16351 /// let x = ManagementDnsZoneBinding::new().set_uid("example");
16352 /// ```
16353 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16354 self.uid = v.into();
16355 self
16356 }
16357
16358 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network].
16359 ///
16360 /// Note that all the setters affecting `bind_network` are mutually
16361 /// exclusive.
16362 ///
16363 /// # Example
16364 /// ```ignore,no_run
16365 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16366 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::BindNetwork;
16367 /// let x = ManagementDnsZoneBinding::new().set_bind_network(Some(BindNetwork::VpcNetwork("example".to_string())));
16368 /// ```
16369 pub fn set_bind_network<
16370 T: std::convert::Into<
16371 std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16372 >,
16373 >(
16374 mut self,
16375 v: T,
16376 ) -> Self {
16377 self.bind_network = v.into();
16378 self
16379 }
16380
16381 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16382 /// if it holds a `VpcNetwork`, `None` if the field is not set or
16383 /// holds a different branch.
16384 pub fn vpc_network(&self) -> std::option::Option<&std::string::String> {
16385 #[allow(unreachable_patterns)]
16386 self.bind_network.as_ref().and_then(|v| match v {
16387 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v) => {
16388 std::option::Option::Some(v)
16389 }
16390 _ => std::option::Option::None,
16391 })
16392 }
16393
16394 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16395 /// to hold a `VpcNetwork`.
16396 ///
16397 /// Note that all the setters affecting `bind_network` are
16398 /// mutually exclusive.
16399 ///
16400 /// # Example
16401 /// ```ignore,no_run
16402 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16403 /// let x = ManagementDnsZoneBinding::new().set_vpc_network("example");
16404 /// assert!(x.vpc_network().is_some());
16405 /// assert!(x.vmware_engine_network().is_none());
16406 /// ```
16407 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16408 self.bind_network = std::option::Option::Some(
16409 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v.into()),
16410 );
16411 self
16412 }
16413
16414 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16415 /// if it holds a `VmwareEngineNetwork`, `None` if the field is not set or
16416 /// holds a different branch.
16417 pub fn vmware_engine_network(&self) -> std::option::Option<&std::string::String> {
16418 #[allow(unreachable_patterns)]
16419 self.bind_network.as_ref().and_then(|v| match v {
16420 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v) => {
16421 std::option::Option::Some(v)
16422 }
16423 _ => std::option::Option::None,
16424 })
16425 }
16426
16427 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16428 /// to hold a `VmwareEngineNetwork`.
16429 ///
16430 /// Note that all the setters affecting `bind_network` are
16431 /// mutually exclusive.
16432 ///
16433 /// # Example
16434 /// ```ignore,no_run
16435 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16436 /// let x = ManagementDnsZoneBinding::new().set_vmware_engine_network("example");
16437 /// assert!(x.vmware_engine_network().is_some());
16438 /// assert!(x.vpc_network().is_none());
16439 /// ```
16440 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
16441 mut self,
16442 v: T,
16443 ) -> Self {
16444 self.bind_network = std::option::Option::Some(
16445 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v.into()),
16446 );
16447 self
16448 }
16449}
16450
16451impl wkt::message::Message for ManagementDnsZoneBinding {
16452 fn typename() -> &'static str {
16453 "type.googleapis.com/google.cloud.vmwareengine.v1.ManagementDnsZoneBinding"
16454 }
16455}
16456
16457/// Defines additional types related to [ManagementDnsZoneBinding].
16458pub mod management_dns_zone_binding {
16459 #[allow(unused_imports)]
16460 use super::*;
16461
16462 /// Enum State defines possible states of binding between the consumer VPC
16463 /// network and the management DNS zone.
16464 ///
16465 /// # Working with unknown values
16466 ///
16467 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16468 /// additional enum variants at any time. Adding new variants is not considered
16469 /// a breaking change. Applications should write their code in anticipation of:
16470 ///
16471 /// - New values appearing in future releases of the client library, **and**
16472 /// - New values received dynamically, without application changes.
16473 ///
16474 /// Please consult the [Working with enums] section in the user guide for some
16475 /// guidelines.
16476 ///
16477 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16478 #[derive(Clone, Debug, PartialEq)]
16479 #[non_exhaustive]
16480 pub enum State {
16481 /// The default value. This value should never be used.
16482 Unspecified,
16483 /// The binding is ready.
16484 Active,
16485 /// The binding is being created.
16486 Creating,
16487 /// The binding is being updated.
16488 Updating,
16489 /// The binding is being deleted.
16490 Deleting,
16491 /// The binding has failed.
16492 Failed,
16493 /// If set, the enum was initialized with an unknown value.
16494 ///
16495 /// Applications can examine the value using [State::value] or
16496 /// [State::name].
16497 UnknownValue(state::UnknownValue),
16498 }
16499
16500 #[doc(hidden)]
16501 pub mod state {
16502 #[allow(unused_imports)]
16503 use super::*;
16504 #[derive(Clone, Debug, PartialEq)]
16505 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16506 }
16507
16508 impl State {
16509 /// Gets the enum value.
16510 ///
16511 /// Returns `None` if the enum contains an unknown value deserialized from
16512 /// the string representation of enums.
16513 pub fn value(&self) -> std::option::Option<i32> {
16514 match self {
16515 Self::Unspecified => std::option::Option::Some(0),
16516 Self::Active => std::option::Option::Some(1),
16517 Self::Creating => std::option::Option::Some(2),
16518 Self::Updating => std::option::Option::Some(3),
16519 Self::Deleting => std::option::Option::Some(4),
16520 Self::Failed => std::option::Option::Some(5),
16521 Self::UnknownValue(u) => u.0.value(),
16522 }
16523 }
16524
16525 /// Gets the enum value as a string.
16526 ///
16527 /// Returns `None` if the enum contains an unknown value deserialized from
16528 /// the integer representation of enums.
16529 pub fn name(&self) -> std::option::Option<&str> {
16530 match self {
16531 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16532 Self::Active => std::option::Option::Some("ACTIVE"),
16533 Self::Creating => std::option::Option::Some("CREATING"),
16534 Self::Updating => std::option::Option::Some("UPDATING"),
16535 Self::Deleting => std::option::Option::Some("DELETING"),
16536 Self::Failed => std::option::Option::Some("FAILED"),
16537 Self::UnknownValue(u) => u.0.name(),
16538 }
16539 }
16540 }
16541
16542 impl std::default::Default for State {
16543 fn default() -> Self {
16544 use std::convert::From;
16545 Self::from(0)
16546 }
16547 }
16548
16549 impl std::fmt::Display for State {
16550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16551 wkt::internal::display_enum(f, self.name(), self.value())
16552 }
16553 }
16554
16555 impl std::convert::From<i32> for State {
16556 fn from(value: i32) -> Self {
16557 match value {
16558 0 => Self::Unspecified,
16559 1 => Self::Active,
16560 2 => Self::Creating,
16561 3 => Self::Updating,
16562 4 => Self::Deleting,
16563 5 => Self::Failed,
16564 _ => Self::UnknownValue(state::UnknownValue(
16565 wkt::internal::UnknownEnumValue::Integer(value),
16566 )),
16567 }
16568 }
16569 }
16570
16571 impl std::convert::From<&str> for State {
16572 fn from(value: &str) -> Self {
16573 use std::string::ToString;
16574 match value {
16575 "STATE_UNSPECIFIED" => Self::Unspecified,
16576 "ACTIVE" => Self::Active,
16577 "CREATING" => Self::Creating,
16578 "UPDATING" => Self::Updating,
16579 "DELETING" => Self::Deleting,
16580 "FAILED" => Self::Failed,
16581 _ => Self::UnknownValue(state::UnknownValue(
16582 wkt::internal::UnknownEnumValue::String(value.to_string()),
16583 )),
16584 }
16585 }
16586 }
16587
16588 impl serde::ser::Serialize for State {
16589 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16590 where
16591 S: serde::Serializer,
16592 {
16593 match self {
16594 Self::Unspecified => serializer.serialize_i32(0),
16595 Self::Active => serializer.serialize_i32(1),
16596 Self::Creating => serializer.serialize_i32(2),
16597 Self::Updating => serializer.serialize_i32(3),
16598 Self::Deleting => serializer.serialize_i32(4),
16599 Self::Failed => serializer.serialize_i32(5),
16600 Self::UnknownValue(u) => u.0.serialize(serializer),
16601 }
16602 }
16603 }
16604
16605 impl<'de> serde::de::Deserialize<'de> for State {
16606 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16607 where
16608 D: serde::Deserializer<'de>,
16609 {
16610 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16611 ".google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State",
16612 ))
16613 }
16614 }
16615
16616 /// Required. The relative resource name of the network to bind to the
16617 /// management DNS zone. This network can be a consumer VPC network or a
16618 /// VMware engine network.
16619 #[derive(Clone, Debug, PartialEq)]
16620 #[non_exhaustive]
16621 pub enum BindNetwork {
16622 /// Network to bind is a standard consumer VPC.
16623 /// Specify the name in the following form for consumer
16624 /// VPC network: `projects/{project}/global/networks/{network_id}`.
16625 /// `{project}` can either be a project number or a project ID.
16626 VpcNetwork(std::string::String),
16627 /// Network to bind is a VMware Engine network.
16628 /// Specify the name in the following form for VMware engine network:
16629 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
16630 /// `{project}` can either be a project number or a project ID.
16631 VmwareEngineNetwork(std::string::String),
16632 }
16633}
16634
16635/// VMware Engine network resource that provides connectivity for VMware Engine
16636/// private clouds.
16637#[derive(Clone, Default, PartialEq)]
16638#[non_exhaustive]
16639pub struct VmwareEngineNetwork {
16640 /// Output only. The resource name of the VMware Engine network.
16641 /// Resource names are schemeless URIs that follow the conventions in
16642 /// <https://cloud.google.com/apis/design/resource_names>.
16643 /// For example:
16644 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
16645 pub name: std::string::String,
16646
16647 /// Output only. Creation time of this resource.
16648 pub create_time: std::option::Option<wkt::Timestamp>,
16649
16650 /// Output only. Last update time of this resource.
16651 pub update_time: std::option::Option<wkt::Timestamp>,
16652
16653 /// User-provided description for this VMware Engine network.
16654 pub description: std::string::String,
16655
16656 /// Output only. VMware Engine service VPC networks that provide connectivity
16657 /// from a private cloud to customer projects, the internet, and other Google
16658 /// Cloud services.
16659 pub vpc_networks: std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
16660
16661 /// Output only. State of the VMware Engine network.
16662 pub state: crate::model::vmware_engine_network::State,
16663
16664 /// Required. VMware Engine network type.
16665 pub r#type: crate::model::vmware_engine_network::Type,
16666
16667 /// Output only. System-generated unique identifier for the resource.
16668 pub uid: std::string::String,
16669
16670 /// Checksum that may be sent on update and delete requests to ensure that the
16671 /// user-provided value is up to date before the server processes a request.
16672 /// The server computes checksums based on the value of other fields in the
16673 /// request.
16674 pub etag: std::string::String,
16675
16676 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16677}
16678
16679impl VmwareEngineNetwork {
16680 pub fn new() -> Self {
16681 std::default::Default::default()
16682 }
16683
16684 /// Sets the value of [name][crate::model::VmwareEngineNetwork::name].
16685 ///
16686 /// # Example
16687 /// ```ignore,no_run
16688 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16689 /// let x = VmwareEngineNetwork::new().set_name("example");
16690 /// ```
16691 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16692 self.name = v.into();
16693 self
16694 }
16695
16696 /// Sets the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16697 ///
16698 /// # Example
16699 /// ```ignore,no_run
16700 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16701 /// use wkt::Timestamp;
16702 /// let x = VmwareEngineNetwork::new().set_create_time(Timestamp::default()/* use setters */);
16703 /// ```
16704 pub fn set_create_time<T>(mut self, v: T) -> Self
16705 where
16706 T: std::convert::Into<wkt::Timestamp>,
16707 {
16708 self.create_time = std::option::Option::Some(v.into());
16709 self
16710 }
16711
16712 /// Sets or clears the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16713 ///
16714 /// # Example
16715 /// ```ignore,no_run
16716 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16717 /// use wkt::Timestamp;
16718 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16719 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(None::<Timestamp>);
16720 /// ```
16721 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16722 where
16723 T: std::convert::Into<wkt::Timestamp>,
16724 {
16725 self.create_time = v.map(|x| x.into());
16726 self
16727 }
16728
16729 /// Sets the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16730 ///
16731 /// # Example
16732 /// ```ignore,no_run
16733 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16734 /// use wkt::Timestamp;
16735 /// let x = VmwareEngineNetwork::new().set_update_time(Timestamp::default()/* use setters */);
16736 /// ```
16737 pub fn set_update_time<T>(mut self, v: T) -> Self
16738 where
16739 T: std::convert::Into<wkt::Timestamp>,
16740 {
16741 self.update_time = std::option::Option::Some(v.into());
16742 self
16743 }
16744
16745 /// Sets or clears the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16746 ///
16747 /// # Example
16748 /// ```ignore,no_run
16749 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16750 /// use wkt::Timestamp;
16751 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16752 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(None::<Timestamp>);
16753 /// ```
16754 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16755 where
16756 T: std::convert::Into<wkt::Timestamp>,
16757 {
16758 self.update_time = v.map(|x| x.into());
16759 self
16760 }
16761
16762 /// Sets the value of [description][crate::model::VmwareEngineNetwork::description].
16763 ///
16764 /// # Example
16765 /// ```ignore,no_run
16766 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16767 /// let x = VmwareEngineNetwork::new().set_description("example");
16768 /// ```
16769 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16770 self.description = v.into();
16771 self
16772 }
16773
16774 /// Sets the value of [vpc_networks][crate::model::VmwareEngineNetwork::vpc_networks].
16775 ///
16776 /// # Example
16777 /// ```ignore,no_run
16778 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16779 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16780 /// let x = VmwareEngineNetwork::new()
16781 /// .set_vpc_networks([
16782 /// VpcNetwork::default()/* use setters */,
16783 /// VpcNetwork::default()/* use (different) setters */,
16784 /// ]);
16785 /// ```
16786 pub fn set_vpc_networks<T, V>(mut self, v: T) -> Self
16787 where
16788 T: std::iter::IntoIterator<Item = V>,
16789 V: std::convert::Into<crate::model::vmware_engine_network::VpcNetwork>,
16790 {
16791 use std::iter::Iterator;
16792 self.vpc_networks = v.into_iter().map(|i| i.into()).collect();
16793 self
16794 }
16795
16796 /// Sets the value of [state][crate::model::VmwareEngineNetwork::state].
16797 ///
16798 /// # Example
16799 /// ```ignore,no_run
16800 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16801 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::State;
16802 /// let x0 = VmwareEngineNetwork::new().set_state(State::Creating);
16803 /// let x1 = VmwareEngineNetwork::new().set_state(State::Active);
16804 /// let x2 = VmwareEngineNetwork::new().set_state(State::Updating);
16805 /// ```
16806 pub fn set_state<T: std::convert::Into<crate::model::vmware_engine_network::State>>(
16807 mut self,
16808 v: T,
16809 ) -> Self {
16810 self.state = v.into();
16811 self
16812 }
16813
16814 /// Sets the value of [r#type][crate::model::VmwareEngineNetwork::type].
16815 ///
16816 /// # Example
16817 /// ```ignore,no_run
16818 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16819 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::Type;
16820 /// let x0 = VmwareEngineNetwork::new().set_type(Type::Legacy);
16821 /// let x1 = VmwareEngineNetwork::new().set_type(Type::Standard);
16822 /// ```
16823 pub fn set_type<T: std::convert::Into<crate::model::vmware_engine_network::Type>>(
16824 mut self,
16825 v: T,
16826 ) -> Self {
16827 self.r#type = v.into();
16828 self
16829 }
16830
16831 /// Sets the value of [uid][crate::model::VmwareEngineNetwork::uid].
16832 ///
16833 /// # Example
16834 /// ```ignore,no_run
16835 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16836 /// let x = VmwareEngineNetwork::new().set_uid("example");
16837 /// ```
16838 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16839 self.uid = v.into();
16840 self
16841 }
16842
16843 /// Sets the value of [etag][crate::model::VmwareEngineNetwork::etag].
16844 ///
16845 /// # Example
16846 /// ```ignore,no_run
16847 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16848 /// let x = VmwareEngineNetwork::new().set_etag("example");
16849 /// ```
16850 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16851 self.etag = v.into();
16852 self
16853 }
16854}
16855
16856impl wkt::message::Message for VmwareEngineNetwork {
16857 fn typename() -> &'static str {
16858 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork"
16859 }
16860}
16861
16862/// Defines additional types related to [VmwareEngineNetwork].
16863pub mod vmware_engine_network {
16864 #[allow(unused_imports)]
16865 use super::*;
16866
16867 /// Represents a VMware Engine VPC network that is managed by a
16868 /// VMware Engine network resource.
16869 #[derive(Clone, Default, PartialEq)]
16870 #[non_exhaustive]
16871 pub struct VpcNetwork {
16872 /// Output only. Type of VPC network (INTRANET, INTERNET, or
16873 /// GOOGLE_CLOUD)
16874 pub r#type: crate::model::vmware_engine_network::vpc_network::Type,
16875
16876 /// Output only. The relative resource name of the service VPC network this
16877 /// VMware Engine network is attached to. For example:
16878 /// `projects/123123/global/networks/my-network`
16879 pub network: std::string::String,
16880
16881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16882 }
16883
16884 impl VpcNetwork {
16885 pub fn new() -> Self {
16886 std::default::Default::default()
16887 }
16888
16889 /// Sets the value of [r#type][crate::model::vmware_engine_network::VpcNetwork::type].
16890 ///
16891 /// # Example
16892 /// ```ignore,no_run
16893 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16894 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::vpc_network::Type;
16895 /// let x0 = VpcNetwork::new().set_type(Type::Intranet);
16896 /// let x1 = VpcNetwork::new().set_type(Type::Internet);
16897 /// let x2 = VpcNetwork::new().set_type(Type::GoogleCloud);
16898 /// ```
16899 pub fn set_type<
16900 T: std::convert::Into<crate::model::vmware_engine_network::vpc_network::Type>,
16901 >(
16902 mut self,
16903 v: T,
16904 ) -> Self {
16905 self.r#type = v.into();
16906 self
16907 }
16908
16909 /// Sets the value of [network][crate::model::vmware_engine_network::VpcNetwork::network].
16910 ///
16911 /// # Example
16912 /// ```ignore,no_run
16913 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16914 /// let x = VpcNetwork::new().set_network("example");
16915 /// ```
16916 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16917 self.network = v.into();
16918 self
16919 }
16920 }
16921
16922 impl wkt::message::Message for VpcNetwork {
16923 fn typename() -> &'static str {
16924 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"
16925 }
16926 }
16927
16928 /// Defines additional types related to [VpcNetwork].
16929 pub mod vpc_network {
16930 #[allow(unused_imports)]
16931 use super::*;
16932
16933 /// Enum Type defines possible types of a VMware Engine network controlled
16934 /// service.
16935 ///
16936 /// # Working with unknown values
16937 ///
16938 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16939 /// additional enum variants at any time. Adding new variants is not considered
16940 /// a breaking change. Applications should write their code in anticipation of:
16941 ///
16942 /// - New values appearing in future releases of the client library, **and**
16943 /// - New values received dynamically, without application changes.
16944 ///
16945 /// Please consult the [Working with enums] section in the user guide for some
16946 /// guidelines.
16947 ///
16948 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16949 #[derive(Clone, Debug, PartialEq)]
16950 #[non_exhaustive]
16951 pub enum Type {
16952 /// The default value. This value should never be used.
16953 Unspecified,
16954 /// VPC network that will be peered with a consumer VPC network or the
16955 /// intranet VPC of another VMware Engine network. Access a private cloud
16956 /// through Compute Engine VMs on a peered VPC network or an on-premises
16957 /// resource connected to a peered consumer VPC network.
16958 Intranet,
16959 /// VPC network used for internet access to and from a private cloud.
16960 Internet,
16961 /// VPC network used for access to Google Cloud services like
16962 /// Cloud Storage.
16963 GoogleCloud,
16964 /// If set, the enum was initialized with an unknown value.
16965 ///
16966 /// Applications can examine the value using [Type::value] or
16967 /// [Type::name].
16968 UnknownValue(r#type::UnknownValue),
16969 }
16970
16971 #[doc(hidden)]
16972 pub mod r#type {
16973 #[allow(unused_imports)]
16974 use super::*;
16975 #[derive(Clone, Debug, PartialEq)]
16976 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16977 }
16978
16979 impl Type {
16980 /// Gets the enum value.
16981 ///
16982 /// Returns `None` if the enum contains an unknown value deserialized from
16983 /// the string representation of enums.
16984 pub fn value(&self) -> std::option::Option<i32> {
16985 match self {
16986 Self::Unspecified => std::option::Option::Some(0),
16987 Self::Intranet => std::option::Option::Some(1),
16988 Self::Internet => std::option::Option::Some(2),
16989 Self::GoogleCloud => std::option::Option::Some(3),
16990 Self::UnknownValue(u) => u.0.value(),
16991 }
16992 }
16993
16994 /// Gets the enum value as a string.
16995 ///
16996 /// Returns `None` if the enum contains an unknown value deserialized from
16997 /// the integer representation of enums.
16998 pub fn name(&self) -> std::option::Option<&str> {
16999 match self {
17000 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17001 Self::Intranet => std::option::Option::Some("INTRANET"),
17002 Self::Internet => std::option::Option::Some("INTERNET"),
17003 Self::GoogleCloud => std::option::Option::Some("GOOGLE_CLOUD"),
17004 Self::UnknownValue(u) => u.0.name(),
17005 }
17006 }
17007 }
17008
17009 impl std::default::Default for Type {
17010 fn default() -> Self {
17011 use std::convert::From;
17012 Self::from(0)
17013 }
17014 }
17015
17016 impl std::fmt::Display for Type {
17017 fn fmt(
17018 &self,
17019 f: &mut std::fmt::Formatter<'_>,
17020 ) -> std::result::Result<(), std::fmt::Error> {
17021 wkt::internal::display_enum(f, self.name(), self.value())
17022 }
17023 }
17024
17025 impl std::convert::From<i32> for Type {
17026 fn from(value: i32) -> Self {
17027 match value {
17028 0 => Self::Unspecified,
17029 1 => Self::Intranet,
17030 2 => Self::Internet,
17031 3 => Self::GoogleCloud,
17032 _ => Self::UnknownValue(r#type::UnknownValue(
17033 wkt::internal::UnknownEnumValue::Integer(value),
17034 )),
17035 }
17036 }
17037 }
17038
17039 impl std::convert::From<&str> for Type {
17040 fn from(value: &str) -> Self {
17041 use std::string::ToString;
17042 match value {
17043 "TYPE_UNSPECIFIED" => Self::Unspecified,
17044 "INTRANET" => Self::Intranet,
17045 "INTERNET" => Self::Internet,
17046 "GOOGLE_CLOUD" => Self::GoogleCloud,
17047 _ => Self::UnknownValue(r#type::UnknownValue(
17048 wkt::internal::UnknownEnumValue::String(value.to_string()),
17049 )),
17050 }
17051 }
17052 }
17053
17054 impl serde::ser::Serialize for Type {
17055 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17056 where
17057 S: serde::Serializer,
17058 {
17059 match self {
17060 Self::Unspecified => serializer.serialize_i32(0),
17061 Self::Intranet => serializer.serialize_i32(1),
17062 Self::Internet => serializer.serialize_i32(2),
17063 Self::GoogleCloud => serializer.serialize_i32(3),
17064 Self::UnknownValue(u) => u.0.serialize(serializer),
17065 }
17066 }
17067 }
17068
17069 impl<'de> serde::de::Deserialize<'de> for Type {
17070 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17071 where
17072 D: serde::Deserializer<'de>,
17073 {
17074 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17075 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type",
17076 ))
17077 }
17078 }
17079 }
17080
17081 /// Enum State defines possible states of VMware Engine network.
17082 ///
17083 /// # Working with unknown values
17084 ///
17085 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17086 /// additional enum variants at any time. Adding new variants is not considered
17087 /// a breaking change. Applications should write their code in anticipation of:
17088 ///
17089 /// - New values appearing in future releases of the client library, **and**
17090 /// - New values received dynamically, without application changes.
17091 ///
17092 /// Please consult the [Working with enums] section in the user guide for some
17093 /// guidelines.
17094 ///
17095 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17096 #[derive(Clone, Debug, PartialEq)]
17097 #[non_exhaustive]
17098 pub enum State {
17099 /// The default value. This value is used if the state is omitted.
17100 Unspecified,
17101 /// The VMware Engine network is being created.
17102 Creating,
17103 /// The VMware Engine network is ready.
17104 Active,
17105 /// The VMware Engine network is being updated.
17106 Updating,
17107 /// The VMware Engine network is being deleted.
17108 Deleting,
17109 /// If set, the enum was initialized with an unknown value.
17110 ///
17111 /// Applications can examine the value using [State::value] or
17112 /// [State::name].
17113 UnknownValue(state::UnknownValue),
17114 }
17115
17116 #[doc(hidden)]
17117 pub mod state {
17118 #[allow(unused_imports)]
17119 use super::*;
17120 #[derive(Clone, Debug, PartialEq)]
17121 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17122 }
17123
17124 impl State {
17125 /// Gets the enum value.
17126 ///
17127 /// Returns `None` if the enum contains an unknown value deserialized from
17128 /// the string representation of enums.
17129 pub fn value(&self) -> std::option::Option<i32> {
17130 match self {
17131 Self::Unspecified => std::option::Option::Some(0),
17132 Self::Creating => std::option::Option::Some(1),
17133 Self::Active => std::option::Option::Some(2),
17134 Self::Updating => std::option::Option::Some(3),
17135 Self::Deleting => std::option::Option::Some(4),
17136 Self::UnknownValue(u) => u.0.value(),
17137 }
17138 }
17139
17140 /// Gets the enum value as a string.
17141 ///
17142 /// Returns `None` if the enum contains an unknown value deserialized from
17143 /// the integer representation of enums.
17144 pub fn name(&self) -> std::option::Option<&str> {
17145 match self {
17146 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17147 Self::Creating => std::option::Option::Some("CREATING"),
17148 Self::Active => std::option::Option::Some("ACTIVE"),
17149 Self::Updating => std::option::Option::Some("UPDATING"),
17150 Self::Deleting => std::option::Option::Some("DELETING"),
17151 Self::UnknownValue(u) => u.0.name(),
17152 }
17153 }
17154 }
17155
17156 impl std::default::Default for State {
17157 fn default() -> Self {
17158 use std::convert::From;
17159 Self::from(0)
17160 }
17161 }
17162
17163 impl std::fmt::Display for State {
17164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17165 wkt::internal::display_enum(f, self.name(), self.value())
17166 }
17167 }
17168
17169 impl std::convert::From<i32> for State {
17170 fn from(value: i32) -> Self {
17171 match value {
17172 0 => Self::Unspecified,
17173 1 => Self::Creating,
17174 2 => Self::Active,
17175 3 => Self::Updating,
17176 4 => Self::Deleting,
17177 _ => Self::UnknownValue(state::UnknownValue(
17178 wkt::internal::UnknownEnumValue::Integer(value),
17179 )),
17180 }
17181 }
17182 }
17183
17184 impl std::convert::From<&str> for State {
17185 fn from(value: &str) -> Self {
17186 use std::string::ToString;
17187 match value {
17188 "STATE_UNSPECIFIED" => Self::Unspecified,
17189 "CREATING" => Self::Creating,
17190 "ACTIVE" => Self::Active,
17191 "UPDATING" => Self::Updating,
17192 "DELETING" => Self::Deleting,
17193 _ => Self::UnknownValue(state::UnknownValue(
17194 wkt::internal::UnknownEnumValue::String(value.to_string()),
17195 )),
17196 }
17197 }
17198 }
17199
17200 impl serde::ser::Serialize for State {
17201 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17202 where
17203 S: serde::Serializer,
17204 {
17205 match self {
17206 Self::Unspecified => serializer.serialize_i32(0),
17207 Self::Creating => serializer.serialize_i32(1),
17208 Self::Active => serializer.serialize_i32(2),
17209 Self::Updating => serializer.serialize_i32(3),
17210 Self::Deleting => serializer.serialize_i32(4),
17211 Self::UnknownValue(u) => u.0.serialize(serializer),
17212 }
17213 }
17214 }
17215
17216 impl<'de> serde::de::Deserialize<'de> for State {
17217 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17218 where
17219 D: serde::Deserializer<'de>,
17220 {
17221 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17222 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.State",
17223 ))
17224 }
17225 }
17226
17227 /// Enum Type defines possible types of VMware Engine network.
17228 ///
17229 /// # Working with unknown values
17230 ///
17231 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17232 /// additional enum variants at any time. Adding new variants is not considered
17233 /// a breaking change. Applications should write their code in anticipation of:
17234 ///
17235 /// - New values appearing in future releases of the client library, **and**
17236 /// - New values received dynamically, without application changes.
17237 ///
17238 /// Please consult the [Working with enums] section in the user guide for some
17239 /// guidelines.
17240 ///
17241 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17242 #[derive(Clone, Debug, PartialEq)]
17243 #[non_exhaustive]
17244 pub enum Type {
17245 /// The default value. This value should never be used.
17246 Unspecified,
17247 /// Network type used by private clouds created in projects without a network
17248 /// of type `STANDARD`. This network type is no longer used for new VMware
17249 /// Engine private cloud deployments.
17250 Legacy,
17251 /// Standard network type used for private cloud connectivity.
17252 Standard,
17253 /// If set, the enum was initialized with an unknown value.
17254 ///
17255 /// Applications can examine the value using [Type::value] or
17256 /// [Type::name].
17257 UnknownValue(r#type::UnknownValue),
17258 }
17259
17260 #[doc(hidden)]
17261 pub mod r#type {
17262 #[allow(unused_imports)]
17263 use super::*;
17264 #[derive(Clone, Debug, PartialEq)]
17265 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17266 }
17267
17268 impl Type {
17269 /// Gets the enum value.
17270 ///
17271 /// Returns `None` if the enum contains an unknown value deserialized from
17272 /// the string representation of enums.
17273 pub fn value(&self) -> std::option::Option<i32> {
17274 match self {
17275 Self::Unspecified => std::option::Option::Some(0),
17276 Self::Legacy => std::option::Option::Some(1),
17277 Self::Standard => std::option::Option::Some(2),
17278 Self::UnknownValue(u) => u.0.value(),
17279 }
17280 }
17281
17282 /// Gets the enum value as a string.
17283 ///
17284 /// Returns `None` if the enum contains an unknown value deserialized from
17285 /// the integer representation of enums.
17286 pub fn name(&self) -> std::option::Option<&str> {
17287 match self {
17288 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17289 Self::Legacy => std::option::Option::Some("LEGACY"),
17290 Self::Standard => std::option::Option::Some("STANDARD"),
17291 Self::UnknownValue(u) => u.0.name(),
17292 }
17293 }
17294 }
17295
17296 impl std::default::Default for Type {
17297 fn default() -> Self {
17298 use std::convert::From;
17299 Self::from(0)
17300 }
17301 }
17302
17303 impl std::fmt::Display for Type {
17304 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17305 wkt::internal::display_enum(f, self.name(), self.value())
17306 }
17307 }
17308
17309 impl std::convert::From<i32> for Type {
17310 fn from(value: i32) -> Self {
17311 match value {
17312 0 => Self::Unspecified,
17313 1 => Self::Legacy,
17314 2 => Self::Standard,
17315 _ => Self::UnknownValue(r#type::UnknownValue(
17316 wkt::internal::UnknownEnumValue::Integer(value),
17317 )),
17318 }
17319 }
17320 }
17321
17322 impl std::convert::From<&str> for Type {
17323 fn from(value: &str) -> Self {
17324 use std::string::ToString;
17325 match value {
17326 "TYPE_UNSPECIFIED" => Self::Unspecified,
17327 "LEGACY" => Self::Legacy,
17328 "STANDARD" => Self::Standard,
17329 _ => Self::UnknownValue(r#type::UnknownValue(
17330 wkt::internal::UnknownEnumValue::String(value.to_string()),
17331 )),
17332 }
17333 }
17334 }
17335
17336 impl serde::ser::Serialize for Type {
17337 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17338 where
17339 S: serde::Serializer,
17340 {
17341 match self {
17342 Self::Unspecified => serializer.serialize_i32(0),
17343 Self::Legacy => serializer.serialize_i32(1),
17344 Self::Standard => serializer.serialize_i32(2),
17345 Self::UnknownValue(u) => u.0.serialize(serializer),
17346 }
17347 }
17348 }
17349
17350 impl<'de> serde::de::Deserialize<'de> for Type {
17351 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17352 where
17353 D: serde::Deserializer<'de>,
17354 {
17355 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17356 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type",
17357 ))
17358 }
17359 }
17360}
17361
17362/// Private connection resource that provides connectivity for VMware Engine
17363/// private clouds.
17364#[derive(Clone, Default, PartialEq)]
17365#[non_exhaustive]
17366pub struct PrivateConnection {
17367 /// Output only. The resource name of the private connection.
17368 /// Resource names are schemeless URIs that follow the conventions in
17369 /// <https://cloud.google.com/apis/design/resource_names>.
17370 /// For example:
17371 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
17372 pub name: std::string::String,
17373
17374 /// Output only. Creation time of this resource.
17375 pub create_time: std::option::Option<wkt::Timestamp>,
17376
17377 /// Output only. Last update time of this resource.
17378 pub update_time: std::option::Option<wkt::Timestamp>,
17379
17380 /// Optional. User-provided description for this private connection.
17381 pub description: std::string::String,
17382
17383 /// Output only. State of the private connection.
17384 pub state: crate::model::private_connection::State,
17385
17386 /// Required. The relative resource name of Legacy VMware Engine network.
17387 /// Specify the name in the following form:
17388 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17389 /// where `{project}`, `{location}` will be same as specified in private
17390 /// connection resource name and `{vmware_engine_network_id}` will be in the
17391 /// form of `{location}`-default e.g.
17392 /// projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
17393 pub vmware_engine_network: std::string::String,
17394
17395 /// Output only. The canonical name of the VMware Engine network in the form:
17396 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17397 pub vmware_engine_network_canonical: std::string::String,
17398
17399 /// Required. Private connection type.
17400 pub r#type: crate::model::private_connection::Type,
17401
17402 /// Output only. VPC network peering id between given network VPC and
17403 /// VMwareEngineNetwork.
17404 pub peering_id: std::string::String,
17405
17406 /// Optional. Routing Mode.
17407 /// Default value is set to GLOBAL.
17408 /// For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or
17409 /// REGIONAL, for other types only GLOBAL is supported.
17410 pub routing_mode: crate::model::private_connection::RoutingMode,
17411
17412 /// Output only. System-generated unique identifier for the resource.
17413 pub uid: std::string::String,
17414
17415 /// Required. Service network to create private connection.
17416 /// Specify the name in the following form:
17417 /// `projects/{project}/global/networks/{network_id}`
17418 /// For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
17419 /// VPC, e.g. projects/project-tp/global/networks/servicenetworking.
17420 /// For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
17421 /// e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
17422 /// For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
17423 /// projects/project-tp/global/networks/dell-tenant-vpc.
17424 /// For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
17425 /// any other producer VPC to which the VMware Engine Network needs to be
17426 /// connected, e.g. projects/project/global/networks/vpc.
17427 pub service_network: std::string::String,
17428
17429 /// Output only. Peering state between service network and VMware Engine
17430 /// network.
17431 pub peering_state: crate::model::private_connection::PeeringState,
17432
17433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17434}
17435
17436impl PrivateConnection {
17437 pub fn new() -> Self {
17438 std::default::Default::default()
17439 }
17440
17441 /// Sets the value of [name][crate::model::PrivateConnection::name].
17442 ///
17443 /// # Example
17444 /// ```ignore,no_run
17445 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17446 /// let x = PrivateConnection::new().set_name("example");
17447 /// ```
17448 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17449 self.name = v.into();
17450 self
17451 }
17452
17453 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
17454 ///
17455 /// # Example
17456 /// ```ignore,no_run
17457 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17458 /// use wkt::Timestamp;
17459 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
17460 /// ```
17461 pub fn set_create_time<T>(mut self, v: T) -> Self
17462 where
17463 T: std::convert::Into<wkt::Timestamp>,
17464 {
17465 self.create_time = std::option::Option::Some(v.into());
17466 self
17467 }
17468
17469 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
17470 ///
17471 /// # Example
17472 /// ```ignore,no_run
17473 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17474 /// use wkt::Timestamp;
17475 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17476 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
17477 /// ```
17478 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17479 where
17480 T: std::convert::Into<wkt::Timestamp>,
17481 {
17482 self.create_time = v.map(|x| x.into());
17483 self
17484 }
17485
17486 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
17487 ///
17488 /// # Example
17489 /// ```ignore,no_run
17490 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17491 /// use wkt::Timestamp;
17492 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
17493 /// ```
17494 pub fn set_update_time<T>(mut self, v: T) -> Self
17495 where
17496 T: std::convert::Into<wkt::Timestamp>,
17497 {
17498 self.update_time = std::option::Option::Some(v.into());
17499 self
17500 }
17501
17502 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
17503 ///
17504 /// # Example
17505 /// ```ignore,no_run
17506 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17507 /// use wkt::Timestamp;
17508 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17509 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
17510 /// ```
17511 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17512 where
17513 T: std::convert::Into<wkt::Timestamp>,
17514 {
17515 self.update_time = v.map(|x| x.into());
17516 self
17517 }
17518
17519 /// Sets the value of [description][crate::model::PrivateConnection::description].
17520 ///
17521 /// # Example
17522 /// ```ignore,no_run
17523 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17524 /// let x = PrivateConnection::new().set_description("example");
17525 /// ```
17526 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17527 self.description = v.into();
17528 self
17529 }
17530
17531 /// Sets the value of [state][crate::model::PrivateConnection::state].
17532 ///
17533 /// # Example
17534 /// ```ignore,no_run
17535 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17536 /// use google_cloud_vmwareengine_v1::model::private_connection::State;
17537 /// let x0 = PrivateConnection::new().set_state(State::Creating);
17538 /// let x1 = PrivateConnection::new().set_state(State::Active);
17539 /// let x2 = PrivateConnection::new().set_state(State::Updating);
17540 /// ```
17541 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
17542 mut self,
17543 v: T,
17544 ) -> Self {
17545 self.state = v.into();
17546 self
17547 }
17548
17549 /// Sets the value of [vmware_engine_network][crate::model::PrivateConnection::vmware_engine_network].
17550 ///
17551 /// # Example
17552 /// ```ignore,no_run
17553 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17554 /// let x = PrivateConnection::new().set_vmware_engine_network("example");
17555 /// ```
17556 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
17557 mut self,
17558 v: T,
17559 ) -> Self {
17560 self.vmware_engine_network = v.into();
17561 self
17562 }
17563
17564 /// Sets the value of [vmware_engine_network_canonical][crate::model::PrivateConnection::vmware_engine_network_canonical].
17565 ///
17566 /// # Example
17567 /// ```ignore,no_run
17568 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17569 /// let x = PrivateConnection::new().set_vmware_engine_network_canonical("example");
17570 /// ```
17571 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
17572 mut self,
17573 v: T,
17574 ) -> Self {
17575 self.vmware_engine_network_canonical = v.into();
17576 self
17577 }
17578
17579 /// Sets the value of [r#type][crate::model::PrivateConnection::type].
17580 ///
17581 /// # Example
17582 /// ```ignore,no_run
17583 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17584 /// use google_cloud_vmwareengine_v1::model::private_connection::Type;
17585 /// let x0 = PrivateConnection::new().set_type(Type::PrivateServiceAccess);
17586 /// let x1 = PrivateConnection::new().set_type(Type::NetappCloudVolumes);
17587 /// let x2 = PrivateConnection::new().set_type(Type::DellPowerscale);
17588 /// ```
17589 pub fn set_type<T: std::convert::Into<crate::model::private_connection::Type>>(
17590 mut self,
17591 v: T,
17592 ) -> Self {
17593 self.r#type = v.into();
17594 self
17595 }
17596
17597 /// Sets the value of [peering_id][crate::model::PrivateConnection::peering_id].
17598 ///
17599 /// # Example
17600 /// ```ignore,no_run
17601 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17602 /// let x = PrivateConnection::new().set_peering_id("example");
17603 /// ```
17604 pub fn set_peering_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17605 self.peering_id = v.into();
17606 self
17607 }
17608
17609 /// Sets the value of [routing_mode][crate::model::PrivateConnection::routing_mode].
17610 ///
17611 /// # Example
17612 /// ```ignore,no_run
17613 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17614 /// use google_cloud_vmwareengine_v1::model::private_connection::RoutingMode;
17615 /// let x0 = PrivateConnection::new().set_routing_mode(RoutingMode::Global);
17616 /// let x1 = PrivateConnection::new().set_routing_mode(RoutingMode::Regional);
17617 /// ```
17618 pub fn set_routing_mode<
17619 T: std::convert::Into<crate::model::private_connection::RoutingMode>,
17620 >(
17621 mut self,
17622 v: T,
17623 ) -> Self {
17624 self.routing_mode = v.into();
17625 self
17626 }
17627
17628 /// Sets the value of [uid][crate::model::PrivateConnection::uid].
17629 ///
17630 /// # Example
17631 /// ```ignore,no_run
17632 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17633 /// let x = PrivateConnection::new().set_uid("example");
17634 /// ```
17635 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17636 self.uid = v.into();
17637 self
17638 }
17639
17640 /// Sets the value of [service_network][crate::model::PrivateConnection::service_network].
17641 ///
17642 /// # Example
17643 /// ```ignore,no_run
17644 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17645 /// let x = PrivateConnection::new().set_service_network("example");
17646 /// ```
17647 pub fn set_service_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17648 self.service_network = v.into();
17649 self
17650 }
17651
17652 /// Sets the value of [peering_state][crate::model::PrivateConnection::peering_state].
17653 ///
17654 /// # Example
17655 /// ```ignore,no_run
17656 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17657 /// use google_cloud_vmwareengine_v1::model::private_connection::PeeringState;
17658 /// let x0 = PrivateConnection::new().set_peering_state(PeeringState::PeeringActive);
17659 /// let x1 = PrivateConnection::new().set_peering_state(PeeringState::PeeringInactive);
17660 /// ```
17661 pub fn set_peering_state<
17662 T: std::convert::Into<crate::model::private_connection::PeeringState>,
17663 >(
17664 mut self,
17665 v: T,
17666 ) -> Self {
17667 self.peering_state = v.into();
17668 self
17669 }
17670}
17671
17672impl wkt::message::Message for PrivateConnection {
17673 fn typename() -> &'static str {
17674 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateConnection"
17675 }
17676}
17677
17678/// Defines additional types related to [PrivateConnection].
17679pub mod private_connection {
17680 #[allow(unused_imports)]
17681 use super::*;
17682
17683 /// Enum State defines possible states of private connection.
17684 ///
17685 /// # Working with unknown values
17686 ///
17687 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17688 /// additional enum variants at any time. Adding new variants is not considered
17689 /// a breaking change. Applications should write their code in anticipation of:
17690 ///
17691 /// - New values appearing in future releases of the client library, **and**
17692 /// - New values received dynamically, without application changes.
17693 ///
17694 /// Please consult the [Working with enums] section in the user guide for some
17695 /// guidelines.
17696 ///
17697 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17698 #[derive(Clone, Debug, PartialEq)]
17699 #[non_exhaustive]
17700 pub enum State {
17701 /// The default value. This value is used if the state is omitted.
17702 Unspecified,
17703 /// The private connection is being created.
17704 Creating,
17705 /// The private connection is ready.
17706 Active,
17707 /// The private connection is being updated.
17708 Updating,
17709 /// The private connection is being deleted.
17710 Deleting,
17711 /// The private connection is not provisioned, since no private cloud is
17712 /// present for which this private connection is needed.
17713 Unprovisioned,
17714 /// The private connection is in failed state.
17715 Failed,
17716 /// If set, the enum was initialized with an unknown value.
17717 ///
17718 /// Applications can examine the value using [State::value] or
17719 /// [State::name].
17720 UnknownValue(state::UnknownValue),
17721 }
17722
17723 #[doc(hidden)]
17724 pub mod state {
17725 #[allow(unused_imports)]
17726 use super::*;
17727 #[derive(Clone, Debug, PartialEq)]
17728 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17729 }
17730
17731 impl State {
17732 /// Gets the enum value.
17733 ///
17734 /// Returns `None` if the enum contains an unknown value deserialized from
17735 /// the string representation of enums.
17736 pub fn value(&self) -> std::option::Option<i32> {
17737 match self {
17738 Self::Unspecified => std::option::Option::Some(0),
17739 Self::Creating => std::option::Option::Some(1),
17740 Self::Active => std::option::Option::Some(2),
17741 Self::Updating => std::option::Option::Some(3),
17742 Self::Deleting => std::option::Option::Some(4),
17743 Self::Unprovisioned => std::option::Option::Some(5),
17744 Self::Failed => std::option::Option::Some(6),
17745 Self::UnknownValue(u) => u.0.value(),
17746 }
17747 }
17748
17749 /// Gets the enum value as a string.
17750 ///
17751 /// Returns `None` if the enum contains an unknown value deserialized from
17752 /// the integer representation of enums.
17753 pub fn name(&self) -> std::option::Option<&str> {
17754 match self {
17755 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17756 Self::Creating => std::option::Option::Some("CREATING"),
17757 Self::Active => std::option::Option::Some("ACTIVE"),
17758 Self::Updating => std::option::Option::Some("UPDATING"),
17759 Self::Deleting => std::option::Option::Some("DELETING"),
17760 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
17761 Self::Failed => std::option::Option::Some("FAILED"),
17762 Self::UnknownValue(u) => u.0.name(),
17763 }
17764 }
17765 }
17766
17767 impl std::default::Default for State {
17768 fn default() -> Self {
17769 use std::convert::From;
17770 Self::from(0)
17771 }
17772 }
17773
17774 impl std::fmt::Display for State {
17775 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17776 wkt::internal::display_enum(f, self.name(), self.value())
17777 }
17778 }
17779
17780 impl std::convert::From<i32> for State {
17781 fn from(value: i32) -> Self {
17782 match value {
17783 0 => Self::Unspecified,
17784 1 => Self::Creating,
17785 2 => Self::Active,
17786 3 => Self::Updating,
17787 4 => Self::Deleting,
17788 5 => Self::Unprovisioned,
17789 6 => Self::Failed,
17790 _ => Self::UnknownValue(state::UnknownValue(
17791 wkt::internal::UnknownEnumValue::Integer(value),
17792 )),
17793 }
17794 }
17795 }
17796
17797 impl std::convert::From<&str> for State {
17798 fn from(value: &str) -> Self {
17799 use std::string::ToString;
17800 match value {
17801 "STATE_UNSPECIFIED" => Self::Unspecified,
17802 "CREATING" => Self::Creating,
17803 "ACTIVE" => Self::Active,
17804 "UPDATING" => Self::Updating,
17805 "DELETING" => Self::Deleting,
17806 "UNPROVISIONED" => Self::Unprovisioned,
17807 "FAILED" => Self::Failed,
17808 _ => Self::UnknownValue(state::UnknownValue(
17809 wkt::internal::UnknownEnumValue::String(value.to_string()),
17810 )),
17811 }
17812 }
17813 }
17814
17815 impl serde::ser::Serialize for State {
17816 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17817 where
17818 S: serde::Serializer,
17819 {
17820 match self {
17821 Self::Unspecified => serializer.serialize_i32(0),
17822 Self::Creating => serializer.serialize_i32(1),
17823 Self::Active => serializer.serialize_i32(2),
17824 Self::Updating => serializer.serialize_i32(3),
17825 Self::Deleting => serializer.serialize_i32(4),
17826 Self::Unprovisioned => serializer.serialize_i32(5),
17827 Self::Failed => serializer.serialize_i32(6),
17828 Self::UnknownValue(u) => u.0.serialize(serializer),
17829 }
17830 }
17831 }
17832
17833 impl<'de> serde::de::Deserialize<'de> for State {
17834 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17835 where
17836 D: serde::Deserializer<'de>,
17837 {
17838 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17839 ".google.cloud.vmwareengine.v1.PrivateConnection.State",
17840 ))
17841 }
17842 }
17843
17844 /// Enum Type defines possible types of private connection.
17845 ///
17846 /// # Working with unknown values
17847 ///
17848 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17849 /// additional enum variants at any time. Adding new variants is not considered
17850 /// a breaking change. Applications should write their code in anticipation of:
17851 ///
17852 /// - New values appearing in future releases of the client library, **and**
17853 /// - New values received dynamically, without application changes.
17854 ///
17855 /// Please consult the [Working with enums] section in the user guide for some
17856 /// guidelines.
17857 ///
17858 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17859 #[derive(Clone, Debug, PartialEq)]
17860 #[non_exhaustive]
17861 pub enum Type {
17862 /// The default value. This value should never be used.
17863 Unspecified,
17864 /// Connection used for establishing [private services
17865 /// access](https://cloud.google.com/vpc/docs/private-services-access).
17866 PrivateServiceAccess,
17867 /// Connection used for connecting to NetApp Cloud Volumes.
17868 NetappCloudVolumes,
17869 /// Connection used for connecting to Dell PowerScale.
17870 DellPowerscale,
17871 /// Connection used for connecting to third-party services.
17872 ThirdPartyService,
17873 /// If set, the enum was initialized with an unknown value.
17874 ///
17875 /// Applications can examine the value using [Type::value] or
17876 /// [Type::name].
17877 UnknownValue(r#type::UnknownValue),
17878 }
17879
17880 #[doc(hidden)]
17881 pub mod r#type {
17882 #[allow(unused_imports)]
17883 use super::*;
17884 #[derive(Clone, Debug, PartialEq)]
17885 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17886 }
17887
17888 impl Type {
17889 /// Gets the enum value.
17890 ///
17891 /// Returns `None` if the enum contains an unknown value deserialized from
17892 /// the string representation of enums.
17893 pub fn value(&self) -> std::option::Option<i32> {
17894 match self {
17895 Self::Unspecified => std::option::Option::Some(0),
17896 Self::PrivateServiceAccess => std::option::Option::Some(1),
17897 Self::NetappCloudVolumes => std::option::Option::Some(2),
17898 Self::DellPowerscale => std::option::Option::Some(3),
17899 Self::ThirdPartyService => std::option::Option::Some(4),
17900 Self::UnknownValue(u) => u.0.value(),
17901 }
17902 }
17903
17904 /// Gets the enum value as a string.
17905 ///
17906 /// Returns `None` if the enum contains an unknown value deserialized from
17907 /// the integer representation of enums.
17908 pub fn name(&self) -> std::option::Option<&str> {
17909 match self {
17910 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17911 Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
17912 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
17913 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
17914 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
17915 Self::UnknownValue(u) => u.0.name(),
17916 }
17917 }
17918 }
17919
17920 impl std::default::Default for Type {
17921 fn default() -> Self {
17922 use std::convert::From;
17923 Self::from(0)
17924 }
17925 }
17926
17927 impl std::fmt::Display for Type {
17928 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17929 wkt::internal::display_enum(f, self.name(), self.value())
17930 }
17931 }
17932
17933 impl std::convert::From<i32> for Type {
17934 fn from(value: i32) -> Self {
17935 match value {
17936 0 => Self::Unspecified,
17937 1 => Self::PrivateServiceAccess,
17938 2 => Self::NetappCloudVolumes,
17939 3 => Self::DellPowerscale,
17940 4 => Self::ThirdPartyService,
17941 _ => Self::UnknownValue(r#type::UnknownValue(
17942 wkt::internal::UnknownEnumValue::Integer(value),
17943 )),
17944 }
17945 }
17946 }
17947
17948 impl std::convert::From<&str> for Type {
17949 fn from(value: &str) -> Self {
17950 use std::string::ToString;
17951 match value {
17952 "TYPE_UNSPECIFIED" => Self::Unspecified,
17953 "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
17954 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
17955 "DELL_POWERSCALE" => Self::DellPowerscale,
17956 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
17957 _ => Self::UnknownValue(r#type::UnknownValue(
17958 wkt::internal::UnknownEnumValue::String(value.to_string()),
17959 )),
17960 }
17961 }
17962 }
17963
17964 impl serde::ser::Serialize for Type {
17965 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17966 where
17967 S: serde::Serializer,
17968 {
17969 match self {
17970 Self::Unspecified => serializer.serialize_i32(0),
17971 Self::PrivateServiceAccess => serializer.serialize_i32(1),
17972 Self::NetappCloudVolumes => serializer.serialize_i32(2),
17973 Self::DellPowerscale => serializer.serialize_i32(3),
17974 Self::ThirdPartyService => serializer.serialize_i32(4),
17975 Self::UnknownValue(u) => u.0.serialize(serializer),
17976 }
17977 }
17978 }
17979
17980 impl<'de> serde::de::Deserialize<'de> for Type {
17981 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17982 where
17983 D: serde::Deserializer<'de>,
17984 {
17985 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17986 ".google.cloud.vmwareengine.v1.PrivateConnection.Type",
17987 ))
17988 }
17989 }
17990
17991 /// Possible types for RoutingMode
17992 ///
17993 /// # Working with unknown values
17994 ///
17995 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17996 /// additional enum variants at any time. Adding new variants is not considered
17997 /// a breaking change. Applications should write their code in anticipation of:
17998 ///
17999 /// - New values appearing in future releases of the client library, **and**
18000 /// - New values received dynamically, without application changes.
18001 ///
18002 /// Please consult the [Working with enums] section in the user guide for some
18003 /// guidelines.
18004 ///
18005 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18006 #[derive(Clone, Debug, PartialEq)]
18007 #[non_exhaustive]
18008 pub enum RoutingMode {
18009 /// The default value. This value should never be used.
18010 Unspecified,
18011 /// Global Routing Mode
18012 Global,
18013 /// Regional Routing Mode
18014 Regional,
18015 /// If set, the enum was initialized with an unknown value.
18016 ///
18017 /// Applications can examine the value using [RoutingMode::value] or
18018 /// [RoutingMode::name].
18019 UnknownValue(routing_mode::UnknownValue),
18020 }
18021
18022 #[doc(hidden)]
18023 pub mod routing_mode {
18024 #[allow(unused_imports)]
18025 use super::*;
18026 #[derive(Clone, Debug, PartialEq)]
18027 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18028 }
18029
18030 impl RoutingMode {
18031 /// Gets the enum value.
18032 ///
18033 /// Returns `None` if the enum contains an unknown value deserialized from
18034 /// the string representation of enums.
18035 pub fn value(&self) -> std::option::Option<i32> {
18036 match self {
18037 Self::Unspecified => std::option::Option::Some(0),
18038 Self::Global => std::option::Option::Some(1),
18039 Self::Regional => std::option::Option::Some(2),
18040 Self::UnknownValue(u) => u.0.value(),
18041 }
18042 }
18043
18044 /// Gets the enum value as a string.
18045 ///
18046 /// Returns `None` if the enum contains an unknown value deserialized from
18047 /// the integer representation of enums.
18048 pub fn name(&self) -> std::option::Option<&str> {
18049 match self {
18050 Self::Unspecified => std::option::Option::Some("ROUTING_MODE_UNSPECIFIED"),
18051 Self::Global => std::option::Option::Some("GLOBAL"),
18052 Self::Regional => std::option::Option::Some("REGIONAL"),
18053 Self::UnknownValue(u) => u.0.name(),
18054 }
18055 }
18056 }
18057
18058 impl std::default::Default for RoutingMode {
18059 fn default() -> Self {
18060 use std::convert::From;
18061 Self::from(0)
18062 }
18063 }
18064
18065 impl std::fmt::Display for RoutingMode {
18066 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18067 wkt::internal::display_enum(f, self.name(), self.value())
18068 }
18069 }
18070
18071 impl std::convert::From<i32> for RoutingMode {
18072 fn from(value: i32) -> Self {
18073 match value {
18074 0 => Self::Unspecified,
18075 1 => Self::Global,
18076 2 => Self::Regional,
18077 _ => Self::UnknownValue(routing_mode::UnknownValue(
18078 wkt::internal::UnknownEnumValue::Integer(value),
18079 )),
18080 }
18081 }
18082 }
18083
18084 impl std::convert::From<&str> for RoutingMode {
18085 fn from(value: &str) -> Self {
18086 use std::string::ToString;
18087 match value {
18088 "ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
18089 "GLOBAL" => Self::Global,
18090 "REGIONAL" => Self::Regional,
18091 _ => Self::UnknownValue(routing_mode::UnknownValue(
18092 wkt::internal::UnknownEnumValue::String(value.to_string()),
18093 )),
18094 }
18095 }
18096 }
18097
18098 impl serde::ser::Serialize for RoutingMode {
18099 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18100 where
18101 S: serde::Serializer,
18102 {
18103 match self {
18104 Self::Unspecified => serializer.serialize_i32(0),
18105 Self::Global => serializer.serialize_i32(1),
18106 Self::Regional => serializer.serialize_i32(2),
18107 Self::UnknownValue(u) => u.0.serialize(serializer),
18108 }
18109 }
18110 }
18111
18112 impl<'de> serde::de::Deserialize<'de> for RoutingMode {
18113 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18114 where
18115 D: serde::Deserializer<'de>,
18116 {
18117 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingMode>::new(
18118 ".google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode",
18119 ))
18120 }
18121 }
18122
18123 /// Enum PeeringState defines the possible states of peering between service
18124 /// network and the vpc network peered to service network
18125 ///
18126 /// # Working with unknown values
18127 ///
18128 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18129 /// additional enum variants at any time. Adding new variants is not considered
18130 /// a breaking change. Applications should write their code in anticipation of:
18131 ///
18132 /// - New values appearing in future releases of the client library, **and**
18133 /// - New values received dynamically, without application changes.
18134 ///
18135 /// Please consult the [Working with enums] section in the user guide for some
18136 /// guidelines.
18137 ///
18138 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18139 #[derive(Clone, Debug, PartialEq)]
18140 #[non_exhaustive]
18141 pub enum PeeringState {
18142 /// The default value. This value is used if the peering state is omitted or
18143 /// unknown.
18144 Unspecified,
18145 /// The peering is in active state.
18146 PeeringActive,
18147 /// The peering is in inactive state.
18148 PeeringInactive,
18149 /// If set, the enum was initialized with an unknown value.
18150 ///
18151 /// Applications can examine the value using [PeeringState::value] or
18152 /// [PeeringState::name].
18153 UnknownValue(peering_state::UnknownValue),
18154 }
18155
18156 #[doc(hidden)]
18157 pub mod peering_state {
18158 #[allow(unused_imports)]
18159 use super::*;
18160 #[derive(Clone, Debug, PartialEq)]
18161 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18162 }
18163
18164 impl PeeringState {
18165 /// Gets the enum value.
18166 ///
18167 /// Returns `None` if the enum contains an unknown value deserialized from
18168 /// the string representation of enums.
18169 pub fn value(&self) -> std::option::Option<i32> {
18170 match self {
18171 Self::Unspecified => std::option::Option::Some(0),
18172 Self::PeeringActive => std::option::Option::Some(1),
18173 Self::PeeringInactive => std::option::Option::Some(2),
18174 Self::UnknownValue(u) => u.0.value(),
18175 }
18176 }
18177
18178 /// Gets the enum value as a string.
18179 ///
18180 /// Returns `None` if the enum contains an unknown value deserialized from
18181 /// the integer representation of enums.
18182 pub fn name(&self) -> std::option::Option<&str> {
18183 match self {
18184 Self::Unspecified => std::option::Option::Some("PEERING_STATE_UNSPECIFIED"),
18185 Self::PeeringActive => std::option::Option::Some("PEERING_ACTIVE"),
18186 Self::PeeringInactive => std::option::Option::Some("PEERING_INACTIVE"),
18187 Self::UnknownValue(u) => u.0.name(),
18188 }
18189 }
18190 }
18191
18192 impl std::default::Default for PeeringState {
18193 fn default() -> Self {
18194 use std::convert::From;
18195 Self::from(0)
18196 }
18197 }
18198
18199 impl std::fmt::Display for PeeringState {
18200 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18201 wkt::internal::display_enum(f, self.name(), self.value())
18202 }
18203 }
18204
18205 impl std::convert::From<i32> for PeeringState {
18206 fn from(value: i32) -> Self {
18207 match value {
18208 0 => Self::Unspecified,
18209 1 => Self::PeeringActive,
18210 2 => Self::PeeringInactive,
18211 _ => Self::UnknownValue(peering_state::UnknownValue(
18212 wkt::internal::UnknownEnumValue::Integer(value),
18213 )),
18214 }
18215 }
18216 }
18217
18218 impl std::convert::From<&str> for PeeringState {
18219 fn from(value: &str) -> Self {
18220 use std::string::ToString;
18221 match value {
18222 "PEERING_STATE_UNSPECIFIED" => Self::Unspecified,
18223 "PEERING_ACTIVE" => Self::PeeringActive,
18224 "PEERING_INACTIVE" => Self::PeeringInactive,
18225 _ => Self::UnknownValue(peering_state::UnknownValue(
18226 wkt::internal::UnknownEnumValue::String(value.to_string()),
18227 )),
18228 }
18229 }
18230 }
18231
18232 impl serde::ser::Serialize for PeeringState {
18233 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18234 where
18235 S: serde::Serializer,
18236 {
18237 match self {
18238 Self::Unspecified => serializer.serialize_i32(0),
18239 Self::PeeringActive => serializer.serialize_i32(1),
18240 Self::PeeringInactive => serializer.serialize_i32(2),
18241 Self::UnknownValue(u) => u.0.serialize(serializer),
18242 }
18243 }
18244 }
18245
18246 impl<'de> serde::de::Deserialize<'de> for PeeringState {
18247 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18248 where
18249 D: serde::Deserializer<'de>,
18250 {
18251 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeeringState>::new(
18252 ".google.cloud.vmwareengine.v1.PrivateConnection.PeeringState",
18253 ))
18254 }
18255 }
18256}
18257
18258/// VmwareEngine specific metadata for the given
18259/// [google.cloud.location.Location][google.cloud.location.Location]. It is
18260/// returned as a content of the `google.cloud.location.Location.metadata` field.
18261///
18262/// [google.cloud.location.Location]: google_cloud_location::model::Location
18263#[derive(Clone, Default, PartialEq)]
18264#[non_exhaustive]
18265pub struct LocationMetadata {
18266 /// Output only. Capabilities of this location.
18267 pub capabilities: std::vec::Vec<crate::model::location_metadata::Capability>,
18268
18269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18270}
18271
18272impl LocationMetadata {
18273 pub fn new() -> Self {
18274 std::default::Default::default()
18275 }
18276
18277 /// Sets the value of [capabilities][crate::model::LocationMetadata::capabilities].
18278 ///
18279 /// # Example
18280 /// ```ignore,no_run
18281 /// # use google_cloud_vmwareengine_v1::model::LocationMetadata;
18282 /// use google_cloud_vmwareengine_v1::model::location_metadata::Capability;
18283 /// let x = LocationMetadata::new().set_capabilities([
18284 /// Capability::StretchedClusters,
18285 /// ]);
18286 /// ```
18287 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
18288 where
18289 T: std::iter::IntoIterator<Item = V>,
18290 V: std::convert::Into<crate::model::location_metadata::Capability>,
18291 {
18292 use std::iter::Iterator;
18293 self.capabilities = v.into_iter().map(|i| i.into()).collect();
18294 self
18295 }
18296}
18297
18298impl wkt::message::Message for LocationMetadata {
18299 fn typename() -> &'static str {
18300 "type.googleapis.com/google.cloud.vmwareengine.v1.LocationMetadata"
18301 }
18302}
18303
18304/// Defines additional types related to [LocationMetadata].
18305pub mod location_metadata {
18306 #[allow(unused_imports)]
18307 use super::*;
18308
18309 /// Capability of a location.
18310 ///
18311 /// # Working with unknown values
18312 ///
18313 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18314 /// additional enum variants at any time. Adding new variants is not considered
18315 /// a breaking change. Applications should write their code in anticipation of:
18316 ///
18317 /// - New values appearing in future releases of the client library, **and**
18318 /// - New values received dynamically, without application changes.
18319 ///
18320 /// Please consult the [Working with enums] section in the user guide for some
18321 /// guidelines.
18322 ///
18323 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18324 #[derive(Clone, Debug, PartialEq)]
18325 #[non_exhaustive]
18326 pub enum Capability {
18327 /// The default value. This value is used if the capability is omitted or
18328 /// unknown.
18329 Unspecified,
18330 /// Stretch clusters are supported in this location.
18331 StretchedClusters,
18332 /// If set, the enum was initialized with an unknown value.
18333 ///
18334 /// Applications can examine the value using [Capability::value] or
18335 /// [Capability::name].
18336 UnknownValue(capability::UnknownValue),
18337 }
18338
18339 #[doc(hidden)]
18340 pub mod capability {
18341 #[allow(unused_imports)]
18342 use super::*;
18343 #[derive(Clone, Debug, PartialEq)]
18344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18345 }
18346
18347 impl Capability {
18348 /// Gets the enum value.
18349 ///
18350 /// Returns `None` if the enum contains an unknown value deserialized from
18351 /// the string representation of enums.
18352 pub fn value(&self) -> std::option::Option<i32> {
18353 match self {
18354 Self::Unspecified => std::option::Option::Some(0),
18355 Self::StretchedClusters => std::option::Option::Some(1),
18356 Self::UnknownValue(u) => u.0.value(),
18357 }
18358 }
18359
18360 /// Gets the enum value as a string.
18361 ///
18362 /// Returns `None` if the enum contains an unknown value deserialized from
18363 /// the integer representation of enums.
18364 pub fn name(&self) -> std::option::Option<&str> {
18365 match self {
18366 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
18367 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
18368 Self::UnknownValue(u) => u.0.name(),
18369 }
18370 }
18371 }
18372
18373 impl std::default::Default for Capability {
18374 fn default() -> Self {
18375 use std::convert::From;
18376 Self::from(0)
18377 }
18378 }
18379
18380 impl std::fmt::Display for Capability {
18381 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18382 wkt::internal::display_enum(f, self.name(), self.value())
18383 }
18384 }
18385
18386 impl std::convert::From<i32> for Capability {
18387 fn from(value: i32) -> Self {
18388 match value {
18389 0 => Self::Unspecified,
18390 1 => Self::StretchedClusters,
18391 _ => Self::UnknownValue(capability::UnknownValue(
18392 wkt::internal::UnknownEnumValue::Integer(value),
18393 )),
18394 }
18395 }
18396 }
18397
18398 impl std::convert::From<&str> for Capability {
18399 fn from(value: &str) -> Self {
18400 use std::string::ToString;
18401 match value {
18402 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
18403 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
18404 _ => Self::UnknownValue(capability::UnknownValue(
18405 wkt::internal::UnknownEnumValue::String(value.to_string()),
18406 )),
18407 }
18408 }
18409 }
18410
18411 impl serde::ser::Serialize for Capability {
18412 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18413 where
18414 S: serde::Serializer,
18415 {
18416 match self {
18417 Self::Unspecified => serializer.serialize_i32(0),
18418 Self::StretchedClusters => serializer.serialize_i32(1),
18419 Self::UnknownValue(u) => u.0.serialize(serializer),
18420 }
18421 }
18422 }
18423
18424 impl<'de> serde::de::Deserialize<'de> for Capability {
18425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18426 where
18427 D: serde::Deserializer<'de>,
18428 {
18429 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
18430 ".google.cloud.vmwareengine.v1.LocationMetadata.Capability",
18431 ))
18432 }
18433 }
18434}
18435
18436/// DnsBindPermission resource that contains the accounts having the consumer DNS
18437/// bind permission on the corresponding intranet VPC of the consumer project.
18438#[derive(Clone, Default, PartialEq)]
18439#[non_exhaustive]
18440pub struct DnsBindPermission {
18441 /// Required. Output only. The name of the resource which stores the
18442 /// users/service accounts having the permission to bind to the corresponding
18443 /// intranet VPC of the consumer project. DnsBindPermission is a global
18444 /// resource and location can only be global. Resource names are schemeless
18445 /// URIs that follow the conventions in
18446 /// <https://cloud.google.com/apis/design/resource_names>. For example:
18447 /// `projects/my-project/locations/global/dnsBindPermission`
18448 pub name: std::string::String,
18449
18450 /// Output only. Users/Service accounts which have access for binding on the
18451 /// intranet VPC project corresponding to the consumer project.
18452 pub principals: std::vec::Vec<crate::model::Principal>,
18453
18454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18455}
18456
18457impl DnsBindPermission {
18458 pub fn new() -> Self {
18459 std::default::Default::default()
18460 }
18461
18462 /// Sets the value of [name][crate::model::DnsBindPermission::name].
18463 ///
18464 /// # Example
18465 /// ```ignore,no_run
18466 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18467 /// let x = DnsBindPermission::new().set_name("example");
18468 /// ```
18469 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18470 self.name = v.into();
18471 self
18472 }
18473
18474 /// Sets the value of [principals][crate::model::DnsBindPermission::principals].
18475 ///
18476 /// # Example
18477 /// ```ignore,no_run
18478 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18479 /// use google_cloud_vmwareengine_v1::model::Principal;
18480 /// let x = DnsBindPermission::new()
18481 /// .set_principals([
18482 /// Principal::default()/* use setters */,
18483 /// Principal::default()/* use (different) setters */,
18484 /// ]);
18485 /// ```
18486 pub fn set_principals<T, V>(mut self, v: T) -> Self
18487 where
18488 T: std::iter::IntoIterator<Item = V>,
18489 V: std::convert::Into<crate::model::Principal>,
18490 {
18491 use std::iter::Iterator;
18492 self.principals = v.into_iter().map(|i| i.into()).collect();
18493 self
18494 }
18495}
18496
18497impl wkt::message::Message for DnsBindPermission {
18498 fn typename() -> &'static str {
18499 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsBindPermission"
18500 }
18501}
18502
18503/// Users/Service accounts which have access for DNS binding on the intranet
18504/// VPC corresponding to the consumer project.
18505#[derive(Clone, Default, PartialEq)]
18506#[non_exhaustive]
18507pub struct Principal {
18508 /// The consumer provided user/service account which needs to be
18509 /// granted permission to DNS bind with the intranet VPC corresponding to the
18510 /// consumer project.
18511 pub principal: std::option::Option<crate::model::principal::Principal>,
18512
18513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18514}
18515
18516impl Principal {
18517 pub fn new() -> Self {
18518 std::default::Default::default()
18519 }
18520
18521 /// Sets the value of [principal][crate::model::Principal::principal].
18522 ///
18523 /// Note that all the setters affecting `principal` are mutually
18524 /// exclusive.
18525 ///
18526 /// # Example
18527 /// ```ignore,no_run
18528 /// # use google_cloud_vmwareengine_v1::model::Principal;
18529 /// use google_cloud_vmwareengine_v1::model::principal::Principal as PrincipalOneOf;
18530 /// let x = Principal::new().set_principal(Some(PrincipalOneOf::User("example".to_string())));
18531 /// ```
18532 pub fn set_principal<
18533 T: std::convert::Into<std::option::Option<crate::model::principal::Principal>>,
18534 >(
18535 mut self,
18536 v: T,
18537 ) -> Self {
18538 self.principal = v.into();
18539 self
18540 }
18541
18542 /// The value of [principal][crate::model::Principal::principal]
18543 /// if it holds a `User`, `None` if the field is not set or
18544 /// holds a different branch.
18545 pub fn user(&self) -> std::option::Option<&std::string::String> {
18546 #[allow(unreachable_patterns)]
18547 self.principal.as_ref().and_then(|v| match v {
18548 crate::model::principal::Principal::User(v) => std::option::Option::Some(v),
18549 _ => std::option::Option::None,
18550 })
18551 }
18552
18553 /// Sets the value of [principal][crate::model::Principal::principal]
18554 /// to hold a `User`.
18555 ///
18556 /// Note that all the setters affecting `principal` are
18557 /// mutually exclusive.
18558 ///
18559 /// # Example
18560 /// ```ignore,no_run
18561 /// # use google_cloud_vmwareengine_v1::model::Principal;
18562 /// let x = Principal::new().set_user("example");
18563 /// assert!(x.user().is_some());
18564 /// assert!(x.service_account().is_none());
18565 /// ```
18566 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18567 self.principal =
18568 std::option::Option::Some(crate::model::principal::Principal::User(v.into()));
18569 self
18570 }
18571
18572 /// The value of [principal][crate::model::Principal::principal]
18573 /// if it holds a `ServiceAccount`, `None` if the field is not set or
18574 /// holds a different branch.
18575 pub fn service_account(&self) -> std::option::Option<&std::string::String> {
18576 #[allow(unreachable_patterns)]
18577 self.principal.as_ref().and_then(|v| match v {
18578 crate::model::principal::Principal::ServiceAccount(v) => std::option::Option::Some(v),
18579 _ => std::option::Option::None,
18580 })
18581 }
18582
18583 /// Sets the value of [principal][crate::model::Principal::principal]
18584 /// to hold a `ServiceAccount`.
18585 ///
18586 /// Note that all the setters affecting `principal` are
18587 /// mutually exclusive.
18588 ///
18589 /// # Example
18590 /// ```ignore,no_run
18591 /// # use google_cloud_vmwareengine_v1::model::Principal;
18592 /// let x = Principal::new().set_service_account("example");
18593 /// assert!(x.service_account().is_some());
18594 /// assert!(x.user().is_none());
18595 /// ```
18596 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18597 self.principal =
18598 std::option::Option::Some(crate::model::principal::Principal::ServiceAccount(v.into()));
18599 self
18600 }
18601}
18602
18603impl wkt::message::Message for Principal {
18604 fn typename() -> &'static str {
18605 "type.googleapis.com/google.cloud.vmwareengine.v1.Principal"
18606 }
18607}
18608
18609/// Defines additional types related to [Principal].
18610pub mod principal {
18611 #[allow(unused_imports)]
18612 use super::*;
18613
18614 /// The consumer provided user/service account which needs to be
18615 /// granted permission to DNS bind with the intranet VPC corresponding to the
18616 /// consumer project.
18617 #[derive(Clone, Debug, PartialEq)]
18618 #[non_exhaustive]
18619 pub enum Principal {
18620 /// The user who needs to be granted permission.
18621 User(std::string::String),
18622 /// The service account which needs to be granted the permission.
18623 ServiceAccount(std::string::String),
18624 }
18625}