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 serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Request message for
40/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
41///
42/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ListPrivateCloudsRequest {
46 /// Required. The resource name of the private cloud to be queried for
47 /// clusters. Resource names are schemeless URIs that follow the conventions in
48 /// <https://cloud.google.com/apis/design/resource_names>.
49 /// For example:
50 /// `projects/my-project/locations/us-central1-a`
51 pub parent: std::string::String,
52
53 /// The maximum number of private clouds to return in one page.
54 /// The service may return fewer than this value.
55 /// The maximum value is coerced to 1000.
56 /// The default value of this field is 500.
57 pub page_size: i32,
58
59 /// A page token, received from a previous `ListPrivateClouds` call.
60 /// Provide this to retrieve the subsequent page.
61 ///
62 /// When paginating, all other parameters provided to `ListPrivateClouds` must
63 /// match the call that provided the page token.
64 pub page_token: std::string::String,
65
66 /// A filter expression that matches resources returned in the response.
67 /// The expression must specify the field name, a comparison operator, and the
68 /// value that you want to use for filtering. The value must be a string, a
69 /// number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
70 /// `<`.
71 ///
72 /// For example, if you are filtering a list of private clouds, you can exclude
73 /// the ones named `example-pc` by specifying `name != "example-pc"`.
74 ///
75 /// You can also filter nested fields. For example, you could specify
76 /// `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
77 /// only if they have a matching address in their network configuration.
78 ///
79 /// To filter on multiple expressions, provide each separate expression within
80 /// parentheses. For example:
81 ///
82 /// ```norust
83 /// (name = "example-pc")
84 /// (createTime > "2021-04-12T08:15:10.40Z")
85 /// ```
86 ///
87 /// By default, each expression is an `AND` expression. However, you can
88 /// include `AND` and `OR` expressions explicitly. For example:
89 ///
90 /// ```norust
91 /// (name = "private-cloud-1") AND
92 /// (createTime > "2021-04-12T08:15:10.40Z") OR
93 /// (name = "private-cloud-2")
94 /// ```
95 pub filter: std::string::String,
96
97 /// Sorts list results by a certain order. By default, returned results are
98 /// ordered by `name` in ascending order. You can also sort results in
99 /// descending order based on the `name` value using `orderBy="name desc"`.
100 /// Currently, only ordering by `name` is supported.
101 pub order_by: std::string::String,
102
103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
104}
105
106impl ListPrivateCloudsRequest {
107 pub fn new() -> Self {
108 std::default::Default::default()
109 }
110
111 /// Sets the value of [parent][crate::model::ListPrivateCloudsRequest::parent].
112 ///
113 /// # Example
114 /// ```ignore,no_run
115 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
116 /// let x = ListPrivateCloudsRequest::new().set_parent("example");
117 /// ```
118 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
119 self.parent = v.into();
120 self
121 }
122
123 /// Sets the value of [page_size][crate::model::ListPrivateCloudsRequest::page_size].
124 ///
125 /// # Example
126 /// ```ignore,no_run
127 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
128 /// let x = ListPrivateCloudsRequest::new().set_page_size(42);
129 /// ```
130 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
131 self.page_size = v.into();
132 self
133 }
134
135 /// Sets the value of [page_token][crate::model::ListPrivateCloudsRequest::page_token].
136 ///
137 /// # Example
138 /// ```ignore,no_run
139 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
140 /// let x = ListPrivateCloudsRequest::new().set_page_token("example");
141 /// ```
142 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
143 self.page_token = v.into();
144 self
145 }
146
147 /// Sets the value of [filter][crate::model::ListPrivateCloudsRequest::filter].
148 ///
149 /// # Example
150 /// ```ignore,no_run
151 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
152 /// let x = ListPrivateCloudsRequest::new().set_filter("example");
153 /// ```
154 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
155 self.filter = v.into();
156 self
157 }
158
159 /// Sets the value of [order_by][crate::model::ListPrivateCloudsRequest::order_by].
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
164 /// let x = ListPrivateCloudsRequest::new().set_order_by("example");
165 /// ```
166 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
167 self.order_by = v.into();
168 self
169 }
170}
171
172impl wkt::message::Message for ListPrivateCloudsRequest {
173 fn typename() -> &'static str {
174 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"
175 }
176}
177
178/// Response message for
179/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
180///
181/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
182#[derive(Clone, Default, PartialEq)]
183#[non_exhaustive]
184pub struct ListPrivateCloudsResponse {
185 /// A list of private clouds.
186 pub private_clouds: std::vec::Vec<crate::model::PrivateCloud>,
187
188 /// A token, which can be sent as `page_token` to retrieve the next page.
189 /// If this field is omitted, there are no subsequent pages.
190 pub next_page_token: std::string::String,
191
192 /// Locations that could not be reached when making an aggregated query using
193 /// wildcards.
194 pub unreachable: std::vec::Vec<std::string::String>,
195
196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
197}
198
199impl ListPrivateCloudsResponse {
200 pub fn new() -> Self {
201 std::default::Default::default()
202 }
203
204 /// Sets the value of [private_clouds][crate::model::ListPrivateCloudsResponse::private_clouds].
205 ///
206 /// # Example
207 /// ```ignore,no_run
208 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
209 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
210 /// let x = ListPrivateCloudsResponse::new()
211 /// .set_private_clouds([
212 /// PrivateCloud::default()/* use setters */,
213 /// PrivateCloud::default()/* use (different) setters */,
214 /// ]);
215 /// ```
216 pub fn set_private_clouds<T, V>(mut self, v: T) -> Self
217 where
218 T: std::iter::IntoIterator<Item = V>,
219 V: std::convert::Into<crate::model::PrivateCloud>,
220 {
221 use std::iter::Iterator;
222 self.private_clouds = v.into_iter().map(|i| i.into()).collect();
223 self
224 }
225
226 /// Sets the value of [next_page_token][crate::model::ListPrivateCloudsResponse::next_page_token].
227 ///
228 /// # Example
229 /// ```ignore,no_run
230 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
231 /// let x = ListPrivateCloudsResponse::new().set_next_page_token("example");
232 /// ```
233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
234 self.next_page_token = v.into();
235 self
236 }
237
238 /// Sets the value of [unreachable][crate::model::ListPrivateCloudsResponse::unreachable].
239 ///
240 /// # Example
241 /// ```ignore,no_run
242 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
243 /// let x = ListPrivateCloudsResponse::new().set_unreachable(["a", "b", "c"]);
244 /// ```
245 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
246 where
247 T: std::iter::IntoIterator<Item = V>,
248 V: std::convert::Into<std::string::String>,
249 {
250 use std::iter::Iterator;
251 self.unreachable = v.into_iter().map(|i| i.into()).collect();
252 self
253 }
254}
255
256impl wkt::message::Message for ListPrivateCloudsResponse {
257 fn typename() -> &'static str {
258 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"
259 }
260}
261
262#[doc(hidden)]
263impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateCloudsResponse {
264 type PageItem = crate::model::PrivateCloud;
265
266 fn items(self) -> std::vec::Vec<Self::PageItem> {
267 self.private_clouds
268 }
269
270 fn next_page_token(&self) -> std::string::String {
271 use std::clone::Clone;
272 self.next_page_token.clone()
273 }
274}
275
276/// Request message for
277/// [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]
278///
279/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]: crate::client::VmwareEngine::get_private_cloud
280#[derive(Clone, Default, PartialEq)]
281#[non_exhaustive]
282pub struct GetPrivateCloudRequest {
283 /// Required. The resource name of the private cloud to retrieve.
284 /// Resource names are schemeless URIs that follow the conventions in
285 /// <https://cloud.google.com/apis/design/resource_names>.
286 /// For example:
287 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
288 pub name: std::string::String,
289
290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
291}
292
293impl GetPrivateCloudRequest {
294 pub fn new() -> Self {
295 std::default::Default::default()
296 }
297
298 /// Sets the value of [name][crate::model::GetPrivateCloudRequest::name].
299 ///
300 /// # Example
301 /// ```ignore,no_run
302 /// # use google_cloud_vmwareengine_v1::model::GetPrivateCloudRequest;
303 /// let x = GetPrivateCloudRequest::new().set_name("example");
304 /// ```
305 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
306 self.name = v.into();
307 self
308 }
309}
310
311impl wkt::message::Message for GetPrivateCloudRequest {
312 fn typename() -> &'static str {
313 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"
314 }
315}
316
317/// Request message for
318/// [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]
319///
320/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]: crate::client::VmwareEngine::create_private_cloud
321#[derive(Clone, Default, PartialEq)]
322#[non_exhaustive]
323pub struct CreatePrivateCloudRequest {
324 /// Required. The resource name of the location to create the new
325 /// private cloud in. Resource names are schemeless URIs that follow the
326 /// conventions in <https://cloud.google.com/apis/design/resource_names>.
327 /// For example:
328 /// `projects/my-project/locations/us-central1-a`
329 pub parent: std::string::String,
330
331 /// Required. The user-provided identifier of the private cloud to be created.
332 /// This identifier must be unique among each `PrivateCloud` within the parent
333 /// and becomes the final token in the name URI.
334 /// The identifier must meet the following requirements:
335 ///
336 /// * Only contains 1-63 alphanumeric characters and hyphens
337 /// * Begins with an alphabetical character
338 /// * Ends with a non-hyphen character
339 /// * Not formatted as a UUID
340 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
341 /// (section 3.5)
342 pub private_cloud_id: std::string::String,
343
344 /// Required. The initial description of the new private cloud.
345 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
346
347 /// Optional. The request ID must be a valid UUID with the exception that zero
348 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
349 pub request_id: std::string::String,
350
351 /// Optional. True if you want the request to be validated and not executed;
352 /// false otherwise.
353 pub validate_only: bool,
354
355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
356}
357
358impl CreatePrivateCloudRequest {
359 pub fn new() -> Self {
360 std::default::Default::default()
361 }
362
363 /// Sets the value of [parent][crate::model::CreatePrivateCloudRequest::parent].
364 ///
365 /// # Example
366 /// ```ignore,no_run
367 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
368 /// let x = CreatePrivateCloudRequest::new().set_parent("example");
369 /// ```
370 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
371 self.parent = v.into();
372 self
373 }
374
375 /// Sets the value of [private_cloud_id][crate::model::CreatePrivateCloudRequest::private_cloud_id].
376 ///
377 /// # Example
378 /// ```ignore,no_run
379 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
380 /// let x = CreatePrivateCloudRequest::new().set_private_cloud_id("example");
381 /// ```
382 pub fn set_private_cloud_id<T: std::convert::Into<std::string::String>>(
383 mut self,
384 v: T,
385 ) -> Self {
386 self.private_cloud_id = v.into();
387 self
388 }
389
390 /// Sets the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
391 ///
392 /// # Example
393 /// ```ignore,no_run
394 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
395 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
396 /// let x = CreatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
397 /// ```
398 pub fn set_private_cloud<T>(mut self, v: T) -> Self
399 where
400 T: std::convert::Into<crate::model::PrivateCloud>,
401 {
402 self.private_cloud = std::option::Option::Some(v.into());
403 self
404 }
405
406 /// Sets or clears the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
407 ///
408 /// # Example
409 /// ```ignore,no_run
410 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
411 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
412 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
413 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
414 /// ```
415 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
416 where
417 T: std::convert::Into<crate::model::PrivateCloud>,
418 {
419 self.private_cloud = v.map(|x| x.into());
420 self
421 }
422
423 /// Sets the value of [request_id][crate::model::CreatePrivateCloudRequest::request_id].
424 ///
425 /// # Example
426 /// ```ignore,no_run
427 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
428 /// let x = CreatePrivateCloudRequest::new().set_request_id("example");
429 /// ```
430 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
431 self.request_id = v.into();
432 self
433 }
434
435 /// Sets the value of [validate_only][crate::model::CreatePrivateCloudRequest::validate_only].
436 ///
437 /// # Example
438 /// ```ignore,no_run
439 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
440 /// let x = CreatePrivateCloudRequest::new().set_validate_only(true);
441 /// ```
442 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
443 self.validate_only = v.into();
444 self
445 }
446}
447
448impl wkt::message::Message for CreatePrivateCloudRequest {
449 fn typename() -> &'static str {
450 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"
451 }
452}
453
454/// Request message for
455/// [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]
456///
457/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]: crate::client::VmwareEngine::update_private_cloud
458#[derive(Clone, Default, PartialEq)]
459#[non_exhaustive]
460pub struct UpdatePrivateCloudRequest {
461 /// Required. Private cloud description.
462 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
463
464 /// Required. Field mask is used to specify the fields to be overwritten in the
465 /// `PrivateCloud` resource by the update. The fields specified in `updateMask`
466 /// are relative to the resource, not the full request. A field will be
467 /// overwritten if it is in the mask. If the user does not provide a mask then
468 /// all fields will be overwritten.
469 pub update_mask: std::option::Option<wkt::FieldMask>,
470
471 /// Optional. The request ID must be a valid UUID with the exception that zero
472 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
473 pub request_id: std::string::String,
474
475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
476}
477
478impl UpdatePrivateCloudRequest {
479 pub fn new() -> Self {
480 std::default::Default::default()
481 }
482
483 /// Sets the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
484 ///
485 /// # Example
486 /// ```ignore,no_run
487 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
488 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
489 /// let x = UpdatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
490 /// ```
491 pub fn set_private_cloud<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<crate::model::PrivateCloud>,
494 {
495 self.private_cloud = std::option::Option::Some(v.into());
496 self
497 }
498
499 /// Sets or clears the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
504 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
505 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
506 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
507 /// ```
508 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
509 where
510 T: std::convert::Into<crate::model::PrivateCloud>,
511 {
512 self.private_cloud = v.map(|x| x.into());
513 self
514 }
515
516 /// Sets the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
517 ///
518 /// # Example
519 /// ```ignore,no_run
520 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
521 /// use wkt::FieldMask;
522 /// let x = UpdatePrivateCloudRequest::new().set_update_mask(FieldMask::default()/* use setters */);
523 /// ```
524 pub fn set_update_mask<T>(mut self, v: T) -> Self
525 where
526 T: std::convert::Into<wkt::FieldMask>,
527 {
528 self.update_mask = std::option::Option::Some(v.into());
529 self
530 }
531
532 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
537 /// use wkt::FieldMask;
538 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
539 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(None::<FieldMask>);
540 /// ```
541 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
542 where
543 T: std::convert::Into<wkt::FieldMask>,
544 {
545 self.update_mask = v.map(|x| x.into());
546 self
547 }
548
549 /// Sets the value of [request_id][crate::model::UpdatePrivateCloudRequest::request_id].
550 ///
551 /// # Example
552 /// ```ignore,no_run
553 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
554 /// let x = UpdatePrivateCloudRequest::new().set_request_id("example");
555 /// ```
556 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
557 self.request_id = v.into();
558 self
559 }
560}
561
562impl wkt::message::Message for UpdatePrivateCloudRequest {
563 fn typename() -> &'static str {
564 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"
565 }
566}
567
568/// Request message for
569/// [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]
570///
571/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]: crate::client::VmwareEngine::delete_private_cloud
572#[derive(Clone, Default, PartialEq)]
573#[non_exhaustive]
574pub struct DeletePrivateCloudRequest {
575 /// Required. The resource name of the private cloud to delete.
576 /// Resource names are schemeless URIs that follow the conventions in
577 /// <https://cloud.google.com/apis/design/resource_names>.
578 /// For example:
579 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
580 pub name: std::string::String,
581
582 /// Optional. The request ID must be a valid UUID with the exception that zero
583 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
584 pub request_id: std::string::String,
585
586 /// Optional. If set to true, cascade delete is enabled and all children of
587 /// this private cloud resource are also deleted. When this flag is set to
588 /// false, the private cloud will not be deleted if there are any children
589 /// other than the management cluster. The management cluster is always
590 /// deleted.
591 pub force: bool,
592
593 /// Optional. Time delay of the deletion specified in hours. The default value
594 /// is `3`. Specifying a non-zero value for this field changes the value of
595 /// `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
596 /// deletion time. Deletion can be cancelled before `expire_time` elapses using
597 /// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud].
598 /// Specifying a value of `0` for this field instead begins the deletion
599 /// process and ceases billing immediately. During the final deletion process,
600 /// the value of `PrivateCloud.state` becomes `PURGING`.
601 ///
602 /// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
603 pub delay_hours: std::option::Option<i32>,
604
605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
606}
607
608impl DeletePrivateCloudRequest {
609 pub fn new() -> Self {
610 std::default::Default::default()
611 }
612
613 /// Sets the value of [name][crate::model::DeletePrivateCloudRequest::name].
614 ///
615 /// # Example
616 /// ```ignore,no_run
617 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
618 /// let x = DeletePrivateCloudRequest::new().set_name("example");
619 /// ```
620 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
621 self.name = v.into();
622 self
623 }
624
625 /// Sets the value of [request_id][crate::model::DeletePrivateCloudRequest::request_id].
626 ///
627 /// # Example
628 /// ```ignore,no_run
629 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
630 /// let x = DeletePrivateCloudRequest::new().set_request_id("example");
631 /// ```
632 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
633 self.request_id = v.into();
634 self
635 }
636
637 /// Sets the value of [force][crate::model::DeletePrivateCloudRequest::force].
638 ///
639 /// # Example
640 /// ```ignore,no_run
641 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
642 /// let x = DeletePrivateCloudRequest::new().set_force(true);
643 /// ```
644 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
645 self.force = v.into();
646 self
647 }
648
649 /// Sets the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
650 ///
651 /// # Example
652 /// ```ignore,no_run
653 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
654 /// let x = DeletePrivateCloudRequest::new().set_delay_hours(42);
655 /// ```
656 pub fn set_delay_hours<T>(mut self, v: T) -> Self
657 where
658 T: std::convert::Into<i32>,
659 {
660 self.delay_hours = std::option::Option::Some(v.into());
661 self
662 }
663
664 /// Sets or clears the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
665 ///
666 /// # Example
667 /// ```ignore,no_run
668 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
669 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(Some(42));
670 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(None::<i32>);
671 /// ```
672 pub fn set_or_clear_delay_hours<T>(mut self, v: std::option::Option<T>) -> Self
673 where
674 T: std::convert::Into<i32>,
675 {
676 self.delay_hours = v.map(|x| x.into());
677 self
678 }
679}
680
681impl wkt::message::Message for DeletePrivateCloudRequest {
682 fn typename() -> &'static str {
683 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"
684 }
685}
686
687/// Request message for
688/// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]
689///
690/// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
691#[derive(Clone, Default, PartialEq)]
692#[non_exhaustive]
693pub struct UndeletePrivateCloudRequest {
694 /// Required. The resource name of the private cloud scheduled for deletion.
695 /// Resource names are schemeless URIs that follow the conventions in
696 /// <https://cloud.google.com/apis/design/resource_names>.
697 /// For example:
698 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
699 pub name: std::string::String,
700
701 /// Optional. The request ID must be a valid UUID with the exception that zero
702 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
703 pub request_id: std::string::String,
704
705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
706}
707
708impl UndeletePrivateCloudRequest {
709 pub fn new() -> Self {
710 std::default::Default::default()
711 }
712
713 /// Sets the value of [name][crate::model::UndeletePrivateCloudRequest::name].
714 ///
715 /// # Example
716 /// ```ignore,no_run
717 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
718 /// let x = UndeletePrivateCloudRequest::new().set_name("example");
719 /// ```
720 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
721 self.name = v.into();
722 self
723 }
724
725 /// Sets the value of [request_id][crate::model::UndeletePrivateCloudRequest::request_id].
726 ///
727 /// # Example
728 /// ```ignore,no_run
729 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
730 /// let x = UndeletePrivateCloudRequest::new().set_request_id("example");
731 /// ```
732 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733 self.request_id = v.into();
734 self
735 }
736}
737
738impl wkt::message::Message for UndeletePrivateCloudRequest {
739 fn typename() -> &'static str {
740 "type.googleapis.com/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"
741 }
742}
743
744/// Request message for
745/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
746///
747/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
748#[derive(Clone, Default, PartialEq)]
749#[non_exhaustive]
750pub struct ListClustersRequest {
751 /// Required. The resource name of the private cloud to query for clusters.
752 /// Resource names are schemeless URIs that follow the conventions in
753 /// <https://cloud.google.com/apis/design/resource_names>.
754 /// For example:
755 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
756 pub parent: std::string::String,
757
758 /// The maximum number of clusters to return in one page.
759 /// The service may return fewer than this value.
760 /// The maximum value is coerced to 1000.
761 /// The default value of this field is 500.
762 pub page_size: i32,
763
764 /// A page token, received from a previous `ListClusters` call.
765 /// Provide this to retrieve the subsequent page.
766 ///
767 /// When paginating, all other parameters provided to `ListClusters`
768 /// must match the call that provided the page token.
769 pub page_token: std::string::String,
770
771 /// To filter on multiple expressions, provide each separate expression within
772 /// parentheses. For example:
773 ///
774 /// ```norust
775 /// (name = "example-cluster")
776 /// (nodeCount = "3")
777 /// ```
778 ///
779 /// By default, each expression is an `AND` expression. However, you can
780 /// include `AND` and `OR` expressions explicitly. For example:
781 ///
782 /// ```norust
783 /// (name = "example-cluster-1") AND
784 /// (createTime > "2021-04-12T08:15:10.40Z") OR
785 /// (name = "example-cluster-2")
786 /// ```
787 pub filter: std::string::String,
788
789 /// Sorts list results by a certain order. By default, returned results are
790 /// ordered by `name` in ascending order. You can also sort results in
791 /// descending order based on the `name` value using `orderBy="name desc"`.
792 /// Currently, only ordering by `name` is supported.
793 pub order_by: std::string::String,
794
795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
796}
797
798impl ListClustersRequest {
799 pub fn new() -> Self {
800 std::default::Default::default()
801 }
802
803 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
804 ///
805 /// # Example
806 /// ```ignore,no_run
807 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
808 /// let x = ListClustersRequest::new().set_parent("example");
809 /// ```
810 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811 self.parent = v.into();
812 self
813 }
814
815 /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
816 ///
817 /// # Example
818 /// ```ignore,no_run
819 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
820 /// let x = ListClustersRequest::new().set_page_size(42);
821 /// ```
822 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
823 self.page_size = v.into();
824 self
825 }
826
827 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
828 ///
829 /// # Example
830 /// ```ignore,no_run
831 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
832 /// let x = ListClustersRequest::new().set_page_token("example");
833 /// ```
834 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
835 self.page_token = v.into();
836 self
837 }
838
839 /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
840 ///
841 /// # Example
842 /// ```ignore,no_run
843 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
844 /// let x = ListClustersRequest::new().set_filter("example");
845 /// ```
846 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
847 self.filter = v.into();
848 self
849 }
850
851 /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
852 ///
853 /// # Example
854 /// ```ignore,no_run
855 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
856 /// let x = ListClustersRequest::new().set_order_by("example");
857 /// ```
858 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
859 self.order_by = v.into();
860 self
861 }
862}
863
864impl wkt::message::Message for ListClustersRequest {
865 fn typename() -> &'static str {
866 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersRequest"
867 }
868}
869
870/// Response message for
871/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
872///
873/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
874#[derive(Clone, Default, PartialEq)]
875#[non_exhaustive]
876pub struct ListClustersResponse {
877 /// A list of private cloud clusters.
878 pub clusters: std::vec::Vec<crate::model::Cluster>,
879
880 /// A token, which can be sent as `page_token` to retrieve the next page.
881 /// If this field is omitted, there are no subsequent pages.
882 pub next_page_token: std::string::String,
883
884 /// Locations that could not be reached when making an aggregated query using
885 /// wildcards.
886 pub unreachable: std::vec::Vec<std::string::String>,
887
888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
889}
890
891impl ListClustersResponse {
892 pub fn new() -> Self {
893 std::default::Default::default()
894 }
895
896 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
901 /// use google_cloud_vmwareengine_v1::model::Cluster;
902 /// let x = ListClustersResponse::new()
903 /// .set_clusters([
904 /// Cluster::default()/* use setters */,
905 /// Cluster::default()/* use (different) setters */,
906 /// ]);
907 /// ```
908 pub fn set_clusters<T, V>(mut self, v: T) -> Self
909 where
910 T: std::iter::IntoIterator<Item = V>,
911 V: std::convert::Into<crate::model::Cluster>,
912 {
913 use std::iter::Iterator;
914 self.clusters = v.into_iter().map(|i| i.into()).collect();
915 self
916 }
917
918 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
919 ///
920 /// # Example
921 /// ```ignore,no_run
922 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
923 /// let x = ListClustersResponse::new().set_next_page_token("example");
924 /// ```
925 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
926 self.next_page_token = v.into();
927 self
928 }
929
930 /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
931 ///
932 /// # Example
933 /// ```ignore,no_run
934 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
935 /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
936 /// ```
937 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
938 where
939 T: std::iter::IntoIterator<Item = V>,
940 V: std::convert::Into<std::string::String>,
941 {
942 use std::iter::Iterator;
943 self.unreachable = v.into_iter().map(|i| i.into()).collect();
944 self
945 }
946}
947
948impl wkt::message::Message for ListClustersResponse {
949 fn typename() -> &'static str {
950 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersResponse"
951 }
952}
953
954#[doc(hidden)]
955impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
956 type PageItem = crate::model::Cluster;
957
958 fn items(self) -> std::vec::Vec<Self::PageItem> {
959 self.clusters
960 }
961
962 fn next_page_token(&self) -> std::string::String {
963 use std::clone::Clone;
964 self.next_page_token.clone()
965 }
966}
967
968/// Request message for
969/// [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]
970///
971/// [google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]: crate::client::VmwareEngine::get_cluster
972#[derive(Clone, Default, PartialEq)]
973#[non_exhaustive]
974pub struct GetClusterRequest {
975 /// Required. The cluster resource name to retrieve.
976 /// Resource names are schemeless URIs that follow the conventions in
977 /// <https://cloud.google.com/apis/design/resource_names>.
978 /// For example:
979 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
980 pub name: std::string::String,
981
982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
983}
984
985impl GetClusterRequest {
986 pub fn new() -> Self {
987 std::default::Default::default()
988 }
989
990 /// Sets the value of [name][crate::model::GetClusterRequest::name].
991 ///
992 /// # Example
993 /// ```ignore,no_run
994 /// # use google_cloud_vmwareengine_v1::model::GetClusterRequest;
995 /// let x = GetClusterRequest::new().set_name("example");
996 /// ```
997 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
998 self.name = v.into();
999 self
1000 }
1001}
1002
1003impl wkt::message::Message for GetClusterRequest {
1004 fn typename() -> &'static str {
1005 "type.googleapis.com/google.cloud.vmwareengine.v1.GetClusterRequest"
1006 }
1007}
1008
1009/// Request message for
1010/// [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]
1011///
1012/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]: crate::client::VmwareEngine::create_cluster
1013#[derive(Clone, Default, PartialEq)]
1014#[non_exhaustive]
1015pub struct CreateClusterRequest {
1016 /// Required. The resource name of the private cloud to create a new cluster
1017 /// in. Resource names are schemeless URIs that follow the conventions in
1018 /// <https://cloud.google.com/apis/design/resource_names>.
1019 /// For example:
1020 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1021 pub parent: std::string::String,
1022
1023 /// Required. The user-provided identifier of the new `Cluster`.
1024 /// This identifier must be unique among clusters within the parent and becomes
1025 /// the final token in the name URI.
1026 /// The identifier must meet the following requirements:
1027 ///
1028 /// * Only contains 1-63 alphanumeric characters and hyphens
1029 /// * Begins with an alphabetical character
1030 /// * Ends with a non-hyphen character
1031 /// * Not formatted as a UUID
1032 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1033 /// (section 3.5)
1034 pub cluster_id: std::string::String,
1035
1036 /// Required. The initial description of the new cluster.
1037 pub cluster: std::option::Option<crate::model::Cluster>,
1038
1039 /// Optional. The request ID must be a valid UUID with the exception that zero
1040 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1041 pub request_id: std::string::String,
1042
1043 /// Optional. True if you want the request to be validated and not executed;
1044 /// false otherwise.
1045 pub validate_only: bool,
1046
1047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1048}
1049
1050impl CreateClusterRequest {
1051 pub fn new() -> Self {
1052 std::default::Default::default()
1053 }
1054
1055 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
1056 ///
1057 /// # Example
1058 /// ```ignore,no_run
1059 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1060 /// let x = CreateClusterRequest::new().set_parent("example");
1061 /// ```
1062 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1063 self.parent = v.into();
1064 self
1065 }
1066
1067 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
1068 ///
1069 /// # Example
1070 /// ```ignore,no_run
1071 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1072 /// let x = CreateClusterRequest::new().set_cluster_id("example");
1073 /// ```
1074 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1075 self.cluster_id = v.into();
1076 self
1077 }
1078
1079 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
1080 ///
1081 /// # Example
1082 /// ```ignore,no_run
1083 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1084 /// use google_cloud_vmwareengine_v1::model::Cluster;
1085 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1086 /// ```
1087 pub fn set_cluster<T>(mut self, v: T) -> Self
1088 where
1089 T: std::convert::Into<crate::model::Cluster>,
1090 {
1091 self.cluster = std::option::Option::Some(v.into());
1092 self
1093 }
1094
1095 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
1096 ///
1097 /// # Example
1098 /// ```ignore,no_run
1099 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1100 /// use google_cloud_vmwareengine_v1::model::Cluster;
1101 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1102 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1103 /// ```
1104 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1105 where
1106 T: std::convert::Into<crate::model::Cluster>,
1107 {
1108 self.cluster = v.map(|x| x.into());
1109 self
1110 }
1111
1112 /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
1113 ///
1114 /// # Example
1115 /// ```ignore,no_run
1116 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1117 /// let x = CreateClusterRequest::new().set_request_id("example");
1118 /// ```
1119 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.request_id = v.into();
1121 self
1122 }
1123
1124 /// Sets the value of [validate_only][crate::model::CreateClusterRequest::validate_only].
1125 ///
1126 /// # Example
1127 /// ```ignore,no_run
1128 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1129 /// let x = CreateClusterRequest::new().set_validate_only(true);
1130 /// ```
1131 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1132 self.validate_only = v.into();
1133 self
1134 }
1135}
1136
1137impl wkt::message::Message for CreateClusterRequest {
1138 fn typename() -> &'static str {
1139 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateClusterRequest"
1140 }
1141}
1142
1143/// Request message for
1144/// [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]
1145///
1146/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]: crate::client::VmwareEngine::update_cluster
1147#[derive(Clone, Default, PartialEq)]
1148#[non_exhaustive]
1149pub struct UpdateClusterRequest {
1150 /// Required. Field mask is used to specify the fields to be overwritten in the
1151 /// `Cluster` resource by the update. The fields specified in the `updateMask`
1152 /// are relative to the resource, not the full request. A field will be
1153 /// overwritten if it is in the mask. If the user does not provide a mask then
1154 /// all fields will be overwritten.
1155 pub update_mask: std::option::Option<wkt::FieldMask>,
1156
1157 /// Required. The description of the cluster.
1158 pub cluster: std::option::Option<crate::model::Cluster>,
1159
1160 /// Optional. The request ID must be a valid UUID with the exception that
1161 /// zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1162 pub request_id: std::string::String,
1163
1164 /// Optional. True if you want the request to be validated and not executed;
1165 /// false otherwise.
1166 pub validate_only: bool,
1167
1168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1169}
1170
1171impl UpdateClusterRequest {
1172 pub fn new() -> Self {
1173 std::default::Default::default()
1174 }
1175
1176 /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1177 ///
1178 /// # Example
1179 /// ```ignore,no_run
1180 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1181 /// use wkt::FieldMask;
1182 /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1183 /// ```
1184 pub fn set_update_mask<T>(mut self, v: T) -> Self
1185 where
1186 T: std::convert::Into<wkt::FieldMask>,
1187 {
1188 self.update_mask = std::option::Option::Some(v.into());
1189 self
1190 }
1191
1192 /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1193 ///
1194 /// # Example
1195 /// ```ignore,no_run
1196 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1197 /// use wkt::FieldMask;
1198 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1199 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1200 /// ```
1201 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1202 where
1203 T: std::convert::Into<wkt::FieldMask>,
1204 {
1205 self.update_mask = v.map(|x| x.into());
1206 self
1207 }
1208
1209 /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1210 ///
1211 /// # Example
1212 /// ```ignore,no_run
1213 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1214 /// use google_cloud_vmwareengine_v1::model::Cluster;
1215 /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1216 /// ```
1217 pub fn set_cluster<T>(mut self, v: T) -> Self
1218 where
1219 T: std::convert::Into<crate::model::Cluster>,
1220 {
1221 self.cluster = std::option::Option::Some(v.into());
1222 self
1223 }
1224
1225 /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1226 ///
1227 /// # Example
1228 /// ```ignore,no_run
1229 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1230 /// use google_cloud_vmwareengine_v1::model::Cluster;
1231 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1232 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1233 /// ```
1234 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1235 where
1236 T: std::convert::Into<crate::model::Cluster>,
1237 {
1238 self.cluster = v.map(|x| x.into());
1239 self
1240 }
1241
1242 /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
1243 ///
1244 /// # Example
1245 /// ```ignore,no_run
1246 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1247 /// let x = UpdateClusterRequest::new().set_request_id("example");
1248 /// ```
1249 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.request_id = v.into();
1251 self
1252 }
1253
1254 /// Sets the value of [validate_only][crate::model::UpdateClusterRequest::validate_only].
1255 ///
1256 /// # Example
1257 /// ```ignore,no_run
1258 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1259 /// let x = UpdateClusterRequest::new().set_validate_only(true);
1260 /// ```
1261 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1262 self.validate_only = v.into();
1263 self
1264 }
1265}
1266
1267impl wkt::message::Message for UpdateClusterRequest {
1268 fn typename() -> &'static str {
1269 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateClusterRequest"
1270 }
1271}
1272
1273/// Request message for
1274/// [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]
1275///
1276/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]: crate::client::VmwareEngine::delete_cluster
1277#[derive(Clone, Default, PartialEq)]
1278#[non_exhaustive]
1279pub struct DeleteClusterRequest {
1280 /// Required. The resource name of the cluster to delete.
1281 /// Resource names are schemeless URIs that follow the conventions in
1282 /// <https://cloud.google.com/apis/design/resource_names>.
1283 /// For example:
1284 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1285 pub name: std::string::String,
1286
1287 /// Optional. The request ID must be a valid UUID with the exception that zero
1288 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1289 pub request_id: std::string::String,
1290
1291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1292}
1293
1294impl DeleteClusterRequest {
1295 pub fn new() -> Self {
1296 std::default::Default::default()
1297 }
1298
1299 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1300 ///
1301 /// # Example
1302 /// ```ignore,no_run
1303 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1304 /// let x = DeleteClusterRequest::new().set_name("example");
1305 /// ```
1306 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1307 self.name = v.into();
1308 self
1309 }
1310
1311 /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
1312 ///
1313 /// # Example
1314 /// ```ignore,no_run
1315 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1316 /// let x = DeleteClusterRequest::new().set_request_id("example");
1317 /// ```
1318 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1319 self.request_id = v.into();
1320 self
1321 }
1322}
1323
1324impl wkt::message::Message for DeleteClusterRequest {
1325 fn typename() -> &'static str {
1326 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteClusterRequest"
1327 }
1328}
1329
1330/// Request message for
1331/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1332///
1333/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1334#[derive(Clone, Default, PartialEq)]
1335#[non_exhaustive]
1336pub struct ListNodesRequest {
1337 /// Required. The resource name of the cluster to be queried for nodes.
1338 /// Resource names are schemeless URIs that follow the conventions in
1339 /// <https://cloud.google.com/apis/design/resource_names>.
1340 /// For example:
1341 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1342 pub parent: std::string::String,
1343
1344 /// The maximum number of nodes to return in one page.
1345 /// The service may return fewer than this value.
1346 /// The maximum value is coerced to 1000.
1347 /// The default value of this field is 500.
1348 pub page_size: i32,
1349
1350 /// A page token, received from a previous `ListNodes` call.
1351 /// Provide this to retrieve the subsequent page.
1352 ///
1353 /// When paginating, all other parameters provided to
1354 /// `ListNodes` must match the call that provided the page
1355 /// token.
1356 pub page_token: std::string::String,
1357
1358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1359}
1360
1361impl ListNodesRequest {
1362 pub fn new() -> Self {
1363 std::default::Default::default()
1364 }
1365
1366 /// Sets the value of [parent][crate::model::ListNodesRequest::parent].
1367 ///
1368 /// # Example
1369 /// ```ignore,no_run
1370 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1371 /// let x = ListNodesRequest::new().set_parent("example");
1372 /// ```
1373 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1374 self.parent = v.into();
1375 self
1376 }
1377
1378 /// Sets the value of [page_size][crate::model::ListNodesRequest::page_size].
1379 ///
1380 /// # Example
1381 /// ```ignore,no_run
1382 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1383 /// let x = ListNodesRequest::new().set_page_size(42);
1384 /// ```
1385 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1386 self.page_size = v.into();
1387 self
1388 }
1389
1390 /// Sets the value of [page_token][crate::model::ListNodesRequest::page_token].
1391 ///
1392 /// # Example
1393 /// ```ignore,no_run
1394 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1395 /// let x = ListNodesRequest::new().set_page_token("example");
1396 /// ```
1397 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1398 self.page_token = v.into();
1399 self
1400 }
1401}
1402
1403impl wkt::message::Message for ListNodesRequest {
1404 fn typename() -> &'static str {
1405 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesRequest"
1406 }
1407}
1408
1409/// Response message for
1410/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1411///
1412/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1413#[derive(Clone, Default, PartialEq)]
1414#[non_exhaustive]
1415pub struct ListNodesResponse {
1416 /// The nodes.
1417 pub nodes: std::vec::Vec<crate::model::Node>,
1418
1419 /// A token, which can be sent as `page_token` to retrieve the next page.
1420 /// If this field is omitted, there are no subsequent pages.
1421 pub next_page_token: std::string::String,
1422
1423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1424}
1425
1426impl ListNodesResponse {
1427 pub fn new() -> Self {
1428 std::default::Default::default()
1429 }
1430
1431 /// Sets the value of [nodes][crate::model::ListNodesResponse::nodes].
1432 ///
1433 /// # Example
1434 /// ```ignore,no_run
1435 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1436 /// use google_cloud_vmwareengine_v1::model::Node;
1437 /// let x = ListNodesResponse::new()
1438 /// .set_nodes([
1439 /// Node::default()/* use setters */,
1440 /// Node::default()/* use (different) setters */,
1441 /// ]);
1442 /// ```
1443 pub fn set_nodes<T, V>(mut self, v: T) -> Self
1444 where
1445 T: std::iter::IntoIterator<Item = V>,
1446 V: std::convert::Into<crate::model::Node>,
1447 {
1448 use std::iter::Iterator;
1449 self.nodes = v.into_iter().map(|i| i.into()).collect();
1450 self
1451 }
1452
1453 /// Sets the value of [next_page_token][crate::model::ListNodesResponse::next_page_token].
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1458 /// let x = ListNodesResponse::new().set_next_page_token("example");
1459 /// ```
1460 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1461 self.next_page_token = v.into();
1462 self
1463 }
1464}
1465
1466impl wkt::message::Message for ListNodesResponse {
1467 fn typename() -> &'static str {
1468 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesResponse"
1469 }
1470}
1471
1472#[doc(hidden)]
1473impl google_cloud_gax::paginator::internal::PageableResponse for ListNodesResponse {
1474 type PageItem = crate::model::Node;
1475
1476 fn items(self) -> std::vec::Vec<Self::PageItem> {
1477 self.nodes
1478 }
1479
1480 fn next_page_token(&self) -> std::string::String {
1481 use std::clone::Clone;
1482 self.next_page_token.clone()
1483 }
1484}
1485
1486/// Request message for
1487/// [VmwareEngine.GetNode][google.cloud.vmwareengine.v1.VmwareEngine.GetNode]
1488///
1489/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNode]: crate::client::VmwareEngine::get_node
1490#[derive(Clone, Default, PartialEq)]
1491#[non_exhaustive]
1492pub struct GetNodeRequest {
1493 /// Required. The resource name of the node to retrieve.
1494 /// For example:
1495 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}`
1496 pub name: std::string::String,
1497
1498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1499}
1500
1501impl GetNodeRequest {
1502 pub fn new() -> Self {
1503 std::default::Default::default()
1504 }
1505
1506 /// Sets the value of [name][crate::model::GetNodeRequest::name].
1507 ///
1508 /// # Example
1509 /// ```ignore,no_run
1510 /// # use google_cloud_vmwareengine_v1::model::GetNodeRequest;
1511 /// let x = GetNodeRequest::new().set_name("example");
1512 /// ```
1513 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1514 self.name = v.into();
1515 self
1516 }
1517}
1518
1519impl wkt::message::Message for GetNodeRequest {
1520 fn typename() -> &'static str {
1521 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeRequest"
1522 }
1523}
1524
1525/// Request message for
1526/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1527///
1528/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1529#[derive(Clone, Default, PartialEq)]
1530#[non_exhaustive]
1531pub struct ListExternalAddressesRequest {
1532 /// Required. The resource name of the private cloud to be queried for
1533 /// external IP addresses.
1534 /// Resource names are schemeless URIs that follow the conventions in
1535 /// <https://cloud.google.com/apis/design/resource_names>.
1536 /// For example:
1537 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1538 pub parent: std::string::String,
1539
1540 /// The maximum number of external IP addresses to return in one page.
1541 /// The service may return fewer than this value.
1542 /// The maximum value is coerced to 1000.
1543 /// The default value of this field is 500.
1544 pub page_size: i32,
1545
1546 /// A page token, received from a previous `ListExternalAddresses` call.
1547 /// Provide this to retrieve the subsequent page.
1548 ///
1549 /// When paginating, all other parameters provided to
1550 /// `ListExternalAddresses` must match the call that provided the page token.
1551 pub page_token: std::string::String,
1552
1553 /// A filter expression that matches resources returned in the response.
1554 /// The expression must specify the field name, a comparison
1555 /// operator, and the value that you want to use for filtering. The value
1556 /// must be a string, a number, or a boolean. The comparison operator
1557 /// must be `=`, `!=`, `>`, or `<`.
1558 ///
1559 /// For example, if you are filtering a list of IP addresses, you can
1560 /// exclude the ones named `example-ip` by specifying
1561 /// `name != "example-ip"`.
1562 ///
1563 /// To filter on multiple expressions, provide each separate expression within
1564 /// parentheses. For example:
1565 ///
1566 /// ```norust
1567 /// (name = "example-ip")
1568 /// (createTime > "2021-04-12T08:15:10.40Z")
1569 /// ```
1570 ///
1571 /// By default, each expression is an `AND` expression. However, you
1572 /// can include `AND` and `OR` expressions explicitly.
1573 /// For example:
1574 ///
1575 /// ```norust
1576 /// (name = "example-ip-1") AND
1577 /// (createTime > "2021-04-12T08:15:10.40Z") OR
1578 /// (name = "example-ip-2")
1579 /// ```
1580 pub filter: std::string::String,
1581
1582 /// Sorts list results by a certain order. By default, returned results
1583 /// are ordered by `name` in ascending order.
1584 /// You can also sort results in descending order based on the `name` value
1585 /// using `orderBy="name desc"`.
1586 /// Currently, only ordering by `name` is supported.
1587 pub order_by: std::string::String,
1588
1589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1590}
1591
1592impl ListExternalAddressesRequest {
1593 pub fn new() -> Self {
1594 std::default::Default::default()
1595 }
1596
1597 /// Sets the value of [parent][crate::model::ListExternalAddressesRequest::parent].
1598 ///
1599 /// # Example
1600 /// ```ignore,no_run
1601 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1602 /// let x = ListExternalAddressesRequest::new().set_parent("example");
1603 /// ```
1604 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1605 self.parent = v.into();
1606 self
1607 }
1608
1609 /// Sets the value of [page_size][crate::model::ListExternalAddressesRequest::page_size].
1610 ///
1611 /// # Example
1612 /// ```ignore,no_run
1613 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1614 /// let x = ListExternalAddressesRequest::new().set_page_size(42);
1615 /// ```
1616 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1617 self.page_size = v.into();
1618 self
1619 }
1620
1621 /// Sets the value of [page_token][crate::model::ListExternalAddressesRequest::page_token].
1622 ///
1623 /// # Example
1624 /// ```ignore,no_run
1625 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1626 /// let x = ListExternalAddressesRequest::new().set_page_token("example");
1627 /// ```
1628 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.page_token = v.into();
1630 self
1631 }
1632
1633 /// Sets the value of [filter][crate::model::ListExternalAddressesRequest::filter].
1634 ///
1635 /// # Example
1636 /// ```ignore,no_run
1637 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1638 /// let x = ListExternalAddressesRequest::new().set_filter("example");
1639 /// ```
1640 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.filter = v.into();
1642 self
1643 }
1644
1645 /// Sets the value of [order_by][crate::model::ListExternalAddressesRequest::order_by].
1646 ///
1647 /// # Example
1648 /// ```ignore,no_run
1649 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1650 /// let x = ListExternalAddressesRequest::new().set_order_by("example");
1651 /// ```
1652 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.order_by = v.into();
1654 self
1655 }
1656}
1657
1658impl wkt::message::Message for ListExternalAddressesRequest {
1659 fn typename() -> &'static str {
1660 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesRequest"
1661 }
1662}
1663
1664/// Response message for
1665/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1666///
1667/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1668#[derive(Clone, Default, PartialEq)]
1669#[non_exhaustive]
1670pub struct ListExternalAddressesResponse {
1671 /// A list of external IP addresses.
1672 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1673
1674 /// A token, which can be sent as `page_token` to retrieve the next page.
1675 /// If this field is omitted, there are no subsequent pages.
1676 pub next_page_token: std::string::String,
1677
1678 /// Locations that could not be reached when making an aggregated query using
1679 /// wildcards.
1680 pub unreachable: std::vec::Vec<std::string::String>,
1681
1682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1683}
1684
1685impl ListExternalAddressesResponse {
1686 pub fn new() -> Self {
1687 std::default::Default::default()
1688 }
1689
1690 /// Sets the value of [external_addresses][crate::model::ListExternalAddressesResponse::external_addresses].
1691 ///
1692 /// # Example
1693 /// ```ignore,no_run
1694 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1695 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1696 /// let x = ListExternalAddressesResponse::new()
1697 /// .set_external_addresses([
1698 /// ExternalAddress::default()/* use setters */,
1699 /// ExternalAddress::default()/* use (different) setters */,
1700 /// ]);
1701 /// ```
1702 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1703 where
1704 T: std::iter::IntoIterator<Item = V>,
1705 V: std::convert::Into<crate::model::ExternalAddress>,
1706 {
1707 use std::iter::Iterator;
1708 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1709 self
1710 }
1711
1712 /// Sets the value of [next_page_token][crate::model::ListExternalAddressesResponse::next_page_token].
1713 ///
1714 /// # Example
1715 /// ```ignore,no_run
1716 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1717 /// let x = ListExternalAddressesResponse::new().set_next_page_token("example");
1718 /// ```
1719 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1720 self.next_page_token = v.into();
1721 self
1722 }
1723
1724 /// Sets the value of [unreachable][crate::model::ListExternalAddressesResponse::unreachable].
1725 ///
1726 /// # Example
1727 /// ```ignore,no_run
1728 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1729 /// let x = ListExternalAddressesResponse::new().set_unreachable(["a", "b", "c"]);
1730 /// ```
1731 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1732 where
1733 T: std::iter::IntoIterator<Item = V>,
1734 V: std::convert::Into<std::string::String>,
1735 {
1736 use std::iter::Iterator;
1737 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1738 self
1739 }
1740}
1741
1742impl wkt::message::Message for ListExternalAddressesResponse {
1743 fn typename() -> &'static str {
1744 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesResponse"
1745 }
1746}
1747
1748#[doc(hidden)]
1749impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAddressesResponse {
1750 type PageItem = crate::model::ExternalAddress;
1751
1752 fn items(self) -> std::vec::Vec<Self::PageItem> {
1753 self.external_addresses
1754 }
1755
1756 fn next_page_token(&self) -> std::string::String {
1757 use std::clone::Clone;
1758 self.next_page_token.clone()
1759 }
1760}
1761
1762/// Request message for
1763/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1764///
1765/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1766#[derive(Clone, Default, PartialEq)]
1767#[non_exhaustive]
1768pub struct FetchNetworkPolicyExternalAddressesRequest {
1769 /// Required. The resource name of the network policy to query for assigned
1770 /// external IP addresses. Resource names are schemeless URIs that follow the
1771 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
1772 /// example:
1773 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
1774 pub network_policy: std::string::String,
1775
1776 /// The maximum number of external IP addresses to return in one page.
1777 /// The service may return fewer than this value.
1778 /// The maximum value is coerced to 1000.
1779 /// The default value of this field is 500.
1780 pub page_size: i32,
1781
1782 /// A page token, received from a previous
1783 /// `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the
1784 /// subsequent page.
1785 ///
1786 /// When paginating, all parameters provided to
1787 /// `FetchNetworkPolicyExternalAddresses`, except for `page_size` and
1788 /// `page_token`, must match the call that provided the page token.
1789 pub page_token: std::string::String,
1790
1791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1792}
1793
1794impl FetchNetworkPolicyExternalAddressesRequest {
1795 pub fn new() -> Self {
1796 std::default::Default::default()
1797 }
1798
1799 /// Sets the value of [network_policy][crate::model::FetchNetworkPolicyExternalAddressesRequest::network_policy].
1800 ///
1801 /// # Example
1802 /// ```ignore,no_run
1803 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1804 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_network_policy("example");
1805 /// ```
1806 pub fn set_network_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1807 self.network_policy = v.into();
1808 self
1809 }
1810
1811 /// Sets the value of [page_size][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_size].
1812 ///
1813 /// # Example
1814 /// ```ignore,no_run
1815 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1816 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_size(42);
1817 /// ```
1818 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1819 self.page_size = v.into();
1820 self
1821 }
1822
1823 /// Sets the value of [page_token][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_token].
1824 ///
1825 /// # Example
1826 /// ```ignore,no_run
1827 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1828 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_token("example");
1829 /// ```
1830 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1831 self.page_token = v.into();
1832 self
1833 }
1834}
1835
1836impl wkt::message::Message for FetchNetworkPolicyExternalAddressesRequest {
1837 fn typename() -> &'static str {
1838 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest"
1839 }
1840}
1841
1842/// Response message for
1843/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1844///
1845/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1846#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct FetchNetworkPolicyExternalAddressesResponse {
1849 /// A list of external IP addresses assigned to VMware workload VMs within the
1850 /// scope of the given network policy.
1851 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1852
1853 /// A token, which can be sent as `page_token` to retrieve the next page.
1854 /// If this field is omitted, there are no subsequent pages.
1855 pub next_page_token: std::string::String,
1856
1857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1858}
1859
1860impl FetchNetworkPolicyExternalAddressesResponse {
1861 pub fn new() -> Self {
1862 std::default::Default::default()
1863 }
1864
1865 /// Sets the value of [external_addresses][crate::model::FetchNetworkPolicyExternalAddressesResponse::external_addresses].
1866 ///
1867 /// # Example
1868 /// ```ignore,no_run
1869 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1870 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1871 /// let x = FetchNetworkPolicyExternalAddressesResponse::new()
1872 /// .set_external_addresses([
1873 /// ExternalAddress::default()/* use setters */,
1874 /// ExternalAddress::default()/* use (different) setters */,
1875 /// ]);
1876 /// ```
1877 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1878 where
1879 T: std::iter::IntoIterator<Item = V>,
1880 V: std::convert::Into<crate::model::ExternalAddress>,
1881 {
1882 use std::iter::Iterator;
1883 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1884 self
1885 }
1886
1887 /// Sets the value of [next_page_token][crate::model::FetchNetworkPolicyExternalAddressesResponse::next_page_token].
1888 ///
1889 /// # Example
1890 /// ```ignore,no_run
1891 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1892 /// let x = FetchNetworkPolicyExternalAddressesResponse::new().set_next_page_token("example");
1893 /// ```
1894 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1895 self.next_page_token = v.into();
1896 self
1897 }
1898}
1899
1900impl wkt::message::Message for FetchNetworkPolicyExternalAddressesResponse {
1901 fn typename() -> &'static str {
1902 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse"
1903 }
1904}
1905
1906#[doc(hidden)]
1907impl google_cloud_gax::paginator::internal::PageableResponse
1908 for FetchNetworkPolicyExternalAddressesResponse
1909{
1910 type PageItem = crate::model::ExternalAddress;
1911
1912 fn items(self) -> std::vec::Vec<Self::PageItem> {
1913 self.external_addresses
1914 }
1915
1916 fn next_page_token(&self) -> std::string::String {
1917 use std::clone::Clone;
1918 self.next_page_token.clone()
1919 }
1920}
1921
1922/// Request message for
1923/// [VmwareEngine.GetExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]
1924///
1925/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]: crate::client::VmwareEngine::get_external_address
1926#[derive(Clone, Default, PartialEq)]
1927#[non_exhaustive]
1928pub struct GetExternalAddressRequest {
1929 /// Required. The resource name of the external IP address to retrieve.
1930 /// Resource names are schemeless URIs that follow the conventions in
1931 /// <https://cloud.google.com/apis/design/resource_names>.
1932 /// For example:
1933 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
1934 pub name: std::string::String,
1935
1936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1937}
1938
1939impl GetExternalAddressRequest {
1940 pub fn new() -> Self {
1941 std::default::Default::default()
1942 }
1943
1944 /// Sets the value of [name][crate::model::GetExternalAddressRequest::name].
1945 ///
1946 /// # Example
1947 /// ```ignore,no_run
1948 /// # use google_cloud_vmwareengine_v1::model::GetExternalAddressRequest;
1949 /// let x = GetExternalAddressRequest::new().set_name("example");
1950 /// ```
1951 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.name = v.into();
1953 self
1954 }
1955}
1956
1957impl wkt::message::Message for GetExternalAddressRequest {
1958 fn typename() -> &'static str {
1959 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAddressRequest"
1960 }
1961}
1962
1963/// Request message for
1964/// [VmwareEngine.CreateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]
1965///
1966/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]: crate::client::VmwareEngine::create_external_address
1967#[derive(Clone, Default, PartialEq)]
1968#[non_exhaustive]
1969pub struct CreateExternalAddressRequest {
1970 /// Required. The resource name of the private cloud
1971 /// to create a new external IP address in.
1972 /// Resource names are schemeless URIs that follow the conventions in
1973 /// <https://cloud.google.com/apis/design/resource_names>.
1974 /// For example:
1975 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1976 pub parent: std::string::String,
1977
1978 /// Required. The initial description of a new external IP address.
1979 pub external_address: std::option::Option<crate::model::ExternalAddress>,
1980
1981 /// Required. The user-provided identifier of the `ExternalAddress` to be
1982 /// created. This identifier must be unique among `ExternalAddress` resources
1983 /// within the parent and becomes the final token in the name URI. The
1984 /// identifier must meet the following requirements:
1985 ///
1986 /// * Only contains 1-63 alphanumeric characters and hyphens
1987 /// * Begins with an alphabetical character
1988 /// * Ends with a non-hyphen character
1989 /// * Not formatted as a UUID
1990 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1991 /// (section 3.5)
1992 pub external_address_id: std::string::String,
1993
1994 /// Optional. A request ID to identify requests. Specify a unique request ID
1995 /// so that if you must retry your request, the server will know to ignore
1996 /// the request if it has already been completed. The server guarantees that a
1997 /// request doesn't result in creation of duplicate commitments for at least 60
1998 /// minutes.
1999 ///
2000 /// For example, consider a situation where you make an initial request and the
2001 /// request times out. If you make the request again with the same request ID,
2002 /// the server can check if the original operation with the same request ID was
2003 /// received, and if so, will ignore the second request. This prevents clients
2004 /// from accidentally creating duplicate commitments.
2005 ///
2006 /// The request ID must be a valid UUID with the exception that zero UUID is
2007 /// not supported (00000000-0000-0000-0000-000000000000).
2008 pub request_id: std::string::String,
2009
2010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2011}
2012
2013impl CreateExternalAddressRequest {
2014 pub fn new() -> Self {
2015 std::default::Default::default()
2016 }
2017
2018 /// Sets the value of [parent][crate::model::CreateExternalAddressRequest::parent].
2019 ///
2020 /// # Example
2021 /// ```ignore,no_run
2022 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2023 /// let x = CreateExternalAddressRequest::new().set_parent("example");
2024 /// ```
2025 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2026 self.parent = v.into();
2027 self
2028 }
2029
2030 /// Sets the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2031 ///
2032 /// # Example
2033 /// ```ignore,no_run
2034 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2035 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2036 /// let x = CreateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2037 /// ```
2038 pub fn set_external_address<T>(mut self, v: T) -> Self
2039 where
2040 T: std::convert::Into<crate::model::ExternalAddress>,
2041 {
2042 self.external_address = std::option::Option::Some(v.into());
2043 self
2044 }
2045
2046 /// Sets or clears the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2051 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2052 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2053 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2054 /// ```
2055 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2056 where
2057 T: std::convert::Into<crate::model::ExternalAddress>,
2058 {
2059 self.external_address = v.map(|x| x.into());
2060 self
2061 }
2062
2063 /// Sets the value of [external_address_id][crate::model::CreateExternalAddressRequest::external_address_id].
2064 ///
2065 /// # Example
2066 /// ```ignore,no_run
2067 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2068 /// let x = CreateExternalAddressRequest::new().set_external_address_id("example");
2069 /// ```
2070 pub fn set_external_address_id<T: std::convert::Into<std::string::String>>(
2071 mut self,
2072 v: T,
2073 ) -> Self {
2074 self.external_address_id = v.into();
2075 self
2076 }
2077
2078 /// Sets the value of [request_id][crate::model::CreateExternalAddressRequest::request_id].
2079 ///
2080 /// # Example
2081 /// ```ignore,no_run
2082 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2083 /// let x = CreateExternalAddressRequest::new().set_request_id("example");
2084 /// ```
2085 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.request_id = v.into();
2087 self
2088 }
2089}
2090
2091impl wkt::message::Message for CreateExternalAddressRequest {
2092 fn typename() -> &'static str {
2093 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAddressRequest"
2094 }
2095}
2096
2097/// Request message for
2098/// [VmwareEngine.UpdateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]
2099///
2100/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]: crate::client::VmwareEngine::update_external_address
2101#[derive(Clone, Default, PartialEq)]
2102#[non_exhaustive]
2103pub struct UpdateExternalAddressRequest {
2104 /// Required. Field mask is used to specify the fields to be overwritten in the
2105 /// `ExternalAddress` resource by the update.
2106 /// The fields specified in the `update_mask` are relative to the resource, not
2107 /// the full request. A field will be overwritten if it is in the mask. If the
2108 /// user does not provide a mask then all fields will be overwritten.
2109 pub update_mask: std::option::Option<wkt::FieldMask>,
2110
2111 /// Required. External IP address description.
2112 pub external_address: std::option::Option<crate::model::ExternalAddress>,
2113
2114 /// Optional. A request ID to identify requests. Specify a unique request ID
2115 /// so that if you must retry your request, the server will know to ignore
2116 /// the request if it has already been completed. The server guarantees that a
2117 /// request doesn't result in creation of duplicate commitments for at least 60
2118 /// minutes.
2119 ///
2120 /// For example, consider a situation where you make an initial request and the
2121 /// request times out. If you make the request again with the same request ID,
2122 /// the server can check if the original operation with the same request ID was
2123 /// received, and if so, will ignore the second request. This prevents clients
2124 /// from accidentally creating duplicate commitments.
2125 ///
2126 /// The request ID must be a valid UUID with the exception that zero UUID is
2127 /// not supported (00000000-0000-0000-0000-000000000000).
2128 pub request_id: std::string::String,
2129
2130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2131}
2132
2133impl UpdateExternalAddressRequest {
2134 pub fn new() -> Self {
2135 std::default::Default::default()
2136 }
2137
2138 /// Sets the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2143 /// use wkt::FieldMask;
2144 /// let x = UpdateExternalAddressRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2145 /// ```
2146 pub fn set_update_mask<T>(mut self, v: T) -> Self
2147 where
2148 T: std::convert::Into<wkt::FieldMask>,
2149 {
2150 self.update_mask = std::option::Option::Some(v.into());
2151 self
2152 }
2153
2154 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2155 ///
2156 /// # Example
2157 /// ```ignore,no_run
2158 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2159 /// use wkt::FieldMask;
2160 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2161 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2162 /// ```
2163 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2164 where
2165 T: std::convert::Into<wkt::FieldMask>,
2166 {
2167 self.update_mask = v.map(|x| x.into());
2168 self
2169 }
2170
2171 /// Sets the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2172 ///
2173 /// # Example
2174 /// ```ignore,no_run
2175 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2176 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2177 /// let x = UpdateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2178 /// ```
2179 pub fn set_external_address<T>(mut self, v: T) -> Self
2180 where
2181 T: std::convert::Into<crate::model::ExternalAddress>,
2182 {
2183 self.external_address = std::option::Option::Some(v.into());
2184 self
2185 }
2186
2187 /// Sets or clears the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2192 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2193 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2194 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2195 /// ```
2196 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2197 where
2198 T: std::convert::Into<crate::model::ExternalAddress>,
2199 {
2200 self.external_address = v.map(|x| x.into());
2201 self
2202 }
2203
2204 /// Sets the value of [request_id][crate::model::UpdateExternalAddressRequest::request_id].
2205 ///
2206 /// # Example
2207 /// ```ignore,no_run
2208 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2209 /// let x = UpdateExternalAddressRequest::new().set_request_id("example");
2210 /// ```
2211 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.request_id = v.into();
2213 self
2214 }
2215}
2216
2217impl wkt::message::Message for UpdateExternalAddressRequest {
2218 fn typename() -> &'static str {
2219 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAddressRequest"
2220 }
2221}
2222
2223/// Request message for
2224/// [VmwareEngine.DeleteExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]
2225///
2226/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]: crate::client::VmwareEngine::delete_external_address
2227#[derive(Clone, Default, PartialEq)]
2228#[non_exhaustive]
2229pub struct DeleteExternalAddressRequest {
2230 /// Required. The resource name of the external IP address to delete.
2231 /// Resource names are schemeless URIs that follow the conventions in
2232 /// <https://cloud.google.com/apis/design/resource_names>.
2233 /// For example:
2234 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
2235 pub name: std::string::String,
2236
2237 /// Optional. A request ID to identify requests. Specify a unique request ID
2238 /// so that if you must retry your request, the server will know to ignore
2239 /// the request if it has already been completed. The server guarantees that a
2240 /// request doesn't result in creation of duplicate commitments for at least 60
2241 /// minutes.
2242 ///
2243 /// For example, consider a situation where you make an initial request and the
2244 /// request times out. If you make the request again with the same request
2245 /// ID, the server can check if the original operation with the same request ID
2246 /// was received, and if so, will ignore the second request. This prevents
2247 /// clients from accidentally creating duplicate commitments.
2248 ///
2249 /// The request ID must be a valid UUID with the exception that zero UUID is
2250 /// not supported (00000000-0000-0000-0000-000000000000).
2251 pub request_id: std::string::String,
2252
2253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2254}
2255
2256impl DeleteExternalAddressRequest {
2257 pub fn new() -> Self {
2258 std::default::Default::default()
2259 }
2260
2261 /// Sets the value of [name][crate::model::DeleteExternalAddressRequest::name].
2262 ///
2263 /// # Example
2264 /// ```ignore,no_run
2265 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2266 /// let x = DeleteExternalAddressRequest::new().set_name("example");
2267 /// ```
2268 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2269 self.name = v.into();
2270 self
2271 }
2272
2273 /// Sets the value of [request_id][crate::model::DeleteExternalAddressRequest::request_id].
2274 ///
2275 /// # Example
2276 /// ```ignore,no_run
2277 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2278 /// let x = DeleteExternalAddressRequest::new().set_request_id("example");
2279 /// ```
2280 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.request_id = v.into();
2282 self
2283 }
2284}
2285
2286impl wkt::message::Message for DeleteExternalAddressRequest {
2287 fn typename() -> &'static str {
2288 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAddressRequest"
2289 }
2290}
2291
2292/// Request message for
2293/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2294///
2295/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2296#[derive(Clone, Default, PartialEq)]
2297#[non_exhaustive]
2298pub struct ListSubnetsRequest {
2299 /// Required. The resource name of the private cloud to be queried for
2300 /// subnets.
2301 /// Resource names are schemeless URIs that follow the conventions in
2302 /// <https://cloud.google.com/apis/design/resource_names>.
2303 /// For example:
2304 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2305 pub parent: std::string::String,
2306
2307 /// The maximum number of subnets to return in one page.
2308 /// The service may return fewer than this value.
2309 /// The maximum value is coerced to 1000.
2310 /// The default value of this field is 500.
2311 pub page_size: i32,
2312
2313 /// A page token, received from a previous `ListSubnetsRequest` call.
2314 /// Provide this to retrieve the subsequent page.
2315 ///
2316 /// When paginating, all other parameters provided to
2317 /// `ListSubnetsRequest` must match the call that provided the page token.
2318 pub page_token: std::string::String,
2319
2320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2321}
2322
2323impl ListSubnetsRequest {
2324 pub fn new() -> Self {
2325 std::default::Default::default()
2326 }
2327
2328 /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
2329 ///
2330 /// # Example
2331 /// ```ignore,no_run
2332 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2333 /// let x = ListSubnetsRequest::new().set_parent("example");
2334 /// ```
2335 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2336 self.parent = v.into();
2337 self
2338 }
2339
2340 /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2345 /// let x = ListSubnetsRequest::new().set_page_size(42);
2346 /// ```
2347 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2348 self.page_size = v.into();
2349 self
2350 }
2351
2352 /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2357 /// let x = ListSubnetsRequest::new().set_page_token("example");
2358 /// ```
2359 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.page_token = v.into();
2361 self
2362 }
2363}
2364
2365impl wkt::message::Message for ListSubnetsRequest {
2366 fn typename() -> &'static str {
2367 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsRequest"
2368 }
2369}
2370
2371/// Response message for
2372/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2373///
2374/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2375#[derive(Clone, Default, PartialEq)]
2376#[non_exhaustive]
2377pub struct ListSubnetsResponse {
2378 /// A list of subnets.
2379 pub subnets: std::vec::Vec<crate::model::Subnet>,
2380
2381 /// A token, which can be sent as `page_token` to retrieve the next page.
2382 /// If this field is omitted, there are no subsequent pages.
2383 pub next_page_token: std::string::String,
2384
2385 /// Locations that could not be reached when making an aggregated query using
2386 /// wildcards.
2387 pub unreachable: std::vec::Vec<std::string::String>,
2388
2389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2390}
2391
2392impl ListSubnetsResponse {
2393 pub fn new() -> Self {
2394 std::default::Default::default()
2395 }
2396
2397 /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
2398 ///
2399 /// # Example
2400 /// ```ignore,no_run
2401 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2402 /// use google_cloud_vmwareengine_v1::model::Subnet;
2403 /// let x = ListSubnetsResponse::new()
2404 /// .set_subnets([
2405 /// Subnet::default()/* use setters */,
2406 /// Subnet::default()/* use (different) setters */,
2407 /// ]);
2408 /// ```
2409 pub fn set_subnets<T, V>(mut self, v: T) -> Self
2410 where
2411 T: std::iter::IntoIterator<Item = V>,
2412 V: std::convert::Into<crate::model::Subnet>,
2413 {
2414 use std::iter::Iterator;
2415 self.subnets = v.into_iter().map(|i| i.into()).collect();
2416 self
2417 }
2418
2419 /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2424 /// let x = ListSubnetsResponse::new().set_next_page_token("example");
2425 /// ```
2426 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.next_page_token = v.into();
2428 self
2429 }
2430
2431 /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
2432 ///
2433 /// # Example
2434 /// ```ignore,no_run
2435 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2436 /// let x = ListSubnetsResponse::new().set_unreachable(["a", "b", "c"]);
2437 /// ```
2438 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2439 where
2440 T: std::iter::IntoIterator<Item = V>,
2441 V: std::convert::Into<std::string::String>,
2442 {
2443 use std::iter::Iterator;
2444 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2445 self
2446 }
2447}
2448
2449impl wkt::message::Message for ListSubnetsResponse {
2450 fn typename() -> &'static str {
2451 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsResponse"
2452 }
2453}
2454
2455#[doc(hidden)]
2456impl google_cloud_gax::paginator::internal::PageableResponse for ListSubnetsResponse {
2457 type PageItem = crate::model::Subnet;
2458
2459 fn items(self) -> std::vec::Vec<Self::PageItem> {
2460 self.subnets
2461 }
2462
2463 fn next_page_token(&self) -> std::string::String {
2464 use std::clone::Clone;
2465 self.next_page_token.clone()
2466 }
2467}
2468
2469/// Request message for
2470/// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]
2471///
2472/// [google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]: crate::client::VmwareEngine::get_subnet
2473#[derive(Clone, Default, PartialEq)]
2474#[non_exhaustive]
2475pub struct GetSubnetRequest {
2476 /// Required. The resource name of the subnet to retrieve.
2477 /// Resource names are schemeless URIs that follow the conventions in
2478 /// <https://cloud.google.com/apis/design/resource_names>.
2479 /// For example:
2480 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
2481 pub name: std::string::String,
2482
2483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2484}
2485
2486impl GetSubnetRequest {
2487 pub fn new() -> Self {
2488 std::default::Default::default()
2489 }
2490
2491 /// Sets the value of [name][crate::model::GetSubnetRequest::name].
2492 ///
2493 /// # Example
2494 /// ```ignore,no_run
2495 /// # use google_cloud_vmwareengine_v1::model::GetSubnetRequest;
2496 /// let x = GetSubnetRequest::new().set_name("example");
2497 /// ```
2498 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2499 self.name = v.into();
2500 self
2501 }
2502}
2503
2504impl wkt::message::Message for GetSubnetRequest {
2505 fn typename() -> &'static str {
2506 "type.googleapis.com/google.cloud.vmwareengine.v1.GetSubnetRequest"
2507 }
2508}
2509
2510/// Request message for
2511/// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]
2512///
2513/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]: crate::client::VmwareEngine::update_subnet
2514#[derive(Clone, Default, PartialEq)]
2515#[non_exhaustive]
2516pub struct UpdateSubnetRequest {
2517 /// Required. Field mask is used to specify the fields to be overwritten in the
2518 /// `Subnet` resource by the update.
2519 /// The fields specified in the `update_mask` are relative to the resource, not
2520 /// the full request. A field will be overwritten if it is in the mask. If the
2521 /// user does not provide a mask then all fields will be overwritten.
2522 pub update_mask: std::option::Option<wkt::FieldMask>,
2523
2524 /// Required. Subnet description.
2525 pub subnet: std::option::Option<crate::model::Subnet>,
2526
2527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2528}
2529
2530impl UpdateSubnetRequest {
2531 pub fn new() -> Self {
2532 std::default::Default::default()
2533 }
2534
2535 /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2536 ///
2537 /// # Example
2538 /// ```ignore,no_run
2539 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2540 /// use wkt::FieldMask;
2541 /// let x = UpdateSubnetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2542 /// ```
2543 pub fn set_update_mask<T>(mut self, v: T) -> Self
2544 where
2545 T: std::convert::Into<wkt::FieldMask>,
2546 {
2547 self.update_mask = std::option::Option::Some(v.into());
2548 self
2549 }
2550
2551 /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2552 ///
2553 /// # Example
2554 /// ```ignore,no_run
2555 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2556 /// use wkt::FieldMask;
2557 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2558 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2559 /// ```
2560 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561 where
2562 T: std::convert::Into<wkt::FieldMask>,
2563 {
2564 self.update_mask = v.map(|x| x.into());
2565 self
2566 }
2567
2568 /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2569 ///
2570 /// # Example
2571 /// ```ignore,no_run
2572 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2573 /// use google_cloud_vmwareengine_v1::model::Subnet;
2574 /// let x = UpdateSubnetRequest::new().set_subnet(Subnet::default()/* use setters */);
2575 /// ```
2576 pub fn set_subnet<T>(mut self, v: T) -> Self
2577 where
2578 T: std::convert::Into<crate::model::Subnet>,
2579 {
2580 self.subnet = std::option::Option::Some(v.into());
2581 self
2582 }
2583
2584 /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2585 ///
2586 /// # Example
2587 /// ```ignore,no_run
2588 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2589 /// use google_cloud_vmwareengine_v1::model::Subnet;
2590 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(Some(Subnet::default()/* use setters */));
2591 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(None::<Subnet>);
2592 /// ```
2593 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
2594 where
2595 T: std::convert::Into<crate::model::Subnet>,
2596 {
2597 self.subnet = v.map(|x| x.into());
2598 self
2599 }
2600}
2601
2602impl wkt::message::Message for UpdateSubnetRequest {
2603 fn typename() -> &'static str {
2604 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateSubnetRequest"
2605 }
2606}
2607
2608/// Request message for
2609/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2610///
2611/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2612#[derive(Clone, Default, PartialEq)]
2613#[non_exhaustive]
2614pub struct ListExternalAccessRulesRequest {
2615 /// Required. The resource name of the network policy to query for external
2616 /// access firewall rules. Resource names are schemeless URIs that follow the
2617 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
2618 /// example:
2619 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2620 pub parent: std::string::String,
2621
2622 /// The maximum number of external access rules to return in one page.
2623 /// The service may return fewer than this value.
2624 /// The maximum value is coerced to 1000.
2625 /// The default value of this field is 500.
2626 pub page_size: i32,
2627
2628 /// A page token, received from a previous `ListExternalAccessRulesRequest`
2629 /// call. Provide this to retrieve the subsequent page.
2630 ///
2631 /// When paginating, all other parameters provided to
2632 /// `ListExternalAccessRulesRequest` must match the call that provided the page
2633 /// token.
2634 pub page_token: std::string::String,
2635
2636 /// A filter expression that matches resources returned in the response.
2637 /// The expression must specify the field name, a comparison
2638 /// operator, and the value that you want to use for filtering. The value
2639 /// must be a string, a number, or a boolean. The comparison operator
2640 /// must be `=`, `!=`, `>`, or `<`.
2641 ///
2642 /// For example, if you are filtering a list of external access rules, you can
2643 /// exclude the ones named `example-rule` by specifying
2644 /// `name != "example-rule"`.
2645 ///
2646 /// To filter on multiple expressions, provide each separate expression within
2647 /// parentheses. For example:
2648 ///
2649 /// ```norust
2650 /// (name = "example-rule")
2651 /// (createTime > "2021-04-12T08:15:10.40Z")
2652 /// ```
2653 ///
2654 /// By default, each expression is an `AND` expression. However, you
2655 /// can include `AND` and `OR` expressions explicitly.
2656 /// For example:
2657 ///
2658 /// ```norust
2659 /// (name = "example-rule-1") AND
2660 /// (createTime > "2021-04-12T08:15:10.40Z") OR
2661 /// (name = "example-rule-2")
2662 /// ```
2663 pub filter: std::string::String,
2664
2665 /// Sorts list results by a certain order. By default, returned results
2666 /// are ordered by `name` in ascending order.
2667 /// You can also sort results in descending order based on the `name` value
2668 /// using `orderBy="name desc"`.
2669 /// Currently, only ordering by `name` is supported.
2670 pub order_by: std::string::String,
2671
2672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2673}
2674
2675impl ListExternalAccessRulesRequest {
2676 pub fn new() -> Self {
2677 std::default::Default::default()
2678 }
2679
2680 /// Sets the value of [parent][crate::model::ListExternalAccessRulesRequest::parent].
2681 ///
2682 /// # Example
2683 /// ```ignore,no_run
2684 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2685 /// let x = ListExternalAccessRulesRequest::new().set_parent("example");
2686 /// ```
2687 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.parent = v.into();
2689 self
2690 }
2691
2692 /// Sets the value of [page_size][crate::model::ListExternalAccessRulesRequest::page_size].
2693 ///
2694 /// # Example
2695 /// ```ignore,no_run
2696 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2697 /// let x = ListExternalAccessRulesRequest::new().set_page_size(42);
2698 /// ```
2699 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2700 self.page_size = v.into();
2701 self
2702 }
2703
2704 /// Sets the value of [page_token][crate::model::ListExternalAccessRulesRequest::page_token].
2705 ///
2706 /// # Example
2707 /// ```ignore,no_run
2708 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2709 /// let x = ListExternalAccessRulesRequest::new().set_page_token("example");
2710 /// ```
2711 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2712 self.page_token = v.into();
2713 self
2714 }
2715
2716 /// Sets the value of [filter][crate::model::ListExternalAccessRulesRequest::filter].
2717 ///
2718 /// # Example
2719 /// ```ignore,no_run
2720 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2721 /// let x = ListExternalAccessRulesRequest::new().set_filter("example");
2722 /// ```
2723 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2724 self.filter = v.into();
2725 self
2726 }
2727
2728 /// Sets the value of [order_by][crate::model::ListExternalAccessRulesRequest::order_by].
2729 ///
2730 /// # Example
2731 /// ```ignore,no_run
2732 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2733 /// let x = ListExternalAccessRulesRequest::new().set_order_by("example");
2734 /// ```
2735 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2736 self.order_by = v.into();
2737 self
2738 }
2739}
2740
2741impl wkt::message::Message for ListExternalAccessRulesRequest {
2742 fn typename() -> &'static str {
2743 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest"
2744 }
2745}
2746
2747/// Response message for
2748/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2749///
2750/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2751#[derive(Clone, Default, PartialEq)]
2752#[non_exhaustive]
2753pub struct ListExternalAccessRulesResponse {
2754 /// A list of external access firewall rules.
2755 pub external_access_rules: std::vec::Vec<crate::model::ExternalAccessRule>,
2756
2757 /// A token, which can be sent as `page_token` to retrieve the next page.
2758 /// If this field is omitted, there are no subsequent pages.
2759 pub next_page_token: std::string::String,
2760
2761 /// Locations that could not be reached when making an aggregated query using
2762 /// wildcards.
2763 pub unreachable: std::vec::Vec<std::string::String>,
2764
2765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2766}
2767
2768impl ListExternalAccessRulesResponse {
2769 pub fn new() -> Self {
2770 std::default::Default::default()
2771 }
2772
2773 /// Sets the value of [external_access_rules][crate::model::ListExternalAccessRulesResponse::external_access_rules].
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2778 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2779 /// let x = ListExternalAccessRulesResponse::new()
2780 /// .set_external_access_rules([
2781 /// ExternalAccessRule::default()/* use setters */,
2782 /// ExternalAccessRule::default()/* use (different) setters */,
2783 /// ]);
2784 /// ```
2785 pub fn set_external_access_rules<T, V>(mut self, v: T) -> Self
2786 where
2787 T: std::iter::IntoIterator<Item = V>,
2788 V: std::convert::Into<crate::model::ExternalAccessRule>,
2789 {
2790 use std::iter::Iterator;
2791 self.external_access_rules = v.into_iter().map(|i| i.into()).collect();
2792 self
2793 }
2794
2795 /// Sets the value of [next_page_token][crate::model::ListExternalAccessRulesResponse::next_page_token].
2796 ///
2797 /// # Example
2798 /// ```ignore,no_run
2799 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2800 /// let x = ListExternalAccessRulesResponse::new().set_next_page_token("example");
2801 /// ```
2802 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2803 self.next_page_token = v.into();
2804 self
2805 }
2806
2807 /// Sets the value of [unreachable][crate::model::ListExternalAccessRulesResponse::unreachable].
2808 ///
2809 /// # Example
2810 /// ```ignore,no_run
2811 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2812 /// let x = ListExternalAccessRulesResponse::new().set_unreachable(["a", "b", "c"]);
2813 /// ```
2814 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2815 where
2816 T: std::iter::IntoIterator<Item = V>,
2817 V: std::convert::Into<std::string::String>,
2818 {
2819 use std::iter::Iterator;
2820 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2821 self
2822 }
2823}
2824
2825impl wkt::message::Message for ListExternalAccessRulesResponse {
2826 fn typename() -> &'static str {
2827 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse"
2828 }
2829}
2830
2831#[doc(hidden)]
2832impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAccessRulesResponse {
2833 type PageItem = crate::model::ExternalAccessRule;
2834
2835 fn items(self) -> std::vec::Vec<Self::PageItem> {
2836 self.external_access_rules
2837 }
2838
2839 fn next_page_token(&self) -> std::string::String {
2840 use std::clone::Clone;
2841 self.next_page_token.clone()
2842 }
2843}
2844
2845/// Request message for
2846/// [VmwareEngine.GetExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]
2847///
2848/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]: crate::client::VmwareEngine::get_external_access_rule
2849#[derive(Clone, Default, PartialEq)]
2850#[non_exhaustive]
2851pub struct GetExternalAccessRuleRequest {
2852 /// Required. The resource name of the external access firewall rule to
2853 /// retrieve. Resource names are schemeless URIs that follow the conventions in
2854 /// <https://cloud.google.com/apis/design/resource_names>.
2855 /// For example:
2856 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
2857 pub name: std::string::String,
2858
2859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2860}
2861
2862impl GetExternalAccessRuleRequest {
2863 pub fn new() -> Self {
2864 std::default::Default::default()
2865 }
2866
2867 /// Sets the value of [name][crate::model::GetExternalAccessRuleRequest::name].
2868 ///
2869 /// # Example
2870 /// ```ignore,no_run
2871 /// # use google_cloud_vmwareengine_v1::model::GetExternalAccessRuleRequest;
2872 /// let x = GetExternalAccessRuleRequest::new().set_name("example");
2873 /// ```
2874 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2875 self.name = v.into();
2876 self
2877 }
2878}
2879
2880impl wkt::message::Message for GetExternalAccessRuleRequest {
2881 fn typename() -> &'static str {
2882 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest"
2883 }
2884}
2885
2886/// Request message for
2887/// [VmwareEngine.CreateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]
2888///
2889/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]: crate::client::VmwareEngine::create_external_access_rule
2890#[derive(Clone, Default, PartialEq)]
2891#[non_exhaustive]
2892pub struct CreateExternalAccessRuleRequest {
2893 /// Required. The resource name of the network policy
2894 /// to create a new external access firewall rule in.
2895 /// Resource names are schemeless URIs that follow the conventions in
2896 /// <https://cloud.google.com/apis/design/resource_names>.
2897 /// For example:
2898 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2899 pub parent: std::string::String,
2900
2901 /// Required. The initial description of a new external access rule.
2902 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
2903
2904 /// Required. The user-provided identifier of the `ExternalAccessRule` to be
2905 /// created. This identifier must be unique among `ExternalAccessRule`
2906 /// resources within the parent and becomes the final token in the name URI.
2907 /// The identifier must meet the following requirements:
2908 ///
2909 /// * Only contains 1-63 alphanumeric characters and hyphens
2910 /// * Begins with an alphabetical character
2911 /// * Ends with a non-hyphen character
2912 /// * Not formatted as a UUID
2913 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2914 /// (section 3.5)
2915 pub external_access_rule_id: std::string::String,
2916
2917 /// A request ID to identify requests. Specify a unique request ID
2918 /// so that if you must retry your request, the server will know to ignore
2919 /// the request if it has already been completed. The server guarantees that a
2920 /// request doesn't result in creation of duplicate commitments for at least 60
2921 /// minutes.
2922 ///
2923 /// For example, consider a situation where you make an initial request and the
2924 /// request times out. If you make the request again with the same request ID,
2925 /// the server can check if the original operation with the same request ID was
2926 /// received, and if so, will ignore the second request. This prevents clients
2927 /// from accidentally creating duplicate commitments.
2928 ///
2929 /// The request ID must be a valid UUID with the exception that zero UUID is
2930 /// not supported (00000000-0000-0000-0000-000000000000).
2931 pub request_id: std::string::String,
2932
2933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2934}
2935
2936impl CreateExternalAccessRuleRequest {
2937 pub fn new() -> Self {
2938 std::default::Default::default()
2939 }
2940
2941 /// Sets the value of [parent][crate::model::CreateExternalAccessRuleRequest::parent].
2942 ///
2943 /// # Example
2944 /// ```ignore,no_run
2945 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2946 /// let x = CreateExternalAccessRuleRequest::new().set_parent("example");
2947 /// ```
2948 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2949 self.parent = v.into();
2950 self
2951 }
2952
2953 /// Sets the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2954 ///
2955 /// # Example
2956 /// ```ignore,no_run
2957 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2958 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2959 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
2960 /// ```
2961 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
2962 where
2963 T: std::convert::Into<crate::model::ExternalAccessRule>,
2964 {
2965 self.external_access_rule = std::option::Option::Some(v.into());
2966 self
2967 }
2968
2969 /// Sets or clears the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
2970 ///
2971 /// # Example
2972 /// ```ignore,no_run
2973 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2974 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2975 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
2976 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
2977 /// ```
2978 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
2979 where
2980 T: std::convert::Into<crate::model::ExternalAccessRule>,
2981 {
2982 self.external_access_rule = v.map(|x| x.into());
2983 self
2984 }
2985
2986 /// Sets the value of [external_access_rule_id][crate::model::CreateExternalAccessRuleRequest::external_access_rule_id].
2987 ///
2988 /// # Example
2989 /// ```ignore,no_run
2990 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
2991 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule_id("example");
2992 /// ```
2993 pub fn set_external_access_rule_id<T: std::convert::Into<std::string::String>>(
2994 mut self,
2995 v: T,
2996 ) -> Self {
2997 self.external_access_rule_id = v.into();
2998 self
2999 }
3000
3001 /// Sets the value of [request_id][crate::model::CreateExternalAccessRuleRequest::request_id].
3002 ///
3003 /// # Example
3004 /// ```ignore,no_run
3005 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3006 /// let x = CreateExternalAccessRuleRequest::new().set_request_id("example");
3007 /// ```
3008 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.request_id = v.into();
3010 self
3011 }
3012}
3013
3014impl wkt::message::Message for CreateExternalAccessRuleRequest {
3015 fn typename() -> &'static str {
3016 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest"
3017 }
3018}
3019
3020/// Request message for
3021/// [VmwareEngine.UpdateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]
3022///
3023/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]: crate::client::VmwareEngine::update_external_access_rule
3024#[derive(Clone, Default, PartialEq)]
3025#[non_exhaustive]
3026pub struct UpdateExternalAccessRuleRequest {
3027 /// Required. Field mask is used to specify the fields to be overwritten in the
3028 /// `ExternalAccessRule` resource by the update.
3029 /// The fields specified in the `update_mask` are relative to the resource, not
3030 /// the full request. A field will be overwritten if it is in the mask. If the
3031 /// user does not provide a mask then all fields will be overwritten.
3032 pub update_mask: std::option::Option<wkt::FieldMask>,
3033
3034 /// Required. Description of the external access rule.
3035 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
3036
3037 /// Optional. A request ID to identify requests. Specify a unique request ID
3038 /// so that if you must retry your request, the server will know to ignore
3039 /// the request if it has already been completed. The server guarantees that a
3040 /// request doesn't result in creation of duplicate commitments for at least 60
3041 /// minutes.
3042 ///
3043 /// For example, consider a situation where you make an initial request and the
3044 /// request times out. If you make the request again with the same request ID,
3045 /// the server can check if the original operation with the same request ID was
3046 /// received, and if so, will ignore the second request. This prevents clients
3047 /// from accidentally creating duplicate commitments.
3048 ///
3049 /// The request ID must be a valid UUID with the exception that zero UUID is
3050 /// not supported (00000000-0000-0000-0000-000000000000).
3051 pub request_id: std::string::String,
3052
3053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3054}
3055
3056impl UpdateExternalAccessRuleRequest {
3057 pub fn new() -> Self {
3058 std::default::Default::default()
3059 }
3060
3061 /// Sets the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3062 ///
3063 /// # Example
3064 /// ```ignore,no_run
3065 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3066 /// use wkt::FieldMask;
3067 /// let x = UpdateExternalAccessRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3068 /// ```
3069 pub fn set_update_mask<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<wkt::FieldMask>,
3072 {
3073 self.update_mask = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3078 ///
3079 /// # Example
3080 /// ```ignore,no_run
3081 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3082 /// use wkt::FieldMask;
3083 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3084 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3085 /// ```
3086 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3087 where
3088 T: std::convert::Into<wkt::FieldMask>,
3089 {
3090 self.update_mask = v.map(|x| x.into());
3091 self
3092 }
3093
3094 /// Sets the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3099 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3100 /// let x = UpdateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
3101 /// ```
3102 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
3103 where
3104 T: std::convert::Into<crate::model::ExternalAccessRule>,
3105 {
3106 self.external_access_rule = std::option::Option::Some(v.into());
3107 self
3108 }
3109
3110 /// Sets or clears the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3111 ///
3112 /// # Example
3113 /// ```ignore,no_run
3114 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3115 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3116 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
3117 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
3118 /// ```
3119 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
3120 where
3121 T: std::convert::Into<crate::model::ExternalAccessRule>,
3122 {
3123 self.external_access_rule = v.map(|x| x.into());
3124 self
3125 }
3126
3127 /// Sets the value of [request_id][crate::model::UpdateExternalAccessRuleRequest::request_id].
3128 ///
3129 /// # Example
3130 /// ```ignore,no_run
3131 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3132 /// let x = UpdateExternalAccessRuleRequest::new().set_request_id("example");
3133 /// ```
3134 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3135 self.request_id = v.into();
3136 self
3137 }
3138}
3139
3140impl wkt::message::Message for UpdateExternalAccessRuleRequest {
3141 fn typename() -> &'static str {
3142 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest"
3143 }
3144}
3145
3146/// Request message for
3147/// [VmwareEngine.DeleteExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]
3148///
3149/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]: crate::client::VmwareEngine::delete_external_access_rule
3150#[derive(Clone, Default, PartialEq)]
3151#[non_exhaustive]
3152pub struct DeleteExternalAccessRuleRequest {
3153 /// Required. The resource name of the external access firewall rule to delete.
3154 /// Resource names are schemeless URIs that follow the conventions in
3155 /// <https://cloud.google.com/apis/design/resource_names>.
3156 /// For example:
3157 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
3158 pub name: std::string::String,
3159
3160 /// Optional. A request ID to identify requests. Specify a unique request ID
3161 /// so that if you must retry your request, the server will know to ignore
3162 /// the request if it has already been completed. The server guarantees that a
3163 /// request doesn't result in creation of duplicate commitments for at least 60
3164 /// minutes.
3165 ///
3166 /// For example, consider a situation where you make an initial request and the
3167 /// request times out. If you make the request again with the same request
3168 /// ID, the server can check if the original operation with the same request ID
3169 /// was received, and if so, will ignore the second request. This prevents
3170 /// clients from accidentally creating duplicate commitments.
3171 ///
3172 /// The request ID must be a valid UUID with the exception that zero UUID is
3173 /// not supported (00000000-0000-0000-0000-000000000000).
3174 pub request_id: std::string::String,
3175
3176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3177}
3178
3179impl DeleteExternalAccessRuleRequest {
3180 pub fn new() -> Self {
3181 std::default::Default::default()
3182 }
3183
3184 /// Sets the value of [name][crate::model::DeleteExternalAccessRuleRequest::name].
3185 ///
3186 /// # Example
3187 /// ```ignore,no_run
3188 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3189 /// let x = DeleteExternalAccessRuleRequest::new().set_name("example");
3190 /// ```
3191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.name = v.into();
3193 self
3194 }
3195
3196 /// Sets the value of [request_id][crate::model::DeleteExternalAccessRuleRequest::request_id].
3197 ///
3198 /// # Example
3199 /// ```ignore,no_run
3200 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3201 /// let x = DeleteExternalAccessRuleRequest::new().set_request_id("example");
3202 /// ```
3203 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.request_id = v.into();
3205 self
3206 }
3207}
3208
3209impl wkt::message::Message for DeleteExternalAccessRuleRequest {
3210 fn typename() -> &'static str {
3211 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest"
3212 }
3213}
3214
3215/// Request message for
3216/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3217///
3218/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3219#[derive(Clone, Default, PartialEq)]
3220#[non_exhaustive]
3221pub struct ListLoggingServersRequest {
3222 /// Required. The resource name of the private cloud to be queried for
3223 /// logging servers.
3224 /// Resource names are schemeless URIs that follow the conventions in
3225 /// <https://cloud.google.com/apis/design/resource_names>.
3226 /// For example:
3227 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3228 pub parent: std::string::String,
3229
3230 /// The maximum number of logging servers to return in one page.
3231 /// The service may return fewer than this value.
3232 /// The maximum value is coerced to 1000.
3233 /// The default value of this field is 500.
3234 pub page_size: i32,
3235
3236 /// A page token, received from a previous `ListLoggingServersRequest` call.
3237 /// Provide this to retrieve the subsequent page.
3238 ///
3239 /// When paginating, all other parameters provided to
3240 /// `ListLoggingServersRequest` must match the call that provided the page
3241 /// token.
3242 pub page_token: std::string::String,
3243
3244 /// A filter expression that matches resources returned in the response.
3245 /// The expression must specify the field name, a comparison
3246 /// operator, and the value that you want to use for filtering. The value
3247 /// must be a string, a number, or a boolean. The comparison operator
3248 /// must be `=`, `!=`, `>`, or `<`.
3249 ///
3250 /// For example, if you are filtering a list of logging servers, you can
3251 /// exclude the ones named `example-server` by specifying
3252 /// `name != "example-server"`.
3253 ///
3254 /// To filter on multiple expressions, provide each separate expression within
3255 /// parentheses. For example:
3256 ///
3257 /// ```norust
3258 /// (name = "example-server")
3259 /// (createTime > "2021-04-12T08:15:10.40Z")
3260 /// ```
3261 ///
3262 /// By default, each expression is an `AND` expression. However, you
3263 /// can include `AND` and `OR` expressions explicitly.
3264 /// For example:
3265 ///
3266 /// ```norust
3267 /// (name = "example-server-1") AND
3268 /// (createTime > "2021-04-12T08:15:10.40Z") OR
3269 /// (name = "example-server-2")
3270 /// ```
3271 pub filter: std::string::String,
3272
3273 /// Sorts list results by a certain order. By default, returned results
3274 /// are ordered by `name` in ascending order.
3275 /// You can also sort results in descending order based on the `name` value
3276 /// using `orderBy="name desc"`.
3277 /// Currently, only ordering by `name` is supported.
3278 pub order_by: std::string::String,
3279
3280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3281}
3282
3283impl ListLoggingServersRequest {
3284 pub fn new() -> Self {
3285 std::default::Default::default()
3286 }
3287
3288 /// Sets the value of [parent][crate::model::ListLoggingServersRequest::parent].
3289 ///
3290 /// # Example
3291 /// ```ignore,no_run
3292 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3293 /// let x = ListLoggingServersRequest::new().set_parent("example");
3294 /// ```
3295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.parent = v.into();
3297 self
3298 }
3299
3300 /// Sets the value of [page_size][crate::model::ListLoggingServersRequest::page_size].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3305 /// let x = ListLoggingServersRequest::new().set_page_size(42);
3306 /// ```
3307 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3308 self.page_size = v.into();
3309 self
3310 }
3311
3312 /// Sets the value of [page_token][crate::model::ListLoggingServersRequest::page_token].
3313 ///
3314 /// # Example
3315 /// ```ignore,no_run
3316 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3317 /// let x = ListLoggingServersRequest::new().set_page_token("example");
3318 /// ```
3319 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3320 self.page_token = v.into();
3321 self
3322 }
3323
3324 /// Sets the value of [filter][crate::model::ListLoggingServersRequest::filter].
3325 ///
3326 /// # Example
3327 /// ```ignore,no_run
3328 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3329 /// let x = ListLoggingServersRequest::new().set_filter("example");
3330 /// ```
3331 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3332 self.filter = v.into();
3333 self
3334 }
3335
3336 /// Sets the value of [order_by][crate::model::ListLoggingServersRequest::order_by].
3337 ///
3338 /// # Example
3339 /// ```ignore,no_run
3340 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3341 /// let x = ListLoggingServersRequest::new().set_order_by("example");
3342 /// ```
3343 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3344 self.order_by = v.into();
3345 self
3346 }
3347}
3348
3349impl wkt::message::Message for ListLoggingServersRequest {
3350 fn typename() -> &'static str {
3351 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersRequest"
3352 }
3353}
3354
3355/// Response message for
3356/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3357///
3358/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3359#[derive(Clone, Default, PartialEq)]
3360#[non_exhaustive]
3361pub struct ListLoggingServersResponse {
3362 /// A list of Logging Servers.
3363 pub logging_servers: std::vec::Vec<crate::model::LoggingServer>,
3364
3365 /// A token, which can be send as `page_token` to retrieve the next page.
3366 /// If this field is omitted, there are no subsequent pages.
3367 pub next_page_token: std::string::String,
3368
3369 /// Locations that could not be reached when making an aggregated query using
3370 /// wildcards.
3371 pub unreachable: std::vec::Vec<std::string::String>,
3372
3373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3374}
3375
3376impl ListLoggingServersResponse {
3377 pub fn new() -> Self {
3378 std::default::Default::default()
3379 }
3380
3381 /// Sets the value of [logging_servers][crate::model::ListLoggingServersResponse::logging_servers].
3382 ///
3383 /// # Example
3384 /// ```ignore,no_run
3385 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3386 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3387 /// let x = ListLoggingServersResponse::new()
3388 /// .set_logging_servers([
3389 /// LoggingServer::default()/* use setters */,
3390 /// LoggingServer::default()/* use (different) setters */,
3391 /// ]);
3392 /// ```
3393 pub fn set_logging_servers<T, V>(mut self, v: T) -> Self
3394 where
3395 T: std::iter::IntoIterator<Item = V>,
3396 V: std::convert::Into<crate::model::LoggingServer>,
3397 {
3398 use std::iter::Iterator;
3399 self.logging_servers = v.into_iter().map(|i| i.into()).collect();
3400 self
3401 }
3402
3403 /// Sets the value of [next_page_token][crate::model::ListLoggingServersResponse::next_page_token].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3408 /// let x = ListLoggingServersResponse::new().set_next_page_token("example");
3409 /// ```
3410 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.next_page_token = v.into();
3412 self
3413 }
3414
3415 /// Sets the value of [unreachable][crate::model::ListLoggingServersResponse::unreachable].
3416 ///
3417 /// # Example
3418 /// ```ignore,no_run
3419 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3420 /// let x = ListLoggingServersResponse::new().set_unreachable(["a", "b", "c"]);
3421 /// ```
3422 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3423 where
3424 T: std::iter::IntoIterator<Item = V>,
3425 V: std::convert::Into<std::string::String>,
3426 {
3427 use std::iter::Iterator;
3428 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3429 self
3430 }
3431}
3432
3433impl wkt::message::Message for ListLoggingServersResponse {
3434 fn typename() -> &'static str {
3435 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersResponse"
3436 }
3437}
3438
3439#[doc(hidden)]
3440impl google_cloud_gax::paginator::internal::PageableResponse for ListLoggingServersResponse {
3441 type PageItem = crate::model::LoggingServer;
3442
3443 fn items(self) -> std::vec::Vec<Self::PageItem> {
3444 self.logging_servers
3445 }
3446
3447 fn next_page_token(&self) -> std::string::String {
3448 use std::clone::Clone;
3449 self.next_page_token.clone()
3450 }
3451}
3452
3453/// Request message for
3454/// [VmwareEngine.GetLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]
3455///
3456/// [google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]: crate::client::VmwareEngine::get_logging_server
3457#[derive(Clone, Default, PartialEq)]
3458#[non_exhaustive]
3459pub struct GetLoggingServerRequest {
3460 /// Required. The resource name of the Logging Server to retrieve.
3461 /// Resource names are schemeless URIs that follow the conventions in
3462 /// <https://cloud.google.com/apis/design/resource_names>.
3463 /// For example:
3464 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3465 pub name: std::string::String,
3466
3467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3468}
3469
3470impl GetLoggingServerRequest {
3471 pub fn new() -> Self {
3472 std::default::Default::default()
3473 }
3474
3475 /// Sets the value of [name][crate::model::GetLoggingServerRequest::name].
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_vmwareengine_v1::model::GetLoggingServerRequest;
3480 /// let x = GetLoggingServerRequest::new().set_name("example");
3481 /// ```
3482 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.name = v.into();
3484 self
3485 }
3486}
3487
3488impl wkt::message::Message for GetLoggingServerRequest {
3489 fn typename() -> &'static str {
3490 "type.googleapis.com/google.cloud.vmwareengine.v1.GetLoggingServerRequest"
3491 }
3492}
3493
3494/// Request message for
3495/// [VmwareEngine.CreateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]
3496///
3497/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]: crate::client::VmwareEngine::create_logging_server
3498#[derive(Clone, Default, PartialEq)]
3499#[non_exhaustive]
3500pub struct CreateLoggingServerRequest {
3501 /// Required. The resource name of the private cloud
3502 /// to create a new Logging Server in.
3503 /// Resource names are schemeless URIs that follow the conventions in
3504 /// <https://cloud.google.com/apis/design/resource_names>.
3505 /// For example:
3506 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3507 pub parent: std::string::String,
3508
3509 /// Required. The initial description of a new logging server.
3510 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3511
3512 /// Required. The user-provided identifier of the `LoggingServer` to be
3513 /// created. This identifier must be unique among `LoggingServer` resources
3514 /// within the parent and becomes the final token in the name URI.
3515 /// The identifier must meet the following requirements:
3516 ///
3517 /// * Only contains 1-63 alphanumeric characters and hyphens
3518 /// * Begins with an alphabetical character
3519 /// * Ends with a non-hyphen character
3520 /// * Not formatted as a UUID
3521 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3522 /// (section 3.5)
3523 pub logging_server_id: std::string::String,
3524
3525 /// Optional. A request ID to identify requests. Specify a unique request ID
3526 /// so that if you must retry your request, the server will know to ignore
3527 /// the request if it has already been completed. The server guarantees that a
3528 /// request doesn't result in creation of duplicate commitments for at least 60
3529 /// minutes.
3530 ///
3531 /// For example, consider a situation where you make an initial request and the
3532 /// request times out. If you make the request again with the same request ID,
3533 /// the server can check if original operation with the same request ID was
3534 /// received, and if so, will ignore the second request. This prevents clients
3535 /// from accidentally creating duplicate commitments.
3536 ///
3537 /// The request ID must be a valid UUID with the exception that zero UUID is
3538 /// not supported (00000000-0000-0000-0000-000000000000).
3539 pub request_id: std::string::String,
3540
3541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3542}
3543
3544impl CreateLoggingServerRequest {
3545 pub fn new() -> Self {
3546 std::default::Default::default()
3547 }
3548
3549 /// Sets the value of [parent][crate::model::CreateLoggingServerRequest::parent].
3550 ///
3551 /// # Example
3552 /// ```ignore,no_run
3553 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3554 /// let x = CreateLoggingServerRequest::new().set_parent("example");
3555 /// ```
3556 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3557 self.parent = v.into();
3558 self
3559 }
3560
3561 /// Sets the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3562 ///
3563 /// # Example
3564 /// ```ignore,no_run
3565 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3566 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3567 /// let x = CreateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3568 /// ```
3569 pub fn set_logging_server<T>(mut self, v: T) -> Self
3570 where
3571 T: std::convert::Into<crate::model::LoggingServer>,
3572 {
3573 self.logging_server = std::option::Option::Some(v.into());
3574 self
3575 }
3576
3577 /// Sets or clears the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3578 ///
3579 /// # Example
3580 /// ```ignore,no_run
3581 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3582 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3583 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3584 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3585 /// ```
3586 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3587 where
3588 T: std::convert::Into<crate::model::LoggingServer>,
3589 {
3590 self.logging_server = v.map(|x| x.into());
3591 self
3592 }
3593
3594 /// Sets the value of [logging_server_id][crate::model::CreateLoggingServerRequest::logging_server_id].
3595 ///
3596 /// # Example
3597 /// ```ignore,no_run
3598 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3599 /// let x = CreateLoggingServerRequest::new().set_logging_server_id("example");
3600 /// ```
3601 pub fn set_logging_server_id<T: std::convert::Into<std::string::String>>(
3602 mut self,
3603 v: T,
3604 ) -> Self {
3605 self.logging_server_id = v.into();
3606 self
3607 }
3608
3609 /// Sets the value of [request_id][crate::model::CreateLoggingServerRequest::request_id].
3610 ///
3611 /// # Example
3612 /// ```ignore,no_run
3613 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3614 /// let x = CreateLoggingServerRequest::new().set_request_id("example");
3615 /// ```
3616 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3617 self.request_id = v.into();
3618 self
3619 }
3620}
3621
3622impl wkt::message::Message for CreateLoggingServerRequest {
3623 fn typename() -> &'static str {
3624 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateLoggingServerRequest"
3625 }
3626}
3627
3628/// Request message for
3629/// [VmwareEngine.UpdateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]
3630///
3631/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]: crate::client::VmwareEngine::update_logging_server
3632#[derive(Clone, Default, PartialEq)]
3633#[non_exhaustive]
3634pub struct UpdateLoggingServerRequest {
3635 /// Required. Field mask is used to specify the fields to be overwritten in the
3636 /// `LoggingServer` resource by the update.
3637 /// The fields specified in the `update_mask` are relative to the resource, not
3638 /// the full request. A field will be overwritten if it is in the mask. If the
3639 /// user does not provide a mask then all fields will be overwritten.
3640 pub update_mask: std::option::Option<wkt::FieldMask>,
3641
3642 /// Required. Logging server description.
3643 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3644
3645 /// Optional. A request ID to identify requests. Specify a unique request ID
3646 /// so that if you must retry your request, the server will know to ignore
3647 /// the request if it has already been completed. The server guarantees that a
3648 /// request doesn't result in creation of duplicate commitments for at least 60
3649 /// minutes.
3650 ///
3651 /// For example, consider a situation where you make an initial request and the
3652 /// request times out. If you make the request again with the same request ID,
3653 /// the server can check if original operation with the same request ID was
3654 /// received, and if so, will ignore the second request. This prevents clients
3655 /// from accidentally creating duplicate commitments.
3656 ///
3657 /// The request ID must be a valid UUID with the exception that zero UUID is
3658 /// not supported (00000000-0000-0000-0000-000000000000).
3659 pub request_id: std::string::String,
3660
3661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3662}
3663
3664impl UpdateLoggingServerRequest {
3665 pub fn new() -> Self {
3666 std::default::Default::default()
3667 }
3668
3669 /// Sets the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3670 ///
3671 /// # Example
3672 /// ```ignore,no_run
3673 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3674 /// use wkt::FieldMask;
3675 /// let x = UpdateLoggingServerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3676 /// ```
3677 pub fn set_update_mask<T>(mut self, v: T) -> Self
3678 where
3679 T: std::convert::Into<wkt::FieldMask>,
3680 {
3681 self.update_mask = std::option::Option::Some(v.into());
3682 self
3683 }
3684
3685 /// Sets or clears the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3686 ///
3687 /// # Example
3688 /// ```ignore,no_run
3689 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3690 /// use wkt::FieldMask;
3691 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3692 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3693 /// ```
3694 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3695 where
3696 T: std::convert::Into<wkt::FieldMask>,
3697 {
3698 self.update_mask = v.map(|x| x.into());
3699 self
3700 }
3701
3702 /// Sets the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3703 ///
3704 /// # Example
3705 /// ```ignore,no_run
3706 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3707 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3708 /// let x = UpdateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3709 /// ```
3710 pub fn set_logging_server<T>(mut self, v: T) -> Self
3711 where
3712 T: std::convert::Into<crate::model::LoggingServer>,
3713 {
3714 self.logging_server = std::option::Option::Some(v.into());
3715 self
3716 }
3717
3718 /// Sets or clears the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3719 ///
3720 /// # Example
3721 /// ```ignore,no_run
3722 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3723 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3724 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3725 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3726 /// ```
3727 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3728 where
3729 T: std::convert::Into<crate::model::LoggingServer>,
3730 {
3731 self.logging_server = v.map(|x| x.into());
3732 self
3733 }
3734
3735 /// Sets the value of [request_id][crate::model::UpdateLoggingServerRequest::request_id].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3740 /// let x = UpdateLoggingServerRequest::new().set_request_id("example");
3741 /// ```
3742 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.request_id = v.into();
3744 self
3745 }
3746}
3747
3748impl wkt::message::Message for UpdateLoggingServerRequest {
3749 fn typename() -> &'static str {
3750 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateLoggingServerRequest"
3751 }
3752}
3753
3754/// Request message for
3755/// [VmwareEngine.DeleteLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]
3756///
3757/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]: crate::client::VmwareEngine::delete_logging_server
3758#[derive(Clone, Default, PartialEq)]
3759#[non_exhaustive]
3760pub struct DeleteLoggingServerRequest {
3761 /// Required. The resource name of the logging server to delete.
3762 /// Resource names are schemeless URIs that follow the conventions in
3763 /// <https://cloud.google.com/apis/design/resource_names>.
3764 /// For example:
3765 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3766 pub name: std::string::String,
3767
3768 /// Optional. A request ID to identify requests. Specify a unique request ID
3769 /// so that if you must retry your request, the server will know to ignore
3770 /// the request if it has already been completed. The server guarantees that a
3771 /// request doesn't result in creation of duplicate commitments for at least 60
3772 /// minutes.
3773 ///
3774 /// For example, consider a situation where you make an initial request and the
3775 /// request times out. If you make the request again with the same request
3776 /// ID, the server can check if original operation with the same request ID
3777 /// was received, and if so, will ignore the second request. This prevents
3778 /// clients from accidentally creating duplicate commitments.
3779 ///
3780 /// The request ID must be a valid UUID with the exception that zero UUID is
3781 /// not supported (00000000-0000-0000-0000-000000000000).
3782 pub request_id: std::string::String,
3783
3784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3785}
3786
3787impl DeleteLoggingServerRequest {
3788 pub fn new() -> Self {
3789 std::default::Default::default()
3790 }
3791
3792 /// Sets the value of [name][crate::model::DeleteLoggingServerRequest::name].
3793 ///
3794 /// # Example
3795 /// ```ignore,no_run
3796 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3797 /// let x = DeleteLoggingServerRequest::new().set_name("example");
3798 /// ```
3799 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3800 self.name = v.into();
3801 self
3802 }
3803
3804 /// Sets the value of [request_id][crate::model::DeleteLoggingServerRequest::request_id].
3805 ///
3806 /// # Example
3807 /// ```ignore,no_run
3808 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3809 /// let x = DeleteLoggingServerRequest::new().set_request_id("example");
3810 /// ```
3811 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.request_id = v.into();
3813 self
3814 }
3815}
3816
3817impl wkt::message::Message for DeleteLoggingServerRequest {
3818 fn typename() -> &'static str {
3819 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteLoggingServerRequest"
3820 }
3821}
3822
3823/// Represents the metadata of the long-running operation.
3824#[derive(Clone, Default, PartialEq)]
3825#[non_exhaustive]
3826pub struct OperationMetadata {
3827 /// Output only. The time the operation was created.
3828 pub create_time: std::option::Option<wkt::Timestamp>,
3829
3830 /// Output only. The time the operation finished running.
3831 pub end_time: std::option::Option<wkt::Timestamp>,
3832
3833 /// Output only. Server-defined resource path for the target of the operation.
3834 pub target: std::string::String,
3835
3836 /// Output only. Name of the verb executed by the operation.
3837 pub verb: std::string::String,
3838
3839 /// Output only. Human-readable status of the operation, if any.
3840 pub status_message: std::string::String,
3841
3842 /// Output only. True if the user has requested cancellation
3843 /// of the operation; false otherwise.
3844 /// Operations that have successfully been cancelled
3845 /// have [Operation.error][] value with a
3846 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3847 /// `Code.CANCELLED`.
3848 ///
3849 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3850 pub requested_cancellation: bool,
3851
3852 /// Output only. API version used to start the operation.
3853 pub api_version: std::string::String,
3854
3855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3856}
3857
3858impl OperationMetadata {
3859 pub fn new() -> Self {
3860 std::default::Default::default()
3861 }
3862
3863 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3864 ///
3865 /// # Example
3866 /// ```ignore,no_run
3867 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3868 /// use wkt::Timestamp;
3869 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3870 /// ```
3871 pub fn set_create_time<T>(mut self, v: T) -> Self
3872 where
3873 T: std::convert::Into<wkt::Timestamp>,
3874 {
3875 self.create_time = std::option::Option::Some(v.into());
3876 self
3877 }
3878
3879 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3880 ///
3881 /// # Example
3882 /// ```ignore,no_run
3883 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3884 /// use wkt::Timestamp;
3885 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3886 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3887 /// ```
3888 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3889 where
3890 T: std::convert::Into<wkt::Timestamp>,
3891 {
3892 self.create_time = v.map(|x| x.into());
3893 self
3894 }
3895
3896 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3897 ///
3898 /// # Example
3899 /// ```ignore,no_run
3900 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3901 /// use wkt::Timestamp;
3902 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3903 /// ```
3904 pub fn set_end_time<T>(mut self, v: T) -> Self
3905 where
3906 T: std::convert::Into<wkt::Timestamp>,
3907 {
3908 self.end_time = std::option::Option::Some(v.into());
3909 self
3910 }
3911
3912 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3913 ///
3914 /// # Example
3915 /// ```ignore,no_run
3916 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3917 /// use wkt::Timestamp;
3918 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3919 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3920 /// ```
3921 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3922 where
3923 T: std::convert::Into<wkt::Timestamp>,
3924 {
3925 self.end_time = v.map(|x| x.into());
3926 self
3927 }
3928
3929 /// Sets the value of [target][crate::model::OperationMetadata::target].
3930 ///
3931 /// # Example
3932 /// ```ignore,no_run
3933 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3934 /// let x = OperationMetadata::new().set_target("example");
3935 /// ```
3936 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3937 self.target = v.into();
3938 self
3939 }
3940
3941 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3942 ///
3943 /// # Example
3944 /// ```ignore,no_run
3945 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3946 /// let x = OperationMetadata::new().set_verb("example");
3947 /// ```
3948 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3949 self.verb = v.into();
3950 self
3951 }
3952
3953 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3958 /// let x = OperationMetadata::new().set_status_message("example");
3959 /// ```
3960 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3961 self.status_message = v.into();
3962 self
3963 }
3964
3965 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3966 ///
3967 /// # Example
3968 /// ```ignore,no_run
3969 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3970 /// let x = OperationMetadata::new().set_requested_cancellation(true);
3971 /// ```
3972 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3973 self.requested_cancellation = v.into();
3974 self
3975 }
3976
3977 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3978 ///
3979 /// # Example
3980 /// ```ignore,no_run
3981 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3982 /// let x = OperationMetadata::new().set_api_version("example");
3983 /// ```
3984 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.api_version = v.into();
3986 self
3987 }
3988}
3989
3990impl wkt::message::Message for OperationMetadata {
3991 fn typename() -> &'static str {
3992 "type.googleapis.com/google.cloud.vmwareengine.v1.OperationMetadata"
3993 }
3994}
3995
3996/// Request message for
3997/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
3998///
3999/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4000#[derive(Clone, Default, PartialEq)]
4001#[non_exhaustive]
4002pub struct ListNodeTypesRequest {
4003 /// Required. The resource name of the location to be queried for node types.
4004 /// Resource names are schemeless URIs that follow the conventions in
4005 /// <https://cloud.google.com/apis/design/resource_names>.
4006 /// For example:
4007 /// `projects/my-project/locations/us-central1-a`
4008 pub parent: std::string::String,
4009
4010 /// The maximum number of node types to return in one page.
4011 /// The service may return fewer than this value.
4012 /// The maximum value is coerced to 1000.
4013 /// The default value of this field is 500.
4014 pub page_size: i32,
4015
4016 /// A page token, received from a previous `ListNodeTypes` call.
4017 /// Provide this to retrieve the subsequent page.
4018 ///
4019 /// When paginating, all other parameters provided to
4020 /// `ListNodeTypes` must match the call that provided the page token.
4021 pub page_token: std::string::String,
4022
4023 /// A filter expression that matches resources returned in the response.
4024 /// The expression must specify the field name, a comparison
4025 /// operator, and the value that you want to use for filtering. The value
4026 /// must be a string, a number, or a boolean. The comparison operator
4027 /// must be `=`, `!=`, `>`, or `<`.
4028 ///
4029 /// For example, if you are filtering a list of node types, you can
4030 /// exclude the ones named `standard-72` by specifying
4031 /// `name != "standard-72"`.
4032 ///
4033 /// To filter on multiple expressions, provide each separate expression within
4034 /// parentheses. For example:
4035 ///
4036 /// ```norust
4037 /// (name = "standard-72")
4038 /// (virtual_cpu_count > 2)
4039 /// ```
4040 ///
4041 /// By default, each expression is an `AND` expression. However, you
4042 /// can include `AND` and `OR` expressions explicitly.
4043 /// For example:
4044 ///
4045 /// ```norust
4046 /// (name = "standard-96") AND
4047 /// (virtual_cpu_count > 2) OR
4048 /// (name = "standard-72")
4049 /// ```
4050 pub filter: std::string::String,
4051
4052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4053}
4054
4055impl ListNodeTypesRequest {
4056 pub fn new() -> Self {
4057 std::default::Default::default()
4058 }
4059
4060 /// Sets the value of [parent][crate::model::ListNodeTypesRequest::parent].
4061 ///
4062 /// # Example
4063 /// ```ignore,no_run
4064 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4065 /// let x = ListNodeTypesRequest::new().set_parent("example");
4066 /// ```
4067 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068 self.parent = v.into();
4069 self
4070 }
4071
4072 /// Sets the value of [page_size][crate::model::ListNodeTypesRequest::page_size].
4073 ///
4074 /// # Example
4075 /// ```ignore,no_run
4076 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4077 /// let x = ListNodeTypesRequest::new().set_page_size(42);
4078 /// ```
4079 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4080 self.page_size = v.into();
4081 self
4082 }
4083
4084 /// Sets the value of [page_token][crate::model::ListNodeTypesRequest::page_token].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4089 /// let x = ListNodeTypesRequest::new().set_page_token("example");
4090 /// ```
4091 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.page_token = v.into();
4093 self
4094 }
4095
4096 /// Sets the value of [filter][crate::model::ListNodeTypesRequest::filter].
4097 ///
4098 /// # Example
4099 /// ```ignore,no_run
4100 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4101 /// let x = ListNodeTypesRequest::new().set_filter("example");
4102 /// ```
4103 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4104 self.filter = v.into();
4105 self
4106 }
4107}
4108
4109impl wkt::message::Message for ListNodeTypesRequest {
4110 fn typename() -> &'static str {
4111 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesRequest"
4112 }
4113}
4114
4115/// Response message for
4116/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
4117///
4118/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4119#[derive(Clone, Default, PartialEq)]
4120#[non_exhaustive]
4121pub struct ListNodeTypesResponse {
4122 /// A list of Node Types.
4123 pub node_types: std::vec::Vec<crate::model::NodeType>,
4124
4125 /// A token, which can be sent as `page_token` to retrieve the next page.
4126 /// If this field is omitted, there are no subsequent pages.
4127 pub next_page_token: std::string::String,
4128
4129 /// Locations that could not be reached when making an aggregated query using
4130 /// wildcards.
4131 pub unreachable: std::vec::Vec<std::string::String>,
4132
4133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4134}
4135
4136impl ListNodeTypesResponse {
4137 pub fn new() -> Self {
4138 std::default::Default::default()
4139 }
4140
4141 /// Sets the value of [node_types][crate::model::ListNodeTypesResponse::node_types].
4142 ///
4143 /// # Example
4144 /// ```ignore,no_run
4145 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4146 /// use google_cloud_vmwareengine_v1::model::NodeType;
4147 /// let x = ListNodeTypesResponse::new()
4148 /// .set_node_types([
4149 /// NodeType::default()/* use setters */,
4150 /// NodeType::default()/* use (different) setters */,
4151 /// ]);
4152 /// ```
4153 pub fn set_node_types<T, V>(mut self, v: T) -> Self
4154 where
4155 T: std::iter::IntoIterator<Item = V>,
4156 V: std::convert::Into<crate::model::NodeType>,
4157 {
4158 use std::iter::Iterator;
4159 self.node_types = v.into_iter().map(|i| i.into()).collect();
4160 self
4161 }
4162
4163 /// Sets the value of [next_page_token][crate::model::ListNodeTypesResponse::next_page_token].
4164 ///
4165 /// # Example
4166 /// ```ignore,no_run
4167 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4168 /// let x = ListNodeTypesResponse::new().set_next_page_token("example");
4169 /// ```
4170 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4171 self.next_page_token = v.into();
4172 self
4173 }
4174
4175 /// Sets the value of [unreachable][crate::model::ListNodeTypesResponse::unreachable].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4180 /// let x = ListNodeTypesResponse::new().set_unreachable(["a", "b", "c"]);
4181 /// ```
4182 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4183 where
4184 T: std::iter::IntoIterator<Item = V>,
4185 V: std::convert::Into<std::string::String>,
4186 {
4187 use std::iter::Iterator;
4188 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4189 self
4190 }
4191}
4192
4193impl wkt::message::Message for ListNodeTypesResponse {
4194 fn typename() -> &'static str {
4195 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesResponse"
4196 }
4197}
4198
4199#[doc(hidden)]
4200impl google_cloud_gax::paginator::internal::PageableResponse for ListNodeTypesResponse {
4201 type PageItem = crate::model::NodeType;
4202
4203 fn items(self) -> std::vec::Vec<Self::PageItem> {
4204 self.node_types
4205 }
4206
4207 fn next_page_token(&self) -> std::string::String {
4208 use std::clone::Clone;
4209 self.next_page_token.clone()
4210 }
4211}
4212
4213/// Request message for
4214/// [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]
4215///
4216/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]: crate::client::VmwareEngine::get_node_type
4217#[derive(Clone, Default, PartialEq)]
4218#[non_exhaustive]
4219pub struct GetNodeTypeRequest {
4220 /// Required. The resource name of the node type to retrieve.
4221 /// Resource names are schemeless URIs that follow the conventions in
4222 /// <https://cloud.google.com/apis/design/resource_names>.
4223 /// For example:
4224 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
4225 pub name: std::string::String,
4226
4227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4228}
4229
4230impl GetNodeTypeRequest {
4231 pub fn new() -> Self {
4232 std::default::Default::default()
4233 }
4234
4235 /// Sets the value of [name][crate::model::GetNodeTypeRequest::name].
4236 ///
4237 /// # Example
4238 /// ```ignore,no_run
4239 /// # use google_cloud_vmwareengine_v1::model::GetNodeTypeRequest;
4240 /// let x = GetNodeTypeRequest::new().set_name("example");
4241 /// ```
4242 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4243 self.name = v.into();
4244 self
4245 }
4246}
4247
4248impl wkt::message::Message for GetNodeTypeRequest {
4249 fn typename() -> &'static str {
4250 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeTypeRequest"
4251 }
4252}
4253
4254/// Request message for
4255/// [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]
4256///
4257/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]: crate::client::VmwareEngine::show_nsx_credentials
4258#[derive(Clone, Default, PartialEq)]
4259#[non_exhaustive]
4260pub struct ShowNsxCredentialsRequest {
4261 /// Required. The resource name of the private cloud
4262 /// to be queried for credentials.
4263 /// Resource names are schemeless URIs that follow the conventions in
4264 /// <https://cloud.google.com/apis/design/resource_names>.
4265 /// For example:
4266 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4267 pub private_cloud: std::string::String,
4268
4269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4270}
4271
4272impl ShowNsxCredentialsRequest {
4273 pub fn new() -> Self {
4274 std::default::Default::default()
4275 }
4276
4277 /// Sets the value of [private_cloud][crate::model::ShowNsxCredentialsRequest::private_cloud].
4278 ///
4279 /// # Example
4280 /// ```ignore,no_run
4281 /// # use google_cloud_vmwareengine_v1::model::ShowNsxCredentialsRequest;
4282 /// let x = ShowNsxCredentialsRequest::new().set_private_cloud("example");
4283 /// ```
4284 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.private_cloud = v.into();
4286 self
4287 }
4288}
4289
4290impl wkt::message::Message for ShowNsxCredentialsRequest {
4291 fn typename() -> &'static str {
4292 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"
4293 }
4294}
4295
4296/// Request message for
4297/// [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]
4298///
4299/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]: crate::client::VmwareEngine::show_vcenter_credentials
4300#[derive(Clone, Default, PartialEq)]
4301#[non_exhaustive]
4302pub struct ShowVcenterCredentialsRequest {
4303 /// Required. The resource name of the private cloud
4304 /// to be queried for credentials.
4305 /// Resource names are schemeless URIs that follow the conventions in
4306 /// <https://cloud.google.com/apis/design/resource_names>.
4307 /// For example:
4308 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4309 pub private_cloud: std::string::String,
4310
4311 /// Optional. The username of the user to be queried for credentials.
4312 /// The default value of this field is CloudOwner@gve.local.
4313 /// The provided value must be one of the following:
4314 /// CloudOwner@gve.local,
4315 /// solution-user-01@gve.local,
4316 /// solution-user-02@gve.local,
4317 /// solution-user-03@gve.local,
4318 /// solution-user-04@gve.local,
4319 /// solution-user-05@gve.local,
4320 /// zertoadmin@gve.local.
4321 pub username: std::string::String,
4322
4323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4324}
4325
4326impl ShowVcenterCredentialsRequest {
4327 pub fn new() -> Self {
4328 std::default::Default::default()
4329 }
4330
4331 /// Sets the value of [private_cloud][crate::model::ShowVcenterCredentialsRequest::private_cloud].
4332 ///
4333 /// # Example
4334 /// ```ignore,no_run
4335 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4336 /// let x = ShowVcenterCredentialsRequest::new().set_private_cloud("example");
4337 /// ```
4338 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4339 self.private_cloud = v.into();
4340 self
4341 }
4342
4343 /// Sets the value of [username][crate::model::ShowVcenterCredentialsRequest::username].
4344 ///
4345 /// # Example
4346 /// ```ignore,no_run
4347 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4348 /// let x = ShowVcenterCredentialsRequest::new().set_username("example");
4349 /// ```
4350 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4351 self.username = v.into();
4352 self
4353 }
4354}
4355
4356impl wkt::message::Message for ShowVcenterCredentialsRequest {
4357 fn typename() -> &'static str {
4358 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"
4359 }
4360}
4361
4362/// Request message for
4363/// [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]
4364///
4365/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]: crate::client::VmwareEngine::reset_nsx_credentials
4366#[derive(Clone, Default, PartialEq)]
4367#[non_exhaustive]
4368pub struct ResetNsxCredentialsRequest {
4369 /// Required. The resource name of the private cloud
4370 /// to reset credentials for.
4371 /// Resource names are schemeless URIs that follow the conventions in
4372 /// <https://cloud.google.com/apis/design/resource_names>.
4373 /// For example:
4374 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4375 pub private_cloud: std::string::String,
4376
4377 /// Optional. A request ID to identify requests. Specify a unique request ID
4378 /// so that if you must retry your request, the server will know to ignore
4379 /// the request if it has already been completed. The server guarantees that a
4380 /// request doesn't result in creation of duplicate commitments for at least 60
4381 /// minutes.
4382 ///
4383 /// For example, consider a situation where you make an initial request and the
4384 /// request times out. If you make the request again with the same request
4385 /// ID, the server can check if original operation with the same request ID
4386 /// was received, and if so, will ignore the second request. This prevents
4387 /// clients from accidentally creating duplicate commitments.
4388 ///
4389 /// The request ID must be a valid UUID with the exception that zero UUID is
4390 /// not supported (00000000-0000-0000-0000-000000000000).
4391 pub request_id: std::string::String,
4392
4393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4394}
4395
4396impl ResetNsxCredentialsRequest {
4397 pub fn new() -> Self {
4398 std::default::Default::default()
4399 }
4400
4401 /// Sets the value of [private_cloud][crate::model::ResetNsxCredentialsRequest::private_cloud].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4406 /// let x = ResetNsxCredentialsRequest::new().set_private_cloud("example");
4407 /// ```
4408 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4409 self.private_cloud = v.into();
4410 self
4411 }
4412
4413 /// Sets the value of [request_id][crate::model::ResetNsxCredentialsRequest::request_id].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4418 /// let x = ResetNsxCredentialsRequest::new().set_request_id("example");
4419 /// ```
4420 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421 self.request_id = v.into();
4422 self
4423 }
4424}
4425
4426impl wkt::message::Message for ResetNsxCredentialsRequest {
4427 fn typename() -> &'static str {
4428 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"
4429 }
4430}
4431
4432/// Request message for
4433/// [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]
4434///
4435/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]: crate::client::VmwareEngine::reset_vcenter_credentials
4436#[derive(Clone, Default, PartialEq)]
4437#[non_exhaustive]
4438pub struct ResetVcenterCredentialsRequest {
4439 /// Required. The resource name of the private cloud
4440 /// to reset credentials for.
4441 /// Resource names are schemeless URIs that follow the conventions in
4442 /// <https://cloud.google.com/apis/design/resource_names>.
4443 /// For example:
4444 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4445 pub private_cloud: std::string::String,
4446
4447 /// Optional. A request ID to identify requests. Specify a unique request ID
4448 /// so that if you must retry your request, the server will know to ignore
4449 /// the request if it has already been completed. The server guarantees that a
4450 /// request doesn't result in creation of duplicate commitments for at least 60
4451 /// minutes.
4452 ///
4453 /// For example, consider a situation where you make an initial request and the
4454 /// request times out. If you make the request again with the same request
4455 /// ID, the server can check if original operation with the same request ID
4456 /// was received, and if so, will ignore the second request. This prevents
4457 /// clients from accidentally creating duplicate commitments.
4458 ///
4459 /// The request ID must be a valid UUID with the exception that zero UUID is
4460 /// not supported (00000000-0000-0000-0000-000000000000).
4461 pub request_id: std::string::String,
4462
4463 /// Optional. The username of the user to be to reset the credentials.
4464 /// The default value of this field is CloudOwner@gve.local.
4465 /// The provided value should be one of the following:
4466 /// solution-user-01@gve.local,
4467 /// solution-user-02@gve.local,
4468 /// solution-user-03@gve.local,
4469 /// solution-user-04@gve.local,
4470 /// solution-user-05@gve.local,
4471 /// zertoadmin@gve.local.
4472 pub username: std::string::String,
4473
4474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4475}
4476
4477impl ResetVcenterCredentialsRequest {
4478 pub fn new() -> Self {
4479 std::default::Default::default()
4480 }
4481
4482 /// Sets the value of [private_cloud][crate::model::ResetVcenterCredentialsRequest::private_cloud].
4483 ///
4484 /// # Example
4485 /// ```ignore,no_run
4486 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4487 /// let x = ResetVcenterCredentialsRequest::new().set_private_cloud("example");
4488 /// ```
4489 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4490 self.private_cloud = v.into();
4491 self
4492 }
4493
4494 /// Sets the value of [request_id][crate::model::ResetVcenterCredentialsRequest::request_id].
4495 ///
4496 /// # Example
4497 /// ```ignore,no_run
4498 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4499 /// let x = ResetVcenterCredentialsRequest::new().set_request_id("example");
4500 /// ```
4501 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.request_id = v.into();
4503 self
4504 }
4505
4506 /// Sets the value of [username][crate::model::ResetVcenterCredentialsRequest::username].
4507 ///
4508 /// # Example
4509 /// ```ignore,no_run
4510 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4511 /// let x = ResetVcenterCredentialsRequest::new().set_username("example");
4512 /// ```
4513 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4514 self.username = v.into();
4515 self
4516 }
4517}
4518
4519impl wkt::message::Message for ResetVcenterCredentialsRequest {
4520 fn typename() -> &'static str {
4521 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"
4522 }
4523}
4524
4525/// Response message for
4526/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4527///
4528/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4529#[derive(Clone, Default, PartialEq)]
4530#[non_exhaustive]
4531pub struct ListHcxActivationKeysResponse {
4532 /// List of HCX activation keys.
4533 pub hcx_activation_keys: std::vec::Vec<crate::model::HcxActivationKey>,
4534
4535 /// A token, which can be sent as `page_token` to retrieve the next page.
4536 /// If this field is omitted, there are no subsequent pages.
4537 pub next_page_token: std::string::String,
4538
4539 /// Locations that could not be reached when making an aggregated query using
4540 /// wildcards.
4541 pub unreachable: std::vec::Vec<std::string::String>,
4542
4543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4544}
4545
4546impl ListHcxActivationKeysResponse {
4547 pub fn new() -> Self {
4548 std::default::Default::default()
4549 }
4550
4551 /// Sets the value of [hcx_activation_keys][crate::model::ListHcxActivationKeysResponse::hcx_activation_keys].
4552 ///
4553 /// # Example
4554 /// ```ignore,no_run
4555 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4556 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4557 /// let x = ListHcxActivationKeysResponse::new()
4558 /// .set_hcx_activation_keys([
4559 /// HcxActivationKey::default()/* use setters */,
4560 /// HcxActivationKey::default()/* use (different) setters */,
4561 /// ]);
4562 /// ```
4563 pub fn set_hcx_activation_keys<T, V>(mut self, v: T) -> Self
4564 where
4565 T: std::iter::IntoIterator<Item = V>,
4566 V: std::convert::Into<crate::model::HcxActivationKey>,
4567 {
4568 use std::iter::Iterator;
4569 self.hcx_activation_keys = v.into_iter().map(|i| i.into()).collect();
4570 self
4571 }
4572
4573 /// Sets the value of [next_page_token][crate::model::ListHcxActivationKeysResponse::next_page_token].
4574 ///
4575 /// # Example
4576 /// ```ignore,no_run
4577 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4578 /// let x = ListHcxActivationKeysResponse::new().set_next_page_token("example");
4579 /// ```
4580 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4581 self.next_page_token = v.into();
4582 self
4583 }
4584
4585 /// Sets the value of [unreachable][crate::model::ListHcxActivationKeysResponse::unreachable].
4586 ///
4587 /// # Example
4588 /// ```ignore,no_run
4589 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4590 /// let x = ListHcxActivationKeysResponse::new().set_unreachable(["a", "b", "c"]);
4591 /// ```
4592 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4593 where
4594 T: std::iter::IntoIterator<Item = V>,
4595 V: std::convert::Into<std::string::String>,
4596 {
4597 use std::iter::Iterator;
4598 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4599 self
4600 }
4601}
4602
4603impl wkt::message::Message for ListHcxActivationKeysResponse {
4604 fn typename() -> &'static str {
4605 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"
4606 }
4607}
4608
4609#[doc(hidden)]
4610impl google_cloud_gax::paginator::internal::PageableResponse for ListHcxActivationKeysResponse {
4611 type PageItem = crate::model::HcxActivationKey;
4612
4613 fn items(self) -> std::vec::Vec<Self::PageItem> {
4614 self.hcx_activation_keys
4615 }
4616
4617 fn next_page_token(&self) -> std::string::String {
4618 use std::clone::Clone;
4619 self.next_page_token.clone()
4620 }
4621}
4622
4623/// Request message for
4624/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4625///
4626/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4627#[derive(Clone, Default, PartialEq)]
4628#[non_exhaustive]
4629pub struct ListHcxActivationKeysRequest {
4630 /// Required. The resource name of the private cloud
4631 /// to be queried for HCX activation keys.
4632 /// Resource names are schemeless URIs that follow the conventions in
4633 /// <https://cloud.google.com/apis/design/resource_names>.
4634 /// For example:
4635 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4636 pub parent: std::string::String,
4637
4638 /// The maximum number of HCX activation keys to return in one page.
4639 /// The service may return fewer than this value.
4640 /// The maximum value is coerced to 1000.
4641 /// The default value of this field is 500.
4642 pub page_size: i32,
4643
4644 /// A page token, received from a previous `ListHcxActivationKeys` call.
4645 /// Provide this to retrieve the subsequent page.
4646 ///
4647 /// When paginating, all other parameters provided to
4648 /// `ListHcxActivationKeys` must match the call that provided the page
4649 /// token.
4650 pub page_token: std::string::String,
4651
4652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4653}
4654
4655impl ListHcxActivationKeysRequest {
4656 pub fn new() -> Self {
4657 std::default::Default::default()
4658 }
4659
4660 /// Sets the value of [parent][crate::model::ListHcxActivationKeysRequest::parent].
4661 ///
4662 /// # Example
4663 /// ```ignore,no_run
4664 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4665 /// let x = ListHcxActivationKeysRequest::new().set_parent("example");
4666 /// ```
4667 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4668 self.parent = v.into();
4669 self
4670 }
4671
4672 /// Sets the value of [page_size][crate::model::ListHcxActivationKeysRequest::page_size].
4673 ///
4674 /// # Example
4675 /// ```ignore,no_run
4676 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4677 /// let x = ListHcxActivationKeysRequest::new().set_page_size(42);
4678 /// ```
4679 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4680 self.page_size = v.into();
4681 self
4682 }
4683
4684 /// Sets the value of [page_token][crate::model::ListHcxActivationKeysRequest::page_token].
4685 ///
4686 /// # Example
4687 /// ```ignore,no_run
4688 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4689 /// let x = ListHcxActivationKeysRequest::new().set_page_token("example");
4690 /// ```
4691 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4692 self.page_token = v.into();
4693 self
4694 }
4695}
4696
4697impl wkt::message::Message for ListHcxActivationKeysRequest {
4698 fn typename() -> &'static str {
4699 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"
4700 }
4701}
4702
4703/// Request message for [VmwareEngine.GetHcxActivationKeys][]
4704#[derive(Clone, Default, PartialEq)]
4705#[non_exhaustive]
4706pub struct GetHcxActivationKeyRequest {
4707 /// Required. The resource name of the HCX activation key to retrieve.
4708 /// Resource names are schemeless URIs that follow the conventions in
4709 /// <https://cloud.google.com/apis/design/resource_names>.
4710 /// For example:
4711 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
4712 pub name: std::string::String,
4713
4714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4715}
4716
4717impl GetHcxActivationKeyRequest {
4718 pub fn new() -> Self {
4719 std::default::Default::default()
4720 }
4721
4722 /// Sets the value of [name][crate::model::GetHcxActivationKeyRequest::name].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_vmwareengine_v1::model::GetHcxActivationKeyRequest;
4727 /// let x = GetHcxActivationKeyRequest::new().set_name("example");
4728 /// ```
4729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.name = v.into();
4731 self
4732 }
4733}
4734
4735impl wkt::message::Message for GetHcxActivationKeyRequest {
4736 fn typename() -> &'static str {
4737 "type.googleapis.com/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"
4738 }
4739}
4740
4741/// Request message for
4742/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
4743///
4744/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
4745#[derive(Clone, Default, PartialEq)]
4746#[non_exhaustive]
4747pub struct CreateHcxActivationKeyRequest {
4748 /// Required. The resource name of the private cloud to create the key for.
4749 /// Resource names are schemeless URIs that follow the conventions in
4750 /// <https://cloud.google.com/apis/design/resource_names>.
4751 /// For example:
4752 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4753 pub parent: std::string::String,
4754
4755 /// Required. The initial description of a new HCX activation key. When
4756 /// creating a new key, this field must be an empty object.
4757 pub hcx_activation_key: std::option::Option<crate::model::HcxActivationKey>,
4758
4759 /// Required. The user-provided identifier of the `HcxActivationKey` to be
4760 /// created. This identifier must be unique among `HcxActivationKey` resources
4761 /// within the parent and becomes the final token in the name URI.
4762 /// The identifier must meet the following requirements:
4763 ///
4764 /// * Only contains 1-63 alphanumeric characters and hyphens
4765 /// * Begins with an alphabetical character
4766 /// * Ends with a non-hyphen character
4767 /// * Not formatted as a UUID
4768 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
4769 /// (section 3.5)
4770 pub hcx_activation_key_id: std::string::String,
4771
4772 /// A request ID to identify requests. Specify a unique request ID
4773 /// so that if you must retry your request, the server will know to ignore
4774 /// the request if it has already been completed. The server guarantees that a
4775 /// request doesn't result in creation of duplicate commitments for at least 60
4776 /// minutes.
4777 ///
4778 /// For example, consider a situation where you make an initial request and the
4779 /// request times out. If you make the request again with the same request ID,
4780 /// the server can check if original operation with the same request ID was
4781 /// received, and if so, will ignore the second request. This prevents clients
4782 /// from accidentally creating duplicate commitments.
4783 ///
4784 /// The request ID must be a valid UUID with the exception that zero UUID is
4785 /// not supported (00000000-0000-0000-0000-000000000000).
4786 pub request_id: std::string::String,
4787
4788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4789}
4790
4791impl CreateHcxActivationKeyRequest {
4792 pub fn new() -> Self {
4793 std::default::Default::default()
4794 }
4795
4796 /// Sets the value of [parent][crate::model::CreateHcxActivationKeyRequest::parent].
4797 ///
4798 /// # Example
4799 /// ```ignore,no_run
4800 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4801 /// let x = CreateHcxActivationKeyRequest::new().set_parent("example");
4802 /// ```
4803 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4804 self.parent = v.into();
4805 self
4806 }
4807
4808 /// Sets the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4809 ///
4810 /// # Example
4811 /// ```ignore,no_run
4812 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4813 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4814 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key(HcxActivationKey::default()/* use setters */);
4815 /// ```
4816 pub fn set_hcx_activation_key<T>(mut self, v: T) -> Self
4817 where
4818 T: std::convert::Into<crate::model::HcxActivationKey>,
4819 {
4820 self.hcx_activation_key = std::option::Option::Some(v.into());
4821 self
4822 }
4823
4824 /// Sets or clears the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4829 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4830 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(Some(HcxActivationKey::default()/* use setters */));
4831 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(None::<HcxActivationKey>);
4832 /// ```
4833 pub fn set_or_clear_hcx_activation_key<T>(mut self, v: std::option::Option<T>) -> Self
4834 where
4835 T: std::convert::Into<crate::model::HcxActivationKey>,
4836 {
4837 self.hcx_activation_key = v.map(|x| x.into());
4838 self
4839 }
4840
4841 /// Sets the value of [hcx_activation_key_id][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key_id].
4842 ///
4843 /// # Example
4844 /// ```ignore,no_run
4845 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4846 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key_id("example");
4847 /// ```
4848 pub fn set_hcx_activation_key_id<T: std::convert::Into<std::string::String>>(
4849 mut self,
4850 v: T,
4851 ) -> Self {
4852 self.hcx_activation_key_id = v.into();
4853 self
4854 }
4855
4856 /// Sets the value of [request_id][crate::model::CreateHcxActivationKeyRequest::request_id].
4857 ///
4858 /// # Example
4859 /// ```ignore,no_run
4860 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4861 /// let x = CreateHcxActivationKeyRequest::new().set_request_id("example");
4862 /// ```
4863 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4864 self.request_id = v.into();
4865 self
4866 }
4867}
4868
4869impl wkt::message::Message for CreateHcxActivationKeyRequest {
4870 fn typename() -> &'static str {
4871 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"
4872 }
4873}
4874
4875/// Request message for
4876/// [VmwareEngine.GetDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]
4877///
4878/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]: crate::client::VmwareEngine::get_dns_forwarding
4879#[derive(Clone, Default, PartialEq)]
4880#[non_exhaustive]
4881pub struct GetDnsForwardingRequest {
4882 /// Required. The resource name of a `DnsForwarding` to retrieve.
4883 /// Resource names are schemeless URIs that follow the conventions in
4884 /// <https://cloud.google.com/apis/design/resource_names>.
4885 /// For example:
4886 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
4887 pub name: std::string::String,
4888
4889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4890}
4891
4892impl GetDnsForwardingRequest {
4893 pub fn new() -> Self {
4894 std::default::Default::default()
4895 }
4896
4897 /// Sets the value of [name][crate::model::GetDnsForwardingRequest::name].
4898 ///
4899 /// # Example
4900 /// ```ignore,no_run
4901 /// # use google_cloud_vmwareengine_v1::model::GetDnsForwardingRequest;
4902 /// let x = GetDnsForwardingRequest::new().set_name("example");
4903 /// ```
4904 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4905 self.name = v.into();
4906 self
4907 }
4908}
4909
4910impl wkt::message::Message for GetDnsForwardingRequest {
4911 fn typename() -> &'static str {
4912 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsForwardingRequest"
4913 }
4914}
4915
4916/// Request message for
4917/// [VmwareEngine.UpdateDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]
4918///
4919/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]: crate::client::VmwareEngine::update_dns_forwarding
4920#[derive(Clone, Default, PartialEq)]
4921#[non_exhaustive]
4922pub struct UpdateDnsForwardingRequest {
4923 /// Required. DnsForwarding config details.
4924 pub dns_forwarding: std::option::Option<crate::model::DnsForwarding>,
4925
4926 /// Required. Field mask is used to specify the fields to be overwritten in the
4927 /// `DnsForwarding` resource by the update.
4928 /// The fields specified in the `update_mask` are relative to the resource, not
4929 /// the full request. A field will be overwritten if it is in the mask. If the
4930 /// user does not provide a mask then all fields will be overwritten.
4931 pub update_mask: std::option::Option<wkt::FieldMask>,
4932
4933 /// Optional. A request ID to identify requests. Specify a unique request ID
4934 /// so that if you must retry your request, the server will know to ignore
4935 /// the request if it has already been completed. The server guarantees that a
4936 /// request doesn't result in creation of duplicate commitments for at least 60
4937 /// minutes.
4938 ///
4939 /// For example, consider a situation where you make an initial request and the
4940 /// request times out. If you make the request again with the same request ID,
4941 /// the server can check if original operation with the same request ID was
4942 /// received, and if so, will ignore the second request. This prevents clients
4943 /// from accidentally creating duplicate commitments.
4944 ///
4945 /// The request ID must be a valid UUID with the exception that zero UUID is
4946 /// not supported (00000000-0000-0000-0000-000000000000).
4947 pub request_id: std::string::String,
4948
4949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4950}
4951
4952impl UpdateDnsForwardingRequest {
4953 pub fn new() -> Self {
4954 std::default::Default::default()
4955 }
4956
4957 /// Sets the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4958 ///
4959 /// # Example
4960 /// ```ignore,no_run
4961 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4962 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4963 /// let x = UpdateDnsForwardingRequest::new().set_dns_forwarding(DnsForwarding::default()/* use setters */);
4964 /// ```
4965 pub fn set_dns_forwarding<T>(mut self, v: T) -> Self
4966 where
4967 T: std::convert::Into<crate::model::DnsForwarding>,
4968 {
4969 self.dns_forwarding = std::option::Option::Some(v.into());
4970 self
4971 }
4972
4973 /// Sets or clears the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4978 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
4979 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(Some(DnsForwarding::default()/* use setters */));
4980 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(None::<DnsForwarding>);
4981 /// ```
4982 pub fn set_or_clear_dns_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
4983 where
4984 T: std::convert::Into<crate::model::DnsForwarding>,
4985 {
4986 self.dns_forwarding = v.map(|x| x.into());
4987 self
4988 }
4989
4990 /// Sets the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
4991 ///
4992 /// # Example
4993 /// ```ignore,no_run
4994 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
4995 /// use wkt::FieldMask;
4996 /// let x = UpdateDnsForwardingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4997 /// ```
4998 pub fn set_update_mask<T>(mut self, v: T) -> Self
4999 where
5000 T: std::convert::Into<wkt::FieldMask>,
5001 {
5002 self.update_mask = std::option::Option::Some(v.into());
5003 self
5004 }
5005
5006 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
5007 ///
5008 /// # Example
5009 /// ```ignore,no_run
5010 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5011 /// use wkt::FieldMask;
5012 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5013 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5014 /// ```
5015 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5016 where
5017 T: std::convert::Into<wkt::FieldMask>,
5018 {
5019 self.update_mask = v.map(|x| x.into());
5020 self
5021 }
5022
5023 /// Sets the value of [request_id][crate::model::UpdateDnsForwardingRequest::request_id].
5024 ///
5025 /// # Example
5026 /// ```ignore,no_run
5027 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5028 /// let x = UpdateDnsForwardingRequest::new().set_request_id("example");
5029 /// ```
5030 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5031 self.request_id = v.into();
5032 self
5033 }
5034}
5035
5036impl wkt::message::Message for UpdateDnsForwardingRequest {
5037 fn typename() -> &'static str {
5038 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest"
5039 }
5040}
5041
5042/// Request message for
5043/// [VmwareEngine.CreateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]
5044///
5045/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]: crate::client::VmwareEngine::create_network_peering
5046#[derive(Clone, Default, PartialEq)]
5047#[non_exhaustive]
5048pub struct CreateNetworkPeeringRequest {
5049 /// Required. The resource name of the location to create the new network
5050 /// peering in. This value is always `global`, because `NetworkPeering` is a
5051 /// global resource. Resource names are schemeless URIs that follow the
5052 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5053 /// example: `projects/my-project/locations/global`
5054 pub parent: std::string::String,
5055
5056 /// Required. The user-provided identifier of the new `NetworkPeering`.
5057 /// This identifier must be unique among `NetworkPeering` resources within the
5058 /// parent and becomes the final token in the name URI.
5059 /// The identifier must meet the following requirements:
5060 ///
5061 /// * Only contains 1-63 alphanumeric characters and hyphens
5062 /// * Begins with an alphabetical character
5063 /// * Ends with a non-hyphen character
5064 /// * Not formatted as a UUID
5065 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
5066 /// (section 3.5)
5067 pub network_peering_id: std::string::String,
5068
5069 /// Required. The initial description of the new network peering.
5070 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5071
5072 /// Optional. A request ID to identify requests. Specify a unique request ID
5073 /// so that if you must retry your request, the server will know to ignore
5074 /// the request if it has already been completed. The server guarantees that a
5075 /// request doesn't result in creation of duplicate commitments for at least 60
5076 /// minutes.
5077 ///
5078 /// For example, consider a situation where you make an initial request and the
5079 /// request times out. If you make the request again with the same request
5080 /// ID, the server can check if original operation with the same request ID
5081 /// was received, and if so, will ignore the second request. This prevents
5082 /// clients from accidentally creating duplicate commitments.
5083 ///
5084 /// The request ID must be a valid UUID with the exception that zero UUID is
5085 /// not supported (00000000-0000-0000-0000-000000000000).
5086 pub request_id: std::string::String,
5087
5088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5089}
5090
5091impl CreateNetworkPeeringRequest {
5092 pub fn new() -> Self {
5093 std::default::Default::default()
5094 }
5095
5096 /// Sets the value of [parent][crate::model::CreateNetworkPeeringRequest::parent].
5097 ///
5098 /// # Example
5099 /// ```ignore,no_run
5100 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5101 /// let x = CreateNetworkPeeringRequest::new().set_parent("example");
5102 /// ```
5103 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5104 self.parent = v.into();
5105 self
5106 }
5107
5108 /// Sets the value of [network_peering_id][crate::model::CreateNetworkPeeringRequest::network_peering_id].
5109 ///
5110 /// # Example
5111 /// ```ignore,no_run
5112 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5113 /// let x = CreateNetworkPeeringRequest::new().set_network_peering_id("example");
5114 /// ```
5115 pub fn set_network_peering_id<T: std::convert::Into<std::string::String>>(
5116 mut self,
5117 v: T,
5118 ) -> Self {
5119 self.network_peering_id = v.into();
5120 self
5121 }
5122
5123 /// Sets the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5128 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5129 /// let x = CreateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5130 /// ```
5131 pub fn set_network_peering<T>(mut self, v: T) -> Self
5132 where
5133 T: std::convert::Into<crate::model::NetworkPeering>,
5134 {
5135 self.network_peering = std::option::Option::Some(v.into());
5136 self
5137 }
5138
5139 /// Sets or clears the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5140 ///
5141 /// # Example
5142 /// ```ignore,no_run
5143 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5144 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5145 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5146 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5147 /// ```
5148 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5149 where
5150 T: std::convert::Into<crate::model::NetworkPeering>,
5151 {
5152 self.network_peering = v.map(|x| x.into());
5153 self
5154 }
5155
5156 /// Sets the value of [request_id][crate::model::CreateNetworkPeeringRequest::request_id].
5157 ///
5158 /// # Example
5159 /// ```ignore,no_run
5160 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5161 /// let x = CreateNetworkPeeringRequest::new().set_request_id("example");
5162 /// ```
5163 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5164 self.request_id = v.into();
5165 self
5166 }
5167}
5168
5169impl wkt::message::Message for CreateNetworkPeeringRequest {
5170 fn typename() -> &'static str {
5171 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest"
5172 }
5173}
5174
5175/// Request message for
5176/// [VmwareEngine.DeleteNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]
5177///
5178/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]: crate::client::VmwareEngine::delete_network_peering
5179#[derive(Clone, Default, PartialEq)]
5180#[non_exhaustive]
5181pub struct DeleteNetworkPeeringRequest {
5182 /// Required. The resource name of the network peering to be deleted.
5183 /// Resource names are schemeless URIs that follow the conventions in
5184 /// <https://cloud.google.com/apis/design/resource_names>.
5185 /// For example:
5186 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5187 pub name: std::string::String,
5188
5189 /// Optional. A request ID to identify requests. Specify a unique request ID
5190 /// so that if you must retry your request, the server will know to ignore
5191 /// the request if it has already been completed. The server guarantees that a
5192 /// request doesn't result in creation of duplicate commitments for at least 60
5193 /// minutes.
5194 ///
5195 /// For example, consider a situation where you make an initial request and the
5196 /// request times out. If you make the request again with the same request
5197 /// ID, the server can check if original operation with the same request ID
5198 /// was received, and if so, will ignore the second request. This prevents
5199 /// clients from accidentally creating duplicate commitments.
5200 ///
5201 /// The request ID must be a valid UUID with the exception that zero UUID is
5202 /// not supported (00000000-0000-0000-0000-000000000000).
5203 pub request_id: std::string::String,
5204
5205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5206}
5207
5208impl DeleteNetworkPeeringRequest {
5209 pub fn new() -> Self {
5210 std::default::Default::default()
5211 }
5212
5213 /// Sets the value of [name][crate::model::DeleteNetworkPeeringRequest::name].
5214 ///
5215 /// # Example
5216 /// ```ignore,no_run
5217 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5218 /// let x = DeleteNetworkPeeringRequest::new().set_name("example");
5219 /// ```
5220 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5221 self.name = v.into();
5222 self
5223 }
5224
5225 /// Sets the value of [request_id][crate::model::DeleteNetworkPeeringRequest::request_id].
5226 ///
5227 /// # Example
5228 /// ```ignore,no_run
5229 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5230 /// let x = DeleteNetworkPeeringRequest::new().set_request_id("example");
5231 /// ```
5232 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5233 self.request_id = v.into();
5234 self
5235 }
5236}
5237
5238impl wkt::message::Message for DeleteNetworkPeeringRequest {
5239 fn typename() -> &'static str {
5240 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest"
5241 }
5242}
5243
5244/// Request message for
5245/// [VmwareEngine.GetNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]
5246///
5247/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]: crate::client::VmwareEngine::get_network_peering
5248#[derive(Clone, Default, PartialEq)]
5249#[non_exhaustive]
5250pub struct GetNetworkPeeringRequest {
5251 /// Required. The resource name of the network peering to retrieve.
5252 /// Resource names are schemeless URIs that follow the conventions in
5253 /// <https://cloud.google.com/apis/design/resource_names>.
5254 /// For example:
5255 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5256 pub name: std::string::String,
5257
5258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5259}
5260
5261impl GetNetworkPeeringRequest {
5262 pub fn new() -> Self {
5263 std::default::Default::default()
5264 }
5265
5266 /// Sets the value of [name][crate::model::GetNetworkPeeringRequest::name].
5267 ///
5268 /// # Example
5269 /// ```ignore,no_run
5270 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPeeringRequest;
5271 /// let x = GetNetworkPeeringRequest::new().set_name("example");
5272 /// ```
5273 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5274 self.name = v.into();
5275 self
5276 }
5277}
5278
5279impl wkt::message::Message for GetNetworkPeeringRequest {
5280 fn typename() -> &'static str {
5281 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPeeringRequest"
5282 }
5283}
5284
5285/// Request message for
5286/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5287///
5288/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5289#[derive(Clone, Default, PartialEq)]
5290#[non_exhaustive]
5291pub struct ListNetworkPeeringsRequest {
5292 /// Required. The resource name of the location (global) to query for
5293 /// network peerings. Resource names are schemeless URIs that follow the
5294 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5295 /// example: `projects/my-project/locations/global`
5296 pub parent: std::string::String,
5297
5298 /// The maximum number of network peerings to return in one page.
5299 /// The maximum value is coerced to 1000.
5300 /// The default value of this field is 500.
5301 pub page_size: i32,
5302
5303 /// A page token, received from a previous `ListNetworkPeerings` call.
5304 /// Provide this to retrieve the subsequent page.
5305 ///
5306 /// When paginating, all other parameters provided to
5307 /// `ListNetworkPeerings` must match the call that provided the page
5308 /// token.
5309 pub page_token: std::string::String,
5310
5311 /// A filter expression that matches resources returned in the response.
5312 /// The expression must specify the field name, a comparison
5313 /// operator, and the value that you want to use for filtering. The value
5314 /// must be a string, a number, or a boolean. The comparison operator
5315 /// must be `=`, `!=`, `>`, or `<`.
5316 ///
5317 /// For example, if you are filtering a list of network peerings, you can
5318 /// exclude the ones named `example-peering` by specifying
5319 /// `name != "example-peering"`.
5320 ///
5321 /// To filter on multiple expressions, provide each separate expression within
5322 /// parentheses. For example:
5323 ///
5324 /// ```norust
5325 /// (name = "example-peering")
5326 /// (createTime > "2021-04-12T08:15:10.40Z")
5327 /// ```
5328 ///
5329 /// By default, each expression is an `AND` expression. However, you
5330 /// can include `AND` and `OR` expressions explicitly.
5331 /// For example:
5332 ///
5333 /// ```norust
5334 /// (name = "example-peering-1") AND
5335 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5336 /// (name = "example-peering-2")
5337 /// ```
5338 pub filter: std::string::String,
5339
5340 /// Sorts list results by a certain order. By default, returned results
5341 /// are ordered by `name` in ascending order.
5342 /// You can also sort results in descending order based on the `name` value
5343 /// using `orderBy="name desc"`.
5344 /// Currently, only ordering by `name` is supported.
5345 pub order_by: std::string::String,
5346
5347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5348}
5349
5350impl ListNetworkPeeringsRequest {
5351 pub fn new() -> Self {
5352 std::default::Default::default()
5353 }
5354
5355 /// Sets the value of [parent][crate::model::ListNetworkPeeringsRequest::parent].
5356 ///
5357 /// # Example
5358 /// ```ignore,no_run
5359 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5360 /// let x = ListNetworkPeeringsRequest::new().set_parent("example");
5361 /// ```
5362 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363 self.parent = v.into();
5364 self
5365 }
5366
5367 /// Sets the value of [page_size][crate::model::ListNetworkPeeringsRequest::page_size].
5368 ///
5369 /// # Example
5370 /// ```ignore,no_run
5371 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5372 /// let x = ListNetworkPeeringsRequest::new().set_page_size(42);
5373 /// ```
5374 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5375 self.page_size = v.into();
5376 self
5377 }
5378
5379 /// Sets the value of [page_token][crate::model::ListNetworkPeeringsRequest::page_token].
5380 ///
5381 /// # Example
5382 /// ```ignore,no_run
5383 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5384 /// let x = ListNetworkPeeringsRequest::new().set_page_token("example");
5385 /// ```
5386 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5387 self.page_token = v.into();
5388 self
5389 }
5390
5391 /// Sets the value of [filter][crate::model::ListNetworkPeeringsRequest::filter].
5392 ///
5393 /// # Example
5394 /// ```ignore,no_run
5395 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5396 /// let x = ListNetworkPeeringsRequest::new().set_filter("example");
5397 /// ```
5398 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5399 self.filter = v.into();
5400 self
5401 }
5402
5403 /// Sets the value of [order_by][crate::model::ListNetworkPeeringsRequest::order_by].
5404 ///
5405 /// # Example
5406 /// ```ignore,no_run
5407 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5408 /// let x = ListNetworkPeeringsRequest::new().set_order_by("example");
5409 /// ```
5410 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5411 self.order_by = v.into();
5412 self
5413 }
5414}
5415
5416impl wkt::message::Message for ListNetworkPeeringsRequest {
5417 fn typename() -> &'static str {
5418 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest"
5419 }
5420}
5421
5422/// Request message for
5423/// [VmwareEngine.UpdateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]
5424///
5425/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]: crate::client::VmwareEngine::update_network_peering
5426#[derive(Clone, Default, PartialEq)]
5427#[non_exhaustive]
5428pub struct UpdateNetworkPeeringRequest {
5429 /// Required. Network peering description.
5430 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5431
5432 /// Required. Field mask is used to specify the fields to be overwritten in the
5433 /// `NetworkPeering` resource by the update.
5434 /// The fields specified in the `update_mask` are relative to the resource, not
5435 /// the full request. A field will be overwritten if it is in the mask. If the
5436 /// user does not provide a mask then all fields will be overwritten.
5437 pub update_mask: std::option::Option<wkt::FieldMask>,
5438
5439 /// Optional. A request ID to identify requests. Specify a unique request ID
5440 /// so that if you must retry your request, the server will know to ignore
5441 /// the request if it has already been completed. The server guarantees that a
5442 /// request doesn't result in creation of duplicate commitments for at least 60
5443 /// minutes.
5444 ///
5445 /// For example, consider a situation where you make an initial request and the
5446 /// request times out. If you make the request again with the same request
5447 /// ID, the server can check if original operation with the same request ID
5448 /// was received, and if so, will ignore the second request. This prevents
5449 /// clients from accidentally creating duplicate commitments.
5450 ///
5451 /// The request ID must be a valid UUID with the exception that zero UUID is
5452 /// not supported (00000000-0000-0000-0000-000000000000).
5453 pub request_id: std::string::String,
5454
5455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5456}
5457
5458impl UpdateNetworkPeeringRequest {
5459 pub fn new() -> Self {
5460 std::default::Default::default()
5461 }
5462
5463 /// Sets the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5464 ///
5465 /// # Example
5466 /// ```ignore,no_run
5467 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5468 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5469 /// let x = UpdateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5470 /// ```
5471 pub fn set_network_peering<T>(mut self, v: T) -> Self
5472 where
5473 T: std::convert::Into<crate::model::NetworkPeering>,
5474 {
5475 self.network_peering = std::option::Option::Some(v.into());
5476 self
5477 }
5478
5479 /// Sets or clears the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5480 ///
5481 /// # Example
5482 /// ```ignore,no_run
5483 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5484 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5485 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5486 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5487 /// ```
5488 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5489 where
5490 T: std::convert::Into<crate::model::NetworkPeering>,
5491 {
5492 self.network_peering = v.map(|x| x.into());
5493 self
5494 }
5495
5496 /// Sets the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5497 ///
5498 /// # Example
5499 /// ```ignore,no_run
5500 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5501 /// use wkt::FieldMask;
5502 /// let x = UpdateNetworkPeeringRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5503 /// ```
5504 pub fn set_update_mask<T>(mut self, v: T) -> Self
5505 where
5506 T: std::convert::Into<wkt::FieldMask>,
5507 {
5508 self.update_mask = std::option::Option::Some(v.into());
5509 self
5510 }
5511
5512 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5513 ///
5514 /// # Example
5515 /// ```ignore,no_run
5516 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5517 /// use wkt::FieldMask;
5518 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5519 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5520 /// ```
5521 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5522 where
5523 T: std::convert::Into<wkt::FieldMask>,
5524 {
5525 self.update_mask = v.map(|x| x.into());
5526 self
5527 }
5528
5529 /// Sets the value of [request_id][crate::model::UpdateNetworkPeeringRequest::request_id].
5530 ///
5531 /// # Example
5532 /// ```ignore,no_run
5533 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5534 /// let x = UpdateNetworkPeeringRequest::new().set_request_id("example");
5535 /// ```
5536 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.request_id = v.into();
5538 self
5539 }
5540}
5541
5542impl wkt::message::Message for UpdateNetworkPeeringRequest {
5543 fn typename() -> &'static str {
5544 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest"
5545 }
5546}
5547
5548/// Response message for
5549/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5550///
5551/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5552#[derive(Clone, Default, PartialEq)]
5553#[non_exhaustive]
5554pub struct ListNetworkPeeringsResponse {
5555 /// A list of network peerings.
5556 pub network_peerings: std::vec::Vec<crate::model::NetworkPeering>,
5557
5558 /// A token, which can be sent as `page_token` to retrieve the next page.
5559 /// If this field is omitted, there are no subsequent pages.
5560 pub next_page_token: std::string::String,
5561
5562 /// Unreachable resources.
5563 pub unreachable: std::vec::Vec<std::string::String>,
5564
5565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5566}
5567
5568impl ListNetworkPeeringsResponse {
5569 pub fn new() -> Self {
5570 std::default::Default::default()
5571 }
5572
5573 /// Sets the value of [network_peerings][crate::model::ListNetworkPeeringsResponse::network_peerings].
5574 ///
5575 /// # Example
5576 /// ```ignore,no_run
5577 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5578 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5579 /// let x = ListNetworkPeeringsResponse::new()
5580 /// .set_network_peerings([
5581 /// NetworkPeering::default()/* use setters */,
5582 /// NetworkPeering::default()/* use (different) setters */,
5583 /// ]);
5584 /// ```
5585 pub fn set_network_peerings<T, V>(mut self, v: T) -> Self
5586 where
5587 T: std::iter::IntoIterator<Item = V>,
5588 V: std::convert::Into<crate::model::NetworkPeering>,
5589 {
5590 use std::iter::Iterator;
5591 self.network_peerings = v.into_iter().map(|i| i.into()).collect();
5592 self
5593 }
5594
5595 /// Sets the value of [next_page_token][crate::model::ListNetworkPeeringsResponse::next_page_token].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5600 /// let x = ListNetworkPeeringsResponse::new().set_next_page_token("example");
5601 /// ```
5602 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.next_page_token = v.into();
5604 self
5605 }
5606
5607 /// Sets the value of [unreachable][crate::model::ListNetworkPeeringsResponse::unreachable].
5608 ///
5609 /// # Example
5610 /// ```ignore,no_run
5611 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5612 /// let x = ListNetworkPeeringsResponse::new().set_unreachable(["a", "b", "c"]);
5613 /// ```
5614 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5615 where
5616 T: std::iter::IntoIterator<Item = V>,
5617 V: std::convert::Into<std::string::String>,
5618 {
5619 use std::iter::Iterator;
5620 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5621 self
5622 }
5623}
5624
5625impl wkt::message::Message for ListNetworkPeeringsResponse {
5626 fn typename() -> &'static str {
5627 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse"
5628 }
5629}
5630
5631#[doc(hidden)]
5632impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPeeringsResponse {
5633 type PageItem = crate::model::NetworkPeering;
5634
5635 fn items(self) -> std::vec::Vec<Self::PageItem> {
5636 self.network_peerings
5637 }
5638
5639 fn next_page_token(&self) -> std::string::String {
5640 use std::clone::Clone;
5641 self.next_page_token.clone()
5642 }
5643}
5644
5645/// Request message for
5646/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5647///
5648/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5649#[derive(Clone, Default, PartialEq)]
5650#[non_exhaustive]
5651pub struct ListPeeringRoutesRequest {
5652 /// Required. The resource name of the network peering to retrieve peering
5653 /// routes from. Resource names are schemeless URIs that follow the conventions
5654 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
5655 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5656 pub parent: std::string::String,
5657
5658 /// The maximum number of peering routes to return in one page.
5659 /// The service may return fewer than this value.
5660 /// The maximum value is coerced to 1000.
5661 /// The default value of this field is 500.
5662 pub page_size: i32,
5663
5664 /// A page token, received from a previous `ListPeeringRoutes` call.
5665 /// Provide this to retrieve the subsequent page.
5666 /// When paginating, all other parameters provided to `ListPeeringRoutes` must
5667 /// match the call that provided the page token.
5668 pub page_token: std::string::String,
5669
5670 /// A filter expression that matches resources returned in the response.
5671 /// Currently, only filtering on the `direction` field is supported. To return
5672 /// routes imported from the peer network, provide "direction=INCOMING". To
5673 /// return routes exported from the VMware Engine network, provide
5674 /// "direction=OUTGOING". Other filter expressions return an error.
5675 pub filter: std::string::String,
5676
5677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5678}
5679
5680impl ListPeeringRoutesRequest {
5681 pub fn new() -> Self {
5682 std::default::Default::default()
5683 }
5684
5685 /// Sets the value of [parent][crate::model::ListPeeringRoutesRequest::parent].
5686 ///
5687 /// # Example
5688 /// ```ignore,no_run
5689 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5690 /// let x = ListPeeringRoutesRequest::new().set_parent("example");
5691 /// ```
5692 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5693 self.parent = v.into();
5694 self
5695 }
5696
5697 /// Sets the value of [page_size][crate::model::ListPeeringRoutesRequest::page_size].
5698 ///
5699 /// # Example
5700 /// ```ignore,no_run
5701 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5702 /// let x = ListPeeringRoutesRequest::new().set_page_size(42);
5703 /// ```
5704 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5705 self.page_size = v.into();
5706 self
5707 }
5708
5709 /// Sets the value of [page_token][crate::model::ListPeeringRoutesRequest::page_token].
5710 ///
5711 /// # Example
5712 /// ```ignore,no_run
5713 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5714 /// let x = ListPeeringRoutesRequest::new().set_page_token("example");
5715 /// ```
5716 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5717 self.page_token = v.into();
5718 self
5719 }
5720
5721 /// Sets the value of [filter][crate::model::ListPeeringRoutesRequest::filter].
5722 ///
5723 /// # Example
5724 /// ```ignore,no_run
5725 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5726 /// let x = ListPeeringRoutesRequest::new().set_filter("example");
5727 /// ```
5728 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5729 self.filter = v.into();
5730 self
5731 }
5732}
5733
5734impl wkt::message::Message for ListPeeringRoutesRequest {
5735 fn typename() -> &'static str {
5736 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesRequest"
5737 }
5738}
5739
5740/// Response message for
5741/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5742///
5743/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5744#[derive(Clone, Default, PartialEq)]
5745#[non_exhaustive]
5746pub struct ListPeeringRoutesResponse {
5747 /// A list of peering routes.
5748 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
5749
5750 /// A token, which can be sent as `page_token` to retrieve the next page.
5751 /// If this field is omitted, there are no subsequent pages.
5752 pub next_page_token: std::string::String,
5753
5754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5755}
5756
5757impl ListPeeringRoutesResponse {
5758 pub fn new() -> Self {
5759 std::default::Default::default()
5760 }
5761
5762 /// Sets the value of [peering_routes][crate::model::ListPeeringRoutesResponse::peering_routes].
5763 ///
5764 /// # Example
5765 /// ```ignore,no_run
5766 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5767 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
5768 /// let x = ListPeeringRoutesResponse::new()
5769 /// .set_peering_routes([
5770 /// PeeringRoute::default()/* use setters */,
5771 /// PeeringRoute::default()/* use (different) setters */,
5772 /// ]);
5773 /// ```
5774 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
5775 where
5776 T: std::iter::IntoIterator<Item = V>,
5777 V: std::convert::Into<crate::model::PeeringRoute>,
5778 {
5779 use std::iter::Iterator;
5780 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
5781 self
5782 }
5783
5784 /// Sets the value of [next_page_token][crate::model::ListPeeringRoutesResponse::next_page_token].
5785 ///
5786 /// # Example
5787 /// ```ignore,no_run
5788 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5789 /// let x = ListPeeringRoutesResponse::new().set_next_page_token("example");
5790 /// ```
5791 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5792 self.next_page_token = v.into();
5793 self
5794 }
5795}
5796
5797impl wkt::message::Message for ListPeeringRoutesResponse {
5798 fn typename() -> &'static str {
5799 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesResponse"
5800 }
5801}
5802
5803#[doc(hidden)]
5804impl google_cloud_gax::paginator::internal::PageableResponse for ListPeeringRoutesResponse {
5805 type PageItem = crate::model::PeeringRoute;
5806
5807 fn items(self) -> std::vec::Vec<Self::PageItem> {
5808 self.peering_routes
5809 }
5810
5811 fn next_page_token(&self) -> std::string::String {
5812 use std::clone::Clone;
5813 self.next_page_token.clone()
5814 }
5815}
5816
5817/// Request message for
5818/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5819///
5820/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5821#[derive(Clone, Default, PartialEq)]
5822#[non_exhaustive]
5823pub struct ListNetworkPoliciesRequest {
5824 /// Required. The resource name of the location (region) to query for
5825 /// network policies. Resource names are schemeless URIs that follow the
5826 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5827 /// example: `projects/my-project/locations/us-central1`
5828 pub parent: std::string::String,
5829
5830 /// The maximum number of network policies to return in one page.
5831 /// The service may return fewer than this value.
5832 /// The maximum value is coerced to 1000.
5833 /// The default value of this field is 500.
5834 pub page_size: i32,
5835
5836 /// A page token, received from a previous `ListNetworkPolicies` call.
5837 /// Provide this to retrieve the subsequent page.
5838 ///
5839 /// When paginating, all other parameters provided to
5840 /// `ListNetworkPolicies` must match the call that provided the page
5841 /// token.
5842 pub page_token: std::string::String,
5843
5844 /// A filter expression that matches resources returned in the response.
5845 /// The expression must specify the field name, a comparison
5846 /// operator, and the value that you want to use for filtering. The value
5847 /// must be a string, a number, or a boolean. The comparison operator
5848 /// must be `=`, `!=`, `>`, or `<`.
5849 ///
5850 /// For example, if you are filtering a list of network policies, you can
5851 /// exclude the ones named `example-policy` by specifying
5852 /// `name != "example-policy"`.
5853 ///
5854 /// To filter on multiple expressions, provide each separate expression within
5855 /// parentheses. For example:
5856 ///
5857 /// ```norust
5858 /// (name = "example-policy")
5859 /// (createTime > "2021-04-12T08:15:10.40Z")
5860 /// ```
5861 ///
5862 /// By default, each expression is an `AND` expression. However, you
5863 /// can include `AND` and `OR` expressions explicitly.
5864 /// For example:
5865 ///
5866 /// ```norust
5867 /// (name = "example-policy-1") AND
5868 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5869 /// (name = "example-policy-2")
5870 /// ```
5871 pub filter: std::string::String,
5872
5873 /// Sorts list results by a certain order. By default, returned results
5874 /// are ordered by `name` in ascending order.
5875 /// You can also sort results in descending order based on the `name` value
5876 /// using `orderBy="name desc"`.
5877 /// Currently, only ordering by `name` is supported.
5878 pub order_by: std::string::String,
5879
5880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5881}
5882
5883impl ListNetworkPoliciesRequest {
5884 pub fn new() -> Self {
5885 std::default::Default::default()
5886 }
5887
5888 /// Sets the value of [parent][crate::model::ListNetworkPoliciesRequest::parent].
5889 ///
5890 /// # Example
5891 /// ```ignore,no_run
5892 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5893 /// let x = ListNetworkPoliciesRequest::new().set_parent("example");
5894 /// ```
5895 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.parent = v.into();
5897 self
5898 }
5899
5900 /// Sets the value of [page_size][crate::model::ListNetworkPoliciesRequest::page_size].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5905 /// let x = ListNetworkPoliciesRequest::new().set_page_size(42);
5906 /// ```
5907 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5908 self.page_size = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [page_token][crate::model::ListNetworkPoliciesRequest::page_token].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5917 /// let x = ListNetworkPoliciesRequest::new().set_page_token("example");
5918 /// ```
5919 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.page_token = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [filter][crate::model::ListNetworkPoliciesRequest::filter].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5929 /// let x = ListNetworkPoliciesRequest::new().set_filter("example");
5930 /// ```
5931 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5932 self.filter = v.into();
5933 self
5934 }
5935
5936 /// Sets the value of [order_by][crate::model::ListNetworkPoliciesRequest::order_by].
5937 ///
5938 /// # Example
5939 /// ```ignore,no_run
5940 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
5941 /// let x = ListNetworkPoliciesRequest::new().set_order_by("example");
5942 /// ```
5943 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5944 self.order_by = v.into();
5945 self
5946 }
5947}
5948
5949impl wkt::message::Message for ListNetworkPoliciesRequest {
5950 fn typename() -> &'static str {
5951 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"
5952 }
5953}
5954
5955/// Response message for
5956/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
5957///
5958/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
5959#[derive(Clone, Default, PartialEq)]
5960#[non_exhaustive]
5961pub struct ListNetworkPoliciesResponse {
5962 /// A list of network policies.
5963 pub network_policies: std::vec::Vec<crate::model::NetworkPolicy>,
5964
5965 /// A token, which can be send as `page_token` to retrieve the next page.
5966 /// If this field is omitted, there are no subsequent pages.
5967 pub next_page_token: std::string::String,
5968
5969 /// Locations that could not be reached when making an aggregated query using
5970 /// wildcards.
5971 pub unreachable: std::vec::Vec<std::string::String>,
5972
5973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5974}
5975
5976impl ListNetworkPoliciesResponse {
5977 pub fn new() -> Self {
5978 std::default::Default::default()
5979 }
5980
5981 /// Sets the value of [network_policies][crate::model::ListNetworkPoliciesResponse::network_policies].
5982 ///
5983 /// # Example
5984 /// ```ignore,no_run
5985 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
5986 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
5987 /// let x = ListNetworkPoliciesResponse::new()
5988 /// .set_network_policies([
5989 /// NetworkPolicy::default()/* use setters */,
5990 /// NetworkPolicy::default()/* use (different) setters */,
5991 /// ]);
5992 /// ```
5993 pub fn set_network_policies<T, V>(mut self, v: T) -> Self
5994 where
5995 T: std::iter::IntoIterator<Item = V>,
5996 V: std::convert::Into<crate::model::NetworkPolicy>,
5997 {
5998 use std::iter::Iterator;
5999 self.network_policies = v.into_iter().map(|i| i.into()).collect();
6000 self
6001 }
6002
6003 /// Sets the value of [next_page_token][crate::model::ListNetworkPoliciesResponse::next_page_token].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6008 /// let x = ListNetworkPoliciesResponse::new().set_next_page_token("example");
6009 /// ```
6010 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6011 self.next_page_token = v.into();
6012 self
6013 }
6014
6015 /// Sets the value of [unreachable][crate::model::ListNetworkPoliciesResponse::unreachable].
6016 ///
6017 /// # Example
6018 /// ```ignore,no_run
6019 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6020 /// let x = ListNetworkPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
6021 /// ```
6022 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6023 where
6024 T: std::iter::IntoIterator<Item = V>,
6025 V: std::convert::Into<std::string::String>,
6026 {
6027 use std::iter::Iterator;
6028 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6029 self
6030 }
6031}
6032
6033impl wkt::message::Message for ListNetworkPoliciesResponse {
6034 fn typename() -> &'static str {
6035 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"
6036 }
6037}
6038
6039#[doc(hidden)]
6040impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPoliciesResponse {
6041 type PageItem = crate::model::NetworkPolicy;
6042
6043 fn items(self) -> std::vec::Vec<Self::PageItem> {
6044 self.network_policies
6045 }
6046
6047 fn next_page_token(&self) -> std::string::String {
6048 use std::clone::Clone;
6049 self.next_page_token.clone()
6050 }
6051}
6052
6053/// Request message for
6054/// [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]
6055///
6056/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]: crate::client::VmwareEngine::get_network_policy
6057#[derive(Clone, Default, PartialEq)]
6058#[non_exhaustive]
6059pub struct GetNetworkPolicyRequest {
6060 /// Required. The resource name of the network policy to retrieve.
6061 /// Resource names are schemeless URIs that follow the conventions in
6062 /// <https://cloud.google.com/apis/design/resource_names>.
6063 /// For example:
6064 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6065 pub name: std::string::String,
6066
6067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6068}
6069
6070impl GetNetworkPolicyRequest {
6071 pub fn new() -> Self {
6072 std::default::Default::default()
6073 }
6074
6075 /// Sets the value of [name][crate::model::GetNetworkPolicyRequest::name].
6076 ///
6077 /// # Example
6078 /// ```ignore,no_run
6079 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPolicyRequest;
6080 /// let x = GetNetworkPolicyRequest::new().set_name("example");
6081 /// ```
6082 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6083 self.name = v.into();
6084 self
6085 }
6086}
6087
6088impl wkt::message::Message for GetNetworkPolicyRequest {
6089 fn typename() -> &'static str {
6090 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"
6091 }
6092}
6093
6094/// Request message for
6095/// [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]
6096///
6097/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]: crate::client::VmwareEngine::update_network_policy
6098#[derive(Clone, Default, PartialEq)]
6099#[non_exhaustive]
6100pub struct UpdateNetworkPolicyRequest {
6101 /// Required. Network policy description.
6102 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6103
6104 /// Required. Field mask is used to specify the fields to be overwritten in the
6105 /// `NetworkPolicy` resource by the update.
6106 /// The fields specified in the `update_mask` are relative to the resource, not
6107 /// the full request. A field will be overwritten if it is in the mask. If the
6108 /// user does not provide a mask then all fields will be overwritten.
6109 pub update_mask: std::option::Option<wkt::FieldMask>,
6110
6111 /// Optional. A request ID to identify requests. Specify a unique request ID
6112 /// so that if you must retry your request, the server will know to ignore
6113 /// the request if it has already been completed. The server guarantees that a
6114 /// request doesn't result in creation of duplicate commitments for at least 60
6115 /// minutes.
6116 ///
6117 /// For example, consider a situation where you make an initial request and the
6118 /// request times out. If you make the request again with the same request
6119 /// ID, the server can check if original operation with the same request ID
6120 /// was received, and if so, will ignore the second request. This prevents
6121 /// clients from accidentally creating duplicate commitments.
6122 ///
6123 /// The request ID must be a valid UUID with the exception that zero UUID is
6124 /// not supported (00000000-0000-0000-0000-000000000000).
6125 pub request_id: std::string::String,
6126
6127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6128}
6129
6130impl UpdateNetworkPolicyRequest {
6131 pub fn new() -> Self {
6132 std::default::Default::default()
6133 }
6134
6135 /// Sets the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6136 ///
6137 /// # Example
6138 /// ```ignore,no_run
6139 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6140 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6141 /// let x = UpdateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6142 /// ```
6143 pub fn set_network_policy<T>(mut self, v: T) -> Self
6144 where
6145 T: std::convert::Into<crate::model::NetworkPolicy>,
6146 {
6147 self.network_policy = std::option::Option::Some(v.into());
6148 self
6149 }
6150
6151 /// Sets or clears the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6152 ///
6153 /// # Example
6154 /// ```ignore,no_run
6155 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6156 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6157 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6158 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6159 /// ```
6160 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6161 where
6162 T: std::convert::Into<crate::model::NetworkPolicy>,
6163 {
6164 self.network_policy = v.map(|x| x.into());
6165 self
6166 }
6167
6168 /// Sets the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6169 ///
6170 /// # Example
6171 /// ```ignore,no_run
6172 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6173 /// use wkt::FieldMask;
6174 /// let x = UpdateNetworkPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6175 /// ```
6176 pub fn set_update_mask<T>(mut self, v: T) -> Self
6177 where
6178 T: std::convert::Into<wkt::FieldMask>,
6179 {
6180 self.update_mask = std::option::Option::Some(v.into());
6181 self
6182 }
6183
6184 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6185 ///
6186 /// # Example
6187 /// ```ignore,no_run
6188 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6189 /// use wkt::FieldMask;
6190 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6191 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6192 /// ```
6193 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6194 where
6195 T: std::convert::Into<wkt::FieldMask>,
6196 {
6197 self.update_mask = v.map(|x| x.into());
6198 self
6199 }
6200
6201 /// Sets the value of [request_id][crate::model::UpdateNetworkPolicyRequest::request_id].
6202 ///
6203 /// # Example
6204 /// ```ignore,no_run
6205 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6206 /// let x = UpdateNetworkPolicyRequest::new().set_request_id("example");
6207 /// ```
6208 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.request_id = v.into();
6210 self
6211 }
6212}
6213
6214impl wkt::message::Message for UpdateNetworkPolicyRequest {
6215 fn typename() -> &'static str {
6216 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"
6217 }
6218}
6219
6220/// Request message for
6221/// [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]
6222///
6223/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]: crate::client::VmwareEngine::create_network_policy
6224#[derive(Clone, Default, PartialEq)]
6225#[non_exhaustive]
6226pub struct CreateNetworkPolicyRequest {
6227 /// Required. The resource name of the location (region)
6228 /// to create the new network policy in.
6229 /// Resource names are schemeless URIs that follow the conventions in
6230 /// <https://cloud.google.com/apis/design/resource_names>.
6231 /// For example:
6232 /// `projects/my-project/locations/us-central1`
6233 pub parent: std::string::String,
6234
6235 /// Required. The user-provided identifier of the network policy to be created.
6236 /// This identifier must be unique within parent
6237 /// `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
6238 /// the final token in the name URI.
6239 /// The identifier must meet the following requirements:
6240 ///
6241 /// * Only contains 1-63 alphanumeric characters and hyphens
6242 /// * Begins with an alphabetical character
6243 /// * Ends with a non-hyphen character
6244 /// * Not formatted as a UUID
6245 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6246 /// (section 3.5)
6247 pub network_policy_id: std::string::String,
6248
6249 /// Required. The network policy configuration to use in the request.
6250 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6251
6252 /// Optional. A request ID to identify requests. Specify a unique request ID
6253 /// so that if you must retry your request, the server will know to ignore
6254 /// the request if it has already been completed. The server guarantees that a
6255 /// request doesn't result in creation of duplicate commitments for at least 60
6256 /// minutes.
6257 ///
6258 /// For example, consider a situation where you make an initial request and the
6259 /// request times out. If you make the request again with the same request
6260 /// ID, the server can check if original operation with the same request ID
6261 /// was received, and if so, will ignore the second request. This prevents
6262 /// clients from accidentally creating duplicate commitments.
6263 ///
6264 /// The request ID must be a valid UUID with the exception that zero UUID is
6265 /// not supported (00000000-0000-0000-0000-000000000000).
6266 pub request_id: std::string::String,
6267
6268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6269}
6270
6271impl CreateNetworkPolicyRequest {
6272 pub fn new() -> Self {
6273 std::default::Default::default()
6274 }
6275
6276 /// Sets the value of [parent][crate::model::CreateNetworkPolicyRequest::parent].
6277 ///
6278 /// # Example
6279 /// ```ignore,no_run
6280 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6281 /// let x = CreateNetworkPolicyRequest::new().set_parent("example");
6282 /// ```
6283 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6284 self.parent = v.into();
6285 self
6286 }
6287
6288 /// Sets the value of [network_policy_id][crate::model::CreateNetworkPolicyRequest::network_policy_id].
6289 ///
6290 /// # Example
6291 /// ```ignore,no_run
6292 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6293 /// let x = CreateNetworkPolicyRequest::new().set_network_policy_id("example");
6294 /// ```
6295 pub fn set_network_policy_id<T: std::convert::Into<std::string::String>>(
6296 mut self,
6297 v: T,
6298 ) -> Self {
6299 self.network_policy_id = v.into();
6300 self
6301 }
6302
6303 /// Sets the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6304 ///
6305 /// # Example
6306 /// ```ignore,no_run
6307 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6308 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6309 /// let x = CreateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6310 /// ```
6311 pub fn set_network_policy<T>(mut self, v: T) -> Self
6312 where
6313 T: std::convert::Into<crate::model::NetworkPolicy>,
6314 {
6315 self.network_policy = std::option::Option::Some(v.into());
6316 self
6317 }
6318
6319 /// Sets or clears the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6320 ///
6321 /// # Example
6322 /// ```ignore,no_run
6323 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6324 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6325 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6326 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6327 /// ```
6328 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6329 where
6330 T: std::convert::Into<crate::model::NetworkPolicy>,
6331 {
6332 self.network_policy = v.map(|x| x.into());
6333 self
6334 }
6335
6336 /// Sets the value of [request_id][crate::model::CreateNetworkPolicyRequest::request_id].
6337 ///
6338 /// # Example
6339 /// ```ignore,no_run
6340 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6341 /// let x = CreateNetworkPolicyRequest::new().set_request_id("example");
6342 /// ```
6343 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6344 self.request_id = v.into();
6345 self
6346 }
6347}
6348
6349impl wkt::message::Message for CreateNetworkPolicyRequest {
6350 fn typename() -> &'static str {
6351 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"
6352 }
6353}
6354
6355/// Request message for
6356/// [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]
6357///
6358/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]: crate::client::VmwareEngine::delete_network_policy
6359#[derive(Clone, Default, PartialEq)]
6360#[non_exhaustive]
6361pub struct DeleteNetworkPolicyRequest {
6362 /// Required. The resource name of the network policy to delete.
6363 /// Resource names are schemeless URIs that follow the conventions in
6364 /// <https://cloud.google.com/apis/design/resource_names>.
6365 /// For example:
6366 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6367 pub name: std::string::String,
6368
6369 /// Optional. A request ID to identify requests. Specify a unique request ID
6370 /// so that if you must retry your request, the server will know to ignore
6371 /// the request if it has already been completed. The server guarantees that a
6372 /// request doesn't result in creation of duplicate commitments for at least 60
6373 /// minutes.
6374 ///
6375 /// For example, consider a situation where you make an initial request and the
6376 /// request times out. If you make the request again with the same request
6377 /// ID, the server can check if original operation with the same request ID
6378 /// was received, and if so, will ignore the second request. This prevents
6379 /// clients from accidentally creating duplicate commitments.
6380 ///
6381 /// The request ID must be a valid UUID with the exception that zero UUID is
6382 /// not supported (00000000-0000-0000-0000-000000000000).
6383 pub request_id: std::string::String,
6384
6385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6386}
6387
6388impl DeleteNetworkPolicyRequest {
6389 pub fn new() -> Self {
6390 std::default::Default::default()
6391 }
6392
6393 /// Sets the value of [name][crate::model::DeleteNetworkPolicyRequest::name].
6394 ///
6395 /// # Example
6396 /// ```ignore,no_run
6397 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6398 /// let x = DeleteNetworkPolicyRequest::new().set_name("example");
6399 /// ```
6400 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6401 self.name = v.into();
6402 self
6403 }
6404
6405 /// Sets the value of [request_id][crate::model::DeleteNetworkPolicyRequest::request_id].
6406 ///
6407 /// # Example
6408 /// ```ignore,no_run
6409 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6410 /// let x = DeleteNetworkPolicyRequest::new().set_request_id("example");
6411 /// ```
6412 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6413 self.request_id = v.into();
6414 self
6415 }
6416}
6417
6418impl wkt::message::Message for DeleteNetworkPolicyRequest {
6419 fn typename() -> &'static str {
6420 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"
6421 }
6422}
6423
6424/// Request message for
6425/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6426///
6427/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6428#[derive(Clone, Default, PartialEq)]
6429#[non_exhaustive]
6430pub struct ListManagementDnsZoneBindingsRequest {
6431 /// Required. The resource name of the private cloud to be queried for
6432 /// management DNS zone bindings.
6433 /// Resource names are schemeless URIs that follow the conventions in
6434 /// <https://cloud.google.com/apis/design/resource_names>.
6435 /// For example:
6436 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6437 pub parent: std::string::String,
6438
6439 /// The maximum number of management DNS zone bindings to return in one page.
6440 /// The service may return fewer than this value.
6441 /// The maximum value is coerced to 1000.
6442 /// The default value of this field is 500.
6443 pub page_size: i32,
6444
6445 /// A page token, received from a previous `ListManagementDnsZoneBindings`
6446 /// call. Provide this to retrieve the subsequent page.
6447 ///
6448 /// When paginating, all other parameters provided to
6449 /// `ListManagementDnsZoneBindings` must match the call that provided the page
6450 /// token.
6451 pub page_token: std::string::String,
6452
6453 /// A filter expression that matches resources returned in the response.
6454 /// The expression must specify the field name, a comparison
6455 /// operator, and the value that you want to use for filtering. The value
6456 /// must be a string, a number, or a boolean. The comparison operator
6457 /// must be `=`, `!=`, `>`, or `<`.
6458 ///
6459 /// For example, if you are filtering a list of Management DNS Zone Bindings,
6460 /// you can exclude the ones named `example-management-dns-zone-binding` by
6461 /// specifying `name != "example-management-dns-zone-binding"`.
6462 ///
6463 /// To filter on multiple expressions, provide each separate expression within
6464 /// parentheses. For example:
6465 ///
6466 /// ```norust
6467 /// (name = "example-management-dns-zone-binding")
6468 /// (createTime > "2021-04-12T08:15:10.40Z")
6469 /// ```
6470 ///
6471 /// By default, each expression is an `AND` expression. However, you
6472 /// can include `AND` and `OR` expressions explicitly.
6473 /// For example:
6474 ///
6475 /// ```norust
6476 /// (name = "example-management-dns-zone-binding-1") AND
6477 /// (createTime > "2021-04-12T08:15:10.40Z") OR
6478 /// (name = "example-management-dns-zone-binding-2")
6479 /// ```
6480 pub filter: std::string::String,
6481
6482 /// Sorts list results by a certain order. By default, returned results
6483 /// are ordered by `name` in ascending order.
6484 /// You can also sort results in descending order based on the `name` value
6485 /// using `orderBy="name desc"`.
6486 /// Currently, only ordering by `name` is supported.
6487 pub order_by: std::string::String,
6488
6489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6490}
6491
6492impl ListManagementDnsZoneBindingsRequest {
6493 pub fn new() -> Self {
6494 std::default::Default::default()
6495 }
6496
6497 /// Sets the value of [parent][crate::model::ListManagementDnsZoneBindingsRequest::parent].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6502 /// let x = ListManagementDnsZoneBindingsRequest::new().set_parent("example");
6503 /// ```
6504 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6505 self.parent = v.into();
6506 self
6507 }
6508
6509 /// Sets the value of [page_size][crate::model::ListManagementDnsZoneBindingsRequest::page_size].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6514 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_size(42);
6515 /// ```
6516 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6517 self.page_size = v.into();
6518 self
6519 }
6520
6521 /// Sets the value of [page_token][crate::model::ListManagementDnsZoneBindingsRequest::page_token].
6522 ///
6523 /// # Example
6524 /// ```ignore,no_run
6525 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6526 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_token("example");
6527 /// ```
6528 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6529 self.page_token = v.into();
6530 self
6531 }
6532
6533 /// Sets the value of [filter][crate::model::ListManagementDnsZoneBindingsRequest::filter].
6534 ///
6535 /// # Example
6536 /// ```ignore,no_run
6537 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6538 /// let x = ListManagementDnsZoneBindingsRequest::new().set_filter("example");
6539 /// ```
6540 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6541 self.filter = v.into();
6542 self
6543 }
6544
6545 /// Sets the value of [order_by][crate::model::ListManagementDnsZoneBindingsRequest::order_by].
6546 ///
6547 /// # Example
6548 /// ```ignore,no_run
6549 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6550 /// let x = ListManagementDnsZoneBindingsRequest::new().set_order_by("example");
6551 /// ```
6552 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6553 self.order_by = v.into();
6554 self
6555 }
6556}
6557
6558impl wkt::message::Message for ListManagementDnsZoneBindingsRequest {
6559 fn typename() -> &'static str {
6560 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest"
6561 }
6562}
6563
6564/// Response message for
6565/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6566///
6567/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6568#[derive(Clone, Default, PartialEq)]
6569#[non_exhaustive]
6570pub struct ListManagementDnsZoneBindingsResponse {
6571 /// A list of management DNS zone bindings.
6572 pub management_dns_zone_bindings: std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
6573
6574 /// A token, which can be sent as `page_token` to retrieve the next page.
6575 /// If this field is omitted, there are no subsequent pages.
6576 pub next_page_token: std::string::String,
6577
6578 /// Locations that could not be reached when making an aggregated query using
6579 /// wildcards.
6580 pub unreachable: std::vec::Vec<std::string::String>,
6581
6582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6583}
6584
6585impl ListManagementDnsZoneBindingsResponse {
6586 pub fn new() -> Self {
6587 std::default::Default::default()
6588 }
6589
6590 /// Sets the value of [management_dns_zone_bindings][crate::model::ListManagementDnsZoneBindingsResponse::management_dns_zone_bindings].
6591 ///
6592 /// # Example
6593 /// ```ignore,no_run
6594 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6595 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6596 /// let x = ListManagementDnsZoneBindingsResponse::new()
6597 /// .set_management_dns_zone_bindings([
6598 /// ManagementDnsZoneBinding::default()/* use setters */,
6599 /// ManagementDnsZoneBinding::default()/* use (different) setters */,
6600 /// ]);
6601 /// ```
6602 pub fn set_management_dns_zone_bindings<T, V>(mut self, v: T) -> Self
6603 where
6604 T: std::iter::IntoIterator<Item = V>,
6605 V: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6606 {
6607 use std::iter::Iterator;
6608 self.management_dns_zone_bindings = v.into_iter().map(|i| i.into()).collect();
6609 self
6610 }
6611
6612 /// Sets the value of [next_page_token][crate::model::ListManagementDnsZoneBindingsResponse::next_page_token].
6613 ///
6614 /// # Example
6615 /// ```ignore,no_run
6616 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6617 /// let x = ListManagementDnsZoneBindingsResponse::new().set_next_page_token("example");
6618 /// ```
6619 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6620 self.next_page_token = v.into();
6621 self
6622 }
6623
6624 /// Sets the value of [unreachable][crate::model::ListManagementDnsZoneBindingsResponse::unreachable].
6625 ///
6626 /// # Example
6627 /// ```ignore,no_run
6628 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6629 /// let x = ListManagementDnsZoneBindingsResponse::new().set_unreachable(["a", "b", "c"]);
6630 /// ```
6631 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6632 where
6633 T: std::iter::IntoIterator<Item = V>,
6634 V: std::convert::Into<std::string::String>,
6635 {
6636 use std::iter::Iterator;
6637 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6638 self
6639 }
6640}
6641
6642impl wkt::message::Message for ListManagementDnsZoneBindingsResponse {
6643 fn typename() -> &'static str {
6644 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse"
6645 }
6646}
6647
6648#[doc(hidden)]
6649impl google_cloud_gax::paginator::internal::PageableResponse
6650 for ListManagementDnsZoneBindingsResponse
6651{
6652 type PageItem = crate::model::ManagementDnsZoneBinding;
6653
6654 fn items(self) -> std::vec::Vec<Self::PageItem> {
6655 self.management_dns_zone_bindings
6656 }
6657
6658 fn next_page_token(&self) -> std::string::String {
6659 use std::clone::Clone;
6660 self.next_page_token.clone()
6661 }
6662}
6663
6664/// Request message for
6665/// [VmwareEngine.GetManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]
6666///
6667/// [google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]: crate::client::VmwareEngine::get_management_dns_zone_binding
6668#[derive(Clone, Default, PartialEq)]
6669#[non_exhaustive]
6670pub struct GetManagementDnsZoneBindingRequest {
6671 /// Required. The resource name of the management DNS zone binding to
6672 /// retrieve. Resource names are schemeless URIs that follow the conventions in
6673 /// <https://cloud.google.com/apis/design/resource_names>.
6674 /// For example:
6675 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6676 pub name: std::string::String,
6677
6678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6679}
6680
6681impl GetManagementDnsZoneBindingRequest {
6682 pub fn new() -> Self {
6683 std::default::Default::default()
6684 }
6685
6686 /// Sets the value of [name][crate::model::GetManagementDnsZoneBindingRequest::name].
6687 ///
6688 /// # Example
6689 /// ```ignore,no_run
6690 /// # use google_cloud_vmwareengine_v1::model::GetManagementDnsZoneBindingRequest;
6691 /// let x = GetManagementDnsZoneBindingRequest::new().set_name("example");
6692 /// ```
6693 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6694 self.name = v.into();
6695 self
6696 }
6697}
6698
6699impl wkt::message::Message for GetManagementDnsZoneBindingRequest {
6700 fn typename() -> &'static str {
6701 "type.googleapis.com/google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest"
6702 }
6703}
6704
6705/// Request message for [VmwareEngine.CreateManagementDnsZoneBindings][]
6706#[derive(Clone, Default, PartialEq)]
6707#[non_exhaustive]
6708pub struct CreateManagementDnsZoneBindingRequest {
6709 /// Required. The resource name of the private cloud
6710 /// to create a new management DNS zone binding for.
6711 /// Resource names are schemeless URIs that follow the conventions in
6712 /// <https://cloud.google.com/apis/design/resource_names>.
6713 /// For example:
6714 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6715 pub parent: std::string::String,
6716
6717 /// Required. The initial values for a new management DNS zone binding.
6718 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6719
6720 /// Required. The user-provided identifier of the `ManagementDnsZoneBinding`
6721 /// resource to be created. This identifier must be unique among
6722 /// `ManagementDnsZoneBinding` resources within the parent and becomes the
6723 /// final token in the name URI. The identifier must meet the following
6724 /// requirements:
6725 ///
6726 /// * Only contains 1-63 alphanumeric characters and hyphens
6727 /// * Begins with an alphabetical character
6728 /// * Ends with a non-hyphen character
6729 /// * Not formatted as a UUID
6730 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6731 /// (section 3.5)
6732 pub management_dns_zone_binding_id: std::string::String,
6733
6734 /// Optional. A request ID to identify requests. Specify a unique request ID
6735 /// so that if you must retry your request, the server will know to ignore
6736 /// the request if it has already been completed. The server guarantees that a
6737 /// request doesn't result in creation of duplicate commitments for at least 60
6738 /// minutes.
6739 ///
6740 /// For example, consider a situation where you make an initial request and the
6741 /// request times out. If you make the request again with the same request ID,
6742 /// the server can check if the original operation with the same request ID was
6743 /// received, and if so, will ignore the second request. This prevents clients
6744 /// from accidentally creating duplicate commitments.
6745 ///
6746 /// The request ID must be a valid UUID with the exception that zero UUID is
6747 /// not supported (00000000-0000-0000-0000-000000000000).
6748 pub request_id: std::string::String,
6749
6750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6751}
6752
6753impl CreateManagementDnsZoneBindingRequest {
6754 pub fn new() -> Self {
6755 std::default::Default::default()
6756 }
6757
6758 /// Sets the value of [parent][crate::model::CreateManagementDnsZoneBindingRequest::parent].
6759 ///
6760 /// # Example
6761 /// ```ignore,no_run
6762 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6763 /// let x = CreateManagementDnsZoneBindingRequest::new().set_parent("example");
6764 /// ```
6765 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6766 self.parent = v.into();
6767 self
6768 }
6769
6770 /// Sets the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6771 ///
6772 /// # Example
6773 /// ```ignore,no_run
6774 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6775 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6776 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6777 /// ```
6778 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6779 where
6780 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6781 {
6782 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6783 self
6784 }
6785
6786 /// Sets or clears the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6787 ///
6788 /// # Example
6789 /// ```ignore,no_run
6790 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6791 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6792 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6793 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6794 /// ```
6795 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6796 where
6797 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6798 {
6799 self.management_dns_zone_binding = v.map(|x| x.into());
6800 self
6801 }
6802
6803 /// Sets the value of [management_dns_zone_binding_id][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding_id].
6804 ///
6805 /// # Example
6806 /// ```ignore,no_run
6807 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6808 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding_id("example");
6809 /// ```
6810 pub fn set_management_dns_zone_binding_id<T: std::convert::Into<std::string::String>>(
6811 mut self,
6812 v: T,
6813 ) -> Self {
6814 self.management_dns_zone_binding_id = v.into();
6815 self
6816 }
6817
6818 /// Sets the value of [request_id][crate::model::CreateManagementDnsZoneBindingRequest::request_id].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6823 /// let x = CreateManagementDnsZoneBindingRequest::new().set_request_id("example");
6824 /// ```
6825 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6826 self.request_id = v.into();
6827 self
6828 }
6829}
6830
6831impl wkt::message::Message for CreateManagementDnsZoneBindingRequest {
6832 fn typename() -> &'static str {
6833 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest"
6834 }
6835}
6836
6837/// Request message for
6838/// [VmwareEngine.UpdateManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]
6839///
6840/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]: crate::client::VmwareEngine::update_management_dns_zone_binding
6841#[derive(Clone, Default, PartialEq)]
6842#[non_exhaustive]
6843pub struct UpdateManagementDnsZoneBindingRequest {
6844 /// Required. Field mask is used to specify the fields to be overwritten in the
6845 /// `ManagementDnsZoneBinding` resource by the update.
6846 /// The fields specified in the `update_mask` are relative to the resource, not
6847 /// the full request. A field will be overwritten if it is in the mask. If the
6848 /// user does not provide a mask then all fields will be overwritten.
6849 pub update_mask: std::option::Option<wkt::FieldMask>,
6850
6851 /// Required. New values to update the management DNS zone binding with.
6852 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6853
6854 /// Optional. A request ID to identify requests. Specify a unique request ID
6855 /// so that if you must retry your request, the server will know to ignore
6856 /// the request if it has already been completed. The server guarantees that a
6857 /// request doesn't result in creation of duplicate commitments for at least 60
6858 /// minutes.
6859 ///
6860 /// For example, consider a situation where you make an initial request and the
6861 /// request times out. If you make the request again with the same request ID,
6862 /// the server can check if the original operation with the same request ID was
6863 /// received, and if so, will ignore the second request. This prevents clients
6864 /// from accidentally creating duplicate commitments.
6865 ///
6866 /// The request ID must be a valid UUID with the exception that zero UUID is
6867 /// not supported (00000000-0000-0000-0000-000000000000).
6868 pub request_id: std::string::String,
6869
6870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6871}
6872
6873impl UpdateManagementDnsZoneBindingRequest {
6874 pub fn new() -> Self {
6875 std::default::Default::default()
6876 }
6877
6878 /// Sets the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6879 ///
6880 /// # Example
6881 /// ```ignore,no_run
6882 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6883 /// use wkt::FieldMask;
6884 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6885 /// ```
6886 pub fn set_update_mask<T>(mut self, v: T) -> Self
6887 where
6888 T: std::convert::Into<wkt::FieldMask>,
6889 {
6890 self.update_mask = std::option::Option::Some(v.into());
6891 self
6892 }
6893
6894 /// Sets or clears the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
6895 ///
6896 /// # Example
6897 /// ```ignore,no_run
6898 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6899 /// use wkt::FieldMask;
6900 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6901 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6902 /// ```
6903 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6904 where
6905 T: std::convert::Into<wkt::FieldMask>,
6906 {
6907 self.update_mask = v.map(|x| x.into());
6908 self
6909 }
6910
6911 /// Sets the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6912 ///
6913 /// # Example
6914 /// ```ignore,no_run
6915 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6916 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6917 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6918 /// ```
6919 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6920 where
6921 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6922 {
6923 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6924 self
6925 }
6926
6927 /// Sets or clears the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6928 ///
6929 /// # Example
6930 /// ```ignore,no_run
6931 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6932 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6933 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
6934 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
6935 /// ```
6936 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
6937 where
6938 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6939 {
6940 self.management_dns_zone_binding = v.map(|x| x.into());
6941 self
6942 }
6943
6944 /// Sets the value of [request_id][crate::model::UpdateManagementDnsZoneBindingRequest::request_id].
6945 ///
6946 /// # Example
6947 /// ```ignore,no_run
6948 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
6949 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_request_id("example");
6950 /// ```
6951 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6952 self.request_id = v.into();
6953 self
6954 }
6955}
6956
6957impl wkt::message::Message for UpdateManagementDnsZoneBindingRequest {
6958 fn typename() -> &'static str {
6959 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest"
6960 }
6961}
6962
6963/// Request message for
6964/// [VmwareEngine.DeleteManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]
6965///
6966/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]: crate::client::VmwareEngine::delete_management_dns_zone_binding
6967#[derive(Clone, Default, PartialEq)]
6968#[non_exhaustive]
6969pub struct DeleteManagementDnsZoneBindingRequest {
6970 /// Required. The resource name of the management DNS zone binding to delete.
6971 /// Resource names are schemeless URIs that follow the conventions in
6972 /// <https://cloud.google.com/apis/design/resource_names>.
6973 /// For example:
6974 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6975 pub name: std::string::String,
6976
6977 /// Optional. A request ID to identify requests. Specify a unique request ID
6978 /// so that if you must retry your request, the server will know to ignore
6979 /// the request if it has already been completed. The server guarantees that a
6980 /// request doesn't result in creation of duplicate commitments for at least 60
6981 /// minutes.
6982 ///
6983 /// For example, consider a situation where you make an initial request and the
6984 /// request times out. If you make the request again with the same request
6985 /// ID, the server can check if the original operation with the same request ID
6986 /// was received, and if so, will ignore the second request. This prevents
6987 /// clients from accidentally creating duplicate commitments.
6988 ///
6989 /// The request ID must be a valid UUID with the exception that zero UUID is
6990 /// not supported (00000000-0000-0000-0000-000000000000).
6991 pub request_id: std::string::String,
6992
6993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6994}
6995
6996impl DeleteManagementDnsZoneBindingRequest {
6997 pub fn new() -> Self {
6998 std::default::Default::default()
6999 }
7000
7001 /// Sets the value of [name][crate::model::DeleteManagementDnsZoneBindingRequest::name].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7006 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_name("example");
7007 /// ```
7008 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7009 self.name = v.into();
7010 self
7011 }
7012
7013 /// Sets the value of [request_id][crate::model::DeleteManagementDnsZoneBindingRequest::request_id].
7014 ///
7015 /// # Example
7016 /// ```ignore,no_run
7017 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7018 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_request_id("example");
7019 /// ```
7020 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7021 self.request_id = v.into();
7022 self
7023 }
7024}
7025
7026impl wkt::message::Message for DeleteManagementDnsZoneBindingRequest {
7027 fn typename() -> &'static str {
7028 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest"
7029 }
7030}
7031
7032/// Request message for [VmwareEngine.RepairManagementDnsZoneBindings][]
7033#[derive(Clone, Default, PartialEq)]
7034#[non_exhaustive]
7035pub struct RepairManagementDnsZoneBindingRequest {
7036 /// Required. The resource name of the management DNS zone binding to repair.
7037 /// Resource names are schemeless URIs that follow the conventions in
7038 /// <https://cloud.google.com/apis/design/resource_names>.
7039 /// For example:
7040 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
7041 pub name: std::string::String,
7042
7043 /// Optional. A request ID to identify requests. Specify a unique request ID
7044 /// so that if you must retry your request, the server will know to ignore
7045 /// the request if it has already been completed. The server guarantees that a
7046 /// request doesn't result in creation of duplicate commitments for at least 60
7047 /// minutes.
7048 ///
7049 /// For example, consider a situation where you make an initial request and the
7050 /// request times out. If you make the request again with the same request ID,
7051 /// the server can check if the original operation with the same request ID was
7052 /// received, and if so, will ignore the second request. This prevents clients
7053 /// from accidentally creating duplicate commitments.
7054 ///
7055 /// The request ID must be a valid UUID with the exception that zero UUID is
7056 /// not supported (00000000-0000-0000-0000-000000000000).
7057 pub request_id: std::string::String,
7058
7059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7060}
7061
7062impl RepairManagementDnsZoneBindingRequest {
7063 pub fn new() -> Self {
7064 std::default::Default::default()
7065 }
7066
7067 /// Sets the value of [name][crate::model::RepairManagementDnsZoneBindingRequest::name].
7068 ///
7069 /// # Example
7070 /// ```ignore,no_run
7071 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7072 /// let x = RepairManagementDnsZoneBindingRequest::new().set_name("example");
7073 /// ```
7074 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7075 self.name = v.into();
7076 self
7077 }
7078
7079 /// Sets the value of [request_id][crate::model::RepairManagementDnsZoneBindingRequest::request_id].
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7084 /// let x = RepairManagementDnsZoneBindingRequest::new().set_request_id("example");
7085 /// ```
7086 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7087 self.request_id = v.into();
7088 self
7089 }
7090}
7091
7092impl wkt::message::Message for RepairManagementDnsZoneBindingRequest {
7093 fn typename() -> &'static str {
7094 "type.googleapis.com/google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest"
7095 }
7096}
7097
7098/// Request message for
7099/// [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]
7100///
7101/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]: crate::client::VmwareEngine::create_vmware_engine_network
7102#[derive(Clone, Default, PartialEq)]
7103#[non_exhaustive]
7104pub struct CreateVmwareEngineNetworkRequest {
7105 /// Required. The resource name of the location to create the new VMware Engine
7106 /// network in. A VMware Engine network of type
7107 /// `LEGACY` is a regional resource, and a VMware
7108 /// Engine network of type `STANDARD` is a global resource.
7109 /// Resource names are schemeless URIs that follow the conventions in
7110 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7111 /// `projects/my-project/locations/global`
7112 pub parent: std::string::String,
7113
7114 /// Required. The user-provided identifier of the new VMware Engine network.
7115 /// This identifier must be unique among VMware Engine network resources
7116 /// within the parent and becomes the final token in the name URI. The
7117 /// identifier must meet the following requirements:
7118 ///
7119 /// * For networks of type LEGACY, adheres to the format:
7120 /// `{region-id}-default`. Replace `{region-id}` with the region where you want
7121 /// to create the VMware Engine network. For example, "us-central1-default".
7122 /// * Only contains 1-63 alphanumeric characters and hyphens
7123 /// * Begins with an alphabetical character
7124 /// * Ends with a non-hyphen character
7125 /// * Not formatted as a UUID
7126 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7127 /// (section 3.5)
7128 pub vmware_engine_network_id: std::string::String,
7129
7130 /// Required. The initial description of the new VMware Engine network.
7131 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7132
7133 /// Optional. A request ID to identify requests. Specify a unique request ID
7134 /// so that if you must retry your request, the server will know to ignore
7135 /// the request if it has already been completed. The server guarantees that a
7136 /// request doesn't result in creation of duplicate commitments for at least 60
7137 /// minutes.
7138 ///
7139 /// For example, consider a situation where you make an initial request and the
7140 /// request times out. If you make the request again with the same request
7141 /// ID, the server can check if original operation with the same request ID
7142 /// was received, and if so, will ignore the second request. This prevents
7143 /// clients from accidentally creating duplicate commitments.
7144 ///
7145 /// The request ID must be a valid UUID with the exception that zero UUID is
7146 /// not supported (00000000-0000-0000-0000-000000000000).
7147 pub request_id: std::string::String,
7148
7149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7150}
7151
7152impl CreateVmwareEngineNetworkRequest {
7153 pub fn new() -> Self {
7154 std::default::Default::default()
7155 }
7156
7157 /// Sets the value of [parent][crate::model::CreateVmwareEngineNetworkRequest::parent].
7158 ///
7159 /// # Example
7160 /// ```ignore,no_run
7161 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7162 /// let x = CreateVmwareEngineNetworkRequest::new().set_parent("example");
7163 /// ```
7164 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7165 self.parent = v.into();
7166 self
7167 }
7168
7169 /// Sets the value of [vmware_engine_network_id][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network_id].
7170 ///
7171 /// # Example
7172 /// ```ignore,no_run
7173 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7174 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network_id("example");
7175 /// ```
7176 pub fn set_vmware_engine_network_id<T: std::convert::Into<std::string::String>>(
7177 mut self,
7178 v: T,
7179 ) -> Self {
7180 self.vmware_engine_network_id = v.into();
7181 self
7182 }
7183
7184 /// Sets the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7185 ///
7186 /// # Example
7187 /// ```ignore,no_run
7188 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7189 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7190 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7191 /// ```
7192 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7193 where
7194 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7195 {
7196 self.vmware_engine_network = std::option::Option::Some(v.into());
7197 self
7198 }
7199
7200 /// Sets or clears the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7201 ///
7202 /// # Example
7203 /// ```ignore,no_run
7204 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7205 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7206 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7207 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7208 /// ```
7209 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7210 where
7211 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7212 {
7213 self.vmware_engine_network = v.map(|x| x.into());
7214 self
7215 }
7216
7217 /// Sets the value of [request_id][crate::model::CreateVmwareEngineNetworkRequest::request_id].
7218 ///
7219 /// # Example
7220 /// ```ignore,no_run
7221 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7222 /// let x = CreateVmwareEngineNetworkRequest::new().set_request_id("example");
7223 /// ```
7224 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7225 self.request_id = v.into();
7226 self
7227 }
7228}
7229
7230impl wkt::message::Message for CreateVmwareEngineNetworkRequest {
7231 fn typename() -> &'static str {
7232 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"
7233 }
7234}
7235
7236/// Request message for
7237/// [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]
7238///
7239/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]: crate::client::VmwareEngine::update_vmware_engine_network
7240#[derive(Clone, Default, PartialEq)]
7241#[non_exhaustive]
7242pub struct UpdateVmwareEngineNetworkRequest {
7243 /// Required. VMware Engine network description.
7244 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7245
7246 /// Required. Field mask is used to specify the fields to be overwritten in the
7247 /// VMware Engine network resource by the update.
7248 /// The fields specified in the `update_mask` are relative to the resource, not
7249 /// the full request. A field will be overwritten if it is in the mask. If the
7250 /// user does not provide a mask then all fields will be overwritten. Only the
7251 /// following fields can be updated: `description`.
7252 pub update_mask: std::option::Option<wkt::FieldMask>,
7253
7254 /// Optional. A request ID to identify requests. Specify a unique request ID
7255 /// so that if you must retry your request, the server will know to ignore
7256 /// the request if it has already been completed. The server guarantees that a
7257 /// request doesn't result in creation of duplicate commitments for at least 60
7258 /// minutes.
7259 ///
7260 /// For example, consider a situation where you make an initial request and the
7261 /// request times out. If you make the request again with the same request
7262 /// ID, the server can check if original operation with the same request ID
7263 /// was received, and if so, will ignore the second request. This prevents
7264 /// clients from accidentally creating duplicate commitments.
7265 ///
7266 /// The request ID must be a valid UUID with the exception that zero UUID is
7267 /// not supported (00000000-0000-0000-0000-000000000000).
7268 pub request_id: std::string::String,
7269
7270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7271}
7272
7273impl UpdateVmwareEngineNetworkRequest {
7274 pub fn new() -> Self {
7275 std::default::Default::default()
7276 }
7277
7278 /// Sets the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7279 ///
7280 /// # Example
7281 /// ```ignore,no_run
7282 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7283 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7284 /// let x = UpdateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7285 /// ```
7286 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7287 where
7288 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7289 {
7290 self.vmware_engine_network = std::option::Option::Some(v.into());
7291 self
7292 }
7293
7294 /// Sets or clears the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7295 ///
7296 /// # Example
7297 /// ```ignore,no_run
7298 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7299 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7300 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7301 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7302 /// ```
7303 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7304 where
7305 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7306 {
7307 self.vmware_engine_network = v.map(|x| x.into());
7308 self
7309 }
7310
7311 /// Sets the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7312 ///
7313 /// # Example
7314 /// ```ignore,no_run
7315 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7316 /// use wkt::FieldMask;
7317 /// let x = UpdateVmwareEngineNetworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7318 /// ```
7319 pub fn set_update_mask<T>(mut self, v: T) -> Self
7320 where
7321 T: std::convert::Into<wkt::FieldMask>,
7322 {
7323 self.update_mask = std::option::Option::Some(v.into());
7324 self
7325 }
7326
7327 /// Sets or clears the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7328 ///
7329 /// # Example
7330 /// ```ignore,no_run
7331 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7332 /// use wkt::FieldMask;
7333 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7334 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7335 /// ```
7336 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7337 where
7338 T: std::convert::Into<wkt::FieldMask>,
7339 {
7340 self.update_mask = v.map(|x| x.into());
7341 self
7342 }
7343
7344 /// Sets the value of [request_id][crate::model::UpdateVmwareEngineNetworkRequest::request_id].
7345 ///
7346 /// # Example
7347 /// ```ignore,no_run
7348 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7349 /// let x = UpdateVmwareEngineNetworkRequest::new().set_request_id("example");
7350 /// ```
7351 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7352 self.request_id = v.into();
7353 self
7354 }
7355}
7356
7357impl wkt::message::Message for UpdateVmwareEngineNetworkRequest {
7358 fn typename() -> &'static str {
7359 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"
7360 }
7361}
7362
7363/// Request message for
7364/// [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]
7365///
7366/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]: crate::client::VmwareEngine::delete_vmware_engine_network
7367#[derive(Clone, Default, PartialEq)]
7368#[non_exhaustive]
7369pub struct DeleteVmwareEngineNetworkRequest {
7370 /// Required. The resource name of the VMware Engine network to be deleted.
7371 /// Resource names are schemeless URIs that follow the conventions in
7372 /// <https://cloud.google.com/apis/design/resource_names>.
7373 /// For example:
7374 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7375 pub name: std::string::String,
7376
7377 /// Optional. A request ID to identify requests. Specify a unique request ID
7378 /// so that if you must retry your request, the server will know to ignore
7379 /// the request if it has already been completed. The server guarantees that a
7380 /// request doesn't result in creation of duplicate commitments for at least 60
7381 /// minutes.
7382 ///
7383 /// For example, consider a situation where you make an initial request and the
7384 /// request times out. If you make the request again with the same request
7385 /// ID, the server can check if original operation with the same request ID
7386 /// was received, and if so, will ignore the second request. This prevents
7387 /// clients from accidentally creating duplicate commitments.
7388 ///
7389 /// The request ID must be a valid UUID with the exception that zero UUID is
7390 /// not supported (00000000-0000-0000-0000-000000000000).
7391 pub request_id: std::string::String,
7392
7393 /// Optional. Checksum used to ensure that the user-provided value is up to
7394 /// date before the server processes the request. The server compares provided
7395 /// checksum with the current checksum of the resource. If the user-provided
7396 /// value is out of date, this request returns an `ABORTED` error.
7397 pub etag: std::string::String,
7398
7399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7400}
7401
7402impl DeleteVmwareEngineNetworkRequest {
7403 pub fn new() -> Self {
7404 std::default::Default::default()
7405 }
7406
7407 /// Sets the value of [name][crate::model::DeleteVmwareEngineNetworkRequest::name].
7408 ///
7409 /// # Example
7410 /// ```ignore,no_run
7411 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7412 /// let x = DeleteVmwareEngineNetworkRequest::new().set_name("example");
7413 /// ```
7414 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7415 self.name = v.into();
7416 self
7417 }
7418
7419 /// Sets the value of [request_id][crate::model::DeleteVmwareEngineNetworkRequest::request_id].
7420 ///
7421 /// # Example
7422 /// ```ignore,no_run
7423 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7424 /// let x = DeleteVmwareEngineNetworkRequest::new().set_request_id("example");
7425 /// ```
7426 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7427 self.request_id = v.into();
7428 self
7429 }
7430
7431 /// Sets the value of [etag][crate::model::DeleteVmwareEngineNetworkRequest::etag].
7432 ///
7433 /// # Example
7434 /// ```ignore,no_run
7435 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7436 /// let x = DeleteVmwareEngineNetworkRequest::new().set_etag("example");
7437 /// ```
7438 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7439 self.etag = v.into();
7440 self
7441 }
7442}
7443
7444impl wkt::message::Message for DeleteVmwareEngineNetworkRequest {
7445 fn typename() -> &'static str {
7446 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"
7447 }
7448}
7449
7450/// Request message for
7451/// [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]
7452///
7453/// [google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]: crate::client::VmwareEngine::get_vmware_engine_network
7454#[derive(Clone, Default, PartialEq)]
7455#[non_exhaustive]
7456pub struct GetVmwareEngineNetworkRequest {
7457 /// Required. The resource name of the VMware Engine network to retrieve.
7458 /// Resource names are schemeless URIs that follow the conventions in
7459 /// <https://cloud.google.com/apis/design/resource_names>.
7460 /// For example:
7461 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7462 pub name: std::string::String,
7463
7464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7465}
7466
7467impl GetVmwareEngineNetworkRequest {
7468 pub fn new() -> Self {
7469 std::default::Default::default()
7470 }
7471
7472 /// Sets the value of [name][crate::model::GetVmwareEngineNetworkRequest::name].
7473 ///
7474 /// # Example
7475 /// ```ignore,no_run
7476 /// # use google_cloud_vmwareengine_v1::model::GetVmwareEngineNetworkRequest;
7477 /// let x = GetVmwareEngineNetworkRequest::new().set_name("example");
7478 /// ```
7479 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7480 self.name = v.into();
7481 self
7482 }
7483}
7484
7485impl wkt::message::Message for GetVmwareEngineNetworkRequest {
7486 fn typename() -> &'static str {
7487 "type.googleapis.com/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"
7488 }
7489}
7490
7491/// Request message for
7492/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7493///
7494/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7495#[derive(Clone, Default, PartialEq)]
7496#[non_exhaustive]
7497pub struct ListVmwareEngineNetworksRequest {
7498 /// Required. The resource name of the location to query for
7499 /// VMware Engine networks. Resource names are schemeless URIs that follow the
7500 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7501 /// example: `projects/my-project/locations/global`
7502 pub parent: std::string::String,
7503
7504 /// The maximum number of results to return in one page.
7505 /// The maximum value is coerced to 1000.
7506 /// The default value of this field is 500.
7507 pub page_size: i32,
7508
7509 /// A page token, received from a previous `ListVmwareEngineNetworks` call.
7510 /// Provide this to retrieve the subsequent page.
7511 ///
7512 /// When paginating, all other parameters provided to
7513 /// `ListVmwareEngineNetworks` must match the call that provided the page
7514 /// token.
7515 pub page_token: std::string::String,
7516
7517 /// A filter expression that matches resources returned in the response.
7518 /// The expression must specify the field name, a comparison
7519 /// operator, and the value that you want to use for filtering. The value
7520 /// must be a string, a number, or a boolean. The comparison operator
7521 /// must be `=`, `!=`, `>`, or `<`.
7522 ///
7523 /// For example, if you are filtering a list of network peerings, you can
7524 /// exclude the ones named `example-network` by specifying
7525 /// `name != "example-network"`.
7526 ///
7527 /// To filter on multiple expressions, provide each separate expression within
7528 /// parentheses. For example:
7529 ///
7530 /// ```norust
7531 /// (name = "example-network")
7532 /// (createTime > "2021-04-12T08:15:10.40Z")
7533 /// ```
7534 ///
7535 /// By default, each expression is an `AND` expression. However, you
7536 /// can include `AND` and `OR` expressions explicitly.
7537 /// For example:
7538 ///
7539 /// ```norust
7540 /// (name = "example-network-1") AND
7541 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7542 /// (name = "example-network-2")
7543 /// ```
7544 pub filter: std::string::String,
7545
7546 /// Sorts list results by a certain order. By default, returned results
7547 /// are ordered by `name` in ascending order.
7548 /// You can also sort results in descending order based on the `name` value
7549 /// using `orderBy="name desc"`.
7550 /// Currently, only ordering by `name` is supported.
7551 pub order_by: std::string::String,
7552
7553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7554}
7555
7556impl ListVmwareEngineNetworksRequest {
7557 pub fn new() -> Self {
7558 std::default::Default::default()
7559 }
7560
7561 /// Sets the value of [parent][crate::model::ListVmwareEngineNetworksRequest::parent].
7562 ///
7563 /// # Example
7564 /// ```ignore,no_run
7565 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7566 /// let x = ListVmwareEngineNetworksRequest::new().set_parent("example");
7567 /// ```
7568 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7569 self.parent = v.into();
7570 self
7571 }
7572
7573 /// Sets the value of [page_size][crate::model::ListVmwareEngineNetworksRequest::page_size].
7574 ///
7575 /// # Example
7576 /// ```ignore,no_run
7577 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7578 /// let x = ListVmwareEngineNetworksRequest::new().set_page_size(42);
7579 /// ```
7580 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7581 self.page_size = v.into();
7582 self
7583 }
7584
7585 /// Sets the value of [page_token][crate::model::ListVmwareEngineNetworksRequest::page_token].
7586 ///
7587 /// # Example
7588 /// ```ignore,no_run
7589 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7590 /// let x = ListVmwareEngineNetworksRequest::new().set_page_token("example");
7591 /// ```
7592 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7593 self.page_token = v.into();
7594 self
7595 }
7596
7597 /// Sets the value of [filter][crate::model::ListVmwareEngineNetworksRequest::filter].
7598 ///
7599 /// # Example
7600 /// ```ignore,no_run
7601 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7602 /// let x = ListVmwareEngineNetworksRequest::new().set_filter("example");
7603 /// ```
7604 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7605 self.filter = v.into();
7606 self
7607 }
7608
7609 /// Sets the value of [order_by][crate::model::ListVmwareEngineNetworksRequest::order_by].
7610 ///
7611 /// # Example
7612 /// ```ignore,no_run
7613 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7614 /// let x = ListVmwareEngineNetworksRequest::new().set_order_by("example");
7615 /// ```
7616 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7617 self.order_by = v.into();
7618 self
7619 }
7620}
7621
7622impl wkt::message::Message for ListVmwareEngineNetworksRequest {
7623 fn typename() -> &'static str {
7624 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"
7625 }
7626}
7627
7628/// Response message for
7629/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7630///
7631/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7632#[derive(Clone, Default, PartialEq)]
7633#[non_exhaustive]
7634pub struct ListVmwareEngineNetworksResponse {
7635 /// A list of VMware Engine networks.
7636 pub vmware_engine_networks: std::vec::Vec<crate::model::VmwareEngineNetwork>,
7637
7638 /// A token, which can be sent as `page_token` to retrieve the next page.
7639 /// If this field is omitted, there are no subsequent pages.
7640 pub next_page_token: std::string::String,
7641
7642 /// Unreachable resources.
7643 pub unreachable: std::vec::Vec<std::string::String>,
7644
7645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7646}
7647
7648impl ListVmwareEngineNetworksResponse {
7649 pub fn new() -> Self {
7650 std::default::Default::default()
7651 }
7652
7653 /// Sets the value of [vmware_engine_networks][crate::model::ListVmwareEngineNetworksResponse::vmware_engine_networks].
7654 ///
7655 /// # Example
7656 /// ```ignore,no_run
7657 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7658 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7659 /// let x = ListVmwareEngineNetworksResponse::new()
7660 /// .set_vmware_engine_networks([
7661 /// VmwareEngineNetwork::default()/* use setters */,
7662 /// VmwareEngineNetwork::default()/* use (different) setters */,
7663 /// ]);
7664 /// ```
7665 pub fn set_vmware_engine_networks<T, V>(mut self, v: T) -> Self
7666 where
7667 T: std::iter::IntoIterator<Item = V>,
7668 V: std::convert::Into<crate::model::VmwareEngineNetwork>,
7669 {
7670 use std::iter::Iterator;
7671 self.vmware_engine_networks = v.into_iter().map(|i| i.into()).collect();
7672 self
7673 }
7674
7675 /// Sets the value of [next_page_token][crate::model::ListVmwareEngineNetworksResponse::next_page_token].
7676 ///
7677 /// # Example
7678 /// ```ignore,no_run
7679 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7680 /// let x = ListVmwareEngineNetworksResponse::new().set_next_page_token("example");
7681 /// ```
7682 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7683 self.next_page_token = v.into();
7684 self
7685 }
7686
7687 /// Sets the value of [unreachable][crate::model::ListVmwareEngineNetworksResponse::unreachable].
7688 ///
7689 /// # Example
7690 /// ```ignore,no_run
7691 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7692 /// let x = ListVmwareEngineNetworksResponse::new().set_unreachable(["a", "b", "c"]);
7693 /// ```
7694 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7695 where
7696 T: std::iter::IntoIterator<Item = V>,
7697 V: std::convert::Into<std::string::String>,
7698 {
7699 use std::iter::Iterator;
7700 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7701 self
7702 }
7703}
7704
7705impl wkt::message::Message for ListVmwareEngineNetworksResponse {
7706 fn typename() -> &'static str {
7707 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"
7708 }
7709}
7710
7711#[doc(hidden)]
7712impl google_cloud_gax::paginator::internal::PageableResponse for ListVmwareEngineNetworksResponse {
7713 type PageItem = crate::model::VmwareEngineNetwork;
7714
7715 fn items(self) -> std::vec::Vec<Self::PageItem> {
7716 self.vmware_engine_networks
7717 }
7718
7719 fn next_page_token(&self) -> std::string::String {
7720 use std::clone::Clone;
7721 self.next_page_token.clone()
7722 }
7723}
7724
7725/// Request message for
7726/// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]
7727///
7728/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]: crate::client::VmwareEngine::create_private_connection
7729#[derive(Clone, Default, PartialEq)]
7730#[non_exhaustive]
7731pub struct CreatePrivateConnectionRequest {
7732 /// Required. The resource name of the location to create the new private
7733 /// connection in. Private connection is a regional resource.
7734 /// Resource names are schemeless URIs that follow the conventions in
7735 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7736 /// `projects/my-project/locations/us-central1`
7737 pub parent: std::string::String,
7738
7739 /// Required. The user-provided identifier of the new private connection.
7740 /// This identifier must be unique among private connection resources
7741 /// within the parent and becomes the final token in the name URI. The
7742 /// identifier must meet the following requirements:
7743 ///
7744 /// * Only contains 1-63 alphanumeric characters and hyphens
7745 /// * Begins with an alphabetical character
7746 /// * Ends with a non-hyphen character
7747 /// * Not formatted as a UUID
7748 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7749 /// (section 3.5)
7750 pub private_connection_id: std::string::String,
7751
7752 /// Required. The initial description of the new private connection.
7753 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
7754
7755 /// Optional. A request ID to identify requests. Specify a unique request ID
7756 /// so that if you must retry your request, the server will know to ignore
7757 /// the request if it has already been completed. The server guarantees that a
7758 /// request doesn't result in creation of duplicate commitments for at least 60
7759 /// minutes.
7760 ///
7761 /// For example, consider a situation where you make an initial request and the
7762 /// request times out. If you make the request again with the same request
7763 /// ID, the server can check if original operation with the same request ID
7764 /// was received, and if so, will ignore the second request. This prevents
7765 /// clients from accidentally creating duplicate commitments.
7766 ///
7767 /// The request ID must be a valid UUID with the exception that zero UUID is
7768 /// not supported (00000000-0000-0000-0000-000000000000).
7769 pub request_id: std::string::String,
7770
7771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7772}
7773
7774impl CreatePrivateConnectionRequest {
7775 pub fn new() -> Self {
7776 std::default::Default::default()
7777 }
7778
7779 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
7780 ///
7781 /// # Example
7782 /// ```ignore,no_run
7783 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7784 /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
7785 /// ```
7786 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7787 self.parent = v.into();
7788 self
7789 }
7790
7791 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
7792 ///
7793 /// # Example
7794 /// ```ignore,no_run
7795 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7796 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
7797 /// ```
7798 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
7799 mut self,
7800 v: T,
7801 ) -> Self {
7802 self.private_connection_id = v.into();
7803 self
7804 }
7805
7806 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7807 ///
7808 /// # Example
7809 /// ```ignore,no_run
7810 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7811 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7812 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
7813 /// ```
7814 pub fn set_private_connection<T>(mut self, v: T) -> Self
7815 where
7816 T: std::convert::Into<crate::model::PrivateConnection>,
7817 {
7818 self.private_connection = std::option::Option::Some(v.into());
7819 self
7820 }
7821
7822 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
7823 ///
7824 /// # Example
7825 /// ```ignore,no_run
7826 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7827 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
7828 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
7829 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
7830 /// ```
7831 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
7832 where
7833 T: std::convert::Into<crate::model::PrivateConnection>,
7834 {
7835 self.private_connection = v.map(|x| x.into());
7836 self
7837 }
7838
7839 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
7840 ///
7841 /// # Example
7842 /// ```ignore,no_run
7843 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
7844 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
7845 /// ```
7846 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7847 self.request_id = v.into();
7848 self
7849 }
7850}
7851
7852impl wkt::message::Message for CreatePrivateConnectionRequest {
7853 fn typename() -> &'static str {
7854 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"
7855 }
7856}
7857
7858/// Request message for
7859/// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]
7860///
7861/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]: crate::client::VmwareEngine::get_private_connection
7862#[derive(Clone, Default, PartialEq)]
7863#[non_exhaustive]
7864pub struct GetPrivateConnectionRequest {
7865 /// Required. The resource name of the private connection to retrieve.
7866 /// Resource names are schemeless URIs that follow the conventions in
7867 /// <https://cloud.google.com/apis/design/resource_names>.
7868 /// For example:
7869 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
7870 pub name: std::string::String,
7871
7872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7873}
7874
7875impl GetPrivateConnectionRequest {
7876 pub fn new() -> Self {
7877 std::default::Default::default()
7878 }
7879
7880 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
7881 ///
7882 /// # Example
7883 /// ```ignore,no_run
7884 /// # use google_cloud_vmwareengine_v1::model::GetPrivateConnectionRequest;
7885 /// let x = GetPrivateConnectionRequest::new().set_name("example");
7886 /// ```
7887 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7888 self.name = v.into();
7889 self
7890 }
7891}
7892
7893impl wkt::message::Message for GetPrivateConnectionRequest {
7894 fn typename() -> &'static str {
7895 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"
7896 }
7897}
7898
7899/// Request message for
7900/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
7901///
7902/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
7903#[derive(Clone, Default, PartialEq)]
7904#[non_exhaustive]
7905pub struct ListPrivateConnectionsRequest {
7906 /// Required. The resource name of the location to query for
7907 /// private connections. Resource names are schemeless URIs that follow the
7908 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7909 /// example: `projects/my-project/locations/us-central1`
7910 pub parent: std::string::String,
7911
7912 /// The maximum number of private connections to return in one page.
7913 /// The maximum value is coerced to 1000.
7914 /// The default value of this field is 500.
7915 pub page_size: i32,
7916
7917 /// A page token, received from a previous `ListPrivateConnections` call.
7918 /// Provide this to retrieve the subsequent page.
7919 ///
7920 /// When paginating, all other parameters provided to
7921 /// `ListPrivateConnections` must match the call that provided the page
7922 /// token.
7923 pub page_token: std::string::String,
7924
7925 /// A filter expression that matches resources returned in the response.
7926 /// The expression must specify the field name, a comparison
7927 /// operator, and the value that you want to use for filtering. The value
7928 /// must be a string, a number, or a boolean. The comparison operator
7929 /// must be `=`, `!=`, `>`, or `<`.
7930 ///
7931 /// For example, if you are filtering a list of private connections, you can
7932 /// exclude the ones named `example-connection` by specifying
7933 /// `name != "example-connection"`.
7934 ///
7935 /// To filter on multiple expressions, provide each separate expression within
7936 /// parentheses. For example:
7937 ///
7938 /// ```norust
7939 /// (name = "example-connection")
7940 /// (createTime > "2022-09-22T08:15:10.40Z")
7941 /// ```
7942 ///
7943 /// By default, each expression is an `AND` expression. However, you
7944 /// can include `AND` and `OR` expressions explicitly.
7945 /// For example:
7946 ///
7947 /// ```norust
7948 /// (name = "example-connection-1") AND
7949 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7950 /// (name = "example-connection-2")
7951 /// ```
7952 pub filter: std::string::String,
7953
7954 /// Sorts list results by a certain order. By default, returned results
7955 /// are ordered by `name` in ascending order.
7956 /// You can also sort results in descending order based on the `name` value
7957 /// using `orderBy="name desc"`.
7958 /// Currently, only ordering by `name` is supported.
7959 pub order_by: std::string::String,
7960
7961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7962}
7963
7964impl ListPrivateConnectionsRequest {
7965 pub fn new() -> Self {
7966 std::default::Default::default()
7967 }
7968
7969 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
7970 ///
7971 /// # Example
7972 /// ```ignore,no_run
7973 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7974 /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
7975 /// ```
7976 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7977 self.parent = v.into();
7978 self
7979 }
7980
7981 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
7982 ///
7983 /// # Example
7984 /// ```ignore,no_run
7985 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7986 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
7987 /// ```
7988 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7989 self.page_size = v.into();
7990 self
7991 }
7992
7993 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
7994 ///
7995 /// # Example
7996 /// ```ignore,no_run
7997 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
7998 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
7999 /// ```
8000 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8001 self.page_token = v.into();
8002 self
8003 }
8004
8005 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
8006 ///
8007 /// # Example
8008 /// ```ignore,no_run
8009 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8010 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
8011 /// ```
8012 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8013 self.filter = v.into();
8014 self
8015 }
8016
8017 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
8018 ///
8019 /// # Example
8020 /// ```ignore,no_run
8021 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8022 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
8023 /// ```
8024 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8025 self.order_by = v.into();
8026 self
8027 }
8028}
8029
8030impl wkt::message::Message for ListPrivateConnectionsRequest {
8031 fn typename() -> &'static str {
8032 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"
8033 }
8034}
8035
8036/// Response message for
8037/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
8038///
8039/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
8040#[derive(Clone, Default, PartialEq)]
8041#[non_exhaustive]
8042pub struct ListPrivateConnectionsResponse {
8043 /// A list of private connections.
8044 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
8045
8046 /// A token, which can be sent as `page_token` to retrieve the next page.
8047 /// If this field is omitted, there are no subsequent pages.
8048 pub next_page_token: std::string::String,
8049
8050 /// Unreachable resources.
8051 pub unreachable: std::vec::Vec<std::string::String>,
8052
8053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8054}
8055
8056impl ListPrivateConnectionsResponse {
8057 pub fn new() -> Self {
8058 std::default::Default::default()
8059 }
8060
8061 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
8062 ///
8063 /// # Example
8064 /// ```ignore,no_run
8065 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8066 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8067 /// let x = ListPrivateConnectionsResponse::new()
8068 /// .set_private_connections([
8069 /// PrivateConnection::default()/* use setters */,
8070 /// PrivateConnection::default()/* use (different) setters */,
8071 /// ]);
8072 /// ```
8073 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
8074 where
8075 T: std::iter::IntoIterator<Item = V>,
8076 V: std::convert::Into<crate::model::PrivateConnection>,
8077 {
8078 use std::iter::Iterator;
8079 self.private_connections = v.into_iter().map(|i| i.into()).collect();
8080 self
8081 }
8082
8083 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
8084 ///
8085 /// # Example
8086 /// ```ignore,no_run
8087 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8088 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
8089 /// ```
8090 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8091 self.next_page_token = v.into();
8092 self
8093 }
8094
8095 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
8096 ///
8097 /// # Example
8098 /// ```ignore,no_run
8099 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8100 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
8101 /// ```
8102 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8103 where
8104 T: std::iter::IntoIterator<Item = V>,
8105 V: std::convert::Into<std::string::String>,
8106 {
8107 use std::iter::Iterator;
8108 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8109 self
8110 }
8111}
8112
8113impl wkt::message::Message for ListPrivateConnectionsResponse {
8114 fn typename() -> &'static str {
8115 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"
8116 }
8117}
8118
8119#[doc(hidden)]
8120impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
8121 type PageItem = crate::model::PrivateConnection;
8122
8123 fn items(self) -> std::vec::Vec<Self::PageItem> {
8124 self.private_connections
8125 }
8126
8127 fn next_page_token(&self) -> std::string::String {
8128 use std::clone::Clone;
8129 self.next_page_token.clone()
8130 }
8131}
8132
8133/// Request message for
8134/// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]
8135///
8136/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]: crate::client::VmwareEngine::update_private_connection
8137#[derive(Clone, Default, PartialEq)]
8138#[non_exhaustive]
8139pub struct UpdatePrivateConnectionRequest {
8140 /// Required. Private connection description.
8141 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
8142
8143 /// Required. Field mask is used to specify the fields to be overwritten in the
8144 /// `PrivateConnection` resource by the update.
8145 /// The fields specified in the `update_mask` are relative to the resource, not
8146 /// the full request. A field will be overwritten if it is in the mask. If the
8147 /// user does not provide a mask then all fields will be overwritten.
8148 pub update_mask: std::option::Option<wkt::FieldMask>,
8149
8150 /// Optional. A request ID to identify requests. Specify a unique request ID
8151 /// so that if you must retry your request, the server will know to ignore
8152 /// the request if it has already been completed. The server guarantees that a
8153 /// request doesn't result in creation of duplicate commitments for at least 60
8154 /// minutes.
8155 ///
8156 /// For example, consider a situation where you make an initial request and the
8157 /// request times out. If you make the request again with the same request
8158 /// ID, the server can check if original operation with the same request ID
8159 /// was received, and if so, will ignore the second request. This prevents
8160 /// clients from accidentally creating duplicate commitments.
8161 ///
8162 /// The request ID must be a valid UUID with the exception that zero UUID is
8163 /// not supported (00000000-0000-0000-0000-000000000000).
8164 pub request_id: std::string::String,
8165
8166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8167}
8168
8169impl UpdatePrivateConnectionRequest {
8170 pub fn new() -> Self {
8171 std::default::Default::default()
8172 }
8173
8174 /// Sets the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8175 ///
8176 /// # Example
8177 /// ```ignore,no_run
8178 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8179 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8180 /// let x = UpdatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
8181 /// ```
8182 pub fn set_private_connection<T>(mut self, v: T) -> Self
8183 where
8184 T: std::convert::Into<crate::model::PrivateConnection>,
8185 {
8186 self.private_connection = std::option::Option::Some(v.into());
8187 self
8188 }
8189
8190 /// Sets or clears the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8191 ///
8192 /// # Example
8193 /// ```ignore,no_run
8194 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8195 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8196 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
8197 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
8198 /// ```
8199 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
8200 where
8201 T: std::convert::Into<crate::model::PrivateConnection>,
8202 {
8203 self.private_connection = v.map(|x| x.into());
8204 self
8205 }
8206
8207 /// Sets the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8208 ///
8209 /// # Example
8210 /// ```ignore,no_run
8211 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8212 /// use wkt::FieldMask;
8213 /// let x = UpdatePrivateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8214 /// ```
8215 pub fn set_update_mask<T>(mut self, v: T) -> Self
8216 where
8217 T: std::convert::Into<wkt::FieldMask>,
8218 {
8219 self.update_mask = std::option::Option::Some(v.into());
8220 self
8221 }
8222
8223 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8224 ///
8225 /// # Example
8226 /// ```ignore,no_run
8227 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8228 /// use wkt::FieldMask;
8229 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8230 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8231 /// ```
8232 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8233 where
8234 T: std::convert::Into<wkt::FieldMask>,
8235 {
8236 self.update_mask = v.map(|x| x.into());
8237 self
8238 }
8239
8240 /// Sets the value of [request_id][crate::model::UpdatePrivateConnectionRequest::request_id].
8241 ///
8242 /// # Example
8243 /// ```ignore,no_run
8244 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8245 /// let x = UpdatePrivateConnectionRequest::new().set_request_id("example");
8246 /// ```
8247 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248 self.request_id = v.into();
8249 self
8250 }
8251}
8252
8253impl wkt::message::Message for UpdatePrivateConnectionRequest {
8254 fn typename() -> &'static str {
8255 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"
8256 }
8257}
8258
8259/// Request message for
8260/// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]
8261///
8262/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]: crate::client::VmwareEngine::delete_private_connection
8263#[derive(Clone, Default, PartialEq)]
8264#[non_exhaustive]
8265pub struct DeletePrivateConnectionRequest {
8266 /// Required. The resource name of the private connection to be deleted.
8267 /// Resource names are schemeless URIs that follow the conventions in
8268 /// <https://cloud.google.com/apis/design/resource_names>.
8269 /// For example:
8270 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
8271 pub name: std::string::String,
8272
8273 /// Optional. A request ID to identify requests. Specify a unique request ID
8274 /// so that if you must retry your request, the server will know to ignore
8275 /// the request if it has already been completed. The server guarantees that a
8276 /// request doesn't result in creation of duplicate commitments for at least 60
8277 /// minutes.
8278 ///
8279 /// For example, consider a situation where you make an initial request and the
8280 /// request times out. If you make the request again with the same request
8281 /// ID, the server can check if original operation with the same request ID
8282 /// was received, and if so, will ignore the second request. This prevents
8283 /// clients from accidentally creating duplicate commitments.
8284 ///
8285 /// The request ID must be a valid UUID with the exception that zero UUID is
8286 /// not supported (00000000-0000-0000-0000-000000000000).
8287 pub request_id: std::string::String,
8288
8289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8290}
8291
8292impl DeletePrivateConnectionRequest {
8293 pub fn new() -> Self {
8294 std::default::Default::default()
8295 }
8296
8297 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
8298 ///
8299 /// # Example
8300 /// ```ignore,no_run
8301 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8302 /// let x = DeletePrivateConnectionRequest::new().set_name("example");
8303 /// ```
8304 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8305 self.name = v.into();
8306 self
8307 }
8308
8309 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
8310 ///
8311 /// # Example
8312 /// ```ignore,no_run
8313 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8314 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
8315 /// ```
8316 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8317 self.request_id = v.into();
8318 self
8319 }
8320}
8321
8322impl wkt::message::Message for DeletePrivateConnectionRequest {
8323 fn typename() -> &'static str {
8324 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"
8325 }
8326}
8327
8328/// Request message for
8329/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8330///
8331/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8332#[derive(Clone, Default, PartialEq)]
8333#[non_exhaustive]
8334pub struct ListPrivateConnectionPeeringRoutesRequest {
8335 /// Required. The resource name of the private connection to retrieve peering
8336 /// routes from. Resource names are schemeless URIs that follow the conventions
8337 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
8338 /// `projects/my-project/locations/us-west1/privateConnections/my-connection`
8339 pub parent: std::string::String,
8340
8341 /// The maximum number of peering routes to return in one page.
8342 /// The service may return fewer than this value.
8343 /// The maximum value is coerced to 1000.
8344 /// The default value of this field is 500.
8345 pub page_size: i32,
8346
8347 /// A page token, received from a previous `ListPrivateConnectionPeeringRoutes`
8348 /// call. Provide this to retrieve the subsequent page. When paginating, all
8349 /// other parameters provided to `ListPrivateConnectionPeeringRoutes` must
8350 /// match the call that provided the page token.
8351 pub page_token: std::string::String,
8352
8353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8354}
8355
8356impl ListPrivateConnectionPeeringRoutesRequest {
8357 pub fn new() -> Self {
8358 std::default::Default::default()
8359 }
8360
8361 /// Sets the value of [parent][crate::model::ListPrivateConnectionPeeringRoutesRequest::parent].
8362 ///
8363 /// # Example
8364 /// ```ignore,no_run
8365 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8366 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_parent("example");
8367 /// ```
8368 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8369 self.parent = v.into();
8370 self
8371 }
8372
8373 /// Sets the value of [page_size][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_size].
8374 ///
8375 /// # Example
8376 /// ```ignore,no_run
8377 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8378 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_size(42);
8379 /// ```
8380 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8381 self.page_size = v.into();
8382 self
8383 }
8384
8385 /// Sets the value of [page_token][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_token].
8386 ///
8387 /// # Example
8388 /// ```ignore,no_run
8389 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8390 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_token("example");
8391 /// ```
8392 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8393 self.page_token = v.into();
8394 self
8395 }
8396}
8397
8398impl wkt::message::Message for ListPrivateConnectionPeeringRoutesRequest {
8399 fn typename() -> &'static str {
8400 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"
8401 }
8402}
8403
8404/// Response message for
8405/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8406///
8407/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8408#[derive(Clone, Default, PartialEq)]
8409#[non_exhaustive]
8410pub struct ListPrivateConnectionPeeringRoutesResponse {
8411 /// A list of peering routes.
8412 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
8413
8414 /// A token, which can be sent as `page_token` to retrieve the next page.
8415 /// If this field is omitted, there are no subsequent pages.
8416 pub next_page_token: std::string::String,
8417
8418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8419}
8420
8421impl ListPrivateConnectionPeeringRoutesResponse {
8422 pub fn new() -> Self {
8423 std::default::Default::default()
8424 }
8425
8426 /// Sets the value of [peering_routes][crate::model::ListPrivateConnectionPeeringRoutesResponse::peering_routes].
8427 ///
8428 /// # Example
8429 /// ```ignore,no_run
8430 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8431 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
8432 /// let x = ListPrivateConnectionPeeringRoutesResponse::new()
8433 /// .set_peering_routes([
8434 /// PeeringRoute::default()/* use setters */,
8435 /// PeeringRoute::default()/* use (different) setters */,
8436 /// ]);
8437 /// ```
8438 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
8439 where
8440 T: std::iter::IntoIterator<Item = V>,
8441 V: std::convert::Into<crate::model::PeeringRoute>,
8442 {
8443 use std::iter::Iterator;
8444 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
8445 self
8446 }
8447
8448 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionPeeringRoutesResponse::next_page_token].
8449 ///
8450 /// # Example
8451 /// ```ignore,no_run
8452 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8453 /// let x = ListPrivateConnectionPeeringRoutesResponse::new().set_next_page_token("example");
8454 /// ```
8455 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8456 self.next_page_token = v.into();
8457 self
8458 }
8459}
8460
8461impl wkt::message::Message for ListPrivateConnectionPeeringRoutesResponse {
8462 fn typename() -> &'static str {
8463 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"
8464 }
8465}
8466
8467#[doc(hidden)]
8468impl google_cloud_gax::paginator::internal::PageableResponse
8469 for ListPrivateConnectionPeeringRoutesResponse
8470{
8471 type PageItem = crate::model::PeeringRoute;
8472
8473 fn items(self) -> std::vec::Vec<Self::PageItem> {
8474 self.peering_routes
8475 }
8476
8477 fn next_page_token(&self) -> std::string::String {
8478 use std::clone::Clone;
8479 self.next_page_token.clone()
8480 }
8481}
8482
8483/// Request message for
8484/// [VmwareEngine.GrantDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]
8485///
8486/// [google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]: crate::client::VmwareEngine::grant_dns_bind_permission
8487#[derive(Clone, Default, PartialEq)]
8488#[non_exhaustive]
8489pub struct GrantDnsBindPermissionRequest {
8490 /// Required. The name of the resource which stores the users/service accounts
8491 /// having the permission to bind to the corresponding intranet VPC of the
8492 /// consumer project. DnsBindPermission is a global resource. Resource names
8493 /// are schemeless URIs that follow the conventions in
8494 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8495 /// `projects/my-project/locations/global/dnsBindPermission`
8496 pub name: std::string::String,
8497
8498 /// Required. The consumer provided user/service account which needs to be
8499 /// granted permission to bind with the intranet VPC corresponding to the
8500 /// consumer project.
8501 pub principal: std::option::Option<crate::model::Principal>,
8502
8503 /// Optional. A request ID to identify requests. Specify a unique request ID
8504 /// so that if you must retry your request, the server will know to ignore
8505 /// the request if it has already been completed. The server guarantees that a
8506 /// request doesn't result in creation of duplicate commitments for at least 60
8507 /// minutes.
8508 ///
8509 /// For example, consider a situation where you make an initial request and the
8510 /// request times out. If you make the request again with the same request
8511 /// ID, the server can check if original operation with the same request ID
8512 /// was received, and if so, will ignore the second request. This prevents
8513 /// clients from accidentally creating duplicate commitments.
8514 ///
8515 /// The request ID must be a valid UUID with the exception that zero UUID is
8516 /// not supported (00000000-0000-0000-0000-000000000000).
8517 pub request_id: std::string::String,
8518
8519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8520}
8521
8522impl GrantDnsBindPermissionRequest {
8523 pub fn new() -> Self {
8524 std::default::Default::default()
8525 }
8526
8527 /// Sets the value of [name][crate::model::GrantDnsBindPermissionRequest::name].
8528 ///
8529 /// # Example
8530 /// ```ignore,no_run
8531 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8532 /// let x = GrantDnsBindPermissionRequest::new().set_name("example");
8533 /// ```
8534 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8535 self.name = v.into();
8536 self
8537 }
8538
8539 /// Sets the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8540 ///
8541 /// # Example
8542 /// ```ignore,no_run
8543 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8544 /// use google_cloud_vmwareengine_v1::model::Principal;
8545 /// let x = GrantDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8546 /// ```
8547 pub fn set_principal<T>(mut self, v: T) -> Self
8548 where
8549 T: std::convert::Into<crate::model::Principal>,
8550 {
8551 self.principal = std::option::Option::Some(v.into());
8552 self
8553 }
8554
8555 /// Sets or clears the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8556 ///
8557 /// # Example
8558 /// ```ignore,no_run
8559 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8560 /// use google_cloud_vmwareengine_v1::model::Principal;
8561 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8562 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8563 /// ```
8564 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8565 where
8566 T: std::convert::Into<crate::model::Principal>,
8567 {
8568 self.principal = v.map(|x| x.into());
8569 self
8570 }
8571
8572 /// Sets the value of [request_id][crate::model::GrantDnsBindPermissionRequest::request_id].
8573 ///
8574 /// # Example
8575 /// ```ignore,no_run
8576 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8577 /// let x = GrantDnsBindPermissionRequest::new().set_request_id("example");
8578 /// ```
8579 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8580 self.request_id = v.into();
8581 self
8582 }
8583}
8584
8585impl wkt::message::Message for GrantDnsBindPermissionRequest {
8586 fn typename() -> &'static str {
8587 "type.googleapis.com/google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest"
8588 }
8589}
8590
8591/// Request message for
8592/// [VmwareEngine.RevokeDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]
8593///
8594/// [google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]: crate::client::VmwareEngine::revoke_dns_bind_permission
8595#[derive(Clone, Default, PartialEq)]
8596#[non_exhaustive]
8597pub struct RevokeDnsBindPermissionRequest {
8598 /// Required. The name of the resource which stores the users/service accounts
8599 /// having the permission to bind to the corresponding intranet VPC of the
8600 /// consumer project. DnsBindPermission is a global resource. Resource names
8601 /// are schemeless URIs that follow the conventions in
8602 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8603 /// `projects/my-project/locations/global/dnsBindPermission`
8604 pub name: std::string::String,
8605
8606 /// Required. The consumer provided user/service account which needs to be
8607 /// granted permission to bind with the intranet VPC corresponding to the
8608 /// consumer project.
8609 pub principal: std::option::Option<crate::model::Principal>,
8610
8611 /// Optional. A request ID to identify requests. Specify a unique request ID
8612 /// so that if you must retry your request, the server will know to ignore
8613 /// the request if it has already been completed. The server guarantees that a
8614 /// request doesn't result in creation of duplicate commitments for at least 60
8615 /// minutes.
8616 ///
8617 /// For example, consider a situation where you make an initial request and the
8618 /// request times out. If you make the request again with the same request
8619 /// ID, the server can check if original operation with the same request ID
8620 /// was received, and if so, will ignore the second request. This prevents
8621 /// clients from accidentally creating duplicate commitments.
8622 ///
8623 /// The request ID must be a valid UUID with the exception that zero UUID is
8624 /// not supported (00000000-0000-0000-0000-000000000000).
8625 pub request_id: std::string::String,
8626
8627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8628}
8629
8630impl RevokeDnsBindPermissionRequest {
8631 pub fn new() -> Self {
8632 std::default::Default::default()
8633 }
8634
8635 /// Sets the value of [name][crate::model::RevokeDnsBindPermissionRequest::name].
8636 ///
8637 /// # Example
8638 /// ```ignore,no_run
8639 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8640 /// let x = RevokeDnsBindPermissionRequest::new().set_name("example");
8641 /// ```
8642 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8643 self.name = v.into();
8644 self
8645 }
8646
8647 /// Sets the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8648 ///
8649 /// # Example
8650 /// ```ignore,no_run
8651 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8652 /// use google_cloud_vmwareengine_v1::model::Principal;
8653 /// let x = RevokeDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8654 /// ```
8655 pub fn set_principal<T>(mut self, v: T) -> Self
8656 where
8657 T: std::convert::Into<crate::model::Principal>,
8658 {
8659 self.principal = std::option::Option::Some(v.into());
8660 self
8661 }
8662
8663 /// Sets or clears the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8664 ///
8665 /// # Example
8666 /// ```ignore,no_run
8667 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8668 /// use google_cloud_vmwareengine_v1::model::Principal;
8669 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8670 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8671 /// ```
8672 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8673 where
8674 T: std::convert::Into<crate::model::Principal>,
8675 {
8676 self.principal = v.map(|x| x.into());
8677 self
8678 }
8679
8680 /// Sets the value of [request_id][crate::model::RevokeDnsBindPermissionRequest::request_id].
8681 ///
8682 /// # Example
8683 /// ```ignore,no_run
8684 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8685 /// let x = RevokeDnsBindPermissionRequest::new().set_request_id("example");
8686 /// ```
8687 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8688 self.request_id = v.into();
8689 self
8690 }
8691}
8692
8693impl wkt::message::Message for RevokeDnsBindPermissionRequest {
8694 fn typename() -> &'static str {
8695 "type.googleapis.com/google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest"
8696 }
8697}
8698
8699/// Request message for
8700/// [VmwareEngine.GetDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]
8701///
8702/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]: crate::client::VmwareEngine::get_dns_bind_permission
8703#[derive(Clone, Default, PartialEq)]
8704#[non_exhaustive]
8705pub struct GetDnsBindPermissionRequest {
8706 /// Required. The name of the resource which stores the users/service accounts
8707 /// having the permission to bind to the corresponding intranet VPC of the
8708 /// consumer project. DnsBindPermission is a global resource. Resource names
8709 /// are schemeless URIs that follow the conventions in
8710 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8711 /// `projects/my-project/locations/global/dnsBindPermission`
8712 pub name: std::string::String,
8713
8714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8715}
8716
8717impl GetDnsBindPermissionRequest {
8718 pub fn new() -> Self {
8719 std::default::Default::default()
8720 }
8721
8722 /// Sets the value of [name][crate::model::GetDnsBindPermissionRequest::name].
8723 ///
8724 /// # Example
8725 /// ```ignore,no_run
8726 /// # use google_cloud_vmwareengine_v1::model::GetDnsBindPermissionRequest;
8727 /// let x = GetDnsBindPermissionRequest::new().set_name("example");
8728 /// ```
8729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8730 self.name = v.into();
8731 self
8732 }
8733}
8734
8735impl wkt::message::Message for GetDnsBindPermissionRequest {
8736 fn typename() -> &'static str {
8737 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest"
8738 }
8739}
8740
8741/// Network configuration in the consumer project
8742/// with which the peering has to be done.
8743#[derive(Clone, Default, PartialEq)]
8744#[non_exhaustive]
8745pub struct NetworkConfig {
8746 /// Required. Management CIDR used by VMware management appliances.
8747 pub management_cidr: std::string::String,
8748
8749 /// Optional. The relative resource name of the VMware Engine network attached
8750 /// to the private cloud. Specify the name in the following form:
8751 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8752 /// where `{project}` can either be a project number or a project ID.
8753 pub vmware_engine_network: std::string::String,
8754
8755 /// Output only. The canonical name of the VMware Engine network in the form:
8756 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
8757 pub vmware_engine_network_canonical: std::string::String,
8758
8759 /// Output only. The IP address layout version of the management IP address
8760 /// range. Possible versions include:
8761 ///
8762 /// * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address
8763 /// layout used by some existing private clouds. This is no longer supported
8764 /// for new private clouds as it does not support all features.
8765 /// * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address
8766 /// layout used by all newly created private clouds. This version supports all
8767 /// current features.
8768 pub management_ip_address_layout_version: i32,
8769
8770 /// Output only. DNS Server IP of the Private Cloud.
8771 /// All DNS queries can be forwarded to this address for name resolution of
8772 /// Private Cloud's management entities like vCenter, NSX-T Manager and
8773 /// ESXi hosts.
8774 pub dns_server_ip: std::string::String,
8775
8776 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8777}
8778
8779impl NetworkConfig {
8780 pub fn new() -> Self {
8781 std::default::Default::default()
8782 }
8783
8784 /// Sets the value of [management_cidr][crate::model::NetworkConfig::management_cidr].
8785 ///
8786 /// # Example
8787 /// ```ignore,no_run
8788 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8789 /// let x = NetworkConfig::new().set_management_cidr("example");
8790 /// ```
8791 pub fn set_management_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8792 self.management_cidr = v.into();
8793 self
8794 }
8795
8796 /// Sets the value of [vmware_engine_network][crate::model::NetworkConfig::vmware_engine_network].
8797 ///
8798 /// # Example
8799 /// ```ignore,no_run
8800 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8801 /// let x = NetworkConfig::new().set_vmware_engine_network("example");
8802 /// ```
8803 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
8804 mut self,
8805 v: T,
8806 ) -> Self {
8807 self.vmware_engine_network = v.into();
8808 self
8809 }
8810
8811 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkConfig::vmware_engine_network_canonical].
8812 ///
8813 /// # Example
8814 /// ```ignore,no_run
8815 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8816 /// let x = NetworkConfig::new().set_vmware_engine_network_canonical("example");
8817 /// ```
8818 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
8819 mut self,
8820 v: T,
8821 ) -> Self {
8822 self.vmware_engine_network_canonical = v.into();
8823 self
8824 }
8825
8826 /// Sets the value of [management_ip_address_layout_version][crate::model::NetworkConfig::management_ip_address_layout_version].
8827 ///
8828 /// # Example
8829 /// ```ignore,no_run
8830 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8831 /// let x = NetworkConfig::new().set_management_ip_address_layout_version(42);
8832 /// ```
8833 pub fn set_management_ip_address_layout_version<T: std::convert::Into<i32>>(
8834 mut self,
8835 v: T,
8836 ) -> Self {
8837 self.management_ip_address_layout_version = v.into();
8838 self
8839 }
8840
8841 /// Sets the value of [dns_server_ip][crate::model::NetworkConfig::dns_server_ip].
8842 ///
8843 /// # Example
8844 /// ```ignore,no_run
8845 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
8846 /// let x = NetworkConfig::new().set_dns_server_ip("example");
8847 /// ```
8848 pub fn set_dns_server_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8849 self.dns_server_ip = v.into();
8850 self
8851 }
8852}
8853
8854impl wkt::message::Message for NetworkConfig {
8855 fn typename() -> &'static str {
8856 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkConfig"
8857 }
8858}
8859
8860/// Information about the type and number of nodes associated with the cluster.
8861#[derive(Clone, Default, PartialEq)]
8862#[non_exhaustive]
8863pub struct NodeTypeConfig {
8864 /// Required. The number of nodes of this type in the cluster
8865 pub node_count: i32,
8866
8867 /// Optional. Customized number of cores available to each node of the type.
8868 /// This number must always be one of `nodeType.availableCustomCoreCounts`.
8869 /// If zero is provided max value from `nodeType.availableCustomCoreCounts`
8870 /// will be used.
8871 pub custom_core_count: i32,
8872
8873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8874}
8875
8876impl NodeTypeConfig {
8877 pub fn new() -> Self {
8878 std::default::Default::default()
8879 }
8880
8881 /// Sets the value of [node_count][crate::model::NodeTypeConfig::node_count].
8882 ///
8883 /// # Example
8884 /// ```ignore,no_run
8885 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8886 /// let x = NodeTypeConfig::new().set_node_count(42);
8887 /// ```
8888 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8889 self.node_count = v.into();
8890 self
8891 }
8892
8893 /// Sets the value of [custom_core_count][crate::model::NodeTypeConfig::custom_core_count].
8894 ///
8895 /// # Example
8896 /// ```ignore,no_run
8897 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
8898 /// let x = NodeTypeConfig::new().set_custom_core_count(42);
8899 /// ```
8900 pub fn set_custom_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8901 self.custom_core_count = v.into();
8902 self
8903 }
8904}
8905
8906impl wkt::message::Message for NodeTypeConfig {
8907 fn typename() -> &'static str {
8908 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeTypeConfig"
8909 }
8910}
8911
8912/// Configuration of a stretched cluster.
8913#[derive(Clone, Default, PartialEq)]
8914#[non_exhaustive]
8915pub struct StretchedClusterConfig {
8916 /// Required. Zone that will remain operational when connection between the two
8917 /// zones is lost. Specify the resource name of a zone that belongs to the
8918 /// region of the private cloud. For example:
8919 /// `projects/{project}/locations/europe-west3-a` where `{project}` can either
8920 /// be a project number or a project ID.
8921 pub preferred_location: std::string::String,
8922
8923 /// Required. Additional zone for a higher level of availability and load
8924 /// balancing. Specify the resource name of a zone that belongs to the region
8925 /// of the private cloud. For example:
8926 /// `projects/{project}/locations/europe-west3-b` where `{project}` can either
8927 /// be a project number or a project ID.
8928 pub secondary_location: std::string::String,
8929
8930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8931}
8932
8933impl StretchedClusterConfig {
8934 pub fn new() -> Self {
8935 std::default::Default::default()
8936 }
8937
8938 /// Sets the value of [preferred_location][crate::model::StretchedClusterConfig::preferred_location].
8939 ///
8940 /// # Example
8941 /// ```ignore,no_run
8942 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8943 /// let x = StretchedClusterConfig::new().set_preferred_location("example");
8944 /// ```
8945 pub fn set_preferred_location<T: std::convert::Into<std::string::String>>(
8946 mut self,
8947 v: T,
8948 ) -> Self {
8949 self.preferred_location = v.into();
8950 self
8951 }
8952
8953 /// Sets the value of [secondary_location][crate::model::StretchedClusterConfig::secondary_location].
8954 ///
8955 /// # Example
8956 /// ```ignore,no_run
8957 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
8958 /// let x = StretchedClusterConfig::new().set_secondary_location("example");
8959 /// ```
8960 pub fn set_secondary_location<T: std::convert::Into<std::string::String>>(
8961 mut self,
8962 v: T,
8963 ) -> Self {
8964 self.secondary_location = v.into();
8965 self
8966 }
8967}
8968
8969impl wkt::message::Message for StretchedClusterConfig {
8970 fn typename() -> &'static str {
8971 "type.googleapis.com/google.cloud.vmwareengine.v1.StretchedClusterConfig"
8972 }
8973}
8974
8975/// Represents a private cloud resource. Private clouds of type `STANDARD` and
8976/// `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are
8977/// regional.
8978#[derive(Clone, Default, PartialEq)]
8979#[non_exhaustive]
8980pub struct PrivateCloud {
8981 /// Output only. The resource name of this private cloud.
8982 /// Resource names are schemeless URIs that follow the conventions in
8983 /// <https://cloud.google.com/apis/design/resource_names>.
8984 /// For example:
8985 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
8986 pub name: std::string::String,
8987
8988 /// Output only. Creation time of this resource.
8989 pub create_time: std::option::Option<wkt::Timestamp>,
8990
8991 /// Output only. Last update time of this resource.
8992 pub update_time: std::option::Option<wkt::Timestamp>,
8993
8994 /// Output only. Time when the resource was scheduled for deletion.
8995 pub delete_time: std::option::Option<wkt::Timestamp>,
8996
8997 /// Output only. Time when the resource will be irreversibly deleted.
8998 pub expire_time: std::option::Option<wkt::Timestamp>,
8999
9000 /// Output only. State of the resource. New values may be added to this enum
9001 /// when appropriate.
9002 pub state: crate::model::private_cloud::State,
9003
9004 /// Required. Network configuration of the private cloud.
9005 pub network_config: std::option::Option<crate::model::NetworkConfig>,
9006
9007 /// Required. Input only. The management cluster for this private cloud.
9008 /// This field is required during creation of the private cloud to provide
9009 /// details for the default cluster.
9010 ///
9011 /// The following fields can't be changed after private cloud creation:
9012 /// `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.
9013 pub management_cluster: std::option::Option<crate::model::private_cloud::ManagementCluster>,
9014
9015 /// User-provided description for this private cloud.
9016 pub description: std::string::String,
9017
9018 /// Output only. HCX appliance.
9019 pub hcx: std::option::Option<crate::model::Hcx>,
9020
9021 /// Output only. NSX appliance.
9022 pub nsx: std::option::Option<crate::model::Nsx>,
9023
9024 /// Output only. Vcenter appliance.
9025 pub vcenter: std::option::Option<crate::model::Vcenter>,
9026
9027 /// Output only. System-generated unique identifier for the resource.
9028 pub uid: std::string::String,
9029
9030 /// Optional. Type of the private cloud. Defaults to STANDARD.
9031 pub r#type: crate::model::private_cloud::Type,
9032
9033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9034}
9035
9036impl PrivateCloud {
9037 pub fn new() -> Self {
9038 std::default::Default::default()
9039 }
9040
9041 /// Sets the value of [name][crate::model::PrivateCloud::name].
9042 ///
9043 /// # Example
9044 /// ```ignore,no_run
9045 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9046 /// let x = PrivateCloud::new().set_name("example");
9047 /// ```
9048 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9049 self.name = v.into();
9050 self
9051 }
9052
9053 /// Sets the value of [create_time][crate::model::PrivateCloud::create_time].
9054 ///
9055 /// # Example
9056 /// ```ignore,no_run
9057 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9058 /// use wkt::Timestamp;
9059 /// let x = PrivateCloud::new().set_create_time(Timestamp::default()/* use setters */);
9060 /// ```
9061 pub fn set_create_time<T>(mut self, v: T) -> Self
9062 where
9063 T: std::convert::Into<wkt::Timestamp>,
9064 {
9065 self.create_time = std::option::Option::Some(v.into());
9066 self
9067 }
9068
9069 /// Sets or clears the value of [create_time][crate::model::PrivateCloud::create_time].
9070 ///
9071 /// # Example
9072 /// ```ignore,no_run
9073 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9074 /// use wkt::Timestamp;
9075 /// let x = PrivateCloud::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9076 /// let x = PrivateCloud::new().set_or_clear_create_time(None::<Timestamp>);
9077 /// ```
9078 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9079 where
9080 T: std::convert::Into<wkt::Timestamp>,
9081 {
9082 self.create_time = v.map(|x| x.into());
9083 self
9084 }
9085
9086 /// Sets the value of [update_time][crate::model::PrivateCloud::update_time].
9087 ///
9088 /// # Example
9089 /// ```ignore,no_run
9090 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9091 /// use wkt::Timestamp;
9092 /// let x = PrivateCloud::new().set_update_time(Timestamp::default()/* use setters */);
9093 /// ```
9094 pub fn set_update_time<T>(mut self, v: T) -> Self
9095 where
9096 T: std::convert::Into<wkt::Timestamp>,
9097 {
9098 self.update_time = std::option::Option::Some(v.into());
9099 self
9100 }
9101
9102 /// Sets or clears the value of [update_time][crate::model::PrivateCloud::update_time].
9103 ///
9104 /// # Example
9105 /// ```ignore,no_run
9106 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9107 /// use wkt::Timestamp;
9108 /// let x = PrivateCloud::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9109 /// let x = PrivateCloud::new().set_or_clear_update_time(None::<Timestamp>);
9110 /// ```
9111 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9112 where
9113 T: std::convert::Into<wkt::Timestamp>,
9114 {
9115 self.update_time = v.map(|x| x.into());
9116 self
9117 }
9118
9119 /// Sets the value of [delete_time][crate::model::PrivateCloud::delete_time].
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9124 /// use wkt::Timestamp;
9125 /// let x = PrivateCloud::new().set_delete_time(Timestamp::default()/* use setters */);
9126 /// ```
9127 pub fn set_delete_time<T>(mut self, v: T) -> Self
9128 where
9129 T: std::convert::Into<wkt::Timestamp>,
9130 {
9131 self.delete_time = std::option::Option::Some(v.into());
9132 self
9133 }
9134
9135 /// Sets or clears the value of [delete_time][crate::model::PrivateCloud::delete_time].
9136 ///
9137 /// # Example
9138 /// ```ignore,no_run
9139 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9140 /// use wkt::Timestamp;
9141 /// let x = PrivateCloud::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
9142 /// let x = PrivateCloud::new().set_or_clear_delete_time(None::<Timestamp>);
9143 /// ```
9144 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9145 where
9146 T: std::convert::Into<wkt::Timestamp>,
9147 {
9148 self.delete_time = v.map(|x| x.into());
9149 self
9150 }
9151
9152 /// Sets the value of [expire_time][crate::model::PrivateCloud::expire_time].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9157 /// use wkt::Timestamp;
9158 /// let x = PrivateCloud::new().set_expire_time(Timestamp::default()/* use setters */);
9159 /// ```
9160 pub fn set_expire_time<T>(mut self, v: T) -> Self
9161 where
9162 T: std::convert::Into<wkt::Timestamp>,
9163 {
9164 self.expire_time = std::option::Option::Some(v.into());
9165 self
9166 }
9167
9168 /// Sets or clears the value of [expire_time][crate::model::PrivateCloud::expire_time].
9169 ///
9170 /// # Example
9171 /// ```ignore,no_run
9172 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9173 /// use wkt::Timestamp;
9174 /// let x = PrivateCloud::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
9175 /// let x = PrivateCloud::new().set_or_clear_expire_time(None::<Timestamp>);
9176 /// ```
9177 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9178 where
9179 T: std::convert::Into<wkt::Timestamp>,
9180 {
9181 self.expire_time = v.map(|x| x.into());
9182 self
9183 }
9184
9185 /// Sets the value of [state][crate::model::PrivateCloud::state].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9190 /// use google_cloud_vmwareengine_v1::model::private_cloud::State;
9191 /// let x0 = PrivateCloud::new().set_state(State::Active);
9192 /// let x1 = PrivateCloud::new().set_state(State::Creating);
9193 /// let x2 = PrivateCloud::new().set_state(State::Updating);
9194 /// ```
9195 pub fn set_state<T: std::convert::Into<crate::model::private_cloud::State>>(
9196 mut self,
9197 v: T,
9198 ) -> Self {
9199 self.state = v.into();
9200 self
9201 }
9202
9203 /// Sets the value of [network_config][crate::model::PrivateCloud::network_config].
9204 ///
9205 /// # Example
9206 /// ```ignore,no_run
9207 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9208 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9209 /// let x = PrivateCloud::new().set_network_config(NetworkConfig::default()/* use setters */);
9210 /// ```
9211 pub fn set_network_config<T>(mut self, v: T) -> Self
9212 where
9213 T: std::convert::Into<crate::model::NetworkConfig>,
9214 {
9215 self.network_config = std::option::Option::Some(v.into());
9216 self
9217 }
9218
9219 /// Sets or clears the value of [network_config][crate::model::PrivateCloud::network_config].
9220 ///
9221 /// # Example
9222 /// ```ignore,no_run
9223 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9224 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9225 /// let x = PrivateCloud::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
9226 /// let x = PrivateCloud::new().set_or_clear_network_config(None::<NetworkConfig>);
9227 /// ```
9228 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
9229 where
9230 T: std::convert::Into<crate::model::NetworkConfig>,
9231 {
9232 self.network_config = v.map(|x| x.into());
9233 self
9234 }
9235
9236 /// Sets the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9237 ///
9238 /// # Example
9239 /// ```ignore,no_run
9240 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9241 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9242 /// let x = PrivateCloud::new().set_management_cluster(ManagementCluster::default()/* use setters */);
9243 /// ```
9244 pub fn set_management_cluster<T>(mut self, v: T) -> Self
9245 where
9246 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9247 {
9248 self.management_cluster = std::option::Option::Some(v.into());
9249 self
9250 }
9251
9252 /// Sets or clears the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9253 ///
9254 /// # Example
9255 /// ```ignore,no_run
9256 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9257 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9258 /// let x = PrivateCloud::new().set_or_clear_management_cluster(Some(ManagementCluster::default()/* use setters */));
9259 /// let x = PrivateCloud::new().set_or_clear_management_cluster(None::<ManagementCluster>);
9260 /// ```
9261 pub fn set_or_clear_management_cluster<T>(mut self, v: std::option::Option<T>) -> Self
9262 where
9263 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9264 {
9265 self.management_cluster = v.map(|x| x.into());
9266 self
9267 }
9268
9269 /// Sets the value of [description][crate::model::PrivateCloud::description].
9270 ///
9271 /// # Example
9272 /// ```ignore,no_run
9273 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9274 /// let x = PrivateCloud::new().set_description("example");
9275 /// ```
9276 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9277 self.description = v.into();
9278 self
9279 }
9280
9281 /// Sets the value of [hcx][crate::model::PrivateCloud::hcx].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9286 /// use google_cloud_vmwareengine_v1::model::Hcx;
9287 /// let x = PrivateCloud::new().set_hcx(Hcx::default()/* use setters */);
9288 /// ```
9289 pub fn set_hcx<T>(mut self, v: T) -> Self
9290 where
9291 T: std::convert::Into<crate::model::Hcx>,
9292 {
9293 self.hcx = std::option::Option::Some(v.into());
9294 self
9295 }
9296
9297 /// Sets or clears the value of [hcx][crate::model::PrivateCloud::hcx].
9298 ///
9299 /// # Example
9300 /// ```ignore,no_run
9301 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9302 /// use google_cloud_vmwareengine_v1::model::Hcx;
9303 /// let x = PrivateCloud::new().set_or_clear_hcx(Some(Hcx::default()/* use setters */));
9304 /// let x = PrivateCloud::new().set_or_clear_hcx(None::<Hcx>);
9305 /// ```
9306 pub fn set_or_clear_hcx<T>(mut self, v: std::option::Option<T>) -> Self
9307 where
9308 T: std::convert::Into<crate::model::Hcx>,
9309 {
9310 self.hcx = v.map(|x| x.into());
9311 self
9312 }
9313
9314 /// Sets the value of [nsx][crate::model::PrivateCloud::nsx].
9315 ///
9316 /// # Example
9317 /// ```ignore,no_run
9318 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9319 /// use google_cloud_vmwareengine_v1::model::Nsx;
9320 /// let x = PrivateCloud::new().set_nsx(Nsx::default()/* use setters */);
9321 /// ```
9322 pub fn set_nsx<T>(mut self, v: T) -> Self
9323 where
9324 T: std::convert::Into<crate::model::Nsx>,
9325 {
9326 self.nsx = std::option::Option::Some(v.into());
9327 self
9328 }
9329
9330 /// Sets or clears the value of [nsx][crate::model::PrivateCloud::nsx].
9331 ///
9332 /// # Example
9333 /// ```ignore,no_run
9334 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9335 /// use google_cloud_vmwareengine_v1::model::Nsx;
9336 /// let x = PrivateCloud::new().set_or_clear_nsx(Some(Nsx::default()/* use setters */));
9337 /// let x = PrivateCloud::new().set_or_clear_nsx(None::<Nsx>);
9338 /// ```
9339 pub fn set_or_clear_nsx<T>(mut self, v: std::option::Option<T>) -> Self
9340 where
9341 T: std::convert::Into<crate::model::Nsx>,
9342 {
9343 self.nsx = v.map(|x| x.into());
9344 self
9345 }
9346
9347 /// Sets the value of [vcenter][crate::model::PrivateCloud::vcenter].
9348 ///
9349 /// # Example
9350 /// ```ignore,no_run
9351 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9352 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9353 /// let x = PrivateCloud::new().set_vcenter(Vcenter::default()/* use setters */);
9354 /// ```
9355 pub fn set_vcenter<T>(mut self, v: T) -> Self
9356 where
9357 T: std::convert::Into<crate::model::Vcenter>,
9358 {
9359 self.vcenter = std::option::Option::Some(v.into());
9360 self
9361 }
9362
9363 /// Sets or clears the value of [vcenter][crate::model::PrivateCloud::vcenter].
9364 ///
9365 /// # Example
9366 /// ```ignore,no_run
9367 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9368 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9369 /// let x = PrivateCloud::new().set_or_clear_vcenter(Some(Vcenter::default()/* use setters */));
9370 /// let x = PrivateCloud::new().set_or_clear_vcenter(None::<Vcenter>);
9371 /// ```
9372 pub fn set_or_clear_vcenter<T>(mut self, v: std::option::Option<T>) -> Self
9373 where
9374 T: std::convert::Into<crate::model::Vcenter>,
9375 {
9376 self.vcenter = v.map(|x| x.into());
9377 self
9378 }
9379
9380 /// Sets the value of [uid][crate::model::PrivateCloud::uid].
9381 ///
9382 /// # Example
9383 /// ```ignore,no_run
9384 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9385 /// let x = PrivateCloud::new().set_uid("example");
9386 /// ```
9387 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9388 self.uid = v.into();
9389 self
9390 }
9391
9392 /// Sets the value of [r#type][crate::model::PrivateCloud::type].
9393 ///
9394 /// # Example
9395 /// ```ignore,no_run
9396 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9397 /// use google_cloud_vmwareengine_v1::model::private_cloud::Type;
9398 /// let x0 = PrivateCloud::new().set_type(Type::TimeLimited);
9399 /// let x1 = PrivateCloud::new().set_type(Type::Stretched);
9400 /// ```
9401 pub fn set_type<T: std::convert::Into<crate::model::private_cloud::Type>>(
9402 mut self,
9403 v: T,
9404 ) -> Self {
9405 self.r#type = v.into();
9406 self
9407 }
9408}
9409
9410impl wkt::message::Message for PrivateCloud {
9411 fn typename() -> &'static str {
9412 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud"
9413 }
9414}
9415
9416/// Defines additional types related to [PrivateCloud].
9417pub mod private_cloud {
9418 #[allow(unused_imports)]
9419 use super::*;
9420
9421 /// Management cluster configuration.
9422 #[derive(Clone, Default, PartialEq)]
9423 #[non_exhaustive]
9424 pub struct ManagementCluster {
9425 /// Required. The user-provided identifier of the new `Cluster`.
9426 /// The identifier must meet the following requirements:
9427 ///
9428 /// * Only contains 1-63 alphanumeric characters and hyphens
9429 /// * Begins with an alphabetical character
9430 /// * Ends with a non-hyphen character
9431 /// * Not formatted as a UUID
9432 /// * Complies with [RFC
9433 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
9434 pub cluster_id: std::string::String,
9435
9436 /// Required. The map of cluster node types in this cluster, where the key is
9437 /// canonical identifier of the node type (corresponds to the `NodeType`).
9438 pub node_type_configs:
9439 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9440
9441 /// Optional. Configuration of a stretched cluster. Required for STRETCHED
9442 /// private clouds.
9443 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9444
9445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9446 }
9447
9448 impl ManagementCluster {
9449 pub fn new() -> Self {
9450 std::default::Default::default()
9451 }
9452
9453 /// Sets the value of [cluster_id][crate::model::private_cloud::ManagementCluster::cluster_id].
9454 ///
9455 /// # Example
9456 /// ```ignore,no_run
9457 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9458 /// let x = ManagementCluster::new().set_cluster_id("example");
9459 /// ```
9460 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9461 self.cluster_id = v.into();
9462 self
9463 }
9464
9465 /// Sets the value of [node_type_configs][crate::model::private_cloud::ManagementCluster::node_type_configs].
9466 ///
9467 /// # Example
9468 /// ```ignore,no_run
9469 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9470 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9471 /// let x = ManagementCluster::new().set_node_type_configs([
9472 /// ("key0", NodeTypeConfig::default()/* use setters */),
9473 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
9474 /// ]);
9475 /// ```
9476 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
9477 where
9478 T: std::iter::IntoIterator<Item = (K, V)>,
9479 K: std::convert::Into<std::string::String>,
9480 V: std::convert::Into<crate::model::NodeTypeConfig>,
9481 {
9482 use std::iter::Iterator;
9483 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9484 self
9485 }
9486
9487 /// Sets the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9488 ///
9489 /// # Example
9490 /// ```ignore,no_run
9491 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9492 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9493 /// let x = ManagementCluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
9494 /// ```
9495 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
9496 where
9497 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9498 {
9499 self.stretched_cluster_config = std::option::Option::Some(v.into());
9500 self
9501 }
9502
9503 /// Sets or clears the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9504 ///
9505 /// # Example
9506 /// ```ignore,no_run
9507 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9508 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9509 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
9510 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
9511 /// ```
9512 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
9513 where
9514 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9515 {
9516 self.stretched_cluster_config = v.map(|x| x.into());
9517 self
9518 }
9519 }
9520
9521 impl wkt::message::Message for ManagementCluster {
9522 fn typename() -> &'static str {
9523 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"
9524 }
9525 }
9526
9527 /// Enum State defines possible states of private clouds.
9528 ///
9529 /// # Working with unknown values
9530 ///
9531 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9532 /// additional enum variants at any time. Adding new variants is not considered
9533 /// a breaking change. Applications should write their code in anticipation of:
9534 ///
9535 /// - New values appearing in future releases of the client library, **and**
9536 /// - New values received dynamically, without application changes.
9537 ///
9538 /// Please consult the [Working with enums] section in the user guide for some
9539 /// guidelines.
9540 ///
9541 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9542 #[derive(Clone, Debug, PartialEq)]
9543 #[non_exhaustive]
9544 pub enum State {
9545 /// The default value. This value should never be used.
9546 Unspecified,
9547 /// The private cloud is ready.
9548 Active,
9549 /// The private cloud is being created.
9550 Creating,
9551 /// The private cloud is being updated.
9552 Updating,
9553 /// The private cloud is in failed state.
9554 Failed,
9555 /// The private cloud is scheduled for deletion. The deletion process can be
9556 /// cancelled by using the corresponding undelete method.
9557 Deleted,
9558 /// The private cloud is irreversibly deleted and is being removed from the
9559 /// system.
9560 Purging,
9561 /// If set, the enum was initialized with an unknown value.
9562 ///
9563 /// Applications can examine the value using [State::value] or
9564 /// [State::name].
9565 UnknownValue(state::UnknownValue),
9566 }
9567
9568 #[doc(hidden)]
9569 pub mod state {
9570 #[allow(unused_imports)]
9571 use super::*;
9572 #[derive(Clone, Debug, PartialEq)]
9573 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9574 }
9575
9576 impl State {
9577 /// Gets the enum value.
9578 ///
9579 /// Returns `None` if the enum contains an unknown value deserialized from
9580 /// the string representation of enums.
9581 pub fn value(&self) -> std::option::Option<i32> {
9582 match self {
9583 Self::Unspecified => std::option::Option::Some(0),
9584 Self::Active => std::option::Option::Some(1),
9585 Self::Creating => std::option::Option::Some(2),
9586 Self::Updating => std::option::Option::Some(3),
9587 Self::Failed => std::option::Option::Some(5),
9588 Self::Deleted => std::option::Option::Some(6),
9589 Self::Purging => std::option::Option::Some(7),
9590 Self::UnknownValue(u) => u.0.value(),
9591 }
9592 }
9593
9594 /// Gets the enum value as a string.
9595 ///
9596 /// Returns `None` if the enum contains an unknown value deserialized from
9597 /// the integer representation of enums.
9598 pub fn name(&self) -> std::option::Option<&str> {
9599 match self {
9600 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9601 Self::Active => std::option::Option::Some("ACTIVE"),
9602 Self::Creating => std::option::Option::Some("CREATING"),
9603 Self::Updating => std::option::Option::Some("UPDATING"),
9604 Self::Failed => std::option::Option::Some("FAILED"),
9605 Self::Deleted => std::option::Option::Some("DELETED"),
9606 Self::Purging => std::option::Option::Some("PURGING"),
9607 Self::UnknownValue(u) => u.0.name(),
9608 }
9609 }
9610 }
9611
9612 impl std::default::Default for State {
9613 fn default() -> Self {
9614 use std::convert::From;
9615 Self::from(0)
9616 }
9617 }
9618
9619 impl std::fmt::Display for State {
9620 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9621 wkt::internal::display_enum(f, self.name(), self.value())
9622 }
9623 }
9624
9625 impl std::convert::From<i32> for State {
9626 fn from(value: i32) -> Self {
9627 match value {
9628 0 => Self::Unspecified,
9629 1 => Self::Active,
9630 2 => Self::Creating,
9631 3 => Self::Updating,
9632 5 => Self::Failed,
9633 6 => Self::Deleted,
9634 7 => Self::Purging,
9635 _ => Self::UnknownValue(state::UnknownValue(
9636 wkt::internal::UnknownEnumValue::Integer(value),
9637 )),
9638 }
9639 }
9640 }
9641
9642 impl std::convert::From<&str> for State {
9643 fn from(value: &str) -> Self {
9644 use std::string::ToString;
9645 match value {
9646 "STATE_UNSPECIFIED" => Self::Unspecified,
9647 "ACTIVE" => Self::Active,
9648 "CREATING" => Self::Creating,
9649 "UPDATING" => Self::Updating,
9650 "FAILED" => Self::Failed,
9651 "DELETED" => Self::Deleted,
9652 "PURGING" => Self::Purging,
9653 _ => Self::UnknownValue(state::UnknownValue(
9654 wkt::internal::UnknownEnumValue::String(value.to_string()),
9655 )),
9656 }
9657 }
9658 }
9659
9660 impl serde::ser::Serialize for State {
9661 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9662 where
9663 S: serde::Serializer,
9664 {
9665 match self {
9666 Self::Unspecified => serializer.serialize_i32(0),
9667 Self::Active => serializer.serialize_i32(1),
9668 Self::Creating => serializer.serialize_i32(2),
9669 Self::Updating => serializer.serialize_i32(3),
9670 Self::Failed => serializer.serialize_i32(5),
9671 Self::Deleted => serializer.serialize_i32(6),
9672 Self::Purging => serializer.serialize_i32(7),
9673 Self::UnknownValue(u) => u.0.serialize(serializer),
9674 }
9675 }
9676 }
9677
9678 impl<'de> serde::de::Deserialize<'de> for State {
9679 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9680 where
9681 D: serde::Deserializer<'de>,
9682 {
9683 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9684 ".google.cloud.vmwareengine.v1.PrivateCloud.State",
9685 ))
9686 }
9687 }
9688
9689 /// Enum Type defines private cloud type.
9690 ///
9691 /// # Working with unknown values
9692 ///
9693 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9694 /// additional enum variants at any time. Adding new variants is not considered
9695 /// a breaking change. Applications should write their code in anticipation of:
9696 ///
9697 /// - New values appearing in future releases of the client library, **and**
9698 /// - New values received dynamically, without application changes.
9699 ///
9700 /// Please consult the [Working with enums] section in the user guide for some
9701 /// guidelines.
9702 ///
9703 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9704 #[derive(Clone, Debug, PartialEq)]
9705 #[non_exhaustive]
9706 pub enum Type {
9707 /// Standard private is a zonal resource, with 3+ nodes. Default type.
9708 Standard,
9709 /// Time limited private cloud is a zonal resource, can have only 1 node and
9710 /// has limited life span. Will be deleted after defined period of time,
9711 /// can be converted into standard private cloud by expanding it up to 3
9712 /// or more nodes.
9713 TimeLimited,
9714 /// Stretched private cloud is a regional resource with redundancy,
9715 /// with a minimum of 6 nodes, nodes count has to be even.
9716 Stretched,
9717 /// If set, the enum was initialized with an unknown value.
9718 ///
9719 /// Applications can examine the value using [Type::value] or
9720 /// [Type::name].
9721 UnknownValue(r#type::UnknownValue),
9722 }
9723
9724 #[doc(hidden)]
9725 pub mod r#type {
9726 #[allow(unused_imports)]
9727 use super::*;
9728 #[derive(Clone, Debug, PartialEq)]
9729 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9730 }
9731
9732 impl Type {
9733 /// Gets the enum value.
9734 ///
9735 /// Returns `None` if the enum contains an unknown value deserialized from
9736 /// the string representation of enums.
9737 pub fn value(&self) -> std::option::Option<i32> {
9738 match self {
9739 Self::Standard => std::option::Option::Some(0),
9740 Self::TimeLimited => std::option::Option::Some(1),
9741 Self::Stretched => std::option::Option::Some(2),
9742 Self::UnknownValue(u) => u.0.value(),
9743 }
9744 }
9745
9746 /// Gets the enum value as a string.
9747 ///
9748 /// Returns `None` if the enum contains an unknown value deserialized from
9749 /// the integer representation of enums.
9750 pub fn name(&self) -> std::option::Option<&str> {
9751 match self {
9752 Self::Standard => std::option::Option::Some("STANDARD"),
9753 Self::TimeLimited => std::option::Option::Some("TIME_LIMITED"),
9754 Self::Stretched => std::option::Option::Some("STRETCHED"),
9755 Self::UnknownValue(u) => u.0.name(),
9756 }
9757 }
9758 }
9759
9760 impl std::default::Default for Type {
9761 fn default() -> Self {
9762 use std::convert::From;
9763 Self::from(0)
9764 }
9765 }
9766
9767 impl std::fmt::Display for Type {
9768 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9769 wkt::internal::display_enum(f, self.name(), self.value())
9770 }
9771 }
9772
9773 impl std::convert::From<i32> for Type {
9774 fn from(value: i32) -> Self {
9775 match value {
9776 0 => Self::Standard,
9777 1 => Self::TimeLimited,
9778 2 => Self::Stretched,
9779 _ => Self::UnknownValue(r#type::UnknownValue(
9780 wkt::internal::UnknownEnumValue::Integer(value),
9781 )),
9782 }
9783 }
9784 }
9785
9786 impl std::convert::From<&str> for Type {
9787 fn from(value: &str) -> Self {
9788 use std::string::ToString;
9789 match value {
9790 "STANDARD" => Self::Standard,
9791 "TIME_LIMITED" => Self::TimeLimited,
9792 "STRETCHED" => Self::Stretched,
9793 _ => Self::UnknownValue(r#type::UnknownValue(
9794 wkt::internal::UnknownEnumValue::String(value.to_string()),
9795 )),
9796 }
9797 }
9798 }
9799
9800 impl serde::ser::Serialize for Type {
9801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9802 where
9803 S: serde::Serializer,
9804 {
9805 match self {
9806 Self::Standard => serializer.serialize_i32(0),
9807 Self::TimeLimited => serializer.serialize_i32(1),
9808 Self::Stretched => serializer.serialize_i32(2),
9809 Self::UnknownValue(u) => u.0.serialize(serializer),
9810 }
9811 }
9812 }
9813
9814 impl<'de> serde::de::Deserialize<'de> for Type {
9815 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9816 where
9817 D: serde::Deserializer<'de>,
9818 {
9819 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
9820 ".google.cloud.vmwareengine.v1.PrivateCloud.Type",
9821 ))
9822 }
9823 }
9824}
9825
9826/// A cluster in a private cloud.
9827#[derive(Clone, Default, PartialEq)]
9828#[non_exhaustive]
9829pub struct Cluster {
9830 /// Output only. The resource name of this cluster.
9831 /// Resource names are schemeless URIs that follow the conventions in
9832 /// <https://cloud.google.com/apis/design/resource_names>.
9833 /// For example:
9834 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
9835 pub name: std::string::String,
9836
9837 /// Output only. Creation time of this resource.
9838 pub create_time: std::option::Option<wkt::Timestamp>,
9839
9840 /// Output only. Last update time of this resource.
9841 pub update_time: std::option::Option<wkt::Timestamp>,
9842
9843 /// Output only. State of the resource.
9844 pub state: crate::model::cluster::State,
9845
9846 /// Output only. True if the cluster is a management cluster; false otherwise.
9847 /// There can only be one management cluster in a private cloud
9848 /// and it has to be the first one.
9849 pub management: bool,
9850
9851 /// Optional. Configuration of the autoscaling applied to this cluster.
9852 pub autoscaling_settings: std::option::Option<crate::model::AutoscalingSettings>,
9853
9854 /// Output only. System-generated unique identifier for the resource.
9855 pub uid: std::string::String,
9856
9857 /// Required. The map of cluster node types in this cluster, where the key is
9858 /// canonical identifier of the node type (corresponds to the `NodeType`).
9859 pub node_type_configs:
9860 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9861
9862 /// Optional. Configuration of a stretched cluster. Required for clusters that
9863 /// belong to a STRETCHED private cloud.
9864 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9865
9866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9867}
9868
9869impl Cluster {
9870 pub fn new() -> Self {
9871 std::default::Default::default()
9872 }
9873
9874 /// Sets the value of [name][crate::model::Cluster::name].
9875 ///
9876 /// # Example
9877 /// ```ignore,no_run
9878 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9879 /// let x = Cluster::new().set_name("example");
9880 /// ```
9881 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9882 self.name = v.into();
9883 self
9884 }
9885
9886 /// Sets the value of [create_time][crate::model::Cluster::create_time].
9887 ///
9888 /// # Example
9889 /// ```ignore,no_run
9890 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9891 /// use wkt::Timestamp;
9892 /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
9893 /// ```
9894 pub fn set_create_time<T>(mut self, v: T) -> Self
9895 where
9896 T: std::convert::Into<wkt::Timestamp>,
9897 {
9898 self.create_time = std::option::Option::Some(v.into());
9899 self
9900 }
9901
9902 /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
9903 ///
9904 /// # Example
9905 /// ```ignore,no_run
9906 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9907 /// use wkt::Timestamp;
9908 /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9909 /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
9910 /// ```
9911 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9912 where
9913 T: std::convert::Into<wkt::Timestamp>,
9914 {
9915 self.create_time = v.map(|x| x.into());
9916 self
9917 }
9918
9919 /// Sets the value of [update_time][crate::model::Cluster::update_time].
9920 ///
9921 /// # Example
9922 /// ```ignore,no_run
9923 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9924 /// use wkt::Timestamp;
9925 /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
9926 /// ```
9927 pub fn set_update_time<T>(mut self, v: T) -> Self
9928 where
9929 T: std::convert::Into<wkt::Timestamp>,
9930 {
9931 self.update_time = std::option::Option::Some(v.into());
9932 self
9933 }
9934
9935 /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
9936 ///
9937 /// # Example
9938 /// ```ignore,no_run
9939 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9940 /// use wkt::Timestamp;
9941 /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9942 /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
9943 /// ```
9944 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9945 where
9946 T: std::convert::Into<wkt::Timestamp>,
9947 {
9948 self.update_time = v.map(|x| x.into());
9949 self
9950 }
9951
9952 /// Sets the value of [state][crate::model::Cluster::state].
9953 ///
9954 /// # Example
9955 /// ```ignore,no_run
9956 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9957 /// use google_cloud_vmwareengine_v1::model::cluster::State;
9958 /// let x0 = Cluster::new().set_state(State::Active);
9959 /// let x1 = Cluster::new().set_state(State::Creating);
9960 /// let x2 = Cluster::new().set_state(State::Updating);
9961 /// ```
9962 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
9963 self.state = v.into();
9964 self
9965 }
9966
9967 /// Sets the value of [management][crate::model::Cluster::management].
9968 ///
9969 /// # Example
9970 /// ```ignore,no_run
9971 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9972 /// let x = Cluster::new().set_management(true);
9973 /// ```
9974 pub fn set_management<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9975 self.management = v.into();
9976 self
9977 }
9978
9979 /// Sets the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9980 ///
9981 /// # Example
9982 /// ```ignore,no_run
9983 /// # use google_cloud_vmwareengine_v1::model::Cluster;
9984 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
9985 /// let x = Cluster::new().set_autoscaling_settings(AutoscalingSettings::default()/* use setters */);
9986 /// ```
9987 pub fn set_autoscaling_settings<T>(mut self, v: T) -> Self
9988 where
9989 T: std::convert::Into<crate::model::AutoscalingSettings>,
9990 {
9991 self.autoscaling_settings = std::option::Option::Some(v.into());
9992 self
9993 }
9994
9995 /// Sets or clears the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
9996 ///
9997 /// # Example
9998 /// ```ignore,no_run
9999 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10000 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
10001 /// let x = Cluster::new().set_or_clear_autoscaling_settings(Some(AutoscalingSettings::default()/* use setters */));
10002 /// let x = Cluster::new().set_or_clear_autoscaling_settings(None::<AutoscalingSettings>);
10003 /// ```
10004 pub fn set_or_clear_autoscaling_settings<T>(mut self, v: std::option::Option<T>) -> Self
10005 where
10006 T: std::convert::Into<crate::model::AutoscalingSettings>,
10007 {
10008 self.autoscaling_settings = v.map(|x| x.into());
10009 self
10010 }
10011
10012 /// Sets the value of [uid][crate::model::Cluster::uid].
10013 ///
10014 /// # Example
10015 /// ```ignore,no_run
10016 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10017 /// let x = Cluster::new().set_uid("example");
10018 /// ```
10019 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10020 self.uid = v.into();
10021 self
10022 }
10023
10024 /// Sets the value of [node_type_configs][crate::model::Cluster::node_type_configs].
10025 ///
10026 /// # Example
10027 /// ```ignore,no_run
10028 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10029 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
10030 /// let x = Cluster::new().set_node_type_configs([
10031 /// ("key0", NodeTypeConfig::default()/* use setters */),
10032 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
10033 /// ]);
10034 /// ```
10035 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
10036 where
10037 T: std::iter::IntoIterator<Item = (K, V)>,
10038 K: std::convert::Into<std::string::String>,
10039 V: std::convert::Into<crate::model::NodeTypeConfig>,
10040 {
10041 use std::iter::Iterator;
10042 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10043 self
10044 }
10045
10046 /// Sets the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10047 ///
10048 /// # Example
10049 /// ```ignore,no_run
10050 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10051 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10052 /// let x = Cluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
10053 /// ```
10054 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
10055 where
10056 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10057 {
10058 self.stretched_cluster_config = std::option::Option::Some(v.into());
10059 self
10060 }
10061
10062 /// Sets or clears the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10063 ///
10064 /// # Example
10065 /// ```ignore,no_run
10066 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10067 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10068 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
10069 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
10070 /// ```
10071 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
10072 where
10073 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10074 {
10075 self.stretched_cluster_config = v.map(|x| x.into());
10076 self
10077 }
10078}
10079
10080impl wkt::message::Message for Cluster {
10081 fn typename() -> &'static str {
10082 "type.googleapis.com/google.cloud.vmwareengine.v1.Cluster"
10083 }
10084}
10085
10086/// Defines additional types related to [Cluster].
10087pub mod cluster {
10088 #[allow(unused_imports)]
10089 use super::*;
10090
10091 /// Enum State defines possible states of private cloud clusters.
10092 ///
10093 /// # Working with unknown values
10094 ///
10095 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10096 /// additional enum variants at any time. Adding new variants is not considered
10097 /// a breaking change. Applications should write their code in anticipation of:
10098 ///
10099 /// - New values appearing in future releases of the client library, **and**
10100 /// - New values received dynamically, without application changes.
10101 ///
10102 /// Please consult the [Working with enums] section in the user guide for some
10103 /// guidelines.
10104 ///
10105 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10106 #[derive(Clone, Debug, PartialEq)]
10107 #[non_exhaustive]
10108 pub enum State {
10109 /// The default value. This value should never be used.
10110 Unspecified,
10111 /// The Cluster is operational and can be used by the user.
10112 Active,
10113 /// The Cluster is being deployed.
10114 Creating,
10115 /// Adding or removing of a node to the cluster, any other cluster specific
10116 /// updates.
10117 Updating,
10118 /// The Cluster is being deleted.
10119 Deleting,
10120 /// The Cluster is undergoing maintenance, for example: a failed node is
10121 /// getting replaced.
10122 Repairing,
10123 /// If set, the enum was initialized with an unknown value.
10124 ///
10125 /// Applications can examine the value using [State::value] or
10126 /// [State::name].
10127 UnknownValue(state::UnknownValue),
10128 }
10129
10130 #[doc(hidden)]
10131 pub mod state {
10132 #[allow(unused_imports)]
10133 use super::*;
10134 #[derive(Clone, Debug, PartialEq)]
10135 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10136 }
10137
10138 impl State {
10139 /// Gets the enum value.
10140 ///
10141 /// Returns `None` if the enum contains an unknown value deserialized from
10142 /// the string representation of enums.
10143 pub fn value(&self) -> std::option::Option<i32> {
10144 match self {
10145 Self::Unspecified => std::option::Option::Some(0),
10146 Self::Active => std::option::Option::Some(1),
10147 Self::Creating => std::option::Option::Some(2),
10148 Self::Updating => std::option::Option::Some(3),
10149 Self::Deleting => std::option::Option::Some(4),
10150 Self::Repairing => std::option::Option::Some(5),
10151 Self::UnknownValue(u) => u.0.value(),
10152 }
10153 }
10154
10155 /// Gets the enum value as a string.
10156 ///
10157 /// Returns `None` if the enum contains an unknown value deserialized from
10158 /// the integer representation of enums.
10159 pub fn name(&self) -> std::option::Option<&str> {
10160 match self {
10161 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10162 Self::Active => std::option::Option::Some("ACTIVE"),
10163 Self::Creating => std::option::Option::Some("CREATING"),
10164 Self::Updating => std::option::Option::Some("UPDATING"),
10165 Self::Deleting => std::option::Option::Some("DELETING"),
10166 Self::Repairing => std::option::Option::Some("REPAIRING"),
10167 Self::UnknownValue(u) => u.0.name(),
10168 }
10169 }
10170 }
10171
10172 impl std::default::Default for State {
10173 fn default() -> Self {
10174 use std::convert::From;
10175 Self::from(0)
10176 }
10177 }
10178
10179 impl std::fmt::Display for State {
10180 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10181 wkt::internal::display_enum(f, self.name(), self.value())
10182 }
10183 }
10184
10185 impl std::convert::From<i32> for State {
10186 fn from(value: i32) -> Self {
10187 match value {
10188 0 => Self::Unspecified,
10189 1 => Self::Active,
10190 2 => Self::Creating,
10191 3 => Self::Updating,
10192 4 => Self::Deleting,
10193 5 => Self::Repairing,
10194 _ => Self::UnknownValue(state::UnknownValue(
10195 wkt::internal::UnknownEnumValue::Integer(value),
10196 )),
10197 }
10198 }
10199 }
10200
10201 impl std::convert::From<&str> for State {
10202 fn from(value: &str) -> Self {
10203 use std::string::ToString;
10204 match value {
10205 "STATE_UNSPECIFIED" => Self::Unspecified,
10206 "ACTIVE" => Self::Active,
10207 "CREATING" => Self::Creating,
10208 "UPDATING" => Self::Updating,
10209 "DELETING" => Self::Deleting,
10210 "REPAIRING" => Self::Repairing,
10211 _ => Self::UnknownValue(state::UnknownValue(
10212 wkt::internal::UnknownEnumValue::String(value.to_string()),
10213 )),
10214 }
10215 }
10216 }
10217
10218 impl serde::ser::Serialize for State {
10219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10220 where
10221 S: serde::Serializer,
10222 {
10223 match self {
10224 Self::Unspecified => serializer.serialize_i32(0),
10225 Self::Active => serializer.serialize_i32(1),
10226 Self::Creating => serializer.serialize_i32(2),
10227 Self::Updating => serializer.serialize_i32(3),
10228 Self::Deleting => serializer.serialize_i32(4),
10229 Self::Repairing => serializer.serialize_i32(5),
10230 Self::UnknownValue(u) => u.0.serialize(serializer),
10231 }
10232 }
10233 }
10234
10235 impl<'de> serde::de::Deserialize<'de> for State {
10236 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10237 where
10238 D: serde::Deserializer<'de>,
10239 {
10240 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10241 ".google.cloud.vmwareengine.v1.Cluster.State",
10242 ))
10243 }
10244 }
10245}
10246
10247/// Node in a cluster.
10248#[derive(Clone, Default, PartialEq)]
10249#[non_exhaustive]
10250pub struct Node {
10251 /// Output only. The resource name of this node.
10252 /// Resource names are schemeless URIs that follow the conventions in
10253 /// <https://cloud.google.com/apis/design/resource_names>.
10254 /// For example:
10255 /// projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node
10256 pub name: std::string::String,
10257
10258 /// Output only. Fully qualified domain name of the node.
10259 pub fqdn: std::string::String,
10260
10261 /// Output only. Internal IP address of the node.
10262 pub internal_ip: std::string::String,
10263
10264 /// Output only. The canonical identifier of the node type (corresponds to the
10265 /// `NodeType`).
10266 /// For example: standard-72.
10267 pub node_type_id: std::string::String,
10268
10269 /// Output only. The version number of the VMware ESXi
10270 /// management component in this cluster.
10271 pub version: std::string::String,
10272
10273 /// Output only. Customized number of cores
10274 pub custom_core_count: i64,
10275
10276 /// Output only. The state of the appliance.
10277 pub state: crate::model::node::State,
10278
10279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10280}
10281
10282impl Node {
10283 pub fn new() -> Self {
10284 std::default::Default::default()
10285 }
10286
10287 /// Sets the value of [name][crate::model::Node::name].
10288 ///
10289 /// # Example
10290 /// ```ignore,no_run
10291 /// # use google_cloud_vmwareengine_v1::model::Node;
10292 /// let x = Node::new().set_name("example");
10293 /// ```
10294 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10295 self.name = v.into();
10296 self
10297 }
10298
10299 /// Sets the value of [fqdn][crate::model::Node::fqdn].
10300 ///
10301 /// # Example
10302 /// ```ignore,no_run
10303 /// # use google_cloud_vmwareengine_v1::model::Node;
10304 /// let x = Node::new().set_fqdn("example");
10305 /// ```
10306 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10307 self.fqdn = v.into();
10308 self
10309 }
10310
10311 /// Sets the value of [internal_ip][crate::model::Node::internal_ip].
10312 ///
10313 /// # Example
10314 /// ```ignore,no_run
10315 /// # use google_cloud_vmwareengine_v1::model::Node;
10316 /// let x = Node::new().set_internal_ip("example");
10317 /// ```
10318 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10319 self.internal_ip = v.into();
10320 self
10321 }
10322
10323 /// Sets the value of [node_type_id][crate::model::Node::node_type_id].
10324 ///
10325 /// # Example
10326 /// ```ignore,no_run
10327 /// # use google_cloud_vmwareengine_v1::model::Node;
10328 /// let x = Node::new().set_node_type_id("example");
10329 /// ```
10330 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10331 self.node_type_id = v.into();
10332 self
10333 }
10334
10335 /// Sets the value of [version][crate::model::Node::version].
10336 ///
10337 /// # Example
10338 /// ```ignore,no_run
10339 /// # use google_cloud_vmwareengine_v1::model::Node;
10340 /// let x = Node::new().set_version("example");
10341 /// ```
10342 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10343 self.version = v.into();
10344 self
10345 }
10346
10347 /// Sets the value of [custom_core_count][crate::model::Node::custom_core_count].
10348 ///
10349 /// # Example
10350 /// ```ignore,no_run
10351 /// # use google_cloud_vmwareengine_v1::model::Node;
10352 /// let x = Node::new().set_custom_core_count(42);
10353 /// ```
10354 pub fn set_custom_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10355 self.custom_core_count = v.into();
10356 self
10357 }
10358
10359 /// Sets the value of [state][crate::model::Node::state].
10360 ///
10361 /// # Example
10362 /// ```ignore,no_run
10363 /// # use google_cloud_vmwareengine_v1::model::Node;
10364 /// use google_cloud_vmwareengine_v1::model::node::State;
10365 /// let x0 = Node::new().set_state(State::Active);
10366 /// let x1 = Node::new().set_state(State::Creating);
10367 /// let x2 = Node::new().set_state(State::Failed);
10368 /// ```
10369 pub fn set_state<T: std::convert::Into<crate::model::node::State>>(mut self, v: T) -> Self {
10370 self.state = v.into();
10371 self
10372 }
10373}
10374
10375impl wkt::message::Message for Node {
10376 fn typename() -> &'static str {
10377 "type.googleapis.com/google.cloud.vmwareengine.v1.Node"
10378 }
10379}
10380
10381/// Defines additional types related to [Node].
10382pub mod node {
10383 #[allow(unused_imports)]
10384 use super::*;
10385
10386 /// Enum State defines possible states of a node in a cluster.
10387 ///
10388 /// # Working with unknown values
10389 ///
10390 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10391 /// additional enum variants at any time. Adding new variants is not considered
10392 /// a breaking change. Applications should write their code in anticipation of:
10393 ///
10394 /// - New values appearing in future releases of the client library, **and**
10395 /// - New values received dynamically, without application changes.
10396 ///
10397 /// Please consult the [Working with enums] section in the user guide for some
10398 /// guidelines.
10399 ///
10400 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10401 #[derive(Clone, Debug, PartialEq)]
10402 #[non_exhaustive]
10403 pub enum State {
10404 /// The default value. This value should never be used.
10405 Unspecified,
10406 /// Node is operational and can be used by the user.
10407 Active,
10408 /// Node is being provisioned.
10409 Creating,
10410 /// Node is in a failed state.
10411 Failed,
10412 /// Node is undergoing maintenance, e.g.: during private cloud upgrade.
10413 Upgrading,
10414 /// If set, the enum was initialized with an unknown value.
10415 ///
10416 /// Applications can examine the value using [State::value] or
10417 /// [State::name].
10418 UnknownValue(state::UnknownValue),
10419 }
10420
10421 #[doc(hidden)]
10422 pub mod state {
10423 #[allow(unused_imports)]
10424 use super::*;
10425 #[derive(Clone, Debug, PartialEq)]
10426 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10427 }
10428
10429 impl State {
10430 /// Gets the enum value.
10431 ///
10432 /// Returns `None` if the enum contains an unknown value deserialized from
10433 /// the string representation of enums.
10434 pub fn value(&self) -> std::option::Option<i32> {
10435 match self {
10436 Self::Unspecified => std::option::Option::Some(0),
10437 Self::Active => std::option::Option::Some(1),
10438 Self::Creating => std::option::Option::Some(2),
10439 Self::Failed => std::option::Option::Some(3),
10440 Self::Upgrading => std::option::Option::Some(4),
10441 Self::UnknownValue(u) => u.0.value(),
10442 }
10443 }
10444
10445 /// Gets the enum value as a string.
10446 ///
10447 /// Returns `None` if the enum contains an unknown value deserialized from
10448 /// the integer representation of enums.
10449 pub fn name(&self) -> std::option::Option<&str> {
10450 match self {
10451 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10452 Self::Active => std::option::Option::Some("ACTIVE"),
10453 Self::Creating => std::option::Option::Some("CREATING"),
10454 Self::Failed => std::option::Option::Some("FAILED"),
10455 Self::Upgrading => std::option::Option::Some("UPGRADING"),
10456 Self::UnknownValue(u) => u.0.name(),
10457 }
10458 }
10459 }
10460
10461 impl std::default::Default for State {
10462 fn default() -> Self {
10463 use std::convert::From;
10464 Self::from(0)
10465 }
10466 }
10467
10468 impl std::fmt::Display for State {
10469 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10470 wkt::internal::display_enum(f, self.name(), self.value())
10471 }
10472 }
10473
10474 impl std::convert::From<i32> for State {
10475 fn from(value: i32) -> Self {
10476 match value {
10477 0 => Self::Unspecified,
10478 1 => Self::Active,
10479 2 => Self::Creating,
10480 3 => Self::Failed,
10481 4 => Self::Upgrading,
10482 _ => Self::UnknownValue(state::UnknownValue(
10483 wkt::internal::UnknownEnumValue::Integer(value),
10484 )),
10485 }
10486 }
10487 }
10488
10489 impl std::convert::From<&str> for State {
10490 fn from(value: &str) -> Self {
10491 use std::string::ToString;
10492 match value {
10493 "STATE_UNSPECIFIED" => Self::Unspecified,
10494 "ACTIVE" => Self::Active,
10495 "CREATING" => Self::Creating,
10496 "FAILED" => Self::Failed,
10497 "UPGRADING" => Self::Upgrading,
10498 _ => Self::UnknownValue(state::UnknownValue(
10499 wkt::internal::UnknownEnumValue::String(value.to_string()),
10500 )),
10501 }
10502 }
10503 }
10504
10505 impl serde::ser::Serialize for State {
10506 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10507 where
10508 S: serde::Serializer,
10509 {
10510 match self {
10511 Self::Unspecified => serializer.serialize_i32(0),
10512 Self::Active => serializer.serialize_i32(1),
10513 Self::Creating => serializer.serialize_i32(2),
10514 Self::Failed => serializer.serialize_i32(3),
10515 Self::Upgrading => serializer.serialize_i32(4),
10516 Self::UnknownValue(u) => u.0.serialize(serializer),
10517 }
10518 }
10519 }
10520
10521 impl<'de> serde::de::Deserialize<'de> for State {
10522 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10523 where
10524 D: serde::Deserializer<'de>,
10525 {
10526 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10527 ".google.cloud.vmwareengine.v1.Node.State",
10528 ))
10529 }
10530 }
10531}
10532
10533/// Represents an allocated external IP address and its corresponding internal IP
10534/// address in a private cloud.
10535#[derive(Clone, Default, PartialEq)]
10536#[non_exhaustive]
10537pub struct ExternalAddress {
10538 /// Output only. The resource name of this external IP address.
10539 /// Resource names are schemeless URIs that follow the conventions in
10540 /// <https://cloud.google.com/apis/design/resource_names>.
10541 /// For example:
10542 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`
10543 pub name: std::string::String,
10544
10545 /// Output only. Creation time of this resource.
10546 pub create_time: std::option::Option<wkt::Timestamp>,
10547
10548 /// Output only. Last update time of this resource.
10549 pub update_time: std::option::Option<wkt::Timestamp>,
10550
10551 /// The internal IP address of a workload VM.
10552 pub internal_ip: std::string::String,
10553
10554 /// Output only. The external IP address of a workload VM.
10555 pub external_ip: std::string::String,
10556
10557 /// Output only. The state of the resource.
10558 pub state: crate::model::external_address::State,
10559
10560 /// Output only. System-generated unique identifier for the resource.
10561 pub uid: std::string::String,
10562
10563 /// User-provided description for this resource.
10564 pub description: std::string::String,
10565
10566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10567}
10568
10569impl ExternalAddress {
10570 pub fn new() -> Self {
10571 std::default::Default::default()
10572 }
10573
10574 /// Sets the value of [name][crate::model::ExternalAddress::name].
10575 ///
10576 /// # Example
10577 /// ```ignore,no_run
10578 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10579 /// let x = ExternalAddress::new().set_name("example");
10580 /// ```
10581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10582 self.name = v.into();
10583 self
10584 }
10585
10586 /// Sets the value of [create_time][crate::model::ExternalAddress::create_time].
10587 ///
10588 /// # Example
10589 /// ```ignore,no_run
10590 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10591 /// use wkt::Timestamp;
10592 /// let x = ExternalAddress::new().set_create_time(Timestamp::default()/* use setters */);
10593 /// ```
10594 pub fn set_create_time<T>(mut self, v: T) -> Self
10595 where
10596 T: std::convert::Into<wkt::Timestamp>,
10597 {
10598 self.create_time = std::option::Option::Some(v.into());
10599 self
10600 }
10601
10602 /// Sets or clears the value of [create_time][crate::model::ExternalAddress::create_time].
10603 ///
10604 /// # Example
10605 /// ```ignore,no_run
10606 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10607 /// use wkt::Timestamp;
10608 /// let x = ExternalAddress::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10609 /// let x = ExternalAddress::new().set_or_clear_create_time(None::<Timestamp>);
10610 /// ```
10611 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10612 where
10613 T: std::convert::Into<wkt::Timestamp>,
10614 {
10615 self.create_time = v.map(|x| x.into());
10616 self
10617 }
10618
10619 /// Sets the value of [update_time][crate::model::ExternalAddress::update_time].
10620 ///
10621 /// # Example
10622 /// ```ignore,no_run
10623 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10624 /// use wkt::Timestamp;
10625 /// let x = ExternalAddress::new().set_update_time(Timestamp::default()/* use setters */);
10626 /// ```
10627 pub fn set_update_time<T>(mut self, v: T) -> Self
10628 where
10629 T: std::convert::Into<wkt::Timestamp>,
10630 {
10631 self.update_time = std::option::Option::Some(v.into());
10632 self
10633 }
10634
10635 /// Sets or clears the value of [update_time][crate::model::ExternalAddress::update_time].
10636 ///
10637 /// # Example
10638 /// ```ignore,no_run
10639 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10640 /// use wkt::Timestamp;
10641 /// let x = ExternalAddress::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10642 /// let x = ExternalAddress::new().set_or_clear_update_time(None::<Timestamp>);
10643 /// ```
10644 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10645 where
10646 T: std::convert::Into<wkt::Timestamp>,
10647 {
10648 self.update_time = v.map(|x| x.into());
10649 self
10650 }
10651
10652 /// Sets the value of [internal_ip][crate::model::ExternalAddress::internal_ip].
10653 ///
10654 /// # Example
10655 /// ```ignore,no_run
10656 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10657 /// let x = ExternalAddress::new().set_internal_ip("example");
10658 /// ```
10659 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10660 self.internal_ip = v.into();
10661 self
10662 }
10663
10664 /// Sets the value of [external_ip][crate::model::ExternalAddress::external_ip].
10665 ///
10666 /// # Example
10667 /// ```ignore,no_run
10668 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10669 /// let x = ExternalAddress::new().set_external_ip("example");
10670 /// ```
10671 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10672 self.external_ip = v.into();
10673 self
10674 }
10675
10676 /// Sets the value of [state][crate::model::ExternalAddress::state].
10677 ///
10678 /// # Example
10679 /// ```ignore,no_run
10680 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10681 /// use google_cloud_vmwareengine_v1::model::external_address::State;
10682 /// let x0 = ExternalAddress::new().set_state(State::Active);
10683 /// let x1 = ExternalAddress::new().set_state(State::Creating);
10684 /// let x2 = ExternalAddress::new().set_state(State::Updating);
10685 /// ```
10686 pub fn set_state<T: std::convert::Into<crate::model::external_address::State>>(
10687 mut self,
10688 v: T,
10689 ) -> Self {
10690 self.state = v.into();
10691 self
10692 }
10693
10694 /// Sets the value of [uid][crate::model::ExternalAddress::uid].
10695 ///
10696 /// # Example
10697 /// ```ignore,no_run
10698 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10699 /// let x = ExternalAddress::new().set_uid("example");
10700 /// ```
10701 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10702 self.uid = v.into();
10703 self
10704 }
10705
10706 /// Sets the value of [description][crate::model::ExternalAddress::description].
10707 ///
10708 /// # Example
10709 /// ```ignore,no_run
10710 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10711 /// let x = ExternalAddress::new().set_description("example");
10712 /// ```
10713 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10714 self.description = v.into();
10715 self
10716 }
10717}
10718
10719impl wkt::message::Message for ExternalAddress {
10720 fn typename() -> &'static str {
10721 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAddress"
10722 }
10723}
10724
10725/// Defines additional types related to [ExternalAddress].
10726pub mod external_address {
10727 #[allow(unused_imports)]
10728 use super::*;
10729
10730 /// Enum State defines possible states of external addresses.
10731 ///
10732 /// # Working with unknown values
10733 ///
10734 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10735 /// additional enum variants at any time. Adding new variants is not considered
10736 /// a breaking change. Applications should write their code in anticipation of:
10737 ///
10738 /// - New values appearing in future releases of the client library, **and**
10739 /// - New values received dynamically, without application changes.
10740 ///
10741 /// Please consult the [Working with enums] section in the user guide for some
10742 /// guidelines.
10743 ///
10744 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10745 #[derive(Clone, Debug, PartialEq)]
10746 #[non_exhaustive]
10747 pub enum State {
10748 /// The default value. This value should never be used.
10749 Unspecified,
10750 /// The address is ready.
10751 Active,
10752 /// The address is being created.
10753 Creating,
10754 /// The address is being updated.
10755 Updating,
10756 /// The address is being deleted.
10757 Deleting,
10758 /// If set, the enum was initialized with an unknown value.
10759 ///
10760 /// Applications can examine the value using [State::value] or
10761 /// [State::name].
10762 UnknownValue(state::UnknownValue),
10763 }
10764
10765 #[doc(hidden)]
10766 pub mod state {
10767 #[allow(unused_imports)]
10768 use super::*;
10769 #[derive(Clone, Debug, PartialEq)]
10770 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10771 }
10772
10773 impl State {
10774 /// Gets the enum value.
10775 ///
10776 /// Returns `None` if the enum contains an unknown value deserialized from
10777 /// the string representation of enums.
10778 pub fn value(&self) -> std::option::Option<i32> {
10779 match self {
10780 Self::Unspecified => std::option::Option::Some(0),
10781 Self::Active => std::option::Option::Some(1),
10782 Self::Creating => std::option::Option::Some(2),
10783 Self::Updating => std::option::Option::Some(3),
10784 Self::Deleting => std::option::Option::Some(4),
10785 Self::UnknownValue(u) => u.0.value(),
10786 }
10787 }
10788
10789 /// Gets the enum value as a string.
10790 ///
10791 /// Returns `None` if the enum contains an unknown value deserialized from
10792 /// the integer representation of enums.
10793 pub fn name(&self) -> std::option::Option<&str> {
10794 match self {
10795 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10796 Self::Active => std::option::Option::Some("ACTIVE"),
10797 Self::Creating => std::option::Option::Some("CREATING"),
10798 Self::Updating => std::option::Option::Some("UPDATING"),
10799 Self::Deleting => std::option::Option::Some("DELETING"),
10800 Self::UnknownValue(u) => u.0.name(),
10801 }
10802 }
10803 }
10804
10805 impl std::default::Default for State {
10806 fn default() -> Self {
10807 use std::convert::From;
10808 Self::from(0)
10809 }
10810 }
10811
10812 impl std::fmt::Display for State {
10813 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10814 wkt::internal::display_enum(f, self.name(), self.value())
10815 }
10816 }
10817
10818 impl std::convert::From<i32> for State {
10819 fn from(value: i32) -> Self {
10820 match value {
10821 0 => Self::Unspecified,
10822 1 => Self::Active,
10823 2 => Self::Creating,
10824 3 => Self::Updating,
10825 4 => Self::Deleting,
10826 _ => Self::UnknownValue(state::UnknownValue(
10827 wkt::internal::UnknownEnumValue::Integer(value),
10828 )),
10829 }
10830 }
10831 }
10832
10833 impl std::convert::From<&str> for State {
10834 fn from(value: &str) -> Self {
10835 use std::string::ToString;
10836 match value {
10837 "STATE_UNSPECIFIED" => Self::Unspecified,
10838 "ACTIVE" => Self::Active,
10839 "CREATING" => Self::Creating,
10840 "UPDATING" => Self::Updating,
10841 "DELETING" => Self::Deleting,
10842 _ => Self::UnknownValue(state::UnknownValue(
10843 wkt::internal::UnknownEnumValue::String(value.to_string()),
10844 )),
10845 }
10846 }
10847 }
10848
10849 impl serde::ser::Serialize for State {
10850 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10851 where
10852 S: serde::Serializer,
10853 {
10854 match self {
10855 Self::Unspecified => serializer.serialize_i32(0),
10856 Self::Active => serializer.serialize_i32(1),
10857 Self::Creating => serializer.serialize_i32(2),
10858 Self::Updating => serializer.serialize_i32(3),
10859 Self::Deleting => serializer.serialize_i32(4),
10860 Self::UnknownValue(u) => u.0.serialize(serializer),
10861 }
10862 }
10863 }
10864
10865 impl<'de> serde::de::Deserialize<'de> for State {
10866 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10867 where
10868 D: serde::Deserializer<'de>,
10869 {
10870 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10871 ".google.cloud.vmwareengine.v1.ExternalAddress.State",
10872 ))
10873 }
10874 }
10875}
10876
10877/// Subnet in a private cloud. Either `management` subnets (such as vMotion) that
10878/// are read-only, or `userDefined`, which can also be updated.
10879#[derive(Clone, Default, PartialEq)]
10880#[non_exhaustive]
10881pub struct Subnet {
10882 /// Output only. The resource name of this subnet.
10883 /// Resource names are schemeless URIs that follow the conventions in
10884 /// <https://cloud.google.com/apis/design/resource_names>.
10885 /// For example:
10886 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
10887 pub name: std::string::String,
10888
10889 /// The IP address range of the subnet in CIDR format '10.0.0.0/24'.
10890 pub ip_cidr_range: std::string::String,
10891
10892 /// The IP address of the gateway of this subnet.
10893 /// Must fall within the IP prefix defined above.
10894 pub gateway_ip: std::string::String,
10895
10896 /// Output only. The type of the subnet. For example "management" or
10897 /// "userDefined".
10898 pub r#type: std::string::String,
10899
10900 /// Output only. The state of the resource.
10901 pub state: crate::model::subnet::State,
10902
10903 /// Output only. VLAN ID of the VLAN on which the subnet is configured
10904 pub vlan_id: i32,
10905
10906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10907}
10908
10909impl Subnet {
10910 pub fn new() -> Self {
10911 std::default::Default::default()
10912 }
10913
10914 /// Sets the value of [name][crate::model::Subnet::name].
10915 ///
10916 /// # Example
10917 /// ```ignore,no_run
10918 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10919 /// let x = Subnet::new().set_name("example");
10920 /// ```
10921 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10922 self.name = v.into();
10923 self
10924 }
10925
10926 /// Sets the value of [ip_cidr_range][crate::model::Subnet::ip_cidr_range].
10927 ///
10928 /// # Example
10929 /// ```ignore,no_run
10930 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10931 /// let x = Subnet::new().set_ip_cidr_range("example");
10932 /// ```
10933 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10934 self.ip_cidr_range = v.into();
10935 self
10936 }
10937
10938 /// Sets the value of [gateway_ip][crate::model::Subnet::gateway_ip].
10939 ///
10940 /// # Example
10941 /// ```ignore,no_run
10942 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10943 /// let x = Subnet::new().set_gateway_ip("example");
10944 /// ```
10945 pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10946 self.gateway_ip = v.into();
10947 self
10948 }
10949
10950 /// Sets the value of [r#type][crate::model::Subnet::type].
10951 ///
10952 /// # Example
10953 /// ```ignore,no_run
10954 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10955 /// let x = Subnet::new().set_type("example");
10956 /// ```
10957 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10958 self.r#type = v.into();
10959 self
10960 }
10961
10962 /// Sets the value of [state][crate::model::Subnet::state].
10963 ///
10964 /// # Example
10965 /// ```ignore,no_run
10966 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10967 /// use google_cloud_vmwareengine_v1::model::subnet::State;
10968 /// let x0 = Subnet::new().set_state(State::Active);
10969 /// let x1 = Subnet::new().set_state(State::Creating);
10970 /// let x2 = Subnet::new().set_state(State::Updating);
10971 /// ```
10972 pub fn set_state<T: std::convert::Into<crate::model::subnet::State>>(mut self, v: T) -> Self {
10973 self.state = v.into();
10974 self
10975 }
10976
10977 /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
10978 ///
10979 /// # Example
10980 /// ```ignore,no_run
10981 /// # use google_cloud_vmwareengine_v1::model::Subnet;
10982 /// let x = Subnet::new().set_vlan_id(42);
10983 /// ```
10984 pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10985 self.vlan_id = v.into();
10986 self
10987 }
10988}
10989
10990impl wkt::message::Message for Subnet {
10991 fn typename() -> &'static str {
10992 "type.googleapis.com/google.cloud.vmwareengine.v1.Subnet"
10993 }
10994}
10995
10996/// Defines additional types related to [Subnet].
10997pub mod subnet {
10998 #[allow(unused_imports)]
10999 use super::*;
11000
11001 /// Defines possible states of subnets.
11002 ///
11003 /// # Working with unknown values
11004 ///
11005 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11006 /// additional enum variants at any time. Adding new variants is not considered
11007 /// a breaking change. Applications should write their code in anticipation of:
11008 ///
11009 /// - New values appearing in future releases of the client library, **and**
11010 /// - New values received dynamically, without application changes.
11011 ///
11012 /// Please consult the [Working with enums] section in the user guide for some
11013 /// guidelines.
11014 ///
11015 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11016 #[derive(Clone, Debug, PartialEq)]
11017 #[non_exhaustive]
11018 pub enum State {
11019 /// The default value. This value should never be used.
11020 Unspecified,
11021 /// The subnet is ready.
11022 Active,
11023 /// The subnet is being created.
11024 Creating,
11025 /// The subnet is being updated.
11026 Updating,
11027 /// The subnet is being deleted.
11028 Deleting,
11029 /// Changes requested in the last operation are being propagated.
11030 Reconciling,
11031 /// Last operation on the subnet did not succeed. Subnet's payload is
11032 /// reverted back to its most recent working state.
11033 Failed,
11034 /// If set, the enum was initialized with an unknown value.
11035 ///
11036 /// Applications can examine the value using [State::value] or
11037 /// [State::name].
11038 UnknownValue(state::UnknownValue),
11039 }
11040
11041 #[doc(hidden)]
11042 pub mod state {
11043 #[allow(unused_imports)]
11044 use super::*;
11045 #[derive(Clone, Debug, PartialEq)]
11046 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11047 }
11048
11049 impl State {
11050 /// Gets the enum value.
11051 ///
11052 /// Returns `None` if the enum contains an unknown value deserialized from
11053 /// the string representation of enums.
11054 pub fn value(&self) -> std::option::Option<i32> {
11055 match self {
11056 Self::Unspecified => std::option::Option::Some(0),
11057 Self::Active => std::option::Option::Some(1),
11058 Self::Creating => std::option::Option::Some(2),
11059 Self::Updating => std::option::Option::Some(3),
11060 Self::Deleting => std::option::Option::Some(4),
11061 Self::Reconciling => std::option::Option::Some(5),
11062 Self::Failed => std::option::Option::Some(6),
11063 Self::UnknownValue(u) => u.0.value(),
11064 }
11065 }
11066
11067 /// Gets the enum value as a string.
11068 ///
11069 /// Returns `None` if the enum contains an unknown value deserialized from
11070 /// the integer representation of enums.
11071 pub fn name(&self) -> std::option::Option<&str> {
11072 match self {
11073 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11074 Self::Active => std::option::Option::Some("ACTIVE"),
11075 Self::Creating => std::option::Option::Some("CREATING"),
11076 Self::Updating => std::option::Option::Some("UPDATING"),
11077 Self::Deleting => std::option::Option::Some("DELETING"),
11078 Self::Reconciling => std::option::Option::Some("RECONCILING"),
11079 Self::Failed => std::option::Option::Some("FAILED"),
11080 Self::UnknownValue(u) => u.0.name(),
11081 }
11082 }
11083 }
11084
11085 impl std::default::Default for State {
11086 fn default() -> Self {
11087 use std::convert::From;
11088 Self::from(0)
11089 }
11090 }
11091
11092 impl std::fmt::Display for State {
11093 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11094 wkt::internal::display_enum(f, self.name(), self.value())
11095 }
11096 }
11097
11098 impl std::convert::From<i32> for State {
11099 fn from(value: i32) -> Self {
11100 match value {
11101 0 => Self::Unspecified,
11102 1 => Self::Active,
11103 2 => Self::Creating,
11104 3 => Self::Updating,
11105 4 => Self::Deleting,
11106 5 => Self::Reconciling,
11107 6 => Self::Failed,
11108 _ => Self::UnknownValue(state::UnknownValue(
11109 wkt::internal::UnknownEnumValue::Integer(value),
11110 )),
11111 }
11112 }
11113 }
11114
11115 impl std::convert::From<&str> for State {
11116 fn from(value: &str) -> Self {
11117 use std::string::ToString;
11118 match value {
11119 "STATE_UNSPECIFIED" => Self::Unspecified,
11120 "ACTIVE" => Self::Active,
11121 "CREATING" => Self::Creating,
11122 "UPDATING" => Self::Updating,
11123 "DELETING" => Self::Deleting,
11124 "RECONCILING" => Self::Reconciling,
11125 "FAILED" => Self::Failed,
11126 _ => Self::UnknownValue(state::UnknownValue(
11127 wkt::internal::UnknownEnumValue::String(value.to_string()),
11128 )),
11129 }
11130 }
11131 }
11132
11133 impl serde::ser::Serialize for State {
11134 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11135 where
11136 S: serde::Serializer,
11137 {
11138 match self {
11139 Self::Unspecified => serializer.serialize_i32(0),
11140 Self::Active => serializer.serialize_i32(1),
11141 Self::Creating => serializer.serialize_i32(2),
11142 Self::Updating => serializer.serialize_i32(3),
11143 Self::Deleting => serializer.serialize_i32(4),
11144 Self::Reconciling => serializer.serialize_i32(5),
11145 Self::Failed => serializer.serialize_i32(6),
11146 Self::UnknownValue(u) => u.0.serialize(serializer),
11147 }
11148 }
11149 }
11150
11151 impl<'de> serde::de::Deserialize<'de> for State {
11152 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11153 where
11154 D: serde::Deserializer<'de>,
11155 {
11156 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11157 ".google.cloud.vmwareengine.v1.Subnet.State",
11158 ))
11159 }
11160 }
11161}
11162
11163/// External access firewall rules for filtering incoming traffic destined to
11164/// `ExternalAddress` resources.
11165#[derive(Clone, Default, PartialEq)]
11166#[non_exhaustive]
11167pub struct ExternalAccessRule {
11168 /// Output only. The resource name of this external access rule.
11169 /// Resource names are schemeless URIs that follow the conventions in
11170 /// <https://cloud.google.com/apis/design/resource_names>.
11171 /// For example:
11172 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
11173 pub name: std::string::String,
11174
11175 /// Output only. Creation time of this resource.
11176 pub create_time: std::option::Option<wkt::Timestamp>,
11177
11178 /// Output only. Last update time of this resource.
11179 pub update_time: std::option::Option<wkt::Timestamp>,
11180
11181 /// User-provided description for this external access rule.
11182 pub description: std::string::String,
11183
11184 /// External access rule priority, which determines the external access rule to
11185 /// use when multiple rules apply. If multiple rules have the same priority,
11186 /// their ordering is non-deterministic. If specific ordering is required,
11187 /// assign unique priorities to enforce such ordering. The external access rule
11188 /// priority is an integer from 100 to 4096, both inclusive. Lower integers
11189 /// indicate higher precedence. For example, a rule with priority `100` has
11190 /// higher precedence than a rule with priority `101`.
11191 pub priority: i32,
11192
11193 /// The action that the external access rule performs.
11194 pub action: crate::model::external_access_rule::Action,
11195
11196 /// The IP protocol to which the external access rule applies. This value can
11197 /// be one of the following three protocol strings (not case-sensitive):
11198 /// `tcp`, `udp`, or `icmp`.
11199 pub ip_protocol: std::string::String,
11200
11201 /// If source ranges are specified, the external access rule applies only to
11202 /// traffic that has a source IP address in these ranges. These ranges can
11203 /// either be expressed in the CIDR format or as an IP address. As only inbound
11204 /// rules are supported, `ExternalAddress` resources cannot be the source IP
11205 /// addresses of an external access rule. To match all source addresses,
11206 /// specify `0.0.0.0/0`.
11207 pub source_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11208
11209 /// A list of source ports to which the external access rule applies. This
11210 /// field is only applicable for the UDP or TCP protocol.
11211 /// Each entry must be either an integer or a range. For example: `["22"]`,
11212 /// `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
11213 /// `["0-65535"]`.
11214 pub source_ports: std::vec::Vec<std::string::String>,
11215
11216 /// If destination ranges are specified, the external access rule applies only
11217 /// to the traffic that has a destination IP address in these ranges. The
11218 /// specified IP addresses must have reserved external IP addresses in the
11219 /// scope of the parent network policy. To match all external IP addresses in
11220 /// the scope of the parent network policy, specify `0.0.0.0/0`. To match a
11221 /// specific external IP address, specify it using the
11222 /// `IpRange.external_address` property.
11223 pub destination_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11224
11225 /// A list of destination ports to which the external access rule applies. This
11226 /// field is only applicable for the UDP or TCP protocol.
11227 /// Each entry must be either an integer or a range. For example: `["22"]`,
11228 /// `["80","443"]`, or `["12345-12349"]`. To match all destination ports,
11229 /// specify `["0-65535"]`.
11230 pub destination_ports: std::vec::Vec<std::string::String>,
11231
11232 /// Output only. The state of the resource.
11233 pub state: crate::model::external_access_rule::State,
11234
11235 /// Output only. System-generated unique identifier for the resource.
11236 pub uid: std::string::String,
11237
11238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11239}
11240
11241impl ExternalAccessRule {
11242 pub fn new() -> Self {
11243 std::default::Default::default()
11244 }
11245
11246 /// Sets the value of [name][crate::model::ExternalAccessRule::name].
11247 ///
11248 /// # Example
11249 /// ```ignore,no_run
11250 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11251 /// let x = ExternalAccessRule::new().set_name("example");
11252 /// ```
11253 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11254 self.name = v.into();
11255 self
11256 }
11257
11258 /// Sets the value of [create_time][crate::model::ExternalAccessRule::create_time].
11259 ///
11260 /// # Example
11261 /// ```ignore,no_run
11262 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11263 /// use wkt::Timestamp;
11264 /// let x = ExternalAccessRule::new().set_create_time(Timestamp::default()/* use setters */);
11265 /// ```
11266 pub fn set_create_time<T>(mut self, v: T) -> Self
11267 where
11268 T: std::convert::Into<wkt::Timestamp>,
11269 {
11270 self.create_time = std::option::Option::Some(v.into());
11271 self
11272 }
11273
11274 /// Sets or clears the value of [create_time][crate::model::ExternalAccessRule::create_time].
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11279 /// use wkt::Timestamp;
11280 /// let x = ExternalAccessRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11281 /// let x = ExternalAccessRule::new().set_or_clear_create_time(None::<Timestamp>);
11282 /// ```
11283 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11284 where
11285 T: std::convert::Into<wkt::Timestamp>,
11286 {
11287 self.create_time = v.map(|x| x.into());
11288 self
11289 }
11290
11291 /// Sets the value of [update_time][crate::model::ExternalAccessRule::update_time].
11292 ///
11293 /// # Example
11294 /// ```ignore,no_run
11295 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11296 /// use wkt::Timestamp;
11297 /// let x = ExternalAccessRule::new().set_update_time(Timestamp::default()/* use setters */);
11298 /// ```
11299 pub fn set_update_time<T>(mut self, v: T) -> Self
11300 where
11301 T: std::convert::Into<wkt::Timestamp>,
11302 {
11303 self.update_time = std::option::Option::Some(v.into());
11304 self
11305 }
11306
11307 /// Sets or clears the value of [update_time][crate::model::ExternalAccessRule::update_time].
11308 ///
11309 /// # Example
11310 /// ```ignore,no_run
11311 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11312 /// use wkt::Timestamp;
11313 /// let x = ExternalAccessRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11314 /// let x = ExternalAccessRule::new().set_or_clear_update_time(None::<Timestamp>);
11315 /// ```
11316 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11317 where
11318 T: std::convert::Into<wkt::Timestamp>,
11319 {
11320 self.update_time = v.map(|x| x.into());
11321 self
11322 }
11323
11324 /// Sets the value of [description][crate::model::ExternalAccessRule::description].
11325 ///
11326 /// # Example
11327 /// ```ignore,no_run
11328 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11329 /// let x = ExternalAccessRule::new().set_description("example");
11330 /// ```
11331 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11332 self.description = v.into();
11333 self
11334 }
11335
11336 /// Sets the value of [priority][crate::model::ExternalAccessRule::priority].
11337 ///
11338 /// # Example
11339 /// ```ignore,no_run
11340 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11341 /// let x = ExternalAccessRule::new().set_priority(42);
11342 /// ```
11343 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11344 self.priority = v.into();
11345 self
11346 }
11347
11348 /// Sets the value of [action][crate::model::ExternalAccessRule::action].
11349 ///
11350 /// # Example
11351 /// ```ignore,no_run
11352 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11353 /// use google_cloud_vmwareengine_v1::model::external_access_rule::Action;
11354 /// let x0 = ExternalAccessRule::new().set_action(Action::Allow);
11355 /// let x1 = ExternalAccessRule::new().set_action(Action::Deny);
11356 /// ```
11357 pub fn set_action<T: std::convert::Into<crate::model::external_access_rule::Action>>(
11358 mut self,
11359 v: T,
11360 ) -> Self {
11361 self.action = v.into();
11362 self
11363 }
11364
11365 /// Sets the value of [ip_protocol][crate::model::ExternalAccessRule::ip_protocol].
11366 ///
11367 /// # Example
11368 /// ```ignore,no_run
11369 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11370 /// let x = ExternalAccessRule::new().set_ip_protocol("example");
11371 /// ```
11372 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11373 self.ip_protocol = v.into();
11374 self
11375 }
11376
11377 /// Sets the value of [source_ip_ranges][crate::model::ExternalAccessRule::source_ip_ranges].
11378 ///
11379 /// # Example
11380 /// ```ignore,no_run
11381 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11382 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11383 /// let x = ExternalAccessRule::new()
11384 /// .set_source_ip_ranges([
11385 /// IpRange::default()/* use setters */,
11386 /// IpRange::default()/* use (different) setters */,
11387 /// ]);
11388 /// ```
11389 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
11390 where
11391 T: std::iter::IntoIterator<Item = V>,
11392 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11393 {
11394 use std::iter::Iterator;
11395 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11396 self
11397 }
11398
11399 /// Sets the value of [source_ports][crate::model::ExternalAccessRule::source_ports].
11400 ///
11401 /// # Example
11402 /// ```ignore,no_run
11403 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11404 /// let x = ExternalAccessRule::new().set_source_ports(["a", "b", "c"]);
11405 /// ```
11406 pub fn set_source_ports<T, V>(mut self, v: T) -> Self
11407 where
11408 T: std::iter::IntoIterator<Item = V>,
11409 V: std::convert::Into<std::string::String>,
11410 {
11411 use std::iter::Iterator;
11412 self.source_ports = v.into_iter().map(|i| i.into()).collect();
11413 self
11414 }
11415
11416 /// Sets the value of [destination_ip_ranges][crate::model::ExternalAccessRule::destination_ip_ranges].
11417 ///
11418 /// # Example
11419 /// ```ignore,no_run
11420 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11421 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11422 /// let x = ExternalAccessRule::new()
11423 /// .set_destination_ip_ranges([
11424 /// IpRange::default()/* use setters */,
11425 /// IpRange::default()/* use (different) setters */,
11426 /// ]);
11427 /// ```
11428 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
11429 where
11430 T: std::iter::IntoIterator<Item = V>,
11431 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11432 {
11433 use std::iter::Iterator;
11434 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11435 self
11436 }
11437
11438 /// Sets the value of [destination_ports][crate::model::ExternalAccessRule::destination_ports].
11439 ///
11440 /// # Example
11441 /// ```ignore,no_run
11442 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11443 /// let x = ExternalAccessRule::new().set_destination_ports(["a", "b", "c"]);
11444 /// ```
11445 pub fn set_destination_ports<T, V>(mut self, v: T) -> Self
11446 where
11447 T: std::iter::IntoIterator<Item = V>,
11448 V: std::convert::Into<std::string::String>,
11449 {
11450 use std::iter::Iterator;
11451 self.destination_ports = v.into_iter().map(|i| i.into()).collect();
11452 self
11453 }
11454
11455 /// Sets the value of [state][crate::model::ExternalAccessRule::state].
11456 ///
11457 /// # Example
11458 /// ```ignore,no_run
11459 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11460 /// use google_cloud_vmwareengine_v1::model::external_access_rule::State;
11461 /// let x0 = ExternalAccessRule::new().set_state(State::Active);
11462 /// let x1 = ExternalAccessRule::new().set_state(State::Creating);
11463 /// let x2 = ExternalAccessRule::new().set_state(State::Updating);
11464 /// ```
11465 pub fn set_state<T: std::convert::Into<crate::model::external_access_rule::State>>(
11466 mut self,
11467 v: T,
11468 ) -> Self {
11469 self.state = v.into();
11470 self
11471 }
11472
11473 /// Sets the value of [uid][crate::model::ExternalAccessRule::uid].
11474 ///
11475 /// # Example
11476 /// ```ignore,no_run
11477 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11478 /// let x = ExternalAccessRule::new().set_uid("example");
11479 /// ```
11480 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11481 self.uid = v.into();
11482 self
11483 }
11484}
11485
11486impl wkt::message::Message for ExternalAccessRule {
11487 fn typename() -> &'static str {
11488 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule"
11489 }
11490}
11491
11492/// Defines additional types related to [ExternalAccessRule].
11493pub mod external_access_rule {
11494 #[allow(unused_imports)]
11495 use super::*;
11496
11497 /// An IP range provided in any one of the supported formats.
11498 #[derive(Clone, Default, PartialEq)]
11499 #[non_exhaustive]
11500 pub struct IpRange {
11501 pub ip_range: std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11502
11503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11504 }
11505
11506 impl IpRange {
11507 pub fn new() -> Self {
11508 std::default::Default::default()
11509 }
11510
11511 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range].
11512 ///
11513 /// Note that all the setters affecting `ip_range` are mutually
11514 /// exclusive.
11515 ///
11516 /// # Example
11517 /// ```ignore,no_run
11518 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11519 /// use google_cloud_vmwareengine_v1::model::external_access_rule::ip_range::IpRange as IpRangeOneOf;
11520 /// let x = IpRange::new().set_ip_range(Some(IpRangeOneOf::IpAddress("example".to_string())));
11521 /// ```
11522 pub fn set_ip_range<
11523 T: std::convert::Into<
11524 std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11525 >,
11526 >(
11527 mut self,
11528 v: T,
11529 ) -> Self {
11530 self.ip_range = v.into();
11531 self
11532 }
11533
11534 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11535 /// if it holds a `IpAddress`, `None` if the field is not set or
11536 /// holds a different branch.
11537 pub fn ip_address(&self) -> std::option::Option<&std::string::String> {
11538 #[allow(unreachable_patterns)]
11539 self.ip_range.as_ref().and_then(|v| match v {
11540 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v) => {
11541 std::option::Option::Some(v)
11542 }
11543 _ => std::option::Option::None,
11544 })
11545 }
11546
11547 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11548 /// to hold a `IpAddress`.
11549 ///
11550 /// Note that all the setters affecting `ip_range` are
11551 /// mutually exclusive.
11552 ///
11553 /// # Example
11554 /// ```ignore,no_run
11555 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11556 /// let x = IpRange::new().set_ip_address("example");
11557 /// assert!(x.ip_address().is_some());
11558 /// assert!(x.ip_address_range().is_none());
11559 /// assert!(x.external_address().is_none());
11560 /// ```
11561 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11562 self.ip_range = std::option::Option::Some(
11563 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v.into()),
11564 );
11565 self
11566 }
11567
11568 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11569 /// if it holds a `IpAddressRange`, `None` if the field is not set or
11570 /// holds a different branch.
11571 pub fn ip_address_range(&self) -> std::option::Option<&std::string::String> {
11572 #[allow(unreachable_patterns)]
11573 self.ip_range.as_ref().and_then(|v| match v {
11574 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v) => {
11575 std::option::Option::Some(v)
11576 }
11577 _ => std::option::Option::None,
11578 })
11579 }
11580
11581 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11582 /// to hold a `IpAddressRange`.
11583 ///
11584 /// Note that all the setters affecting `ip_range` are
11585 /// mutually exclusive.
11586 ///
11587 /// # Example
11588 /// ```ignore,no_run
11589 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11590 /// let x = IpRange::new().set_ip_address_range("example");
11591 /// assert!(x.ip_address_range().is_some());
11592 /// assert!(x.ip_address().is_none());
11593 /// assert!(x.external_address().is_none());
11594 /// ```
11595 pub fn set_ip_address_range<T: std::convert::Into<std::string::String>>(
11596 mut self,
11597 v: T,
11598 ) -> Self {
11599 self.ip_range = std::option::Option::Some(
11600 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v.into()),
11601 );
11602 self
11603 }
11604
11605 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11606 /// if it holds a `ExternalAddress`, `None` if the field is not set or
11607 /// holds a different branch.
11608 pub fn external_address(&self) -> std::option::Option<&std::string::String> {
11609 #[allow(unreachable_patterns)]
11610 self.ip_range.as_ref().and_then(|v| match v {
11611 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v) => {
11612 std::option::Option::Some(v)
11613 }
11614 _ => std::option::Option::None,
11615 })
11616 }
11617
11618 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11619 /// to hold a `ExternalAddress`.
11620 ///
11621 /// Note that all the setters affecting `ip_range` are
11622 /// mutually exclusive.
11623 ///
11624 /// # Example
11625 /// ```ignore,no_run
11626 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11627 /// let x = IpRange::new().set_external_address("example");
11628 /// assert!(x.external_address().is_some());
11629 /// assert!(x.ip_address().is_none());
11630 /// assert!(x.ip_address_range().is_none());
11631 /// ```
11632 pub fn set_external_address<T: std::convert::Into<std::string::String>>(
11633 mut self,
11634 v: T,
11635 ) -> Self {
11636 self.ip_range = std::option::Option::Some(
11637 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v.into()),
11638 );
11639 self
11640 }
11641 }
11642
11643 impl wkt::message::Message for IpRange {
11644 fn typename() -> &'static str {
11645 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange"
11646 }
11647 }
11648
11649 /// Defines additional types related to [IpRange].
11650 pub mod ip_range {
11651 #[allow(unused_imports)]
11652 use super::*;
11653
11654 #[derive(Clone, Debug, PartialEq)]
11655 #[non_exhaustive]
11656 pub enum IpRange {
11657 /// A single IP address. For example: `10.0.0.5`.
11658 IpAddress(std::string::String),
11659 /// An IP address range in the CIDR format. For example: `10.0.0.0/24`.
11660 IpAddressRange(std::string::String),
11661 /// The name of an `ExternalAddress` resource. The external address must
11662 /// have been reserved in the scope of this external access rule's parent
11663 /// network policy. Provide the external address name in the form of
11664 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`.
11665 /// For example:
11666 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
11667 ExternalAddress(std::string::String),
11668 }
11669 }
11670
11671 /// Action determines whether the external access rule permits or blocks
11672 /// traffic, subject to the other components of the rule matching the traffic.
11673 ///
11674 /// # Working with unknown values
11675 ///
11676 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11677 /// additional enum variants at any time. Adding new variants is not considered
11678 /// a breaking change. Applications should write their code in anticipation of:
11679 ///
11680 /// - New values appearing in future releases of the client library, **and**
11681 /// - New values received dynamically, without application changes.
11682 ///
11683 /// Please consult the [Working with enums] section in the user guide for some
11684 /// guidelines.
11685 ///
11686 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11687 #[derive(Clone, Debug, PartialEq)]
11688 #[non_exhaustive]
11689 pub enum Action {
11690 /// Defaults to allow.
11691 Unspecified,
11692 /// Allows connections that match the other specified components.
11693 Allow,
11694 /// Blocks connections that match the other specified components.
11695 Deny,
11696 /// If set, the enum was initialized with an unknown value.
11697 ///
11698 /// Applications can examine the value using [Action::value] or
11699 /// [Action::name].
11700 UnknownValue(action::UnknownValue),
11701 }
11702
11703 #[doc(hidden)]
11704 pub mod action {
11705 #[allow(unused_imports)]
11706 use super::*;
11707 #[derive(Clone, Debug, PartialEq)]
11708 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11709 }
11710
11711 impl Action {
11712 /// Gets the enum value.
11713 ///
11714 /// Returns `None` if the enum contains an unknown value deserialized from
11715 /// the string representation of enums.
11716 pub fn value(&self) -> std::option::Option<i32> {
11717 match self {
11718 Self::Unspecified => std::option::Option::Some(0),
11719 Self::Allow => std::option::Option::Some(1),
11720 Self::Deny => std::option::Option::Some(2),
11721 Self::UnknownValue(u) => u.0.value(),
11722 }
11723 }
11724
11725 /// Gets the enum value as a string.
11726 ///
11727 /// Returns `None` if the enum contains an unknown value deserialized from
11728 /// the integer representation of enums.
11729 pub fn name(&self) -> std::option::Option<&str> {
11730 match self {
11731 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
11732 Self::Allow => std::option::Option::Some("ALLOW"),
11733 Self::Deny => std::option::Option::Some("DENY"),
11734 Self::UnknownValue(u) => u.0.name(),
11735 }
11736 }
11737 }
11738
11739 impl std::default::Default for Action {
11740 fn default() -> Self {
11741 use std::convert::From;
11742 Self::from(0)
11743 }
11744 }
11745
11746 impl std::fmt::Display for Action {
11747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11748 wkt::internal::display_enum(f, self.name(), self.value())
11749 }
11750 }
11751
11752 impl std::convert::From<i32> for Action {
11753 fn from(value: i32) -> Self {
11754 match value {
11755 0 => Self::Unspecified,
11756 1 => Self::Allow,
11757 2 => Self::Deny,
11758 _ => Self::UnknownValue(action::UnknownValue(
11759 wkt::internal::UnknownEnumValue::Integer(value),
11760 )),
11761 }
11762 }
11763 }
11764
11765 impl std::convert::From<&str> for Action {
11766 fn from(value: &str) -> Self {
11767 use std::string::ToString;
11768 match value {
11769 "ACTION_UNSPECIFIED" => Self::Unspecified,
11770 "ALLOW" => Self::Allow,
11771 "DENY" => Self::Deny,
11772 _ => Self::UnknownValue(action::UnknownValue(
11773 wkt::internal::UnknownEnumValue::String(value.to_string()),
11774 )),
11775 }
11776 }
11777 }
11778
11779 impl serde::ser::Serialize for Action {
11780 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11781 where
11782 S: serde::Serializer,
11783 {
11784 match self {
11785 Self::Unspecified => serializer.serialize_i32(0),
11786 Self::Allow => serializer.serialize_i32(1),
11787 Self::Deny => serializer.serialize_i32(2),
11788 Self::UnknownValue(u) => u.0.serialize(serializer),
11789 }
11790 }
11791 }
11792
11793 impl<'de> serde::de::Deserialize<'de> for Action {
11794 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11795 where
11796 D: serde::Deserializer<'de>,
11797 {
11798 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
11799 ".google.cloud.vmwareengine.v1.ExternalAccessRule.Action",
11800 ))
11801 }
11802 }
11803
11804 /// Defines possible states of external access firewall rules.
11805 ///
11806 /// # Working with unknown values
11807 ///
11808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11809 /// additional enum variants at any time. Adding new variants is not considered
11810 /// a breaking change. Applications should write their code in anticipation of:
11811 ///
11812 /// - New values appearing in future releases of the client library, **and**
11813 /// - New values received dynamically, without application changes.
11814 ///
11815 /// Please consult the [Working with enums] section in the user guide for some
11816 /// guidelines.
11817 ///
11818 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11819 #[derive(Clone, Debug, PartialEq)]
11820 #[non_exhaustive]
11821 pub enum State {
11822 /// The default value. This value is used if the state is omitted.
11823 Unspecified,
11824 /// The rule is ready.
11825 Active,
11826 /// The rule is being created.
11827 Creating,
11828 /// The rule is being updated.
11829 Updating,
11830 /// The rule is being deleted.
11831 Deleting,
11832 /// If set, the enum was initialized with an unknown value.
11833 ///
11834 /// Applications can examine the value using [State::value] or
11835 /// [State::name].
11836 UnknownValue(state::UnknownValue),
11837 }
11838
11839 #[doc(hidden)]
11840 pub mod state {
11841 #[allow(unused_imports)]
11842 use super::*;
11843 #[derive(Clone, Debug, PartialEq)]
11844 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11845 }
11846
11847 impl State {
11848 /// Gets the enum value.
11849 ///
11850 /// Returns `None` if the enum contains an unknown value deserialized from
11851 /// the string representation of enums.
11852 pub fn value(&self) -> std::option::Option<i32> {
11853 match self {
11854 Self::Unspecified => std::option::Option::Some(0),
11855 Self::Active => std::option::Option::Some(1),
11856 Self::Creating => std::option::Option::Some(2),
11857 Self::Updating => std::option::Option::Some(3),
11858 Self::Deleting => std::option::Option::Some(4),
11859 Self::UnknownValue(u) => u.0.value(),
11860 }
11861 }
11862
11863 /// Gets the enum value as a string.
11864 ///
11865 /// Returns `None` if the enum contains an unknown value deserialized from
11866 /// the integer representation of enums.
11867 pub fn name(&self) -> std::option::Option<&str> {
11868 match self {
11869 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11870 Self::Active => std::option::Option::Some("ACTIVE"),
11871 Self::Creating => std::option::Option::Some("CREATING"),
11872 Self::Updating => std::option::Option::Some("UPDATING"),
11873 Self::Deleting => std::option::Option::Some("DELETING"),
11874 Self::UnknownValue(u) => u.0.name(),
11875 }
11876 }
11877 }
11878
11879 impl std::default::Default for State {
11880 fn default() -> Self {
11881 use std::convert::From;
11882 Self::from(0)
11883 }
11884 }
11885
11886 impl std::fmt::Display for State {
11887 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11888 wkt::internal::display_enum(f, self.name(), self.value())
11889 }
11890 }
11891
11892 impl std::convert::From<i32> for State {
11893 fn from(value: i32) -> Self {
11894 match value {
11895 0 => Self::Unspecified,
11896 1 => Self::Active,
11897 2 => Self::Creating,
11898 3 => Self::Updating,
11899 4 => Self::Deleting,
11900 _ => Self::UnknownValue(state::UnknownValue(
11901 wkt::internal::UnknownEnumValue::Integer(value),
11902 )),
11903 }
11904 }
11905 }
11906
11907 impl std::convert::From<&str> for State {
11908 fn from(value: &str) -> Self {
11909 use std::string::ToString;
11910 match value {
11911 "STATE_UNSPECIFIED" => Self::Unspecified,
11912 "ACTIVE" => Self::Active,
11913 "CREATING" => Self::Creating,
11914 "UPDATING" => Self::Updating,
11915 "DELETING" => Self::Deleting,
11916 _ => Self::UnknownValue(state::UnknownValue(
11917 wkt::internal::UnknownEnumValue::String(value.to_string()),
11918 )),
11919 }
11920 }
11921 }
11922
11923 impl serde::ser::Serialize for State {
11924 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11925 where
11926 S: serde::Serializer,
11927 {
11928 match self {
11929 Self::Unspecified => serializer.serialize_i32(0),
11930 Self::Active => serializer.serialize_i32(1),
11931 Self::Creating => serializer.serialize_i32(2),
11932 Self::Updating => serializer.serialize_i32(3),
11933 Self::Deleting => serializer.serialize_i32(4),
11934 Self::UnknownValue(u) => u.0.serialize(serializer),
11935 }
11936 }
11937 }
11938
11939 impl<'de> serde::de::Deserialize<'de> for State {
11940 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11941 where
11942 D: serde::Deserializer<'de>,
11943 {
11944 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11945 ".google.cloud.vmwareengine.v1.ExternalAccessRule.State",
11946 ))
11947 }
11948 }
11949}
11950
11951/// Logging server to receive vCenter or ESXi logs.
11952#[derive(Clone, Default, PartialEq)]
11953#[non_exhaustive]
11954pub struct LoggingServer {
11955 /// Output only. The resource name of this logging server.
11956 /// Resource names are schemeless URIs that follow the conventions in
11957 /// <https://cloud.google.com/apis/design/resource_names>.
11958 /// For example:
11959 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
11960 pub name: std::string::String,
11961
11962 /// Output only. Creation time of this resource.
11963 pub create_time: std::option::Option<wkt::Timestamp>,
11964
11965 /// Output only. Last update time of this resource.
11966 pub update_time: std::option::Option<wkt::Timestamp>,
11967
11968 /// Required. Fully-qualified domain name (FQDN) or IP Address of the logging
11969 /// server.
11970 pub hostname: std::string::String,
11971
11972 /// Required. Port number at which the logging server receives logs.
11973 pub port: i32,
11974
11975 /// Required. Protocol used by vCenter to send logs to a logging server.
11976 pub protocol: crate::model::logging_server::Protocol,
11977
11978 /// Required. The type of component that produces logs that will be forwarded
11979 /// to this logging server.
11980 pub source_type: crate::model::logging_server::SourceType,
11981
11982 /// Output only. System-generated unique identifier for the resource.
11983 pub uid: std::string::String,
11984
11985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11986}
11987
11988impl LoggingServer {
11989 pub fn new() -> Self {
11990 std::default::Default::default()
11991 }
11992
11993 /// Sets the value of [name][crate::model::LoggingServer::name].
11994 ///
11995 /// # Example
11996 /// ```ignore,no_run
11997 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
11998 /// let x = LoggingServer::new().set_name("example");
11999 /// ```
12000 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12001 self.name = v.into();
12002 self
12003 }
12004
12005 /// Sets the value of [create_time][crate::model::LoggingServer::create_time].
12006 ///
12007 /// # Example
12008 /// ```ignore,no_run
12009 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12010 /// use wkt::Timestamp;
12011 /// let x = LoggingServer::new().set_create_time(Timestamp::default()/* use setters */);
12012 /// ```
12013 pub fn set_create_time<T>(mut self, v: T) -> Self
12014 where
12015 T: std::convert::Into<wkt::Timestamp>,
12016 {
12017 self.create_time = std::option::Option::Some(v.into());
12018 self
12019 }
12020
12021 /// Sets or clears the value of [create_time][crate::model::LoggingServer::create_time].
12022 ///
12023 /// # Example
12024 /// ```ignore,no_run
12025 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12026 /// use wkt::Timestamp;
12027 /// let x = LoggingServer::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12028 /// let x = LoggingServer::new().set_or_clear_create_time(None::<Timestamp>);
12029 /// ```
12030 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12031 where
12032 T: std::convert::Into<wkt::Timestamp>,
12033 {
12034 self.create_time = v.map(|x| x.into());
12035 self
12036 }
12037
12038 /// Sets the value of [update_time][crate::model::LoggingServer::update_time].
12039 ///
12040 /// # Example
12041 /// ```ignore,no_run
12042 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12043 /// use wkt::Timestamp;
12044 /// let x = LoggingServer::new().set_update_time(Timestamp::default()/* use setters */);
12045 /// ```
12046 pub fn set_update_time<T>(mut self, v: T) -> Self
12047 where
12048 T: std::convert::Into<wkt::Timestamp>,
12049 {
12050 self.update_time = std::option::Option::Some(v.into());
12051 self
12052 }
12053
12054 /// Sets or clears the value of [update_time][crate::model::LoggingServer::update_time].
12055 ///
12056 /// # Example
12057 /// ```ignore,no_run
12058 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12059 /// use wkt::Timestamp;
12060 /// let x = LoggingServer::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12061 /// let x = LoggingServer::new().set_or_clear_update_time(None::<Timestamp>);
12062 /// ```
12063 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12064 where
12065 T: std::convert::Into<wkt::Timestamp>,
12066 {
12067 self.update_time = v.map(|x| x.into());
12068 self
12069 }
12070
12071 /// Sets the value of [hostname][crate::model::LoggingServer::hostname].
12072 ///
12073 /// # Example
12074 /// ```ignore,no_run
12075 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12076 /// let x = LoggingServer::new().set_hostname("example");
12077 /// ```
12078 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12079 self.hostname = v.into();
12080 self
12081 }
12082
12083 /// Sets the value of [port][crate::model::LoggingServer::port].
12084 ///
12085 /// # Example
12086 /// ```ignore,no_run
12087 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12088 /// let x = LoggingServer::new().set_port(42);
12089 /// ```
12090 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12091 self.port = v.into();
12092 self
12093 }
12094
12095 /// Sets the value of [protocol][crate::model::LoggingServer::protocol].
12096 ///
12097 /// # Example
12098 /// ```ignore,no_run
12099 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12100 /// use google_cloud_vmwareengine_v1::model::logging_server::Protocol;
12101 /// let x0 = LoggingServer::new().set_protocol(Protocol::Udp);
12102 /// let x1 = LoggingServer::new().set_protocol(Protocol::Tcp);
12103 /// let x2 = LoggingServer::new().set_protocol(Protocol::Tls);
12104 /// ```
12105 pub fn set_protocol<T: std::convert::Into<crate::model::logging_server::Protocol>>(
12106 mut self,
12107 v: T,
12108 ) -> Self {
12109 self.protocol = v.into();
12110 self
12111 }
12112
12113 /// Sets the value of [source_type][crate::model::LoggingServer::source_type].
12114 ///
12115 /// # Example
12116 /// ```ignore,no_run
12117 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12118 /// use google_cloud_vmwareengine_v1::model::logging_server::SourceType;
12119 /// let x0 = LoggingServer::new().set_source_type(SourceType::Esxi);
12120 /// let x1 = LoggingServer::new().set_source_type(SourceType::Vcsa);
12121 /// ```
12122 pub fn set_source_type<T: std::convert::Into<crate::model::logging_server::SourceType>>(
12123 mut self,
12124 v: T,
12125 ) -> Self {
12126 self.source_type = v.into();
12127 self
12128 }
12129
12130 /// Sets the value of [uid][crate::model::LoggingServer::uid].
12131 ///
12132 /// # Example
12133 /// ```ignore,no_run
12134 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12135 /// let x = LoggingServer::new().set_uid("example");
12136 /// ```
12137 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12138 self.uid = v.into();
12139 self
12140 }
12141}
12142
12143impl wkt::message::Message for LoggingServer {
12144 fn typename() -> &'static str {
12145 "type.googleapis.com/google.cloud.vmwareengine.v1.LoggingServer"
12146 }
12147}
12148
12149/// Defines additional types related to [LoggingServer].
12150pub mod logging_server {
12151 #[allow(unused_imports)]
12152 use super::*;
12153
12154 /// Defines possible protocols used to send logs to
12155 /// a logging server.
12156 ///
12157 /// # Working with unknown values
12158 ///
12159 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12160 /// additional enum variants at any time. Adding new variants is not considered
12161 /// a breaking change. Applications should write their code in anticipation of:
12162 ///
12163 /// - New values appearing in future releases of the client library, **and**
12164 /// - New values received dynamically, without application changes.
12165 ///
12166 /// Please consult the [Working with enums] section in the user guide for some
12167 /// guidelines.
12168 ///
12169 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12170 #[derive(Clone, Debug, PartialEq)]
12171 #[non_exhaustive]
12172 pub enum Protocol {
12173 /// Unspecified communications protocol. This is the default value.
12174 Unspecified,
12175 /// UDP
12176 Udp,
12177 /// TCP
12178 Tcp,
12179 /// TLS
12180 Tls,
12181 /// SSL
12182 Ssl,
12183 /// RELP
12184 Relp,
12185 /// If set, the enum was initialized with an unknown value.
12186 ///
12187 /// Applications can examine the value using [Protocol::value] or
12188 /// [Protocol::name].
12189 UnknownValue(protocol::UnknownValue),
12190 }
12191
12192 #[doc(hidden)]
12193 pub mod protocol {
12194 #[allow(unused_imports)]
12195 use super::*;
12196 #[derive(Clone, Debug, PartialEq)]
12197 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12198 }
12199
12200 impl Protocol {
12201 /// Gets the enum value.
12202 ///
12203 /// Returns `None` if the enum contains an unknown value deserialized from
12204 /// the string representation of enums.
12205 pub fn value(&self) -> std::option::Option<i32> {
12206 match self {
12207 Self::Unspecified => std::option::Option::Some(0),
12208 Self::Udp => std::option::Option::Some(1),
12209 Self::Tcp => std::option::Option::Some(2),
12210 Self::Tls => std::option::Option::Some(3),
12211 Self::Ssl => std::option::Option::Some(4),
12212 Self::Relp => std::option::Option::Some(5),
12213 Self::UnknownValue(u) => u.0.value(),
12214 }
12215 }
12216
12217 /// Gets the enum value as a string.
12218 ///
12219 /// Returns `None` if the enum contains an unknown value deserialized from
12220 /// the integer representation of enums.
12221 pub fn name(&self) -> std::option::Option<&str> {
12222 match self {
12223 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
12224 Self::Udp => std::option::Option::Some("UDP"),
12225 Self::Tcp => std::option::Option::Some("TCP"),
12226 Self::Tls => std::option::Option::Some("TLS"),
12227 Self::Ssl => std::option::Option::Some("SSL"),
12228 Self::Relp => std::option::Option::Some("RELP"),
12229 Self::UnknownValue(u) => u.0.name(),
12230 }
12231 }
12232 }
12233
12234 impl std::default::Default for Protocol {
12235 fn default() -> Self {
12236 use std::convert::From;
12237 Self::from(0)
12238 }
12239 }
12240
12241 impl std::fmt::Display for Protocol {
12242 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12243 wkt::internal::display_enum(f, self.name(), self.value())
12244 }
12245 }
12246
12247 impl std::convert::From<i32> for Protocol {
12248 fn from(value: i32) -> Self {
12249 match value {
12250 0 => Self::Unspecified,
12251 1 => Self::Udp,
12252 2 => Self::Tcp,
12253 3 => Self::Tls,
12254 4 => Self::Ssl,
12255 5 => Self::Relp,
12256 _ => Self::UnknownValue(protocol::UnknownValue(
12257 wkt::internal::UnknownEnumValue::Integer(value),
12258 )),
12259 }
12260 }
12261 }
12262
12263 impl std::convert::From<&str> for Protocol {
12264 fn from(value: &str) -> Self {
12265 use std::string::ToString;
12266 match value {
12267 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
12268 "UDP" => Self::Udp,
12269 "TCP" => Self::Tcp,
12270 "TLS" => Self::Tls,
12271 "SSL" => Self::Ssl,
12272 "RELP" => Self::Relp,
12273 _ => Self::UnknownValue(protocol::UnknownValue(
12274 wkt::internal::UnknownEnumValue::String(value.to_string()),
12275 )),
12276 }
12277 }
12278 }
12279
12280 impl serde::ser::Serialize for Protocol {
12281 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12282 where
12283 S: serde::Serializer,
12284 {
12285 match self {
12286 Self::Unspecified => serializer.serialize_i32(0),
12287 Self::Udp => serializer.serialize_i32(1),
12288 Self::Tcp => serializer.serialize_i32(2),
12289 Self::Tls => serializer.serialize_i32(3),
12290 Self::Ssl => serializer.serialize_i32(4),
12291 Self::Relp => serializer.serialize_i32(5),
12292 Self::UnknownValue(u) => u.0.serialize(serializer),
12293 }
12294 }
12295 }
12296
12297 impl<'de> serde::de::Deserialize<'de> for Protocol {
12298 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12299 where
12300 D: serde::Deserializer<'de>,
12301 {
12302 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
12303 ".google.cloud.vmwareengine.v1.LoggingServer.Protocol",
12304 ))
12305 }
12306 }
12307
12308 /// Defines possible types of component that produces logs.
12309 ///
12310 /// # Working with unknown values
12311 ///
12312 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12313 /// additional enum variants at any time. Adding new variants is not considered
12314 /// a breaking change. Applications should write their code in anticipation of:
12315 ///
12316 /// - New values appearing in future releases of the client library, **and**
12317 /// - New values received dynamically, without application changes.
12318 ///
12319 /// Please consult the [Working with enums] section in the user guide for some
12320 /// guidelines.
12321 ///
12322 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12323 #[derive(Clone, Debug, PartialEq)]
12324 #[non_exhaustive]
12325 pub enum SourceType {
12326 /// The default value. This value should never be used.
12327 Unspecified,
12328 /// Logs produced by ESXI hosts
12329 Esxi,
12330 /// Logs produced by vCenter server
12331 Vcsa,
12332 /// If set, the enum was initialized with an unknown value.
12333 ///
12334 /// Applications can examine the value using [SourceType::value] or
12335 /// [SourceType::name].
12336 UnknownValue(source_type::UnknownValue),
12337 }
12338
12339 #[doc(hidden)]
12340 pub mod source_type {
12341 #[allow(unused_imports)]
12342 use super::*;
12343 #[derive(Clone, Debug, PartialEq)]
12344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12345 }
12346
12347 impl SourceType {
12348 /// Gets the enum value.
12349 ///
12350 /// Returns `None` if the enum contains an unknown value deserialized from
12351 /// the string representation of enums.
12352 pub fn value(&self) -> std::option::Option<i32> {
12353 match self {
12354 Self::Unspecified => std::option::Option::Some(0),
12355 Self::Esxi => std::option::Option::Some(1),
12356 Self::Vcsa => std::option::Option::Some(2),
12357 Self::UnknownValue(u) => u.0.value(),
12358 }
12359 }
12360
12361 /// Gets the enum value as a string.
12362 ///
12363 /// Returns `None` if the enum contains an unknown value deserialized from
12364 /// the integer representation of enums.
12365 pub fn name(&self) -> std::option::Option<&str> {
12366 match self {
12367 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12368 Self::Esxi => std::option::Option::Some("ESXI"),
12369 Self::Vcsa => std::option::Option::Some("VCSA"),
12370 Self::UnknownValue(u) => u.0.name(),
12371 }
12372 }
12373 }
12374
12375 impl std::default::Default for SourceType {
12376 fn default() -> Self {
12377 use std::convert::From;
12378 Self::from(0)
12379 }
12380 }
12381
12382 impl std::fmt::Display for SourceType {
12383 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12384 wkt::internal::display_enum(f, self.name(), self.value())
12385 }
12386 }
12387
12388 impl std::convert::From<i32> for SourceType {
12389 fn from(value: i32) -> Self {
12390 match value {
12391 0 => Self::Unspecified,
12392 1 => Self::Esxi,
12393 2 => Self::Vcsa,
12394 _ => Self::UnknownValue(source_type::UnknownValue(
12395 wkt::internal::UnknownEnumValue::Integer(value),
12396 )),
12397 }
12398 }
12399 }
12400
12401 impl std::convert::From<&str> for SourceType {
12402 fn from(value: &str) -> Self {
12403 use std::string::ToString;
12404 match value {
12405 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12406 "ESXI" => Self::Esxi,
12407 "VCSA" => Self::Vcsa,
12408 _ => Self::UnknownValue(source_type::UnknownValue(
12409 wkt::internal::UnknownEnumValue::String(value.to_string()),
12410 )),
12411 }
12412 }
12413 }
12414
12415 impl serde::ser::Serialize for SourceType {
12416 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12417 where
12418 S: serde::Serializer,
12419 {
12420 match self {
12421 Self::Unspecified => serializer.serialize_i32(0),
12422 Self::Esxi => serializer.serialize_i32(1),
12423 Self::Vcsa => serializer.serialize_i32(2),
12424 Self::UnknownValue(u) => u.0.serialize(serializer),
12425 }
12426 }
12427 }
12428
12429 impl<'de> serde::de::Deserialize<'de> for SourceType {
12430 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12431 where
12432 D: serde::Deserializer<'de>,
12433 {
12434 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12435 ".google.cloud.vmwareengine.v1.LoggingServer.SourceType",
12436 ))
12437 }
12438 }
12439}
12440
12441/// Describes node type.
12442#[derive(Clone, Default, PartialEq)]
12443#[non_exhaustive]
12444pub struct NodeType {
12445 /// Output only. The resource name of this node type.
12446 /// Resource names are schemeless URIs that follow the conventions in
12447 /// <https://cloud.google.com/apis/design/resource_names>.
12448 /// For example:
12449 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
12450 pub name: std::string::String,
12451
12452 /// Output only. The canonical identifier of the node type
12453 /// (corresponds to the `NodeType`). For example: standard-72.
12454 pub node_type_id: std::string::String,
12455
12456 /// Output only. The friendly name for this node type.
12457 /// For example: ve1-standard-72
12458 pub display_name: std::string::String,
12459
12460 /// Output only. The total number of virtual CPUs in a single node.
12461 pub virtual_cpu_count: i32,
12462
12463 /// Output only. The total number of CPU cores in a single node.
12464 pub total_core_count: i32,
12465
12466 /// Output only. The amount of physical memory available, defined in GB.
12467 pub memory_gb: i32,
12468
12469 /// Output only. The amount of storage available, defined in GB.
12470 pub disk_size_gb: i32,
12471
12472 /// Output only. List of possible values of custom core count.
12473 pub available_custom_core_counts: std::vec::Vec<i32>,
12474
12475 /// Output only. The type of the resource.
12476 pub kind: crate::model::node_type::Kind,
12477
12478 /// Output only. Families of the node type.
12479 /// For node types to be in the same cluster
12480 /// they must share at least one element in the `families`.
12481 pub families: std::vec::Vec<std::string::String>,
12482
12483 /// Output only. Capabilities of this node type.
12484 pub capabilities: std::vec::Vec<crate::model::node_type::Capability>,
12485
12486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12487}
12488
12489impl NodeType {
12490 pub fn new() -> Self {
12491 std::default::Default::default()
12492 }
12493
12494 /// Sets the value of [name][crate::model::NodeType::name].
12495 ///
12496 /// # Example
12497 /// ```ignore,no_run
12498 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12499 /// let x = NodeType::new().set_name("example");
12500 /// ```
12501 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12502 self.name = v.into();
12503 self
12504 }
12505
12506 /// Sets the value of [node_type_id][crate::model::NodeType::node_type_id].
12507 ///
12508 /// # Example
12509 /// ```ignore,no_run
12510 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12511 /// let x = NodeType::new().set_node_type_id("example");
12512 /// ```
12513 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12514 self.node_type_id = v.into();
12515 self
12516 }
12517
12518 /// Sets the value of [display_name][crate::model::NodeType::display_name].
12519 ///
12520 /// # Example
12521 /// ```ignore,no_run
12522 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12523 /// let x = NodeType::new().set_display_name("example");
12524 /// ```
12525 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12526 self.display_name = v.into();
12527 self
12528 }
12529
12530 /// Sets the value of [virtual_cpu_count][crate::model::NodeType::virtual_cpu_count].
12531 ///
12532 /// # Example
12533 /// ```ignore,no_run
12534 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12535 /// let x = NodeType::new().set_virtual_cpu_count(42);
12536 /// ```
12537 pub fn set_virtual_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12538 self.virtual_cpu_count = v.into();
12539 self
12540 }
12541
12542 /// Sets the value of [total_core_count][crate::model::NodeType::total_core_count].
12543 ///
12544 /// # Example
12545 /// ```ignore,no_run
12546 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12547 /// let x = NodeType::new().set_total_core_count(42);
12548 /// ```
12549 pub fn set_total_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12550 self.total_core_count = v.into();
12551 self
12552 }
12553
12554 /// Sets the value of [memory_gb][crate::model::NodeType::memory_gb].
12555 ///
12556 /// # Example
12557 /// ```ignore,no_run
12558 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12559 /// let x = NodeType::new().set_memory_gb(42);
12560 /// ```
12561 pub fn set_memory_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12562 self.memory_gb = v.into();
12563 self
12564 }
12565
12566 /// Sets the value of [disk_size_gb][crate::model::NodeType::disk_size_gb].
12567 ///
12568 /// # Example
12569 /// ```ignore,no_run
12570 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12571 /// let x = NodeType::new().set_disk_size_gb(42);
12572 /// ```
12573 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12574 self.disk_size_gb = v.into();
12575 self
12576 }
12577
12578 /// Sets the value of [available_custom_core_counts][crate::model::NodeType::available_custom_core_counts].
12579 ///
12580 /// # Example
12581 /// ```ignore,no_run
12582 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12583 /// let x = NodeType::new().set_available_custom_core_counts([1, 2, 3]);
12584 /// ```
12585 pub fn set_available_custom_core_counts<T, V>(mut self, v: T) -> Self
12586 where
12587 T: std::iter::IntoIterator<Item = V>,
12588 V: std::convert::Into<i32>,
12589 {
12590 use std::iter::Iterator;
12591 self.available_custom_core_counts = v.into_iter().map(|i| i.into()).collect();
12592 self
12593 }
12594
12595 /// Sets the value of [kind][crate::model::NodeType::kind].
12596 ///
12597 /// # Example
12598 /// ```ignore,no_run
12599 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12600 /// use google_cloud_vmwareengine_v1::model::node_type::Kind;
12601 /// let x0 = NodeType::new().set_kind(Kind::Standard);
12602 /// let x1 = NodeType::new().set_kind(Kind::StorageOnly);
12603 /// ```
12604 pub fn set_kind<T: std::convert::Into<crate::model::node_type::Kind>>(mut self, v: T) -> Self {
12605 self.kind = v.into();
12606 self
12607 }
12608
12609 /// Sets the value of [families][crate::model::NodeType::families].
12610 ///
12611 /// # Example
12612 /// ```ignore,no_run
12613 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12614 /// let x = NodeType::new().set_families(["a", "b", "c"]);
12615 /// ```
12616 pub fn set_families<T, V>(mut self, v: T) -> Self
12617 where
12618 T: std::iter::IntoIterator<Item = V>,
12619 V: std::convert::Into<std::string::String>,
12620 {
12621 use std::iter::Iterator;
12622 self.families = v.into_iter().map(|i| i.into()).collect();
12623 self
12624 }
12625
12626 /// Sets the value of [capabilities][crate::model::NodeType::capabilities].
12627 ///
12628 /// # Example
12629 /// ```ignore,no_run
12630 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12631 /// use google_cloud_vmwareengine_v1::model::node_type::Capability;
12632 /// let x = NodeType::new().set_capabilities([
12633 /// Capability::StretchedClusters,
12634 /// ]);
12635 /// ```
12636 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
12637 where
12638 T: std::iter::IntoIterator<Item = V>,
12639 V: std::convert::Into<crate::model::node_type::Capability>,
12640 {
12641 use std::iter::Iterator;
12642 self.capabilities = v.into_iter().map(|i| i.into()).collect();
12643 self
12644 }
12645}
12646
12647impl wkt::message::Message for NodeType {
12648 fn typename() -> &'static str {
12649 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeType"
12650 }
12651}
12652
12653/// Defines additional types related to [NodeType].
12654pub mod node_type {
12655 #[allow(unused_imports)]
12656 use super::*;
12657
12658 /// Enum Kind defines possible types of a NodeType.
12659 ///
12660 /// # Working with unknown values
12661 ///
12662 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12663 /// additional enum variants at any time. Adding new variants is not considered
12664 /// a breaking change. Applications should write their code in anticipation of:
12665 ///
12666 /// - New values appearing in future releases of the client library, **and**
12667 /// - New values received dynamically, without application changes.
12668 ///
12669 /// Please consult the [Working with enums] section in the user guide for some
12670 /// guidelines.
12671 ///
12672 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12673 #[derive(Clone, Debug, PartialEq)]
12674 #[non_exhaustive]
12675 pub enum Kind {
12676 /// The default value. This value should never be used.
12677 Unspecified,
12678 /// Standard HCI node.
12679 Standard,
12680 /// Storage only Node.
12681 StorageOnly,
12682 /// If set, the enum was initialized with an unknown value.
12683 ///
12684 /// Applications can examine the value using [Kind::value] or
12685 /// [Kind::name].
12686 UnknownValue(kind::UnknownValue),
12687 }
12688
12689 #[doc(hidden)]
12690 pub mod kind {
12691 #[allow(unused_imports)]
12692 use super::*;
12693 #[derive(Clone, Debug, PartialEq)]
12694 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12695 }
12696
12697 impl Kind {
12698 /// Gets the enum value.
12699 ///
12700 /// Returns `None` if the enum contains an unknown value deserialized from
12701 /// the string representation of enums.
12702 pub fn value(&self) -> std::option::Option<i32> {
12703 match self {
12704 Self::Unspecified => std::option::Option::Some(0),
12705 Self::Standard => std::option::Option::Some(1),
12706 Self::StorageOnly => std::option::Option::Some(2),
12707 Self::UnknownValue(u) => u.0.value(),
12708 }
12709 }
12710
12711 /// Gets the enum value as a string.
12712 ///
12713 /// Returns `None` if the enum contains an unknown value deserialized from
12714 /// the integer representation of enums.
12715 pub fn name(&self) -> std::option::Option<&str> {
12716 match self {
12717 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
12718 Self::Standard => std::option::Option::Some("STANDARD"),
12719 Self::StorageOnly => std::option::Option::Some("STORAGE_ONLY"),
12720 Self::UnknownValue(u) => u.0.name(),
12721 }
12722 }
12723 }
12724
12725 impl std::default::Default for Kind {
12726 fn default() -> Self {
12727 use std::convert::From;
12728 Self::from(0)
12729 }
12730 }
12731
12732 impl std::fmt::Display for Kind {
12733 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12734 wkt::internal::display_enum(f, self.name(), self.value())
12735 }
12736 }
12737
12738 impl std::convert::From<i32> for Kind {
12739 fn from(value: i32) -> Self {
12740 match value {
12741 0 => Self::Unspecified,
12742 1 => Self::Standard,
12743 2 => Self::StorageOnly,
12744 _ => Self::UnknownValue(kind::UnknownValue(
12745 wkt::internal::UnknownEnumValue::Integer(value),
12746 )),
12747 }
12748 }
12749 }
12750
12751 impl std::convert::From<&str> for Kind {
12752 fn from(value: &str) -> Self {
12753 use std::string::ToString;
12754 match value {
12755 "KIND_UNSPECIFIED" => Self::Unspecified,
12756 "STANDARD" => Self::Standard,
12757 "STORAGE_ONLY" => Self::StorageOnly,
12758 _ => Self::UnknownValue(kind::UnknownValue(
12759 wkt::internal::UnknownEnumValue::String(value.to_string()),
12760 )),
12761 }
12762 }
12763 }
12764
12765 impl serde::ser::Serialize for Kind {
12766 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12767 where
12768 S: serde::Serializer,
12769 {
12770 match self {
12771 Self::Unspecified => serializer.serialize_i32(0),
12772 Self::Standard => serializer.serialize_i32(1),
12773 Self::StorageOnly => serializer.serialize_i32(2),
12774 Self::UnknownValue(u) => u.0.serialize(serializer),
12775 }
12776 }
12777 }
12778
12779 impl<'de> serde::de::Deserialize<'de> for Kind {
12780 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12781 where
12782 D: serde::Deserializer<'de>,
12783 {
12784 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
12785 ".google.cloud.vmwareengine.v1.NodeType.Kind",
12786 ))
12787 }
12788 }
12789
12790 /// Capability of a node type.
12791 ///
12792 /// # Working with unknown values
12793 ///
12794 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12795 /// additional enum variants at any time. Adding new variants is not considered
12796 /// a breaking change. Applications should write their code in anticipation of:
12797 ///
12798 /// - New values appearing in future releases of the client library, **and**
12799 /// - New values received dynamically, without application changes.
12800 ///
12801 /// Please consult the [Working with enums] section in the user guide for some
12802 /// guidelines.
12803 ///
12804 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12805 #[derive(Clone, Debug, PartialEq)]
12806 #[non_exhaustive]
12807 pub enum Capability {
12808 /// The default value. This value is used if the capability is omitted or
12809 /// unknown.
12810 Unspecified,
12811 /// This node type supports stretch clusters.
12812 StretchedClusters,
12813 /// If set, the enum was initialized with an unknown value.
12814 ///
12815 /// Applications can examine the value using [Capability::value] or
12816 /// [Capability::name].
12817 UnknownValue(capability::UnknownValue),
12818 }
12819
12820 #[doc(hidden)]
12821 pub mod capability {
12822 #[allow(unused_imports)]
12823 use super::*;
12824 #[derive(Clone, Debug, PartialEq)]
12825 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12826 }
12827
12828 impl Capability {
12829 /// Gets the enum value.
12830 ///
12831 /// Returns `None` if the enum contains an unknown value deserialized from
12832 /// the string representation of enums.
12833 pub fn value(&self) -> std::option::Option<i32> {
12834 match self {
12835 Self::Unspecified => std::option::Option::Some(0),
12836 Self::StretchedClusters => std::option::Option::Some(1),
12837 Self::UnknownValue(u) => u.0.value(),
12838 }
12839 }
12840
12841 /// Gets the enum value as a string.
12842 ///
12843 /// Returns `None` if the enum contains an unknown value deserialized from
12844 /// the integer representation of enums.
12845 pub fn name(&self) -> std::option::Option<&str> {
12846 match self {
12847 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
12848 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
12849 Self::UnknownValue(u) => u.0.name(),
12850 }
12851 }
12852 }
12853
12854 impl std::default::Default for Capability {
12855 fn default() -> Self {
12856 use std::convert::From;
12857 Self::from(0)
12858 }
12859 }
12860
12861 impl std::fmt::Display for Capability {
12862 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12863 wkt::internal::display_enum(f, self.name(), self.value())
12864 }
12865 }
12866
12867 impl std::convert::From<i32> for Capability {
12868 fn from(value: i32) -> Self {
12869 match value {
12870 0 => Self::Unspecified,
12871 1 => Self::StretchedClusters,
12872 _ => Self::UnknownValue(capability::UnknownValue(
12873 wkt::internal::UnknownEnumValue::Integer(value),
12874 )),
12875 }
12876 }
12877 }
12878
12879 impl std::convert::From<&str> for Capability {
12880 fn from(value: &str) -> Self {
12881 use std::string::ToString;
12882 match value {
12883 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
12884 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
12885 _ => Self::UnknownValue(capability::UnknownValue(
12886 wkt::internal::UnknownEnumValue::String(value.to_string()),
12887 )),
12888 }
12889 }
12890 }
12891
12892 impl serde::ser::Serialize for Capability {
12893 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12894 where
12895 S: serde::Serializer,
12896 {
12897 match self {
12898 Self::Unspecified => serializer.serialize_i32(0),
12899 Self::StretchedClusters => serializer.serialize_i32(1),
12900 Self::UnknownValue(u) => u.0.serialize(serializer),
12901 }
12902 }
12903 }
12904
12905 impl<'de> serde::de::Deserialize<'de> for Capability {
12906 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12907 where
12908 D: serde::Deserializer<'de>,
12909 {
12910 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
12911 ".google.cloud.vmwareengine.v1.NodeType.Capability",
12912 ))
12913 }
12914 }
12915}
12916
12917/// Credentials for a private cloud.
12918#[derive(Clone, Default, PartialEq)]
12919#[non_exhaustive]
12920pub struct Credentials {
12921 /// Initial username.
12922 pub username: std::string::String,
12923
12924 /// Initial password.
12925 pub password: std::string::String,
12926
12927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12928}
12929
12930impl Credentials {
12931 pub fn new() -> Self {
12932 std::default::Default::default()
12933 }
12934
12935 /// Sets the value of [username][crate::model::Credentials::username].
12936 ///
12937 /// # Example
12938 /// ```ignore,no_run
12939 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12940 /// let x = Credentials::new().set_username("example");
12941 /// ```
12942 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12943 self.username = v.into();
12944 self
12945 }
12946
12947 /// Sets the value of [password][crate::model::Credentials::password].
12948 ///
12949 /// # Example
12950 /// ```ignore,no_run
12951 /// # use google_cloud_vmwareengine_v1::model::Credentials;
12952 /// let x = Credentials::new().set_password("example");
12953 /// ```
12954 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12955 self.password = v.into();
12956 self
12957 }
12958}
12959
12960impl wkt::message::Message for Credentials {
12961 fn typename() -> &'static str {
12962 "type.googleapis.com/google.cloud.vmwareengine.v1.Credentials"
12963 }
12964}
12965
12966/// HCX activation key. A default key is created during
12967/// private cloud provisioning, but this behavior is subject to change
12968/// and you should always verify active keys.
12969/// Use
12970/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
12971/// to retrieve existing keys and
12972/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
12973/// to create new ones.
12974///
12975/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
12976/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
12977#[derive(Clone, Default, PartialEq)]
12978#[non_exhaustive]
12979pub struct HcxActivationKey {
12980 /// Output only. The resource name of this HcxActivationKey.
12981 /// Resource names are schemeless URIs that follow the conventions in
12982 /// <https://cloud.google.com/apis/design/resource_names>.
12983 /// For example:
12984 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
12985 pub name: std::string::String,
12986
12987 /// Output only. Creation time of HCX activation key.
12988 pub create_time: std::option::Option<wkt::Timestamp>,
12989
12990 /// Output only. State of HCX activation key.
12991 pub state: crate::model::hcx_activation_key::State,
12992
12993 /// Output only. HCX activation key.
12994 pub activation_key: std::string::String,
12995
12996 /// Output only. System-generated unique identifier for the resource.
12997 pub uid: std::string::String,
12998
12999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13000}
13001
13002impl HcxActivationKey {
13003 pub fn new() -> Self {
13004 std::default::Default::default()
13005 }
13006
13007 /// Sets the value of [name][crate::model::HcxActivationKey::name].
13008 ///
13009 /// # Example
13010 /// ```ignore,no_run
13011 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13012 /// let x = HcxActivationKey::new().set_name("example");
13013 /// ```
13014 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13015 self.name = v.into();
13016 self
13017 }
13018
13019 /// Sets the value of [create_time][crate::model::HcxActivationKey::create_time].
13020 ///
13021 /// # Example
13022 /// ```ignore,no_run
13023 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13024 /// use wkt::Timestamp;
13025 /// let x = HcxActivationKey::new().set_create_time(Timestamp::default()/* use setters */);
13026 /// ```
13027 pub fn set_create_time<T>(mut self, v: T) -> Self
13028 where
13029 T: std::convert::Into<wkt::Timestamp>,
13030 {
13031 self.create_time = std::option::Option::Some(v.into());
13032 self
13033 }
13034
13035 /// Sets or clears the value of [create_time][crate::model::HcxActivationKey::create_time].
13036 ///
13037 /// # Example
13038 /// ```ignore,no_run
13039 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13040 /// use wkt::Timestamp;
13041 /// let x = HcxActivationKey::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13042 /// let x = HcxActivationKey::new().set_or_clear_create_time(None::<Timestamp>);
13043 /// ```
13044 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13045 where
13046 T: std::convert::Into<wkt::Timestamp>,
13047 {
13048 self.create_time = v.map(|x| x.into());
13049 self
13050 }
13051
13052 /// Sets the value of [state][crate::model::HcxActivationKey::state].
13053 ///
13054 /// # Example
13055 /// ```ignore,no_run
13056 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13057 /// use google_cloud_vmwareengine_v1::model::hcx_activation_key::State;
13058 /// let x0 = HcxActivationKey::new().set_state(State::Available);
13059 /// let x1 = HcxActivationKey::new().set_state(State::Consumed);
13060 /// let x2 = HcxActivationKey::new().set_state(State::Creating);
13061 /// ```
13062 pub fn set_state<T: std::convert::Into<crate::model::hcx_activation_key::State>>(
13063 mut self,
13064 v: T,
13065 ) -> Self {
13066 self.state = v.into();
13067 self
13068 }
13069
13070 /// Sets the value of [activation_key][crate::model::HcxActivationKey::activation_key].
13071 ///
13072 /// # Example
13073 /// ```ignore,no_run
13074 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13075 /// let x = HcxActivationKey::new().set_activation_key("example");
13076 /// ```
13077 pub fn set_activation_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13078 self.activation_key = v.into();
13079 self
13080 }
13081
13082 /// Sets the value of [uid][crate::model::HcxActivationKey::uid].
13083 ///
13084 /// # Example
13085 /// ```ignore,no_run
13086 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13087 /// let x = HcxActivationKey::new().set_uid("example");
13088 /// ```
13089 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13090 self.uid = v.into();
13091 self
13092 }
13093}
13094
13095impl wkt::message::Message for HcxActivationKey {
13096 fn typename() -> &'static str {
13097 "type.googleapis.com/google.cloud.vmwareengine.v1.HcxActivationKey"
13098 }
13099}
13100
13101/// Defines additional types related to [HcxActivationKey].
13102pub mod hcx_activation_key {
13103 #[allow(unused_imports)]
13104 use super::*;
13105
13106 /// State of HCX activation key
13107 ///
13108 /// # Working with unknown values
13109 ///
13110 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13111 /// additional enum variants at any time. Adding new variants is not considered
13112 /// a breaking change. Applications should write their code in anticipation of:
13113 ///
13114 /// - New values appearing in future releases of the client library, **and**
13115 /// - New values received dynamically, without application changes.
13116 ///
13117 /// Please consult the [Working with enums] section in the user guide for some
13118 /// guidelines.
13119 ///
13120 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13121 #[derive(Clone, Debug, PartialEq)]
13122 #[non_exhaustive]
13123 pub enum State {
13124 /// Unspecified state.
13125 Unspecified,
13126 /// State of a newly generated activation key.
13127 Available,
13128 /// State of key when it has been used to activate HCX appliance.
13129 Consumed,
13130 /// State of key when it is being created.
13131 Creating,
13132 /// If set, the enum was initialized with an unknown value.
13133 ///
13134 /// Applications can examine the value using [State::value] or
13135 /// [State::name].
13136 UnknownValue(state::UnknownValue),
13137 }
13138
13139 #[doc(hidden)]
13140 pub mod state {
13141 #[allow(unused_imports)]
13142 use super::*;
13143 #[derive(Clone, Debug, PartialEq)]
13144 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13145 }
13146
13147 impl State {
13148 /// Gets the enum value.
13149 ///
13150 /// Returns `None` if the enum contains an unknown value deserialized from
13151 /// the string representation of enums.
13152 pub fn value(&self) -> std::option::Option<i32> {
13153 match self {
13154 Self::Unspecified => std::option::Option::Some(0),
13155 Self::Available => std::option::Option::Some(1),
13156 Self::Consumed => std::option::Option::Some(2),
13157 Self::Creating => std::option::Option::Some(3),
13158 Self::UnknownValue(u) => u.0.value(),
13159 }
13160 }
13161
13162 /// Gets the enum value as a string.
13163 ///
13164 /// Returns `None` if the enum contains an unknown value deserialized from
13165 /// the integer representation of enums.
13166 pub fn name(&self) -> std::option::Option<&str> {
13167 match self {
13168 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13169 Self::Available => std::option::Option::Some("AVAILABLE"),
13170 Self::Consumed => std::option::Option::Some("CONSUMED"),
13171 Self::Creating => std::option::Option::Some("CREATING"),
13172 Self::UnknownValue(u) => u.0.name(),
13173 }
13174 }
13175 }
13176
13177 impl std::default::Default for State {
13178 fn default() -> Self {
13179 use std::convert::From;
13180 Self::from(0)
13181 }
13182 }
13183
13184 impl std::fmt::Display for State {
13185 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13186 wkt::internal::display_enum(f, self.name(), self.value())
13187 }
13188 }
13189
13190 impl std::convert::From<i32> for State {
13191 fn from(value: i32) -> Self {
13192 match value {
13193 0 => Self::Unspecified,
13194 1 => Self::Available,
13195 2 => Self::Consumed,
13196 3 => Self::Creating,
13197 _ => Self::UnknownValue(state::UnknownValue(
13198 wkt::internal::UnknownEnumValue::Integer(value),
13199 )),
13200 }
13201 }
13202 }
13203
13204 impl std::convert::From<&str> for State {
13205 fn from(value: &str) -> Self {
13206 use std::string::ToString;
13207 match value {
13208 "STATE_UNSPECIFIED" => Self::Unspecified,
13209 "AVAILABLE" => Self::Available,
13210 "CONSUMED" => Self::Consumed,
13211 "CREATING" => Self::Creating,
13212 _ => Self::UnknownValue(state::UnknownValue(
13213 wkt::internal::UnknownEnumValue::String(value.to_string()),
13214 )),
13215 }
13216 }
13217 }
13218
13219 impl serde::ser::Serialize for State {
13220 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13221 where
13222 S: serde::Serializer,
13223 {
13224 match self {
13225 Self::Unspecified => serializer.serialize_i32(0),
13226 Self::Available => serializer.serialize_i32(1),
13227 Self::Consumed => serializer.serialize_i32(2),
13228 Self::Creating => serializer.serialize_i32(3),
13229 Self::UnknownValue(u) => u.0.serialize(serializer),
13230 }
13231 }
13232 }
13233
13234 impl<'de> serde::de::Deserialize<'de> for State {
13235 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13236 where
13237 D: serde::Deserializer<'de>,
13238 {
13239 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13240 ".google.cloud.vmwareengine.v1.HcxActivationKey.State",
13241 ))
13242 }
13243 }
13244}
13245
13246/// Details about a HCX Cloud Manager appliance.
13247#[derive(Clone, Default, PartialEq)]
13248#[non_exhaustive]
13249pub struct Hcx {
13250 /// Internal IP address of the appliance.
13251 pub internal_ip: std::string::String,
13252
13253 /// Version of the appliance.
13254 pub version: std::string::String,
13255
13256 /// Output only. The state of the appliance.
13257 pub state: crate::model::hcx::State,
13258
13259 /// Fully qualified domain name of the appliance.
13260 pub fqdn: std::string::String,
13261
13262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13263}
13264
13265impl Hcx {
13266 pub fn new() -> Self {
13267 std::default::Default::default()
13268 }
13269
13270 /// Sets the value of [internal_ip][crate::model::Hcx::internal_ip].
13271 ///
13272 /// # Example
13273 /// ```ignore,no_run
13274 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13275 /// let x = Hcx::new().set_internal_ip("example");
13276 /// ```
13277 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13278 self.internal_ip = v.into();
13279 self
13280 }
13281
13282 /// Sets the value of [version][crate::model::Hcx::version].
13283 ///
13284 /// # Example
13285 /// ```ignore,no_run
13286 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13287 /// let x = Hcx::new().set_version("example");
13288 /// ```
13289 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13290 self.version = v.into();
13291 self
13292 }
13293
13294 /// Sets the value of [state][crate::model::Hcx::state].
13295 ///
13296 /// # Example
13297 /// ```ignore,no_run
13298 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13299 /// use google_cloud_vmwareengine_v1::model::hcx::State;
13300 /// let x0 = Hcx::new().set_state(State::Active);
13301 /// let x1 = Hcx::new().set_state(State::Creating);
13302 /// let x2 = Hcx::new().set_state(State::Activating);
13303 /// ```
13304 pub fn set_state<T: std::convert::Into<crate::model::hcx::State>>(mut self, v: T) -> Self {
13305 self.state = v.into();
13306 self
13307 }
13308
13309 /// Sets the value of [fqdn][crate::model::Hcx::fqdn].
13310 ///
13311 /// # Example
13312 /// ```ignore,no_run
13313 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13314 /// let x = Hcx::new().set_fqdn("example");
13315 /// ```
13316 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13317 self.fqdn = v.into();
13318 self
13319 }
13320}
13321
13322impl wkt::message::Message for Hcx {
13323 fn typename() -> &'static str {
13324 "type.googleapis.com/google.cloud.vmwareengine.v1.Hcx"
13325 }
13326}
13327
13328/// Defines additional types related to [Hcx].
13329pub mod hcx {
13330 #[allow(unused_imports)]
13331 use super::*;
13332
13333 /// State of the appliance
13334 ///
13335 /// # Working with unknown values
13336 ///
13337 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13338 /// additional enum variants at any time. Adding new variants is not considered
13339 /// a breaking change. Applications should write their code in anticipation of:
13340 ///
13341 /// - New values appearing in future releases of the client library, **and**
13342 /// - New values received dynamically, without application changes.
13343 ///
13344 /// Please consult the [Working with enums] section in the user guide for some
13345 /// guidelines.
13346 ///
13347 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13348 #[derive(Clone, Debug, PartialEq)]
13349 #[non_exhaustive]
13350 pub enum State {
13351 /// Unspecified appliance state. This is the default value.
13352 Unspecified,
13353 /// The appliance is operational and can be used.
13354 Active,
13355 /// The appliance is being deployed.
13356 Creating,
13357 /// The appliance is being activated.
13358 Activating,
13359 /// If set, the enum was initialized with an unknown value.
13360 ///
13361 /// Applications can examine the value using [State::value] or
13362 /// [State::name].
13363 UnknownValue(state::UnknownValue),
13364 }
13365
13366 #[doc(hidden)]
13367 pub mod state {
13368 #[allow(unused_imports)]
13369 use super::*;
13370 #[derive(Clone, Debug, PartialEq)]
13371 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13372 }
13373
13374 impl State {
13375 /// Gets the enum value.
13376 ///
13377 /// Returns `None` if the enum contains an unknown value deserialized from
13378 /// the string representation of enums.
13379 pub fn value(&self) -> std::option::Option<i32> {
13380 match self {
13381 Self::Unspecified => std::option::Option::Some(0),
13382 Self::Active => std::option::Option::Some(1),
13383 Self::Creating => std::option::Option::Some(2),
13384 Self::Activating => std::option::Option::Some(3),
13385 Self::UnknownValue(u) => u.0.value(),
13386 }
13387 }
13388
13389 /// Gets the enum value as a string.
13390 ///
13391 /// Returns `None` if the enum contains an unknown value deserialized from
13392 /// the integer representation of enums.
13393 pub fn name(&self) -> std::option::Option<&str> {
13394 match self {
13395 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13396 Self::Active => std::option::Option::Some("ACTIVE"),
13397 Self::Creating => std::option::Option::Some("CREATING"),
13398 Self::Activating => std::option::Option::Some("ACTIVATING"),
13399 Self::UnknownValue(u) => u.0.name(),
13400 }
13401 }
13402 }
13403
13404 impl std::default::Default for State {
13405 fn default() -> Self {
13406 use std::convert::From;
13407 Self::from(0)
13408 }
13409 }
13410
13411 impl std::fmt::Display for State {
13412 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13413 wkt::internal::display_enum(f, self.name(), self.value())
13414 }
13415 }
13416
13417 impl std::convert::From<i32> for State {
13418 fn from(value: i32) -> Self {
13419 match value {
13420 0 => Self::Unspecified,
13421 1 => Self::Active,
13422 2 => Self::Creating,
13423 3 => Self::Activating,
13424 _ => Self::UnknownValue(state::UnknownValue(
13425 wkt::internal::UnknownEnumValue::Integer(value),
13426 )),
13427 }
13428 }
13429 }
13430
13431 impl std::convert::From<&str> for State {
13432 fn from(value: &str) -> Self {
13433 use std::string::ToString;
13434 match value {
13435 "STATE_UNSPECIFIED" => Self::Unspecified,
13436 "ACTIVE" => Self::Active,
13437 "CREATING" => Self::Creating,
13438 "ACTIVATING" => Self::Activating,
13439 _ => Self::UnknownValue(state::UnknownValue(
13440 wkt::internal::UnknownEnumValue::String(value.to_string()),
13441 )),
13442 }
13443 }
13444 }
13445
13446 impl serde::ser::Serialize for State {
13447 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13448 where
13449 S: serde::Serializer,
13450 {
13451 match self {
13452 Self::Unspecified => serializer.serialize_i32(0),
13453 Self::Active => serializer.serialize_i32(1),
13454 Self::Creating => serializer.serialize_i32(2),
13455 Self::Activating => serializer.serialize_i32(3),
13456 Self::UnknownValue(u) => u.0.serialize(serializer),
13457 }
13458 }
13459 }
13460
13461 impl<'de> serde::de::Deserialize<'de> for State {
13462 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13463 where
13464 D: serde::Deserializer<'de>,
13465 {
13466 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13467 ".google.cloud.vmwareengine.v1.Hcx.State",
13468 ))
13469 }
13470 }
13471}
13472
13473/// Details about a NSX Manager appliance.
13474#[derive(Clone, Default, PartialEq)]
13475#[non_exhaustive]
13476pub struct Nsx {
13477 /// Internal IP address of the appliance.
13478 pub internal_ip: std::string::String,
13479
13480 /// Version of the appliance.
13481 pub version: std::string::String,
13482
13483 /// Output only. The state of the appliance.
13484 pub state: crate::model::nsx::State,
13485
13486 /// Fully qualified domain name of the appliance.
13487 pub fqdn: std::string::String,
13488
13489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13490}
13491
13492impl Nsx {
13493 pub fn new() -> Self {
13494 std::default::Default::default()
13495 }
13496
13497 /// Sets the value of [internal_ip][crate::model::Nsx::internal_ip].
13498 ///
13499 /// # Example
13500 /// ```ignore,no_run
13501 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13502 /// let x = Nsx::new().set_internal_ip("example");
13503 /// ```
13504 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13505 self.internal_ip = v.into();
13506 self
13507 }
13508
13509 /// Sets the value of [version][crate::model::Nsx::version].
13510 ///
13511 /// # Example
13512 /// ```ignore,no_run
13513 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13514 /// let x = Nsx::new().set_version("example");
13515 /// ```
13516 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13517 self.version = v.into();
13518 self
13519 }
13520
13521 /// Sets the value of [state][crate::model::Nsx::state].
13522 ///
13523 /// # Example
13524 /// ```ignore,no_run
13525 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13526 /// use google_cloud_vmwareengine_v1::model::nsx::State;
13527 /// let x0 = Nsx::new().set_state(State::Active);
13528 /// let x1 = Nsx::new().set_state(State::Creating);
13529 /// ```
13530 pub fn set_state<T: std::convert::Into<crate::model::nsx::State>>(mut self, v: T) -> Self {
13531 self.state = v.into();
13532 self
13533 }
13534
13535 /// Sets the value of [fqdn][crate::model::Nsx::fqdn].
13536 ///
13537 /// # Example
13538 /// ```ignore,no_run
13539 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13540 /// let x = Nsx::new().set_fqdn("example");
13541 /// ```
13542 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13543 self.fqdn = v.into();
13544 self
13545 }
13546}
13547
13548impl wkt::message::Message for Nsx {
13549 fn typename() -> &'static str {
13550 "type.googleapis.com/google.cloud.vmwareengine.v1.Nsx"
13551 }
13552}
13553
13554/// Defines additional types related to [Nsx].
13555pub mod nsx {
13556 #[allow(unused_imports)]
13557 use super::*;
13558
13559 /// State of the appliance
13560 ///
13561 /// # Working with unknown values
13562 ///
13563 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13564 /// additional enum variants at any time. Adding new variants is not considered
13565 /// a breaking change. Applications should write their code in anticipation of:
13566 ///
13567 /// - New values appearing in future releases of the client library, **and**
13568 /// - New values received dynamically, without application changes.
13569 ///
13570 /// Please consult the [Working with enums] section in the user guide for some
13571 /// guidelines.
13572 ///
13573 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13574 #[derive(Clone, Debug, PartialEq)]
13575 #[non_exhaustive]
13576 pub enum State {
13577 /// Unspecified appliance state. This is the default value.
13578 Unspecified,
13579 /// The appliance is operational and can be used.
13580 Active,
13581 /// The appliance is being deployed.
13582 Creating,
13583 /// If set, the enum was initialized with an unknown value.
13584 ///
13585 /// Applications can examine the value using [State::value] or
13586 /// [State::name].
13587 UnknownValue(state::UnknownValue),
13588 }
13589
13590 #[doc(hidden)]
13591 pub mod state {
13592 #[allow(unused_imports)]
13593 use super::*;
13594 #[derive(Clone, Debug, PartialEq)]
13595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13596 }
13597
13598 impl State {
13599 /// Gets the enum value.
13600 ///
13601 /// Returns `None` if the enum contains an unknown value deserialized from
13602 /// the string representation of enums.
13603 pub fn value(&self) -> std::option::Option<i32> {
13604 match self {
13605 Self::Unspecified => std::option::Option::Some(0),
13606 Self::Active => std::option::Option::Some(1),
13607 Self::Creating => std::option::Option::Some(2),
13608 Self::UnknownValue(u) => u.0.value(),
13609 }
13610 }
13611
13612 /// Gets the enum value as a string.
13613 ///
13614 /// Returns `None` if the enum contains an unknown value deserialized from
13615 /// the integer representation of enums.
13616 pub fn name(&self) -> std::option::Option<&str> {
13617 match self {
13618 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13619 Self::Active => std::option::Option::Some("ACTIVE"),
13620 Self::Creating => std::option::Option::Some("CREATING"),
13621 Self::UnknownValue(u) => u.0.name(),
13622 }
13623 }
13624 }
13625
13626 impl std::default::Default for State {
13627 fn default() -> Self {
13628 use std::convert::From;
13629 Self::from(0)
13630 }
13631 }
13632
13633 impl std::fmt::Display for State {
13634 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13635 wkt::internal::display_enum(f, self.name(), self.value())
13636 }
13637 }
13638
13639 impl std::convert::From<i32> for State {
13640 fn from(value: i32) -> Self {
13641 match value {
13642 0 => Self::Unspecified,
13643 1 => Self::Active,
13644 2 => Self::Creating,
13645 _ => Self::UnknownValue(state::UnknownValue(
13646 wkt::internal::UnknownEnumValue::Integer(value),
13647 )),
13648 }
13649 }
13650 }
13651
13652 impl std::convert::From<&str> for State {
13653 fn from(value: &str) -> Self {
13654 use std::string::ToString;
13655 match value {
13656 "STATE_UNSPECIFIED" => Self::Unspecified,
13657 "ACTIVE" => Self::Active,
13658 "CREATING" => Self::Creating,
13659 _ => Self::UnknownValue(state::UnknownValue(
13660 wkt::internal::UnknownEnumValue::String(value.to_string()),
13661 )),
13662 }
13663 }
13664 }
13665
13666 impl serde::ser::Serialize for State {
13667 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13668 where
13669 S: serde::Serializer,
13670 {
13671 match self {
13672 Self::Unspecified => serializer.serialize_i32(0),
13673 Self::Active => serializer.serialize_i32(1),
13674 Self::Creating => serializer.serialize_i32(2),
13675 Self::UnknownValue(u) => u.0.serialize(serializer),
13676 }
13677 }
13678 }
13679
13680 impl<'de> serde::de::Deserialize<'de> for State {
13681 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13682 where
13683 D: serde::Deserializer<'de>,
13684 {
13685 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13686 ".google.cloud.vmwareengine.v1.Nsx.State",
13687 ))
13688 }
13689 }
13690}
13691
13692/// Details about a vCenter Server management appliance.
13693#[derive(Clone, Default, PartialEq)]
13694#[non_exhaustive]
13695pub struct Vcenter {
13696 /// Internal IP address of the appliance.
13697 pub internal_ip: std::string::String,
13698
13699 /// Version of the appliance.
13700 pub version: std::string::String,
13701
13702 /// Output only. The state of the appliance.
13703 pub state: crate::model::vcenter::State,
13704
13705 /// Fully qualified domain name of the appliance.
13706 pub fqdn: std::string::String,
13707
13708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13709}
13710
13711impl Vcenter {
13712 pub fn new() -> Self {
13713 std::default::Default::default()
13714 }
13715
13716 /// Sets the value of [internal_ip][crate::model::Vcenter::internal_ip].
13717 ///
13718 /// # Example
13719 /// ```ignore,no_run
13720 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13721 /// let x = Vcenter::new().set_internal_ip("example");
13722 /// ```
13723 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13724 self.internal_ip = v.into();
13725 self
13726 }
13727
13728 /// Sets the value of [version][crate::model::Vcenter::version].
13729 ///
13730 /// # Example
13731 /// ```ignore,no_run
13732 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13733 /// let x = Vcenter::new().set_version("example");
13734 /// ```
13735 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13736 self.version = v.into();
13737 self
13738 }
13739
13740 /// Sets the value of [state][crate::model::Vcenter::state].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13745 /// use google_cloud_vmwareengine_v1::model::vcenter::State;
13746 /// let x0 = Vcenter::new().set_state(State::Active);
13747 /// let x1 = Vcenter::new().set_state(State::Creating);
13748 /// ```
13749 pub fn set_state<T: std::convert::Into<crate::model::vcenter::State>>(mut self, v: T) -> Self {
13750 self.state = v.into();
13751 self
13752 }
13753
13754 /// Sets the value of [fqdn][crate::model::Vcenter::fqdn].
13755 ///
13756 /// # Example
13757 /// ```ignore,no_run
13758 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
13759 /// let x = Vcenter::new().set_fqdn("example");
13760 /// ```
13761 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13762 self.fqdn = v.into();
13763 self
13764 }
13765}
13766
13767impl wkt::message::Message for Vcenter {
13768 fn typename() -> &'static str {
13769 "type.googleapis.com/google.cloud.vmwareengine.v1.Vcenter"
13770 }
13771}
13772
13773/// Defines additional types related to [Vcenter].
13774pub mod vcenter {
13775 #[allow(unused_imports)]
13776 use super::*;
13777
13778 /// State of the appliance
13779 ///
13780 /// # Working with unknown values
13781 ///
13782 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13783 /// additional enum variants at any time. Adding new variants is not considered
13784 /// a breaking change. Applications should write their code in anticipation of:
13785 ///
13786 /// - New values appearing in future releases of the client library, **and**
13787 /// - New values received dynamically, without application changes.
13788 ///
13789 /// Please consult the [Working with enums] section in the user guide for some
13790 /// guidelines.
13791 ///
13792 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13793 #[derive(Clone, Debug, PartialEq)]
13794 #[non_exhaustive]
13795 pub enum State {
13796 /// Unspecified appliance state. This is the default value.
13797 Unspecified,
13798 /// The appliance is operational and can be used.
13799 Active,
13800 /// The appliance is being deployed.
13801 Creating,
13802 /// If set, the enum was initialized with an unknown value.
13803 ///
13804 /// Applications can examine the value using [State::value] or
13805 /// [State::name].
13806 UnknownValue(state::UnknownValue),
13807 }
13808
13809 #[doc(hidden)]
13810 pub mod state {
13811 #[allow(unused_imports)]
13812 use super::*;
13813 #[derive(Clone, Debug, PartialEq)]
13814 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13815 }
13816
13817 impl State {
13818 /// Gets the enum value.
13819 ///
13820 /// Returns `None` if the enum contains an unknown value deserialized from
13821 /// the string representation of enums.
13822 pub fn value(&self) -> std::option::Option<i32> {
13823 match self {
13824 Self::Unspecified => std::option::Option::Some(0),
13825 Self::Active => std::option::Option::Some(1),
13826 Self::Creating => std::option::Option::Some(2),
13827 Self::UnknownValue(u) => u.0.value(),
13828 }
13829 }
13830
13831 /// Gets the enum value as a string.
13832 ///
13833 /// Returns `None` if the enum contains an unknown value deserialized from
13834 /// the integer representation of enums.
13835 pub fn name(&self) -> std::option::Option<&str> {
13836 match self {
13837 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13838 Self::Active => std::option::Option::Some("ACTIVE"),
13839 Self::Creating => std::option::Option::Some("CREATING"),
13840 Self::UnknownValue(u) => u.0.name(),
13841 }
13842 }
13843 }
13844
13845 impl std::default::Default for State {
13846 fn default() -> Self {
13847 use std::convert::From;
13848 Self::from(0)
13849 }
13850 }
13851
13852 impl std::fmt::Display for State {
13853 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13854 wkt::internal::display_enum(f, self.name(), self.value())
13855 }
13856 }
13857
13858 impl std::convert::From<i32> for State {
13859 fn from(value: i32) -> Self {
13860 match value {
13861 0 => Self::Unspecified,
13862 1 => Self::Active,
13863 2 => Self::Creating,
13864 _ => Self::UnknownValue(state::UnknownValue(
13865 wkt::internal::UnknownEnumValue::Integer(value),
13866 )),
13867 }
13868 }
13869 }
13870
13871 impl std::convert::From<&str> for State {
13872 fn from(value: &str) -> Self {
13873 use std::string::ToString;
13874 match value {
13875 "STATE_UNSPECIFIED" => Self::Unspecified,
13876 "ACTIVE" => Self::Active,
13877 "CREATING" => Self::Creating,
13878 _ => Self::UnknownValue(state::UnknownValue(
13879 wkt::internal::UnknownEnumValue::String(value.to_string()),
13880 )),
13881 }
13882 }
13883 }
13884
13885 impl serde::ser::Serialize for State {
13886 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13887 where
13888 S: serde::Serializer,
13889 {
13890 match self {
13891 Self::Unspecified => serializer.serialize_i32(0),
13892 Self::Active => serializer.serialize_i32(1),
13893 Self::Creating => serializer.serialize_i32(2),
13894 Self::UnknownValue(u) => u.0.serialize(serializer),
13895 }
13896 }
13897 }
13898
13899 impl<'de> serde::de::Deserialize<'de> for State {
13900 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13901 where
13902 D: serde::Deserializer<'de>,
13903 {
13904 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13905 ".google.cloud.vmwareengine.v1.Vcenter.State",
13906 ))
13907 }
13908 }
13909}
13910
13911/// Autoscaling settings define the rules used by VMware Engine to
13912/// automatically scale-out and scale-in the clusters in a private cloud.
13913#[derive(Clone, Default, PartialEq)]
13914#[non_exhaustive]
13915pub struct AutoscalingSettings {
13916 /// Required. The map with autoscaling policies applied to the cluster.
13917 /// The key is the identifier of the policy.
13918 /// It must meet the following requirements:
13919 ///
13920 /// * Only contains 1-63 alphanumeric characters and hyphens
13921 /// * Begins with an alphabetical character
13922 /// * Ends with a non-hyphen character
13923 /// * Not formatted as a UUID
13924 /// * Complies with [RFC
13925 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
13926 ///
13927 /// Currently there map must contain only one element
13928 /// that describes the autoscaling policy for compute nodes.
13929 pub autoscaling_policies: std::collections::HashMap<
13930 std::string::String,
13931 crate::model::autoscaling_settings::AutoscalingPolicy,
13932 >,
13933
13934 /// Optional. Minimum number of nodes of any type in a cluster.
13935 /// If not specified the default limits apply.
13936 pub min_cluster_node_count: i32,
13937
13938 /// Optional. Maximum number of nodes of any type in a cluster.
13939 /// If not specified the default limits apply.
13940 pub max_cluster_node_count: i32,
13941
13942 /// Optional. The minimum duration between consecutive autoscale operations.
13943 /// It starts once addition or removal of nodes is fully completed.
13944 /// Defaults to 30 minutes if not specified. Cool down period must be in whole
13945 /// minutes (for example, 30, 31, 50, 180 minutes).
13946 pub cool_down_period: std::option::Option<wkt::Duration>,
13947
13948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13949}
13950
13951impl AutoscalingSettings {
13952 pub fn new() -> Self {
13953 std::default::Default::default()
13954 }
13955
13956 /// Sets the value of [autoscaling_policies][crate::model::AutoscalingSettings::autoscaling_policies].
13957 ///
13958 /// # Example
13959 /// ```ignore,no_run
13960 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13961 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
13962 /// let x = AutoscalingSettings::new().set_autoscaling_policies([
13963 /// ("key0", AutoscalingPolicy::default()/* use setters */),
13964 /// ("key1", AutoscalingPolicy::default()/* use (different) setters */),
13965 /// ]);
13966 /// ```
13967 pub fn set_autoscaling_policies<T, K, V>(mut self, v: T) -> Self
13968 where
13969 T: std::iter::IntoIterator<Item = (K, V)>,
13970 K: std::convert::Into<std::string::String>,
13971 V: std::convert::Into<crate::model::autoscaling_settings::AutoscalingPolicy>,
13972 {
13973 use std::iter::Iterator;
13974 self.autoscaling_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13975 self
13976 }
13977
13978 /// Sets the value of [min_cluster_node_count][crate::model::AutoscalingSettings::min_cluster_node_count].
13979 ///
13980 /// # Example
13981 /// ```ignore,no_run
13982 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13983 /// let x = AutoscalingSettings::new().set_min_cluster_node_count(42);
13984 /// ```
13985 pub fn set_min_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13986 self.min_cluster_node_count = v.into();
13987 self
13988 }
13989
13990 /// Sets the value of [max_cluster_node_count][crate::model::AutoscalingSettings::max_cluster_node_count].
13991 ///
13992 /// # Example
13993 /// ```ignore,no_run
13994 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
13995 /// let x = AutoscalingSettings::new().set_max_cluster_node_count(42);
13996 /// ```
13997 pub fn set_max_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13998 self.max_cluster_node_count = v.into();
13999 self
14000 }
14001
14002 /// Sets the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14003 ///
14004 /// # Example
14005 /// ```ignore,no_run
14006 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14007 /// use wkt::Duration;
14008 /// let x = AutoscalingSettings::new().set_cool_down_period(Duration::default()/* use setters */);
14009 /// ```
14010 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
14011 where
14012 T: std::convert::Into<wkt::Duration>,
14013 {
14014 self.cool_down_period = std::option::Option::Some(v.into());
14015 self
14016 }
14017
14018 /// Sets or clears the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14019 ///
14020 /// # Example
14021 /// ```ignore,no_run
14022 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14023 /// use wkt::Duration;
14024 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
14025 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(None::<Duration>);
14026 /// ```
14027 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
14028 where
14029 T: std::convert::Into<wkt::Duration>,
14030 {
14031 self.cool_down_period = v.map(|x| x.into());
14032 self
14033 }
14034}
14035
14036impl wkt::message::Message for AutoscalingSettings {
14037 fn typename() -> &'static str {
14038 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings"
14039 }
14040}
14041
14042/// Defines additional types related to [AutoscalingSettings].
14043pub mod autoscaling_settings {
14044 #[allow(unused_imports)]
14045 use super::*;
14046
14047 /// Thresholds define the utilization of resources triggering
14048 /// scale-out and scale-in operations.
14049 #[derive(Clone, Default, PartialEq)]
14050 #[non_exhaustive]
14051 pub struct Thresholds {
14052 /// Required. The utilization triggering the scale-out operation in percent.
14053 pub scale_out: i32,
14054
14055 /// Required. The utilization triggering the scale-in operation in percent.
14056 pub scale_in: i32,
14057
14058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14059 }
14060
14061 impl Thresholds {
14062 pub fn new() -> Self {
14063 std::default::Default::default()
14064 }
14065
14066 /// Sets the value of [scale_out][crate::model::autoscaling_settings::Thresholds::scale_out].
14067 ///
14068 /// # Example
14069 /// ```ignore,no_run
14070 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14071 /// let x = Thresholds::new().set_scale_out(42);
14072 /// ```
14073 pub fn set_scale_out<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14074 self.scale_out = v.into();
14075 self
14076 }
14077
14078 /// Sets the value of [scale_in][crate::model::autoscaling_settings::Thresholds::scale_in].
14079 ///
14080 /// # Example
14081 /// ```ignore,no_run
14082 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14083 /// let x = Thresholds::new().set_scale_in(42);
14084 /// ```
14085 pub fn set_scale_in<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14086 self.scale_in = v.into();
14087 self
14088 }
14089 }
14090
14091 impl wkt::message::Message for Thresholds {
14092 fn typename() -> &'static str {
14093 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds"
14094 }
14095 }
14096
14097 /// Autoscaling policy describes the behavior of the autoscaling
14098 /// with respect to the resource utilization.
14099 /// The scale-out operation is initiated if the utilization
14100 /// exceeds ANY of the respective thresholds.
14101 /// The scale-in operation is initiated if the utilization
14102 /// is below ALL of the respective thresholds.
14103 #[derive(Clone, Default, PartialEq)]
14104 #[non_exhaustive]
14105 pub struct AutoscalingPolicy {
14106 /// Required. The canonical identifier of the node type to add or remove.
14107 /// Corresponds to the `NodeType`.
14108 pub node_type_id: std::string::String,
14109
14110 /// Required. Number of nodes to add to a cluster during a scale-out
14111 /// operation. Must be divisible by 2 for stretched clusters. During a
14112 /// scale-in operation only one node (or 2 for stretched clusters) are
14113 /// removed in a single iteration.
14114 pub scale_out_size: i32,
14115
14116 /// Optional. Utilization thresholds pertaining to CPU utilization.
14117 pub cpu_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14118
14119 /// Optional. Utilization thresholds pertaining to amount of granted memory.
14120 pub granted_memory_thresholds:
14121 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14122
14123 /// Optional. Utilization thresholds pertaining to amount of consumed memory.
14124 pub consumed_memory_thresholds:
14125 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14126
14127 /// Optional. Utilization thresholds pertaining to amount of consumed
14128 /// storage.
14129 pub storage_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14130
14131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14132 }
14133
14134 impl AutoscalingPolicy {
14135 pub fn new() -> Self {
14136 std::default::Default::default()
14137 }
14138
14139 /// Sets the value of [node_type_id][crate::model::autoscaling_settings::AutoscalingPolicy::node_type_id].
14140 ///
14141 /// # Example
14142 /// ```ignore,no_run
14143 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14144 /// let x = AutoscalingPolicy::new().set_node_type_id("example");
14145 /// ```
14146 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(
14147 mut self,
14148 v: T,
14149 ) -> Self {
14150 self.node_type_id = v.into();
14151 self
14152 }
14153
14154 /// Sets the value of [scale_out_size][crate::model::autoscaling_settings::AutoscalingPolicy::scale_out_size].
14155 ///
14156 /// # Example
14157 /// ```ignore,no_run
14158 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14159 /// let x = AutoscalingPolicy::new().set_scale_out_size(42);
14160 /// ```
14161 pub fn set_scale_out_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14162 self.scale_out_size = v.into();
14163 self
14164 }
14165
14166 /// Sets the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14167 ///
14168 /// # Example
14169 /// ```ignore,no_run
14170 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14171 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14172 /// let x = AutoscalingPolicy::new().set_cpu_thresholds(Thresholds::default()/* use setters */);
14173 /// ```
14174 pub fn set_cpu_thresholds<T>(mut self, v: T) -> Self
14175 where
14176 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14177 {
14178 self.cpu_thresholds = std::option::Option::Some(v.into());
14179 self
14180 }
14181
14182 /// Sets or clears the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14183 ///
14184 /// # Example
14185 /// ```ignore,no_run
14186 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14187 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14188 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(Some(Thresholds::default()/* use setters */));
14189 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(None::<Thresholds>);
14190 /// ```
14191 pub fn set_or_clear_cpu_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14192 where
14193 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14194 {
14195 self.cpu_thresholds = v.map(|x| x.into());
14196 self
14197 }
14198
14199 /// Sets the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14200 ///
14201 /// # Example
14202 /// ```ignore,no_run
14203 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14204 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14205 /// let x = AutoscalingPolicy::new().set_granted_memory_thresholds(Thresholds::default()/* use setters */);
14206 /// ```
14207 pub fn set_granted_memory_thresholds<T>(mut self, v: T) -> Self
14208 where
14209 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14210 {
14211 self.granted_memory_thresholds = std::option::Option::Some(v.into());
14212 self
14213 }
14214
14215 /// Sets or clears the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14216 ///
14217 /// # Example
14218 /// ```ignore,no_run
14219 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14220 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14221 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(Some(Thresholds::default()/* use setters */));
14222 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(None::<Thresholds>);
14223 /// ```
14224 pub fn set_or_clear_granted_memory_thresholds<T>(
14225 mut self,
14226 v: std::option::Option<T>,
14227 ) -> Self
14228 where
14229 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14230 {
14231 self.granted_memory_thresholds = v.map(|x| x.into());
14232 self
14233 }
14234
14235 /// Sets the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14240 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14241 /// let x = AutoscalingPolicy::new().set_consumed_memory_thresholds(Thresholds::default()/* use setters */);
14242 /// ```
14243 pub fn set_consumed_memory_thresholds<T>(mut self, v: T) -> Self
14244 where
14245 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14246 {
14247 self.consumed_memory_thresholds = std::option::Option::Some(v.into());
14248 self
14249 }
14250
14251 /// Sets or clears the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14252 ///
14253 /// # Example
14254 /// ```ignore,no_run
14255 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14256 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14257 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(Some(Thresholds::default()/* use setters */));
14258 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(None::<Thresholds>);
14259 /// ```
14260 pub fn set_or_clear_consumed_memory_thresholds<T>(
14261 mut self,
14262 v: std::option::Option<T>,
14263 ) -> Self
14264 where
14265 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14266 {
14267 self.consumed_memory_thresholds = v.map(|x| x.into());
14268 self
14269 }
14270
14271 /// Sets the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14272 ///
14273 /// # Example
14274 /// ```ignore,no_run
14275 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14276 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14277 /// let x = AutoscalingPolicy::new().set_storage_thresholds(Thresholds::default()/* use setters */);
14278 /// ```
14279 pub fn set_storage_thresholds<T>(mut self, v: T) -> Self
14280 where
14281 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14282 {
14283 self.storage_thresholds = std::option::Option::Some(v.into());
14284 self
14285 }
14286
14287 /// Sets or clears the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14288 ///
14289 /// # Example
14290 /// ```ignore,no_run
14291 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14292 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14293 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(Some(Thresholds::default()/* use setters */));
14294 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(None::<Thresholds>);
14295 /// ```
14296 pub fn set_or_clear_storage_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14297 where
14298 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14299 {
14300 self.storage_thresholds = v.map(|x| x.into());
14301 self
14302 }
14303 }
14304
14305 impl wkt::message::Message for AutoscalingPolicy {
14306 fn typename() -> &'static str {
14307 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy"
14308 }
14309 }
14310}
14311
14312/// DNS forwarding config.
14313/// This config defines a list of domain to name server mappings,
14314/// and is attached to the private cloud for custom domain resolution.
14315#[derive(Clone, Default, PartialEq)]
14316#[non_exhaustive]
14317pub struct DnsForwarding {
14318 /// Output only. The resource name of this DNS profile.
14319 /// Resource names are schemeless URIs that follow the conventions in
14320 /// <https://cloud.google.com/apis/design/resource_names>.
14321 /// For example:
14322 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
14323 pub name: std::string::String,
14324
14325 /// Output only. Creation time of this resource.
14326 pub create_time: std::option::Option<wkt::Timestamp>,
14327
14328 /// Output only. Last update time of this resource.
14329 pub update_time: std::option::Option<wkt::Timestamp>,
14330
14331 /// Required. List of domain mappings to configure
14332 pub forwarding_rules: std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
14333
14334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14335}
14336
14337impl DnsForwarding {
14338 pub fn new() -> Self {
14339 std::default::Default::default()
14340 }
14341
14342 /// Sets the value of [name][crate::model::DnsForwarding::name].
14343 ///
14344 /// # Example
14345 /// ```ignore,no_run
14346 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14347 /// let x = DnsForwarding::new().set_name("example");
14348 /// ```
14349 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14350 self.name = v.into();
14351 self
14352 }
14353
14354 /// Sets the value of [create_time][crate::model::DnsForwarding::create_time].
14355 ///
14356 /// # Example
14357 /// ```ignore,no_run
14358 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14359 /// use wkt::Timestamp;
14360 /// let x = DnsForwarding::new().set_create_time(Timestamp::default()/* use setters */);
14361 /// ```
14362 pub fn set_create_time<T>(mut self, v: T) -> Self
14363 where
14364 T: std::convert::Into<wkt::Timestamp>,
14365 {
14366 self.create_time = std::option::Option::Some(v.into());
14367 self
14368 }
14369
14370 /// Sets or clears the value of [create_time][crate::model::DnsForwarding::create_time].
14371 ///
14372 /// # Example
14373 /// ```ignore,no_run
14374 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14375 /// use wkt::Timestamp;
14376 /// let x = DnsForwarding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14377 /// let x = DnsForwarding::new().set_or_clear_create_time(None::<Timestamp>);
14378 /// ```
14379 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14380 where
14381 T: std::convert::Into<wkt::Timestamp>,
14382 {
14383 self.create_time = v.map(|x| x.into());
14384 self
14385 }
14386
14387 /// Sets the value of [update_time][crate::model::DnsForwarding::update_time].
14388 ///
14389 /// # Example
14390 /// ```ignore,no_run
14391 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14392 /// use wkt::Timestamp;
14393 /// let x = DnsForwarding::new().set_update_time(Timestamp::default()/* use setters */);
14394 /// ```
14395 pub fn set_update_time<T>(mut self, v: T) -> Self
14396 where
14397 T: std::convert::Into<wkt::Timestamp>,
14398 {
14399 self.update_time = std::option::Option::Some(v.into());
14400 self
14401 }
14402
14403 /// Sets or clears the value of [update_time][crate::model::DnsForwarding::update_time].
14404 ///
14405 /// # Example
14406 /// ```ignore,no_run
14407 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14408 /// use wkt::Timestamp;
14409 /// let x = DnsForwarding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14410 /// let x = DnsForwarding::new().set_or_clear_update_time(None::<Timestamp>);
14411 /// ```
14412 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14413 where
14414 T: std::convert::Into<wkt::Timestamp>,
14415 {
14416 self.update_time = v.map(|x| x.into());
14417 self
14418 }
14419
14420 /// Sets the value of [forwarding_rules][crate::model::DnsForwarding::forwarding_rules].
14421 ///
14422 /// # Example
14423 /// ```ignore,no_run
14424 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14425 /// use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14426 /// let x = DnsForwarding::new()
14427 /// .set_forwarding_rules([
14428 /// ForwardingRule::default()/* use setters */,
14429 /// ForwardingRule::default()/* use (different) setters */,
14430 /// ]);
14431 /// ```
14432 pub fn set_forwarding_rules<T, V>(mut self, v: T) -> Self
14433 where
14434 T: std::iter::IntoIterator<Item = V>,
14435 V: std::convert::Into<crate::model::dns_forwarding::ForwardingRule>,
14436 {
14437 use std::iter::Iterator;
14438 self.forwarding_rules = v.into_iter().map(|i| i.into()).collect();
14439 self
14440 }
14441}
14442
14443impl wkt::message::Message for DnsForwarding {
14444 fn typename() -> &'static str {
14445 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding"
14446 }
14447}
14448
14449/// Defines additional types related to [DnsForwarding].
14450pub mod dns_forwarding {
14451 #[allow(unused_imports)]
14452 use super::*;
14453
14454 /// A forwarding rule is a mapping of a `domain` to `name_servers`.
14455 /// This mapping allows VMware Engine to resolve domains for attached private
14456 /// clouds by forwarding DNS requests for a given domain to the specified
14457 /// nameservers.
14458 #[derive(Clone, Default, PartialEq)]
14459 #[non_exhaustive]
14460 pub struct ForwardingRule {
14461 /// Required. Domain used to resolve a `name_servers` list.
14462 pub domain: std::string::String,
14463
14464 /// Required. List of DNS servers to use for domain resolution
14465 pub name_servers: std::vec::Vec<std::string::String>,
14466
14467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14468 }
14469
14470 impl ForwardingRule {
14471 pub fn new() -> Self {
14472 std::default::Default::default()
14473 }
14474
14475 /// Sets the value of [domain][crate::model::dns_forwarding::ForwardingRule::domain].
14476 ///
14477 /// # Example
14478 /// ```ignore,no_run
14479 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14480 /// let x = ForwardingRule::new().set_domain("example");
14481 /// ```
14482 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14483 self.domain = v.into();
14484 self
14485 }
14486
14487 /// Sets the value of [name_servers][crate::model::dns_forwarding::ForwardingRule::name_servers].
14488 ///
14489 /// # Example
14490 /// ```ignore,no_run
14491 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14492 /// let x = ForwardingRule::new().set_name_servers(["a", "b", "c"]);
14493 /// ```
14494 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
14495 where
14496 T: std::iter::IntoIterator<Item = V>,
14497 V: std::convert::Into<std::string::String>,
14498 {
14499 use std::iter::Iterator;
14500 self.name_servers = v.into_iter().map(|i| i.into()).collect();
14501 self
14502 }
14503 }
14504
14505 impl wkt::message::Message for ForwardingRule {
14506 fn typename() -> &'static str {
14507 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule"
14508 }
14509 }
14510}
14511
14512/// Details of a network peering.
14513#[derive(Clone, Default, PartialEq)]
14514#[non_exhaustive]
14515pub struct NetworkPeering {
14516 /// Output only. The resource name of the network peering. NetworkPeering is a
14517 /// global resource and location can only be global. Resource names are
14518 /// scheme-less URIs that follow the conventions in
14519 /// <https://cloud.google.com/apis/design/resource_names>.
14520 /// For example:
14521 /// `projects/my-project/locations/global/networkPeerings/my-peering`
14522 pub name: std::string::String,
14523
14524 /// Output only. Creation time of this resource.
14525 pub create_time: std::option::Option<wkt::Timestamp>,
14526
14527 /// Output only. Last update time of this resource.
14528 pub update_time: std::option::Option<wkt::Timestamp>,
14529
14530 /// Required. The relative resource name of the network to peer with
14531 /// a standard VMware Engine network. The provided network can be a
14532 /// consumer VPC network or another standard VMware Engine network. If the
14533 /// `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form:
14534 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
14535 /// Otherwise specify the name in the form:
14536 /// `projects/{project}/global/networks/{network_id}`, where
14537 /// `{project}` can either be a project number or a project ID.
14538 pub peer_network: std::string::String,
14539
14540 /// Optional. True if custom routes are exported to the peered network;
14541 /// false otherwise. The default value is true.
14542 pub export_custom_routes: std::option::Option<bool>,
14543
14544 /// Optional. True if custom routes are imported from the peered network;
14545 /// false otherwise. The default value is true.
14546 pub import_custom_routes: std::option::Option<bool>,
14547
14548 /// Optional. True if full mesh connectivity is created and managed
14549 /// automatically between peered networks; false otherwise. Currently this
14550 /// field is always true because Google Compute Engine automatically creates
14551 /// and manages subnetwork routes between two VPC networks when peering state
14552 /// is 'ACTIVE'.
14553 pub exchange_subnet_routes: std::option::Option<bool>,
14554
14555 /// Optional. True if all subnet routes with a public IP address range are
14556 /// exported; false otherwise. The default value is true. IPv4 special-use
14557 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14558 /// exported to peers and are not controlled by this field.
14559 pub export_custom_routes_with_public_ip: std::option::Option<bool>,
14560
14561 /// Optional. True if all subnet routes with public IP address range are
14562 /// imported; false otherwise. The default value is true. IPv4 special-use
14563 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14564 /// imported to peers and are not controlled by this field.
14565 pub import_custom_routes_with_public_ip: std::option::Option<bool>,
14566
14567 /// Output only. State of the network peering. This field
14568 /// has a value of 'ACTIVE' when there's a matching configuration in the peer
14569 /// network. New values may be added to this enum when appropriate.
14570 pub state: crate::model::network_peering::State,
14571
14572 /// Output only. Output Only. Details about the current state of the network
14573 /// peering.
14574 pub state_details: std::string::String,
14575
14576 /// Optional. Maximum transmission unit (MTU) in bytes.
14577 /// The default value is `1500`. If a value of `0` is provided for this field,
14578 /// VMware Engine uses the default value instead.
14579 pub peer_mtu: i32,
14580
14581 /// Required. The type of the network to peer with the VMware Engine network.
14582 pub peer_network_type: crate::model::network_peering::PeerNetworkType,
14583
14584 /// Output only. System-generated unique identifier for the resource.
14585 pub uid: std::string::String,
14586
14587 /// Required. The relative resource name of the VMware Engine network.
14588 /// Specify the name in the following form:
14589 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
14590 /// where `{project}` can either be a project number or a project ID.
14591 pub vmware_engine_network: std::string::String,
14592
14593 /// Optional. User-provided description for this network peering.
14594 pub description: std::string::String,
14595
14596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14597}
14598
14599impl NetworkPeering {
14600 pub fn new() -> Self {
14601 std::default::Default::default()
14602 }
14603
14604 /// Sets the value of [name][crate::model::NetworkPeering::name].
14605 ///
14606 /// # Example
14607 /// ```ignore,no_run
14608 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14609 /// let x = NetworkPeering::new().set_name("example");
14610 /// ```
14611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14612 self.name = v.into();
14613 self
14614 }
14615
14616 /// Sets the value of [create_time][crate::model::NetworkPeering::create_time].
14617 ///
14618 /// # Example
14619 /// ```ignore,no_run
14620 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14621 /// use wkt::Timestamp;
14622 /// let x = NetworkPeering::new().set_create_time(Timestamp::default()/* use setters */);
14623 /// ```
14624 pub fn set_create_time<T>(mut self, v: T) -> Self
14625 where
14626 T: std::convert::Into<wkt::Timestamp>,
14627 {
14628 self.create_time = std::option::Option::Some(v.into());
14629 self
14630 }
14631
14632 /// Sets or clears the value of [create_time][crate::model::NetworkPeering::create_time].
14633 ///
14634 /// # Example
14635 /// ```ignore,no_run
14636 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14637 /// use wkt::Timestamp;
14638 /// let x = NetworkPeering::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14639 /// let x = NetworkPeering::new().set_or_clear_create_time(None::<Timestamp>);
14640 /// ```
14641 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14642 where
14643 T: std::convert::Into<wkt::Timestamp>,
14644 {
14645 self.create_time = v.map(|x| x.into());
14646 self
14647 }
14648
14649 /// Sets the value of [update_time][crate::model::NetworkPeering::update_time].
14650 ///
14651 /// # Example
14652 /// ```ignore,no_run
14653 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14654 /// use wkt::Timestamp;
14655 /// let x = NetworkPeering::new().set_update_time(Timestamp::default()/* use setters */);
14656 /// ```
14657 pub fn set_update_time<T>(mut self, v: T) -> Self
14658 where
14659 T: std::convert::Into<wkt::Timestamp>,
14660 {
14661 self.update_time = std::option::Option::Some(v.into());
14662 self
14663 }
14664
14665 /// Sets or clears the value of [update_time][crate::model::NetworkPeering::update_time].
14666 ///
14667 /// # Example
14668 /// ```ignore,no_run
14669 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14670 /// use wkt::Timestamp;
14671 /// let x = NetworkPeering::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14672 /// let x = NetworkPeering::new().set_or_clear_update_time(None::<Timestamp>);
14673 /// ```
14674 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14675 where
14676 T: std::convert::Into<wkt::Timestamp>,
14677 {
14678 self.update_time = v.map(|x| x.into());
14679 self
14680 }
14681
14682 /// Sets the value of [peer_network][crate::model::NetworkPeering::peer_network].
14683 ///
14684 /// # Example
14685 /// ```ignore,no_run
14686 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14687 /// let x = NetworkPeering::new().set_peer_network("example");
14688 /// ```
14689 pub fn set_peer_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14690 self.peer_network = v.into();
14691 self
14692 }
14693
14694 /// Sets the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14695 ///
14696 /// # Example
14697 /// ```ignore,no_run
14698 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14699 /// let x = NetworkPeering::new().set_export_custom_routes(true);
14700 /// ```
14701 pub fn set_export_custom_routes<T>(mut self, v: T) -> Self
14702 where
14703 T: std::convert::Into<bool>,
14704 {
14705 self.export_custom_routes = std::option::Option::Some(v.into());
14706 self
14707 }
14708
14709 /// Sets or clears the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
14710 ///
14711 /// # Example
14712 /// ```ignore,no_run
14713 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14714 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(Some(false));
14715 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(None::<bool>);
14716 /// ```
14717 pub fn set_or_clear_export_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14718 where
14719 T: std::convert::Into<bool>,
14720 {
14721 self.export_custom_routes = v.map(|x| x.into());
14722 self
14723 }
14724
14725 /// Sets the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14726 ///
14727 /// # Example
14728 /// ```ignore,no_run
14729 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14730 /// let x = NetworkPeering::new().set_import_custom_routes(true);
14731 /// ```
14732 pub fn set_import_custom_routes<T>(mut self, v: T) -> Self
14733 where
14734 T: std::convert::Into<bool>,
14735 {
14736 self.import_custom_routes = std::option::Option::Some(v.into());
14737 self
14738 }
14739
14740 /// Sets or clears the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
14741 ///
14742 /// # Example
14743 /// ```ignore,no_run
14744 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14745 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(Some(false));
14746 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(None::<bool>);
14747 /// ```
14748 pub fn set_or_clear_import_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
14749 where
14750 T: std::convert::Into<bool>,
14751 {
14752 self.import_custom_routes = v.map(|x| x.into());
14753 self
14754 }
14755
14756 /// Sets the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14757 ///
14758 /// # Example
14759 /// ```ignore,no_run
14760 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14761 /// let x = NetworkPeering::new().set_exchange_subnet_routes(true);
14762 /// ```
14763 pub fn set_exchange_subnet_routes<T>(mut self, v: T) -> Self
14764 where
14765 T: std::convert::Into<bool>,
14766 {
14767 self.exchange_subnet_routes = std::option::Option::Some(v.into());
14768 self
14769 }
14770
14771 /// Sets or clears the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
14772 ///
14773 /// # Example
14774 /// ```ignore,no_run
14775 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14776 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(Some(false));
14777 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(None::<bool>);
14778 /// ```
14779 pub fn set_or_clear_exchange_subnet_routes<T>(mut self, v: std::option::Option<T>) -> Self
14780 where
14781 T: std::convert::Into<bool>,
14782 {
14783 self.exchange_subnet_routes = v.map(|x| x.into());
14784 self
14785 }
14786
14787 /// Sets the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14788 ///
14789 /// # Example
14790 /// ```ignore,no_run
14791 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14792 /// let x = NetworkPeering::new().set_export_custom_routes_with_public_ip(true);
14793 /// ```
14794 pub fn set_export_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14795 where
14796 T: std::convert::Into<bool>,
14797 {
14798 self.export_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14799 self
14800 }
14801
14802 /// Sets or clears the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
14803 ///
14804 /// # Example
14805 /// ```ignore,no_run
14806 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14807 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(Some(false));
14808 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(None::<bool>);
14809 /// ```
14810 pub fn set_or_clear_export_custom_routes_with_public_ip<T>(
14811 mut self,
14812 v: std::option::Option<T>,
14813 ) -> Self
14814 where
14815 T: std::convert::Into<bool>,
14816 {
14817 self.export_custom_routes_with_public_ip = v.map(|x| x.into());
14818 self
14819 }
14820
14821 /// Sets the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14822 ///
14823 /// # Example
14824 /// ```ignore,no_run
14825 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14826 /// let x = NetworkPeering::new().set_import_custom_routes_with_public_ip(true);
14827 /// ```
14828 pub fn set_import_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
14829 where
14830 T: std::convert::Into<bool>,
14831 {
14832 self.import_custom_routes_with_public_ip = std::option::Option::Some(v.into());
14833 self
14834 }
14835
14836 /// Sets or clears the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
14837 ///
14838 /// # Example
14839 /// ```ignore,no_run
14840 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14841 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(Some(false));
14842 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(None::<bool>);
14843 /// ```
14844 pub fn set_or_clear_import_custom_routes_with_public_ip<T>(
14845 mut self,
14846 v: std::option::Option<T>,
14847 ) -> Self
14848 where
14849 T: std::convert::Into<bool>,
14850 {
14851 self.import_custom_routes_with_public_ip = v.map(|x| x.into());
14852 self
14853 }
14854
14855 /// Sets the value of [state][crate::model::NetworkPeering::state].
14856 ///
14857 /// # Example
14858 /// ```ignore,no_run
14859 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14860 /// use google_cloud_vmwareengine_v1::model::network_peering::State;
14861 /// let x0 = NetworkPeering::new().set_state(State::Inactive);
14862 /// let x1 = NetworkPeering::new().set_state(State::Active);
14863 /// let x2 = NetworkPeering::new().set_state(State::Creating);
14864 /// ```
14865 pub fn set_state<T: std::convert::Into<crate::model::network_peering::State>>(
14866 mut self,
14867 v: T,
14868 ) -> Self {
14869 self.state = v.into();
14870 self
14871 }
14872
14873 /// Sets the value of [state_details][crate::model::NetworkPeering::state_details].
14874 ///
14875 /// # Example
14876 /// ```ignore,no_run
14877 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14878 /// let x = NetworkPeering::new().set_state_details("example");
14879 /// ```
14880 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14881 self.state_details = v.into();
14882 self
14883 }
14884
14885 /// Sets the value of [peer_mtu][crate::model::NetworkPeering::peer_mtu].
14886 ///
14887 /// # Example
14888 /// ```ignore,no_run
14889 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14890 /// let x = NetworkPeering::new().set_peer_mtu(42);
14891 /// ```
14892 pub fn set_peer_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14893 self.peer_mtu = v.into();
14894 self
14895 }
14896
14897 /// Sets the value of [peer_network_type][crate::model::NetworkPeering::peer_network_type].
14898 ///
14899 /// # Example
14900 /// ```ignore,no_run
14901 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14902 /// use google_cloud_vmwareengine_v1::model::network_peering::PeerNetworkType;
14903 /// let x0 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::Standard);
14904 /// let x1 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::VmwareEngineNetwork);
14905 /// let x2 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::PrivateServicesAccess);
14906 /// ```
14907 pub fn set_peer_network_type<
14908 T: std::convert::Into<crate::model::network_peering::PeerNetworkType>,
14909 >(
14910 mut self,
14911 v: T,
14912 ) -> Self {
14913 self.peer_network_type = v.into();
14914 self
14915 }
14916
14917 /// Sets the value of [uid][crate::model::NetworkPeering::uid].
14918 ///
14919 /// # Example
14920 /// ```ignore,no_run
14921 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14922 /// let x = NetworkPeering::new().set_uid("example");
14923 /// ```
14924 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14925 self.uid = v.into();
14926 self
14927 }
14928
14929 /// Sets the value of [vmware_engine_network][crate::model::NetworkPeering::vmware_engine_network].
14930 ///
14931 /// # Example
14932 /// ```ignore,no_run
14933 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14934 /// let x = NetworkPeering::new().set_vmware_engine_network("example");
14935 /// ```
14936 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
14937 mut self,
14938 v: T,
14939 ) -> Self {
14940 self.vmware_engine_network = v.into();
14941 self
14942 }
14943
14944 /// Sets the value of [description][crate::model::NetworkPeering::description].
14945 ///
14946 /// # Example
14947 /// ```ignore,no_run
14948 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14949 /// let x = NetworkPeering::new().set_description("example");
14950 /// ```
14951 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14952 self.description = v.into();
14953 self
14954 }
14955}
14956
14957impl wkt::message::Message for NetworkPeering {
14958 fn typename() -> &'static str {
14959 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPeering"
14960 }
14961}
14962
14963/// Defines additional types related to [NetworkPeering].
14964pub mod network_peering {
14965 #[allow(unused_imports)]
14966 use super::*;
14967
14968 /// Possible states of a network peering.
14969 ///
14970 /// # Working with unknown values
14971 ///
14972 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14973 /// additional enum variants at any time. Adding new variants is not considered
14974 /// a breaking change. Applications should write their code in anticipation of:
14975 ///
14976 /// - New values appearing in future releases of the client library, **and**
14977 /// - New values received dynamically, without application changes.
14978 ///
14979 /// Please consult the [Working with enums] section in the user guide for some
14980 /// guidelines.
14981 ///
14982 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14983 #[derive(Clone, Debug, PartialEq)]
14984 #[non_exhaustive]
14985 pub enum State {
14986 /// Unspecified network peering state. This is the default value.
14987 Unspecified,
14988 /// The peering is not active.
14989 Inactive,
14990 /// The peering is active.
14991 Active,
14992 /// The peering is being created.
14993 Creating,
14994 /// The peering is being deleted.
14995 Deleting,
14996 /// If set, the enum was initialized with an unknown value.
14997 ///
14998 /// Applications can examine the value using [State::value] or
14999 /// [State::name].
15000 UnknownValue(state::UnknownValue),
15001 }
15002
15003 #[doc(hidden)]
15004 pub mod state {
15005 #[allow(unused_imports)]
15006 use super::*;
15007 #[derive(Clone, Debug, PartialEq)]
15008 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15009 }
15010
15011 impl State {
15012 /// Gets the enum value.
15013 ///
15014 /// Returns `None` if the enum contains an unknown value deserialized from
15015 /// the string representation of enums.
15016 pub fn value(&self) -> std::option::Option<i32> {
15017 match self {
15018 Self::Unspecified => std::option::Option::Some(0),
15019 Self::Inactive => std::option::Option::Some(1),
15020 Self::Active => std::option::Option::Some(2),
15021 Self::Creating => std::option::Option::Some(3),
15022 Self::Deleting => std::option::Option::Some(4),
15023 Self::UnknownValue(u) => u.0.value(),
15024 }
15025 }
15026
15027 /// Gets the enum value as a string.
15028 ///
15029 /// Returns `None` if the enum contains an unknown value deserialized from
15030 /// the integer representation of enums.
15031 pub fn name(&self) -> std::option::Option<&str> {
15032 match self {
15033 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15034 Self::Inactive => std::option::Option::Some("INACTIVE"),
15035 Self::Active => std::option::Option::Some("ACTIVE"),
15036 Self::Creating => std::option::Option::Some("CREATING"),
15037 Self::Deleting => std::option::Option::Some("DELETING"),
15038 Self::UnknownValue(u) => u.0.name(),
15039 }
15040 }
15041 }
15042
15043 impl std::default::Default for State {
15044 fn default() -> Self {
15045 use std::convert::From;
15046 Self::from(0)
15047 }
15048 }
15049
15050 impl std::fmt::Display for State {
15051 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15052 wkt::internal::display_enum(f, self.name(), self.value())
15053 }
15054 }
15055
15056 impl std::convert::From<i32> for State {
15057 fn from(value: i32) -> Self {
15058 match value {
15059 0 => Self::Unspecified,
15060 1 => Self::Inactive,
15061 2 => Self::Active,
15062 3 => Self::Creating,
15063 4 => Self::Deleting,
15064 _ => Self::UnknownValue(state::UnknownValue(
15065 wkt::internal::UnknownEnumValue::Integer(value),
15066 )),
15067 }
15068 }
15069 }
15070
15071 impl std::convert::From<&str> for State {
15072 fn from(value: &str) -> Self {
15073 use std::string::ToString;
15074 match value {
15075 "STATE_UNSPECIFIED" => Self::Unspecified,
15076 "INACTIVE" => Self::Inactive,
15077 "ACTIVE" => Self::Active,
15078 "CREATING" => Self::Creating,
15079 "DELETING" => Self::Deleting,
15080 _ => Self::UnknownValue(state::UnknownValue(
15081 wkt::internal::UnknownEnumValue::String(value.to_string()),
15082 )),
15083 }
15084 }
15085 }
15086
15087 impl serde::ser::Serialize for State {
15088 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15089 where
15090 S: serde::Serializer,
15091 {
15092 match self {
15093 Self::Unspecified => serializer.serialize_i32(0),
15094 Self::Inactive => serializer.serialize_i32(1),
15095 Self::Active => serializer.serialize_i32(2),
15096 Self::Creating => serializer.serialize_i32(3),
15097 Self::Deleting => serializer.serialize_i32(4),
15098 Self::UnknownValue(u) => u.0.serialize(serializer),
15099 }
15100 }
15101 }
15102
15103 impl<'de> serde::de::Deserialize<'de> for State {
15104 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15105 where
15106 D: serde::Deserializer<'de>,
15107 {
15108 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15109 ".google.cloud.vmwareengine.v1.NetworkPeering.State",
15110 ))
15111 }
15112 }
15113
15114 /// Type or purpose of the network peering connection.
15115 ///
15116 /// # Working with unknown values
15117 ///
15118 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15119 /// additional enum variants at any time. Adding new variants is not considered
15120 /// a breaking change. Applications should write their code in anticipation of:
15121 ///
15122 /// - New values appearing in future releases of the client library, **and**
15123 /// - New values received dynamically, without application changes.
15124 ///
15125 /// Please consult the [Working with enums] section in the user guide for some
15126 /// guidelines.
15127 ///
15128 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15129 #[derive(Clone, Debug, PartialEq)]
15130 #[non_exhaustive]
15131 pub enum PeerNetworkType {
15132 /// Unspecified
15133 Unspecified,
15134 /// Peering connection used for connecting to another VPC network established
15135 /// by the same user. For example, a peering connection to another VPC
15136 /// network in the same project or to an on-premises network.
15137 Standard,
15138 /// Peering connection used for connecting to another VMware Engine network.
15139 VmwareEngineNetwork,
15140 /// Peering connection used for establishing [private services
15141 /// access](https://cloud.google.com/vpc/docs/private-services-access).
15142 PrivateServicesAccess,
15143 /// Peering connection used for connecting to NetApp Cloud Volumes.
15144 NetappCloudVolumes,
15145 /// Peering connection used for connecting to third-party services. Most
15146 /// third-party services require manual setup of reverse peering on the VPC
15147 /// network associated with the third-party service.
15148 ThirdPartyService,
15149 /// Peering connection used for connecting to Dell PowerScale Filers
15150 DellPowerscale,
15151 /// Peering connection used for connecting to Google Cloud NetApp Volumes.
15152 GoogleCloudNetappVolumes,
15153 /// If set, the enum was initialized with an unknown value.
15154 ///
15155 /// Applications can examine the value using [PeerNetworkType::value] or
15156 /// [PeerNetworkType::name].
15157 UnknownValue(peer_network_type::UnknownValue),
15158 }
15159
15160 #[doc(hidden)]
15161 pub mod peer_network_type {
15162 #[allow(unused_imports)]
15163 use super::*;
15164 #[derive(Clone, Debug, PartialEq)]
15165 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15166 }
15167
15168 impl PeerNetworkType {
15169 /// Gets the enum value.
15170 ///
15171 /// Returns `None` if the enum contains an unknown value deserialized from
15172 /// the string representation of enums.
15173 pub fn value(&self) -> std::option::Option<i32> {
15174 match self {
15175 Self::Unspecified => std::option::Option::Some(0),
15176 Self::Standard => std::option::Option::Some(1),
15177 Self::VmwareEngineNetwork => std::option::Option::Some(2),
15178 Self::PrivateServicesAccess => std::option::Option::Some(3),
15179 Self::NetappCloudVolumes => std::option::Option::Some(4),
15180 Self::ThirdPartyService => std::option::Option::Some(5),
15181 Self::DellPowerscale => std::option::Option::Some(6),
15182 Self::GoogleCloudNetappVolumes => std::option::Option::Some(7),
15183 Self::UnknownValue(u) => u.0.value(),
15184 }
15185 }
15186
15187 /// Gets the enum value as a string.
15188 ///
15189 /// Returns `None` if the enum contains an unknown value deserialized from
15190 /// the integer representation of enums.
15191 pub fn name(&self) -> std::option::Option<&str> {
15192 match self {
15193 Self::Unspecified => std::option::Option::Some("PEER_NETWORK_TYPE_UNSPECIFIED"),
15194 Self::Standard => std::option::Option::Some("STANDARD"),
15195 Self::VmwareEngineNetwork => std::option::Option::Some("VMWARE_ENGINE_NETWORK"),
15196 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
15197 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
15198 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
15199 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
15200 Self::GoogleCloudNetappVolumes => {
15201 std::option::Option::Some("GOOGLE_CLOUD_NETAPP_VOLUMES")
15202 }
15203 Self::UnknownValue(u) => u.0.name(),
15204 }
15205 }
15206 }
15207
15208 impl std::default::Default for PeerNetworkType {
15209 fn default() -> Self {
15210 use std::convert::From;
15211 Self::from(0)
15212 }
15213 }
15214
15215 impl std::fmt::Display for PeerNetworkType {
15216 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15217 wkt::internal::display_enum(f, self.name(), self.value())
15218 }
15219 }
15220
15221 impl std::convert::From<i32> for PeerNetworkType {
15222 fn from(value: i32) -> Self {
15223 match value {
15224 0 => Self::Unspecified,
15225 1 => Self::Standard,
15226 2 => Self::VmwareEngineNetwork,
15227 3 => Self::PrivateServicesAccess,
15228 4 => Self::NetappCloudVolumes,
15229 5 => Self::ThirdPartyService,
15230 6 => Self::DellPowerscale,
15231 7 => Self::GoogleCloudNetappVolumes,
15232 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15233 wkt::internal::UnknownEnumValue::Integer(value),
15234 )),
15235 }
15236 }
15237 }
15238
15239 impl std::convert::From<&str> for PeerNetworkType {
15240 fn from(value: &str) -> Self {
15241 use std::string::ToString;
15242 match value {
15243 "PEER_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
15244 "STANDARD" => Self::Standard,
15245 "VMWARE_ENGINE_NETWORK" => Self::VmwareEngineNetwork,
15246 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
15247 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
15248 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
15249 "DELL_POWERSCALE" => Self::DellPowerscale,
15250 "GOOGLE_CLOUD_NETAPP_VOLUMES" => Self::GoogleCloudNetappVolumes,
15251 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15252 wkt::internal::UnknownEnumValue::String(value.to_string()),
15253 )),
15254 }
15255 }
15256 }
15257
15258 impl serde::ser::Serialize for PeerNetworkType {
15259 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15260 where
15261 S: serde::Serializer,
15262 {
15263 match self {
15264 Self::Unspecified => serializer.serialize_i32(0),
15265 Self::Standard => serializer.serialize_i32(1),
15266 Self::VmwareEngineNetwork => serializer.serialize_i32(2),
15267 Self::PrivateServicesAccess => serializer.serialize_i32(3),
15268 Self::NetappCloudVolumes => serializer.serialize_i32(4),
15269 Self::ThirdPartyService => serializer.serialize_i32(5),
15270 Self::DellPowerscale => serializer.serialize_i32(6),
15271 Self::GoogleCloudNetappVolumes => serializer.serialize_i32(7),
15272 Self::UnknownValue(u) => u.0.serialize(serializer),
15273 }
15274 }
15275 }
15276
15277 impl<'de> serde::de::Deserialize<'de> for PeerNetworkType {
15278 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15279 where
15280 D: serde::Deserializer<'de>,
15281 {
15282 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeerNetworkType>::new(
15283 ".google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType",
15284 ))
15285 }
15286 }
15287}
15288
15289/// Exchanged network peering route.
15290#[derive(Clone, Default, PartialEq)]
15291#[non_exhaustive]
15292pub struct PeeringRoute {
15293 /// Output only. Destination range of the peering route in CIDR notation.
15294 pub dest_range: std::string::String,
15295
15296 /// Output only. Type of the route in the peer VPC network.
15297 pub r#type: crate::model::peering_route::Type,
15298
15299 /// Output only. Region containing the next hop of the peering route. This
15300 /// field only applies to dynamic routes in the peer VPC network.
15301 pub next_hop_region: std::string::String,
15302
15303 /// Output only. The priority of the peering route.
15304 pub priority: i64,
15305
15306 /// Output only. True if the peering route has been imported from a peered
15307 /// VPC network; false otherwise. The import happens if the field
15308 /// `NetworkPeering.importCustomRoutes` is true for this network,
15309 /// `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
15310 /// the import does not result in a route conflict.
15311 pub imported: bool,
15312
15313 /// Output only. Direction of the routes exchanged with the peer network, from
15314 /// the VMware Engine network perspective:
15315 ///
15316 /// * Routes of direction `INCOMING` are imported from the peer network.
15317 /// * Routes of direction `OUTGOING` are exported from the intranet VPC network
15318 /// of the VMware Engine network.
15319 pub direction: crate::model::peering_route::Direction,
15320
15321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15322}
15323
15324impl PeeringRoute {
15325 pub fn new() -> Self {
15326 std::default::Default::default()
15327 }
15328
15329 /// Sets the value of [dest_range][crate::model::PeeringRoute::dest_range].
15330 ///
15331 /// # Example
15332 /// ```ignore,no_run
15333 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15334 /// let x = PeeringRoute::new().set_dest_range("example");
15335 /// ```
15336 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15337 self.dest_range = v.into();
15338 self
15339 }
15340
15341 /// Sets the value of [r#type][crate::model::PeeringRoute::type].
15342 ///
15343 /// # Example
15344 /// ```ignore,no_run
15345 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15346 /// use google_cloud_vmwareengine_v1::model::peering_route::Type;
15347 /// let x0 = PeeringRoute::new().set_type(Type::DynamicPeeringRoute);
15348 /// let x1 = PeeringRoute::new().set_type(Type::StaticPeeringRoute);
15349 /// let x2 = PeeringRoute::new().set_type(Type::SubnetPeeringRoute);
15350 /// ```
15351 pub fn set_type<T: std::convert::Into<crate::model::peering_route::Type>>(
15352 mut self,
15353 v: T,
15354 ) -> Self {
15355 self.r#type = v.into();
15356 self
15357 }
15358
15359 /// Sets the value of [next_hop_region][crate::model::PeeringRoute::next_hop_region].
15360 ///
15361 /// # Example
15362 /// ```ignore,no_run
15363 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15364 /// let x = PeeringRoute::new().set_next_hop_region("example");
15365 /// ```
15366 pub fn set_next_hop_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15367 self.next_hop_region = v.into();
15368 self
15369 }
15370
15371 /// Sets the value of [priority][crate::model::PeeringRoute::priority].
15372 ///
15373 /// # Example
15374 /// ```ignore,no_run
15375 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15376 /// let x = PeeringRoute::new().set_priority(42);
15377 /// ```
15378 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15379 self.priority = v.into();
15380 self
15381 }
15382
15383 /// Sets the value of [imported][crate::model::PeeringRoute::imported].
15384 ///
15385 /// # Example
15386 /// ```ignore,no_run
15387 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15388 /// let x = PeeringRoute::new().set_imported(true);
15389 /// ```
15390 pub fn set_imported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15391 self.imported = v.into();
15392 self
15393 }
15394
15395 /// Sets the value of [direction][crate::model::PeeringRoute::direction].
15396 ///
15397 /// # Example
15398 /// ```ignore,no_run
15399 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15400 /// use google_cloud_vmwareengine_v1::model::peering_route::Direction;
15401 /// let x0 = PeeringRoute::new().set_direction(Direction::Incoming);
15402 /// let x1 = PeeringRoute::new().set_direction(Direction::Outgoing);
15403 /// ```
15404 pub fn set_direction<T: std::convert::Into<crate::model::peering_route::Direction>>(
15405 mut self,
15406 v: T,
15407 ) -> Self {
15408 self.direction = v.into();
15409 self
15410 }
15411}
15412
15413impl wkt::message::Message for PeeringRoute {
15414 fn typename() -> &'static str {
15415 "type.googleapis.com/google.cloud.vmwareengine.v1.PeeringRoute"
15416 }
15417}
15418
15419/// Defines additional types related to [PeeringRoute].
15420pub mod peering_route {
15421 #[allow(unused_imports)]
15422 use super::*;
15423
15424 /// The type of the peering route.
15425 ///
15426 /// # Working with unknown values
15427 ///
15428 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15429 /// additional enum variants at any time. Adding new variants is not considered
15430 /// a breaking change. Applications should write their code in anticipation of:
15431 ///
15432 /// - New values appearing in future releases of the client library, **and**
15433 /// - New values received dynamically, without application changes.
15434 ///
15435 /// Please consult the [Working with enums] section in the user guide for some
15436 /// guidelines.
15437 ///
15438 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15439 #[derive(Clone, Debug, PartialEq)]
15440 #[non_exhaustive]
15441 pub enum Type {
15442 /// Unspecified peering route type. This is the default value.
15443 Unspecified,
15444 /// Dynamic routes in the peer network.
15445 DynamicPeeringRoute,
15446 /// Static routes in the peer network.
15447 StaticPeeringRoute,
15448 /// Created, updated, and removed automatically by Google Cloud when subnets
15449 /// are created, modified, or deleted in the peer network.
15450 SubnetPeeringRoute,
15451 /// If set, the enum was initialized with an unknown value.
15452 ///
15453 /// Applications can examine the value using [Type::value] or
15454 /// [Type::name].
15455 UnknownValue(r#type::UnknownValue),
15456 }
15457
15458 #[doc(hidden)]
15459 pub mod r#type {
15460 #[allow(unused_imports)]
15461 use super::*;
15462 #[derive(Clone, Debug, PartialEq)]
15463 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15464 }
15465
15466 impl Type {
15467 /// Gets the enum value.
15468 ///
15469 /// Returns `None` if the enum contains an unknown value deserialized from
15470 /// the string representation of enums.
15471 pub fn value(&self) -> std::option::Option<i32> {
15472 match self {
15473 Self::Unspecified => std::option::Option::Some(0),
15474 Self::DynamicPeeringRoute => std::option::Option::Some(1),
15475 Self::StaticPeeringRoute => std::option::Option::Some(2),
15476 Self::SubnetPeeringRoute => std::option::Option::Some(3),
15477 Self::UnknownValue(u) => u.0.value(),
15478 }
15479 }
15480
15481 /// Gets the enum value as a string.
15482 ///
15483 /// Returns `None` if the enum contains an unknown value deserialized from
15484 /// the integer representation of enums.
15485 pub fn name(&self) -> std::option::Option<&str> {
15486 match self {
15487 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15488 Self::DynamicPeeringRoute => std::option::Option::Some("DYNAMIC_PEERING_ROUTE"),
15489 Self::StaticPeeringRoute => std::option::Option::Some("STATIC_PEERING_ROUTE"),
15490 Self::SubnetPeeringRoute => std::option::Option::Some("SUBNET_PEERING_ROUTE"),
15491 Self::UnknownValue(u) => u.0.name(),
15492 }
15493 }
15494 }
15495
15496 impl std::default::Default for Type {
15497 fn default() -> Self {
15498 use std::convert::From;
15499 Self::from(0)
15500 }
15501 }
15502
15503 impl std::fmt::Display for Type {
15504 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15505 wkt::internal::display_enum(f, self.name(), self.value())
15506 }
15507 }
15508
15509 impl std::convert::From<i32> for Type {
15510 fn from(value: i32) -> Self {
15511 match value {
15512 0 => Self::Unspecified,
15513 1 => Self::DynamicPeeringRoute,
15514 2 => Self::StaticPeeringRoute,
15515 3 => Self::SubnetPeeringRoute,
15516 _ => Self::UnknownValue(r#type::UnknownValue(
15517 wkt::internal::UnknownEnumValue::Integer(value),
15518 )),
15519 }
15520 }
15521 }
15522
15523 impl std::convert::From<&str> for Type {
15524 fn from(value: &str) -> Self {
15525 use std::string::ToString;
15526 match value {
15527 "TYPE_UNSPECIFIED" => Self::Unspecified,
15528 "DYNAMIC_PEERING_ROUTE" => Self::DynamicPeeringRoute,
15529 "STATIC_PEERING_ROUTE" => Self::StaticPeeringRoute,
15530 "SUBNET_PEERING_ROUTE" => Self::SubnetPeeringRoute,
15531 _ => Self::UnknownValue(r#type::UnknownValue(
15532 wkt::internal::UnknownEnumValue::String(value.to_string()),
15533 )),
15534 }
15535 }
15536 }
15537
15538 impl serde::ser::Serialize for Type {
15539 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15540 where
15541 S: serde::Serializer,
15542 {
15543 match self {
15544 Self::Unspecified => serializer.serialize_i32(0),
15545 Self::DynamicPeeringRoute => serializer.serialize_i32(1),
15546 Self::StaticPeeringRoute => serializer.serialize_i32(2),
15547 Self::SubnetPeeringRoute => serializer.serialize_i32(3),
15548 Self::UnknownValue(u) => u.0.serialize(serializer),
15549 }
15550 }
15551 }
15552
15553 impl<'de> serde::de::Deserialize<'de> for Type {
15554 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15555 where
15556 D: serde::Deserializer<'de>,
15557 {
15558 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15559 ".google.cloud.vmwareengine.v1.PeeringRoute.Type",
15560 ))
15561 }
15562 }
15563
15564 /// The direction of the exchanged routes.
15565 ///
15566 /// # Working with unknown values
15567 ///
15568 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15569 /// additional enum variants at any time. Adding new variants is not considered
15570 /// a breaking change. Applications should write their code in anticipation of:
15571 ///
15572 /// - New values appearing in future releases of the client library, **and**
15573 /// - New values received dynamically, without application changes.
15574 ///
15575 /// Please consult the [Working with enums] section in the user guide for some
15576 /// guidelines.
15577 ///
15578 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15579 #[derive(Clone, Debug, PartialEq)]
15580 #[non_exhaustive]
15581 pub enum Direction {
15582 /// Unspecified exchanged routes direction. This is default.
15583 Unspecified,
15584 /// Routes imported from the peer network.
15585 Incoming,
15586 /// Routes exported to the peer network.
15587 Outgoing,
15588 /// If set, the enum was initialized with an unknown value.
15589 ///
15590 /// Applications can examine the value using [Direction::value] or
15591 /// [Direction::name].
15592 UnknownValue(direction::UnknownValue),
15593 }
15594
15595 #[doc(hidden)]
15596 pub mod direction {
15597 #[allow(unused_imports)]
15598 use super::*;
15599 #[derive(Clone, Debug, PartialEq)]
15600 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15601 }
15602
15603 impl Direction {
15604 /// Gets the enum value.
15605 ///
15606 /// Returns `None` if the enum contains an unknown value deserialized from
15607 /// the string representation of enums.
15608 pub fn value(&self) -> std::option::Option<i32> {
15609 match self {
15610 Self::Unspecified => std::option::Option::Some(0),
15611 Self::Incoming => std::option::Option::Some(1),
15612 Self::Outgoing => std::option::Option::Some(2),
15613 Self::UnknownValue(u) => u.0.value(),
15614 }
15615 }
15616
15617 /// Gets the enum value as a string.
15618 ///
15619 /// Returns `None` if the enum contains an unknown value deserialized from
15620 /// the integer representation of enums.
15621 pub fn name(&self) -> std::option::Option<&str> {
15622 match self {
15623 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
15624 Self::Incoming => std::option::Option::Some("INCOMING"),
15625 Self::Outgoing => std::option::Option::Some("OUTGOING"),
15626 Self::UnknownValue(u) => u.0.name(),
15627 }
15628 }
15629 }
15630
15631 impl std::default::Default for Direction {
15632 fn default() -> Self {
15633 use std::convert::From;
15634 Self::from(0)
15635 }
15636 }
15637
15638 impl std::fmt::Display for Direction {
15639 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15640 wkt::internal::display_enum(f, self.name(), self.value())
15641 }
15642 }
15643
15644 impl std::convert::From<i32> for Direction {
15645 fn from(value: i32) -> Self {
15646 match value {
15647 0 => Self::Unspecified,
15648 1 => Self::Incoming,
15649 2 => Self::Outgoing,
15650 _ => Self::UnknownValue(direction::UnknownValue(
15651 wkt::internal::UnknownEnumValue::Integer(value),
15652 )),
15653 }
15654 }
15655 }
15656
15657 impl std::convert::From<&str> for Direction {
15658 fn from(value: &str) -> Self {
15659 use std::string::ToString;
15660 match value {
15661 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
15662 "INCOMING" => Self::Incoming,
15663 "OUTGOING" => Self::Outgoing,
15664 _ => Self::UnknownValue(direction::UnknownValue(
15665 wkt::internal::UnknownEnumValue::String(value.to_string()),
15666 )),
15667 }
15668 }
15669 }
15670
15671 impl serde::ser::Serialize for Direction {
15672 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15673 where
15674 S: serde::Serializer,
15675 {
15676 match self {
15677 Self::Unspecified => serializer.serialize_i32(0),
15678 Self::Incoming => serializer.serialize_i32(1),
15679 Self::Outgoing => serializer.serialize_i32(2),
15680 Self::UnknownValue(u) => u.0.serialize(serializer),
15681 }
15682 }
15683 }
15684
15685 impl<'de> serde::de::Deserialize<'de> for Direction {
15686 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15687 where
15688 D: serde::Deserializer<'de>,
15689 {
15690 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
15691 ".google.cloud.vmwareengine.v1.PeeringRoute.Direction",
15692 ))
15693 }
15694 }
15695}
15696
15697/// Represents a network policy resource. Network policies are regional
15698/// resources. You can use a network policy to enable or disable internet access
15699/// and external IP access. Network policies are associated with a VMware Engine
15700/// network, which might span across regions. For a given region, a network
15701/// policy applies to all private clouds in the VMware Engine network associated
15702/// with the policy.
15703#[derive(Clone, Default, PartialEq)]
15704#[non_exhaustive]
15705pub struct NetworkPolicy {
15706 /// Output only. The resource name of this network policy.
15707 /// Resource names are schemeless URIs that follow the conventions in
15708 /// <https://cloud.google.com/apis/design/resource_names>.
15709 /// For example:
15710 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
15711 pub name: std::string::String,
15712
15713 /// Output only. Creation time of this resource.
15714 pub create_time: std::option::Option<wkt::Timestamp>,
15715
15716 /// Output only. Last update time of this resource.
15717 pub update_time: std::option::Option<wkt::Timestamp>,
15718
15719 /// Network service that allows VMware workloads to access the internet.
15720 pub internet_access: std::option::Option<crate::model::network_policy::NetworkService>,
15721
15722 /// Network service that allows External IP addresses to be assigned to VMware
15723 /// workloads. This service can only be enabled when `internet_access` is also
15724 /// enabled.
15725 pub external_ip: std::option::Option<crate::model::network_policy::NetworkService>,
15726
15727 /// Required. IP address range in CIDR notation used to create internet access
15728 /// and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
15729 /// required. The range cannot overlap with any prefixes either in the consumer
15730 /// VPC network or in use by the private clouds attached to that VPC network.
15731 pub edge_services_cidr: std::string::String,
15732
15733 /// Output only. System-generated unique identifier for the resource.
15734 pub uid: std::string::String,
15735
15736 /// Optional. The relative resource name of the VMware Engine network.
15737 /// Specify the name in the following form:
15738 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15739 /// where `{project}` can either be a project number or a project ID.
15740 pub vmware_engine_network: std::string::String,
15741
15742 /// Optional. User-provided description for this network policy.
15743 pub description: std::string::String,
15744
15745 /// Output only. The canonical name of the VMware Engine network in the form:
15746 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
15747 pub vmware_engine_network_canonical: std::string::String,
15748
15749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15750}
15751
15752impl NetworkPolicy {
15753 pub fn new() -> Self {
15754 std::default::Default::default()
15755 }
15756
15757 /// Sets the value of [name][crate::model::NetworkPolicy::name].
15758 ///
15759 /// # Example
15760 /// ```ignore,no_run
15761 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15762 /// let x = NetworkPolicy::new().set_name("example");
15763 /// ```
15764 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15765 self.name = v.into();
15766 self
15767 }
15768
15769 /// Sets the value of [create_time][crate::model::NetworkPolicy::create_time].
15770 ///
15771 /// # Example
15772 /// ```ignore,no_run
15773 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15774 /// use wkt::Timestamp;
15775 /// let x = NetworkPolicy::new().set_create_time(Timestamp::default()/* use setters */);
15776 /// ```
15777 pub fn set_create_time<T>(mut self, v: T) -> Self
15778 where
15779 T: std::convert::Into<wkt::Timestamp>,
15780 {
15781 self.create_time = std::option::Option::Some(v.into());
15782 self
15783 }
15784
15785 /// Sets or clears the value of [create_time][crate::model::NetworkPolicy::create_time].
15786 ///
15787 /// # Example
15788 /// ```ignore,no_run
15789 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15790 /// use wkt::Timestamp;
15791 /// let x = NetworkPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15792 /// let x = NetworkPolicy::new().set_or_clear_create_time(None::<Timestamp>);
15793 /// ```
15794 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15795 where
15796 T: std::convert::Into<wkt::Timestamp>,
15797 {
15798 self.create_time = v.map(|x| x.into());
15799 self
15800 }
15801
15802 /// Sets the value of [update_time][crate::model::NetworkPolicy::update_time].
15803 ///
15804 /// # Example
15805 /// ```ignore,no_run
15806 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15807 /// use wkt::Timestamp;
15808 /// let x = NetworkPolicy::new().set_update_time(Timestamp::default()/* use setters */);
15809 /// ```
15810 pub fn set_update_time<T>(mut self, v: T) -> Self
15811 where
15812 T: std::convert::Into<wkt::Timestamp>,
15813 {
15814 self.update_time = std::option::Option::Some(v.into());
15815 self
15816 }
15817
15818 /// Sets or clears the value of [update_time][crate::model::NetworkPolicy::update_time].
15819 ///
15820 /// # Example
15821 /// ```ignore,no_run
15822 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15823 /// use wkt::Timestamp;
15824 /// let x = NetworkPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15825 /// let x = NetworkPolicy::new().set_or_clear_update_time(None::<Timestamp>);
15826 /// ```
15827 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15828 where
15829 T: std::convert::Into<wkt::Timestamp>,
15830 {
15831 self.update_time = v.map(|x| x.into());
15832 self
15833 }
15834
15835 /// Sets the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15836 ///
15837 /// # Example
15838 /// ```ignore,no_run
15839 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15840 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15841 /// let x = NetworkPolicy::new().set_internet_access(NetworkService::default()/* use setters */);
15842 /// ```
15843 pub fn set_internet_access<T>(mut self, v: T) -> Self
15844 where
15845 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15846 {
15847 self.internet_access = std::option::Option::Some(v.into());
15848 self
15849 }
15850
15851 /// Sets or clears the value of [internet_access][crate::model::NetworkPolicy::internet_access].
15852 ///
15853 /// # Example
15854 /// ```ignore,no_run
15855 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15856 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15857 /// let x = NetworkPolicy::new().set_or_clear_internet_access(Some(NetworkService::default()/* use setters */));
15858 /// let x = NetworkPolicy::new().set_or_clear_internet_access(None::<NetworkService>);
15859 /// ```
15860 pub fn set_or_clear_internet_access<T>(mut self, v: std::option::Option<T>) -> Self
15861 where
15862 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15863 {
15864 self.internet_access = v.map(|x| x.into());
15865 self
15866 }
15867
15868 /// Sets the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15869 ///
15870 /// # Example
15871 /// ```ignore,no_run
15872 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15873 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15874 /// let x = NetworkPolicy::new().set_external_ip(NetworkService::default()/* use setters */);
15875 /// ```
15876 pub fn set_external_ip<T>(mut self, v: T) -> Self
15877 where
15878 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15879 {
15880 self.external_ip = std::option::Option::Some(v.into());
15881 self
15882 }
15883
15884 /// Sets or clears the value of [external_ip][crate::model::NetworkPolicy::external_ip].
15885 ///
15886 /// # Example
15887 /// ```ignore,no_run
15888 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15889 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
15890 /// let x = NetworkPolicy::new().set_or_clear_external_ip(Some(NetworkService::default()/* use setters */));
15891 /// let x = NetworkPolicy::new().set_or_clear_external_ip(None::<NetworkService>);
15892 /// ```
15893 pub fn set_or_clear_external_ip<T>(mut self, v: std::option::Option<T>) -> Self
15894 where
15895 T: std::convert::Into<crate::model::network_policy::NetworkService>,
15896 {
15897 self.external_ip = v.map(|x| x.into());
15898 self
15899 }
15900
15901 /// Sets the value of [edge_services_cidr][crate::model::NetworkPolicy::edge_services_cidr].
15902 ///
15903 /// # Example
15904 /// ```ignore,no_run
15905 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15906 /// let x = NetworkPolicy::new().set_edge_services_cidr("example");
15907 /// ```
15908 pub fn set_edge_services_cidr<T: std::convert::Into<std::string::String>>(
15909 mut self,
15910 v: T,
15911 ) -> Self {
15912 self.edge_services_cidr = v.into();
15913 self
15914 }
15915
15916 /// Sets the value of [uid][crate::model::NetworkPolicy::uid].
15917 ///
15918 /// # Example
15919 /// ```ignore,no_run
15920 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15921 /// let x = NetworkPolicy::new().set_uid("example");
15922 /// ```
15923 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15924 self.uid = v.into();
15925 self
15926 }
15927
15928 /// Sets the value of [vmware_engine_network][crate::model::NetworkPolicy::vmware_engine_network].
15929 ///
15930 /// # Example
15931 /// ```ignore,no_run
15932 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15933 /// let x = NetworkPolicy::new().set_vmware_engine_network("example");
15934 /// ```
15935 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
15936 mut self,
15937 v: T,
15938 ) -> Self {
15939 self.vmware_engine_network = v.into();
15940 self
15941 }
15942
15943 /// Sets the value of [description][crate::model::NetworkPolicy::description].
15944 ///
15945 /// # Example
15946 /// ```ignore,no_run
15947 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15948 /// let x = NetworkPolicy::new().set_description("example");
15949 /// ```
15950 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15951 self.description = v.into();
15952 self
15953 }
15954
15955 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkPolicy::vmware_engine_network_canonical].
15956 ///
15957 /// # Example
15958 /// ```ignore,no_run
15959 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
15960 /// let x = NetworkPolicy::new().set_vmware_engine_network_canonical("example");
15961 /// ```
15962 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
15963 mut self,
15964 v: T,
15965 ) -> Self {
15966 self.vmware_engine_network_canonical = v.into();
15967 self
15968 }
15969}
15970
15971impl wkt::message::Message for NetworkPolicy {
15972 fn typename() -> &'static str {
15973 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy"
15974 }
15975}
15976
15977/// Defines additional types related to [NetworkPolicy].
15978pub mod network_policy {
15979 #[allow(unused_imports)]
15980 use super::*;
15981
15982 /// Represents a network service that is managed by a `NetworkPolicy` resource.
15983 /// A network service provides a way to control an aspect of external access to
15984 /// VMware workloads. For example, whether the VMware workloads in the
15985 /// private clouds governed by a network policy can access or be accessed from
15986 /// the internet.
15987 #[derive(Clone, Default, PartialEq)]
15988 #[non_exhaustive]
15989 pub struct NetworkService {
15990 /// True if the service is enabled; false otherwise.
15991 pub enabled: bool,
15992
15993 /// Output only. State of the service. New values may be added to this enum
15994 /// when appropriate.
15995 pub state: crate::model::network_policy::network_service::State,
15996
15997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15998 }
15999
16000 impl NetworkService {
16001 pub fn new() -> Self {
16002 std::default::Default::default()
16003 }
16004
16005 /// Sets the value of [enabled][crate::model::network_policy::NetworkService::enabled].
16006 ///
16007 /// # Example
16008 /// ```ignore,no_run
16009 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16010 /// let x = NetworkService::new().set_enabled(true);
16011 /// ```
16012 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16013 self.enabled = v.into();
16014 self
16015 }
16016
16017 /// Sets the value of [state][crate::model::network_policy::NetworkService::state].
16018 ///
16019 /// # Example
16020 /// ```ignore,no_run
16021 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16022 /// use google_cloud_vmwareengine_v1::model::network_policy::network_service::State;
16023 /// let x0 = NetworkService::new().set_state(State::Unprovisioned);
16024 /// let x1 = NetworkService::new().set_state(State::Reconciling);
16025 /// let x2 = NetworkService::new().set_state(State::Active);
16026 /// ```
16027 pub fn set_state<
16028 T: std::convert::Into<crate::model::network_policy::network_service::State>,
16029 >(
16030 mut self,
16031 v: T,
16032 ) -> Self {
16033 self.state = v.into();
16034 self
16035 }
16036 }
16037
16038 impl wkt::message::Message for NetworkService {
16039 fn typename() -> &'static str {
16040 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"
16041 }
16042 }
16043
16044 /// Defines additional types related to [NetworkService].
16045 pub mod network_service {
16046 #[allow(unused_imports)]
16047 use super::*;
16048
16049 /// Enum State defines possible states of a network policy controlled
16050 /// service.
16051 ///
16052 /// # Working with unknown values
16053 ///
16054 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16055 /// additional enum variants at any time. Adding new variants is not considered
16056 /// a breaking change. Applications should write their code in anticipation of:
16057 ///
16058 /// - New values appearing in future releases of the client library, **and**
16059 /// - New values received dynamically, without application changes.
16060 ///
16061 /// Please consult the [Working with enums] section in the user guide for some
16062 /// guidelines.
16063 ///
16064 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16065 #[derive(Clone, Debug, PartialEq)]
16066 #[non_exhaustive]
16067 pub enum State {
16068 /// Unspecified service state. This is the default value.
16069 Unspecified,
16070 /// Service is not provisioned.
16071 Unprovisioned,
16072 /// Service is in the process of being provisioned/deprovisioned.
16073 Reconciling,
16074 /// Service is active.
16075 Active,
16076 /// If set, the enum was initialized with an unknown value.
16077 ///
16078 /// Applications can examine the value using [State::value] or
16079 /// [State::name].
16080 UnknownValue(state::UnknownValue),
16081 }
16082
16083 #[doc(hidden)]
16084 pub mod state {
16085 #[allow(unused_imports)]
16086 use super::*;
16087 #[derive(Clone, Debug, PartialEq)]
16088 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16089 }
16090
16091 impl State {
16092 /// Gets the enum value.
16093 ///
16094 /// Returns `None` if the enum contains an unknown value deserialized from
16095 /// the string representation of enums.
16096 pub fn value(&self) -> std::option::Option<i32> {
16097 match self {
16098 Self::Unspecified => std::option::Option::Some(0),
16099 Self::Unprovisioned => std::option::Option::Some(1),
16100 Self::Reconciling => std::option::Option::Some(2),
16101 Self::Active => std::option::Option::Some(3),
16102 Self::UnknownValue(u) => u.0.value(),
16103 }
16104 }
16105
16106 /// Gets the enum value as a string.
16107 ///
16108 /// Returns `None` if the enum contains an unknown value deserialized from
16109 /// the integer representation of enums.
16110 pub fn name(&self) -> std::option::Option<&str> {
16111 match self {
16112 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16113 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
16114 Self::Reconciling => std::option::Option::Some("RECONCILING"),
16115 Self::Active => std::option::Option::Some("ACTIVE"),
16116 Self::UnknownValue(u) => u.0.name(),
16117 }
16118 }
16119 }
16120
16121 impl std::default::Default for State {
16122 fn default() -> Self {
16123 use std::convert::From;
16124 Self::from(0)
16125 }
16126 }
16127
16128 impl std::fmt::Display for State {
16129 fn fmt(
16130 &self,
16131 f: &mut std::fmt::Formatter<'_>,
16132 ) -> std::result::Result<(), std::fmt::Error> {
16133 wkt::internal::display_enum(f, self.name(), self.value())
16134 }
16135 }
16136
16137 impl std::convert::From<i32> for State {
16138 fn from(value: i32) -> Self {
16139 match value {
16140 0 => Self::Unspecified,
16141 1 => Self::Unprovisioned,
16142 2 => Self::Reconciling,
16143 3 => Self::Active,
16144 _ => Self::UnknownValue(state::UnknownValue(
16145 wkt::internal::UnknownEnumValue::Integer(value),
16146 )),
16147 }
16148 }
16149 }
16150
16151 impl std::convert::From<&str> for State {
16152 fn from(value: &str) -> Self {
16153 use std::string::ToString;
16154 match value {
16155 "STATE_UNSPECIFIED" => Self::Unspecified,
16156 "UNPROVISIONED" => Self::Unprovisioned,
16157 "RECONCILING" => Self::Reconciling,
16158 "ACTIVE" => Self::Active,
16159 _ => Self::UnknownValue(state::UnknownValue(
16160 wkt::internal::UnknownEnumValue::String(value.to_string()),
16161 )),
16162 }
16163 }
16164 }
16165
16166 impl serde::ser::Serialize for State {
16167 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16168 where
16169 S: serde::Serializer,
16170 {
16171 match self {
16172 Self::Unspecified => serializer.serialize_i32(0),
16173 Self::Unprovisioned => serializer.serialize_i32(1),
16174 Self::Reconciling => serializer.serialize_i32(2),
16175 Self::Active => serializer.serialize_i32(3),
16176 Self::UnknownValue(u) => u.0.serialize(serializer),
16177 }
16178 }
16179 }
16180
16181 impl<'de> serde::de::Deserialize<'de> for State {
16182 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16183 where
16184 D: serde::Deserializer<'de>,
16185 {
16186 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16187 ".google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State",
16188 ))
16189 }
16190 }
16191 }
16192}
16193
16194/// Represents a binding between a network and the management DNS zone.
16195/// A management DNS zone is the Cloud DNS cross-project binding zone that
16196/// VMware Engine creates for each private cloud. It contains FQDNs and
16197/// corresponding IP addresses for the private cloud's ESXi hosts and management
16198/// VM appliances like vCenter and NSX Manager.
16199#[derive(Clone, Default, PartialEq)]
16200#[non_exhaustive]
16201pub struct ManagementDnsZoneBinding {
16202 /// Output only. The resource name of this binding.
16203 /// Resource names are schemeless URIs that follow the conventions in
16204 /// <https://cloud.google.com/apis/design/resource_names>.
16205 /// For example:
16206 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16207 pub name: std::string::String,
16208
16209 /// Output only. Creation time of this resource.
16210 pub create_time: std::option::Option<wkt::Timestamp>,
16211
16212 /// Output only. Last update time of this resource.
16213 pub update_time: std::option::Option<wkt::Timestamp>,
16214
16215 /// Output only. The state of the resource.
16216 pub state: crate::model::management_dns_zone_binding::State,
16217
16218 /// User-provided description for this resource.
16219 pub description: std::string::String,
16220
16221 /// Output only. System-generated unique identifier for the resource.
16222 pub uid: std::string::String,
16223
16224 /// Required. The relative resource name of the network to bind to the
16225 /// management DNS zone. This network can be a consumer VPC network or a
16226 /// VMware engine network.
16227 pub bind_network: std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16228
16229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16230}
16231
16232impl ManagementDnsZoneBinding {
16233 pub fn new() -> Self {
16234 std::default::Default::default()
16235 }
16236
16237 /// Sets the value of [name][crate::model::ManagementDnsZoneBinding::name].
16238 ///
16239 /// # Example
16240 /// ```ignore,no_run
16241 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16242 /// let x = ManagementDnsZoneBinding::new().set_name("example");
16243 /// ```
16244 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16245 self.name = v.into();
16246 self
16247 }
16248
16249 /// Sets the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16250 ///
16251 /// # Example
16252 /// ```ignore,no_run
16253 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16254 /// use wkt::Timestamp;
16255 /// let x = ManagementDnsZoneBinding::new().set_create_time(Timestamp::default()/* use setters */);
16256 /// ```
16257 pub fn set_create_time<T>(mut self, v: T) -> Self
16258 where
16259 T: std::convert::Into<wkt::Timestamp>,
16260 {
16261 self.create_time = std::option::Option::Some(v.into());
16262 self
16263 }
16264
16265 /// Sets or clears the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16266 ///
16267 /// # Example
16268 /// ```ignore,no_run
16269 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16270 /// use wkt::Timestamp;
16271 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16272 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(None::<Timestamp>);
16273 /// ```
16274 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16275 where
16276 T: std::convert::Into<wkt::Timestamp>,
16277 {
16278 self.create_time = v.map(|x| x.into());
16279 self
16280 }
16281
16282 /// Sets the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16283 ///
16284 /// # Example
16285 /// ```ignore,no_run
16286 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16287 /// use wkt::Timestamp;
16288 /// let x = ManagementDnsZoneBinding::new().set_update_time(Timestamp::default()/* use setters */);
16289 /// ```
16290 pub fn set_update_time<T>(mut self, v: T) -> Self
16291 where
16292 T: std::convert::Into<wkt::Timestamp>,
16293 {
16294 self.update_time = std::option::Option::Some(v.into());
16295 self
16296 }
16297
16298 /// Sets or clears the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16299 ///
16300 /// # Example
16301 /// ```ignore,no_run
16302 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16303 /// use wkt::Timestamp;
16304 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16305 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(None::<Timestamp>);
16306 /// ```
16307 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16308 where
16309 T: std::convert::Into<wkt::Timestamp>,
16310 {
16311 self.update_time = v.map(|x| x.into());
16312 self
16313 }
16314
16315 /// Sets the value of [state][crate::model::ManagementDnsZoneBinding::state].
16316 ///
16317 /// # Example
16318 /// ```ignore,no_run
16319 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16320 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::State;
16321 /// let x0 = ManagementDnsZoneBinding::new().set_state(State::Active);
16322 /// let x1 = ManagementDnsZoneBinding::new().set_state(State::Creating);
16323 /// let x2 = ManagementDnsZoneBinding::new().set_state(State::Updating);
16324 /// ```
16325 pub fn set_state<T: std::convert::Into<crate::model::management_dns_zone_binding::State>>(
16326 mut self,
16327 v: T,
16328 ) -> Self {
16329 self.state = v.into();
16330 self
16331 }
16332
16333 /// Sets the value of [description][crate::model::ManagementDnsZoneBinding::description].
16334 ///
16335 /// # Example
16336 /// ```ignore,no_run
16337 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16338 /// let x = ManagementDnsZoneBinding::new().set_description("example");
16339 /// ```
16340 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16341 self.description = v.into();
16342 self
16343 }
16344
16345 /// Sets the value of [uid][crate::model::ManagementDnsZoneBinding::uid].
16346 ///
16347 /// # Example
16348 /// ```ignore,no_run
16349 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16350 /// let x = ManagementDnsZoneBinding::new().set_uid("example");
16351 /// ```
16352 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16353 self.uid = v.into();
16354 self
16355 }
16356
16357 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network].
16358 ///
16359 /// Note that all the setters affecting `bind_network` are mutually
16360 /// exclusive.
16361 ///
16362 /// # Example
16363 /// ```ignore,no_run
16364 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16365 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::BindNetwork;
16366 /// let x = ManagementDnsZoneBinding::new().set_bind_network(Some(BindNetwork::VpcNetwork("example".to_string())));
16367 /// ```
16368 pub fn set_bind_network<
16369 T: std::convert::Into<
16370 std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16371 >,
16372 >(
16373 mut self,
16374 v: T,
16375 ) -> Self {
16376 self.bind_network = v.into();
16377 self
16378 }
16379
16380 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16381 /// if it holds a `VpcNetwork`, `None` if the field is not set or
16382 /// holds a different branch.
16383 pub fn vpc_network(&self) -> std::option::Option<&std::string::String> {
16384 #[allow(unreachable_patterns)]
16385 self.bind_network.as_ref().and_then(|v| match v {
16386 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v) => {
16387 std::option::Option::Some(v)
16388 }
16389 _ => std::option::Option::None,
16390 })
16391 }
16392
16393 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16394 /// to hold a `VpcNetwork`.
16395 ///
16396 /// Note that all the setters affecting `bind_network` are
16397 /// mutually exclusive.
16398 ///
16399 /// # Example
16400 /// ```ignore,no_run
16401 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16402 /// let x = ManagementDnsZoneBinding::new().set_vpc_network("example");
16403 /// assert!(x.vpc_network().is_some());
16404 /// assert!(x.vmware_engine_network().is_none());
16405 /// ```
16406 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16407 self.bind_network = std::option::Option::Some(
16408 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v.into()),
16409 );
16410 self
16411 }
16412
16413 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16414 /// if it holds a `VmwareEngineNetwork`, `None` if the field is not set or
16415 /// holds a different branch.
16416 pub fn vmware_engine_network(&self) -> std::option::Option<&std::string::String> {
16417 #[allow(unreachable_patterns)]
16418 self.bind_network.as_ref().and_then(|v| match v {
16419 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v) => {
16420 std::option::Option::Some(v)
16421 }
16422 _ => std::option::Option::None,
16423 })
16424 }
16425
16426 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16427 /// to hold a `VmwareEngineNetwork`.
16428 ///
16429 /// Note that all the setters affecting `bind_network` are
16430 /// mutually exclusive.
16431 ///
16432 /// # Example
16433 /// ```ignore,no_run
16434 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16435 /// let x = ManagementDnsZoneBinding::new().set_vmware_engine_network("example");
16436 /// assert!(x.vmware_engine_network().is_some());
16437 /// assert!(x.vpc_network().is_none());
16438 /// ```
16439 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
16440 mut self,
16441 v: T,
16442 ) -> Self {
16443 self.bind_network = std::option::Option::Some(
16444 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v.into()),
16445 );
16446 self
16447 }
16448}
16449
16450impl wkt::message::Message for ManagementDnsZoneBinding {
16451 fn typename() -> &'static str {
16452 "type.googleapis.com/google.cloud.vmwareengine.v1.ManagementDnsZoneBinding"
16453 }
16454}
16455
16456/// Defines additional types related to [ManagementDnsZoneBinding].
16457pub mod management_dns_zone_binding {
16458 #[allow(unused_imports)]
16459 use super::*;
16460
16461 /// Enum State defines possible states of binding between the consumer VPC
16462 /// network and the management DNS zone.
16463 ///
16464 /// # Working with unknown values
16465 ///
16466 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16467 /// additional enum variants at any time. Adding new variants is not considered
16468 /// a breaking change. Applications should write their code in anticipation of:
16469 ///
16470 /// - New values appearing in future releases of the client library, **and**
16471 /// - New values received dynamically, without application changes.
16472 ///
16473 /// Please consult the [Working with enums] section in the user guide for some
16474 /// guidelines.
16475 ///
16476 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16477 #[derive(Clone, Debug, PartialEq)]
16478 #[non_exhaustive]
16479 pub enum State {
16480 /// The default value. This value should never be used.
16481 Unspecified,
16482 /// The binding is ready.
16483 Active,
16484 /// The binding is being created.
16485 Creating,
16486 /// The binding is being updated.
16487 Updating,
16488 /// The binding is being deleted.
16489 Deleting,
16490 /// The binding has failed.
16491 Failed,
16492 /// If set, the enum was initialized with an unknown value.
16493 ///
16494 /// Applications can examine the value using [State::value] or
16495 /// [State::name].
16496 UnknownValue(state::UnknownValue),
16497 }
16498
16499 #[doc(hidden)]
16500 pub mod state {
16501 #[allow(unused_imports)]
16502 use super::*;
16503 #[derive(Clone, Debug, PartialEq)]
16504 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16505 }
16506
16507 impl State {
16508 /// Gets the enum value.
16509 ///
16510 /// Returns `None` if the enum contains an unknown value deserialized from
16511 /// the string representation of enums.
16512 pub fn value(&self) -> std::option::Option<i32> {
16513 match self {
16514 Self::Unspecified => std::option::Option::Some(0),
16515 Self::Active => std::option::Option::Some(1),
16516 Self::Creating => std::option::Option::Some(2),
16517 Self::Updating => std::option::Option::Some(3),
16518 Self::Deleting => std::option::Option::Some(4),
16519 Self::Failed => std::option::Option::Some(5),
16520 Self::UnknownValue(u) => u.0.value(),
16521 }
16522 }
16523
16524 /// Gets the enum value as a string.
16525 ///
16526 /// Returns `None` if the enum contains an unknown value deserialized from
16527 /// the integer representation of enums.
16528 pub fn name(&self) -> std::option::Option<&str> {
16529 match self {
16530 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16531 Self::Active => std::option::Option::Some("ACTIVE"),
16532 Self::Creating => std::option::Option::Some("CREATING"),
16533 Self::Updating => std::option::Option::Some("UPDATING"),
16534 Self::Deleting => std::option::Option::Some("DELETING"),
16535 Self::Failed => std::option::Option::Some("FAILED"),
16536 Self::UnknownValue(u) => u.0.name(),
16537 }
16538 }
16539 }
16540
16541 impl std::default::Default for State {
16542 fn default() -> Self {
16543 use std::convert::From;
16544 Self::from(0)
16545 }
16546 }
16547
16548 impl std::fmt::Display for State {
16549 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16550 wkt::internal::display_enum(f, self.name(), self.value())
16551 }
16552 }
16553
16554 impl std::convert::From<i32> for State {
16555 fn from(value: i32) -> Self {
16556 match value {
16557 0 => Self::Unspecified,
16558 1 => Self::Active,
16559 2 => Self::Creating,
16560 3 => Self::Updating,
16561 4 => Self::Deleting,
16562 5 => Self::Failed,
16563 _ => Self::UnknownValue(state::UnknownValue(
16564 wkt::internal::UnknownEnumValue::Integer(value),
16565 )),
16566 }
16567 }
16568 }
16569
16570 impl std::convert::From<&str> for State {
16571 fn from(value: &str) -> Self {
16572 use std::string::ToString;
16573 match value {
16574 "STATE_UNSPECIFIED" => Self::Unspecified,
16575 "ACTIVE" => Self::Active,
16576 "CREATING" => Self::Creating,
16577 "UPDATING" => Self::Updating,
16578 "DELETING" => Self::Deleting,
16579 "FAILED" => Self::Failed,
16580 _ => Self::UnknownValue(state::UnknownValue(
16581 wkt::internal::UnknownEnumValue::String(value.to_string()),
16582 )),
16583 }
16584 }
16585 }
16586
16587 impl serde::ser::Serialize for State {
16588 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16589 where
16590 S: serde::Serializer,
16591 {
16592 match self {
16593 Self::Unspecified => serializer.serialize_i32(0),
16594 Self::Active => serializer.serialize_i32(1),
16595 Self::Creating => serializer.serialize_i32(2),
16596 Self::Updating => serializer.serialize_i32(3),
16597 Self::Deleting => serializer.serialize_i32(4),
16598 Self::Failed => serializer.serialize_i32(5),
16599 Self::UnknownValue(u) => u.0.serialize(serializer),
16600 }
16601 }
16602 }
16603
16604 impl<'de> serde::de::Deserialize<'de> for State {
16605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16606 where
16607 D: serde::Deserializer<'de>,
16608 {
16609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16610 ".google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State",
16611 ))
16612 }
16613 }
16614
16615 /// Required. The relative resource name of the network to bind to the
16616 /// management DNS zone. This network can be a consumer VPC network or a
16617 /// VMware engine network.
16618 #[derive(Clone, Debug, PartialEq)]
16619 #[non_exhaustive]
16620 pub enum BindNetwork {
16621 /// Network to bind is a standard consumer VPC.
16622 /// Specify the name in the following form for consumer
16623 /// VPC network: `projects/{project}/global/networks/{network_id}`.
16624 /// `{project}` can either be a project number or a project ID.
16625 VpcNetwork(std::string::String),
16626 /// Network to bind is a VMware Engine network.
16627 /// Specify the name in the following form for VMware engine network:
16628 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
16629 /// `{project}` can either be a project number or a project ID.
16630 VmwareEngineNetwork(std::string::String),
16631 }
16632}
16633
16634/// VMware Engine network resource that provides connectivity for VMware Engine
16635/// private clouds.
16636#[derive(Clone, Default, PartialEq)]
16637#[non_exhaustive]
16638pub struct VmwareEngineNetwork {
16639 /// Output only. The resource name of the VMware Engine network.
16640 /// Resource names are schemeless URIs that follow the conventions in
16641 /// <https://cloud.google.com/apis/design/resource_names>.
16642 /// For example:
16643 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
16644 pub name: std::string::String,
16645
16646 /// Output only. Creation time of this resource.
16647 pub create_time: std::option::Option<wkt::Timestamp>,
16648
16649 /// Output only. Last update time of this resource.
16650 pub update_time: std::option::Option<wkt::Timestamp>,
16651
16652 /// User-provided description for this VMware Engine network.
16653 pub description: std::string::String,
16654
16655 /// Output only. VMware Engine service VPC networks that provide connectivity
16656 /// from a private cloud to customer projects, the internet, and other Google
16657 /// Cloud services.
16658 pub vpc_networks: std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
16659
16660 /// Output only. State of the VMware Engine network.
16661 pub state: crate::model::vmware_engine_network::State,
16662
16663 /// Required. VMware Engine network type.
16664 pub r#type: crate::model::vmware_engine_network::Type,
16665
16666 /// Output only. System-generated unique identifier for the resource.
16667 pub uid: std::string::String,
16668
16669 /// Checksum that may be sent on update and delete requests to ensure that the
16670 /// user-provided value is up to date before the server processes a request.
16671 /// The server computes checksums based on the value of other fields in the
16672 /// request.
16673 pub etag: std::string::String,
16674
16675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16676}
16677
16678impl VmwareEngineNetwork {
16679 pub fn new() -> Self {
16680 std::default::Default::default()
16681 }
16682
16683 /// Sets the value of [name][crate::model::VmwareEngineNetwork::name].
16684 ///
16685 /// # Example
16686 /// ```ignore,no_run
16687 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16688 /// let x = VmwareEngineNetwork::new().set_name("example");
16689 /// ```
16690 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16691 self.name = v.into();
16692 self
16693 }
16694
16695 /// Sets the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16696 ///
16697 /// # Example
16698 /// ```ignore,no_run
16699 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16700 /// use wkt::Timestamp;
16701 /// let x = VmwareEngineNetwork::new().set_create_time(Timestamp::default()/* use setters */);
16702 /// ```
16703 pub fn set_create_time<T>(mut self, v: T) -> Self
16704 where
16705 T: std::convert::Into<wkt::Timestamp>,
16706 {
16707 self.create_time = std::option::Option::Some(v.into());
16708 self
16709 }
16710
16711 /// Sets or clears the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
16712 ///
16713 /// # Example
16714 /// ```ignore,no_run
16715 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16716 /// use wkt::Timestamp;
16717 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16718 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(None::<Timestamp>);
16719 /// ```
16720 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16721 where
16722 T: std::convert::Into<wkt::Timestamp>,
16723 {
16724 self.create_time = v.map(|x| x.into());
16725 self
16726 }
16727
16728 /// Sets the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16729 ///
16730 /// # Example
16731 /// ```ignore,no_run
16732 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16733 /// use wkt::Timestamp;
16734 /// let x = VmwareEngineNetwork::new().set_update_time(Timestamp::default()/* use setters */);
16735 /// ```
16736 pub fn set_update_time<T>(mut self, v: T) -> Self
16737 where
16738 T: std::convert::Into<wkt::Timestamp>,
16739 {
16740 self.update_time = std::option::Option::Some(v.into());
16741 self
16742 }
16743
16744 /// Sets or clears the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
16745 ///
16746 /// # Example
16747 /// ```ignore,no_run
16748 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16749 /// use wkt::Timestamp;
16750 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16751 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(None::<Timestamp>);
16752 /// ```
16753 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16754 where
16755 T: std::convert::Into<wkt::Timestamp>,
16756 {
16757 self.update_time = v.map(|x| x.into());
16758 self
16759 }
16760
16761 /// Sets the value of [description][crate::model::VmwareEngineNetwork::description].
16762 ///
16763 /// # Example
16764 /// ```ignore,no_run
16765 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16766 /// let x = VmwareEngineNetwork::new().set_description("example");
16767 /// ```
16768 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16769 self.description = v.into();
16770 self
16771 }
16772
16773 /// Sets the value of [vpc_networks][crate::model::VmwareEngineNetwork::vpc_networks].
16774 ///
16775 /// # Example
16776 /// ```ignore,no_run
16777 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16778 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16779 /// let x = VmwareEngineNetwork::new()
16780 /// .set_vpc_networks([
16781 /// VpcNetwork::default()/* use setters */,
16782 /// VpcNetwork::default()/* use (different) setters */,
16783 /// ]);
16784 /// ```
16785 pub fn set_vpc_networks<T, V>(mut self, v: T) -> Self
16786 where
16787 T: std::iter::IntoIterator<Item = V>,
16788 V: std::convert::Into<crate::model::vmware_engine_network::VpcNetwork>,
16789 {
16790 use std::iter::Iterator;
16791 self.vpc_networks = v.into_iter().map(|i| i.into()).collect();
16792 self
16793 }
16794
16795 /// Sets the value of [state][crate::model::VmwareEngineNetwork::state].
16796 ///
16797 /// # Example
16798 /// ```ignore,no_run
16799 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16800 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::State;
16801 /// let x0 = VmwareEngineNetwork::new().set_state(State::Creating);
16802 /// let x1 = VmwareEngineNetwork::new().set_state(State::Active);
16803 /// let x2 = VmwareEngineNetwork::new().set_state(State::Updating);
16804 /// ```
16805 pub fn set_state<T: std::convert::Into<crate::model::vmware_engine_network::State>>(
16806 mut self,
16807 v: T,
16808 ) -> Self {
16809 self.state = v.into();
16810 self
16811 }
16812
16813 /// Sets the value of [r#type][crate::model::VmwareEngineNetwork::type].
16814 ///
16815 /// # Example
16816 /// ```ignore,no_run
16817 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16818 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::Type;
16819 /// let x0 = VmwareEngineNetwork::new().set_type(Type::Legacy);
16820 /// let x1 = VmwareEngineNetwork::new().set_type(Type::Standard);
16821 /// ```
16822 pub fn set_type<T: std::convert::Into<crate::model::vmware_engine_network::Type>>(
16823 mut self,
16824 v: T,
16825 ) -> Self {
16826 self.r#type = v.into();
16827 self
16828 }
16829
16830 /// Sets the value of [uid][crate::model::VmwareEngineNetwork::uid].
16831 ///
16832 /// # Example
16833 /// ```ignore,no_run
16834 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16835 /// let x = VmwareEngineNetwork::new().set_uid("example");
16836 /// ```
16837 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16838 self.uid = v.into();
16839 self
16840 }
16841
16842 /// Sets the value of [etag][crate::model::VmwareEngineNetwork::etag].
16843 ///
16844 /// # Example
16845 /// ```ignore,no_run
16846 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
16847 /// let x = VmwareEngineNetwork::new().set_etag("example");
16848 /// ```
16849 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16850 self.etag = v.into();
16851 self
16852 }
16853}
16854
16855impl wkt::message::Message for VmwareEngineNetwork {
16856 fn typename() -> &'static str {
16857 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork"
16858 }
16859}
16860
16861/// Defines additional types related to [VmwareEngineNetwork].
16862pub mod vmware_engine_network {
16863 #[allow(unused_imports)]
16864 use super::*;
16865
16866 /// Represents a VMware Engine VPC network that is managed by a
16867 /// VMware Engine network resource.
16868 #[derive(Clone, Default, PartialEq)]
16869 #[non_exhaustive]
16870 pub struct VpcNetwork {
16871 /// Output only. Type of VPC network (INTRANET, INTERNET, or
16872 /// GOOGLE_CLOUD)
16873 pub r#type: crate::model::vmware_engine_network::vpc_network::Type,
16874
16875 /// Output only. The relative resource name of the service VPC network this
16876 /// VMware Engine network is attached to. For example:
16877 /// `projects/123123/global/networks/my-network`
16878 pub network: std::string::String,
16879
16880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16881 }
16882
16883 impl VpcNetwork {
16884 pub fn new() -> Self {
16885 std::default::Default::default()
16886 }
16887
16888 /// Sets the value of [r#type][crate::model::vmware_engine_network::VpcNetwork::type].
16889 ///
16890 /// # Example
16891 /// ```ignore,no_run
16892 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16893 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::vpc_network::Type;
16894 /// let x0 = VpcNetwork::new().set_type(Type::Intranet);
16895 /// let x1 = VpcNetwork::new().set_type(Type::Internet);
16896 /// let x2 = VpcNetwork::new().set_type(Type::GoogleCloud);
16897 /// ```
16898 pub fn set_type<
16899 T: std::convert::Into<crate::model::vmware_engine_network::vpc_network::Type>,
16900 >(
16901 mut self,
16902 v: T,
16903 ) -> Self {
16904 self.r#type = v.into();
16905 self
16906 }
16907
16908 /// Sets the value of [network][crate::model::vmware_engine_network::VpcNetwork::network].
16909 ///
16910 /// # Example
16911 /// ```ignore,no_run
16912 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
16913 /// let x = VpcNetwork::new().set_network("example");
16914 /// ```
16915 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16916 self.network = v.into();
16917 self
16918 }
16919 }
16920
16921 impl wkt::message::Message for VpcNetwork {
16922 fn typename() -> &'static str {
16923 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"
16924 }
16925 }
16926
16927 /// Defines additional types related to [VpcNetwork].
16928 pub mod vpc_network {
16929 #[allow(unused_imports)]
16930 use super::*;
16931
16932 /// Enum Type defines possible types of a VMware Engine network controlled
16933 /// service.
16934 ///
16935 /// # Working with unknown values
16936 ///
16937 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16938 /// additional enum variants at any time. Adding new variants is not considered
16939 /// a breaking change. Applications should write their code in anticipation of:
16940 ///
16941 /// - New values appearing in future releases of the client library, **and**
16942 /// - New values received dynamically, without application changes.
16943 ///
16944 /// Please consult the [Working with enums] section in the user guide for some
16945 /// guidelines.
16946 ///
16947 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16948 #[derive(Clone, Debug, PartialEq)]
16949 #[non_exhaustive]
16950 pub enum Type {
16951 /// The default value. This value should never be used.
16952 Unspecified,
16953 /// VPC network that will be peered with a consumer VPC network or the
16954 /// intranet VPC of another VMware Engine network. Access a private cloud
16955 /// through Compute Engine VMs on a peered VPC network or an on-premises
16956 /// resource connected to a peered consumer VPC network.
16957 Intranet,
16958 /// VPC network used for internet access to and from a private cloud.
16959 Internet,
16960 /// VPC network used for access to Google Cloud services like
16961 /// Cloud Storage.
16962 GoogleCloud,
16963 /// If set, the enum was initialized with an unknown value.
16964 ///
16965 /// Applications can examine the value using [Type::value] or
16966 /// [Type::name].
16967 UnknownValue(r#type::UnknownValue),
16968 }
16969
16970 #[doc(hidden)]
16971 pub mod r#type {
16972 #[allow(unused_imports)]
16973 use super::*;
16974 #[derive(Clone, Debug, PartialEq)]
16975 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16976 }
16977
16978 impl Type {
16979 /// Gets the enum value.
16980 ///
16981 /// Returns `None` if the enum contains an unknown value deserialized from
16982 /// the string representation of enums.
16983 pub fn value(&self) -> std::option::Option<i32> {
16984 match self {
16985 Self::Unspecified => std::option::Option::Some(0),
16986 Self::Intranet => std::option::Option::Some(1),
16987 Self::Internet => std::option::Option::Some(2),
16988 Self::GoogleCloud => std::option::Option::Some(3),
16989 Self::UnknownValue(u) => u.0.value(),
16990 }
16991 }
16992
16993 /// Gets the enum value as a string.
16994 ///
16995 /// Returns `None` if the enum contains an unknown value deserialized from
16996 /// the integer representation of enums.
16997 pub fn name(&self) -> std::option::Option<&str> {
16998 match self {
16999 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17000 Self::Intranet => std::option::Option::Some("INTRANET"),
17001 Self::Internet => std::option::Option::Some("INTERNET"),
17002 Self::GoogleCloud => std::option::Option::Some("GOOGLE_CLOUD"),
17003 Self::UnknownValue(u) => u.0.name(),
17004 }
17005 }
17006 }
17007
17008 impl std::default::Default for Type {
17009 fn default() -> Self {
17010 use std::convert::From;
17011 Self::from(0)
17012 }
17013 }
17014
17015 impl std::fmt::Display for Type {
17016 fn fmt(
17017 &self,
17018 f: &mut std::fmt::Formatter<'_>,
17019 ) -> std::result::Result<(), std::fmt::Error> {
17020 wkt::internal::display_enum(f, self.name(), self.value())
17021 }
17022 }
17023
17024 impl std::convert::From<i32> for Type {
17025 fn from(value: i32) -> Self {
17026 match value {
17027 0 => Self::Unspecified,
17028 1 => Self::Intranet,
17029 2 => Self::Internet,
17030 3 => Self::GoogleCloud,
17031 _ => Self::UnknownValue(r#type::UnknownValue(
17032 wkt::internal::UnknownEnumValue::Integer(value),
17033 )),
17034 }
17035 }
17036 }
17037
17038 impl std::convert::From<&str> for Type {
17039 fn from(value: &str) -> Self {
17040 use std::string::ToString;
17041 match value {
17042 "TYPE_UNSPECIFIED" => Self::Unspecified,
17043 "INTRANET" => Self::Intranet,
17044 "INTERNET" => Self::Internet,
17045 "GOOGLE_CLOUD" => Self::GoogleCloud,
17046 _ => Self::UnknownValue(r#type::UnknownValue(
17047 wkt::internal::UnknownEnumValue::String(value.to_string()),
17048 )),
17049 }
17050 }
17051 }
17052
17053 impl serde::ser::Serialize for Type {
17054 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17055 where
17056 S: serde::Serializer,
17057 {
17058 match self {
17059 Self::Unspecified => serializer.serialize_i32(0),
17060 Self::Intranet => serializer.serialize_i32(1),
17061 Self::Internet => serializer.serialize_i32(2),
17062 Self::GoogleCloud => serializer.serialize_i32(3),
17063 Self::UnknownValue(u) => u.0.serialize(serializer),
17064 }
17065 }
17066 }
17067
17068 impl<'de> serde::de::Deserialize<'de> for Type {
17069 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17070 where
17071 D: serde::Deserializer<'de>,
17072 {
17073 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17074 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type",
17075 ))
17076 }
17077 }
17078 }
17079
17080 /// Enum State defines possible states of VMware Engine network.
17081 ///
17082 /// # Working with unknown values
17083 ///
17084 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17085 /// additional enum variants at any time. Adding new variants is not considered
17086 /// a breaking change. Applications should write their code in anticipation of:
17087 ///
17088 /// - New values appearing in future releases of the client library, **and**
17089 /// - New values received dynamically, without application changes.
17090 ///
17091 /// Please consult the [Working with enums] section in the user guide for some
17092 /// guidelines.
17093 ///
17094 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17095 #[derive(Clone, Debug, PartialEq)]
17096 #[non_exhaustive]
17097 pub enum State {
17098 /// The default value. This value is used if the state is omitted.
17099 Unspecified,
17100 /// The VMware Engine network is being created.
17101 Creating,
17102 /// The VMware Engine network is ready.
17103 Active,
17104 /// The VMware Engine network is being updated.
17105 Updating,
17106 /// The VMware Engine network is being deleted.
17107 Deleting,
17108 /// If set, the enum was initialized with an unknown value.
17109 ///
17110 /// Applications can examine the value using [State::value] or
17111 /// [State::name].
17112 UnknownValue(state::UnknownValue),
17113 }
17114
17115 #[doc(hidden)]
17116 pub mod state {
17117 #[allow(unused_imports)]
17118 use super::*;
17119 #[derive(Clone, Debug, PartialEq)]
17120 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17121 }
17122
17123 impl State {
17124 /// Gets the enum value.
17125 ///
17126 /// Returns `None` if the enum contains an unknown value deserialized from
17127 /// the string representation of enums.
17128 pub fn value(&self) -> std::option::Option<i32> {
17129 match self {
17130 Self::Unspecified => std::option::Option::Some(0),
17131 Self::Creating => std::option::Option::Some(1),
17132 Self::Active => std::option::Option::Some(2),
17133 Self::Updating => std::option::Option::Some(3),
17134 Self::Deleting => std::option::Option::Some(4),
17135 Self::UnknownValue(u) => u.0.value(),
17136 }
17137 }
17138
17139 /// Gets the enum value as a string.
17140 ///
17141 /// Returns `None` if the enum contains an unknown value deserialized from
17142 /// the integer representation of enums.
17143 pub fn name(&self) -> std::option::Option<&str> {
17144 match self {
17145 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17146 Self::Creating => std::option::Option::Some("CREATING"),
17147 Self::Active => std::option::Option::Some("ACTIVE"),
17148 Self::Updating => std::option::Option::Some("UPDATING"),
17149 Self::Deleting => std::option::Option::Some("DELETING"),
17150 Self::UnknownValue(u) => u.0.name(),
17151 }
17152 }
17153 }
17154
17155 impl std::default::Default for State {
17156 fn default() -> Self {
17157 use std::convert::From;
17158 Self::from(0)
17159 }
17160 }
17161
17162 impl std::fmt::Display for State {
17163 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17164 wkt::internal::display_enum(f, self.name(), self.value())
17165 }
17166 }
17167
17168 impl std::convert::From<i32> for State {
17169 fn from(value: i32) -> Self {
17170 match value {
17171 0 => Self::Unspecified,
17172 1 => Self::Creating,
17173 2 => Self::Active,
17174 3 => Self::Updating,
17175 4 => Self::Deleting,
17176 _ => Self::UnknownValue(state::UnknownValue(
17177 wkt::internal::UnknownEnumValue::Integer(value),
17178 )),
17179 }
17180 }
17181 }
17182
17183 impl std::convert::From<&str> for State {
17184 fn from(value: &str) -> Self {
17185 use std::string::ToString;
17186 match value {
17187 "STATE_UNSPECIFIED" => Self::Unspecified,
17188 "CREATING" => Self::Creating,
17189 "ACTIVE" => Self::Active,
17190 "UPDATING" => Self::Updating,
17191 "DELETING" => Self::Deleting,
17192 _ => Self::UnknownValue(state::UnknownValue(
17193 wkt::internal::UnknownEnumValue::String(value.to_string()),
17194 )),
17195 }
17196 }
17197 }
17198
17199 impl serde::ser::Serialize for State {
17200 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17201 where
17202 S: serde::Serializer,
17203 {
17204 match self {
17205 Self::Unspecified => serializer.serialize_i32(0),
17206 Self::Creating => serializer.serialize_i32(1),
17207 Self::Active => serializer.serialize_i32(2),
17208 Self::Updating => serializer.serialize_i32(3),
17209 Self::Deleting => serializer.serialize_i32(4),
17210 Self::UnknownValue(u) => u.0.serialize(serializer),
17211 }
17212 }
17213 }
17214
17215 impl<'de> serde::de::Deserialize<'de> for State {
17216 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17217 where
17218 D: serde::Deserializer<'de>,
17219 {
17220 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17221 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.State",
17222 ))
17223 }
17224 }
17225
17226 /// Enum Type defines possible types of VMware Engine network.
17227 ///
17228 /// # Working with unknown values
17229 ///
17230 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17231 /// additional enum variants at any time. Adding new variants is not considered
17232 /// a breaking change. Applications should write their code in anticipation of:
17233 ///
17234 /// - New values appearing in future releases of the client library, **and**
17235 /// - New values received dynamically, without application changes.
17236 ///
17237 /// Please consult the [Working with enums] section in the user guide for some
17238 /// guidelines.
17239 ///
17240 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17241 #[derive(Clone, Debug, PartialEq)]
17242 #[non_exhaustive]
17243 pub enum Type {
17244 /// The default value. This value should never be used.
17245 Unspecified,
17246 /// Network type used by private clouds created in projects without a network
17247 /// of type `STANDARD`. This network type is no longer used for new VMware
17248 /// Engine private cloud deployments.
17249 Legacy,
17250 /// Standard network type used for private cloud connectivity.
17251 Standard,
17252 /// If set, the enum was initialized with an unknown value.
17253 ///
17254 /// Applications can examine the value using [Type::value] or
17255 /// [Type::name].
17256 UnknownValue(r#type::UnknownValue),
17257 }
17258
17259 #[doc(hidden)]
17260 pub mod r#type {
17261 #[allow(unused_imports)]
17262 use super::*;
17263 #[derive(Clone, Debug, PartialEq)]
17264 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17265 }
17266
17267 impl Type {
17268 /// Gets the enum value.
17269 ///
17270 /// Returns `None` if the enum contains an unknown value deserialized from
17271 /// the string representation of enums.
17272 pub fn value(&self) -> std::option::Option<i32> {
17273 match self {
17274 Self::Unspecified => std::option::Option::Some(0),
17275 Self::Legacy => std::option::Option::Some(1),
17276 Self::Standard => std::option::Option::Some(2),
17277 Self::UnknownValue(u) => u.0.value(),
17278 }
17279 }
17280
17281 /// Gets the enum value as a string.
17282 ///
17283 /// Returns `None` if the enum contains an unknown value deserialized from
17284 /// the integer representation of enums.
17285 pub fn name(&self) -> std::option::Option<&str> {
17286 match self {
17287 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17288 Self::Legacy => std::option::Option::Some("LEGACY"),
17289 Self::Standard => std::option::Option::Some("STANDARD"),
17290 Self::UnknownValue(u) => u.0.name(),
17291 }
17292 }
17293 }
17294
17295 impl std::default::Default for Type {
17296 fn default() -> Self {
17297 use std::convert::From;
17298 Self::from(0)
17299 }
17300 }
17301
17302 impl std::fmt::Display for Type {
17303 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17304 wkt::internal::display_enum(f, self.name(), self.value())
17305 }
17306 }
17307
17308 impl std::convert::From<i32> for Type {
17309 fn from(value: i32) -> Self {
17310 match value {
17311 0 => Self::Unspecified,
17312 1 => Self::Legacy,
17313 2 => Self::Standard,
17314 _ => Self::UnknownValue(r#type::UnknownValue(
17315 wkt::internal::UnknownEnumValue::Integer(value),
17316 )),
17317 }
17318 }
17319 }
17320
17321 impl std::convert::From<&str> for Type {
17322 fn from(value: &str) -> Self {
17323 use std::string::ToString;
17324 match value {
17325 "TYPE_UNSPECIFIED" => Self::Unspecified,
17326 "LEGACY" => Self::Legacy,
17327 "STANDARD" => Self::Standard,
17328 _ => Self::UnknownValue(r#type::UnknownValue(
17329 wkt::internal::UnknownEnumValue::String(value.to_string()),
17330 )),
17331 }
17332 }
17333 }
17334
17335 impl serde::ser::Serialize for Type {
17336 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17337 where
17338 S: serde::Serializer,
17339 {
17340 match self {
17341 Self::Unspecified => serializer.serialize_i32(0),
17342 Self::Legacy => serializer.serialize_i32(1),
17343 Self::Standard => serializer.serialize_i32(2),
17344 Self::UnknownValue(u) => u.0.serialize(serializer),
17345 }
17346 }
17347 }
17348
17349 impl<'de> serde::de::Deserialize<'de> for Type {
17350 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17351 where
17352 D: serde::Deserializer<'de>,
17353 {
17354 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17355 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type",
17356 ))
17357 }
17358 }
17359}
17360
17361/// Private connection resource that provides connectivity for VMware Engine
17362/// private clouds.
17363#[derive(Clone, Default, PartialEq)]
17364#[non_exhaustive]
17365pub struct PrivateConnection {
17366 /// Output only. The resource name of the private connection.
17367 /// Resource names are schemeless URIs that follow the conventions in
17368 /// <https://cloud.google.com/apis/design/resource_names>.
17369 /// For example:
17370 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
17371 pub name: std::string::String,
17372
17373 /// Output only. Creation time of this resource.
17374 pub create_time: std::option::Option<wkt::Timestamp>,
17375
17376 /// Output only. Last update time of this resource.
17377 pub update_time: std::option::Option<wkt::Timestamp>,
17378
17379 /// Optional. User-provided description for this private connection.
17380 pub description: std::string::String,
17381
17382 /// Output only. State of the private connection.
17383 pub state: crate::model::private_connection::State,
17384
17385 /// Required. The relative resource name of Legacy VMware Engine network.
17386 /// Specify the name in the following form:
17387 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17388 /// where `{project}`, `{location}` will be same as specified in private
17389 /// connection resource name and `{vmware_engine_network_id}` will be in the
17390 /// form of `{location}`-default e.g.
17391 /// projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
17392 pub vmware_engine_network: std::string::String,
17393
17394 /// Output only. The canonical name of the VMware Engine network in the form:
17395 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17396 pub vmware_engine_network_canonical: std::string::String,
17397
17398 /// Required. Private connection type.
17399 pub r#type: crate::model::private_connection::Type,
17400
17401 /// Output only. VPC network peering id between given network VPC and
17402 /// VMwareEngineNetwork.
17403 pub peering_id: std::string::String,
17404
17405 /// Optional. Routing Mode.
17406 /// Default value is set to GLOBAL.
17407 /// For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or
17408 /// REGIONAL, for other types only GLOBAL is supported.
17409 pub routing_mode: crate::model::private_connection::RoutingMode,
17410
17411 /// Output only. System-generated unique identifier for the resource.
17412 pub uid: std::string::String,
17413
17414 /// Required. Service network to create private connection.
17415 /// Specify the name in the following form:
17416 /// `projects/{project}/global/networks/{network_id}`
17417 /// For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
17418 /// VPC, e.g. projects/project-tp/global/networks/servicenetworking.
17419 /// For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
17420 /// e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
17421 /// For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
17422 /// projects/project-tp/global/networks/dell-tenant-vpc.
17423 /// For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
17424 /// any other producer VPC to which the VMware Engine Network needs to be
17425 /// connected, e.g. projects/project/global/networks/vpc.
17426 pub service_network: std::string::String,
17427
17428 /// Output only. Peering state between service network and VMware Engine
17429 /// network.
17430 pub peering_state: crate::model::private_connection::PeeringState,
17431
17432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17433}
17434
17435impl PrivateConnection {
17436 pub fn new() -> Self {
17437 std::default::Default::default()
17438 }
17439
17440 /// Sets the value of [name][crate::model::PrivateConnection::name].
17441 ///
17442 /// # Example
17443 /// ```ignore,no_run
17444 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17445 /// let x = PrivateConnection::new().set_name("example");
17446 /// ```
17447 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17448 self.name = v.into();
17449 self
17450 }
17451
17452 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
17453 ///
17454 /// # Example
17455 /// ```ignore,no_run
17456 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17457 /// use wkt::Timestamp;
17458 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
17459 /// ```
17460 pub fn set_create_time<T>(mut self, v: T) -> Self
17461 where
17462 T: std::convert::Into<wkt::Timestamp>,
17463 {
17464 self.create_time = std::option::Option::Some(v.into());
17465 self
17466 }
17467
17468 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
17469 ///
17470 /// # Example
17471 /// ```ignore,no_run
17472 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17473 /// use wkt::Timestamp;
17474 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17475 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
17476 /// ```
17477 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17478 where
17479 T: std::convert::Into<wkt::Timestamp>,
17480 {
17481 self.create_time = v.map(|x| x.into());
17482 self
17483 }
17484
17485 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
17486 ///
17487 /// # Example
17488 /// ```ignore,no_run
17489 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17490 /// use wkt::Timestamp;
17491 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
17492 /// ```
17493 pub fn set_update_time<T>(mut self, v: T) -> Self
17494 where
17495 T: std::convert::Into<wkt::Timestamp>,
17496 {
17497 self.update_time = std::option::Option::Some(v.into());
17498 self
17499 }
17500
17501 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
17502 ///
17503 /// # Example
17504 /// ```ignore,no_run
17505 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17506 /// use wkt::Timestamp;
17507 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17508 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
17509 /// ```
17510 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17511 where
17512 T: std::convert::Into<wkt::Timestamp>,
17513 {
17514 self.update_time = v.map(|x| x.into());
17515 self
17516 }
17517
17518 /// Sets the value of [description][crate::model::PrivateConnection::description].
17519 ///
17520 /// # Example
17521 /// ```ignore,no_run
17522 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17523 /// let x = PrivateConnection::new().set_description("example");
17524 /// ```
17525 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17526 self.description = v.into();
17527 self
17528 }
17529
17530 /// Sets the value of [state][crate::model::PrivateConnection::state].
17531 ///
17532 /// # Example
17533 /// ```ignore,no_run
17534 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17535 /// use google_cloud_vmwareengine_v1::model::private_connection::State;
17536 /// let x0 = PrivateConnection::new().set_state(State::Creating);
17537 /// let x1 = PrivateConnection::new().set_state(State::Active);
17538 /// let x2 = PrivateConnection::new().set_state(State::Updating);
17539 /// ```
17540 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
17541 mut self,
17542 v: T,
17543 ) -> Self {
17544 self.state = v.into();
17545 self
17546 }
17547
17548 /// Sets the value of [vmware_engine_network][crate::model::PrivateConnection::vmware_engine_network].
17549 ///
17550 /// # Example
17551 /// ```ignore,no_run
17552 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17553 /// let x = PrivateConnection::new().set_vmware_engine_network("example");
17554 /// ```
17555 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
17556 mut self,
17557 v: T,
17558 ) -> Self {
17559 self.vmware_engine_network = v.into();
17560 self
17561 }
17562
17563 /// Sets the value of [vmware_engine_network_canonical][crate::model::PrivateConnection::vmware_engine_network_canonical].
17564 ///
17565 /// # Example
17566 /// ```ignore,no_run
17567 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17568 /// let x = PrivateConnection::new().set_vmware_engine_network_canonical("example");
17569 /// ```
17570 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
17571 mut self,
17572 v: T,
17573 ) -> Self {
17574 self.vmware_engine_network_canonical = v.into();
17575 self
17576 }
17577
17578 /// Sets the value of [r#type][crate::model::PrivateConnection::type].
17579 ///
17580 /// # Example
17581 /// ```ignore,no_run
17582 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17583 /// use google_cloud_vmwareengine_v1::model::private_connection::Type;
17584 /// let x0 = PrivateConnection::new().set_type(Type::PrivateServiceAccess);
17585 /// let x1 = PrivateConnection::new().set_type(Type::NetappCloudVolumes);
17586 /// let x2 = PrivateConnection::new().set_type(Type::DellPowerscale);
17587 /// ```
17588 pub fn set_type<T: std::convert::Into<crate::model::private_connection::Type>>(
17589 mut self,
17590 v: T,
17591 ) -> Self {
17592 self.r#type = v.into();
17593 self
17594 }
17595
17596 /// Sets the value of [peering_id][crate::model::PrivateConnection::peering_id].
17597 ///
17598 /// # Example
17599 /// ```ignore,no_run
17600 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17601 /// let x = PrivateConnection::new().set_peering_id("example");
17602 /// ```
17603 pub fn set_peering_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17604 self.peering_id = v.into();
17605 self
17606 }
17607
17608 /// Sets the value of [routing_mode][crate::model::PrivateConnection::routing_mode].
17609 ///
17610 /// # Example
17611 /// ```ignore,no_run
17612 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17613 /// use google_cloud_vmwareengine_v1::model::private_connection::RoutingMode;
17614 /// let x0 = PrivateConnection::new().set_routing_mode(RoutingMode::Global);
17615 /// let x1 = PrivateConnection::new().set_routing_mode(RoutingMode::Regional);
17616 /// ```
17617 pub fn set_routing_mode<
17618 T: std::convert::Into<crate::model::private_connection::RoutingMode>,
17619 >(
17620 mut self,
17621 v: T,
17622 ) -> Self {
17623 self.routing_mode = v.into();
17624 self
17625 }
17626
17627 /// Sets the value of [uid][crate::model::PrivateConnection::uid].
17628 ///
17629 /// # Example
17630 /// ```ignore,no_run
17631 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17632 /// let x = PrivateConnection::new().set_uid("example");
17633 /// ```
17634 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17635 self.uid = v.into();
17636 self
17637 }
17638
17639 /// Sets the value of [service_network][crate::model::PrivateConnection::service_network].
17640 ///
17641 /// # Example
17642 /// ```ignore,no_run
17643 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17644 /// let x = PrivateConnection::new().set_service_network("example");
17645 /// ```
17646 pub fn set_service_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17647 self.service_network = v.into();
17648 self
17649 }
17650
17651 /// Sets the value of [peering_state][crate::model::PrivateConnection::peering_state].
17652 ///
17653 /// # Example
17654 /// ```ignore,no_run
17655 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17656 /// use google_cloud_vmwareengine_v1::model::private_connection::PeeringState;
17657 /// let x0 = PrivateConnection::new().set_peering_state(PeeringState::PeeringActive);
17658 /// let x1 = PrivateConnection::new().set_peering_state(PeeringState::PeeringInactive);
17659 /// ```
17660 pub fn set_peering_state<
17661 T: std::convert::Into<crate::model::private_connection::PeeringState>,
17662 >(
17663 mut self,
17664 v: T,
17665 ) -> Self {
17666 self.peering_state = v.into();
17667 self
17668 }
17669}
17670
17671impl wkt::message::Message for PrivateConnection {
17672 fn typename() -> &'static str {
17673 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateConnection"
17674 }
17675}
17676
17677/// Defines additional types related to [PrivateConnection].
17678pub mod private_connection {
17679 #[allow(unused_imports)]
17680 use super::*;
17681
17682 /// Enum State defines possible states of private connection.
17683 ///
17684 /// # Working with unknown values
17685 ///
17686 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17687 /// additional enum variants at any time. Adding new variants is not considered
17688 /// a breaking change. Applications should write their code in anticipation of:
17689 ///
17690 /// - New values appearing in future releases of the client library, **and**
17691 /// - New values received dynamically, without application changes.
17692 ///
17693 /// Please consult the [Working with enums] section in the user guide for some
17694 /// guidelines.
17695 ///
17696 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17697 #[derive(Clone, Debug, PartialEq)]
17698 #[non_exhaustive]
17699 pub enum State {
17700 /// The default value. This value is used if the state is omitted.
17701 Unspecified,
17702 /// The private connection is being created.
17703 Creating,
17704 /// The private connection is ready.
17705 Active,
17706 /// The private connection is being updated.
17707 Updating,
17708 /// The private connection is being deleted.
17709 Deleting,
17710 /// The private connection is not provisioned, since no private cloud is
17711 /// present for which this private connection is needed.
17712 Unprovisioned,
17713 /// The private connection is in failed state.
17714 Failed,
17715 /// If set, the enum was initialized with an unknown value.
17716 ///
17717 /// Applications can examine the value using [State::value] or
17718 /// [State::name].
17719 UnknownValue(state::UnknownValue),
17720 }
17721
17722 #[doc(hidden)]
17723 pub mod state {
17724 #[allow(unused_imports)]
17725 use super::*;
17726 #[derive(Clone, Debug, PartialEq)]
17727 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17728 }
17729
17730 impl State {
17731 /// Gets the enum value.
17732 ///
17733 /// Returns `None` if the enum contains an unknown value deserialized from
17734 /// the string representation of enums.
17735 pub fn value(&self) -> std::option::Option<i32> {
17736 match self {
17737 Self::Unspecified => std::option::Option::Some(0),
17738 Self::Creating => std::option::Option::Some(1),
17739 Self::Active => std::option::Option::Some(2),
17740 Self::Updating => std::option::Option::Some(3),
17741 Self::Deleting => std::option::Option::Some(4),
17742 Self::Unprovisioned => std::option::Option::Some(5),
17743 Self::Failed => std::option::Option::Some(6),
17744 Self::UnknownValue(u) => u.0.value(),
17745 }
17746 }
17747
17748 /// Gets the enum value as a string.
17749 ///
17750 /// Returns `None` if the enum contains an unknown value deserialized from
17751 /// the integer representation of enums.
17752 pub fn name(&self) -> std::option::Option<&str> {
17753 match self {
17754 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17755 Self::Creating => std::option::Option::Some("CREATING"),
17756 Self::Active => std::option::Option::Some("ACTIVE"),
17757 Self::Updating => std::option::Option::Some("UPDATING"),
17758 Self::Deleting => std::option::Option::Some("DELETING"),
17759 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
17760 Self::Failed => std::option::Option::Some("FAILED"),
17761 Self::UnknownValue(u) => u.0.name(),
17762 }
17763 }
17764 }
17765
17766 impl std::default::Default for State {
17767 fn default() -> Self {
17768 use std::convert::From;
17769 Self::from(0)
17770 }
17771 }
17772
17773 impl std::fmt::Display for State {
17774 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17775 wkt::internal::display_enum(f, self.name(), self.value())
17776 }
17777 }
17778
17779 impl std::convert::From<i32> for State {
17780 fn from(value: i32) -> Self {
17781 match value {
17782 0 => Self::Unspecified,
17783 1 => Self::Creating,
17784 2 => Self::Active,
17785 3 => Self::Updating,
17786 4 => Self::Deleting,
17787 5 => Self::Unprovisioned,
17788 6 => Self::Failed,
17789 _ => Self::UnknownValue(state::UnknownValue(
17790 wkt::internal::UnknownEnumValue::Integer(value),
17791 )),
17792 }
17793 }
17794 }
17795
17796 impl std::convert::From<&str> for State {
17797 fn from(value: &str) -> Self {
17798 use std::string::ToString;
17799 match value {
17800 "STATE_UNSPECIFIED" => Self::Unspecified,
17801 "CREATING" => Self::Creating,
17802 "ACTIVE" => Self::Active,
17803 "UPDATING" => Self::Updating,
17804 "DELETING" => Self::Deleting,
17805 "UNPROVISIONED" => Self::Unprovisioned,
17806 "FAILED" => Self::Failed,
17807 _ => Self::UnknownValue(state::UnknownValue(
17808 wkt::internal::UnknownEnumValue::String(value.to_string()),
17809 )),
17810 }
17811 }
17812 }
17813
17814 impl serde::ser::Serialize for State {
17815 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17816 where
17817 S: serde::Serializer,
17818 {
17819 match self {
17820 Self::Unspecified => serializer.serialize_i32(0),
17821 Self::Creating => serializer.serialize_i32(1),
17822 Self::Active => serializer.serialize_i32(2),
17823 Self::Updating => serializer.serialize_i32(3),
17824 Self::Deleting => serializer.serialize_i32(4),
17825 Self::Unprovisioned => serializer.serialize_i32(5),
17826 Self::Failed => serializer.serialize_i32(6),
17827 Self::UnknownValue(u) => u.0.serialize(serializer),
17828 }
17829 }
17830 }
17831
17832 impl<'de> serde::de::Deserialize<'de> for State {
17833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17834 where
17835 D: serde::Deserializer<'de>,
17836 {
17837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17838 ".google.cloud.vmwareengine.v1.PrivateConnection.State",
17839 ))
17840 }
17841 }
17842
17843 /// Enum Type defines possible types of private connection.
17844 ///
17845 /// # Working with unknown values
17846 ///
17847 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17848 /// additional enum variants at any time. Adding new variants is not considered
17849 /// a breaking change. Applications should write their code in anticipation of:
17850 ///
17851 /// - New values appearing in future releases of the client library, **and**
17852 /// - New values received dynamically, without application changes.
17853 ///
17854 /// Please consult the [Working with enums] section in the user guide for some
17855 /// guidelines.
17856 ///
17857 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17858 #[derive(Clone, Debug, PartialEq)]
17859 #[non_exhaustive]
17860 pub enum Type {
17861 /// The default value. This value should never be used.
17862 Unspecified,
17863 /// Connection used for establishing [private services
17864 /// access](https://cloud.google.com/vpc/docs/private-services-access).
17865 PrivateServiceAccess,
17866 /// Connection used for connecting to NetApp Cloud Volumes.
17867 NetappCloudVolumes,
17868 /// Connection used for connecting to Dell PowerScale.
17869 DellPowerscale,
17870 /// Connection used for connecting to third-party services.
17871 ThirdPartyService,
17872 /// If set, the enum was initialized with an unknown value.
17873 ///
17874 /// Applications can examine the value using [Type::value] or
17875 /// [Type::name].
17876 UnknownValue(r#type::UnknownValue),
17877 }
17878
17879 #[doc(hidden)]
17880 pub mod r#type {
17881 #[allow(unused_imports)]
17882 use super::*;
17883 #[derive(Clone, Debug, PartialEq)]
17884 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17885 }
17886
17887 impl Type {
17888 /// Gets the enum value.
17889 ///
17890 /// Returns `None` if the enum contains an unknown value deserialized from
17891 /// the string representation of enums.
17892 pub fn value(&self) -> std::option::Option<i32> {
17893 match self {
17894 Self::Unspecified => std::option::Option::Some(0),
17895 Self::PrivateServiceAccess => std::option::Option::Some(1),
17896 Self::NetappCloudVolumes => std::option::Option::Some(2),
17897 Self::DellPowerscale => std::option::Option::Some(3),
17898 Self::ThirdPartyService => std::option::Option::Some(4),
17899 Self::UnknownValue(u) => u.0.value(),
17900 }
17901 }
17902
17903 /// Gets the enum value as a string.
17904 ///
17905 /// Returns `None` if the enum contains an unknown value deserialized from
17906 /// the integer representation of enums.
17907 pub fn name(&self) -> std::option::Option<&str> {
17908 match self {
17909 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17910 Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
17911 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
17912 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
17913 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
17914 Self::UnknownValue(u) => u.0.name(),
17915 }
17916 }
17917 }
17918
17919 impl std::default::Default for Type {
17920 fn default() -> Self {
17921 use std::convert::From;
17922 Self::from(0)
17923 }
17924 }
17925
17926 impl std::fmt::Display for Type {
17927 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17928 wkt::internal::display_enum(f, self.name(), self.value())
17929 }
17930 }
17931
17932 impl std::convert::From<i32> for Type {
17933 fn from(value: i32) -> Self {
17934 match value {
17935 0 => Self::Unspecified,
17936 1 => Self::PrivateServiceAccess,
17937 2 => Self::NetappCloudVolumes,
17938 3 => Self::DellPowerscale,
17939 4 => Self::ThirdPartyService,
17940 _ => Self::UnknownValue(r#type::UnknownValue(
17941 wkt::internal::UnknownEnumValue::Integer(value),
17942 )),
17943 }
17944 }
17945 }
17946
17947 impl std::convert::From<&str> for Type {
17948 fn from(value: &str) -> Self {
17949 use std::string::ToString;
17950 match value {
17951 "TYPE_UNSPECIFIED" => Self::Unspecified,
17952 "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
17953 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
17954 "DELL_POWERSCALE" => Self::DellPowerscale,
17955 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
17956 _ => Self::UnknownValue(r#type::UnknownValue(
17957 wkt::internal::UnknownEnumValue::String(value.to_string()),
17958 )),
17959 }
17960 }
17961 }
17962
17963 impl serde::ser::Serialize for Type {
17964 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17965 where
17966 S: serde::Serializer,
17967 {
17968 match self {
17969 Self::Unspecified => serializer.serialize_i32(0),
17970 Self::PrivateServiceAccess => serializer.serialize_i32(1),
17971 Self::NetappCloudVolumes => serializer.serialize_i32(2),
17972 Self::DellPowerscale => serializer.serialize_i32(3),
17973 Self::ThirdPartyService => serializer.serialize_i32(4),
17974 Self::UnknownValue(u) => u.0.serialize(serializer),
17975 }
17976 }
17977 }
17978
17979 impl<'de> serde::de::Deserialize<'de> for Type {
17980 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17981 where
17982 D: serde::Deserializer<'de>,
17983 {
17984 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17985 ".google.cloud.vmwareengine.v1.PrivateConnection.Type",
17986 ))
17987 }
17988 }
17989
17990 /// Possible types for RoutingMode
17991 ///
17992 /// # Working with unknown values
17993 ///
17994 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17995 /// additional enum variants at any time. Adding new variants is not considered
17996 /// a breaking change. Applications should write their code in anticipation of:
17997 ///
17998 /// - New values appearing in future releases of the client library, **and**
17999 /// - New values received dynamically, without application changes.
18000 ///
18001 /// Please consult the [Working with enums] section in the user guide for some
18002 /// guidelines.
18003 ///
18004 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18005 #[derive(Clone, Debug, PartialEq)]
18006 #[non_exhaustive]
18007 pub enum RoutingMode {
18008 /// The default value. This value should never be used.
18009 Unspecified,
18010 /// Global Routing Mode
18011 Global,
18012 /// Regional Routing Mode
18013 Regional,
18014 /// If set, the enum was initialized with an unknown value.
18015 ///
18016 /// Applications can examine the value using [RoutingMode::value] or
18017 /// [RoutingMode::name].
18018 UnknownValue(routing_mode::UnknownValue),
18019 }
18020
18021 #[doc(hidden)]
18022 pub mod routing_mode {
18023 #[allow(unused_imports)]
18024 use super::*;
18025 #[derive(Clone, Debug, PartialEq)]
18026 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18027 }
18028
18029 impl RoutingMode {
18030 /// Gets the enum value.
18031 ///
18032 /// Returns `None` if the enum contains an unknown value deserialized from
18033 /// the string representation of enums.
18034 pub fn value(&self) -> std::option::Option<i32> {
18035 match self {
18036 Self::Unspecified => std::option::Option::Some(0),
18037 Self::Global => std::option::Option::Some(1),
18038 Self::Regional => std::option::Option::Some(2),
18039 Self::UnknownValue(u) => u.0.value(),
18040 }
18041 }
18042
18043 /// Gets the enum value as a string.
18044 ///
18045 /// Returns `None` if the enum contains an unknown value deserialized from
18046 /// the integer representation of enums.
18047 pub fn name(&self) -> std::option::Option<&str> {
18048 match self {
18049 Self::Unspecified => std::option::Option::Some("ROUTING_MODE_UNSPECIFIED"),
18050 Self::Global => std::option::Option::Some("GLOBAL"),
18051 Self::Regional => std::option::Option::Some("REGIONAL"),
18052 Self::UnknownValue(u) => u.0.name(),
18053 }
18054 }
18055 }
18056
18057 impl std::default::Default for RoutingMode {
18058 fn default() -> Self {
18059 use std::convert::From;
18060 Self::from(0)
18061 }
18062 }
18063
18064 impl std::fmt::Display for RoutingMode {
18065 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18066 wkt::internal::display_enum(f, self.name(), self.value())
18067 }
18068 }
18069
18070 impl std::convert::From<i32> for RoutingMode {
18071 fn from(value: i32) -> Self {
18072 match value {
18073 0 => Self::Unspecified,
18074 1 => Self::Global,
18075 2 => Self::Regional,
18076 _ => Self::UnknownValue(routing_mode::UnknownValue(
18077 wkt::internal::UnknownEnumValue::Integer(value),
18078 )),
18079 }
18080 }
18081 }
18082
18083 impl std::convert::From<&str> for RoutingMode {
18084 fn from(value: &str) -> Self {
18085 use std::string::ToString;
18086 match value {
18087 "ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
18088 "GLOBAL" => Self::Global,
18089 "REGIONAL" => Self::Regional,
18090 _ => Self::UnknownValue(routing_mode::UnknownValue(
18091 wkt::internal::UnknownEnumValue::String(value.to_string()),
18092 )),
18093 }
18094 }
18095 }
18096
18097 impl serde::ser::Serialize for RoutingMode {
18098 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18099 where
18100 S: serde::Serializer,
18101 {
18102 match self {
18103 Self::Unspecified => serializer.serialize_i32(0),
18104 Self::Global => serializer.serialize_i32(1),
18105 Self::Regional => serializer.serialize_i32(2),
18106 Self::UnknownValue(u) => u.0.serialize(serializer),
18107 }
18108 }
18109 }
18110
18111 impl<'de> serde::de::Deserialize<'de> for RoutingMode {
18112 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18113 where
18114 D: serde::Deserializer<'de>,
18115 {
18116 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingMode>::new(
18117 ".google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode",
18118 ))
18119 }
18120 }
18121
18122 /// Enum PeeringState defines the possible states of peering between service
18123 /// network and the vpc network peered to service network
18124 ///
18125 /// # Working with unknown values
18126 ///
18127 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18128 /// additional enum variants at any time. Adding new variants is not considered
18129 /// a breaking change. Applications should write their code in anticipation of:
18130 ///
18131 /// - New values appearing in future releases of the client library, **and**
18132 /// - New values received dynamically, without application changes.
18133 ///
18134 /// Please consult the [Working with enums] section in the user guide for some
18135 /// guidelines.
18136 ///
18137 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18138 #[derive(Clone, Debug, PartialEq)]
18139 #[non_exhaustive]
18140 pub enum PeeringState {
18141 /// The default value. This value is used if the peering state is omitted or
18142 /// unknown.
18143 Unspecified,
18144 /// The peering is in active state.
18145 PeeringActive,
18146 /// The peering is in inactive state.
18147 PeeringInactive,
18148 /// If set, the enum was initialized with an unknown value.
18149 ///
18150 /// Applications can examine the value using [PeeringState::value] or
18151 /// [PeeringState::name].
18152 UnknownValue(peering_state::UnknownValue),
18153 }
18154
18155 #[doc(hidden)]
18156 pub mod peering_state {
18157 #[allow(unused_imports)]
18158 use super::*;
18159 #[derive(Clone, Debug, PartialEq)]
18160 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18161 }
18162
18163 impl PeeringState {
18164 /// Gets the enum value.
18165 ///
18166 /// Returns `None` if the enum contains an unknown value deserialized from
18167 /// the string representation of enums.
18168 pub fn value(&self) -> std::option::Option<i32> {
18169 match self {
18170 Self::Unspecified => std::option::Option::Some(0),
18171 Self::PeeringActive => std::option::Option::Some(1),
18172 Self::PeeringInactive => std::option::Option::Some(2),
18173 Self::UnknownValue(u) => u.0.value(),
18174 }
18175 }
18176
18177 /// Gets the enum value as a string.
18178 ///
18179 /// Returns `None` if the enum contains an unknown value deserialized from
18180 /// the integer representation of enums.
18181 pub fn name(&self) -> std::option::Option<&str> {
18182 match self {
18183 Self::Unspecified => std::option::Option::Some("PEERING_STATE_UNSPECIFIED"),
18184 Self::PeeringActive => std::option::Option::Some("PEERING_ACTIVE"),
18185 Self::PeeringInactive => std::option::Option::Some("PEERING_INACTIVE"),
18186 Self::UnknownValue(u) => u.0.name(),
18187 }
18188 }
18189 }
18190
18191 impl std::default::Default for PeeringState {
18192 fn default() -> Self {
18193 use std::convert::From;
18194 Self::from(0)
18195 }
18196 }
18197
18198 impl std::fmt::Display for PeeringState {
18199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18200 wkt::internal::display_enum(f, self.name(), self.value())
18201 }
18202 }
18203
18204 impl std::convert::From<i32> for PeeringState {
18205 fn from(value: i32) -> Self {
18206 match value {
18207 0 => Self::Unspecified,
18208 1 => Self::PeeringActive,
18209 2 => Self::PeeringInactive,
18210 _ => Self::UnknownValue(peering_state::UnknownValue(
18211 wkt::internal::UnknownEnumValue::Integer(value),
18212 )),
18213 }
18214 }
18215 }
18216
18217 impl std::convert::From<&str> for PeeringState {
18218 fn from(value: &str) -> Self {
18219 use std::string::ToString;
18220 match value {
18221 "PEERING_STATE_UNSPECIFIED" => Self::Unspecified,
18222 "PEERING_ACTIVE" => Self::PeeringActive,
18223 "PEERING_INACTIVE" => Self::PeeringInactive,
18224 _ => Self::UnknownValue(peering_state::UnknownValue(
18225 wkt::internal::UnknownEnumValue::String(value.to_string()),
18226 )),
18227 }
18228 }
18229 }
18230
18231 impl serde::ser::Serialize for PeeringState {
18232 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18233 where
18234 S: serde::Serializer,
18235 {
18236 match self {
18237 Self::Unspecified => serializer.serialize_i32(0),
18238 Self::PeeringActive => serializer.serialize_i32(1),
18239 Self::PeeringInactive => serializer.serialize_i32(2),
18240 Self::UnknownValue(u) => u.0.serialize(serializer),
18241 }
18242 }
18243 }
18244
18245 impl<'de> serde::de::Deserialize<'de> for PeeringState {
18246 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18247 where
18248 D: serde::Deserializer<'de>,
18249 {
18250 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeeringState>::new(
18251 ".google.cloud.vmwareengine.v1.PrivateConnection.PeeringState",
18252 ))
18253 }
18254 }
18255}
18256
18257/// VmwareEngine specific metadata for the given
18258/// [google.cloud.location.Location][google.cloud.location.Location]. It is
18259/// returned as a content of the `google.cloud.location.Location.metadata` field.
18260///
18261/// [google.cloud.location.Location]: google_cloud_location::model::Location
18262#[derive(Clone, Default, PartialEq)]
18263#[non_exhaustive]
18264pub struct LocationMetadata {
18265 /// Output only. Capabilities of this location.
18266 pub capabilities: std::vec::Vec<crate::model::location_metadata::Capability>,
18267
18268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18269}
18270
18271impl LocationMetadata {
18272 pub fn new() -> Self {
18273 std::default::Default::default()
18274 }
18275
18276 /// Sets the value of [capabilities][crate::model::LocationMetadata::capabilities].
18277 ///
18278 /// # Example
18279 /// ```ignore,no_run
18280 /// # use google_cloud_vmwareengine_v1::model::LocationMetadata;
18281 /// use google_cloud_vmwareengine_v1::model::location_metadata::Capability;
18282 /// let x = LocationMetadata::new().set_capabilities([
18283 /// Capability::StretchedClusters,
18284 /// ]);
18285 /// ```
18286 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
18287 where
18288 T: std::iter::IntoIterator<Item = V>,
18289 V: std::convert::Into<crate::model::location_metadata::Capability>,
18290 {
18291 use std::iter::Iterator;
18292 self.capabilities = v.into_iter().map(|i| i.into()).collect();
18293 self
18294 }
18295}
18296
18297impl wkt::message::Message for LocationMetadata {
18298 fn typename() -> &'static str {
18299 "type.googleapis.com/google.cloud.vmwareengine.v1.LocationMetadata"
18300 }
18301}
18302
18303/// Defines additional types related to [LocationMetadata].
18304pub mod location_metadata {
18305 #[allow(unused_imports)]
18306 use super::*;
18307
18308 /// Capability of a location.
18309 ///
18310 /// # Working with unknown values
18311 ///
18312 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18313 /// additional enum variants at any time. Adding new variants is not considered
18314 /// a breaking change. Applications should write their code in anticipation of:
18315 ///
18316 /// - New values appearing in future releases of the client library, **and**
18317 /// - New values received dynamically, without application changes.
18318 ///
18319 /// Please consult the [Working with enums] section in the user guide for some
18320 /// guidelines.
18321 ///
18322 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18323 #[derive(Clone, Debug, PartialEq)]
18324 #[non_exhaustive]
18325 pub enum Capability {
18326 /// The default value. This value is used if the capability is omitted or
18327 /// unknown.
18328 Unspecified,
18329 /// Stretch clusters are supported in this location.
18330 StretchedClusters,
18331 /// If set, the enum was initialized with an unknown value.
18332 ///
18333 /// Applications can examine the value using [Capability::value] or
18334 /// [Capability::name].
18335 UnknownValue(capability::UnknownValue),
18336 }
18337
18338 #[doc(hidden)]
18339 pub mod capability {
18340 #[allow(unused_imports)]
18341 use super::*;
18342 #[derive(Clone, Debug, PartialEq)]
18343 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18344 }
18345
18346 impl Capability {
18347 /// Gets the enum value.
18348 ///
18349 /// Returns `None` if the enum contains an unknown value deserialized from
18350 /// the string representation of enums.
18351 pub fn value(&self) -> std::option::Option<i32> {
18352 match self {
18353 Self::Unspecified => std::option::Option::Some(0),
18354 Self::StretchedClusters => std::option::Option::Some(1),
18355 Self::UnknownValue(u) => u.0.value(),
18356 }
18357 }
18358
18359 /// Gets the enum value as a string.
18360 ///
18361 /// Returns `None` if the enum contains an unknown value deserialized from
18362 /// the integer representation of enums.
18363 pub fn name(&self) -> std::option::Option<&str> {
18364 match self {
18365 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
18366 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
18367 Self::UnknownValue(u) => u.0.name(),
18368 }
18369 }
18370 }
18371
18372 impl std::default::Default for Capability {
18373 fn default() -> Self {
18374 use std::convert::From;
18375 Self::from(0)
18376 }
18377 }
18378
18379 impl std::fmt::Display for Capability {
18380 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18381 wkt::internal::display_enum(f, self.name(), self.value())
18382 }
18383 }
18384
18385 impl std::convert::From<i32> for Capability {
18386 fn from(value: i32) -> Self {
18387 match value {
18388 0 => Self::Unspecified,
18389 1 => Self::StretchedClusters,
18390 _ => Self::UnknownValue(capability::UnknownValue(
18391 wkt::internal::UnknownEnumValue::Integer(value),
18392 )),
18393 }
18394 }
18395 }
18396
18397 impl std::convert::From<&str> for Capability {
18398 fn from(value: &str) -> Self {
18399 use std::string::ToString;
18400 match value {
18401 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
18402 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
18403 _ => Self::UnknownValue(capability::UnknownValue(
18404 wkt::internal::UnknownEnumValue::String(value.to_string()),
18405 )),
18406 }
18407 }
18408 }
18409
18410 impl serde::ser::Serialize for Capability {
18411 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18412 where
18413 S: serde::Serializer,
18414 {
18415 match self {
18416 Self::Unspecified => serializer.serialize_i32(0),
18417 Self::StretchedClusters => serializer.serialize_i32(1),
18418 Self::UnknownValue(u) => u.0.serialize(serializer),
18419 }
18420 }
18421 }
18422
18423 impl<'de> serde::de::Deserialize<'de> for Capability {
18424 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18425 where
18426 D: serde::Deserializer<'de>,
18427 {
18428 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
18429 ".google.cloud.vmwareengine.v1.LocationMetadata.Capability",
18430 ))
18431 }
18432 }
18433}
18434
18435/// DnsBindPermission resource that contains the accounts having the consumer DNS
18436/// bind permission on the corresponding intranet VPC of the consumer project.
18437#[derive(Clone, Default, PartialEq)]
18438#[non_exhaustive]
18439pub struct DnsBindPermission {
18440 /// Required. Output only. The name of the resource which stores the
18441 /// users/service accounts having the permission to bind to the corresponding
18442 /// intranet VPC of the consumer project. DnsBindPermission is a global
18443 /// resource and location can only be global. Resource names are schemeless
18444 /// URIs that follow the conventions in
18445 /// <https://cloud.google.com/apis/design/resource_names>. For example:
18446 /// `projects/my-project/locations/global/dnsBindPermission`
18447 pub name: std::string::String,
18448
18449 /// Output only. Users/Service accounts which have access for binding on the
18450 /// intranet VPC project corresponding to the consumer project.
18451 pub principals: std::vec::Vec<crate::model::Principal>,
18452
18453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18454}
18455
18456impl DnsBindPermission {
18457 pub fn new() -> Self {
18458 std::default::Default::default()
18459 }
18460
18461 /// Sets the value of [name][crate::model::DnsBindPermission::name].
18462 ///
18463 /// # Example
18464 /// ```ignore,no_run
18465 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18466 /// let x = DnsBindPermission::new().set_name("example");
18467 /// ```
18468 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18469 self.name = v.into();
18470 self
18471 }
18472
18473 /// Sets the value of [principals][crate::model::DnsBindPermission::principals].
18474 ///
18475 /// # Example
18476 /// ```ignore,no_run
18477 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18478 /// use google_cloud_vmwareengine_v1::model::Principal;
18479 /// let x = DnsBindPermission::new()
18480 /// .set_principals([
18481 /// Principal::default()/* use setters */,
18482 /// Principal::default()/* use (different) setters */,
18483 /// ]);
18484 /// ```
18485 pub fn set_principals<T, V>(mut self, v: T) -> Self
18486 where
18487 T: std::iter::IntoIterator<Item = V>,
18488 V: std::convert::Into<crate::model::Principal>,
18489 {
18490 use std::iter::Iterator;
18491 self.principals = v.into_iter().map(|i| i.into()).collect();
18492 self
18493 }
18494}
18495
18496impl wkt::message::Message for DnsBindPermission {
18497 fn typename() -> &'static str {
18498 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsBindPermission"
18499 }
18500}
18501
18502/// Users/Service accounts which have access for DNS binding on the intranet
18503/// VPC corresponding to the consumer project.
18504#[derive(Clone, Default, PartialEq)]
18505#[non_exhaustive]
18506pub struct Principal {
18507 /// The consumer provided user/service account which needs to be
18508 /// granted permission to DNS bind with the intranet VPC corresponding to the
18509 /// consumer project.
18510 pub principal: std::option::Option<crate::model::principal::Principal>,
18511
18512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18513}
18514
18515impl Principal {
18516 pub fn new() -> Self {
18517 std::default::Default::default()
18518 }
18519
18520 /// Sets the value of [principal][crate::model::Principal::principal].
18521 ///
18522 /// Note that all the setters affecting `principal` are mutually
18523 /// exclusive.
18524 ///
18525 /// # Example
18526 /// ```ignore,no_run
18527 /// # use google_cloud_vmwareengine_v1::model::Principal;
18528 /// use google_cloud_vmwareengine_v1::model::principal::Principal as PrincipalOneOf;
18529 /// let x = Principal::new().set_principal(Some(PrincipalOneOf::User("example".to_string())));
18530 /// ```
18531 pub fn set_principal<
18532 T: std::convert::Into<std::option::Option<crate::model::principal::Principal>>,
18533 >(
18534 mut self,
18535 v: T,
18536 ) -> Self {
18537 self.principal = v.into();
18538 self
18539 }
18540
18541 /// The value of [principal][crate::model::Principal::principal]
18542 /// if it holds a `User`, `None` if the field is not set or
18543 /// holds a different branch.
18544 pub fn user(&self) -> std::option::Option<&std::string::String> {
18545 #[allow(unreachable_patterns)]
18546 self.principal.as_ref().and_then(|v| match v {
18547 crate::model::principal::Principal::User(v) => std::option::Option::Some(v),
18548 _ => std::option::Option::None,
18549 })
18550 }
18551
18552 /// Sets the value of [principal][crate::model::Principal::principal]
18553 /// to hold a `User`.
18554 ///
18555 /// Note that all the setters affecting `principal` are
18556 /// mutually exclusive.
18557 ///
18558 /// # Example
18559 /// ```ignore,no_run
18560 /// # use google_cloud_vmwareengine_v1::model::Principal;
18561 /// let x = Principal::new().set_user("example");
18562 /// assert!(x.user().is_some());
18563 /// assert!(x.service_account().is_none());
18564 /// ```
18565 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18566 self.principal =
18567 std::option::Option::Some(crate::model::principal::Principal::User(v.into()));
18568 self
18569 }
18570
18571 /// The value of [principal][crate::model::Principal::principal]
18572 /// if it holds a `ServiceAccount`, `None` if the field is not set or
18573 /// holds a different branch.
18574 pub fn service_account(&self) -> std::option::Option<&std::string::String> {
18575 #[allow(unreachable_patterns)]
18576 self.principal.as_ref().and_then(|v| match v {
18577 crate::model::principal::Principal::ServiceAccount(v) => std::option::Option::Some(v),
18578 _ => std::option::Option::None,
18579 })
18580 }
18581
18582 /// Sets the value of [principal][crate::model::Principal::principal]
18583 /// to hold a `ServiceAccount`.
18584 ///
18585 /// Note that all the setters affecting `principal` are
18586 /// mutually exclusive.
18587 ///
18588 /// # Example
18589 /// ```ignore,no_run
18590 /// # use google_cloud_vmwareengine_v1::model::Principal;
18591 /// let x = Principal::new().set_service_account("example");
18592 /// assert!(x.service_account().is_some());
18593 /// assert!(x.user().is_none());
18594 /// ```
18595 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18596 self.principal =
18597 std::option::Option::Some(crate::model::principal::Principal::ServiceAccount(v.into()));
18598 self
18599 }
18600}
18601
18602impl wkt::message::Message for Principal {
18603 fn typename() -> &'static str {
18604 "type.googleapis.com/google.cloud.vmwareengine.v1.Principal"
18605 }
18606}
18607
18608/// Defines additional types related to [Principal].
18609pub mod principal {
18610 #[allow(unused_imports)]
18611 use super::*;
18612
18613 /// The consumer provided user/service account which needs to be
18614 /// granted permission to DNS bind with the intranet VPC corresponding to the
18615 /// consumer project.
18616 #[derive(Clone, Debug, PartialEq)]
18617 #[non_exhaustive]
18618 pub enum Principal {
18619 /// The user who needs to be granted permission.
18620 User(std::string::String),
18621 /// The service account which needs to be granted the permission.
18622 ServiceAccount(std::string::String),
18623 }
18624}