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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Request message for
42/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
43///
44/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
45#[derive(Clone, Default, PartialEq)]
46#[non_exhaustive]
47pub struct ListPrivateCloudsRequest {
48 /// Required. The resource name of the private cloud to be queried for
49 /// clusters. Resource names are schemeless URIs that follow the conventions in
50 /// <https://cloud.google.com/apis/design/resource_names>.
51 /// For example:
52 /// `projects/my-project/locations/us-central1-a`
53 pub parent: std::string::String,
54
55 /// The maximum number of private clouds to return in one page.
56 /// The service may return fewer than this value.
57 /// The maximum value is coerced to 1000.
58 /// The default value of this field is 500.
59 pub page_size: i32,
60
61 /// A page token, received from a previous `ListPrivateClouds` call.
62 /// Provide this to retrieve the subsequent page.
63 ///
64 /// When paginating, all other parameters provided to `ListPrivateClouds` must
65 /// match the call that provided the page token.
66 pub page_token: std::string::String,
67
68 /// A filter expression that matches resources returned in the response.
69 /// The expression must specify the field name, a comparison operator, and the
70 /// value that you want to use for filtering. The value must be a string, a
71 /// number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
72 /// `<`.
73 ///
74 /// For example, if you are filtering a list of private clouds, you can exclude
75 /// the ones named `example-pc` by specifying `name != "example-pc"`.
76 ///
77 /// You can also filter nested fields. For example, you could specify
78 /// `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
79 /// only if they have a matching address in their network configuration.
80 ///
81 /// To filter on multiple expressions, provide each separate expression within
82 /// parentheses. For example:
83 ///
84 /// ```norust
85 /// (name = "example-pc")
86 /// (createTime > "2021-04-12T08:15:10.40Z")
87 /// ```
88 ///
89 /// By default, each expression is an `AND` expression. However, you can
90 /// include `AND` and `OR` expressions explicitly. For example:
91 ///
92 /// ```norust
93 /// (name = "private-cloud-1") AND
94 /// (createTime > "2021-04-12T08:15:10.40Z") OR
95 /// (name = "private-cloud-2")
96 /// ```
97 pub filter: std::string::String,
98
99 /// Sorts list results by a certain order. By default, returned results are
100 /// ordered by `name` in ascending order. You can also sort results in
101 /// descending order based on the `name` value using `orderBy="name desc"`.
102 /// Currently, only ordering by `name` is supported.
103 pub order_by: std::string::String,
104
105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
106}
107
108impl ListPrivateCloudsRequest {
109 /// Creates a new default instance.
110 pub fn new() -> Self {
111 std::default::Default::default()
112 }
113
114 /// Sets the value of [parent][crate::model::ListPrivateCloudsRequest::parent].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
119 /// let x = ListPrivateCloudsRequest::new().set_parent("example");
120 /// ```
121 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
122 self.parent = v.into();
123 self
124 }
125
126 /// Sets the value of [page_size][crate::model::ListPrivateCloudsRequest::page_size].
127 ///
128 /// # Example
129 /// ```ignore,no_run
130 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
131 /// let x = ListPrivateCloudsRequest::new().set_page_size(42);
132 /// ```
133 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
134 self.page_size = v.into();
135 self
136 }
137
138 /// Sets the value of [page_token][crate::model::ListPrivateCloudsRequest::page_token].
139 ///
140 /// # Example
141 /// ```ignore,no_run
142 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
143 /// let x = ListPrivateCloudsRequest::new().set_page_token("example");
144 /// ```
145 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146 self.page_token = v.into();
147 self
148 }
149
150 /// Sets the value of [filter][crate::model::ListPrivateCloudsRequest::filter].
151 ///
152 /// # Example
153 /// ```ignore,no_run
154 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
155 /// let x = ListPrivateCloudsRequest::new().set_filter("example");
156 /// ```
157 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158 self.filter = v.into();
159 self
160 }
161
162 /// Sets the value of [order_by][crate::model::ListPrivateCloudsRequest::order_by].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsRequest;
167 /// let x = ListPrivateCloudsRequest::new().set_order_by("example");
168 /// ```
169 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
170 self.order_by = v.into();
171 self
172 }
173}
174
175impl wkt::message::Message for ListPrivateCloudsRequest {
176 fn typename() -> &'static str {
177 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"
178 }
179}
180
181/// Response message for
182/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
183///
184/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
185#[derive(Clone, Default, PartialEq)]
186#[non_exhaustive]
187pub struct ListPrivateCloudsResponse {
188 /// A list of private clouds.
189 pub private_clouds: std::vec::Vec<crate::model::PrivateCloud>,
190
191 /// A token, which can be sent as `page_token` to retrieve the next page.
192 /// If this field is omitted, there are no subsequent pages.
193 pub next_page_token: std::string::String,
194
195 /// Locations that could not be reached when making an aggregated query using
196 /// wildcards.
197 pub unreachable: std::vec::Vec<std::string::String>,
198
199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
200}
201
202impl ListPrivateCloudsResponse {
203 /// Creates a new default instance.
204 pub fn new() -> Self {
205 std::default::Default::default()
206 }
207
208 /// Sets the value of [private_clouds][crate::model::ListPrivateCloudsResponse::private_clouds].
209 ///
210 /// # Example
211 /// ```ignore,no_run
212 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
213 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
214 /// let x = ListPrivateCloudsResponse::new()
215 /// .set_private_clouds([
216 /// PrivateCloud::default()/* use setters */,
217 /// PrivateCloud::default()/* use (different) setters */,
218 /// ]);
219 /// ```
220 pub fn set_private_clouds<T, V>(mut self, v: T) -> Self
221 where
222 T: std::iter::IntoIterator<Item = V>,
223 V: std::convert::Into<crate::model::PrivateCloud>,
224 {
225 use std::iter::Iterator;
226 self.private_clouds = v.into_iter().map(|i| i.into()).collect();
227 self
228 }
229
230 /// Sets the value of [next_page_token][crate::model::ListPrivateCloudsResponse::next_page_token].
231 ///
232 /// # Example
233 /// ```ignore,no_run
234 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
235 /// let x = ListPrivateCloudsResponse::new().set_next_page_token("example");
236 /// ```
237 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
238 self.next_page_token = v.into();
239 self
240 }
241
242 /// Sets the value of [unreachable][crate::model::ListPrivateCloudsResponse::unreachable].
243 ///
244 /// # Example
245 /// ```ignore,no_run
246 /// # use google_cloud_vmwareengine_v1::model::ListPrivateCloudsResponse;
247 /// let x = ListPrivateCloudsResponse::new().set_unreachable(["a", "b", "c"]);
248 /// ```
249 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
250 where
251 T: std::iter::IntoIterator<Item = V>,
252 V: std::convert::Into<std::string::String>,
253 {
254 use std::iter::Iterator;
255 self.unreachable = v.into_iter().map(|i| i.into()).collect();
256 self
257 }
258}
259
260impl wkt::message::Message for ListPrivateCloudsResponse {
261 fn typename() -> &'static str {
262 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"
263 }
264}
265
266#[doc(hidden)]
267impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateCloudsResponse {
268 type PageItem = crate::model::PrivateCloud;
269
270 fn items(self) -> std::vec::Vec<Self::PageItem> {
271 self.private_clouds
272 }
273
274 fn next_page_token(&self) -> std::string::String {
275 use std::clone::Clone;
276 self.next_page_token.clone()
277 }
278}
279
280/// Request message for
281/// [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]
282///
283/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]: crate::client::VmwareEngine::get_private_cloud
284#[derive(Clone, Default, PartialEq)]
285#[non_exhaustive]
286pub struct GetPrivateCloudRequest {
287 /// Required. The resource name of the private cloud to retrieve.
288 /// Resource names are schemeless URIs that follow the conventions in
289 /// <https://cloud.google.com/apis/design/resource_names>.
290 /// For example:
291 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
292 pub name: std::string::String,
293
294 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
295}
296
297impl GetPrivateCloudRequest {
298 /// Creates a new default instance.
299 pub fn new() -> Self {
300 std::default::Default::default()
301 }
302
303 /// Sets the value of [name][crate::model::GetPrivateCloudRequest::name].
304 ///
305 /// # Example
306 /// ```ignore,no_run
307 /// # use google_cloud_vmwareengine_v1::model::GetPrivateCloudRequest;
308 /// # let project_id = "project_id";
309 /// # let location_id = "location_id";
310 /// # let private_cloud_id = "private_cloud_id";
311 /// let x = GetPrivateCloudRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
312 /// ```
313 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
314 self.name = v.into();
315 self
316 }
317}
318
319impl wkt::message::Message for GetPrivateCloudRequest {
320 fn typename() -> &'static str {
321 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"
322 }
323}
324
325/// Request message for
326/// [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]
327///
328/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]: crate::client::VmwareEngine::create_private_cloud
329#[derive(Clone, Default, PartialEq)]
330#[non_exhaustive]
331pub struct CreatePrivateCloudRequest {
332 /// Required. The resource name of the location to create the new
333 /// private cloud in. Resource names are schemeless URIs that follow the
334 /// conventions in <https://cloud.google.com/apis/design/resource_names>.
335 /// For example:
336 /// `projects/my-project/locations/us-central1-a`
337 pub parent: std::string::String,
338
339 /// Required. The user-provided identifier of the private cloud to be created.
340 /// This identifier must be unique among each `PrivateCloud` within the parent
341 /// and becomes the final token in the name URI.
342 /// The identifier must meet the following requirements:
343 ///
344 /// * Only contains 1-63 alphanumeric characters and hyphens
345 /// * Begins with an alphabetical character
346 /// * Ends with a non-hyphen character
347 /// * Not formatted as a UUID
348 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
349 /// (section 3.5)
350 pub private_cloud_id: std::string::String,
351
352 /// Required. The initial description of the new private cloud.
353 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
354
355 /// Optional. The request ID must be a valid UUID with the exception that zero
356 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
357 pub request_id: std::string::String,
358
359 /// Optional. True if you want the request to be validated and not executed;
360 /// false otherwise.
361 pub validate_only: bool,
362
363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
364}
365
366impl CreatePrivateCloudRequest {
367 /// Creates a new default instance.
368 pub fn new() -> Self {
369 std::default::Default::default()
370 }
371
372 /// Sets the value of [parent][crate::model::CreatePrivateCloudRequest::parent].
373 ///
374 /// # Example
375 /// ```ignore,no_run
376 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
377 /// let x = CreatePrivateCloudRequest::new().set_parent("example");
378 /// ```
379 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
380 self.parent = v.into();
381 self
382 }
383
384 /// Sets the value of [private_cloud_id][crate::model::CreatePrivateCloudRequest::private_cloud_id].
385 ///
386 /// # Example
387 /// ```ignore,no_run
388 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
389 /// let x = CreatePrivateCloudRequest::new().set_private_cloud_id("example");
390 /// ```
391 pub fn set_private_cloud_id<T: std::convert::Into<std::string::String>>(
392 mut self,
393 v: T,
394 ) -> Self {
395 self.private_cloud_id = v.into();
396 self
397 }
398
399 /// Sets the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
400 ///
401 /// # Example
402 /// ```ignore,no_run
403 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
404 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
405 /// let x = CreatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
406 /// ```
407 pub fn set_private_cloud<T>(mut self, v: T) -> Self
408 where
409 T: std::convert::Into<crate::model::PrivateCloud>,
410 {
411 self.private_cloud = std::option::Option::Some(v.into());
412 self
413 }
414
415 /// Sets or clears the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
416 ///
417 /// # Example
418 /// ```ignore,no_run
419 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
420 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
421 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
422 /// let x = CreatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
423 /// ```
424 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
425 where
426 T: std::convert::Into<crate::model::PrivateCloud>,
427 {
428 self.private_cloud = v.map(|x| x.into());
429 self
430 }
431
432 /// Sets the value of [request_id][crate::model::CreatePrivateCloudRequest::request_id].
433 ///
434 /// # Example
435 /// ```ignore,no_run
436 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
437 /// let x = CreatePrivateCloudRequest::new().set_request_id("example");
438 /// ```
439 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
440 self.request_id = v.into();
441 self
442 }
443
444 /// Sets the value of [validate_only][crate::model::CreatePrivateCloudRequest::validate_only].
445 ///
446 /// # Example
447 /// ```ignore,no_run
448 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateCloudRequest;
449 /// let x = CreatePrivateCloudRequest::new().set_validate_only(true);
450 /// ```
451 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
452 self.validate_only = v.into();
453 self
454 }
455}
456
457impl wkt::message::Message for CreatePrivateCloudRequest {
458 fn typename() -> &'static str {
459 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"
460 }
461}
462
463/// Request message for
464/// [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]
465///
466/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]: crate::client::VmwareEngine::update_private_cloud
467#[derive(Clone, Default, PartialEq)]
468#[non_exhaustive]
469pub struct UpdatePrivateCloudRequest {
470 /// Required. Private cloud description.
471 pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
472
473 /// Required. Field mask is used to specify the fields to be overwritten in the
474 /// `PrivateCloud` resource by the update. The fields specified in `updateMask`
475 /// are relative to the resource, not the full request. A field will be
476 /// overwritten if it is in the mask. If the user does not provide a mask then
477 /// all fields will be overwritten.
478 pub update_mask: std::option::Option<wkt::FieldMask>,
479
480 /// Optional. The request ID must be a valid UUID with the exception that zero
481 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
482 pub request_id: std::string::String,
483
484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
485}
486
487impl UpdatePrivateCloudRequest {
488 /// Creates a new default instance.
489 pub fn new() -> Self {
490 std::default::Default::default()
491 }
492
493 /// Sets the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
494 ///
495 /// # Example
496 /// ```ignore,no_run
497 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
498 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
499 /// let x = UpdatePrivateCloudRequest::new().set_private_cloud(PrivateCloud::default()/* use setters */);
500 /// ```
501 pub fn set_private_cloud<T>(mut self, v: T) -> Self
502 where
503 T: std::convert::Into<crate::model::PrivateCloud>,
504 {
505 self.private_cloud = std::option::Option::Some(v.into());
506 self
507 }
508
509 /// Sets or clears the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
510 ///
511 /// # Example
512 /// ```ignore,no_run
513 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
514 /// use google_cloud_vmwareengine_v1::model::PrivateCloud;
515 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(Some(PrivateCloud::default()/* use setters */));
516 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_private_cloud(None::<PrivateCloud>);
517 /// ```
518 pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
519 where
520 T: std::convert::Into<crate::model::PrivateCloud>,
521 {
522 self.private_cloud = v.map(|x| x.into());
523 self
524 }
525
526 /// Sets the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
527 ///
528 /// # Example
529 /// ```ignore,no_run
530 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
531 /// use wkt::FieldMask;
532 /// let x = UpdatePrivateCloudRequest::new().set_update_mask(FieldMask::default()/* use setters */);
533 /// ```
534 pub fn set_update_mask<T>(mut self, v: T) -> Self
535 where
536 T: std::convert::Into<wkt::FieldMask>,
537 {
538 self.update_mask = std::option::Option::Some(v.into());
539 self
540 }
541
542 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
543 ///
544 /// # Example
545 /// ```ignore,no_run
546 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
547 /// use wkt::FieldMask;
548 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
549 /// let x = UpdatePrivateCloudRequest::new().set_or_clear_update_mask(None::<FieldMask>);
550 /// ```
551 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
552 where
553 T: std::convert::Into<wkt::FieldMask>,
554 {
555 self.update_mask = v.map(|x| x.into());
556 self
557 }
558
559 /// Sets the value of [request_id][crate::model::UpdatePrivateCloudRequest::request_id].
560 ///
561 /// # Example
562 /// ```ignore,no_run
563 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateCloudRequest;
564 /// let x = UpdatePrivateCloudRequest::new().set_request_id("example");
565 /// ```
566 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
567 self.request_id = v.into();
568 self
569 }
570}
571
572impl wkt::message::Message for UpdatePrivateCloudRequest {
573 fn typename() -> &'static str {
574 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"
575 }
576}
577
578/// Request message for
579/// [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]
580///
581/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]: crate::client::VmwareEngine::delete_private_cloud
582#[derive(Clone, Default, PartialEq)]
583#[non_exhaustive]
584pub struct DeletePrivateCloudRequest {
585 /// Required. The resource name of the private cloud to delete.
586 /// Resource names are schemeless URIs that follow the conventions in
587 /// <https://cloud.google.com/apis/design/resource_names>.
588 /// For example:
589 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
590 pub name: std::string::String,
591
592 /// Optional. The request ID must be a valid UUID with the exception that zero
593 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
594 pub request_id: std::string::String,
595
596 /// Optional. If set to true, cascade delete is enabled and all children of
597 /// this private cloud resource are also deleted. When this flag is set to
598 /// false, the private cloud will not be deleted if there are any children
599 /// other than the management cluster. The management cluster is always
600 /// deleted.
601 pub force: bool,
602
603 /// Optional. Time delay of the deletion specified in hours. The default value
604 /// is `3`. Specifying a non-zero value for this field changes the value of
605 /// `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
606 /// deletion time. Deletion can be cancelled before `expire_time` elapses using
607 /// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud].
608 /// Specifying a value of `0` for this field instead begins the deletion
609 /// process and ceases billing immediately. During the final deletion process,
610 /// the value of `PrivateCloud.state` becomes `PURGING`.
611 ///
612 /// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
613 pub delay_hours: std::option::Option<i32>,
614
615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
616}
617
618impl DeletePrivateCloudRequest {
619 /// Creates a new default instance.
620 pub fn new() -> Self {
621 std::default::Default::default()
622 }
623
624 /// Sets the value of [name][crate::model::DeletePrivateCloudRequest::name].
625 ///
626 /// # Example
627 /// ```ignore,no_run
628 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
629 /// # let project_id = "project_id";
630 /// # let location_id = "location_id";
631 /// # let private_cloud_id = "private_cloud_id";
632 /// let x = DeletePrivateCloudRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
633 /// ```
634 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
635 self.name = v.into();
636 self
637 }
638
639 /// Sets the value of [request_id][crate::model::DeletePrivateCloudRequest::request_id].
640 ///
641 /// # Example
642 /// ```ignore,no_run
643 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
644 /// let x = DeletePrivateCloudRequest::new().set_request_id("example");
645 /// ```
646 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
647 self.request_id = v.into();
648 self
649 }
650
651 /// Sets the value of [force][crate::model::DeletePrivateCloudRequest::force].
652 ///
653 /// # Example
654 /// ```ignore,no_run
655 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
656 /// let x = DeletePrivateCloudRequest::new().set_force(true);
657 /// ```
658 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
659 self.force = v.into();
660 self
661 }
662
663 /// Sets the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
664 ///
665 /// # Example
666 /// ```ignore,no_run
667 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
668 /// let x = DeletePrivateCloudRequest::new().set_delay_hours(42);
669 /// ```
670 pub fn set_delay_hours<T>(mut self, v: T) -> Self
671 where
672 T: std::convert::Into<i32>,
673 {
674 self.delay_hours = std::option::Option::Some(v.into());
675 self
676 }
677
678 /// Sets or clears the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
679 ///
680 /// # Example
681 /// ```ignore,no_run
682 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateCloudRequest;
683 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(Some(42));
684 /// let x = DeletePrivateCloudRequest::new().set_or_clear_delay_hours(None::<i32>);
685 /// ```
686 pub fn set_or_clear_delay_hours<T>(mut self, v: std::option::Option<T>) -> Self
687 where
688 T: std::convert::Into<i32>,
689 {
690 self.delay_hours = v.map(|x| x.into());
691 self
692 }
693}
694
695impl wkt::message::Message for DeletePrivateCloudRequest {
696 fn typename() -> &'static str {
697 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"
698 }
699}
700
701/// Request message for
702/// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]
703///
704/// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
705#[derive(Clone, Default, PartialEq)]
706#[non_exhaustive]
707pub struct UndeletePrivateCloudRequest {
708 /// Required. The resource name of the private cloud scheduled for deletion.
709 /// Resource names are schemeless URIs that follow the conventions in
710 /// <https://cloud.google.com/apis/design/resource_names>.
711 /// For example:
712 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
713 pub name: std::string::String,
714
715 /// Optional. The request ID must be a valid UUID with the exception that zero
716 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
717 pub request_id: std::string::String,
718
719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
720}
721
722impl UndeletePrivateCloudRequest {
723 /// Creates a new default instance.
724 pub fn new() -> Self {
725 std::default::Default::default()
726 }
727
728 /// Sets the value of [name][crate::model::UndeletePrivateCloudRequest::name].
729 ///
730 /// # Example
731 /// ```ignore,no_run
732 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
733 /// # let project_id = "project_id";
734 /// # let location_id = "location_id";
735 /// # let private_cloud_id = "private_cloud_id";
736 /// let x = UndeletePrivateCloudRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
737 /// ```
738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
739 self.name = v.into();
740 self
741 }
742
743 /// Sets the value of [request_id][crate::model::UndeletePrivateCloudRequest::request_id].
744 ///
745 /// # Example
746 /// ```ignore,no_run
747 /// # use google_cloud_vmwareengine_v1::model::UndeletePrivateCloudRequest;
748 /// let x = UndeletePrivateCloudRequest::new().set_request_id("example");
749 /// ```
750 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
751 self.request_id = v.into();
752 self
753 }
754}
755
756impl wkt::message::Message for UndeletePrivateCloudRequest {
757 fn typename() -> &'static str {
758 "type.googleapis.com/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"
759 }
760}
761
762/// Request message for
763/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
764///
765/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
766#[derive(Clone, Default, PartialEq)]
767#[non_exhaustive]
768pub struct ListClustersRequest {
769 /// Required. The resource name of the private cloud to query for clusters.
770 /// Resource names are schemeless URIs that follow the conventions in
771 /// <https://cloud.google.com/apis/design/resource_names>.
772 /// For example:
773 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
774 pub parent: std::string::String,
775
776 /// The maximum number of clusters to return in one page.
777 /// The service may return fewer than this value.
778 /// The maximum value is coerced to 1000.
779 /// The default value of this field is 500.
780 pub page_size: i32,
781
782 /// A page token, received from a previous `ListClusters` call.
783 /// Provide this to retrieve the subsequent page.
784 ///
785 /// When paginating, all other parameters provided to `ListClusters`
786 /// must match the call that provided the page token.
787 pub page_token: std::string::String,
788
789 /// To filter on multiple expressions, provide each separate expression within
790 /// parentheses. For example:
791 ///
792 /// ```norust
793 /// (name = "example-cluster")
794 /// (nodeCount = "3")
795 /// ```
796 ///
797 /// By default, each expression is an `AND` expression. However, you can
798 /// include `AND` and `OR` expressions explicitly. For example:
799 ///
800 /// ```norust
801 /// (name = "example-cluster-1") AND
802 /// (createTime > "2021-04-12T08:15:10.40Z") OR
803 /// (name = "example-cluster-2")
804 /// ```
805 pub filter: std::string::String,
806
807 /// Sorts list results by a certain order. By default, returned results are
808 /// ordered by `name` in ascending order. You can also sort results in
809 /// descending order based on the `name` value using `orderBy="name desc"`.
810 /// Currently, only ordering by `name` is supported.
811 pub order_by: std::string::String,
812
813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
814}
815
816impl ListClustersRequest {
817 /// Creates a new default instance.
818 pub fn new() -> Self {
819 std::default::Default::default()
820 }
821
822 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
823 ///
824 /// # Example
825 /// ```ignore,no_run
826 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
827 /// # let project_id = "project_id";
828 /// # let location_id = "location_id";
829 /// # let private_cloud_id = "private_cloud_id";
830 /// let x = ListClustersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
831 /// ```
832 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
833 self.parent = v.into();
834 self
835 }
836
837 /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
838 ///
839 /// # Example
840 /// ```ignore,no_run
841 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
842 /// let x = ListClustersRequest::new().set_page_size(42);
843 /// ```
844 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
845 self.page_size = v.into();
846 self
847 }
848
849 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
850 ///
851 /// # Example
852 /// ```ignore,no_run
853 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
854 /// let x = ListClustersRequest::new().set_page_token("example");
855 /// ```
856 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
857 self.page_token = v.into();
858 self
859 }
860
861 /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
862 ///
863 /// # Example
864 /// ```ignore,no_run
865 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
866 /// let x = ListClustersRequest::new().set_filter("example");
867 /// ```
868 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
869 self.filter = v.into();
870 self
871 }
872
873 /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
874 ///
875 /// # Example
876 /// ```ignore,no_run
877 /// # use google_cloud_vmwareengine_v1::model::ListClustersRequest;
878 /// let x = ListClustersRequest::new().set_order_by("example");
879 /// ```
880 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881 self.order_by = v.into();
882 self
883 }
884}
885
886impl wkt::message::Message for ListClustersRequest {
887 fn typename() -> &'static str {
888 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersRequest"
889 }
890}
891
892/// Response message for
893/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
894///
895/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
896#[derive(Clone, Default, PartialEq)]
897#[non_exhaustive]
898pub struct ListClustersResponse {
899 /// A list of private cloud clusters.
900 pub clusters: std::vec::Vec<crate::model::Cluster>,
901
902 /// A token, which can be sent as `page_token` to retrieve the next page.
903 /// If this field is omitted, there are no subsequent pages.
904 pub next_page_token: std::string::String,
905
906 /// Locations that could not be reached when making an aggregated query using
907 /// wildcards.
908 pub unreachable: std::vec::Vec<std::string::String>,
909
910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
911}
912
913impl ListClustersResponse {
914 /// Creates a new default instance.
915 pub fn new() -> Self {
916 std::default::Default::default()
917 }
918
919 /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
920 ///
921 /// # Example
922 /// ```ignore,no_run
923 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
924 /// use google_cloud_vmwareengine_v1::model::Cluster;
925 /// let x = ListClustersResponse::new()
926 /// .set_clusters([
927 /// Cluster::default()/* use setters */,
928 /// Cluster::default()/* use (different) setters */,
929 /// ]);
930 /// ```
931 pub fn set_clusters<T, V>(mut self, v: T) -> Self
932 where
933 T: std::iter::IntoIterator<Item = V>,
934 V: std::convert::Into<crate::model::Cluster>,
935 {
936 use std::iter::Iterator;
937 self.clusters = v.into_iter().map(|i| i.into()).collect();
938 self
939 }
940
941 /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
942 ///
943 /// # Example
944 /// ```ignore,no_run
945 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
946 /// let x = ListClustersResponse::new().set_next_page_token("example");
947 /// ```
948 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
949 self.next_page_token = v.into();
950 self
951 }
952
953 /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
954 ///
955 /// # Example
956 /// ```ignore,no_run
957 /// # use google_cloud_vmwareengine_v1::model::ListClustersResponse;
958 /// let x = ListClustersResponse::new().set_unreachable(["a", "b", "c"]);
959 /// ```
960 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
961 where
962 T: std::iter::IntoIterator<Item = V>,
963 V: std::convert::Into<std::string::String>,
964 {
965 use std::iter::Iterator;
966 self.unreachable = v.into_iter().map(|i| i.into()).collect();
967 self
968 }
969}
970
971impl wkt::message::Message for ListClustersResponse {
972 fn typename() -> &'static str {
973 "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersResponse"
974 }
975}
976
977#[doc(hidden)]
978impl google_cloud_gax::paginator::internal::PageableResponse for ListClustersResponse {
979 type PageItem = crate::model::Cluster;
980
981 fn items(self) -> std::vec::Vec<Self::PageItem> {
982 self.clusters
983 }
984
985 fn next_page_token(&self) -> std::string::String {
986 use std::clone::Clone;
987 self.next_page_token.clone()
988 }
989}
990
991/// Request message for
992/// [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]
993///
994/// [google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]: crate::client::VmwareEngine::get_cluster
995#[derive(Clone, Default, PartialEq)]
996#[non_exhaustive]
997pub struct GetClusterRequest {
998 /// Required. The cluster resource name to retrieve.
999 /// Resource names are schemeless URIs that follow the conventions in
1000 /// <https://cloud.google.com/apis/design/resource_names>.
1001 /// For example:
1002 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1003 pub name: std::string::String,
1004
1005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1006}
1007
1008impl GetClusterRequest {
1009 /// Creates a new default instance.
1010 pub fn new() -> Self {
1011 std::default::Default::default()
1012 }
1013
1014 /// Sets the value of [name][crate::model::GetClusterRequest::name].
1015 ///
1016 /// # Example
1017 /// ```ignore,no_run
1018 /// # use google_cloud_vmwareengine_v1::model::GetClusterRequest;
1019 /// # let project_id = "project_id";
1020 /// # let location_id = "location_id";
1021 /// # let private_cloud_id = "private_cloud_id";
1022 /// # let cluster_id = "cluster_id";
1023 /// let x = GetClusterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}"));
1024 /// ```
1025 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1026 self.name = v.into();
1027 self
1028 }
1029}
1030
1031impl wkt::message::Message for GetClusterRequest {
1032 fn typename() -> &'static str {
1033 "type.googleapis.com/google.cloud.vmwareengine.v1.GetClusterRequest"
1034 }
1035}
1036
1037/// Request message for
1038/// [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]
1039///
1040/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]: crate::client::VmwareEngine::create_cluster
1041#[derive(Clone, Default, PartialEq)]
1042#[non_exhaustive]
1043pub struct CreateClusterRequest {
1044 /// Required. The resource name of the private cloud to create a new cluster
1045 /// in. Resource names are schemeless URIs that follow the conventions in
1046 /// <https://cloud.google.com/apis/design/resource_names>.
1047 /// For example:
1048 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1049 pub parent: std::string::String,
1050
1051 /// Required. The user-provided identifier of the new `Cluster`.
1052 /// This identifier must be unique among clusters within the parent and becomes
1053 /// the final token in the name URI.
1054 /// The identifier must meet the following requirements:
1055 ///
1056 /// * Only contains 1-63 alphanumeric characters and hyphens
1057 /// * Begins with an alphabetical character
1058 /// * Ends with a non-hyphen character
1059 /// * Not formatted as a UUID
1060 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
1061 /// (section 3.5)
1062 pub cluster_id: std::string::String,
1063
1064 /// Required. The initial description of the new cluster.
1065 pub cluster: std::option::Option<crate::model::Cluster>,
1066
1067 /// Optional. The request ID must be a valid UUID with the exception that zero
1068 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1069 pub request_id: std::string::String,
1070
1071 /// Optional. True if you want the request to be validated and not executed;
1072 /// false otherwise.
1073 pub validate_only: bool,
1074
1075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1076}
1077
1078impl CreateClusterRequest {
1079 /// Creates a new default instance.
1080 pub fn new() -> Self {
1081 std::default::Default::default()
1082 }
1083
1084 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
1085 ///
1086 /// # Example
1087 /// ```ignore,no_run
1088 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1089 /// # let project_id = "project_id";
1090 /// # let location_id = "location_id";
1091 /// # let private_cloud_id = "private_cloud_id";
1092 /// let x = CreateClusterRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
1093 /// ```
1094 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1095 self.parent = v.into();
1096 self
1097 }
1098
1099 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1104 /// let x = CreateClusterRequest::new().set_cluster_id("example");
1105 /// ```
1106 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.cluster_id = v.into();
1108 self
1109 }
1110
1111 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
1112 ///
1113 /// # Example
1114 /// ```ignore,no_run
1115 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1116 /// use google_cloud_vmwareengine_v1::model::Cluster;
1117 /// let x = CreateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1118 /// ```
1119 pub fn set_cluster<T>(mut self, v: T) -> Self
1120 where
1121 T: std::convert::Into<crate::model::Cluster>,
1122 {
1123 self.cluster = std::option::Option::Some(v.into());
1124 self
1125 }
1126
1127 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1132 /// use google_cloud_vmwareengine_v1::model::Cluster;
1133 /// let x = CreateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1134 /// let x = CreateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1135 /// ```
1136 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1137 where
1138 T: std::convert::Into<crate::model::Cluster>,
1139 {
1140 self.cluster = v.map(|x| x.into());
1141 self
1142 }
1143
1144 /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
1145 ///
1146 /// # Example
1147 /// ```ignore,no_run
1148 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1149 /// let x = CreateClusterRequest::new().set_request_id("example");
1150 /// ```
1151 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.request_id = v.into();
1153 self
1154 }
1155
1156 /// Sets the value of [validate_only][crate::model::CreateClusterRequest::validate_only].
1157 ///
1158 /// # Example
1159 /// ```ignore,no_run
1160 /// # use google_cloud_vmwareengine_v1::model::CreateClusterRequest;
1161 /// let x = CreateClusterRequest::new().set_validate_only(true);
1162 /// ```
1163 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1164 self.validate_only = v.into();
1165 self
1166 }
1167}
1168
1169impl wkt::message::Message for CreateClusterRequest {
1170 fn typename() -> &'static str {
1171 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateClusterRequest"
1172 }
1173}
1174
1175/// Request message for
1176/// [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]
1177///
1178/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]: crate::client::VmwareEngine::update_cluster
1179#[derive(Clone, Default, PartialEq)]
1180#[non_exhaustive]
1181pub struct UpdateClusterRequest {
1182 /// Required. Field mask is used to specify the fields to be overwritten in the
1183 /// `Cluster` resource by the update. The fields specified in the `updateMask`
1184 /// are relative to the resource, not the full request. A field will be
1185 /// overwritten if it is in the mask. If the user does not provide a mask then
1186 /// all fields will be overwritten.
1187 pub update_mask: std::option::Option<wkt::FieldMask>,
1188
1189 /// Required. The description of the cluster.
1190 pub cluster: std::option::Option<crate::model::Cluster>,
1191
1192 /// Optional. The request ID must be a valid UUID with the exception that
1193 /// zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1194 pub request_id: std::string::String,
1195
1196 /// Optional. True if you want the request to be validated and not executed;
1197 /// false otherwise.
1198 pub validate_only: bool,
1199
1200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1201}
1202
1203impl UpdateClusterRequest {
1204 /// Creates a new default instance.
1205 pub fn new() -> Self {
1206 std::default::Default::default()
1207 }
1208
1209 /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1210 ///
1211 /// # Example
1212 /// ```ignore,no_run
1213 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1214 /// use wkt::FieldMask;
1215 /// let x = UpdateClusterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1216 /// ```
1217 pub fn set_update_mask<T>(mut self, v: T) -> Self
1218 where
1219 T: std::convert::Into<wkt::FieldMask>,
1220 {
1221 self.update_mask = std::option::Option::Some(v.into());
1222 self
1223 }
1224
1225 /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
1226 ///
1227 /// # Example
1228 /// ```ignore,no_run
1229 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1230 /// use wkt::FieldMask;
1231 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1232 /// let x = UpdateClusterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1233 /// ```
1234 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1235 where
1236 T: std::convert::Into<wkt::FieldMask>,
1237 {
1238 self.update_mask = v.map(|x| x.into());
1239 self
1240 }
1241
1242 /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1243 ///
1244 /// # Example
1245 /// ```ignore,no_run
1246 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1247 /// use google_cloud_vmwareengine_v1::model::Cluster;
1248 /// let x = UpdateClusterRequest::new().set_cluster(Cluster::default()/* use setters */);
1249 /// ```
1250 pub fn set_cluster<T>(mut self, v: T) -> Self
1251 where
1252 T: std::convert::Into<crate::model::Cluster>,
1253 {
1254 self.cluster = std::option::Option::Some(v.into());
1255 self
1256 }
1257
1258 /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
1259 ///
1260 /// # Example
1261 /// ```ignore,no_run
1262 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1263 /// use google_cloud_vmwareengine_v1::model::Cluster;
1264 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(Some(Cluster::default()/* use setters */));
1265 /// let x = UpdateClusterRequest::new().set_or_clear_cluster(None::<Cluster>);
1266 /// ```
1267 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1268 where
1269 T: std::convert::Into<crate::model::Cluster>,
1270 {
1271 self.cluster = v.map(|x| x.into());
1272 self
1273 }
1274
1275 /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
1276 ///
1277 /// # Example
1278 /// ```ignore,no_run
1279 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1280 /// let x = UpdateClusterRequest::new().set_request_id("example");
1281 /// ```
1282 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1283 self.request_id = v.into();
1284 self
1285 }
1286
1287 /// Sets the value of [validate_only][crate::model::UpdateClusterRequest::validate_only].
1288 ///
1289 /// # Example
1290 /// ```ignore,no_run
1291 /// # use google_cloud_vmwareengine_v1::model::UpdateClusterRequest;
1292 /// let x = UpdateClusterRequest::new().set_validate_only(true);
1293 /// ```
1294 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1295 self.validate_only = v.into();
1296 self
1297 }
1298}
1299
1300impl wkt::message::Message for UpdateClusterRequest {
1301 fn typename() -> &'static str {
1302 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateClusterRequest"
1303 }
1304}
1305
1306/// Request message for
1307/// [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]
1308///
1309/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]: crate::client::VmwareEngine::delete_cluster
1310#[derive(Clone, Default, PartialEq)]
1311#[non_exhaustive]
1312pub struct DeleteClusterRequest {
1313 /// Required. The resource name of the cluster to delete.
1314 /// Resource names are schemeless URIs that follow the conventions in
1315 /// <https://cloud.google.com/apis/design/resource_names>.
1316 /// For example:
1317 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1318 pub name: std::string::String,
1319
1320 /// Optional. The request ID must be a valid UUID with the exception that zero
1321 /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1322 pub request_id: std::string::String,
1323
1324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1325}
1326
1327impl DeleteClusterRequest {
1328 /// Creates a new default instance.
1329 pub fn new() -> Self {
1330 std::default::Default::default()
1331 }
1332
1333 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1338 /// # let project_id = "project_id";
1339 /// # let location_id = "location_id";
1340 /// # let private_cloud_id = "private_cloud_id";
1341 /// # let cluster_id = "cluster_id";
1342 /// let x = DeleteClusterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}"));
1343 /// ```
1344 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1345 self.name = v.into();
1346 self
1347 }
1348
1349 /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
1350 ///
1351 /// # Example
1352 /// ```ignore,no_run
1353 /// # use google_cloud_vmwareengine_v1::model::DeleteClusterRequest;
1354 /// let x = DeleteClusterRequest::new().set_request_id("example");
1355 /// ```
1356 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1357 self.request_id = v.into();
1358 self
1359 }
1360}
1361
1362impl wkt::message::Message for DeleteClusterRequest {
1363 fn typename() -> &'static str {
1364 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteClusterRequest"
1365 }
1366}
1367
1368/// Request message for
1369/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1370///
1371/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1372#[derive(Clone, Default, PartialEq)]
1373#[non_exhaustive]
1374pub struct ListNodesRequest {
1375 /// Required. The resource name of the cluster to be queried for nodes.
1376 /// Resource names are schemeless URIs that follow the conventions in
1377 /// <https://cloud.google.com/apis/design/resource_names>.
1378 /// For example:
1379 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
1380 pub parent: std::string::String,
1381
1382 /// The maximum number of nodes to return in one page.
1383 /// The service may return fewer than this value.
1384 /// The maximum value is coerced to 1000.
1385 /// The default value of this field is 500.
1386 pub page_size: i32,
1387
1388 /// A page token, received from a previous `ListNodes` call.
1389 /// Provide this to retrieve the subsequent page.
1390 ///
1391 /// When paginating, all other parameters provided to
1392 /// `ListNodes` must match the call that provided the page
1393 /// token.
1394 pub page_token: std::string::String,
1395
1396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1397}
1398
1399impl ListNodesRequest {
1400 /// Creates a new default instance.
1401 pub fn new() -> Self {
1402 std::default::Default::default()
1403 }
1404
1405 /// Sets the value of [parent][crate::model::ListNodesRequest::parent].
1406 ///
1407 /// # Example
1408 /// ```ignore,no_run
1409 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1410 /// # let project_id = "project_id";
1411 /// # let location_id = "location_id";
1412 /// # let private_cloud_id = "private_cloud_id";
1413 /// # let cluster_id = "cluster_id";
1414 /// let x = ListNodesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}"));
1415 /// ```
1416 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1417 self.parent = v.into();
1418 self
1419 }
1420
1421 /// Sets the value of [page_size][crate::model::ListNodesRequest::page_size].
1422 ///
1423 /// # Example
1424 /// ```ignore,no_run
1425 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1426 /// let x = ListNodesRequest::new().set_page_size(42);
1427 /// ```
1428 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1429 self.page_size = v.into();
1430 self
1431 }
1432
1433 /// Sets the value of [page_token][crate::model::ListNodesRequest::page_token].
1434 ///
1435 /// # Example
1436 /// ```ignore,no_run
1437 /// # use google_cloud_vmwareengine_v1::model::ListNodesRequest;
1438 /// let x = ListNodesRequest::new().set_page_token("example");
1439 /// ```
1440 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1441 self.page_token = v.into();
1442 self
1443 }
1444}
1445
1446impl wkt::message::Message for ListNodesRequest {
1447 fn typename() -> &'static str {
1448 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesRequest"
1449 }
1450}
1451
1452/// Response message for
1453/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
1454///
1455/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
1456#[derive(Clone, Default, PartialEq)]
1457#[non_exhaustive]
1458pub struct ListNodesResponse {
1459 /// The nodes.
1460 pub nodes: std::vec::Vec<crate::model::Node>,
1461
1462 /// A token, which can be sent as `page_token` to retrieve the next page.
1463 /// If this field is omitted, there are no subsequent pages.
1464 pub next_page_token: std::string::String,
1465
1466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1467}
1468
1469impl ListNodesResponse {
1470 /// Creates a new default instance.
1471 pub fn new() -> Self {
1472 std::default::Default::default()
1473 }
1474
1475 /// Sets the value of [nodes][crate::model::ListNodesResponse::nodes].
1476 ///
1477 /// # Example
1478 /// ```ignore,no_run
1479 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1480 /// use google_cloud_vmwareengine_v1::model::Node;
1481 /// let x = ListNodesResponse::new()
1482 /// .set_nodes([
1483 /// Node::default()/* use setters */,
1484 /// Node::default()/* use (different) setters */,
1485 /// ]);
1486 /// ```
1487 pub fn set_nodes<T, V>(mut self, v: T) -> Self
1488 where
1489 T: std::iter::IntoIterator<Item = V>,
1490 V: std::convert::Into<crate::model::Node>,
1491 {
1492 use std::iter::Iterator;
1493 self.nodes = v.into_iter().map(|i| i.into()).collect();
1494 self
1495 }
1496
1497 /// Sets the value of [next_page_token][crate::model::ListNodesResponse::next_page_token].
1498 ///
1499 /// # Example
1500 /// ```ignore,no_run
1501 /// # use google_cloud_vmwareengine_v1::model::ListNodesResponse;
1502 /// let x = ListNodesResponse::new().set_next_page_token("example");
1503 /// ```
1504 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1505 self.next_page_token = v.into();
1506 self
1507 }
1508}
1509
1510impl wkt::message::Message for ListNodesResponse {
1511 fn typename() -> &'static str {
1512 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesResponse"
1513 }
1514}
1515
1516#[doc(hidden)]
1517impl google_cloud_gax::paginator::internal::PageableResponse for ListNodesResponse {
1518 type PageItem = crate::model::Node;
1519
1520 fn items(self) -> std::vec::Vec<Self::PageItem> {
1521 self.nodes
1522 }
1523
1524 fn next_page_token(&self) -> std::string::String {
1525 use std::clone::Clone;
1526 self.next_page_token.clone()
1527 }
1528}
1529
1530/// Request message for
1531/// [VmwareEngine.GetNode][google.cloud.vmwareengine.v1.VmwareEngine.GetNode]
1532///
1533/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNode]: crate::client::VmwareEngine::get_node
1534#[derive(Clone, Default, PartialEq)]
1535#[non_exhaustive]
1536pub struct GetNodeRequest {
1537 /// Required. The resource name of the node to retrieve.
1538 /// For example:
1539 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}`
1540 pub name: std::string::String,
1541
1542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1543}
1544
1545impl GetNodeRequest {
1546 /// Creates a new default instance.
1547 pub fn new() -> Self {
1548 std::default::Default::default()
1549 }
1550
1551 /// Sets the value of [name][crate::model::GetNodeRequest::name].
1552 ///
1553 /// # Example
1554 /// ```ignore,no_run
1555 /// # use google_cloud_vmwareengine_v1::model::GetNodeRequest;
1556 /// # let project_id = "project_id";
1557 /// # let location_id = "location_id";
1558 /// # let private_cloud_id = "private_cloud_id";
1559 /// # let cluster_id = "cluster_id";
1560 /// # let node_id = "node_id";
1561 /// let x = GetNodeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}/nodes/{node_id}"));
1562 /// ```
1563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1564 self.name = v.into();
1565 self
1566 }
1567}
1568
1569impl wkt::message::Message for GetNodeRequest {
1570 fn typename() -> &'static str {
1571 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeRequest"
1572 }
1573}
1574
1575/// Request message for
1576/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1577///
1578/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1579#[derive(Clone, Default, PartialEq)]
1580#[non_exhaustive]
1581pub struct ListExternalAddressesRequest {
1582 /// Required. The resource name of the private cloud to be queried for
1583 /// external IP addresses.
1584 /// Resource names are schemeless URIs that follow the conventions in
1585 /// <https://cloud.google.com/apis/design/resource_names>.
1586 /// For example:
1587 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1588 pub parent: std::string::String,
1589
1590 /// The maximum number of external IP addresses to return in one page.
1591 /// The service may return fewer than this value.
1592 /// The maximum value is coerced to 1000.
1593 /// The default value of this field is 500.
1594 pub page_size: i32,
1595
1596 /// A page token, received from a previous `ListExternalAddresses` call.
1597 /// Provide this to retrieve the subsequent page.
1598 ///
1599 /// When paginating, all other parameters provided to
1600 /// `ListExternalAddresses` must match the call that provided the page token.
1601 pub page_token: std::string::String,
1602
1603 /// A filter expression that matches resources returned in the response.
1604 /// The expression must specify the field name, a comparison
1605 /// operator, and the value that you want to use for filtering. The value
1606 /// must be a string, a number, or a boolean. The comparison operator
1607 /// must be `=`, `!=`, `>`, or `<`.
1608 ///
1609 /// For example, if you are filtering a list of IP addresses, you can
1610 /// exclude the ones named `example-ip` by specifying
1611 /// `name != "example-ip"`.
1612 ///
1613 /// To filter on multiple expressions, provide each separate expression within
1614 /// parentheses. For example:
1615 ///
1616 /// ```norust
1617 /// (name = "example-ip")
1618 /// (createTime > "2021-04-12T08:15:10.40Z")
1619 /// ```
1620 ///
1621 /// By default, each expression is an `AND` expression. However, you
1622 /// can include `AND` and `OR` expressions explicitly.
1623 /// For example:
1624 ///
1625 /// ```norust
1626 /// (name = "example-ip-1") AND
1627 /// (createTime > "2021-04-12T08:15:10.40Z") OR
1628 /// (name = "example-ip-2")
1629 /// ```
1630 pub filter: std::string::String,
1631
1632 /// Sorts list results by a certain order. By default, returned results
1633 /// are ordered by `name` in ascending order.
1634 /// You can also sort results in descending order based on the `name` value
1635 /// using `orderBy="name desc"`.
1636 /// Currently, only ordering by `name` is supported.
1637 pub order_by: std::string::String,
1638
1639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1640}
1641
1642impl ListExternalAddressesRequest {
1643 /// Creates a new default instance.
1644 pub fn new() -> Self {
1645 std::default::Default::default()
1646 }
1647
1648 /// Sets the value of [parent][crate::model::ListExternalAddressesRequest::parent].
1649 ///
1650 /// # Example
1651 /// ```ignore,no_run
1652 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1653 /// # let project_id = "project_id";
1654 /// # let location_id = "location_id";
1655 /// # let private_cloud_id = "private_cloud_id";
1656 /// let x = ListExternalAddressesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
1657 /// ```
1658 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1659 self.parent = v.into();
1660 self
1661 }
1662
1663 /// Sets the value of [page_size][crate::model::ListExternalAddressesRequest::page_size].
1664 ///
1665 /// # Example
1666 /// ```ignore,no_run
1667 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1668 /// let x = ListExternalAddressesRequest::new().set_page_size(42);
1669 /// ```
1670 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1671 self.page_size = v.into();
1672 self
1673 }
1674
1675 /// Sets the value of [page_token][crate::model::ListExternalAddressesRequest::page_token].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1680 /// let x = ListExternalAddressesRequest::new().set_page_token("example");
1681 /// ```
1682 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1683 self.page_token = v.into();
1684 self
1685 }
1686
1687 /// Sets the value of [filter][crate::model::ListExternalAddressesRequest::filter].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1692 /// let x = ListExternalAddressesRequest::new().set_filter("example");
1693 /// ```
1694 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1695 self.filter = v.into();
1696 self
1697 }
1698
1699 /// Sets the value of [order_by][crate::model::ListExternalAddressesRequest::order_by].
1700 ///
1701 /// # Example
1702 /// ```ignore,no_run
1703 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesRequest;
1704 /// let x = ListExternalAddressesRequest::new().set_order_by("example");
1705 /// ```
1706 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1707 self.order_by = v.into();
1708 self
1709 }
1710}
1711
1712impl wkt::message::Message for ListExternalAddressesRequest {
1713 fn typename() -> &'static str {
1714 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesRequest"
1715 }
1716}
1717
1718/// Response message for
1719/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
1720///
1721/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
1722#[derive(Clone, Default, PartialEq)]
1723#[non_exhaustive]
1724pub struct ListExternalAddressesResponse {
1725 /// A list of external IP addresses.
1726 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1727
1728 /// A token, which can be sent as `page_token` to retrieve the next page.
1729 /// If this field is omitted, there are no subsequent pages.
1730 pub next_page_token: std::string::String,
1731
1732 /// Locations that could not be reached when making an aggregated query using
1733 /// wildcards.
1734 pub unreachable: std::vec::Vec<std::string::String>,
1735
1736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1737}
1738
1739impl ListExternalAddressesResponse {
1740 /// Creates a new default instance.
1741 pub fn new() -> Self {
1742 std::default::Default::default()
1743 }
1744
1745 /// Sets the value of [external_addresses][crate::model::ListExternalAddressesResponse::external_addresses].
1746 ///
1747 /// # Example
1748 /// ```ignore,no_run
1749 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1750 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1751 /// let x = ListExternalAddressesResponse::new()
1752 /// .set_external_addresses([
1753 /// ExternalAddress::default()/* use setters */,
1754 /// ExternalAddress::default()/* use (different) setters */,
1755 /// ]);
1756 /// ```
1757 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1758 where
1759 T: std::iter::IntoIterator<Item = V>,
1760 V: std::convert::Into<crate::model::ExternalAddress>,
1761 {
1762 use std::iter::Iterator;
1763 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1764 self
1765 }
1766
1767 /// Sets the value of [next_page_token][crate::model::ListExternalAddressesResponse::next_page_token].
1768 ///
1769 /// # Example
1770 /// ```ignore,no_run
1771 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1772 /// let x = ListExternalAddressesResponse::new().set_next_page_token("example");
1773 /// ```
1774 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1775 self.next_page_token = v.into();
1776 self
1777 }
1778
1779 /// Sets the value of [unreachable][crate::model::ListExternalAddressesResponse::unreachable].
1780 ///
1781 /// # Example
1782 /// ```ignore,no_run
1783 /// # use google_cloud_vmwareengine_v1::model::ListExternalAddressesResponse;
1784 /// let x = ListExternalAddressesResponse::new().set_unreachable(["a", "b", "c"]);
1785 /// ```
1786 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1787 where
1788 T: std::iter::IntoIterator<Item = V>,
1789 V: std::convert::Into<std::string::String>,
1790 {
1791 use std::iter::Iterator;
1792 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1793 self
1794 }
1795}
1796
1797impl wkt::message::Message for ListExternalAddressesResponse {
1798 fn typename() -> &'static str {
1799 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesResponse"
1800 }
1801}
1802
1803#[doc(hidden)]
1804impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAddressesResponse {
1805 type PageItem = crate::model::ExternalAddress;
1806
1807 fn items(self) -> std::vec::Vec<Self::PageItem> {
1808 self.external_addresses
1809 }
1810
1811 fn next_page_token(&self) -> std::string::String {
1812 use std::clone::Clone;
1813 self.next_page_token.clone()
1814 }
1815}
1816
1817/// Request message for
1818/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1819///
1820/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1821#[derive(Clone, Default, PartialEq)]
1822#[non_exhaustive]
1823pub struct FetchNetworkPolicyExternalAddressesRequest {
1824 /// Required. The resource name of the network policy to query for assigned
1825 /// external IP addresses. Resource names are schemeless URIs that follow the
1826 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
1827 /// example:
1828 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
1829 pub network_policy: std::string::String,
1830
1831 /// The maximum number of external IP addresses to return in one page.
1832 /// The service may return fewer than this value.
1833 /// The maximum value is coerced to 1000.
1834 /// The default value of this field is 500.
1835 pub page_size: i32,
1836
1837 /// A page token, received from a previous
1838 /// `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the
1839 /// subsequent page.
1840 ///
1841 /// When paginating, all parameters provided to
1842 /// `FetchNetworkPolicyExternalAddresses`, except for `page_size` and
1843 /// `page_token`, must match the call that provided the page token.
1844 pub page_token: std::string::String,
1845
1846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1847}
1848
1849impl FetchNetworkPolicyExternalAddressesRequest {
1850 /// Creates a new default instance.
1851 pub fn new() -> Self {
1852 std::default::Default::default()
1853 }
1854
1855 /// Sets the value of [network_policy][crate::model::FetchNetworkPolicyExternalAddressesRequest::network_policy].
1856 ///
1857 /// # Example
1858 /// ```ignore,no_run
1859 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1860 /// # let project_id = "project_id";
1861 /// # let location_id = "location_id";
1862 /// # let network_policy_id = "network_policy_id";
1863 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_network_policy(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
1864 /// ```
1865 pub fn set_network_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.network_policy = v.into();
1867 self
1868 }
1869
1870 /// Sets the value of [page_size][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_size].
1871 ///
1872 /// # Example
1873 /// ```ignore,no_run
1874 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1875 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_size(42);
1876 /// ```
1877 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1878 self.page_size = v.into();
1879 self
1880 }
1881
1882 /// Sets the value of [page_token][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_token].
1883 ///
1884 /// # Example
1885 /// ```ignore,no_run
1886 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesRequest;
1887 /// let x = FetchNetworkPolicyExternalAddressesRequest::new().set_page_token("example");
1888 /// ```
1889 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1890 self.page_token = v.into();
1891 self
1892 }
1893}
1894
1895impl wkt::message::Message for FetchNetworkPolicyExternalAddressesRequest {
1896 fn typename() -> &'static str {
1897 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest"
1898 }
1899}
1900
1901/// Response message for
1902/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
1903///
1904/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
1905#[derive(Clone, Default, PartialEq)]
1906#[non_exhaustive]
1907pub struct FetchNetworkPolicyExternalAddressesResponse {
1908 /// A list of external IP addresses assigned to VMware workload VMs within the
1909 /// scope of the given network policy.
1910 pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
1911
1912 /// A token, which can be sent as `page_token` to retrieve the next page.
1913 /// If this field is omitted, there are no subsequent pages.
1914 pub next_page_token: std::string::String,
1915
1916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1917}
1918
1919impl FetchNetworkPolicyExternalAddressesResponse {
1920 /// Creates a new default instance.
1921 pub fn new() -> Self {
1922 std::default::Default::default()
1923 }
1924
1925 /// Sets the value of [external_addresses][crate::model::FetchNetworkPolicyExternalAddressesResponse::external_addresses].
1926 ///
1927 /// # Example
1928 /// ```ignore,no_run
1929 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1930 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
1931 /// let x = FetchNetworkPolicyExternalAddressesResponse::new()
1932 /// .set_external_addresses([
1933 /// ExternalAddress::default()/* use setters */,
1934 /// ExternalAddress::default()/* use (different) setters */,
1935 /// ]);
1936 /// ```
1937 pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
1938 where
1939 T: std::iter::IntoIterator<Item = V>,
1940 V: std::convert::Into<crate::model::ExternalAddress>,
1941 {
1942 use std::iter::Iterator;
1943 self.external_addresses = v.into_iter().map(|i| i.into()).collect();
1944 self
1945 }
1946
1947 /// Sets the value of [next_page_token][crate::model::FetchNetworkPolicyExternalAddressesResponse::next_page_token].
1948 ///
1949 /// # Example
1950 /// ```ignore,no_run
1951 /// # use google_cloud_vmwareengine_v1::model::FetchNetworkPolicyExternalAddressesResponse;
1952 /// let x = FetchNetworkPolicyExternalAddressesResponse::new().set_next_page_token("example");
1953 /// ```
1954 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1955 self.next_page_token = v.into();
1956 self
1957 }
1958}
1959
1960impl wkt::message::Message for FetchNetworkPolicyExternalAddressesResponse {
1961 fn typename() -> &'static str {
1962 "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse"
1963 }
1964}
1965
1966#[doc(hidden)]
1967impl google_cloud_gax::paginator::internal::PageableResponse
1968 for FetchNetworkPolicyExternalAddressesResponse
1969{
1970 type PageItem = crate::model::ExternalAddress;
1971
1972 fn items(self) -> std::vec::Vec<Self::PageItem> {
1973 self.external_addresses
1974 }
1975
1976 fn next_page_token(&self) -> std::string::String {
1977 use std::clone::Clone;
1978 self.next_page_token.clone()
1979 }
1980}
1981
1982/// Request message for
1983/// [VmwareEngine.GetExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]
1984///
1985/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]: crate::client::VmwareEngine::get_external_address
1986#[derive(Clone, Default, PartialEq)]
1987#[non_exhaustive]
1988pub struct GetExternalAddressRequest {
1989 /// Required. The resource name of the external IP address to retrieve.
1990 /// Resource names are schemeless URIs that follow the conventions in
1991 /// <https://cloud.google.com/apis/design/resource_names>.
1992 /// For example:
1993 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
1994 pub name: std::string::String,
1995
1996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1997}
1998
1999impl GetExternalAddressRequest {
2000 /// Creates a new default instance.
2001 pub fn new() -> Self {
2002 std::default::Default::default()
2003 }
2004
2005 /// Sets the value of [name][crate::model::GetExternalAddressRequest::name].
2006 ///
2007 /// # Example
2008 /// ```ignore,no_run
2009 /// # use google_cloud_vmwareengine_v1::model::GetExternalAddressRequest;
2010 /// # let project_id = "project_id";
2011 /// # let location_id = "location_id";
2012 /// # let private_cloud_id = "private_cloud_id";
2013 /// # let external_address_id = "external_address_id";
2014 /// let x = GetExternalAddressRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/externalAddresses/{external_address_id}"));
2015 /// ```
2016 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2017 self.name = v.into();
2018 self
2019 }
2020}
2021
2022impl wkt::message::Message for GetExternalAddressRequest {
2023 fn typename() -> &'static str {
2024 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAddressRequest"
2025 }
2026}
2027
2028/// Request message for
2029/// [VmwareEngine.CreateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]
2030///
2031/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]: crate::client::VmwareEngine::create_external_address
2032#[derive(Clone, Default, PartialEq)]
2033#[non_exhaustive]
2034pub struct CreateExternalAddressRequest {
2035 /// Required. The resource name of the private cloud
2036 /// to create a new external IP address in.
2037 /// Resource names are schemeless URIs that follow the conventions in
2038 /// <https://cloud.google.com/apis/design/resource_names>.
2039 /// For example:
2040 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2041 pub parent: std::string::String,
2042
2043 /// Required. The initial description of a new external IP address.
2044 pub external_address: std::option::Option<crate::model::ExternalAddress>,
2045
2046 /// Required. The user-provided identifier of the `ExternalAddress` to be
2047 /// created. This identifier must be unique among `ExternalAddress` resources
2048 /// within the parent and becomes the final token in the name URI. The
2049 /// identifier must meet the following requirements:
2050 ///
2051 /// * Only contains 1-63 alphanumeric characters and hyphens
2052 /// * Begins with an alphabetical character
2053 /// * Ends with a non-hyphen character
2054 /// * Not formatted as a UUID
2055 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2056 /// (section 3.5)
2057 pub external_address_id: std::string::String,
2058
2059 /// Optional. A request ID to identify requests. Specify a unique request ID
2060 /// so that if you must retry your request, the server will know to ignore
2061 /// the request if it has already been completed. The server guarantees that a
2062 /// request doesn't result in creation of duplicate commitments for at least 60
2063 /// minutes.
2064 ///
2065 /// For example, consider a situation where you make an initial request and the
2066 /// request times out. If you make the request again with the same request ID,
2067 /// the server can check if the original operation with the same request ID was
2068 /// received, and if so, will ignore the second request. This prevents clients
2069 /// from accidentally creating duplicate commitments.
2070 ///
2071 /// The request ID must be a valid UUID with the exception that zero UUID is
2072 /// not supported (00000000-0000-0000-0000-000000000000).
2073 pub request_id: std::string::String,
2074
2075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2076}
2077
2078impl CreateExternalAddressRequest {
2079 /// Creates a new default instance.
2080 pub fn new() -> Self {
2081 std::default::Default::default()
2082 }
2083
2084 /// Sets the value of [parent][crate::model::CreateExternalAddressRequest::parent].
2085 ///
2086 /// # Example
2087 /// ```ignore,no_run
2088 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2089 /// # let project_id = "project_id";
2090 /// # let location_id = "location_id";
2091 /// # let private_cloud_id = "private_cloud_id";
2092 /// let x = CreateExternalAddressRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
2093 /// ```
2094 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2095 self.parent = v.into();
2096 self
2097 }
2098
2099 /// Sets the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2100 ///
2101 /// # Example
2102 /// ```ignore,no_run
2103 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2104 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2105 /// let x = CreateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2106 /// ```
2107 pub fn set_external_address<T>(mut self, v: T) -> Self
2108 where
2109 T: std::convert::Into<crate::model::ExternalAddress>,
2110 {
2111 self.external_address = std::option::Option::Some(v.into());
2112 self
2113 }
2114
2115 /// Sets or clears the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
2116 ///
2117 /// # Example
2118 /// ```ignore,no_run
2119 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2120 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2121 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2122 /// let x = CreateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2123 /// ```
2124 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2125 where
2126 T: std::convert::Into<crate::model::ExternalAddress>,
2127 {
2128 self.external_address = v.map(|x| x.into());
2129 self
2130 }
2131
2132 /// Sets the value of [external_address_id][crate::model::CreateExternalAddressRequest::external_address_id].
2133 ///
2134 /// # Example
2135 /// ```ignore,no_run
2136 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2137 /// let x = CreateExternalAddressRequest::new().set_external_address_id("example");
2138 /// ```
2139 pub fn set_external_address_id<T: std::convert::Into<std::string::String>>(
2140 mut self,
2141 v: T,
2142 ) -> Self {
2143 self.external_address_id = v.into();
2144 self
2145 }
2146
2147 /// Sets the value of [request_id][crate::model::CreateExternalAddressRequest::request_id].
2148 ///
2149 /// # Example
2150 /// ```ignore,no_run
2151 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAddressRequest;
2152 /// let x = CreateExternalAddressRequest::new().set_request_id("example");
2153 /// ```
2154 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2155 self.request_id = v.into();
2156 self
2157 }
2158}
2159
2160impl wkt::message::Message for CreateExternalAddressRequest {
2161 fn typename() -> &'static str {
2162 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAddressRequest"
2163 }
2164}
2165
2166/// Request message for
2167/// [VmwareEngine.UpdateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]
2168///
2169/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]: crate::client::VmwareEngine::update_external_address
2170#[derive(Clone, Default, PartialEq)]
2171#[non_exhaustive]
2172pub struct UpdateExternalAddressRequest {
2173 /// Required. Field mask is used to specify the fields to be overwritten in the
2174 /// `ExternalAddress` resource by the update.
2175 /// The fields specified in the `update_mask` are relative to the resource, not
2176 /// the full request. A field will be overwritten if it is in the mask. If the
2177 /// user does not provide a mask then all fields will be overwritten.
2178 pub update_mask: std::option::Option<wkt::FieldMask>,
2179
2180 /// Required. External IP address description.
2181 pub external_address: std::option::Option<crate::model::ExternalAddress>,
2182
2183 /// Optional. A request ID to identify requests. Specify a unique request ID
2184 /// so that if you must retry your request, the server will know to ignore
2185 /// the request if it has already been completed. The server guarantees that a
2186 /// request doesn't result in creation of duplicate commitments for at least 60
2187 /// minutes.
2188 ///
2189 /// For example, consider a situation where you make an initial request and the
2190 /// request times out. If you make the request again with the same request ID,
2191 /// the server can check if the original operation with the same request ID was
2192 /// received, and if so, will ignore the second request. This prevents clients
2193 /// from accidentally creating duplicate commitments.
2194 ///
2195 /// The request ID must be a valid UUID with the exception that zero UUID is
2196 /// not supported (00000000-0000-0000-0000-000000000000).
2197 pub request_id: std::string::String,
2198
2199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2200}
2201
2202impl UpdateExternalAddressRequest {
2203 /// Creates a new default instance.
2204 pub fn new() -> Self {
2205 std::default::Default::default()
2206 }
2207
2208 /// Sets the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2209 ///
2210 /// # Example
2211 /// ```ignore,no_run
2212 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2213 /// use wkt::FieldMask;
2214 /// let x = UpdateExternalAddressRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2215 /// ```
2216 pub fn set_update_mask<T>(mut self, v: T) -> Self
2217 where
2218 T: std::convert::Into<wkt::FieldMask>,
2219 {
2220 self.update_mask = std::option::Option::Some(v.into());
2221 self
2222 }
2223
2224 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
2225 ///
2226 /// # Example
2227 /// ```ignore,no_run
2228 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2229 /// use wkt::FieldMask;
2230 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2231 /// let x = UpdateExternalAddressRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2232 /// ```
2233 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2234 where
2235 T: std::convert::Into<wkt::FieldMask>,
2236 {
2237 self.update_mask = v.map(|x| x.into());
2238 self
2239 }
2240
2241 /// Sets the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2242 ///
2243 /// # Example
2244 /// ```ignore,no_run
2245 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2246 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2247 /// let x = UpdateExternalAddressRequest::new().set_external_address(ExternalAddress::default()/* use setters */);
2248 /// ```
2249 pub fn set_external_address<T>(mut self, v: T) -> Self
2250 where
2251 T: std::convert::Into<crate::model::ExternalAddress>,
2252 {
2253 self.external_address = std::option::Option::Some(v.into());
2254 self
2255 }
2256
2257 /// Sets or clears the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
2258 ///
2259 /// # Example
2260 /// ```ignore,no_run
2261 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2262 /// use google_cloud_vmwareengine_v1::model::ExternalAddress;
2263 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(Some(ExternalAddress::default()/* use setters */));
2264 /// let x = UpdateExternalAddressRequest::new().set_or_clear_external_address(None::<ExternalAddress>);
2265 /// ```
2266 pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
2267 where
2268 T: std::convert::Into<crate::model::ExternalAddress>,
2269 {
2270 self.external_address = v.map(|x| x.into());
2271 self
2272 }
2273
2274 /// Sets the value of [request_id][crate::model::UpdateExternalAddressRequest::request_id].
2275 ///
2276 /// # Example
2277 /// ```ignore,no_run
2278 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAddressRequest;
2279 /// let x = UpdateExternalAddressRequest::new().set_request_id("example");
2280 /// ```
2281 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.request_id = v.into();
2283 self
2284 }
2285}
2286
2287impl wkt::message::Message for UpdateExternalAddressRequest {
2288 fn typename() -> &'static str {
2289 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAddressRequest"
2290 }
2291}
2292
2293/// Request message for
2294/// [VmwareEngine.DeleteExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]
2295///
2296/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]: crate::client::VmwareEngine::delete_external_address
2297#[derive(Clone, Default, PartialEq)]
2298#[non_exhaustive]
2299pub struct DeleteExternalAddressRequest {
2300 /// Required. The resource name of the external IP address to delete.
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/externalAddresses/my-ip`
2305 pub name: std::string::String,
2306
2307 /// Optional. A request ID to identify requests. Specify a unique request ID
2308 /// so that if you must retry your request, the server will know to ignore
2309 /// the request if it has already been completed. The server guarantees that a
2310 /// request doesn't result in creation of duplicate commitments for at least 60
2311 /// minutes.
2312 ///
2313 /// For example, consider a situation where you make an initial request and the
2314 /// request times out. If you make the request again with the same request
2315 /// ID, the server can check if the original operation with the same request ID
2316 /// was received, and if so, will ignore the second request. This prevents
2317 /// clients from accidentally creating duplicate commitments.
2318 ///
2319 /// The request ID must be a valid UUID with the exception that zero UUID is
2320 /// not supported (00000000-0000-0000-0000-000000000000).
2321 pub request_id: std::string::String,
2322
2323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2324}
2325
2326impl DeleteExternalAddressRequest {
2327 /// Creates a new default instance.
2328 pub fn new() -> Self {
2329 std::default::Default::default()
2330 }
2331
2332 /// Sets the value of [name][crate::model::DeleteExternalAddressRequest::name].
2333 ///
2334 /// # Example
2335 /// ```ignore,no_run
2336 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2337 /// # let project_id = "project_id";
2338 /// # let location_id = "location_id";
2339 /// # let private_cloud_id = "private_cloud_id";
2340 /// # let external_address_id = "external_address_id";
2341 /// let x = DeleteExternalAddressRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/externalAddresses/{external_address_id}"));
2342 /// ```
2343 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2344 self.name = v.into();
2345 self
2346 }
2347
2348 /// Sets the value of [request_id][crate::model::DeleteExternalAddressRequest::request_id].
2349 ///
2350 /// # Example
2351 /// ```ignore,no_run
2352 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAddressRequest;
2353 /// let x = DeleteExternalAddressRequest::new().set_request_id("example");
2354 /// ```
2355 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2356 self.request_id = v.into();
2357 self
2358 }
2359}
2360
2361impl wkt::message::Message for DeleteExternalAddressRequest {
2362 fn typename() -> &'static str {
2363 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAddressRequest"
2364 }
2365}
2366
2367/// Request message for
2368/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2369///
2370/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2371#[derive(Clone, Default, PartialEq)]
2372#[non_exhaustive]
2373pub struct ListSubnetsRequest {
2374 /// Required. The resource name of the private cloud to be queried for
2375 /// subnets.
2376 /// Resource names are schemeless URIs that follow the conventions in
2377 /// <https://cloud.google.com/apis/design/resource_names>.
2378 /// For example:
2379 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2380 pub parent: std::string::String,
2381
2382 /// The maximum number of subnets to return in one page.
2383 /// The service may return fewer than this value.
2384 /// The maximum value is coerced to 1000.
2385 /// The default value of this field is 500.
2386 pub page_size: i32,
2387
2388 /// A page token, received from a previous `ListSubnetsRequest` call.
2389 /// Provide this to retrieve the subsequent page.
2390 ///
2391 /// When paginating, all other parameters provided to
2392 /// `ListSubnetsRequest` must match the call that provided the page token.
2393 pub page_token: std::string::String,
2394
2395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2396}
2397
2398impl ListSubnetsRequest {
2399 /// Creates a new default instance.
2400 pub fn new() -> Self {
2401 std::default::Default::default()
2402 }
2403
2404 /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
2405 ///
2406 /// # Example
2407 /// ```ignore,no_run
2408 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2409 /// # let project_id = "project_id";
2410 /// # let location_id = "location_id";
2411 /// # let private_cloud_id = "private_cloud_id";
2412 /// let x = ListSubnetsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
2413 /// ```
2414 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.parent = v.into();
2416 self
2417 }
2418
2419 /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2424 /// let x = ListSubnetsRequest::new().set_page_size(42);
2425 /// ```
2426 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2427 self.page_size = v.into();
2428 self
2429 }
2430
2431 /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
2432 ///
2433 /// # Example
2434 /// ```ignore,no_run
2435 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsRequest;
2436 /// let x = ListSubnetsRequest::new().set_page_token("example");
2437 /// ```
2438 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2439 self.page_token = v.into();
2440 self
2441 }
2442}
2443
2444impl wkt::message::Message for ListSubnetsRequest {
2445 fn typename() -> &'static str {
2446 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsRequest"
2447 }
2448}
2449
2450/// Response message for
2451/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
2452///
2453/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
2454#[derive(Clone, Default, PartialEq)]
2455#[non_exhaustive]
2456pub struct ListSubnetsResponse {
2457 /// A list of subnets.
2458 pub subnets: std::vec::Vec<crate::model::Subnet>,
2459
2460 /// A token, which can be sent as `page_token` to retrieve the next page.
2461 /// If this field is omitted, there are no subsequent pages.
2462 pub next_page_token: std::string::String,
2463
2464 /// Locations that could not be reached when making an aggregated query using
2465 /// wildcards.
2466 pub unreachable: std::vec::Vec<std::string::String>,
2467
2468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2469}
2470
2471impl ListSubnetsResponse {
2472 /// Creates a new default instance.
2473 pub fn new() -> Self {
2474 std::default::Default::default()
2475 }
2476
2477 /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2482 /// use google_cloud_vmwareengine_v1::model::Subnet;
2483 /// let x = ListSubnetsResponse::new()
2484 /// .set_subnets([
2485 /// Subnet::default()/* use setters */,
2486 /// Subnet::default()/* use (different) setters */,
2487 /// ]);
2488 /// ```
2489 pub fn set_subnets<T, V>(mut self, v: T) -> Self
2490 where
2491 T: std::iter::IntoIterator<Item = V>,
2492 V: std::convert::Into<crate::model::Subnet>,
2493 {
2494 use std::iter::Iterator;
2495 self.subnets = v.into_iter().map(|i| i.into()).collect();
2496 self
2497 }
2498
2499 /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
2500 ///
2501 /// # Example
2502 /// ```ignore,no_run
2503 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2504 /// let x = ListSubnetsResponse::new().set_next_page_token("example");
2505 /// ```
2506 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2507 self.next_page_token = v.into();
2508 self
2509 }
2510
2511 /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
2512 ///
2513 /// # Example
2514 /// ```ignore,no_run
2515 /// # use google_cloud_vmwareengine_v1::model::ListSubnetsResponse;
2516 /// let x = ListSubnetsResponse::new().set_unreachable(["a", "b", "c"]);
2517 /// ```
2518 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2519 where
2520 T: std::iter::IntoIterator<Item = V>,
2521 V: std::convert::Into<std::string::String>,
2522 {
2523 use std::iter::Iterator;
2524 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2525 self
2526 }
2527}
2528
2529impl wkt::message::Message for ListSubnetsResponse {
2530 fn typename() -> &'static str {
2531 "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsResponse"
2532 }
2533}
2534
2535#[doc(hidden)]
2536impl google_cloud_gax::paginator::internal::PageableResponse for ListSubnetsResponse {
2537 type PageItem = crate::model::Subnet;
2538
2539 fn items(self) -> std::vec::Vec<Self::PageItem> {
2540 self.subnets
2541 }
2542
2543 fn next_page_token(&self) -> std::string::String {
2544 use std::clone::Clone;
2545 self.next_page_token.clone()
2546 }
2547}
2548
2549/// Request message for
2550/// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]
2551///
2552/// [google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]: crate::client::VmwareEngine::get_subnet
2553#[derive(Clone, Default, PartialEq)]
2554#[non_exhaustive]
2555pub struct GetSubnetRequest {
2556 /// Required. The resource name of the subnet to retrieve.
2557 /// Resource names are schemeless URIs that follow the conventions in
2558 /// <https://cloud.google.com/apis/design/resource_names>.
2559 /// For example:
2560 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
2561 pub name: std::string::String,
2562
2563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl GetSubnetRequest {
2567 /// Creates a new default instance.
2568 pub fn new() -> Self {
2569 std::default::Default::default()
2570 }
2571
2572 /// Sets the value of [name][crate::model::GetSubnetRequest::name].
2573 ///
2574 /// # Example
2575 /// ```ignore,no_run
2576 /// # use google_cloud_vmwareengine_v1::model::GetSubnetRequest;
2577 /// # let project_id = "project_id";
2578 /// # let location_id = "location_id";
2579 /// # let private_cloud_id = "private_cloud_id";
2580 /// # let subnet_id = "subnet_id";
2581 /// let x = GetSubnetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/subnets/{subnet_id}"));
2582 /// ```
2583 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2584 self.name = v.into();
2585 self
2586 }
2587}
2588
2589impl wkt::message::Message for GetSubnetRequest {
2590 fn typename() -> &'static str {
2591 "type.googleapis.com/google.cloud.vmwareengine.v1.GetSubnetRequest"
2592 }
2593}
2594
2595/// Request message for
2596/// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]
2597///
2598/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]: crate::client::VmwareEngine::update_subnet
2599#[derive(Clone, Default, PartialEq)]
2600#[non_exhaustive]
2601pub struct UpdateSubnetRequest {
2602 /// Required. Field mask is used to specify the fields to be overwritten in the
2603 /// `Subnet` resource by the update.
2604 /// The fields specified in the `update_mask` are relative to the resource, not
2605 /// the full request. A field will be overwritten if it is in the mask. If the
2606 /// user does not provide a mask then all fields will be overwritten.
2607 pub update_mask: std::option::Option<wkt::FieldMask>,
2608
2609 /// Required. Subnet description.
2610 pub subnet: std::option::Option<crate::model::Subnet>,
2611
2612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2613}
2614
2615impl UpdateSubnetRequest {
2616 /// Creates a new default instance.
2617 pub fn new() -> Self {
2618 std::default::Default::default()
2619 }
2620
2621 /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2622 ///
2623 /// # Example
2624 /// ```ignore,no_run
2625 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2626 /// use wkt::FieldMask;
2627 /// let x = UpdateSubnetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2628 /// ```
2629 pub fn set_update_mask<T>(mut self, v: T) -> Self
2630 where
2631 T: std::convert::Into<wkt::FieldMask>,
2632 {
2633 self.update_mask = std::option::Option::Some(v.into());
2634 self
2635 }
2636
2637 /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
2638 ///
2639 /// # Example
2640 /// ```ignore,no_run
2641 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2642 /// use wkt::FieldMask;
2643 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2644 /// let x = UpdateSubnetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2645 /// ```
2646 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2647 where
2648 T: std::convert::Into<wkt::FieldMask>,
2649 {
2650 self.update_mask = v.map(|x| x.into());
2651 self
2652 }
2653
2654 /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2655 ///
2656 /// # Example
2657 /// ```ignore,no_run
2658 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2659 /// use google_cloud_vmwareengine_v1::model::Subnet;
2660 /// let x = UpdateSubnetRequest::new().set_subnet(Subnet::default()/* use setters */);
2661 /// ```
2662 pub fn set_subnet<T>(mut self, v: T) -> Self
2663 where
2664 T: std::convert::Into<crate::model::Subnet>,
2665 {
2666 self.subnet = std::option::Option::Some(v.into());
2667 self
2668 }
2669
2670 /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
2671 ///
2672 /// # Example
2673 /// ```ignore,no_run
2674 /// # use google_cloud_vmwareengine_v1::model::UpdateSubnetRequest;
2675 /// use google_cloud_vmwareengine_v1::model::Subnet;
2676 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(Some(Subnet::default()/* use setters */));
2677 /// let x = UpdateSubnetRequest::new().set_or_clear_subnet(None::<Subnet>);
2678 /// ```
2679 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
2680 where
2681 T: std::convert::Into<crate::model::Subnet>,
2682 {
2683 self.subnet = v.map(|x| x.into());
2684 self
2685 }
2686}
2687
2688impl wkt::message::Message for UpdateSubnetRequest {
2689 fn typename() -> &'static str {
2690 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateSubnetRequest"
2691 }
2692}
2693
2694/// Request message for
2695/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2696///
2697/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2698#[derive(Clone, Default, PartialEq)]
2699#[non_exhaustive]
2700pub struct ListExternalAccessRulesRequest {
2701 /// Required. The resource name of the network policy to query for external
2702 /// access firewall rules. Resource names are schemeless URIs that follow the
2703 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
2704 /// example:
2705 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2706 pub parent: std::string::String,
2707
2708 /// The maximum number of external access rules to return in one page.
2709 /// The service may return fewer than this value.
2710 /// The maximum value is coerced to 1000.
2711 /// The default value of this field is 500.
2712 pub page_size: i32,
2713
2714 /// A page token, received from a previous `ListExternalAccessRulesRequest`
2715 /// call. Provide this to retrieve the subsequent page.
2716 ///
2717 /// When paginating, all other parameters provided to
2718 /// `ListExternalAccessRulesRequest` must match the call that provided the page
2719 /// token.
2720 pub page_token: std::string::String,
2721
2722 /// A filter expression that matches resources returned in the response.
2723 /// The expression must specify the field name, a comparison
2724 /// operator, and the value that you want to use for filtering. The value
2725 /// must be a string, a number, or a boolean. The comparison operator
2726 /// must be `=`, `!=`, `>`, or `<`.
2727 ///
2728 /// For example, if you are filtering a list of external access rules, you can
2729 /// exclude the ones named `example-rule` by specifying
2730 /// `name != "example-rule"`.
2731 ///
2732 /// To filter on multiple expressions, provide each separate expression within
2733 /// parentheses. For example:
2734 ///
2735 /// ```norust
2736 /// (name = "example-rule")
2737 /// (createTime > "2021-04-12T08:15:10.40Z")
2738 /// ```
2739 ///
2740 /// By default, each expression is an `AND` expression. However, you
2741 /// can include `AND` and `OR` expressions explicitly.
2742 /// For example:
2743 ///
2744 /// ```norust
2745 /// (name = "example-rule-1") AND
2746 /// (createTime > "2021-04-12T08:15:10.40Z") OR
2747 /// (name = "example-rule-2")
2748 /// ```
2749 pub filter: std::string::String,
2750
2751 /// Sorts list results by a certain order. By default, returned results
2752 /// are ordered by `name` in ascending order.
2753 /// You can also sort results in descending order based on the `name` value
2754 /// using `orderBy="name desc"`.
2755 /// Currently, only ordering by `name` is supported.
2756 pub order_by: std::string::String,
2757
2758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2759}
2760
2761impl ListExternalAccessRulesRequest {
2762 /// Creates a new default instance.
2763 pub fn new() -> Self {
2764 std::default::Default::default()
2765 }
2766
2767 /// Sets the value of [parent][crate::model::ListExternalAccessRulesRequest::parent].
2768 ///
2769 /// # Example
2770 /// ```ignore,no_run
2771 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2772 /// # let project_id = "project_id";
2773 /// # let location_id = "location_id";
2774 /// # let network_policy_id = "network_policy_id";
2775 /// let x = ListExternalAccessRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
2776 /// ```
2777 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2778 self.parent = v.into();
2779 self
2780 }
2781
2782 /// Sets the value of [page_size][crate::model::ListExternalAccessRulesRequest::page_size].
2783 ///
2784 /// # Example
2785 /// ```ignore,no_run
2786 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2787 /// let x = ListExternalAccessRulesRequest::new().set_page_size(42);
2788 /// ```
2789 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2790 self.page_size = v.into();
2791 self
2792 }
2793
2794 /// Sets the value of [page_token][crate::model::ListExternalAccessRulesRequest::page_token].
2795 ///
2796 /// # Example
2797 /// ```ignore,no_run
2798 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2799 /// let x = ListExternalAccessRulesRequest::new().set_page_token("example");
2800 /// ```
2801 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.page_token = v.into();
2803 self
2804 }
2805
2806 /// Sets the value of [filter][crate::model::ListExternalAccessRulesRequest::filter].
2807 ///
2808 /// # Example
2809 /// ```ignore,no_run
2810 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2811 /// let x = ListExternalAccessRulesRequest::new().set_filter("example");
2812 /// ```
2813 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2814 self.filter = v.into();
2815 self
2816 }
2817
2818 /// Sets the value of [order_by][crate::model::ListExternalAccessRulesRequest::order_by].
2819 ///
2820 /// # Example
2821 /// ```ignore,no_run
2822 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesRequest;
2823 /// let x = ListExternalAccessRulesRequest::new().set_order_by("example");
2824 /// ```
2825 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.order_by = v.into();
2827 self
2828 }
2829}
2830
2831impl wkt::message::Message for ListExternalAccessRulesRequest {
2832 fn typename() -> &'static str {
2833 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest"
2834 }
2835}
2836
2837/// Response message for
2838/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
2839///
2840/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
2841#[derive(Clone, Default, PartialEq)]
2842#[non_exhaustive]
2843pub struct ListExternalAccessRulesResponse {
2844 /// A list of external access firewall rules.
2845 pub external_access_rules: std::vec::Vec<crate::model::ExternalAccessRule>,
2846
2847 /// A token, which can be sent as `page_token` to retrieve the next page.
2848 /// If this field is omitted, there are no subsequent pages.
2849 pub next_page_token: std::string::String,
2850
2851 /// Locations that could not be reached when making an aggregated query using
2852 /// wildcards.
2853 pub unreachable: std::vec::Vec<std::string::String>,
2854
2855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2856}
2857
2858impl ListExternalAccessRulesResponse {
2859 /// Creates a new default instance.
2860 pub fn new() -> Self {
2861 std::default::Default::default()
2862 }
2863
2864 /// Sets the value of [external_access_rules][crate::model::ListExternalAccessRulesResponse::external_access_rules].
2865 ///
2866 /// # Example
2867 /// ```ignore,no_run
2868 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2869 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
2870 /// let x = ListExternalAccessRulesResponse::new()
2871 /// .set_external_access_rules([
2872 /// ExternalAccessRule::default()/* use setters */,
2873 /// ExternalAccessRule::default()/* use (different) setters */,
2874 /// ]);
2875 /// ```
2876 pub fn set_external_access_rules<T, V>(mut self, v: T) -> Self
2877 where
2878 T: std::iter::IntoIterator<Item = V>,
2879 V: std::convert::Into<crate::model::ExternalAccessRule>,
2880 {
2881 use std::iter::Iterator;
2882 self.external_access_rules = v.into_iter().map(|i| i.into()).collect();
2883 self
2884 }
2885
2886 /// Sets the value of [next_page_token][crate::model::ListExternalAccessRulesResponse::next_page_token].
2887 ///
2888 /// # Example
2889 /// ```ignore,no_run
2890 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2891 /// let x = ListExternalAccessRulesResponse::new().set_next_page_token("example");
2892 /// ```
2893 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2894 self.next_page_token = v.into();
2895 self
2896 }
2897
2898 /// Sets the value of [unreachable][crate::model::ListExternalAccessRulesResponse::unreachable].
2899 ///
2900 /// # Example
2901 /// ```ignore,no_run
2902 /// # use google_cloud_vmwareengine_v1::model::ListExternalAccessRulesResponse;
2903 /// let x = ListExternalAccessRulesResponse::new().set_unreachable(["a", "b", "c"]);
2904 /// ```
2905 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2906 where
2907 T: std::iter::IntoIterator<Item = V>,
2908 V: std::convert::Into<std::string::String>,
2909 {
2910 use std::iter::Iterator;
2911 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2912 self
2913 }
2914}
2915
2916impl wkt::message::Message for ListExternalAccessRulesResponse {
2917 fn typename() -> &'static str {
2918 "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse"
2919 }
2920}
2921
2922#[doc(hidden)]
2923impl google_cloud_gax::paginator::internal::PageableResponse for ListExternalAccessRulesResponse {
2924 type PageItem = crate::model::ExternalAccessRule;
2925
2926 fn items(self) -> std::vec::Vec<Self::PageItem> {
2927 self.external_access_rules
2928 }
2929
2930 fn next_page_token(&self) -> std::string::String {
2931 use std::clone::Clone;
2932 self.next_page_token.clone()
2933 }
2934}
2935
2936/// Request message for
2937/// [VmwareEngine.GetExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]
2938///
2939/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]: crate::client::VmwareEngine::get_external_access_rule
2940#[derive(Clone, Default, PartialEq)]
2941#[non_exhaustive]
2942pub struct GetExternalAccessRuleRequest {
2943 /// Required. The resource name of the external access firewall rule to
2944 /// retrieve. Resource names are schemeless URIs that follow the conventions in
2945 /// <https://cloud.google.com/apis/design/resource_names>.
2946 /// For example:
2947 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
2948 pub name: std::string::String,
2949
2950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2951}
2952
2953impl GetExternalAccessRuleRequest {
2954 /// Creates a new default instance.
2955 pub fn new() -> Self {
2956 std::default::Default::default()
2957 }
2958
2959 /// Sets the value of [name][crate::model::GetExternalAccessRuleRequest::name].
2960 ///
2961 /// # Example
2962 /// ```ignore,no_run
2963 /// # use google_cloud_vmwareengine_v1::model::GetExternalAccessRuleRequest;
2964 /// # let project_id = "project_id";
2965 /// # let location_id = "location_id";
2966 /// # let network_policy_id = "network_policy_id";
2967 /// # let external_access_rule_id = "external_access_rule_id";
2968 /// let x = GetExternalAccessRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}/externalAccessRules/{external_access_rule_id}"));
2969 /// ```
2970 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2971 self.name = v.into();
2972 self
2973 }
2974}
2975
2976impl wkt::message::Message for GetExternalAccessRuleRequest {
2977 fn typename() -> &'static str {
2978 "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest"
2979 }
2980}
2981
2982/// Request message for
2983/// [VmwareEngine.CreateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]
2984///
2985/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]: crate::client::VmwareEngine::create_external_access_rule
2986#[derive(Clone, Default, PartialEq)]
2987#[non_exhaustive]
2988pub struct CreateExternalAccessRuleRequest {
2989 /// Required. The resource name of the network policy
2990 /// to create a new external access firewall rule in.
2991 /// Resource names are schemeless URIs that follow the conventions in
2992 /// <https://cloud.google.com/apis/design/resource_names>.
2993 /// For example:
2994 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
2995 pub parent: std::string::String,
2996
2997 /// Required. The initial description of a new external access rule.
2998 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
2999
3000 /// Required. The user-provided identifier of the `ExternalAccessRule` to be
3001 /// created. This identifier must be unique among `ExternalAccessRule`
3002 /// resources within the parent and becomes the final token in the name URI.
3003 /// The identifier must meet the following requirements:
3004 ///
3005 /// * Only contains 1-63 alphanumeric characters and hyphens
3006 /// * Begins with an alphabetical character
3007 /// * Ends with a non-hyphen character
3008 /// * Not formatted as a UUID
3009 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3010 /// (section 3.5)
3011 pub external_access_rule_id: std::string::String,
3012
3013 /// A request ID to identify requests. Specify a unique request ID
3014 /// so that if you must retry your request, the server will know to ignore
3015 /// the request if it has already been completed. The server guarantees that a
3016 /// request doesn't result in creation of duplicate commitments for at least 60
3017 /// minutes.
3018 ///
3019 /// For example, consider a situation where you make an initial request and the
3020 /// request times out. If you make the request again with the same request ID,
3021 /// the server can check if the original operation with the same request ID was
3022 /// received, and if so, will ignore the second request. This prevents clients
3023 /// from accidentally creating duplicate commitments.
3024 ///
3025 /// The request ID must be a valid UUID with the exception that zero UUID is
3026 /// not supported (00000000-0000-0000-0000-000000000000).
3027 pub request_id: std::string::String,
3028
3029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3030}
3031
3032impl CreateExternalAccessRuleRequest {
3033 /// Creates a new default instance.
3034 pub fn new() -> Self {
3035 std::default::Default::default()
3036 }
3037
3038 /// Sets the value of [parent][crate::model::CreateExternalAccessRuleRequest::parent].
3039 ///
3040 /// # Example
3041 /// ```ignore,no_run
3042 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3043 /// # let project_id = "project_id";
3044 /// # let location_id = "location_id";
3045 /// # let network_policy_id = "network_policy_id";
3046 /// let x = CreateExternalAccessRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
3047 /// ```
3048 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3049 self.parent = v.into();
3050 self
3051 }
3052
3053 /// Sets the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
3054 ///
3055 /// # Example
3056 /// ```ignore,no_run
3057 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3058 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3059 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
3060 /// ```
3061 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
3062 where
3063 T: std::convert::Into<crate::model::ExternalAccessRule>,
3064 {
3065 self.external_access_rule = std::option::Option::Some(v.into());
3066 self
3067 }
3068
3069 /// Sets or clears the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
3070 ///
3071 /// # Example
3072 /// ```ignore,no_run
3073 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3074 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3075 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
3076 /// let x = CreateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
3077 /// ```
3078 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
3079 where
3080 T: std::convert::Into<crate::model::ExternalAccessRule>,
3081 {
3082 self.external_access_rule = v.map(|x| x.into());
3083 self
3084 }
3085
3086 /// Sets the value of [external_access_rule_id][crate::model::CreateExternalAccessRuleRequest::external_access_rule_id].
3087 ///
3088 /// # Example
3089 /// ```ignore,no_run
3090 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3091 /// let x = CreateExternalAccessRuleRequest::new().set_external_access_rule_id("example");
3092 /// ```
3093 pub fn set_external_access_rule_id<T: std::convert::Into<std::string::String>>(
3094 mut self,
3095 v: T,
3096 ) -> Self {
3097 self.external_access_rule_id = v.into();
3098 self
3099 }
3100
3101 /// Sets the value of [request_id][crate::model::CreateExternalAccessRuleRequest::request_id].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_vmwareengine_v1::model::CreateExternalAccessRuleRequest;
3106 /// let x = CreateExternalAccessRuleRequest::new().set_request_id("example");
3107 /// ```
3108 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3109 self.request_id = v.into();
3110 self
3111 }
3112}
3113
3114impl wkt::message::Message for CreateExternalAccessRuleRequest {
3115 fn typename() -> &'static str {
3116 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest"
3117 }
3118}
3119
3120/// Request message for
3121/// [VmwareEngine.UpdateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]
3122///
3123/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]: crate::client::VmwareEngine::update_external_access_rule
3124#[derive(Clone, Default, PartialEq)]
3125#[non_exhaustive]
3126pub struct UpdateExternalAccessRuleRequest {
3127 /// Required. Field mask is used to specify the fields to be overwritten in the
3128 /// `ExternalAccessRule` resource by the update.
3129 /// The fields specified in the `update_mask` are relative to the resource, not
3130 /// the full request. A field will be overwritten if it is in the mask. If the
3131 /// user does not provide a mask then all fields will be overwritten.
3132 pub update_mask: std::option::Option<wkt::FieldMask>,
3133
3134 /// Required. Description of the external access rule.
3135 pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
3136
3137 /// Optional. A request ID to identify requests. Specify a unique request ID
3138 /// so that if you must retry your request, the server will know to ignore
3139 /// the request if it has already been completed. The server guarantees that a
3140 /// request doesn't result in creation of duplicate commitments for at least 60
3141 /// minutes.
3142 ///
3143 /// For example, consider a situation where you make an initial request and the
3144 /// request times out. If you make the request again with the same request ID,
3145 /// the server can check if the original operation with the same request ID was
3146 /// received, and if so, will ignore the second request. This prevents clients
3147 /// from accidentally creating duplicate commitments.
3148 ///
3149 /// The request ID must be a valid UUID with the exception that zero UUID is
3150 /// not supported (00000000-0000-0000-0000-000000000000).
3151 pub request_id: std::string::String,
3152
3153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3154}
3155
3156impl UpdateExternalAccessRuleRequest {
3157 /// Creates a new default instance.
3158 pub fn new() -> Self {
3159 std::default::Default::default()
3160 }
3161
3162 /// Sets the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3163 ///
3164 /// # Example
3165 /// ```ignore,no_run
3166 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3167 /// use wkt::FieldMask;
3168 /// let x = UpdateExternalAccessRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3169 /// ```
3170 pub fn set_update_mask<T>(mut self, v: T) -> Self
3171 where
3172 T: std::convert::Into<wkt::FieldMask>,
3173 {
3174 self.update_mask = std::option::Option::Some(v.into());
3175 self
3176 }
3177
3178 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
3179 ///
3180 /// # Example
3181 /// ```ignore,no_run
3182 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3183 /// use wkt::FieldMask;
3184 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3185 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3186 /// ```
3187 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3188 where
3189 T: std::convert::Into<wkt::FieldMask>,
3190 {
3191 self.update_mask = v.map(|x| x.into());
3192 self
3193 }
3194
3195 /// Sets the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3196 ///
3197 /// # Example
3198 /// ```ignore,no_run
3199 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3200 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3201 /// let x = UpdateExternalAccessRuleRequest::new().set_external_access_rule(ExternalAccessRule::default()/* use setters */);
3202 /// ```
3203 pub fn set_external_access_rule<T>(mut self, v: T) -> Self
3204 where
3205 T: std::convert::Into<crate::model::ExternalAccessRule>,
3206 {
3207 self.external_access_rule = std::option::Option::Some(v.into());
3208 self
3209 }
3210
3211 /// Sets or clears the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
3212 ///
3213 /// # Example
3214 /// ```ignore,no_run
3215 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3216 /// use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
3217 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(Some(ExternalAccessRule::default()/* use setters */));
3218 /// let x = UpdateExternalAccessRuleRequest::new().set_or_clear_external_access_rule(None::<ExternalAccessRule>);
3219 /// ```
3220 pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
3221 where
3222 T: std::convert::Into<crate::model::ExternalAccessRule>,
3223 {
3224 self.external_access_rule = v.map(|x| x.into());
3225 self
3226 }
3227
3228 /// Sets the value of [request_id][crate::model::UpdateExternalAccessRuleRequest::request_id].
3229 ///
3230 /// # Example
3231 /// ```ignore,no_run
3232 /// # use google_cloud_vmwareengine_v1::model::UpdateExternalAccessRuleRequest;
3233 /// let x = UpdateExternalAccessRuleRequest::new().set_request_id("example");
3234 /// ```
3235 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3236 self.request_id = v.into();
3237 self
3238 }
3239}
3240
3241impl wkt::message::Message for UpdateExternalAccessRuleRequest {
3242 fn typename() -> &'static str {
3243 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest"
3244 }
3245}
3246
3247/// Request message for
3248/// [VmwareEngine.DeleteExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]
3249///
3250/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]: crate::client::VmwareEngine::delete_external_access_rule
3251#[derive(Clone, Default, PartialEq)]
3252#[non_exhaustive]
3253pub struct DeleteExternalAccessRuleRequest {
3254 /// Required. The resource name of the external access firewall rule to delete.
3255 /// Resource names are schemeless URIs that follow the conventions in
3256 /// <https://cloud.google.com/apis/design/resource_names>.
3257 /// For example:
3258 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
3259 pub name: std::string::String,
3260
3261 /// Optional. A request ID to identify requests. Specify a unique request ID
3262 /// so that if you must retry your request, the server will know to ignore
3263 /// the request if it has already been completed. The server guarantees that a
3264 /// request doesn't result in creation of duplicate commitments for at least 60
3265 /// minutes.
3266 ///
3267 /// For example, consider a situation where you make an initial request and the
3268 /// request times out. If you make the request again with the same request
3269 /// ID, the server can check if the original operation with the same request ID
3270 /// was received, and if so, will ignore the second request. This prevents
3271 /// clients from accidentally creating duplicate commitments.
3272 ///
3273 /// The request ID must be a valid UUID with the exception that zero UUID is
3274 /// not supported (00000000-0000-0000-0000-000000000000).
3275 pub request_id: std::string::String,
3276
3277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3278}
3279
3280impl DeleteExternalAccessRuleRequest {
3281 /// Creates a new default instance.
3282 pub fn new() -> Self {
3283 std::default::Default::default()
3284 }
3285
3286 /// Sets the value of [name][crate::model::DeleteExternalAccessRuleRequest::name].
3287 ///
3288 /// # Example
3289 /// ```ignore,no_run
3290 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3291 /// # let project_id = "project_id";
3292 /// # let location_id = "location_id";
3293 /// # let network_policy_id = "network_policy_id";
3294 /// # let external_access_rule_id = "external_access_rule_id";
3295 /// let x = DeleteExternalAccessRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}/externalAccessRules/{external_access_rule_id}"));
3296 /// ```
3297 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3298 self.name = v.into();
3299 self
3300 }
3301
3302 /// Sets the value of [request_id][crate::model::DeleteExternalAccessRuleRequest::request_id].
3303 ///
3304 /// # Example
3305 /// ```ignore,no_run
3306 /// # use google_cloud_vmwareengine_v1::model::DeleteExternalAccessRuleRequest;
3307 /// let x = DeleteExternalAccessRuleRequest::new().set_request_id("example");
3308 /// ```
3309 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3310 self.request_id = v.into();
3311 self
3312 }
3313}
3314
3315impl wkt::message::Message for DeleteExternalAccessRuleRequest {
3316 fn typename() -> &'static str {
3317 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest"
3318 }
3319}
3320
3321/// Request message for
3322/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3323///
3324/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3325#[derive(Clone, Default, PartialEq)]
3326#[non_exhaustive]
3327pub struct ListLoggingServersRequest {
3328 /// Required. The resource name of the private cloud to be queried for
3329 /// logging servers.
3330 /// Resource names are schemeless URIs that follow the conventions in
3331 /// <https://cloud.google.com/apis/design/resource_names>.
3332 /// For example:
3333 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3334 pub parent: std::string::String,
3335
3336 /// The maximum number of logging servers to return in one page.
3337 /// The service may return fewer than this value.
3338 /// The maximum value is coerced to 1000.
3339 /// The default value of this field is 500.
3340 pub page_size: i32,
3341
3342 /// A page token, received from a previous `ListLoggingServersRequest` call.
3343 /// Provide this to retrieve the subsequent page.
3344 ///
3345 /// When paginating, all other parameters provided to
3346 /// `ListLoggingServersRequest` must match the call that provided the page
3347 /// token.
3348 pub page_token: std::string::String,
3349
3350 /// A filter expression that matches resources returned in the response.
3351 /// The expression must specify the field name, a comparison
3352 /// operator, and the value that you want to use for filtering. The value
3353 /// must be a string, a number, or a boolean. The comparison operator
3354 /// must be `=`, `!=`, `>`, or `<`.
3355 ///
3356 /// For example, if you are filtering a list of logging servers, you can
3357 /// exclude the ones named `example-server` by specifying
3358 /// `name != "example-server"`.
3359 ///
3360 /// To filter on multiple expressions, provide each separate expression within
3361 /// parentheses. For example:
3362 ///
3363 /// ```norust
3364 /// (name = "example-server")
3365 /// (createTime > "2021-04-12T08:15:10.40Z")
3366 /// ```
3367 ///
3368 /// By default, each expression is an `AND` expression. However, you
3369 /// can include `AND` and `OR` expressions explicitly.
3370 /// For example:
3371 ///
3372 /// ```norust
3373 /// (name = "example-server-1") AND
3374 /// (createTime > "2021-04-12T08:15:10.40Z") OR
3375 /// (name = "example-server-2")
3376 /// ```
3377 pub filter: std::string::String,
3378
3379 /// Sorts list results by a certain order. By default, returned results
3380 /// are ordered by `name` in ascending order.
3381 /// You can also sort results in descending order based on the `name` value
3382 /// using `orderBy="name desc"`.
3383 /// Currently, only ordering by `name` is supported.
3384 pub order_by: std::string::String,
3385
3386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3387}
3388
3389impl ListLoggingServersRequest {
3390 /// Creates a new default instance.
3391 pub fn new() -> Self {
3392 std::default::Default::default()
3393 }
3394
3395 /// Sets the value of [parent][crate::model::ListLoggingServersRequest::parent].
3396 ///
3397 /// # Example
3398 /// ```ignore,no_run
3399 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3400 /// # let project_id = "project_id";
3401 /// # let location_id = "location_id";
3402 /// # let private_cloud_id = "private_cloud_id";
3403 /// let x = ListLoggingServersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
3404 /// ```
3405 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3406 self.parent = v.into();
3407 self
3408 }
3409
3410 /// Sets the value of [page_size][crate::model::ListLoggingServersRequest::page_size].
3411 ///
3412 /// # Example
3413 /// ```ignore,no_run
3414 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3415 /// let x = ListLoggingServersRequest::new().set_page_size(42);
3416 /// ```
3417 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3418 self.page_size = v.into();
3419 self
3420 }
3421
3422 /// Sets the value of [page_token][crate::model::ListLoggingServersRequest::page_token].
3423 ///
3424 /// # Example
3425 /// ```ignore,no_run
3426 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3427 /// let x = ListLoggingServersRequest::new().set_page_token("example");
3428 /// ```
3429 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3430 self.page_token = v.into();
3431 self
3432 }
3433
3434 /// Sets the value of [filter][crate::model::ListLoggingServersRequest::filter].
3435 ///
3436 /// # Example
3437 /// ```ignore,no_run
3438 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3439 /// let x = ListLoggingServersRequest::new().set_filter("example");
3440 /// ```
3441 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3442 self.filter = v.into();
3443 self
3444 }
3445
3446 /// Sets the value of [order_by][crate::model::ListLoggingServersRequest::order_by].
3447 ///
3448 /// # Example
3449 /// ```ignore,no_run
3450 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersRequest;
3451 /// let x = ListLoggingServersRequest::new().set_order_by("example");
3452 /// ```
3453 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.order_by = v.into();
3455 self
3456 }
3457}
3458
3459impl wkt::message::Message for ListLoggingServersRequest {
3460 fn typename() -> &'static str {
3461 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersRequest"
3462 }
3463}
3464
3465/// Response message for
3466/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
3467///
3468/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
3469#[derive(Clone, Default, PartialEq)]
3470#[non_exhaustive]
3471pub struct ListLoggingServersResponse {
3472 /// A list of Logging Servers.
3473 pub logging_servers: std::vec::Vec<crate::model::LoggingServer>,
3474
3475 /// A token, which can be send as `page_token` to retrieve the next page.
3476 /// If this field is omitted, there are no subsequent pages.
3477 pub next_page_token: std::string::String,
3478
3479 /// Locations that could not be reached when making an aggregated query using
3480 /// wildcards.
3481 pub unreachable: std::vec::Vec<std::string::String>,
3482
3483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3484}
3485
3486impl ListLoggingServersResponse {
3487 /// Creates a new default instance.
3488 pub fn new() -> Self {
3489 std::default::Default::default()
3490 }
3491
3492 /// Sets the value of [logging_servers][crate::model::ListLoggingServersResponse::logging_servers].
3493 ///
3494 /// # Example
3495 /// ```ignore,no_run
3496 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3497 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3498 /// let x = ListLoggingServersResponse::new()
3499 /// .set_logging_servers([
3500 /// LoggingServer::default()/* use setters */,
3501 /// LoggingServer::default()/* use (different) setters */,
3502 /// ]);
3503 /// ```
3504 pub fn set_logging_servers<T, V>(mut self, v: T) -> Self
3505 where
3506 T: std::iter::IntoIterator<Item = V>,
3507 V: std::convert::Into<crate::model::LoggingServer>,
3508 {
3509 use std::iter::Iterator;
3510 self.logging_servers = v.into_iter().map(|i| i.into()).collect();
3511 self
3512 }
3513
3514 /// Sets the value of [next_page_token][crate::model::ListLoggingServersResponse::next_page_token].
3515 ///
3516 /// # Example
3517 /// ```ignore,no_run
3518 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3519 /// let x = ListLoggingServersResponse::new().set_next_page_token("example");
3520 /// ```
3521 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3522 self.next_page_token = v.into();
3523 self
3524 }
3525
3526 /// Sets the value of [unreachable][crate::model::ListLoggingServersResponse::unreachable].
3527 ///
3528 /// # Example
3529 /// ```ignore,no_run
3530 /// # use google_cloud_vmwareengine_v1::model::ListLoggingServersResponse;
3531 /// let x = ListLoggingServersResponse::new().set_unreachable(["a", "b", "c"]);
3532 /// ```
3533 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3534 where
3535 T: std::iter::IntoIterator<Item = V>,
3536 V: std::convert::Into<std::string::String>,
3537 {
3538 use std::iter::Iterator;
3539 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3540 self
3541 }
3542}
3543
3544impl wkt::message::Message for ListLoggingServersResponse {
3545 fn typename() -> &'static str {
3546 "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersResponse"
3547 }
3548}
3549
3550#[doc(hidden)]
3551impl google_cloud_gax::paginator::internal::PageableResponse for ListLoggingServersResponse {
3552 type PageItem = crate::model::LoggingServer;
3553
3554 fn items(self) -> std::vec::Vec<Self::PageItem> {
3555 self.logging_servers
3556 }
3557
3558 fn next_page_token(&self) -> std::string::String {
3559 use std::clone::Clone;
3560 self.next_page_token.clone()
3561 }
3562}
3563
3564/// Request message for
3565/// [VmwareEngine.GetLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]
3566///
3567/// [google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]: crate::client::VmwareEngine::get_logging_server
3568#[derive(Clone, Default, PartialEq)]
3569#[non_exhaustive]
3570pub struct GetLoggingServerRequest {
3571 /// Required. The resource name of the Logging Server to retrieve.
3572 /// Resource names are schemeless URIs that follow the conventions in
3573 /// <https://cloud.google.com/apis/design/resource_names>.
3574 /// For example:
3575 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3576 pub name: std::string::String,
3577
3578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3579}
3580
3581impl GetLoggingServerRequest {
3582 /// Creates a new default instance.
3583 pub fn new() -> Self {
3584 std::default::Default::default()
3585 }
3586
3587 /// Sets the value of [name][crate::model::GetLoggingServerRequest::name].
3588 ///
3589 /// # Example
3590 /// ```ignore,no_run
3591 /// # use google_cloud_vmwareengine_v1::model::GetLoggingServerRequest;
3592 /// # let project_id = "project_id";
3593 /// # let location_id = "location_id";
3594 /// # let private_cloud_id = "private_cloud_id";
3595 /// # let logging_server_id = "logging_server_id";
3596 /// let x = GetLoggingServerRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/loggingServers/{logging_server_id}"));
3597 /// ```
3598 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.name = v.into();
3600 self
3601 }
3602}
3603
3604impl wkt::message::Message for GetLoggingServerRequest {
3605 fn typename() -> &'static str {
3606 "type.googleapis.com/google.cloud.vmwareengine.v1.GetLoggingServerRequest"
3607 }
3608}
3609
3610/// Request message for
3611/// [VmwareEngine.CreateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]
3612///
3613/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]: crate::client::VmwareEngine::create_logging_server
3614#[derive(Clone, Default, PartialEq)]
3615#[non_exhaustive]
3616pub struct CreateLoggingServerRequest {
3617 /// Required. The resource name of the private cloud
3618 /// to create a new Logging Server in.
3619 /// Resource names are schemeless URIs that follow the conventions in
3620 /// <https://cloud.google.com/apis/design/resource_names>.
3621 /// For example:
3622 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3623 pub parent: std::string::String,
3624
3625 /// Required. The initial description of a new logging server.
3626 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3627
3628 /// Required. The user-provided identifier of the `LoggingServer` to be
3629 /// created. This identifier must be unique among `LoggingServer` resources
3630 /// within the parent and becomes the final token in the name URI.
3631 /// The identifier must meet the following requirements:
3632 ///
3633 /// * Only contains 1-63 alphanumeric characters and hyphens
3634 /// * Begins with an alphabetical character
3635 /// * Ends with a non-hyphen character
3636 /// * Not formatted as a UUID
3637 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
3638 /// (section 3.5)
3639 pub logging_server_id: std::string::String,
3640
3641 /// Optional. A request ID to identify requests. Specify a unique request ID
3642 /// so that if you must retry your request, the server will know to ignore
3643 /// the request if it has already been completed. The server guarantees that a
3644 /// request doesn't result in creation of duplicate commitments for at least 60
3645 /// minutes.
3646 ///
3647 /// For example, consider a situation where you make an initial request and the
3648 /// request times out. If you make the request again with the same request ID,
3649 /// the server can check if original operation with the same request ID was
3650 /// received, and if so, will ignore the second request. This prevents clients
3651 /// from accidentally creating duplicate commitments.
3652 ///
3653 /// The request ID must be a valid UUID with the exception that zero UUID is
3654 /// not supported (00000000-0000-0000-0000-000000000000).
3655 pub request_id: std::string::String,
3656
3657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3658}
3659
3660impl CreateLoggingServerRequest {
3661 /// Creates a new default instance.
3662 pub fn new() -> Self {
3663 std::default::Default::default()
3664 }
3665
3666 /// Sets the value of [parent][crate::model::CreateLoggingServerRequest::parent].
3667 ///
3668 /// # Example
3669 /// ```ignore,no_run
3670 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3671 /// # let project_id = "project_id";
3672 /// # let location_id = "location_id";
3673 /// # let private_cloud_id = "private_cloud_id";
3674 /// let x = CreateLoggingServerRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
3675 /// ```
3676 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3677 self.parent = v.into();
3678 self
3679 }
3680
3681 /// Sets the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3682 ///
3683 /// # Example
3684 /// ```ignore,no_run
3685 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3686 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3687 /// let x = CreateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3688 /// ```
3689 pub fn set_logging_server<T>(mut self, v: T) -> Self
3690 where
3691 T: std::convert::Into<crate::model::LoggingServer>,
3692 {
3693 self.logging_server = std::option::Option::Some(v.into());
3694 self
3695 }
3696
3697 /// Sets or clears the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
3698 ///
3699 /// # Example
3700 /// ```ignore,no_run
3701 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3702 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3703 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3704 /// let x = CreateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3705 /// ```
3706 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3707 where
3708 T: std::convert::Into<crate::model::LoggingServer>,
3709 {
3710 self.logging_server = v.map(|x| x.into());
3711 self
3712 }
3713
3714 /// Sets the value of [logging_server_id][crate::model::CreateLoggingServerRequest::logging_server_id].
3715 ///
3716 /// # Example
3717 /// ```ignore,no_run
3718 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3719 /// let x = CreateLoggingServerRequest::new().set_logging_server_id("example");
3720 /// ```
3721 pub fn set_logging_server_id<T: std::convert::Into<std::string::String>>(
3722 mut self,
3723 v: T,
3724 ) -> Self {
3725 self.logging_server_id = v.into();
3726 self
3727 }
3728
3729 /// Sets the value of [request_id][crate::model::CreateLoggingServerRequest::request_id].
3730 ///
3731 /// # Example
3732 /// ```ignore,no_run
3733 /// # use google_cloud_vmwareengine_v1::model::CreateLoggingServerRequest;
3734 /// let x = CreateLoggingServerRequest::new().set_request_id("example");
3735 /// ```
3736 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3737 self.request_id = v.into();
3738 self
3739 }
3740}
3741
3742impl wkt::message::Message for CreateLoggingServerRequest {
3743 fn typename() -> &'static str {
3744 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateLoggingServerRequest"
3745 }
3746}
3747
3748/// Request message for
3749/// [VmwareEngine.UpdateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]
3750///
3751/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]: crate::client::VmwareEngine::update_logging_server
3752#[derive(Clone, Default, PartialEq)]
3753#[non_exhaustive]
3754pub struct UpdateLoggingServerRequest {
3755 /// Required. Field mask is used to specify the fields to be overwritten in the
3756 /// `LoggingServer` resource by the update.
3757 /// The fields specified in the `update_mask` are relative to the resource, not
3758 /// the full request. A field will be overwritten if it is in the mask. If the
3759 /// user does not provide a mask then all fields will be overwritten.
3760 pub update_mask: std::option::Option<wkt::FieldMask>,
3761
3762 /// Required. Logging server description.
3763 pub logging_server: std::option::Option<crate::model::LoggingServer>,
3764
3765 /// Optional. A request ID to identify requests. Specify a unique request ID
3766 /// so that if you must retry your request, the server will know to ignore
3767 /// the request if it has already been completed. The server guarantees that a
3768 /// request doesn't result in creation of duplicate commitments for at least 60
3769 /// minutes.
3770 ///
3771 /// For example, consider a situation where you make an initial request and the
3772 /// request times out. If you make the request again with the same request ID,
3773 /// the server can check if original operation with the same request ID was
3774 /// received, and if so, will ignore the second request. This prevents clients
3775 /// from accidentally creating duplicate commitments.
3776 ///
3777 /// The request ID must be a valid UUID with the exception that zero UUID is
3778 /// not supported (00000000-0000-0000-0000-000000000000).
3779 pub request_id: std::string::String,
3780
3781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3782}
3783
3784impl UpdateLoggingServerRequest {
3785 /// Creates a new default instance.
3786 pub fn new() -> Self {
3787 std::default::Default::default()
3788 }
3789
3790 /// Sets the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3791 ///
3792 /// # Example
3793 /// ```ignore,no_run
3794 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3795 /// use wkt::FieldMask;
3796 /// let x = UpdateLoggingServerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3797 /// ```
3798 pub fn set_update_mask<T>(mut self, v: T) -> Self
3799 where
3800 T: std::convert::Into<wkt::FieldMask>,
3801 {
3802 self.update_mask = std::option::Option::Some(v.into());
3803 self
3804 }
3805
3806 /// Sets or clears the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
3807 ///
3808 /// # Example
3809 /// ```ignore,no_run
3810 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3811 /// use wkt::FieldMask;
3812 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3813 /// let x = UpdateLoggingServerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3814 /// ```
3815 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3816 where
3817 T: std::convert::Into<wkt::FieldMask>,
3818 {
3819 self.update_mask = v.map(|x| x.into());
3820 self
3821 }
3822
3823 /// Sets the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3824 ///
3825 /// # Example
3826 /// ```ignore,no_run
3827 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3828 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3829 /// let x = UpdateLoggingServerRequest::new().set_logging_server(LoggingServer::default()/* use setters */);
3830 /// ```
3831 pub fn set_logging_server<T>(mut self, v: T) -> Self
3832 where
3833 T: std::convert::Into<crate::model::LoggingServer>,
3834 {
3835 self.logging_server = std::option::Option::Some(v.into());
3836 self
3837 }
3838
3839 /// Sets or clears the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
3840 ///
3841 /// # Example
3842 /// ```ignore,no_run
3843 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3844 /// use google_cloud_vmwareengine_v1::model::LoggingServer;
3845 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(Some(LoggingServer::default()/* use setters */));
3846 /// let x = UpdateLoggingServerRequest::new().set_or_clear_logging_server(None::<LoggingServer>);
3847 /// ```
3848 pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
3849 where
3850 T: std::convert::Into<crate::model::LoggingServer>,
3851 {
3852 self.logging_server = v.map(|x| x.into());
3853 self
3854 }
3855
3856 /// Sets the value of [request_id][crate::model::UpdateLoggingServerRequest::request_id].
3857 ///
3858 /// # Example
3859 /// ```ignore,no_run
3860 /// # use google_cloud_vmwareengine_v1::model::UpdateLoggingServerRequest;
3861 /// let x = UpdateLoggingServerRequest::new().set_request_id("example");
3862 /// ```
3863 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3864 self.request_id = v.into();
3865 self
3866 }
3867}
3868
3869impl wkt::message::Message for UpdateLoggingServerRequest {
3870 fn typename() -> &'static str {
3871 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateLoggingServerRequest"
3872 }
3873}
3874
3875/// Request message for
3876/// [VmwareEngine.DeleteLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]
3877///
3878/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]: crate::client::VmwareEngine::delete_logging_server
3879#[derive(Clone, Default, PartialEq)]
3880#[non_exhaustive]
3881pub struct DeleteLoggingServerRequest {
3882 /// Required. The resource name of the logging server to delete.
3883 /// Resource names are schemeless URIs that follow the conventions in
3884 /// <https://cloud.google.com/apis/design/resource_names>.
3885 /// For example:
3886 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
3887 pub name: std::string::String,
3888
3889 /// Optional. A request ID to identify requests. Specify a unique request ID
3890 /// so that if you must retry your request, the server will know to ignore
3891 /// the request if it has already been completed. The server guarantees that a
3892 /// request doesn't result in creation of duplicate commitments for at least 60
3893 /// minutes.
3894 ///
3895 /// For example, consider a situation where you make an initial request and the
3896 /// request times out. If you make the request again with the same request
3897 /// ID, the server can check if original operation with the same request ID
3898 /// was received, and if so, will ignore the second request. This prevents
3899 /// clients from accidentally creating duplicate commitments.
3900 ///
3901 /// The request ID must be a valid UUID with the exception that zero UUID is
3902 /// not supported (00000000-0000-0000-0000-000000000000).
3903 pub request_id: std::string::String,
3904
3905 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3906}
3907
3908impl DeleteLoggingServerRequest {
3909 /// Creates a new default instance.
3910 pub fn new() -> Self {
3911 std::default::Default::default()
3912 }
3913
3914 /// Sets the value of [name][crate::model::DeleteLoggingServerRequest::name].
3915 ///
3916 /// # Example
3917 /// ```ignore,no_run
3918 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3919 /// # let project_id = "project_id";
3920 /// # let location_id = "location_id";
3921 /// # let private_cloud_id = "private_cloud_id";
3922 /// # let logging_server_id = "logging_server_id";
3923 /// let x = DeleteLoggingServerRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/loggingServers/{logging_server_id}"));
3924 /// ```
3925 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.name = v.into();
3927 self
3928 }
3929
3930 /// Sets the value of [request_id][crate::model::DeleteLoggingServerRequest::request_id].
3931 ///
3932 /// # Example
3933 /// ```ignore,no_run
3934 /// # use google_cloud_vmwareengine_v1::model::DeleteLoggingServerRequest;
3935 /// let x = DeleteLoggingServerRequest::new().set_request_id("example");
3936 /// ```
3937 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3938 self.request_id = v.into();
3939 self
3940 }
3941}
3942
3943impl wkt::message::Message for DeleteLoggingServerRequest {
3944 fn typename() -> &'static str {
3945 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteLoggingServerRequest"
3946 }
3947}
3948
3949/// Represents the metadata of the long-running operation.
3950#[derive(Clone, Default, PartialEq)]
3951#[non_exhaustive]
3952pub struct OperationMetadata {
3953 /// Output only. The time the operation was created.
3954 pub create_time: std::option::Option<wkt::Timestamp>,
3955
3956 /// Output only. The time the operation finished running.
3957 pub end_time: std::option::Option<wkt::Timestamp>,
3958
3959 /// Output only. Server-defined resource path for the target of the operation.
3960 pub target: std::string::String,
3961
3962 /// Output only. Name of the verb executed by the operation.
3963 pub verb: std::string::String,
3964
3965 /// Output only. Human-readable status of the operation, if any.
3966 pub status_message: std::string::String,
3967
3968 /// Output only. True if the user has requested cancellation
3969 /// of the operation; false otherwise.
3970 /// Operations that have successfully been cancelled
3971 /// have [Operation.error][] value with a
3972 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3973 /// `Code.CANCELLED`.
3974 pub requested_cancellation: bool,
3975
3976 /// Output only. API version used to start the operation.
3977 pub api_version: std::string::String,
3978
3979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3980}
3981
3982impl OperationMetadata {
3983 /// Creates a new default instance.
3984 pub fn new() -> Self {
3985 std::default::Default::default()
3986 }
3987
3988 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3989 ///
3990 /// # Example
3991 /// ```ignore,no_run
3992 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
3993 /// use wkt::Timestamp;
3994 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3995 /// ```
3996 pub fn set_create_time<T>(mut self, v: T) -> Self
3997 where
3998 T: std::convert::Into<wkt::Timestamp>,
3999 {
4000 self.create_time = std::option::Option::Some(v.into());
4001 self
4002 }
4003
4004 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4005 ///
4006 /// # Example
4007 /// ```ignore,no_run
4008 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4009 /// use wkt::Timestamp;
4010 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4011 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4012 /// ```
4013 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4014 where
4015 T: std::convert::Into<wkt::Timestamp>,
4016 {
4017 self.create_time = v.map(|x| x.into());
4018 self
4019 }
4020
4021 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4022 ///
4023 /// # Example
4024 /// ```ignore,no_run
4025 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4026 /// use wkt::Timestamp;
4027 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4028 /// ```
4029 pub fn set_end_time<T>(mut self, v: T) -> Self
4030 where
4031 T: std::convert::Into<wkt::Timestamp>,
4032 {
4033 self.end_time = std::option::Option::Some(v.into());
4034 self
4035 }
4036
4037 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4038 ///
4039 /// # Example
4040 /// ```ignore,no_run
4041 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4042 /// use wkt::Timestamp;
4043 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4044 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4045 /// ```
4046 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4047 where
4048 T: std::convert::Into<wkt::Timestamp>,
4049 {
4050 self.end_time = v.map(|x| x.into());
4051 self
4052 }
4053
4054 /// Sets the value of [target][crate::model::OperationMetadata::target].
4055 ///
4056 /// # Example
4057 /// ```ignore,no_run
4058 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4059 /// let x = OperationMetadata::new().set_target("example");
4060 /// ```
4061 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4062 self.target = v.into();
4063 self
4064 }
4065
4066 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4067 ///
4068 /// # Example
4069 /// ```ignore,no_run
4070 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4071 /// let x = OperationMetadata::new().set_verb("example");
4072 /// ```
4073 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4074 self.verb = v.into();
4075 self
4076 }
4077
4078 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4079 ///
4080 /// # Example
4081 /// ```ignore,no_run
4082 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4083 /// let x = OperationMetadata::new().set_status_message("example");
4084 /// ```
4085 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4086 self.status_message = v.into();
4087 self
4088 }
4089
4090 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4091 ///
4092 /// # Example
4093 /// ```ignore,no_run
4094 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4095 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4096 /// ```
4097 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4098 self.requested_cancellation = v.into();
4099 self
4100 }
4101
4102 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4103 ///
4104 /// # Example
4105 /// ```ignore,no_run
4106 /// # use google_cloud_vmwareengine_v1::model::OperationMetadata;
4107 /// let x = OperationMetadata::new().set_api_version("example");
4108 /// ```
4109 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.api_version = v.into();
4111 self
4112 }
4113}
4114
4115impl wkt::message::Message for OperationMetadata {
4116 fn typename() -> &'static str {
4117 "type.googleapis.com/google.cloud.vmwareengine.v1.OperationMetadata"
4118 }
4119}
4120
4121/// Request message for
4122/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
4123///
4124/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4125#[derive(Clone, Default, PartialEq)]
4126#[non_exhaustive]
4127pub struct ListNodeTypesRequest {
4128 /// Required. The resource name of the location to be queried for node types.
4129 /// Resource names are schemeless URIs that follow the conventions in
4130 /// <https://cloud.google.com/apis/design/resource_names>.
4131 /// For example:
4132 /// `projects/my-project/locations/us-central1-a`
4133 pub parent: std::string::String,
4134
4135 /// The maximum number of node types to return in one page.
4136 /// The service may return fewer than this value.
4137 /// The maximum value is coerced to 1000.
4138 /// The default value of this field is 500.
4139 pub page_size: i32,
4140
4141 /// A page token, received from a previous `ListNodeTypes` call.
4142 /// Provide this to retrieve the subsequent page.
4143 ///
4144 /// When paginating, all other parameters provided to
4145 /// `ListNodeTypes` must match the call that provided the page token.
4146 pub page_token: std::string::String,
4147
4148 /// A filter expression that matches resources returned in the response.
4149 /// The expression must specify the field name, a comparison
4150 /// operator, and the value that you want to use for filtering. The value
4151 /// must be a string, a number, or a boolean. The comparison operator
4152 /// must be `=`, `!=`, `>`, or `<`.
4153 ///
4154 /// For example, if you are filtering a list of node types, you can
4155 /// exclude the ones named `standard-72` by specifying
4156 /// `name != "standard-72"`.
4157 ///
4158 /// To filter on multiple expressions, provide each separate expression within
4159 /// parentheses. For example:
4160 ///
4161 /// ```norust
4162 /// (name = "standard-72")
4163 /// (virtual_cpu_count > 2)
4164 /// ```
4165 ///
4166 /// By default, each expression is an `AND` expression. However, you
4167 /// can include `AND` and `OR` expressions explicitly.
4168 /// For example:
4169 ///
4170 /// ```norust
4171 /// (name = "standard-96") AND
4172 /// (virtual_cpu_count > 2) OR
4173 /// (name = "standard-72")
4174 /// ```
4175 pub filter: std::string::String,
4176
4177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4178}
4179
4180impl ListNodeTypesRequest {
4181 /// Creates a new default instance.
4182 pub fn new() -> Self {
4183 std::default::Default::default()
4184 }
4185
4186 /// Sets the value of [parent][crate::model::ListNodeTypesRequest::parent].
4187 ///
4188 /// # Example
4189 /// ```ignore,no_run
4190 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4191 /// let x = ListNodeTypesRequest::new().set_parent("example");
4192 /// ```
4193 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4194 self.parent = v.into();
4195 self
4196 }
4197
4198 /// Sets the value of [page_size][crate::model::ListNodeTypesRequest::page_size].
4199 ///
4200 /// # Example
4201 /// ```ignore,no_run
4202 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4203 /// let x = ListNodeTypesRequest::new().set_page_size(42);
4204 /// ```
4205 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4206 self.page_size = v.into();
4207 self
4208 }
4209
4210 /// Sets the value of [page_token][crate::model::ListNodeTypesRequest::page_token].
4211 ///
4212 /// # Example
4213 /// ```ignore,no_run
4214 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4215 /// let x = ListNodeTypesRequest::new().set_page_token("example");
4216 /// ```
4217 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4218 self.page_token = v.into();
4219 self
4220 }
4221
4222 /// Sets the value of [filter][crate::model::ListNodeTypesRequest::filter].
4223 ///
4224 /// # Example
4225 /// ```ignore,no_run
4226 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesRequest;
4227 /// let x = ListNodeTypesRequest::new().set_filter("example");
4228 /// ```
4229 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230 self.filter = v.into();
4231 self
4232 }
4233}
4234
4235impl wkt::message::Message for ListNodeTypesRequest {
4236 fn typename() -> &'static str {
4237 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesRequest"
4238 }
4239}
4240
4241/// Response message for
4242/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
4243///
4244/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
4245#[derive(Clone, Default, PartialEq)]
4246#[non_exhaustive]
4247pub struct ListNodeTypesResponse {
4248 /// A list of Node Types.
4249 pub node_types: std::vec::Vec<crate::model::NodeType>,
4250
4251 /// A token, which can be sent as `page_token` to retrieve the next page.
4252 /// If this field is omitted, there are no subsequent pages.
4253 pub next_page_token: std::string::String,
4254
4255 /// Locations that could not be reached when making an aggregated query using
4256 /// wildcards.
4257 pub unreachable: std::vec::Vec<std::string::String>,
4258
4259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4260}
4261
4262impl ListNodeTypesResponse {
4263 /// Creates a new default instance.
4264 pub fn new() -> Self {
4265 std::default::Default::default()
4266 }
4267
4268 /// Sets the value of [node_types][crate::model::ListNodeTypesResponse::node_types].
4269 ///
4270 /// # Example
4271 /// ```ignore,no_run
4272 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4273 /// use google_cloud_vmwareengine_v1::model::NodeType;
4274 /// let x = ListNodeTypesResponse::new()
4275 /// .set_node_types([
4276 /// NodeType::default()/* use setters */,
4277 /// NodeType::default()/* use (different) setters */,
4278 /// ]);
4279 /// ```
4280 pub fn set_node_types<T, V>(mut self, v: T) -> Self
4281 where
4282 T: std::iter::IntoIterator<Item = V>,
4283 V: std::convert::Into<crate::model::NodeType>,
4284 {
4285 use std::iter::Iterator;
4286 self.node_types = v.into_iter().map(|i| i.into()).collect();
4287 self
4288 }
4289
4290 /// Sets the value of [next_page_token][crate::model::ListNodeTypesResponse::next_page_token].
4291 ///
4292 /// # Example
4293 /// ```ignore,no_run
4294 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4295 /// let x = ListNodeTypesResponse::new().set_next_page_token("example");
4296 /// ```
4297 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4298 self.next_page_token = v.into();
4299 self
4300 }
4301
4302 /// Sets the value of [unreachable][crate::model::ListNodeTypesResponse::unreachable].
4303 ///
4304 /// # Example
4305 /// ```ignore,no_run
4306 /// # use google_cloud_vmwareengine_v1::model::ListNodeTypesResponse;
4307 /// let x = ListNodeTypesResponse::new().set_unreachable(["a", "b", "c"]);
4308 /// ```
4309 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4310 where
4311 T: std::iter::IntoIterator<Item = V>,
4312 V: std::convert::Into<std::string::String>,
4313 {
4314 use std::iter::Iterator;
4315 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4316 self
4317 }
4318}
4319
4320impl wkt::message::Message for ListNodeTypesResponse {
4321 fn typename() -> &'static str {
4322 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesResponse"
4323 }
4324}
4325
4326#[doc(hidden)]
4327impl google_cloud_gax::paginator::internal::PageableResponse for ListNodeTypesResponse {
4328 type PageItem = crate::model::NodeType;
4329
4330 fn items(self) -> std::vec::Vec<Self::PageItem> {
4331 self.node_types
4332 }
4333
4334 fn next_page_token(&self) -> std::string::String {
4335 use std::clone::Clone;
4336 self.next_page_token.clone()
4337 }
4338}
4339
4340/// Request message for
4341/// [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]
4342///
4343/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]: crate::client::VmwareEngine::get_node_type
4344#[derive(Clone, Default, PartialEq)]
4345#[non_exhaustive]
4346pub struct GetNodeTypeRequest {
4347 /// Required. The resource name of the node type to retrieve.
4348 /// Resource names are schemeless URIs that follow the conventions in
4349 /// <https://cloud.google.com/apis/design/resource_names>.
4350 /// For example:
4351 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
4352 pub name: std::string::String,
4353
4354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4355}
4356
4357impl GetNodeTypeRequest {
4358 /// Creates a new default instance.
4359 pub fn new() -> Self {
4360 std::default::Default::default()
4361 }
4362
4363 /// Sets the value of [name][crate::model::GetNodeTypeRequest::name].
4364 ///
4365 /// # Example
4366 /// ```ignore,no_run
4367 /// # use google_cloud_vmwareengine_v1::model::GetNodeTypeRequest;
4368 /// # let project_id = "project_id";
4369 /// # let location_id = "location_id";
4370 /// # let node_type_id = "node_type_id";
4371 /// let x = GetNodeTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/nodeTypes/{node_type_id}"));
4372 /// ```
4373 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4374 self.name = v.into();
4375 self
4376 }
4377}
4378
4379impl wkt::message::Message for GetNodeTypeRequest {
4380 fn typename() -> &'static str {
4381 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeTypeRequest"
4382 }
4383}
4384
4385/// Request message for
4386/// [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]
4387///
4388/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]: crate::client::VmwareEngine::show_nsx_credentials
4389#[derive(Clone, Default, PartialEq)]
4390#[non_exhaustive]
4391pub struct ShowNsxCredentialsRequest {
4392 /// Required. The resource name of the private cloud
4393 /// to be queried for credentials.
4394 /// Resource names are schemeless URIs that follow the conventions in
4395 /// <https://cloud.google.com/apis/design/resource_names>.
4396 /// For example:
4397 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4398 pub private_cloud: std::string::String,
4399
4400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4401}
4402
4403impl ShowNsxCredentialsRequest {
4404 /// Creates a new default instance.
4405 pub fn new() -> Self {
4406 std::default::Default::default()
4407 }
4408
4409 /// Sets the value of [private_cloud][crate::model::ShowNsxCredentialsRequest::private_cloud].
4410 ///
4411 /// # Example
4412 /// ```ignore,no_run
4413 /// # use google_cloud_vmwareengine_v1::model::ShowNsxCredentialsRequest;
4414 /// # let project_id = "project_id";
4415 /// # let location_id = "location_id";
4416 /// # let private_cloud_id = "private_cloud_id";
4417 /// let x = ShowNsxCredentialsRequest::new().set_private_cloud(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4418 /// ```
4419 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.private_cloud = v.into();
4421 self
4422 }
4423}
4424
4425impl wkt::message::Message for ShowNsxCredentialsRequest {
4426 fn typename() -> &'static str {
4427 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"
4428 }
4429}
4430
4431/// Request message for
4432/// [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]
4433///
4434/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]: crate::client::VmwareEngine::show_vcenter_credentials
4435#[derive(Clone, Default, PartialEq)]
4436#[non_exhaustive]
4437pub struct ShowVcenterCredentialsRequest {
4438 /// Required. The resource name of the private cloud
4439 /// to be queried for credentials.
4440 /// Resource names are schemeless URIs that follow the conventions in
4441 /// <https://cloud.google.com/apis/design/resource_names>.
4442 /// For example:
4443 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4444 pub private_cloud: std::string::String,
4445
4446 /// Optional. The username of the user to be queried for credentials.
4447 /// The default value of this field is CloudOwner@gve.local.
4448 /// The provided value must be one of the following:
4449 /// CloudOwner@gve.local,
4450 /// solution-user-01@gve.local,
4451 /// solution-user-02@gve.local,
4452 /// solution-user-03@gve.local,
4453 /// solution-user-04@gve.local,
4454 /// solution-user-05@gve.local,
4455 /// zertoadmin@gve.local.
4456 pub username: std::string::String,
4457
4458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4459}
4460
4461impl ShowVcenterCredentialsRequest {
4462 /// Creates a new default instance.
4463 pub fn new() -> Self {
4464 std::default::Default::default()
4465 }
4466
4467 /// Sets the value of [private_cloud][crate::model::ShowVcenterCredentialsRequest::private_cloud].
4468 ///
4469 /// # Example
4470 /// ```ignore,no_run
4471 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4472 /// # let project_id = "project_id";
4473 /// # let location_id = "location_id";
4474 /// # let private_cloud_id = "private_cloud_id";
4475 /// let x = ShowVcenterCredentialsRequest::new().set_private_cloud(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4476 /// ```
4477 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4478 self.private_cloud = v.into();
4479 self
4480 }
4481
4482 /// Sets the value of [username][crate::model::ShowVcenterCredentialsRequest::username].
4483 ///
4484 /// # Example
4485 /// ```ignore,no_run
4486 /// # use google_cloud_vmwareengine_v1::model::ShowVcenterCredentialsRequest;
4487 /// let x = ShowVcenterCredentialsRequest::new().set_username("example");
4488 /// ```
4489 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4490 self.username = v.into();
4491 self
4492 }
4493}
4494
4495impl wkt::message::Message for ShowVcenterCredentialsRequest {
4496 fn typename() -> &'static str {
4497 "type.googleapis.com/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"
4498 }
4499}
4500
4501/// Request message for
4502/// [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]
4503///
4504/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]: crate::client::VmwareEngine::reset_nsx_credentials
4505#[derive(Clone, Default, PartialEq)]
4506#[non_exhaustive]
4507pub struct ResetNsxCredentialsRequest {
4508 /// Required. The resource name of the private cloud
4509 /// to reset credentials for.
4510 /// Resource names are schemeless URIs that follow the conventions in
4511 /// <https://cloud.google.com/apis/design/resource_names>.
4512 /// For example:
4513 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4514 pub private_cloud: std::string::String,
4515
4516 /// Optional. A request ID to identify requests. Specify a unique request ID
4517 /// so that if you must retry your request, the server will know to ignore
4518 /// the request if it has already been completed. The server guarantees that a
4519 /// request doesn't result in creation of duplicate commitments for at least 60
4520 /// minutes.
4521 ///
4522 /// For example, consider a situation where you make an initial request and the
4523 /// request times out. If you make the request again with the same request
4524 /// ID, the server can check if original operation with the same request ID
4525 /// was received, and if so, will ignore the second request. This prevents
4526 /// clients from accidentally creating duplicate commitments.
4527 ///
4528 /// The request ID must be a valid UUID with the exception that zero UUID is
4529 /// not supported (00000000-0000-0000-0000-000000000000).
4530 pub request_id: std::string::String,
4531
4532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4533}
4534
4535impl ResetNsxCredentialsRequest {
4536 /// Creates a new default instance.
4537 pub fn new() -> Self {
4538 std::default::Default::default()
4539 }
4540
4541 /// Sets the value of [private_cloud][crate::model::ResetNsxCredentialsRequest::private_cloud].
4542 ///
4543 /// # Example
4544 /// ```ignore,no_run
4545 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4546 /// # let project_id = "project_id";
4547 /// # let location_id = "location_id";
4548 /// # let private_cloud_id = "private_cloud_id";
4549 /// let x = ResetNsxCredentialsRequest::new().set_private_cloud(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4550 /// ```
4551 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4552 self.private_cloud = v.into();
4553 self
4554 }
4555
4556 /// Sets the value of [request_id][crate::model::ResetNsxCredentialsRequest::request_id].
4557 ///
4558 /// # Example
4559 /// ```ignore,no_run
4560 /// # use google_cloud_vmwareengine_v1::model::ResetNsxCredentialsRequest;
4561 /// let x = ResetNsxCredentialsRequest::new().set_request_id("example");
4562 /// ```
4563 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4564 self.request_id = v.into();
4565 self
4566 }
4567}
4568
4569impl wkt::message::Message for ResetNsxCredentialsRequest {
4570 fn typename() -> &'static str {
4571 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"
4572 }
4573}
4574
4575/// Request message for
4576/// [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]
4577///
4578/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]: crate::client::VmwareEngine::reset_vcenter_credentials
4579#[derive(Clone, Default, PartialEq)]
4580#[non_exhaustive]
4581pub struct ResetVcenterCredentialsRequest {
4582 /// Required. The resource name of the private cloud
4583 /// to reset credentials for.
4584 /// Resource names are schemeless URIs that follow the conventions in
4585 /// <https://cloud.google.com/apis/design/resource_names>.
4586 /// For example:
4587 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4588 pub private_cloud: std::string::String,
4589
4590 /// Optional. A request ID to identify requests. Specify a unique request ID
4591 /// so that if you must retry your request, the server will know to ignore
4592 /// the request if it has already been completed. The server guarantees that a
4593 /// request doesn't result in creation of duplicate commitments for at least 60
4594 /// minutes.
4595 ///
4596 /// For example, consider a situation where you make an initial request and the
4597 /// request times out. If you make the request again with the same request
4598 /// ID, the server can check if original operation with the same request ID
4599 /// was received, and if so, will ignore the second request. This prevents
4600 /// clients from accidentally creating duplicate commitments.
4601 ///
4602 /// The request ID must be a valid UUID with the exception that zero UUID is
4603 /// not supported (00000000-0000-0000-0000-000000000000).
4604 pub request_id: std::string::String,
4605
4606 /// Optional. The username of the user to be to reset the credentials.
4607 /// The default value of this field is CloudOwner@gve.local.
4608 /// The provided value should be one of the following:
4609 /// solution-user-01@gve.local,
4610 /// solution-user-02@gve.local,
4611 /// solution-user-03@gve.local,
4612 /// solution-user-04@gve.local,
4613 /// solution-user-05@gve.local,
4614 /// zertoadmin@gve.local.
4615 pub username: std::string::String,
4616
4617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4618}
4619
4620impl ResetVcenterCredentialsRequest {
4621 /// Creates a new default instance.
4622 pub fn new() -> Self {
4623 std::default::Default::default()
4624 }
4625
4626 /// Sets the value of [private_cloud][crate::model::ResetVcenterCredentialsRequest::private_cloud].
4627 ///
4628 /// # Example
4629 /// ```ignore,no_run
4630 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4631 /// # let project_id = "project_id";
4632 /// # let location_id = "location_id";
4633 /// # let private_cloud_id = "private_cloud_id";
4634 /// let x = ResetVcenterCredentialsRequest::new().set_private_cloud(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4635 /// ```
4636 pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.private_cloud = v.into();
4638 self
4639 }
4640
4641 /// Sets the value of [request_id][crate::model::ResetVcenterCredentialsRequest::request_id].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4646 /// let x = ResetVcenterCredentialsRequest::new().set_request_id("example");
4647 /// ```
4648 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4649 self.request_id = v.into();
4650 self
4651 }
4652
4653 /// Sets the value of [username][crate::model::ResetVcenterCredentialsRequest::username].
4654 ///
4655 /// # Example
4656 /// ```ignore,no_run
4657 /// # use google_cloud_vmwareengine_v1::model::ResetVcenterCredentialsRequest;
4658 /// let x = ResetVcenterCredentialsRequest::new().set_username("example");
4659 /// ```
4660 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4661 self.username = v.into();
4662 self
4663 }
4664}
4665
4666impl wkt::message::Message for ResetVcenterCredentialsRequest {
4667 fn typename() -> &'static str {
4668 "type.googleapis.com/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"
4669 }
4670}
4671
4672/// Response message for
4673/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4674///
4675/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4676#[derive(Clone, Default, PartialEq)]
4677#[non_exhaustive]
4678pub struct ListHcxActivationKeysResponse {
4679 /// List of HCX activation keys.
4680 pub hcx_activation_keys: std::vec::Vec<crate::model::HcxActivationKey>,
4681
4682 /// A token, which can be sent as `page_token` to retrieve the next page.
4683 /// If this field is omitted, there are no subsequent pages.
4684 pub next_page_token: std::string::String,
4685
4686 /// Locations that could not be reached when making an aggregated query using
4687 /// wildcards.
4688 pub unreachable: std::vec::Vec<std::string::String>,
4689
4690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4691}
4692
4693impl ListHcxActivationKeysResponse {
4694 /// Creates a new default instance.
4695 pub fn new() -> Self {
4696 std::default::Default::default()
4697 }
4698
4699 /// Sets the value of [hcx_activation_keys][crate::model::ListHcxActivationKeysResponse::hcx_activation_keys].
4700 ///
4701 /// # Example
4702 /// ```ignore,no_run
4703 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4704 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4705 /// let x = ListHcxActivationKeysResponse::new()
4706 /// .set_hcx_activation_keys([
4707 /// HcxActivationKey::default()/* use setters */,
4708 /// HcxActivationKey::default()/* use (different) setters */,
4709 /// ]);
4710 /// ```
4711 pub fn set_hcx_activation_keys<T, V>(mut self, v: T) -> Self
4712 where
4713 T: std::iter::IntoIterator<Item = V>,
4714 V: std::convert::Into<crate::model::HcxActivationKey>,
4715 {
4716 use std::iter::Iterator;
4717 self.hcx_activation_keys = v.into_iter().map(|i| i.into()).collect();
4718 self
4719 }
4720
4721 /// Sets the value of [next_page_token][crate::model::ListHcxActivationKeysResponse::next_page_token].
4722 ///
4723 /// # Example
4724 /// ```ignore,no_run
4725 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4726 /// let x = ListHcxActivationKeysResponse::new().set_next_page_token("example");
4727 /// ```
4728 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4729 self.next_page_token = v.into();
4730 self
4731 }
4732
4733 /// Sets the value of [unreachable][crate::model::ListHcxActivationKeysResponse::unreachable].
4734 ///
4735 /// # Example
4736 /// ```ignore,no_run
4737 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysResponse;
4738 /// let x = ListHcxActivationKeysResponse::new().set_unreachable(["a", "b", "c"]);
4739 /// ```
4740 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4741 where
4742 T: std::iter::IntoIterator<Item = V>,
4743 V: std::convert::Into<std::string::String>,
4744 {
4745 use std::iter::Iterator;
4746 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4747 self
4748 }
4749}
4750
4751impl wkt::message::Message for ListHcxActivationKeysResponse {
4752 fn typename() -> &'static str {
4753 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"
4754 }
4755}
4756
4757#[doc(hidden)]
4758impl google_cloud_gax::paginator::internal::PageableResponse for ListHcxActivationKeysResponse {
4759 type PageItem = crate::model::HcxActivationKey;
4760
4761 fn items(self) -> std::vec::Vec<Self::PageItem> {
4762 self.hcx_activation_keys
4763 }
4764
4765 fn next_page_token(&self) -> std::string::String {
4766 use std::clone::Clone;
4767 self.next_page_token.clone()
4768 }
4769}
4770
4771/// Request message for
4772/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
4773///
4774/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
4775#[derive(Clone, Default, PartialEq)]
4776#[non_exhaustive]
4777pub struct ListHcxActivationKeysRequest {
4778 /// Required. The resource name of the private cloud
4779 /// to be queried for HCX activation keys.
4780 /// Resource names are schemeless URIs that follow the conventions in
4781 /// <https://cloud.google.com/apis/design/resource_names>.
4782 /// For example:
4783 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4784 pub parent: std::string::String,
4785
4786 /// The maximum number of HCX activation keys to return in one page.
4787 /// The service may return fewer than this value.
4788 /// The maximum value is coerced to 1000.
4789 /// The default value of this field is 500.
4790 pub page_size: i32,
4791
4792 /// A page token, received from a previous `ListHcxActivationKeys` call.
4793 /// Provide this to retrieve the subsequent page.
4794 ///
4795 /// When paginating, all other parameters provided to
4796 /// `ListHcxActivationKeys` must match the call that provided the page
4797 /// token.
4798 pub page_token: std::string::String,
4799
4800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4801}
4802
4803impl ListHcxActivationKeysRequest {
4804 /// Creates a new default instance.
4805 pub fn new() -> Self {
4806 std::default::Default::default()
4807 }
4808
4809 /// Sets the value of [parent][crate::model::ListHcxActivationKeysRequest::parent].
4810 ///
4811 /// # Example
4812 /// ```ignore,no_run
4813 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4814 /// # let project_id = "project_id";
4815 /// # let location_id = "location_id";
4816 /// # let private_cloud_id = "private_cloud_id";
4817 /// let x = ListHcxActivationKeysRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4818 /// ```
4819 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4820 self.parent = v.into();
4821 self
4822 }
4823
4824 /// Sets the value of [page_size][crate::model::ListHcxActivationKeysRequest::page_size].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4829 /// let x = ListHcxActivationKeysRequest::new().set_page_size(42);
4830 /// ```
4831 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4832 self.page_size = v.into();
4833 self
4834 }
4835
4836 /// Sets the value of [page_token][crate::model::ListHcxActivationKeysRequest::page_token].
4837 ///
4838 /// # Example
4839 /// ```ignore,no_run
4840 /// # use google_cloud_vmwareengine_v1::model::ListHcxActivationKeysRequest;
4841 /// let x = ListHcxActivationKeysRequest::new().set_page_token("example");
4842 /// ```
4843 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4844 self.page_token = v.into();
4845 self
4846 }
4847}
4848
4849impl wkt::message::Message for ListHcxActivationKeysRequest {
4850 fn typename() -> &'static str {
4851 "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"
4852 }
4853}
4854
4855/// Request message for [VmwareEngine.GetHcxActivationKeys][]
4856#[derive(Clone, Default, PartialEq)]
4857#[non_exhaustive]
4858pub struct GetHcxActivationKeyRequest {
4859 /// Required. The resource name of the HCX activation key to retrieve.
4860 /// Resource names are schemeless URIs that follow the conventions in
4861 /// <https://cloud.google.com/apis/design/resource_names>.
4862 /// For example:
4863 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
4864 pub name: std::string::String,
4865
4866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4867}
4868
4869impl GetHcxActivationKeyRequest {
4870 /// Creates a new default instance.
4871 pub fn new() -> Self {
4872 std::default::Default::default()
4873 }
4874
4875 /// Sets the value of [name][crate::model::GetHcxActivationKeyRequest::name].
4876 ///
4877 /// # Example
4878 /// ```ignore,no_run
4879 /// # use google_cloud_vmwareengine_v1::model::GetHcxActivationKeyRequest;
4880 /// # let project_id = "project_id";
4881 /// # let location_id = "location_id";
4882 /// # let private_cloud_id = "private_cloud_id";
4883 /// # let hcx_activation_key_id = "hcx_activation_key_id";
4884 /// let x = GetHcxActivationKeyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/hcxActivationKeys/{hcx_activation_key_id}"));
4885 /// ```
4886 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4887 self.name = v.into();
4888 self
4889 }
4890}
4891
4892impl wkt::message::Message for GetHcxActivationKeyRequest {
4893 fn typename() -> &'static str {
4894 "type.googleapis.com/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"
4895 }
4896}
4897
4898/// Request message for
4899/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
4900///
4901/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
4902#[derive(Clone, Default, PartialEq)]
4903#[non_exhaustive]
4904pub struct CreateHcxActivationKeyRequest {
4905 /// Required. The resource name of the private cloud to create the key for.
4906 /// Resource names are schemeless URIs that follow the conventions in
4907 /// <https://cloud.google.com/apis/design/resource_names>.
4908 /// For example:
4909 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
4910 pub parent: std::string::String,
4911
4912 /// Required. The initial description of a new HCX activation key. When
4913 /// creating a new key, this field must be an empty object.
4914 pub hcx_activation_key: std::option::Option<crate::model::HcxActivationKey>,
4915
4916 /// Required. The user-provided identifier of the `HcxActivationKey` to be
4917 /// created. This identifier must be unique among `HcxActivationKey` resources
4918 /// within the parent and becomes the final token in the name URI.
4919 /// The identifier must meet the following requirements:
4920 ///
4921 /// * Only contains 1-63 alphanumeric characters and hyphens
4922 /// * Begins with an alphabetical character
4923 /// * Ends with a non-hyphen character
4924 /// * Not formatted as a UUID
4925 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
4926 /// (section 3.5)
4927 pub hcx_activation_key_id: std::string::String,
4928
4929 /// A request ID to identify requests. Specify a unique request ID
4930 /// so that if you must retry your request, the server will know to ignore
4931 /// the request if it has already been completed. The server guarantees that a
4932 /// request doesn't result in creation of duplicate commitments for at least 60
4933 /// minutes.
4934 ///
4935 /// For example, consider a situation where you make an initial request and the
4936 /// request times out. If you make the request again with the same request ID,
4937 /// the server can check if original operation with the same request ID was
4938 /// received, and if so, will ignore the second request. This prevents clients
4939 /// from accidentally creating duplicate commitments.
4940 ///
4941 /// The request ID must be a valid UUID with the exception that zero UUID is
4942 /// not supported (00000000-0000-0000-0000-000000000000).
4943 pub request_id: std::string::String,
4944
4945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4946}
4947
4948impl CreateHcxActivationKeyRequest {
4949 /// Creates a new default instance.
4950 pub fn new() -> Self {
4951 std::default::Default::default()
4952 }
4953
4954 /// Sets the value of [parent][crate::model::CreateHcxActivationKeyRequest::parent].
4955 ///
4956 /// # Example
4957 /// ```ignore,no_run
4958 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4959 /// # let project_id = "project_id";
4960 /// # let location_id = "location_id";
4961 /// # let private_cloud_id = "private_cloud_id";
4962 /// let x = CreateHcxActivationKeyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
4963 /// ```
4964 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4965 self.parent = v.into();
4966 self
4967 }
4968
4969 /// Sets the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4970 ///
4971 /// # Example
4972 /// ```ignore,no_run
4973 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4974 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4975 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key(HcxActivationKey::default()/* use setters */);
4976 /// ```
4977 pub fn set_hcx_activation_key<T>(mut self, v: T) -> Self
4978 where
4979 T: std::convert::Into<crate::model::HcxActivationKey>,
4980 {
4981 self.hcx_activation_key = std::option::Option::Some(v.into());
4982 self
4983 }
4984
4985 /// Sets or clears the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
4986 ///
4987 /// # Example
4988 /// ```ignore,no_run
4989 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
4990 /// use google_cloud_vmwareengine_v1::model::HcxActivationKey;
4991 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(Some(HcxActivationKey::default()/* use setters */));
4992 /// let x = CreateHcxActivationKeyRequest::new().set_or_clear_hcx_activation_key(None::<HcxActivationKey>);
4993 /// ```
4994 pub fn set_or_clear_hcx_activation_key<T>(mut self, v: std::option::Option<T>) -> Self
4995 where
4996 T: std::convert::Into<crate::model::HcxActivationKey>,
4997 {
4998 self.hcx_activation_key = v.map(|x| x.into());
4999 self
5000 }
5001
5002 /// Sets the value of [hcx_activation_key_id][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key_id].
5003 ///
5004 /// # Example
5005 /// ```ignore,no_run
5006 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
5007 /// let x = CreateHcxActivationKeyRequest::new().set_hcx_activation_key_id("example");
5008 /// ```
5009 pub fn set_hcx_activation_key_id<T: std::convert::Into<std::string::String>>(
5010 mut self,
5011 v: T,
5012 ) -> Self {
5013 self.hcx_activation_key_id = v.into();
5014 self
5015 }
5016
5017 /// Sets the value of [request_id][crate::model::CreateHcxActivationKeyRequest::request_id].
5018 ///
5019 /// # Example
5020 /// ```ignore,no_run
5021 /// # use google_cloud_vmwareengine_v1::model::CreateHcxActivationKeyRequest;
5022 /// let x = CreateHcxActivationKeyRequest::new().set_request_id("example");
5023 /// ```
5024 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5025 self.request_id = v.into();
5026 self
5027 }
5028}
5029
5030impl wkt::message::Message for CreateHcxActivationKeyRequest {
5031 fn typename() -> &'static str {
5032 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"
5033 }
5034}
5035
5036/// Request message for
5037/// [VmwareEngine.GetDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]
5038///
5039/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]: crate::client::VmwareEngine::get_dns_forwarding
5040#[derive(Clone, Default, PartialEq)]
5041#[non_exhaustive]
5042pub struct GetDnsForwardingRequest {
5043 /// Required. The resource name of a `DnsForwarding` to retrieve.
5044 /// Resource names are schemeless URIs that follow the conventions in
5045 /// <https://cloud.google.com/apis/design/resource_names>.
5046 /// For example:
5047 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
5048 pub name: std::string::String,
5049
5050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5051}
5052
5053impl GetDnsForwardingRequest {
5054 /// Creates a new default instance.
5055 pub fn new() -> Self {
5056 std::default::Default::default()
5057 }
5058
5059 /// Sets the value of [name][crate::model::GetDnsForwardingRequest::name].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_vmwareengine_v1::model::GetDnsForwardingRequest;
5064 /// # let project_id = "project_id";
5065 /// # let location_id = "location_id";
5066 /// # let private_cloud_id = "private_cloud_id";
5067 /// let x = GetDnsForwardingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/dnsForwarding"));
5068 /// ```
5069 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5070 self.name = v.into();
5071 self
5072 }
5073}
5074
5075impl wkt::message::Message for GetDnsForwardingRequest {
5076 fn typename() -> &'static str {
5077 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsForwardingRequest"
5078 }
5079}
5080
5081/// Request message for
5082/// [VmwareEngine.UpdateDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]
5083///
5084/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]: crate::client::VmwareEngine::update_dns_forwarding
5085#[derive(Clone, Default, PartialEq)]
5086#[non_exhaustive]
5087pub struct UpdateDnsForwardingRequest {
5088 /// Required. DnsForwarding config details.
5089 pub dns_forwarding: std::option::Option<crate::model::DnsForwarding>,
5090
5091 /// Required. Field mask is used to specify the fields to be overwritten in the
5092 /// `DnsForwarding` resource by the update.
5093 /// The fields specified in the `update_mask` are relative to the resource, not
5094 /// the full request. A field will be overwritten if it is in the mask. If the
5095 /// user does not provide a mask then all fields will be overwritten.
5096 pub update_mask: std::option::Option<wkt::FieldMask>,
5097
5098 /// Optional. A request ID to identify requests. Specify a unique request ID
5099 /// so that if you must retry your request, the server will know to ignore
5100 /// the request if it has already been completed. The server guarantees that a
5101 /// request doesn't result in creation of duplicate commitments for at least 60
5102 /// minutes.
5103 ///
5104 /// For example, consider a situation where you make an initial request and the
5105 /// request times out. If you make the request again with the same request ID,
5106 /// the server can check if original operation with the same request ID was
5107 /// received, and if so, will ignore the second request. This prevents clients
5108 /// from accidentally creating duplicate commitments.
5109 ///
5110 /// The request ID must be a valid UUID with the exception that zero UUID is
5111 /// not supported (00000000-0000-0000-0000-000000000000).
5112 pub request_id: std::string::String,
5113
5114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5115}
5116
5117impl UpdateDnsForwardingRequest {
5118 /// Creates a new default instance.
5119 pub fn new() -> Self {
5120 std::default::Default::default()
5121 }
5122
5123 /// Sets the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5128 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
5129 /// let x = UpdateDnsForwardingRequest::new().set_dns_forwarding(DnsForwarding::default()/* use setters */);
5130 /// ```
5131 pub fn set_dns_forwarding<T>(mut self, v: T) -> Self
5132 where
5133 T: std::convert::Into<crate::model::DnsForwarding>,
5134 {
5135 self.dns_forwarding = std::option::Option::Some(v.into());
5136 self
5137 }
5138
5139 /// Sets or clears the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
5140 ///
5141 /// # Example
5142 /// ```ignore,no_run
5143 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5144 /// use google_cloud_vmwareengine_v1::model::DnsForwarding;
5145 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(Some(DnsForwarding::default()/* use setters */));
5146 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_dns_forwarding(None::<DnsForwarding>);
5147 /// ```
5148 pub fn set_or_clear_dns_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
5149 where
5150 T: std::convert::Into<crate::model::DnsForwarding>,
5151 {
5152 self.dns_forwarding = v.map(|x| x.into());
5153 self
5154 }
5155
5156 /// Sets the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
5157 ///
5158 /// # Example
5159 /// ```ignore,no_run
5160 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5161 /// use wkt::FieldMask;
5162 /// let x = UpdateDnsForwardingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5163 /// ```
5164 pub fn set_update_mask<T>(mut self, v: T) -> Self
5165 where
5166 T: std::convert::Into<wkt::FieldMask>,
5167 {
5168 self.update_mask = std::option::Option::Some(v.into());
5169 self
5170 }
5171
5172 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
5173 ///
5174 /// # Example
5175 /// ```ignore,no_run
5176 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5177 /// use wkt::FieldMask;
5178 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5179 /// let x = UpdateDnsForwardingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5180 /// ```
5181 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5182 where
5183 T: std::convert::Into<wkt::FieldMask>,
5184 {
5185 self.update_mask = v.map(|x| x.into());
5186 self
5187 }
5188
5189 /// Sets the value of [request_id][crate::model::UpdateDnsForwardingRequest::request_id].
5190 ///
5191 /// # Example
5192 /// ```ignore,no_run
5193 /// # use google_cloud_vmwareengine_v1::model::UpdateDnsForwardingRequest;
5194 /// let x = UpdateDnsForwardingRequest::new().set_request_id("example");
5195 /// ```
5196 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5197 self.request_id = v.into();
5198 self
5199 }
5200}
5201
5202impl wkt::message::Message for UpdateDnsForwardingRequest {
5203 fn typename() -> &'static str {
5204 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest"
5205 }
5206}
5207
5208/// Request message for
5209/// [VmwareEngine.CreateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]
5210///
5211/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]: crate::client::VmwareEngine::create_network_peering
5212#[derive(Clone, Default, PartialEq)]
5213#[non_exhaustive]
5214pub struct CreateNetworkPeeringRequest {
5215 /// Required. The resource name of the location to create the new network
5216 /// peering in. This value is always `global`, because `NetworkPeering` is a
5217 /// global resource. Resource names are schemeless URIs that follow the
5218 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5219 /// example: `projects/my-project/locations/global`
5220 pub parent: std::string::String,
5221
5222 /// Required. The user-provided identifier of the new `NetworkPeering`.
5223 /// This identifier must be unique among `NetworkPeering` resources within the
5224 /// parent and becomes the final token in the name URI.
5225 /// The identifier must meet the following requirements:
5226 ///
5227 /// * Only contains 1-63 alphanumeric characters and hyphens
5228 /// * Begins with an alphabetical character
5229 /// * Ends with a non-hyphen character
5230 /// * Not formatted as a UUID
5231 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
5232 /// (section 3.5)
5233 pub network_peering_id: std::string::String,
5234
5235 /// Required. The initial description of the new network peering.
5236 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5237
5238 /// Optional. A request ID to identify requests. Specify a unique request ID
5239 /// so that if you must retry your request, the server will know to ignore
5240 /// the request if it has already been completed. The server guarantees that a
5241 /// request doesn't result in creation of duplicate commitments for at least 60
5242 /// minutes.
5243 ///
5244 /// For example, consider a situation where you make an initial request and the
5245 /// request times out. If you make the request again with the same request
5246 /// ID, the server can check if original operation with the same request ID
5247 /// was received, and if so, will ignore the second request. This prevents
5248 /// clients from accidentally creating duplicate commitments.
5249 ///
5250 /// The request ID must be a valid UUID with the exception that zero UUID is
5251 /// not supported (00000000-0000-0000-0000-000000000000).
5252 pub request_id: std::string::String,
5253
5254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5255}
5256
5257impl CreateNetworkPeeringRequest {
5258 /// Creates a new default instance.
5259 pub fn new() -> Self {
5260 std::default::Default::default()
5261 }
5262
5263 /// Sets the value of [parent][crate::model::CreateNetworkPeeringRequest::parent].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5268 /// let x = CreateNetworkPeeringRequest::new().set_parent("example");
5269 /// ```
5270 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271 self.parent = v.into();
5272 self
5273 }
5274
5275 /// Sets the value of [network_peering_id][crate::model::CreateNetworkPeeringRequest::network_peering_id].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5280 /// let x = CreateNetworkPeeringRequest::new().set_network_peering_id("example");
5281 /// ```
5282 pub fn set_network_peering_id<T: std::convert::Into<std::string::String>>(
5283 mut self,
5284 v: T,
5285 ) -> Self {
5286 self.network_peering_id = v.into();
5287 self
5288 }
5289
5290 /// Sets the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5291 ///
5292 /// # Example
5293 /// ```ignore,no_run
5294 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5295 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5296 /// let x = CreateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5297 /// ```
5298 pub fn set_network_peering<T>(mut self, v: T) -> Self
5299 where
5300 T: std::convert::Into<crate::model::NetworkPeering>,
5301 {
5302 self.network_peering = std::option::Option::Some(v.into());
5303 self
5304 }
5305
5306 /// Sets or clears the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
5307 ///
5308 /// # Example
5309 /// ```ignore,no_run
5310 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5311 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5312 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5313 /// let x = CreateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5314 /// ```
5315 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5316 where
5317 T: std::convert::Into<crate::model::NetworkPeering>,
5318 {
5319 self.network_peering = v.map(|x| x.into());
5320 self
5321 }
5322
5323 /// Sets the value of [request_id][crate::model::CreateNetworkPeeringRequest::request_id].
5324 ///
5325 /// # Example
5326 /// ```ignore,no_run
5327 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPeeringRequest;
5328 /// let x = CreateNetworkPeeringRequest::new().set_request_id("example");
5329 /// ```
5330 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5331 self.request_id = v.into();
5332 self
5333 }
5334}
5335
5336impl wkt::message::Message for CreateNetworkPeeringRequest {
5337 fn typename() -> &'static str {
5338 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest"
5339 }
5340}
5341
5342/// Request message for
5343/// [VmwareEngine.DeleteNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]
5344///
5345/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]: crate::client::VmwareEngine::delete_network_peering
5346#[derive(Clone, Default, PartialEq)]
5347#[non_exhaustive]
5348pub struct DeleteNetworkPeeringRequest {
5349 /// Required. The resource name of the network peering to be deleted.
5350 /// Resource names are schemeless URIs that follow the conventions in
5351 /// <https://cloud.google.com/apis/design/resource_names>.
5352 /// For example:
5353 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5354 pub name: std::string::String,
5355
5356 /// Optional. A request ID to identify requests. Specify a unique request ID
5357 /// so that if you must retry your request, the server will know to ignore
5358 /// the request if it has already been completed. The server guarantees that a
5359 /// request doesn't result in creation of duplicate commitments for at least 60
5360 /// minutes.
5361 ///
5362 /// For example, consider a situation where you make an initial request and the
5363 /// request times out. If you make the request again with the same request
5364 /// ID, the server can check if original operation with the same request ID
5365 /// was received, and if so, will ignore the second request. This prevents
5366 /// clients from accidentally creating duplicate commitments.
5367 ///
5368 /// The request ID must be a valid UUID with the exception that zero UUID is
5369 /// not supported (00000000-0000-0000-0000-000000000000).
5370 pub request_id: std::string::String,
5371
5372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5373}
5374
5375impl DeleteNetworkPeeringRequest {
5376 /// Creates a new default instance.
5377 pub fn new() -> Self {
5378 std::default::Default::default()
5379 }
5380
5381 /// Sets the value of [name][crate::model::DeleteNetworkPeeringRequest::name].
5382 ///
5383 /// # Example
5384 /// ```ignore,no_run
5385 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5386 /// # let project_id = "project_id";
5387 /// # let location_id = "location_id";
5388 /// # let network_peering_id = "network_peering_id";
5389 /// let x = DeleteNetworkPeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPeerings/{network_peering_id}"));
5390 /// ```
5391 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5392 self.name = v.into();
5393 self
5394 }
5395
5396 /// Sets the value of [request_id][crate::model::DeleteNetworkPeeringRequest::request_id].
5397 ///
5398 /// # Example
5399 /// ```ignore,no_run
5400 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPeeringRequest;
5401 /// let x = DeleteNetworkPeeringRequest::new().set_request_id("example");
5402 /// ```
5403 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5404 self.request_id = v.into();
5405 self
5406 }
5407}
5408
5409impl wkt::message::Message for DeleteNetworkPeeringRequest {
5410 fn typename() -> &'static str {
5411 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest"
5412 }
5413}
5414
5415/// Request message for
5416/// [VmwareEngine.GetNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]
5417///
5418/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]: crate::client::VmwareEngine::get_network_peering
5419#[derive(Clone, Default, PartialEq)]
5420#[non_exhaustive]
5421pub struct GetNetworkPeeringRequest {
5422 /// Required. The resource name of the network peering to retrieve.
5423 /// Resource names are schemeless URIs that follow the conventions in
5424 /// <https://cloud.google.com/apis/design/resource_names>.
5425 /// For example:
5426 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5427 pub name: std::string::String,
5428
5429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5430}
5431
5432impl GetNetworkPeeringRequest {
5433 /// Creates a new default instance.
5434 pub fn new() -> Self {
5435 std::default::Default::default()
5436 }
5437
5438 /// Sets the value of [name][crate::model::GetNetworkPeeringRequest::name].
5439 ///
5440 /// # Example
5441 /// ```ignore,no_run
5442 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPeeringRequest;
5443 /// # let project_id = "project_id";
5444 /// # let location_id = "location_id";
5445 /// # let network_peering_id = "network_peering_id";
5446 /// let x = GetNetworkPeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPeerings/{network_peering_id}"));
5447 /// ```
5448 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5449 self.name = v.into();
5450 self
5451 }
5452}
5453
5454impl wkt::message::Message for GetNetworkPeeringRequest {
5455 fn typename() -> &'static str {
5456 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPeeringRequest"
5457 }
5458}
5459
5460/// Request message for
5461/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5462///
5463/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5464#[derive(Clone, Default, PartialEq)]
5465#[non_exhaustive]
5466pub struct ListNetworkPeeringsRequest {
5467 /// Required. The resource name of the location (global) to query for
5468 /// network peerings. Resource names are schemeless URIs that follow the
5469 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
5470 /// example: `projects/my-project/locations/global`
5471 pub parent: std::string::String,
5472
5473 /// The maximum number of network peerings to return in one page.
5474 /// The maximum value is coerced to 1000.
5475 /// The default value of this field is 500.
5476 pub page_size: i32,
5477
5478 /// A page token, received from a previous `ListNetworkPeerings` call.
5479 /// Provide this to retrieve the subsequent page.
5480 ///
5481 /// When paginating, all other parameters provided to
5482 /// `ListNetworkPeerings` must match the call that provided the page
5483 /// token.
5484 pub page_token: std::string::String,
5485
5486 /// A filter expression that matches resources returned in the response.
5487 /// The expression must specify the field name, a comparison
5488 /// operator, and the value that you want to use for filtering. The value
5489 /// must be a string, a number, or a boolean. The comparison operator
5490 /// must be `=`, `!=`, `>`, or `<`.
5491 ///
5492 /// For example, if you are filtering a list of network peerings, you can
5493 /// exclude the ones named `example-peering` by specifying
5494 /// `name != "example-peering"`.
5495 ///
5496 /// To filter on multiple expressions, provide each separate expression within
5497 /// parentheses. For example:
5498 ///
5499 /// ```norust
5500 /// (name = "example-peering")
5501 /// (createTime > "2021-04-12T08:15:10.40Z")
5502 /// ```
5503 ///
5504 /// By default, each expression is an `AND` expression. However, you
5505 /// can include `AND` and `OR` expressions explicitly.
5506 /// For example:
5507 ///
5508 /// ```norust
5509 /// (name = "example-peering-1") AND
5510 /// (createTime > "2021-04-12T08:15:10.40Z") OR
5511 /// (name = "example-peering-2")
5512 /// ```
5513 pub filter: std::string::String,
5514
5515 /// Sorts list results by a certain order. By default, returned results
5516 /// are ordered by `name` in ascending order.
5517 /// You can also sort results in descending order based on the `name` value
5518 /// using `orderBy="name desc"`.
5519 /// Currently, only ordering by `name` is supported.
5520 pub order_by: std::string::String,
5521
5522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5523}
5524
5525impl ListNetworkPeeringsRequest {
5526 /// Creates a new default instance.
5527 pub fn new() -> Self {
5528 std::default::Default::default()
5529 }
5530
5531 /// Sets the value of [parent][crate::model::ListNetworkPeeringsRequest::parent].
5532 ///
5533 /// # Example
5534 /// ```ignore,no_run
5535 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5536 /// # let project_id = "project_id";
5537 /// # let location_id = "location_id";
5538 /// let x = ListNetworkPeeringsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5539 /// ```
5540 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5541 self.parent = v.into();
5542 self
5543 }
5544
5545 /// Sets the value of [page_size][crate::model::ListNetworkPeeringsRequest::page_size].
5546 ///
5547 /// # Example
5548 /// ```ignore,no_run
5549 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5550 /// let x = ListNetworkPeeringsRequest::new().set_page_size(42);
5551 /// ```
5552 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5553 self.page_size = v.into();
5554 self
5555 }
5556
5557 /// Sets the value of [page_token][crate::model::ListNetworkPeeringsRequest::page_token].
5558 ///
5559 /// # Example
5560 /// ```ignore,no_run
5561 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5562 /// let x = ListNetworkPeeringsRequest::new().set_page_token("example");
5563 /// ```
5564 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5565 self.page_token = v.into();
5566 self
5567 }
5568
5569 /// Sets the value of [filter][crate::model::ListNetworkPeeringsRequest::filter].
5570 ///
5571 /// # Example
5572 /// ```ignore,no_run
5573 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5574 /// let x = ListNetworkPeeringsRequest::new().set_filter("example");
5575 /// ```
5576 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5577 self.filter = v.into();
5578 self
5579 }
5580
5581 /// Sets the value of [order_by][crate::model::ListNetworkPeeringsRequest::order_by].
5582 ///
5583 /// # Example
5584 /// ```ignore,no_run
5585 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsRequest;
5586 /// let x = ListNetworkPeeringsRequest::new().set_order_by("example");
5587 /// ```
5588 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5589 self.order_by = v.into();
5590 self
5591 }
5592}
5593
5594impl wkt::message::Message for ListNetworkPeeringsRequest {
5595 fn typename() -> &'static str {
5596 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest"
5597 }
5598}
5599
5600/// Request message for
5601/// [VmwareEngine.UpdateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]
5602///
5603/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]: crate::client::VmwareEngine::update_network_peering
5604#[derive(Clone, Default, PartialEq)]
5605#[non_exhaustive]
5606pub struct UpdateNetworkPeeringRequest {
5607 /// Required. Network peering description.
5608 pub network_peering: std::option::Option<crate::model::NetworkPeering>,
5609
5610 /// Required. Field mask is used to specify the fields to be overwritten in the
5611 /// `NetworkPeering` resource by the update.
5612 /// The fields specified in the `update_mask` are relative to the resource, not
5613 /// the full request. A field will be overwritten if it is in the mask. If the
5614 /// user does not provide a mask then all fields will be overwritten.
5615 pub update_mask: std::option::Option<wkt::FieldMask>,
5616
5617 /// Optional. A request ID to identify requests. Specify a unique request ID
5618 /// so that if you must retry your request, the server will know to ignore
5619 /// the request if it has already been completed. The server guarantees that a
5620 /// request doesn't result in creation of duplicate commitments for at least 60
5621 /// minutes.
5622 ///
5623 /// For example, consider a situation where you make an initial request and the
5624 /// request times out. If you make the request again with the same request
5625 /// ID, the server can check if original operation with the same request ID
5626 /// was received, and if so, will ignore the second request. This prevents
5627 /// clients from accidentally creating duplicate commitments.
5628 ///
5629 /// The request ID must be a valid UUID with the exception that zero UUID is
5630 /// not supported (00000000-0000-0000-0000-000000000000).
5631 pub request_id: std::string::String,
5632
5633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5634}
5635
5636impl UpdateNetworkPeeringRequest {
5637 /// Creates a new default instance.
5638 pub fn new() -> Self {
5639 std::default::Default::default()
5640 }
5641
5642 /// Sets the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5643 ///
5644 /// # Example
5645 /// ```ignore,no_run
5646 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5647 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5648 /// let x = UpdateNetworkPeeringRequest::new().set_network_peering(NetworkPeering::default()/* use setters */);
5649 /// ```
5650 pub fn set_network_peering<T>(mut self, v: T) -> Self
5651 where
5652 T: std::convert::Into<crate::model::NetworkPeering>,
5653 {
5654 self.network_peering = std::option::Option::Some(v.into());
5655 self
5656 }
5657
5658 /// Sets or clears the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
5659 ///
5660 /// # Example
5661 /// ```ignore,no_run
5662 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5663 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5664 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(Some(NetworkPeering::default()/* use setters */));
5665 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_network_peering(None::<NetworkPeering>);
5666 /// ```
5667 pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
5668 where
5669 T: std::convert::Into<crate::model::NetworkPeering>,
5670 {
5671 self.network_peering = v.map(|x| x.into());
5672 self
5673 }
5674
5675 /// Sets the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5676 ///
5677 /// # Example
5678 /// ```ignore,no_run
5679 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5680 /// use wkt::FieldMask;
5681 /// let x = UpdateNetworkPeeringRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5682 /// ```
5683 pub fn set_update_mask<T>(mut self, v: T) -> Self
5684 where
5685 T: std::convert::Into<wkt::FieldMask>,
5686 {
5687 self.update_mask = std::option::Option::Some(v.into());
5688 self
5689 }
5690
5691 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
5692 ///
5693 /// # Example
5694 /// ```ignore,no_run
5695 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5696 /// use wkt::FieldMask;
5697 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5698 /// let x = UpdateNetworkPeeringRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5699 /// ```
5700 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5701 where
5702 T: std::convert::Into<wkt::FieldMask>,
5703 {
5704 self.update_mask = v.map(|x| x.into());
5705 self
5706 }
5707
5708 /// Sets the value of [request_id][crate::model::UpdateNetworkPeeringRequest::request_id].
5709 ///
5710 /// # Example
5711 /// ```ignore,no_run
5712 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPeeringRequest;
5713 /// let x = UpdateNetworkPeeringRequest::new().set_request_id("example");
5714 /// ```
5715 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5716 self.request_id = v.into();
5717 self
5718 }
5719}
5720
5721impl wkt::message::Message for UpdateNetworkPeeringRequest {
5722 fn typename() -> &'static str {
5723 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest"
5724 }
5725}
5726
5727/// Response message for
5728/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
5729///
5730/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
5731#[derive(Clone, Default, PartialEq)]
5732#[non_exhaustive]
5733pub struct ListNetworkPeeringsResponse {
5734 /// A list of network peerings.
5735 pub network_peerings: std::vec::Vec<crate::model::NetworkPeering>,
5736
5737 /// A token, which can be sent as `page_token` to retrieve the next page.
5738 /// If this field is omitted, there are no subsequent pages.
5739 pub next_page_token: std::string::String,
5740
5741 /// Unreachable resources.
5742 pub unreachable: std::vec::Vec<std::string::String>,
5743
5744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5745}
5746
5747impl ListNetworkPeeringsResponse {
5748 /// Creates a new default instance.
5749 pub fn new() -> Self {
5750 std::default::Default::default()
5751 }
5752
5753 /// Sets the value of [network_peerings][crate::model::ListNetworkPeeringsResponse::network_peerings].
5754 ///
5755 /// # Example
5756 /// ```ignore,no_run
5757 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5758 /// use google_cloud_vmwareengine_v1::model::NetworkPeering;
5759 /// let x = ListNetworkPeeringsResponse::new()
5760 /// .set_network_peerings([
5761 /// NetworkPeering::default()/* use setters */,
5762 /// NetworkPeering::default()/* use (different) setters */,
5763 /// ]);
5764 /// ```
5765 pub fn set_network_peerings<T, V>(mut self, v: T) -> Self
5766 where
5767 T: std::iter::IntoIterator<Item = V>,
5768 V: std::convert::Into<crate::model::NetworkPeering>,
5769 {
5770 use std::iter::Iterator;
5771 self.network_peerings = v.into_iter().map(|i| i.into()).collect();
5772 self
5773 }
5774
5775 /// Sets the value of [next_page_token][crate::model::ListNetworkPeeringsResponse::next_page_token].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5780 /// let x = ListNetworkPeeringsResponse::new().set_next_page_token("example");
5781 /// ```
5782 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5783 self.next_page_token = v.into();
5784 self
5785 }
5786
5787 /// Sets the value of [unreachable][crate::model::ListNetworkPeeringsResponse::unreachable].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPeeringsResponse;
5792 /// let x = ListNetworkPeeringsResponse::new().set_unreachable(["a", "b", "c"]);
5793 /// ```
5794 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5795 where
5796 T: std::iter::IntoIterator<Item = V>,
5797 V: std::convert::Into<std::string::String>,
5798 {
5799 use std::iter::Iterator;
5800 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5801 self
5802 }
5803}
5804
5805impl wkt::message::Message for ListNetworkPeeringsResponse {
5806 fn typename() -> &'static str {
5807 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse"
5808 }
5809}
5810
5811#[doc(hidden)]
5812impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPeeringsResponse {
5813 type PageItem = crate::model::NetworkPeering;
5814
5815 fn items(self) -> std::vec::Vec<Self::PageItem> {
5816 self.network_peerings
5817 }
5818
5819 fn next_page_token(&self) -> std::string::String {
5820 use std::clone::Clone;
5821 self.next_page_token.clone()
5822 }
5823}
5824
5825/// Request message for
5826/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5827///
5828/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5829#[derive(Clone, Default, PartialEq)]
5830#[non_exhaustive]
5831pub struct ListPeeringRoutesRequest {
5832 /// Required. The resource name of the network peering to retrieve peering
5833 /// routes from. Resource names are schemeless URIs that follow the conventions
5834 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
5835 /// `projects/my-project/locations/global/networkPeerings/my-peering`
5836 pub parent: std::string::String,
5837
5838 /// The maximum number of peering routes to return in one page.
5839 /// The service may return fewer than this value.
5840 /// The maximum value is coerced to 1000.
5841 /// The default value of this field is 500.
5842 pub page_size: i32,
5843
5844 /// A page token, received from a previous `ListPeeringRoutes` call.
5845 /// Provide this to retrieve the subsequent page.
5846 /// When paginating, all other parameters provided to `ListPeeringRoutes` must
5847 /// match the call that provided the page token.
5848 pub page_token: std::string::String,
5849
5850 /// A filter expression that matches resources returned in the response.
5851 /// Currently, only filtering on the `direction` field is supported. To return
5852 /// routes imported from the peer network, provide "direction=INCOMING". To
5853 /// return routes exported from the VMware Engine network, provide
5854 /// "direction=OUTGOING". Other filter expressions return an error.
5855 pub filter: std::string::String,
5856
5857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5858}
5859
5860impl ListPeeringRoutesRequest {
5861 /// Creates a new default instance.
5862 pub fn new() -> Self {
5863 std::default::Default::default()
5864 }
5865
5866 /// Sets the value of [parent][crate::model::ListPeeringRoutesRequest::parent].
5867 ///
5868 /// # Example
5869 /// ```ignore,no_run
5870 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5871 /// # let project_id = "project_id";
5872 /// # let location_id = "location_id";
5873 /// # let network_peering_id = "network_peering_id";
5874 /// let x = ListPeeringRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/networkPeerings/{network_peering_id}"));
5875 /// ```
5876 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5877 self.parent = v.into();
5878 self
5879 }
5880
5881 /// Sets the value of [page_size][crate::model::ListPeeringRoutesRequest::page_size].
5882 ///
5883 /// # Example
5884 /// ```ignore,no_run
5885 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5886 /// let x = ListPeeringRoutesRequest::new().set_page_size(42);
5887 /// ```
5888 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5889 self.page_size = v.into();
5890 self
5891 }
5892
5893 /// Sets the value of [page_token][crate::model::ListPeeringRoutesRequest::page_token].
5894 ///
5895 /// # Example
5896 /// ```ignore,no_run
5897 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5898 /// let x = ListPeeringRoutesRequest::new().set_page_token("example");
5899 /// ```
5900 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5901 self.page_token = v.into();
5902 self
5903 }
5904
5905 /// Sets the value of [filter][crate::model::ListPeeringRoutesRequest::filter].
5906 ///
5907 /// # Example
5908 /// ```ignore,no_run
5909 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesRequest;
5910 /// let x = ListPeeringRoutesRequest::new().set_filter("example");
5911 /// ```
5912 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5913 self.filter = v.into();
5914 self
5915 }
5916}
5917
5918impl wkt::message::Message for ListPeeringRoutesRequest {
5919 fn typename() -> &'static str {
5920 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesRequest"
5921 }
5922}
5923
5924/// Response message for
5925/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
5926///
5927/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
5928#[derive(Clone, Default, PartialEq)]
5929#[non_exhaustive]
5930pub struct ListPeeringRoutesResponse {
5931 /// A list of peering routes.
5932 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
5933
5934 /// A token, which can be sent as `page_token` to retrieve the next page.
5935 /// If this field is omitted, there are no subsequent pages.
5936 pub next_page_token: std::string::String,
5937
5938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5939}
5940
5941impl ListPeeringRoutesResponse {
5942 /// Creates a new default instance.
5943 pub fn new() -> Self {
5944 std::default::Default::default()
5945 }
5946
5947 /// Sets the value of [peering_routes][crate::model::ListPeeringRoutesResponse::peering_routes].
5948 ///
5949 /// # Example
5950 /// ```ignore,no_run
5951 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5952 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
5953 /// let x = ListPeeringRoutesResponse::new()
5954 /// .set_peering_routes([
5955 /// PeeringRoute::default()/* use setters */,
5956 /// PeeringRoute::default()/* use (different) setters */,
5957 /// ]);
5958 /// ```
5959 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
5960 where
5961 T: std::iter::IntoIterator<Item = V>,
5962 V: std::convert::Into<crate::model::PeeringRoute>,
5963 {
5964 use std::iter::Iterator;
5965 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
5966 self
5967 }
5968
5969 /// Sets the value of [next_page_token][crate::model::ListPeeringRoutesResponse::next_page_token].
5970 ///
5971 /// # Example
5972 /// ```ignore,no_run
5973 /// # use google_cloud_vmwareengine_v1::model::ListPeeringRoutesResponse;
5974 /// let x = ListPeeringRoutesResponse::new().set_next_page_token("example");
5975 /// ```
5976 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5977 self.next_page_token = v.into();
5978 self
5979 }
5980}
5981
5982impl wkt::message::Message for ListPeeringRoutesResponse {
5983 fn typename() -> &'static str {
5984 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesResponse"
5985 }
5986}
5987
5988#[doc(hidden)]
5989impl google_cloud_gax::paginator::internal::PageableResponse for ListPeeringRoutesResponse {
5990 type PageItem = crate::model::PeeringRoute;
5991
5992 fn items(self) -> std::vec::Vec<Self::PageItem> {
5993 self.peering_routes
5994 }
5995
5996 fn next_page_token(&self) -> std::string::String {
5997 use std::clone::Clone;
5998 self.next_page_token.clone()
5999 }
6000}
6001
6002/// Request message for
6003/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
6004///
6005/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
6006#[derive(Clone, Default, PartialEq)]
6007#[non_exhaustive]
6008pub struct ListNetworkPoliciesRequest {
6009 /// Required. The resource name of the location (region) to query for
6010 /// network policies. Resource names are schemeless URIs that follow the
6011 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
6012 /// example: `projects/my-project/locations/us-central1`
6013 pub parent: std::string::String,
6014
6015 /// The maximum number of network policies to return in one page.
6016 /// The service may return fewer than this value.
6017 /// The maximum value is coerced to 1000.
6018 /// The default value of this field is 500.
6019 pub page_size: i32,
6020
6021 /// A page token, received from a previous `ListNetworkPolicies` call.
6022 /// Provide this to retrieve the subsequent page.
6023 ///
6024 /// When paginating, all other parameters provided to
6025 /// `ListNetworkPolicies` must match the call that provided the page
6026 /// token.
6027 pub page_token: std::string::String,
6028
6029 /// A filter expression that matches resources returned in the response.
6030 /// The expression must specify the field name, a comparison
6031 /// operator, and the value that you want to use for filtering. The value
6032 /// must be a string, a number, or a boolean. The comparison operator
6033 /// must be `=`, `!=`, `>`, or `<`.
6034 ///
6035 /// For example, if you are filtering a list of network policies, you can
6036 /// exclude the ones named `example-policy` by specifying
6037 /// `name != "example-policy"`.
6038 ///
6039 /// To filter on multiple expressions, provide each separate expression within
6040 /// parentheses. For example:
6041 ///
6042 /// ```norust
6043 /// (name = "example-policy")
6044 /// (createTime > "2021-04-12T08:15:10.40Z")
6045 /// ```
6046 ///
6047 /// By default, each expression is an `AND` expression. However, you
6048 /// can include `AND` and `OR` expressions explicitly.
6049 /// For example:
6050 ///
6051 /// ```norust
6052 /// (name = "example-policy-1") AND
6053 /// (createTime > "2021-04-12T08:15:10.40Z") OR
6054 /// (name = "example-policy-2")
6055 /// ```
6056 pub filter: std::string::String,
6057
6058 /// Sorts list results by a certain order. By default, returned results
6059 /// are ordered by `name` in ascending order.
6060 /// You can also sort results in descending order based on the `name` value
6061 /// using `orderBy="name desc"`.
6062 /// Currently, only ordering by `name` is supported.
6063 pub order_by: std::string::String,
6064
6065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6066}
6067
6068impl ListNetworkPoliciesRequest {
6069 /// Creates a new default instance.
6070 pub fn new() -> Self {
6071 std::default::Default::default()
6072 }
6073
6074 /// Sets the value of [parent][crate::model::ListNetworkPoliciesRequest::parent].
6075 ///
6076 /// # Example
6077 /// ```ignore,no_run
6078 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
6079 /// # let project_id = "project_id";
6080 /// # let location_id = "location_id";
6081 /// let x = ListNetworkPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6082 /// ```
6083 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6084 self.parent = v.into();
6085 self
6086 }
6087
6088 /// Sets the value of [page_size][crate::model::ListNetworkPoliciesRequest::page_size].
6089 ///
6090 /// # Example
6091 /// ```ignore,no_run
6092 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
6093 /// let x = ListNetworkPoliciesRequest::new().set_page_size(42);
6094 /// ```
6095 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6096 self.page_size = v.into();
6097 self
6098 }
6099
6100 /// Sets the value of [page_token][crate::model::ListNetworkPoliciesRequest::page_token].
6101 ///
6102 /// # Example
6103 /// ```ignore,no_run
6104 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
6105 /// let x = ListNetworkPoliciesRequest::new().set_page_token("example");
6106 /// ```
6107 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6108 self.page_token = v.into();
6109 self
6110 }
6111
6112 /// Sets the value of [filter][crate::model::ListNetworkPoliciesRequest::filter].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
6117 /// let x = ListNetworkPoliciesRequest::new().set_filter("example");
6118 /// ```
6119 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6120 self.filter = v.into();
6121 self
6122 }
6123
6124 /// Sets the value of [order_by][crate::model::ListNetworkPoliciesRequest::order_by].
6125 ///
6126 /// # Example
6127 /// ```ignore,no_run
6128 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesRequest;
6129 /// let x = ListNetworkPoliciesRequest::new().set_order_by("example");
6130 /// ```
6131 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6132 self.order_by = v.into();
6133 self
6134 }
6135}
6136
6137impl wkt::message::Message for ListNetworkPoliciesRequest {
6138 fn typename() -> &'static str {
6139 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"
6140 }
6141}
6142
6143/// Response message for
6144/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
6145///
6146/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
6147#[derive(Clone, Default, PartialEq)]
6148#[non_exhaustive]
6149pub struct ListNetworkPoliciesResponse {
6150 /// A list of network policies.
6151 pub network_policies: std::vec::Vec<crate::model::NetworkPolicy>,
6152
6153 /// A token, which can be send as `page_token` to retrieve the next page.
6154 /// If this field is omitted, there are no subsequent pages.
6155 pub next_page_token: std::string::String,
6156
6157 /// Locations that could not be reached when making an aggregated query using
6158 /// wildcards.
6159 pub unreachable: std::vec::Vec<std::string::String>,
6160
6161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6162}
6163
6164impl ListNetworkPoliciesResponse {
6165 /// Creates a new default instance.
6166 pub fn new() -> Self {
6167 std::default::Default::default()
6168 }
6169
6170 /// Sets the value of [network_policies][crate::model::ListNetworkPoliciesResponse::network_policies].
6171 ///
6172 /// # Example
6173 /// ```ignore,no_run
6174 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6175 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6176 /// let x = ListNetworkPoliciesResponse::new()
6177 /// .set_network_policies([
6178 /// NetworkPolicy::default()/* use setters */,
6179 /// NetworkPolicy::default()/* use (different) setters */,
6180 /// ]);
6181 /// ```
6182 pub fn set_network_policies<T, V>(mut self, v: T) -> Self
6183 where
6184 T: std::iter::IntoIterator<Item = V>,
6185 V: std::convert::Into<crate::model::NetworkPolicy>,
6186 {
6187 use std::iter::Iterator;
6188 self.network_policies = v.into_iter().map(|i| i.into()).collect();
6189 self
6190 }
6191
6192 /// Sets the value of [next_page_token][crate::model::ListNetworkPoliciesResponse::next_page_token].
6193 ///
6194 /// # Example
6195 /// ```ignore,no_run
6196 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6197 /// let x = ListNetworkPoliciesResponse::new().set_next_page_token("example");
6198 /// ```
6199 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6200 self.next_page_token = v.into();
6201 self
6202 }
6203
6204 /// Sets the value of [unreachable][crate::model::ListNetworkPoliciesResponse::unreachable].
6205 ///
6206 /// # Example
6207 /// ```ignore,no_run
6208 /// # use google_cloud_vmwareengine_v1::model::ListNetworkPoliciesResponse;
6209 /// let x = ListNetworkPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
6210 /// ```
6211 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6212 where
6213 T: std::iter::IntoIterator<Item = V>,
6214 V: std::convert::Into<std::string::String>,
6215 {
6216 use std::iter::Iterator;
6217 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6218 self
6219 }
6220}
6221
6222impl wkt::message::Message for ListNetworkPoliciesResponse {
6223 fn typename() -> &'static str {
6224 "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"
6225 }
6226}
6227
6228#[doc(hidden)]
6229impl google_cloud_gax::paginator::internal::PageableResponse for ListNetworkPoliciesResponse {
6230 type PageItem = crate::model::NetworkPolicy;
6231
6232 fn items(self) -> std::vec::Vec<Self::PageItem> {
6233 self.network_policies
6234 }
6235
6236 fn next_page_token(&self) -> std::string::String {
6237 use std::clone::Clone;
6238 self.next_page_token.clone()
6239 }
6240}
6241
6242/// Request message for
6243/// [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]
6244///
6245/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]: crate::client::VmwareEngine::get_network_policy
6246#[derive(Clone, Default, PartialEq)]
6247#[non_exhaustive]
6248pub struct GetNetworkPolicyRequest {
6249 /// Required. The resource name of the network policy to retrieve.
6250 /// Resource names are schemeless URIs that follow the conventions in
6251 /// <https://cloud.google.com/apis/design/resource_names>.
6252 /// For example:
6253 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6254 pub name: std::string::String,
6255
6256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6257}
6258
6259impl GetNetworkPolicyRequest {
6260 /// Creates a new default instance.
6261 pub fn new() -> Self {
6262 std::default::Default::default()
6263 }
6264
6265 /// Sets the value of [name][crate::model::GetNetworkPolicyRequest::name].
6266 ///
6267 /// # Example
6268 /// ```ignore,no_run
6269 /// # use google_cloud_vmwareengine_v1::model::GetNetworkPolicyRequest;
6270 /// # let project_id = "project_id";
6271 /// # let location_id = "location_id";
6272 /// # let network_policy_id = "network_policy_id";
6273 /// let x = GetNetworkPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
6274 /// ```
6275 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6276 self.name = v.into();
6277 self
6278 }
6279}
6280
6281impl wkt::message::Message for GetNetworkPolicyRequest {
6282 fn typename() -> &'static str {
6283 "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"
6284 }
6285}
6286
6287/// Request message for
6288/// [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]
6289///
6290/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]: crate::client::VmwareEngine::update_network_policy
6291#[derive(Clone, Default, PartialEq)]
6292#[non_exhaustive]
6293pub struct UpdateNetworkPolicyRequest {
6294 /// Required. Network policy description.
6295 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6296
6297 /// Required. Field mask is used to specify the fields to be overwritten in the
6298 /// `NetworkPolicy` resource by the update.
6299 /// The fields specified in the `update_mask` are relative to the resource, not
6300 /// the full request. A field will be overwritten if it is in the mask. If the
6301 /// user does not provide a mask then all fields will be overwritten.
6302 pub update_mask: std::option::Option<wkt::FieldMask>,
6303
6304 /// Optional. A request ID to identify requests. Specify a unique request ID
6305 /// so that if you must retry your request, the server will know to ignore
6306 /// the request if it has already been completed. The server guarantees that a
6307 /// request doesn't result in creation of duplicate commitments for at least 60
6308 /// minutes.
6309 ///
6310 /// For example, consider a situation where you make an initial request and the
6311 /// request times out. If you make the request again with the same request
6312 /// ID, the server can check if original operation with the same request ID
6313 /// was received, and if so, will ignore the second request. This prevents
6314 /// clients from accidentally creating duplicate commitments.
6315 ///
6316 /// The request ID must be a valid UUID with the exception that zero UUID is
6317 /// not supported (00000000-0000-0000-0000-000000000000).
6318 pub request_id: std::string::String,
6319
6320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6321}
6322
6323impl UpdateNetworkPolicyRequest {
6324 /// Creates a new default instance.
6325 pub fn new() -> Self {
6326 std::default::Default::default()
6327 }
6328
6329 /// Sets the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6330 ///
6331 /// # Example
6332 /// ```ignore,no_run
6333 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6334 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6335 /// let x = UpdateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6336 /// ```
6337 pub fn set_network_policy<T>(mut self, v: T) -> Self
6338 where
6339 T: std::convert::Into<crate::model::NetworkPolicy>,
6340 {
6341 self.network_policy = std::option::Option::Some(v.into());
6342 self
6343 }
6344
6345 /// Sets or clears the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
6346 ///
6347 /// # Example
6348 /// ```ignore,no_run
6349 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6350 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6351 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6352 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6353 /// ```
6354 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6355 where
6356 T: std::convert::Into<crate::model::NetworkPolicy>,
6357 {
6358 self.network_policy = v.map(|x| x.into());
6359 self
6360 }
6361
6362 /// Sets the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6363 ///
6364 /// # Example
6365 /// ```ignore,no_run
6366 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6367 /// use wkt::FieldMask;
6368 /// let x = UpdateNetworkPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6369 /// ```
6370 pub fn set_update_mask<T>(mut self, v: T) -> Self
6371 where
6372 T: std::convert::Into<wkt::FieldMask>,
6373 {
6374 self.update_mask = std::option::Option::Some(v.into());
6375 self
6376 }
6377
6378 /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
6379 ///
6380 /// # Example
6381 /// ```ignore,no_run
6382 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6383 /// use wkt::FieldMask;
6384 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6385 /// let x = UpdateNetworkPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6386 /// ```
6387 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6388 where
6389 T: std::convert::Into<wkt::FieldMask>,
6390 {
6391 self.update_mask = v.map(|x| x.into());
6392 self
6393 }
6394
6395 /// Sets the value of [request_id][crate::model::UpdateNetworkPolicyRequest::request_id].
6396 ///
6397 /// # Example
6398 /// ```ignore,no_run
6399 /// # use google_cloud_vmwareengine_v1::model::UpdateNetworkPolicyRequest;
6400 /// let x = UpdateNetworkPolicyRequest::new().set_request_id("example");
6401 /// ```
6402 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6403 self.request_id = v.into();
6404 self
6405 }
6406}
6407
6408impl wkt::message::Message for UpdateNetworkPolicyRequest {
6409 fn typename() -> &'static str {
6410 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"
6411 }
6412}
6413
6414/// Request message for
6415/// [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]
6416///
6417/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]: crate::client::VmwareEngine::create_network_policy
6418#[derive(Clone, Default, PartialEq)]
6419#[non_exhaustive]
6420pub struct CreateNetworkPolicyRequest {
6421 /// Required. The resource name of the location (region)
6422 /// to create the new network policy in.
6423 /// Resource names are schemeless URIs that follow the conventions in
6424 /// <https://cloud.google.com/apis/design/resource_names>.
6425 /// For example:
6426 /// `projects/my-project/locations/us-central1`
6427 pub parent: std::string::String,
6428
6429 /// Required. The user-provided identifier of the network policy to be created.
6430 /// This identifier must be unique within parent
6431 /// `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
6432 /// the final token in the name URI.
6433 /// The identifier must meet the following requirements:
6434 ///
6435 /// * Only contains 1-63 alphanumeric characters and hyphens
6436 /// * Begins with an alphabetical character
6437 /// * Ends with a non-hyphen character
6438 /// * Not formatted as a UUID
6439 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6440 /// (section 3.5)
6441 pub network_policy_id: std::string::String,
6442
6443 /// Required. The network policy configuration to use in the request.
6444 pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
6445
6446 /// Optional. A request ID to identify requests. Specify a unique request ID
6447 /// so that if you must retry your request, the server will know to ignore
6448 /// the request if it has already been completed. The server guarantees that a
6449 /// request doesn't result in creation of duplicate commitments for at least 60
6450 /// minutes.
6451 ///
6452 /// For example, consider a situation where you make an initial request and the
6453 /// request times out. If you make the request again with the same request
6454 /// ID, the server can check if original operation with the same request ID
6455 /// was received, and if so, will ignore the second request. This prevents
6456 /// clients from accidentally creating duplicate commitments.
6457 ///
6458 /// The request ID must be a valid UUID with the exception that zero UUID is
6459 /// not supported (00000000-0000-0000-0000-000000000000).
6460 pub request_id: std::string::String,
6461
6462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6463}
6464
6465impl CreateNetworkPolicyRequest {
6466 /// Creates a new default instance.
6467 pub fn new() -> Self {
6468 std::default::Default::default()
6469 }
6470
6471 /// Sets the value of [parent][crate::model::CreateNetworkPolicyRequest::parent].
6472 ///
6473 /// # Example
6474 /// ```ignore,no_run
6475 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6476 /// # let project_id = "project_id";
6477 /// # let location_id = "location_id";
6478 /// let x = CreateNetworkPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6479 /// ```
6480 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6481 self.parent = v.into();
6482 self
6483 }
6484
6485 /// Sets the value of [network_policy_id][crate::model::CreateNetworkPolicyRequest::network_policy_id].
6486 ///
6487 /// # Example
6488 /// ```ignore,no_run
6489 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6490 /// let x = CreateNetworkPolicyRequest::new().set_network_policy_id("example");
6491 /// ```
6492 pub fn set_network_policy_id<T: std::convert::Into<std::string::String>>(
6493 mut self,
6494 v: T,
6495 ) -> Self {
6496 self.network_policy_id = v.into();
6497 self
6498 }
6499
6500 /// Sets the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6501 ///
6502 /// # Example
6503 /// ```ignore,no_run
6504 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6505 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6506 /// let x = CreateNetworkPolicyRequest::new().set_network_policy(NetworkPolicy::default()/* use setters */);
6507 /// ```
6508 pub fn set_network_policy<T>(mut self, v: T) -> Self
6509 where
6510 T: std::convert::Into<crate::model::NetworkPolicy>,
6511 {
6512 self.network_policy = std::option::Option::Some(v.into());
6513 self
6514 }
6515
6516 /// Sets or clears the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
6517 ///
6518 /// # Example
6519 /// ```ignore,no_run
6520 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6521 /// use google_cloud_vmwareengine_v1::model::NetworkPolicy;
6522 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(Some(NetworkPolicy::default()/* use setters */));
6523 /// let x = CreateNetworkPolicyRequest::new().set_or_clear_network_policy(None::<NetworkPolicy>);
6524 /// ```
6525 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
6526 where
6527 T: std::convert::Into<crate::model::NetworkPolicy>,
6528 {
6529 self.network_policy = v.map(|x| x.into());
6530 self
6531 }
6532
6533 /// Sets the value of [request_id][crate::model::CreateNetworkPolicyRequest::request_id].
6534 ///
6535 /// # Example
6536 /// ```ignore,no_run
6537 /// # use google_cloud_vmwareengine_v1::model::CreateNetworkPolicyRequest;
6538 /// let x = CreateNetworkPolicyRequest::new().set_request_id("example");
6539 /// ```
6540 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6541 self.request_id = v.into();
6542 self
6543 }
6544}
6545
6546impl wkt::message::Message for CreateNetworkPolicyRequest {
6547 fn typename() -> &'static str {
6548 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"
6549 }
6550}
6551
6552/// Request message for
6553/// [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]
6554///
6555/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]: crate::client::VmwareEngine::delete_network_policy
6556#[derive(Clone, Default, PartialEq)]
6557#[non_exhaustive]
6558pub struct DeleteNetworkPolicyRequest {
6559 /// Required. The resource name of the network policy to delete.
6560 /// Resource names are schemeless URIs that follow the conventions in
6561 /// <https://cloud.google.com/apis/design/resource_names>.
6562 /// For example:
6563 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
6564 pub name: std::string::String,
6565
6566 /// Optional. A request ID to identify requests. Specify a unique request ID
6567 /// so that if you must retry your request, the server will know to ignore
6568 /// the request if it has already been completed. The server guarantees that a
6569 /// request doesn't result in creation of duplicate commitments for at least 60
6570 /// minutes.
6571 ///
6572 /// For example, consider a situation where you make an initial request and the
6573 /// request times out. If you make the request again with the same request
6574 /// ID, the server can check if original operation with the same request ID
6575 /// was received, and if so, will ignore the second request. This prevents
6576 /// clients from accidentally creating duplicate commitments.
6577 ///
6578 /// The request ID must be a valid UUID with the exception that zero UUID is
6579 /// not supported (00000000-0000-0000-0000-000000000000).
6580 pub request_id: std::string::String,
6581
6582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6583}
6584
6585impl DeleteNetworkPolicyRequest {
6586 /// Creates a new default instance.
6587 pub fn new() -> Self {
6588 std::default::Default::default()
6589 }
6590
6591 /// Sets the value of [name][crate::model::DeleteNetworkPolicyRequest::name].
6592 ///
6593 /// # Example
6594 /// ```ignore,no_run
6595 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6596 /// # let project_id = "project_id";
6597 /// # let location_id = "location_id";
6598 /// # let network_policy_id = "network_policy_id";
6599 /// let x = DeleteNetworkPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
6600 /// ```
6601 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6602 self.name = v.into();
6603 self
6604 }
6605
6606 /// Sets the value of [request_id][crate::model::DeleteNetworkPolicyRequest::request_id].
6607 ///
6608 /// # Example
6609 /// ```ignore,no_run
6610 /// # use google_cloud_vmwareengine_v1::model::DeleteNetworkPolicyRequest;
6611 /// let x = DeleteNetworkPolicyRequest::new().set_request_id("example");
6612 /// ```
6613 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6614 self.request_id = v.into();
6615 self
6616 }
6617}
6618
6619impl wkt::message::Message for DeleteNetworkPolicyRequest {
6620 fn typename() -> &'static str {
6621 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"
6622 }
6623}
6624
6625/// Request message for
6626/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6627///
6628/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6629#[derive(Clone, Default, PartialEq)]
6630#[non_exhaustive]
6631pub struct ListManagementDnsZoneBindingsRequest {
6632 /// Required. The resource name of the private cloud to be queried for
6633 /// management DNS zone bindings.
6634 /// Resource names are schemeless URIs that follow the conventions in
6635 /// <https://cloud.google.com/apis/design/resource_names>.
6636 /// For example:
6637 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6638 pub parent: std::string::String,
6639
6640 /// The maximum number of management DNS zone bindings to return in one page.
6641 /// The service may return fewer than this value.
6642 /// The maximum value is coerced to 1000.
6643 /// The default value of this field is 500.
6644 pub page_size: i32,
6645
6646 /// A page token, received from a previous `ListManagementDnsZoneBindings`
6647 /// call. Provide this to retrieve the subsequent page.
6648 ///
6649 /// When paginating, all other parameters provided to
6650 /// `ListManagementDnsZoneBindings` must match the call that provided the page
6651 /// token.
6652 pub page_token: std::string::String,
6653
6654 /// A filter expression that matches resources returned in the response.
6655 /// The expression must specify the field name, a comparison
6656 /// operator, and the value that you want to use for filtering. The value
6657 /// must be a string, a number, or a boolean. The comparison operator
6658 /// must be `=`, `!=`, `>`, or `<`.
6659 ///
6660 /// For example, if you are filtering a list of Management DNS Zone Bindings,
6661 /// you can exclude the ones named `example-management-dns-zone-binding` by
6662 /// specifying `name != "example-management-dns-zone-binding"`.
6663 ///
6664 /// To filter on multiple expressions, provide each separate expression within
6665 /// parentheses. For example:
6666 ///
6667 /// ```norust
6668 /// (name = "example-management-dns-zone-binding")
6669 /// (createTime > "2021-04-12T08:15:10.40Z")
6670 /// ```
6671 ///
6672 /// By default, each expression is an `AND` expression. However, you
6673 /// can include `AND` and `OR` expressions explicitly.
6674 /// For example:
6675 ///
6676 /// ```norust
6677 /// (name = "example-management-dns-zone-binding-1") AND
6678 /// (createTime > "2021-04-12T08:15:10.40Z") OR
6679 /// (name = "example-management-dns-zone-binding-2")
6680 /// ```
6681 pub filter: std::string::String,
6682
6683 /// Sorts list results by a certain order. By default, returned results
6684 /// are ordered by `name` in ascending order.
6685 /// You can also sort results in descending order based on the `name` value
6686 /// using `orderBy="name desc"`.
6687 /// Currently, only ordering by `name` is supported.
6688 pub order_by: std::string::String,
6689
6690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6691}
6692
6693impl ListManagementDnsZoneBindingsRequest {
6694 /// Creates a new default instance.
6695 pub fn new() -> Self {
6696 std::default::Default::default()
6697 }
6698
6699 /// Sets the value of [parent][crate::model::ListManagementDnsZoneBindingsRequest::parent].
6700 ///
6701 /// # Example
6702 /// ```ignore,no_run
6703 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6704 /// # let project_id = "project_id";
6705 /// # let location_id = "location_id";
6706 /// # let private_cloud_id = "private_cloud_id";
6707 /// let x = ListManagementDnsZoneBindingsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
6708 /// ```
6709 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6710 self.parent = v.into();
6711 self
6712 }
6713
6714 /// Sets the value of [page_size][crate::model::ListManagementDnsZoneBindingsRequest::page_size].
6715 ///
6716 /// # Example
6717 /// ```ignore,no_run
6718 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6719 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_size(42);
6720 /// ```
6721 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6722 self.page_size = v.into();
6723 self
6724 }
6725
6726 /// Sets the value of [page_token][crate::model::ListManagementDnsZoneBindingsRequest::page_token].
6727 ///
6728 /// # Example
6729 /// ```ignore,no_run
6730 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6731 /// let x = ListManagementDnsZoneBindingsRequest::new().set_page_token("example");
6732 /// ```
6733 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6734 self.page_token = v.into();
6735 self
6736 }
6737
6738 /// Sets the value of [filter][crate::model::ListManagementDnsZoneBindingsRequest::filter].
6739 ///
6740 /// # Example
6741 /// ```ignore,no_run
6742 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6743 /// let x = ListManagementDnsZoneBindingsRequest::new().set_filter("example");
6744 /// ```
6745 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6746 self.filter = v.into();
6747 self
6748 }
6749
6750 /// Sets the value of [order_by][crate::model::ListManagementDnsZoneBindingsRequest::order_by].
6751 ///
6752 /// # Example
6753 /// ```ignore,no_run
6754 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsRequest;
6755 /// let x = ListManagementDnsZoneBindingsRequest::new().set_order_by("example");
6756 /// ```
6757 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6758 self.order_by = v.into();
6759 self
6760 }
6761}
6762
6763impl wkt::message::Message for ListManagementDnsZoneBindingsRequest {
6764 fn typename() -> &'static str {
6765 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest"
6766 }
6767}
6768
6769/// Response message for
6770/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
6771///
6772/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
6773#[derive(Clone, Default, PartialEq)]
6774#[non_exhaustive]
6775pub struct ListManagementDnsZoneBindingsResponse {
6776 /// A list of management DNS zone bindings.
6777 pub management_dns_zone_bindings: std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
6778
6779 /// A token, which can be sent as `page_token` to retrieve the next page.
6780 /// If this field is omitted, there are no subsequent pages.
6781 pub next_page_token: std::string::String,
6782
6783 /// Locations that could not be reached when making an aggregated query using
6784 /// wildcards.
6785 pub unreachable: std::vec::Vec<std::string::String>,
6786
6787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6788}
6789
6790impl ListManagementDnsZoneBindingsResponse {
6791 /// Creates a new default instance.
6792 pub fn new() -> Self {
6793 std::default::Default::default()
6794 }
6795
6796 /// Sets the value of [management_dns_zone_bindings][crate::model::ListManagementDnsZoneBindingsResponse::management_dns_zone_bindings].
6797 ///
6798 /// # Example
6799 /// ```ignore,no_run
6800 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6801 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6802 /// let x = ListManagementDnsZoneBindingsResponse::new()
6803 /// .set_management_dns_zone_bindings([
6804 /// ManagementDnsZoneBinding::default()/* use setters */,
6805 /// ManagementDnsZoneBinding::default()/* use (different) setters */,
6806 /// ]);
6807 /// ```
6808 pub fn set_management_dns_zone_bindings<T, V>(mut self, v: T) -> Self
6809 where
6810 T: std::iter::IntoIterator<Item = V>,
6811 V: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6812 {
6813 use std::iter::Iterator;
6814 self.management_dns_zone_bindings = v.into_iter().map(|i| i.into()).collect();
6815 self
6816 }
6817
6818 /// Sets the value of [next_page_token][crate::model::ListManagementDnsZoneBindingsResponse::next_page_token].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6823 /// let x = ListManagementDnsZoneBindingsResponse::new().set_next_page_token("example");
6824 /// ```
6825 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6826 self.next_page_token = v.into();
6827 self
6828 }
6829
6830 /// Sets the value of [unreachable][crate::model::ListManagementDnsZoneBindingsResponse::unreachable].
6831 ///
6832 /// # Example
6833 /// ```ignore,no_run
6834 /// # use google_cloud_vmwareengine_v1::model::ListManagementDnsZoneBindingsResponse;
6835 /// let x = ListManagementDnsZoneBindingsResponse::new().set_unreachable(["a", "b", "c"]);
6836 /// ```
6837 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6838 where
6839 T: std::iter::IntoIterator<Item = V>,
6840 V: std::convert::Into<std::string::String>,
6841 {
6842 use std::iter::Iterator;
6843 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6844 self
6845 }
6846}
6847
6848impl wkt::message::Message for ListManagementDnsZoneBindingsResponse {
6849 fn typename() -> &'static str {
6850 "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse"
6851 }
6852}
6853
6854#[doc(hidden)]
6855impl google_cloud_gax::paginator::internal::PageableResponse
6856 for ListManagementDnsZoneBindingsResponse
6857{
6858 type PageItem = crate::model::ManagementDnsZoneBinding;
6859
6860 fn items(self) -> std::vec::Vec<Self::PageItem> {
6861 self.management_dns_zone_bindings
6862 }
6863
6864 fn next_page_token(&self) -> std::string::String {
6865 use std::clone::Clone;
6866 self.next_page_token.clone()
6867 }
6868}
6869
6870/// Request message for
6871/// [VmwareEngine.GetManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]
6872///
6873/// [google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]: crate::client::VmwareEngine::get_management_dns_zone_binding
6874#[derive(Clone, Default, PartialEq)]
6875#[non_exhaustive]
6876pub struct GetManagementDnsZoneBindingRequest {
6877 /// Required. The resource name of the management DNS zone binding to
6878 /// retrieve. Resource names are schemeless URIs that follow the conventions in
6879 /// <https://cloud.google.com/apis/design/resource_names>.
6880 /// For example:
6881 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
6882 pub name: std::string::String,
6883
6884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6885}
6886
6887impl GetManagementDnsZoneBindingRequest {
6888 /// Creates a new default instance.
6889 pub fn new() -> Self {
6890 std::default::Default::default()
6891 }
6892
6893 /// Sets the value of [name][crate::model::GetManagementDnsZoneBindingRequest::name].
6894 ///
6895 /// # Example
6896 /// ```ignore,no_run
6897 /// # use google_cloud_vmwareengine_v1::model::GetManagementDnsZoneBindingRequest;
6898 /// # let project_id = "project_id";
6899 /// # let location_id = "location_id";
6900 /// # let private_cloud_id = "private_cloud_id";
6901 /// # let management_dns_zone_binding_id = "management_dns_zone_binding_id";
6902 /// let x = GetManagementDnsZoneBindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/managementDnsZoneBindings/{management_dns_zone_binding_id}"));
6903 /// ```
6904 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6905 self.name = v.into();
6906 self
6907 }
6908}
6909
6910impl wkt::message::Message for GetManagementDnsZoneBindingRequest {
6911 fn typename() -> &'static str {
6912 "type.googleapis.com/google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest"
6913 }
6914}
6915
6916/// Request message for [VmwareEngine.CreateManagementDnsZoneBindings][]
6917#[derive(Clone, Default, PartialEq)]
6918#[non_exhaustive]
6919pub struct CreateManagementDnsZoneBindingRequest {
6920 /// Required. The resource name of the private cloud
6921 /// to create a new management DNS zone binding for.
6922 /// Resource names are schemeless URIs that follow the conventions in
6923 /// <https://cloud.google.com/apis/design/resource_names>.
6924 /// For example:
6925 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
6926 pub parent: std::string::String,
6927
6928 /// Required. The initial values for a new management DNS zone binding.
6929 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
6930
6931 /// Required. The user-provided identifier of the `ManagementDnsZoneBinding`
6932 /// resource to be created. This identifier must be unique among
6933 /// `ManagementDnsZoneBinding` resources within the parent and becomes the
6934 /// final token in the name URI. The identifier must meet the following
6935 /// requirements:
6936 ///
6937 /// * Only contains 1-63 alphanumeric characters and hyphens
6938 /// * Begins with an alphabetical character
6939 /// * Ends with a non-hyphen character
6940 /// * Not formatted as a UUID
6941 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6942 /// (section 3.5)
6943 pub management_dns_zone_binding_id: std::string::String,
6944
6945 /// Optional. A request ID to identify requests. Specify a unique request ID
6946 /// so that if you must retry your request, the server will know to ignore
6947 /// the request if it has already been completed. The server guarantees that a
6948 /// request doesn't result in creation of duplicate commitments for at least 60
6949 /// minutes.
6950 ///
6951 /// For example, consider a situation where you make an initial request and the
6952 /// request times out. If you make the request again with the same request ID,
6953 /// the server can check if the original operation with the same request ID was
6954 /// received, and if so, will ignore the second request. This prevents clients
6955 /// from accidentally creating duplicate commitments.
6956 ///
6957 /// The request ID must be a valid UUID with the exception that zero UUID is
6958 /// not supported (00000000-0000-0000-0000-000000000000).
6959 pub request_id: std::string::String,
6960
6961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6962}
6963
6964impl CreateManagementDnsZoneBindingRequest {
6965 /// Creates a new default instance.
6966 pub fn new() -> Self {
6967 std::default::Default::default()
6968 }
6969
6970 /// Sets the value of [parent][crate::model::CreateManagementDnsZoneBindingRequest::parent].
6971 ///
6972 /// # Example
6973 /// ```ignore,no_run
6974 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6975 /// # let project_id = "project_id";
6976 /// # let location_id = "location_id";
6977 /// # let private_cloud_id = "private_cloud_id";
6978 /// let x = CreateManagementDnsZoneBindingRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
6979 /// ```
6980 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6981 self.parent = v.into();
6982 self
6983 }
6984
6985 /// Sets the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
6986 ///
6987 /// # Example
6988 /// ```ignore,no_run
6989 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
6990 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
6991 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
6992 /// ```
6993 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
6994 where
6995 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
6996 {
6997 self.management_dns_zone_binding = std::option::Option::Some(v.into());
6998 self
6999 }
7000
7001 /// Sets or clears the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
7006 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
7007 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
7008 /// let x = CreateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
7009 /// ```
7010 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
7011 where
7012 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
7013 {
7014 self.management_dns_zone_binding = v.map(|x| x.into());
7015 self
7016 }
7017
7018 /// Sets the value of [management_dns_zone_binding_id][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding_id].
7019 ///
7020 /// # Example
7021 /// ```ignore,no_run
7022 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
7023 /// let x = CreateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding_id("example");
7024 /// ```
7025 pub fn set_management_dns_zone_binding_id<T: std::convert::Into<std::string::String>>(
7026 mut self,
7027 v: T,
7028 ) -> Self {
7029 self.management_dns_zone_binding_id = v.into();
7030 self
7031 }
7032
7033 /// Sets the value of [request_id][crate::model::CreateManagementDnsZoneBindingRequest::request_id].
7034 ///
7035 /// # Example
7036 /// ```ignore,no_run
7037 /// # use google_cloud_vmwareengine_v1::model::CreateManagementDnsZoneBindingRequest;
7038 /// let x = CreateManagementDnsZoneBindingRequest::new().set_request_id("example");
7039 /// ```
7040 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7041 self.request_id = v.into();
7042 self
7043 }
7044}
7045
7046impl wkt::message::Message for CreateManagementDnsZoneBindingRequest {
7047 fn typename() -> &'static str {
7048 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest"
7049 }
7050}
7051
7052/// Request message for
7053/// [VmwareEngine.UpdateManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]
7054///
7055/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]: crate::client::VmwareEngine::update_management_dns_zone_binding
7056#[derive(Clone, Default, PartialEq)]
7057#[non_exhaustive]
7058pub struct UpdateManagementDnsZoneBindingRequest {
7059 /// Required. Field mask is used to specify the fields to be overwritten in the
7060 /// `ManagementDnsZoneBinding` resource by the update.
7061 /// The fields specified in the `update_mask` are relative to the resource, not
7062 /// the full request. A field will be overwritten if it is in the mask. If the
7063 /// user does not provide a mask then all fields will be overwritten.
7064 pub update_mask: std::option::Option<wkt::FieldMask>,
7065
7066 /// Required. New values to update the management DNS zone binding with.
7067 pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
7068
7069 /// Optional. A request ID to identify requests. Specify a unique request ID
7070 /// so that if you must retry your request, the server will know to ignore
7071 /// the request if it has already been completed. The server guarantees that a
7072 /// request doesn't result in creation of duplicate commitments for at least 60
7073 /// minutes.
7074 ///
7075 /// For example, consider a situation where you make an initial request and the
7076 /// request times out. If you make the request again with the same request ID,
7077 /// the server can check if the original operation with the same request ID was
7078 /// received, and if so, will ignore the second request. This prevents clients
7079 /// from accidentally creating duplicate commitments.
7080 ///
7081 /// The request ID must be a valid UUID with the exception that zero UUID is
7082 /// not supported (00000000-0000-0000-0000-000000000000).
7083 pub request_id: std::string::String,
7084
7085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7086}
7087
7088impl UpdateManagementDnsZoneBindingRequest {
7089 /// Creates a new default instance.
7090 pub fn new() -> Self {
7091 std::default::Default::default()
7092 }
7093
7094 /// Sets the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
7095 ///
7096 /// # Example
7097 /// ```ignore,no_run
7098 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
7099 /// use wkt::FieldMask;
7100 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7101 /// ```
7102 pub fn set_update_mask<T>(mut self, v: T) -> Self
7103 where
7104 T: std::convert::Into<wkt::FieldMask>,
7105 {
7106 self.update_mask = std::option::Option::Some(v.into());
7107 self
7108 }
7109
7110 /// Sets or clears the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
7111 ///
7112 /// # Example
7113 /// ```ignore,no_run
7114 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
7115 /// use wkt::FieldMask;
7116 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7117 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7118 /// ```
7119 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7120 where
7121 T: std::convert::Into<wkt::FieldMask>,
7122 {
7123 self.update_mask = v.map(|x| x.into());
7124 self
7125 }
7126
7127 /// Sets the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
7128 ///
7129 /// # Example
7130 /// ```ignore,no_run
7131 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
7132 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
7133 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_management_dns_zone_binding(ManagementDnsZoneBinding::default()/* use setters */);
7134 /// ```
7135 pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
7136 where
7137 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
7138 {
7139 self.management_dns_zone_binding = std::option::Option::Some(v.into());
7140 self
7141 }
7142
7143 /// Sets or clears the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
7144 ///
7145 /// # Example
7146 /// ```ignore,no_run
7147 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
7148 /// use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
7149 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(Some(ManagementDnsZoneBinding::default()/* use setters */));
7150 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_or_clear_management_dns_zone_binding(None::<ManagementDnsZoneBinding>);
7151 /// ```
7152 pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
7153 where
7154 T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
7155 {
7156 self.management_dns_zone_binding = v.map(|x| x.into());
7157 self
7158 }
7159
7160 /// Sets the value of [request_id][crate::model::UpdateManagementDnsZoneBindingRequest::request_id].
7161 ///
7162 /// # Example
7163 /// ```ignore,no_run
7164 /// # use google_cloud_vmwareengine_v1::model::UpdateManagementDnsZoneBindingRequest;
7165 /// let x = UpdateManagementDnsZoneBindingRequest::new().set_request_id("example");
7166 /// ```
7167 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7168 self.request_id = v.into();
7169 self
7170 }
7171}
7172
7173impl wkt::message::Message for UpdateManagementDnsZoneBindingRequest {
7174 fn typename() -> &'static str {
7175 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest"
7176 }
7177}
7178
7179/// Request message for
7180/// [VmwareEngine.DeleteManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]
7181///
7182/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]: crate::client::VmwareEngine::delete_management_dns_zone_binding
7183#[derive(Clone, Default, PartialEq)]
7184#[non_exhaustive]
7185pub struct DeleteManagementDnsZoneBindingRequest {
7186 /// Required. The resource name of the management DNS zone binding to delete.
7187 /// Resource names are schemeless URIs that follow the conventions in
7188 /// <https://cloud.google.com/apis/design/resource_names>.
7189 /// For example:
7190 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
7191 pub name: std::string::String,
7192
7193 /// Optional. A request ID to identify requests. Specify a unique request ID
7194 /// so that if you must retry your request, the server will know to ignore
7195 /// the request if it has already been completed. The server guarantees that a
7196 /// request doesn't result in creation of duplicate commitments for at least 60
7197 /// minutes.
7198 ///
7199 /// For example, consider a situation where you make an initial request and the
7200 /// request times out. If you make the request again with the same request
7201 /// ID, the server can check if the original operation with the same request ID
7202 /// was received, and if so, will ignore the second request. This prevents
7203 /// clients from accidentally creating duplicate commitments.
7204 ///
7205 /// The request ID must be a valid UUID with the exception that zero UUID is
7206 /// not supported (00000000-0000-0000-0000-000000000000).
7207 pub request_id: std::string::String,
7208
7209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7210}
7211
7212impl DeleteManagementDnsZoneBindingRequest {
7213 /// Creates a new default instance.
7214 pub fn new() -> Self {
7215 std::default::Default::default()
7216 }
7217
7218 /// Sets the value of [name][crate::model::DeleteManagementDnsZoneBindingRequest::name].
7219 ///
7220 /// # Example
7221 /// ```ignore,no_run
7222 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7223 /// # let project_id = "project_id";
7224 /// # let location_id = "location_id";
7225 /// # let private_cloud_id = "private_cloud_id";
7226 /// # let management_dns_zone_binding_id = "management_dns_zone_binding_id";
7227 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/managementDnsZoneBindings/{management_dns_zone_binding_id}"));
7228 /// ```
7229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7230 self.name = v.into();
7231 self
7232 }
7233
7234 /// Sets the value of [request_id][crate::model::DeleteManagementDnsZoneBindingRequest::request_id].
7235 ///
7236 /// # Example
7237 /// ```ignore,no_run
7238 /// # use google_cloud_vmwareengine_v1::model::DeleteManagementDnsZoneBindingRequest;
7239 /// let x = DeleteManagementDnsZoneBindingRequest::new().set_request_id("example");
7240 /// ```
7241 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7242 self.request_id = v.into();
7243 self
7244 }
7245}
7246
7247impl wkt::message::Message for DeleteManagementDnsZoneBindingRequest {
7248 fn typename() -> &'static str {
7249 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest"
7250 }
7251}
7252
7253/// Request message for [VmwareEngine.RepairManagementDnsZoneBindings][]
7254#[derive(Clone, Default, PartialEq)]
7255#[non_exhaustive]
7256pub struct RepairManagementDnsZoneBindingRequest {
7257 /// Required. The resource name of the management DNS zone binding to repair.
7258 /// Resource names are schemeless URIs that follow the conventions in
7259 /// <https://cloud.google.com/apis/design/resource_names>.
7260 /// For example:
7261 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
7262 pub name: std::string::String,
7263
7264 /// Optional. A request ID to identify requests. Specify a unique request ID
7265 /// so that if you must retry your request, the server will know to ignore
7266 /// the request if it has already been completed. The server guarantees that a
7267 /// request doesn't result in creation of duplicate commitments for at least 60
7268 /// minutes.
7269 ///
7270 /// For example, consider a situation where you make an initial request and the
7271 /// request times out. If you make the request again with the same request ID,
7272 /// the server can check if the original operation with the same request ID was
7273 /// received, and if so, will ignore the second request. This prevents clients
7274 /// from accidentally creating duplicate commitments.
7275 ///
7276 /// The request ID must be a valid UUID with the exception that zero UUID is
7277 /// not supported (00000000-0000-0000-0000-000000000000).
7278 pub request_id: std::string::String,
7279
7280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7281}
7282
7283impl RepairManagementDnsZoneBindingRequest {
7284 /// Creates a new default instance.
7285 pub fn new() -> Self {
7286 std::default::Default::default()
7287 }
7288
7289 /// Sets the value of [name][crate::model::RepairManagementDnsZoneBindingRequest::name].
7290 ///
7291 /// # Example
7292 /// ```ignore,no_run
7293 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7294 /// # let project_id = "project_id";
7295 /// # let location_id = "location_id";
7296 /// # let private_cloud_id = "private_cloud_id";
7297 /// # let management_dns_zone_binding_id = "management_dns_zone_binding_id";
7298 /// let x = RepairManagementDnsZoneBindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/managementDnsZoneBindings/{management_dns_zone_binding_id}"));
7299 /// ```
7300 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7301 self.name = v.into();
7302 self
7303 }
7304
7305 /// Sets the value of [request_id][crate::model::RepairManagementDnsZoneBindingRequest::request_id].
7306 ///
7307 /// # Example
7308 /// ```ignore,no_run
7309 /// # use google_cloud_vmwareengine_v1::model::RepairManagementDnsZoneBindingRequest;
7310 /// let x = RepairManagementDnsZoneBindingRequest::new().set_request_id("example");
7311 /// ```
7312 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7313 self.request_id = v.into();
7314 self
7315 }
7316}
7317
7318impl wkt::message::Message for RepairManagementDnsZoneBindingRequest {
7319 fn typename() -> &'static str {
7320 "type.googleapis.com/google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest"
7321 }
7322}
7323
7324/// Request message for
7325/// [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]
7326///
7327/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]: crate::client::VmwareEngine::create_vmware_engine_network
7328#[derive(Clone, Default, PartialEq)]
7329#[non_exhaustive]
7330pub struct CreateVmwareEngineNetworkRequest {
7331 /// Required. The resource name of the location to create the new VMware Engine
7332 /// network in. A VMware Engine network of type
7333 /// `LEGACY` is a regional resource, and a VMware
7334 /// Engine network of type `STANDARD` is a global resource.
7335 /// Resource names are schemeless URIs that follow the conventions in
7336 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7337 /// `projects/my-project/locations/global`
7338 pub parent: std::string::String,
7339
7340 /// Required. The user-provided identifier of the new VMware Engine network.
7341 /// This identifier must be unique among VMware Engine network resources
7342 /// within the parent and becomes the final token in the name URI. The
7343 /// identifier must meet the following requirements:
7344 ///
7345 /// * For networks of type LEGACY, adheres to the format:
7346 /// `{region-id}-default`. Replace `{region-id}` with the region where you want
7347 /// to create the VMware Engine network. For example, "us-central1-default".
7348 /// * Only contains 1-63 alphanumeric characters and hyphens
7349 /// * Begins with an alphabetical character
7350 /// * Ends with a non-hyphen character
7351 /// * Not formatted as a UUID
7352 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7353 /// (section 3.5)
7354 pub vmware_engine_network_id: std::string::String,
7355
7356 /// Required. The initial description of the new VMware Engine network.
7357 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7358
7359 /// Optional. A request ID to identify requests. Specify a unique request ID
7360 /// so that if you must retry your request, the server will know to ignore
7361 /// the request if it has already been completed. The server guarantees that a
7362 /// request doesn't result in creation of duplicate commitments for at least 60
7363 /// minutes.
7364 ///
7365 /// For example, consider a situation where you make an initial request and the
7366 /// request times out. If you make the request again with the same request
7367 /// ID, the server can check if original operation with the same request ID
7368 /// was received, and if so, will ignore the second request. This prevents
7369 /// clients from accidentally creating duplicate commitments.
7370 ///
7371 /// The request ID must be a valid UUID with the exception that zero UUID is
7372 /// not supported (00000000-0000-0000-0000-000000000000).
7373 pub request_id: std::string::String,
7374
7375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7376}
7377
7378impl CreateVmwareEngineNetworkRequest {
7379 /// Creates a new default instance.
7380 pub fn new() -> Self {
7381 std::default::Default::default()
7382 }
7383
7384 /// Sets the value of [parent][crate::model::CreateVmwareEngineNetworkRequest::parent].
7385 ///
7386 /// # Example
7387 /// ```ignore,no_run
7388 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7389 /// # let project_id = "project_id";
7390 /// # let location_id = "location_id";
7391 /// let x = CreateVmwareEngineNetworkRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7392 /// ```
7393 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7394 self.parent = v.into();
7395 self
7396 }
7397
7398 /// Sets the value of [vmware_engine_network_id][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network_id].
7399 ///
7400 /// # Example
7401 /// ```ignore,no_run
7402 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7403 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network_id("example");
7404 /// ```
7405 pub fn set_vmware_engine_network_id<T: std::convert::Into<std::string::String>>(
7406 mut self,
7407 v: T,
7408 ) -> Self {
7409 self.vmware_engine_network_id = v.into();
7410 self
7411 }
7412
7413 /// Sets the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7414 ///
7415 /// # Example
7416 /// ```ignore,no_run
7417 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7418 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7419 /// let x = CreateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7420 /// ```
7421 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7422 where
7423 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7424 {
7425 self.vmware_engine_network = std::option::Option::Some(v.into());
7426 self
7427 }
7428
7429 /// Sets or clears the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
7430 ///
7431 /// # Example
7432 /// ```ignore,no_run
7433 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7434 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7435 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7436 /// let x = CreateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7437 /// ```
7438 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7439 where
7440 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7441 {
7442 self.vmware_engine_network = v.map(|x| x.into());
7443 self
7444 }
7445
7446 /// Sets the value of [request_id][crate::model::CreateVmwareEngineNetworkRequest::request_id].
7447 ///
7448 /// # Example
7449 /// ```ignore,no_run
7450 /// # use google_cloud_vmwareengine_v1::model::CreateVmwareEngineNetworkRequest;
7451 /// let x = CreateVmwareEngineNetworkRequest::new().set_request_id("example");
7452 /// ```
7453 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7454 self.request_id = v.into();
7455 self
7456 }
7457}
7458
7459impl wkt::message::Message for CreateVmwareEngineNetworkRequest {
7460 fn typename() -> &'static str {
7461 "type.googleapis.com/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"
7462 }
7463}
7464
7465/// Request message for
7466/// [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]
7467///
7468/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]: crate::client::VmwareEngine::update_vmware_engine_network
7469#[derive(Clone, Default, PartialEq)]
7470#[non_exhaustive]
7471pub struct UpdateVmwareEngineNetworkRequest {
7472 /// Required. VMware Engine network description.
7473 pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
7474
7475 /// Required. Field mask is used to specify the fields to be overwritten in the
7476 /// VMware Engine network resource by the update.
7477 /// The fields specified in the `update_mask` are relative to the resource, not
7478 /// the full request. A field will be overwritten if it is in the mask. If the
7479 /// user does not provide a mask then all fields will be overwritten. Only the
7480 /// following fields can be updated: `description`.
7481 pub update_mask: std::option::Option<wkt::FieldMask>,
7482
7483 /// Optional. A request ID to identify requests. Specify a unique request ID
7484 /// so that if you must retry your request, the server will know to ignore
7485 /// the request if it has already been completed. The server guarantees that a
7486 /// request doesn't result in creation of duplicate commitments for at least 60
7487 /// minutes.
7488 ///
7489 /// For example, consider a situation where you make an initial request and the
7490 /// request times out. If you make the request again with the same request
7491 /// ID, the server can check if original operation with the same request ID
7492 /// was received, and if so, will ignore the second request. This prevents
7493 /// clients from accidentally creating duplicate commitments.
7494 ///
7495 /// The request ID must be a valid UUID with the exception that zero UUID is
7496 /// not supported (00000000-0000-0000-0000-000000000000).
7497 pub request_id: std::string::String,
7498
7499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7500}
7501
7502impl UpdateVmwareEngineNetworkRequest {
7503 /// Creates a new default instance.
7504 pub fn new() -> Self {
7505 std::default::Default::default()
7506 }
7507
7508 /// Sets the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7509 ///
7510 /// # Example
7511 /// ```ignore,no_run
7512 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7513 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7514 /// let x = UpdateVmwareEngineNetworkRequest::new().set_vmware_engine_network(VmwareEngineNetwork::default()/* use setters */);
7515 /// ```
7516 pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
7517 where
7518 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7519 {
7520 self.vmware_engine_network = std::option::Option::Some(v.into());
7521 self
7522 }
7523
7524 /// Sets or clears the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
7525 ///
7526 /// # Example
7527 /// ```ignore,no_run
7528 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7529 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7530 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(Some(VmwareEngineNetwork::default()/* use setters */));
7531 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_vmware_engine_network(None::<VmwareEngineNetwork>);
7532 /// ```
7533 pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
7534 where
7535 T: std::convert::Into<crate::model::VmwareEngineNetwork>,
7536 {
7537 self.vmware_engine_network = v.map(|x| x.into());
7538 self
7539 }
7540
7541 /// Sets the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7542 ///
7543 /// # Example
7544 /// ```ignore,no_run
7545 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7546 /// use wkt::FieldMask;
7547 /// let x = UpdateVmwareEngineNetworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7548 /// ```
7549 pub fn set_update_mask<T>(mut self, v: T) -> Self
7550 where
7551 T: std::convert::Into<wkt::FieldMask>,
7552 {
7553 self.update_mask = std::option::Option::Some(v.into());
7554 self
7555 }
7556
7557 /// Sets or clears the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
7558 ///
7559 /// # Example
7560 /// ```ignore,no_run
7561 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7562 /// use wkt::FieldMask;
7563 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7564 /// let x = UpdateVmwareEngineNetworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7565 /// ```
7566 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7567 where
7568 T: std::convert::Into<wkt::FieldMask>,
7569 {
7570 self.update_mask = v.map(|x| x.into());
7571 self
7572 }
7573
7574 /// Sets the value of [request_id][crate::model::UpdateVmwareEngineNetworkRequest::request_id].
7575 ///
7576 /// # Example
7577 /// ```ignore,no_run
7578 /// # use google_cloud_vmwareengine_v1::model::UpdateVmwareEngineNetworkRequest;
7579 /// let x = UpdateVmwareEngineNetworkRequest::new().set_request_id("example");
7580 /// ```
7581 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7582 self.request_id = v.into();
7583 self
7584 }
7585}
7586
7587impl wkt::message::Message for UpdateVmwareEngineNetworkRequest {
7588 fn typename() -> &'static str {
7589 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"
7590 }
7591}
7592
7593/// Request message for
7594/// [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]
7595///
7596/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]: crate::client::VmwareEngine::delete_vmware_engine_network
7597#[derive(Clone, Default, PartialEq)]
7598#[non_exhaustive]
7599pub struct DeleteVmwareEngineNetworkRequest {
7600 /// Required. The resource name of the VMware Engine network to be deleted.
7601 /// Resource names are schemeless URIs that follow the conventions in
7602 /// <https://cloud.google.com/apis/design/resource_names>.
7603 /// For example:
7604 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7605 pub name: std::string::String,
7606
7607 /// Optional. A request ID to identify requests. Specify a unique request ID
7608 /// so that if you must retry your request, the server will know to ignore
7609 /// the request if it has already been completed. The server guarantees that a
7610 /// request doesn't result in creation of duplicate commitments for at least 60
7611 /// minutes.
7612 ///
7613 /// For example, consider a situation where you make an initial request and the
7614 /// request times out. If you make the request again with the same request
7615 /// ID, the server can check if original operation with the same request ID
7616 /// was received, and if so, will ignore the second request. This prevents
7617 /// clients from accidentally creating duplicate commitments.
7618 ///
7619 /// The request ID must be a valid UUID with the exception that zero UUID is
7620 /// not supported (00000000-0000-0000-0000-000000000000).
7621 pub request_id: std::string::String,
7622
7623 /// Optional. Checksum used to ensure that the user-provided value is up to
7624 /// date before the server processes the request. The server compares provided
7625 /// checksum with the current checksum of the resource. If the user-provided
7626 /// value is out of date, this request returns an `ABORTED` error.
7627 pub etag: std::string::String,
7628
7629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7630}
7631
7632impl DeleteVmwareEngineNetworkRequest {
7633 /// Creates a new default instance.
7634 pub fn new() -> Self {
7635 std::default::Default::default()
7636 }
7637
7638 /// Sets the value of [name][crate::model::DeleteVmwareEngineNetworkRequest::name].
7639 ///
7640 /// # Example
7641 /// ```ignore,no_run
7642 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7643 /// # let project_id = "project_id";
7644 /// # let location_id = "location_id";
7645 /// # let vmware_engine_network_id = "vmware_engine_network_id";
7646 /// let x = DeleteVmwareEngineNetworkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
7647 /// ```
7648 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7649 self.name = v.into();
7650 self
7651 }
7652
7653 /// Sets the value of [request_id][crate::model::DeleteVmwareEngineNetworkRequest::request_id].
7654 ///
7655 /// # Example
7656 /// ```ignore,no_run
7657 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7658 /// let x = DeleteVmwareEngineNetworkRequest::new().set_request_id("example");
7659 /// ```
7660 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7661 self.request_id = v.into();
7662 self
7663 }
7664
7665 /// Sets the value of [etag][crate::model::DeleteVmwareEngineNetworkRequest::etag].
7666 ///
7667 /// # Example
7668 /// ```ignore,no_run
7669 /// # use google_cloud_vmwareengine_v1::model::DeleteVmwareEngineNetworkRequest;
7670 /// let x = DeleteVmwareEngineNetworkRequest::new().set_etag("example");
7671 /// ```
7672 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7673 self.etag = v.into();
7674 self
7675 }
7676}
7677
7678impl wkt::message::Message for DeleteVmwareEngineNetworkRequest {
7679 fn typename() -> &'static str {
7680 "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"
7681 }
7682}
7683
7684/// Request message for
7685/// [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]
7686///
7687/// [google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]: crate::client::VmwareEngine::get_vmware_engine_network
7688#[derive(Clone, Default, PartialEq)]
7689#[non_exhaustive]
7690pub struct GetVmwareEngineNetworkRequest {
7691 /// Required. The resource name of the VMware Engine network to retrieve.
7692 /// Resource names are schemeless URIs that follow the conventions in
7693 /// <https://cloud.google.com/apis/design/resource_names>.
7694 /// For example:
7695 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
7696 pub name: std::string::String,
7697
7698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7699}
7700
7701impl GetVmwareEngineNetworkRequest {
7702 /// Creates a new default instance.
7703 pub fn new() -> Self {
7704 std::default::Default::default()
7705 }
7706
7707 /// Sets the value of [name][crate::model::GetVmwareEngineNetworkRequest::name].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_vmwareengine_v1::model::GetVmwareEngineNetworkRequest;
7712 /// # let project_id = "project_id";
7713 /// # let location_id = "location_id";
7714 /// # let vmware_engine_network_id = "vmware_engine_network_id";
7715 /// let x = GetVmwareEngineNetworkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
7716 /// ```
7717 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7718 self.name = v.into();
7719 self
7720 }
7721}
7722
7723impl wkt::message::Message for GetVmwareEngineNetworkRequest {
7724 fn typename() -> &'static str {
7725 "type.googleapis.com/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"
7726 }
7727}
7728
7729/// Request message for
7730/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7731///
7732/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7733#[derive(Clone, Default, PartialEq)]
7734#[non_exhaustive]
7735pub struct ListVmwareEngineNetworksRequest {
7736 /// Required. The resource name of the location to query for
7737 /// VMware Engine networks. Resource names are schemeless URIs that follow the
7738 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
7739 /// example: `projects/my-project/locations/global`
7740 pub parent: std::string::String,
7741
7742 /// The maximum number of results to return in one page.
7743 /// The maximum value is coerced to 1000.
7744 /// The default value of this field is 500.
7745 pub page_size: i32,
7746
7747 /// A page token, received from a previous `ListVmwareEngineNetworks` call.
7748 /// Provide this to retrieve the subsequent page.
7749 ///
7750 /// When paginating, all other parameters provided to
7751 /// `ListVmwareEngineNetworks` must match the call that provided the page
7752 /// token.
7753 pub page_token: std::string::String,
7754
7755 /// A filter expression that matches resources returned in the response.
7756 /// The expression must specify the field name, a comparison
7757 /// operator, and the value that you want to use for filtering. The value
7758 /// must be a string, a number, or a boolean. The comparison operator
7759 /// must be `=`, `!=`, `>`, or `<`.
7760 ///
7761 /// For example, if you are filtering a list of network peerings, you can
7762 /// exclude the ones named `example-network` by specifying
7763 /// `name != "example-network"`.
7764 ///
7765 /// To filter on multiple expressions, provide each separate expression within
7766 /// parentheses. For example:
7767 ///
7768 /// ```norust
7769 /// (name = "example-network")
7770 /// (createTime > "2021-04-12T08:15:10.40Z")
7771 /// ```
7772 ///
7773 /// By default, each expression is an `AND` expression. However, you
7774 /// can include `AND` and `OR` expressions explicitly.
7775 /// For example:
7776 ///
7777 /// ```norust
7778 /// (name = "example-network-1") AND
7779 /// (createTime > "2021-04-12T08:15:10.40Z") OR
7780 /// (name = "example-network-2")
7781 /// ```
7782 pub filter: std::string::String,
7783
7784 /// Sorts list results by a certain order. By default, returned results
7785 /// are ordered by `name` in ascending order.
7786 /// You can also sort results in descending order based on the `name` value
7787 /// using `orderBy="name desc"`.
7788 /// Currently, only ordering by `name` is supported.
7789 pub order_by: std::string::String,
7790
7791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7792}
7793
7794impl ListVmwareEngineNetworksRequest {
7795 /// Creates a new default instance.
7796 pub fn new() -> Self {
7797 std::default::Default::default()
7798 }
7799
7800 /// Sets the value of [parent][crate::model::ListVmwareEngineNetworksRequest::parent].
7801 ///
7802 /// # Example
7803 /// ```ignore,no_run
7804 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7805 /// let x = ListVmwareEngineNetworksRequest::new().set_parent("example");
7806 /// ```
7807 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7808 self.parent = v.into();
7809 self
7810 }
7811
7812 /// Sets the value of [page_size][crate::model::ListVmwareEngineNetworksRequest::page_size].
7813 ///
7814 /// # Example
7815 /// ```ignore,no_run
7816 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7817 /// let x = ListVmwareEngineNetworksRequest::new().set_page_size(42);
7818 /// ```
7819 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7820 self.page_size = v.into();
7821 self
7822 }
7823
7824 /// Sets the value of [page_token][crate::model::ListVmwareEngineNetworksRequest::page_token].
7825 ///
7826 /// # Example
7827 /// ```ignore,no_run
7828 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7829 /// let x = ListVmwareEngineNetworksRequest::new().set_page_token("example");
7830 /// ```
7831 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7832 self.page_token = v.into();
7833 self
7834 }
7835
7836 /// Sets the value of [filter][crate::model::ListVmwareEngineNetworksRequest::filter].
7837 ///
7838 /// # Example
7839 /// ```ignore,no_run
7840 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7841 /// let x = ListVmwareEngineNetworksRequest::new().set_filter("example");
7842 /// ```
7843 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7844 self.filter = v.into();
7845 self
7846 }
7847
7848 /// Sets the value of [order_by][crate::model::ListVmwareEngineNetworksRequest::order_by].
7849 ///
7850 /// # Example
7851 /// ```ignore,no_run
7852 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksRequest;
7853 /// let x = ListVmwareEngineNetworksRequest::new().set_order_by("example");
7854 /// ```
7855 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7856 self.order_by = v.into();
7857 self
7858 }
7859}
7860
7861impl wkt::message::Message for ListVmwareEngineNetworksRequest {
7862 fn typename() -> &'static str {
7863 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"
7864 }
7865}
7866
7867/// Response message for
7868/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
7869///
7870/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
7871#[derive(Clone, Default, PartialEq)]
7872#[non_exhaustive]
7873pub struct ListVmwareEngineNetworksResponse {
7874 /// A list of VMware Engine networks.
7875 pub vmware_engine_networks: std::vec::Vec<crate::model::VmwareEngineNetwork>,
7876
7877 /// A token, which can be sent as `page_token` to retrieve the next page.
7878 /// If this field is omitted, there are no subsequent pages.
7879 pub next_page_token: std::string::String,
7880
7881 /// Unreachable resources.
7882 pub unreachable: std::vec::Vec<std::string::String>,
7883
7884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7885}
7886
7887impl ListVmwareEngineNetworksResponse {
7888 /// Creates a new default instance.
7889 pub fn new() -> Self {
7890 std::default::Default::default()
7891 }
7892
7893 /// Sets the value of [vmware_engine_networks][crate::model::ListVmwareEngineNetworksResponse::vmware_engine_networks].
7894 ///
7895 /// # Example
7896 /// ```ignore,no_run
7897 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7898 /// use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
7899 /// let x = ListVmwareEngineNetworksResponse::new()
7900 /// .set_vmware_engine_networks([
7901 /// VmwareEngineNetwork::default()/* use setters */,
7902 /// VmwareEngineNetwork::default()/* use (different) setters */,
7903 /// ]);
7904 /// ```
7905 pub fn set_vmware_engine_networks<T, V>(mut self, v: T) -> Self
7906 where
7907 T: std::iter::IntoIterator<Item = V>,
7908 V: std::convert::Into<crate::model::VmwareEngineNetwork>,
7909 {
7910 use std::iter::Iterator;
7911 self.vmware_engine_networks = v.into_iter().map(|i| i.into()).collect();
7912 self
7913 }
7914
7915 /// Sets the value of [next_page_token][crate::model::ListVmwareEngineNetworksResponse::next_page_token].
7916 ///
7917 /// # Example
7918 /// ```ignore,no_run
7919 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7920 /// let x = ListVmwareEngineNetworksResponse::new().set_next_page_token("example");
7921 /// ```
7922 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7923 self.next_page_token = v.into();
7924 self
7925 }
7926
7927 /// Sets the value of [unreachable][crate::model::ListVmwareEngineNetworksResponse::unreachable].
7928 ///
7929 /// # Example
7930 /// ```ignore,no_run
7931 /// # use google_cloud_vmwareengine_v1::model::ListVmwareEngineNetworksResponse;
7932 /// let x = ListVmwareEngineNetworksResponse::new().set_unreachable(["a", "b", "c"]);
7933 /// ```
7934 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7935 where
7936 T: std::iter::IntoIterator<Item = V>,
7937 V: std::convert::Into<std::string::String>,
7938 {
7939 use std::iter::Iterator;
7940 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7941 self
7942 }
7943}
7944
7945impl wkt::message::Message for ListVmwareEngineNetworksResponse {
7946 fn typename() -> &'static str {
7947 "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"
7948 }
7949}
7950
7951#[doc(hidden)]
7952impl google_cloud_gax::paginator::internal::PageableResponse for ListVmwareEngineNetworksResponse {
7953 type PageItem = crate::model::VmwareEngineNetwork;
7954
7955 fn items(self) -> std::vec::Vec<Self::PageItem> {
7956 self.vmware_engine_networks
7957 }
7958
7959 fn next_page_token(&self) -> std::string::String {
7960 use std::clone::Clone;
7961 self.next_page_token.clone()
7962 }
7963}
7964
7965/// Request message for
7966/// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]
7967///
7968/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]: crate::client::VmwareEngine::create_private_connection
7969#[derive(Clone, Default, PartialEq)]
7970#[non_exhaustive]
7971pub struct CreatePrivateConnectionRequest {
7972 /// Required. The resource name of the location to create the new private
7973 /// connection in. Private connection is a regional resource.
7974 /// Resource names are schemeless URIs that follow the conventions in
7975 /// <https://cloud.google.com/apis/design/resource_names>. For example:
7976 /// `projects/my-project/locations/us-central1`
7977 pub parent: std::string::String,
7978
7979 /// Required. The user-provided identifier of the new private connection.
7980 /// This identifier must be unique among private connection resources
7981 /// within the parent and becomes the final token in the name URI. The
7982 /// identifier must meet the following requirements:
7983 ///
7984 /// * Only contains 1-63 alphanumeric characters and hyphens
7985 /// * Begins with an alphabetical character
7986 /// * Ends with a non-hyphen character
7987 /// * Not formatted as a UUID
7988 /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
7989 /// (section 3.5)
7990 pub private_connection_id: std::string::String,
7991
7992 /// Required. The initial description of the new private connection.
7993 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
7994
7995 /// Optional. A request ID to identify requests. Specify a unique request ID
7996 /// so that if you must retry your request, the server will know to ignore
7997 /// the request if it has already been completed. The server guarantees that a
7998 /// request doesn't result in creation of duplicate commitments for at least 60
7999 /// minutes.
8000 ///
8001 /// For example, consider a situation where you make an initial request and the
8002 /// request times out. If you make the request again with the same request
8003 /// ID, the server can check if original operation with the same request ID
8004 /// was received, and if so, will ignore the second request. This prevents
8005 /// clients from accidentally creating duplicate commitments.
8006 ///
8007 /// The request ID must be a valid UUID with the exception that zero UUID is
8008 /// not supported (00000000-0000-0000-0000-000000000000).
8009 pub request_id: std::string::String,
8010
8011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8012}
8013
8014impl CreatePrivateConnectionRequest {
8015 /// Creates a new default instance.
8016 pub fn new() -> Self {
8017 std::default::Default::default()
8018 }
8019
8020 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
8021 ///
8022 /// # Example
8023 /// ```ignore,no_run
8024 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
8025 /// # let project_id = "project_id";
8026 /// # let location_id = "location_id";
8027 /// let x = CreatePrivateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8028 /// ```
8029 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8030 self.parent = v.into();
8031 self
8032 }
8033
8034 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
8035 ///
8036 /// # Example
8037 /// ```ignore,no_run
8038 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
8039 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
8040 /// ```
8041 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
8042 mut self,
8043 v: T,
8044 ) -> Self {
8045 self.private_connection_id = v.into();
8046 self
8047 }
8048
8049 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
8050 ///
8051 /// # Example
8052 /// ```ignore,no_run
8053 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
8054 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8055 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
8056 /// ```
8057 pub fn set_private_connection<T>(mut self, v: T) -> Self
8058 where
8059 T: std::convert::Into<crate::model::PrivateConnection>,
8060 {
8061 self.private_connection = std::option::Option::Some(v.into());
8062 self
8063 }
8064
8065 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
8066 ///
8067 /// # Example
8068 /// ```ignore,no_run
8069 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
8070 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8071 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
8072 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
8073 /// ```
8074 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
8075 where
8076 T: std::convert::Into<crate::model::PrivateConnection>,
8077 {
8078 self.private_connection = v.map(|x| x.into());
8079 self
8080 }
8081
8082 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
8083 ///
8084 /// # Example
8085 /// ```ignore,no_run
8086 /// # use google_cloud_vmwareengine_v1::model::CreatePrivateConnectionRequest;
8087 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
8088 /// ```
8089 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8090 self.request_id = v.into();
8091 self
8092 }
8093}
8094
8095impl wkt::message::Message for CreatePrivateConnectionRequest {
8096 fn typename() -> &'static str {
8097 "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"
8098 }
8099}
8100
8101/// Request message for
8102/// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]
8103///
8104/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]: crate::client::VmwareEngine::get_private_connection
8105#[derive(Clone, Default, PartialEq)]
8106#[non_exhaustive]
8107pub struct GetPrivateConnectionRequest {
8108 /// Required. The resource name of the private connection to retrieve.
8109 /// Resource names are schemeless URIs that follow the conventions in
8110 /// <https://cloud.google.com/apis/design/resource_names>.
8111 /// For example:
8112 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
8113 pub name: std::string::String,
8114
8115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8116}
8117
8118impl GetPrivateConnectionRequest {
8119 /// Creates a new default instance.
8120 pub fn new() -> Self {
8121 std::default::Default::default()
8122 }
8123
8124 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
8125 ///
8126 /// # Example
8127 /// ```ignore,no_run
8128 /// # use google_cloud_vmwareengine_v1::model::GetPrivateConnectionRequest;
8129 /// # let project_id = "project_id";
8130 /// # let location_id = "location_id";
8131 /// # let private_connection_id = "private_connection_id";
8132 /// let x = GetPrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
8133 /// ```
8134 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8135 self.name = v.into();
8136 self
8137 }
8138}
8139
8140impl wkt::message::Message for GetPrivateConnectionRequest {
8141 fn typename() -> &'static str {
8142 "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"
8143 }
8144}
8145
8146/// Request message for
8147/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
8148///
8149/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
8150#[derive(Clone, Default, PartialEq)]
8151#[non_exhaustive]
8152pub struct ListPrivateConnectionsRequest {
8153 /// Required. The resource name of the location to query for
8154 /// private connections. Resource names are schemeless URIs that follow the
8155 /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
8156 /// example: `projects/my-project/locations/us-central1`
8157 pub parent: std::string::String,
8158
8159 /// The maximum number of private connections to return in one page.
8160 /// The maximum value is coerced to 1000.
8161 /// The default value of this field is 500.
8162 pub page_size: i32,
8163
8164 /// A page token, received from a previous `ListPrivateConnections` call.
8165 /// Provide this to retrieve the subsequent page.
8166 ///
8167 /// When paginating, all other parameters provided to
8168 /// `ListPrivateConnections` must match the call that provided the page
8169 /// token.
8170 pub page_token: std::string::String,
8171
8172 /// A filter expression that matches resources returned in the response.
8173 /// The expression must specify the field name, a comparison
8174 /// operator, and the value that you want to use for filtering. The value
8175 /// must be a string, a number, or a boolean. The comparison operator
8176 /// must be `=`, `!=`, `>`, or `<`.
8177 ///
8178 /// For example, if you are filtering a list of private connections, you can
8179 /// exclude the ones named `example-connection` by specifying
8180 /// `name != "example-connection"`.
8181 ///
8182 /// To filter on multiple expressions, provide each separate expression within
8183 /// parentheses. For example:
8184 ///
8185 /// ```norust
8186 /// (name = "example-connection")
8187 /// (createTime > "2022-09-22T08:15:10.40Z")
8188 /// ```
8189 ///
8190 /// By default, each expression is an `AND` expression. However, you
8191 /// can include `AND` and `OR` expressions explicitly.
8192 /// For example:
8193 ///
8194 /// ```norust
8195 /// (name = "example-connection-1") AND
8196 /// (createTime > "2021-04-12T08:15:10.40Z") OR
8197 /// (name = "example-connection-2")
8198 /// ```
8199 pub filter: std::string::String,
8200
8201 /// Sorts list results by a certain order. By default, returned results
8202 /// are ordered by `name` in ascending order.
8203 /// You can also sort results in descending order based on the `name` value
8204 /// using `orderBy="name desc"`.
8205 /// Currently, only ordering by `name` is supported.
8206 pub order_by: std::string::String,
8207
8208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8209}
8210
8211impl ListPrivateConnectionsRequest {
8212 /// Creates a new default instance.
8213 pub fn new() -> Self {
8214 std::default::Default::default()
8215 }
8216
8217 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
8218 ///
8219 /// # Example
8220 /// ```ignore,no_run
8221 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8222 /// # let project_id = "project_id";
8223 /// # let location_id = "location_id";
8224 /// let x = ListPrivateConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8225 /// ```
8226 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8227 self.parent = v.into();
8228 self
8229 }
8230
8231 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
8232 ///
8233 /// # Example
8234 /// ```ignore,no_run
8235 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8236 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
8237 /// ```
8238 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8239 self.page_size = v.into();
8240 self
8241 }
8242
8243 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
8244 ///
8245 /// # Example
8246 /// ```ignore,no_run
8247 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8248 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
8249 /// ```
8250 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8251 self.page_token = v.into();
8252 self
8253 }
8254
8255 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
8256 ///
8257 /// # Example
8258 /// ```ignore,no_run
8259 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8260 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
8261 /// ```
8262 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8263 self.filter = v.into();
8264 self
8265 }
8266
8267 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
8268 ///
8269 /// # Example
8270 /// ```ignore,no_run
8271 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsRequest;
8272 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
8273 /// ```
8274 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8275 self.order_by = v.into();
8276 self
8277 }
8278}
8279
8280impl wkt::message::Message for ListPrivateConnectionsRequest {
8281 fn typename() -> &'static str {
8282 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"
8283 }
8284}
8285
8286/// Response message for
8287/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
8288///
8289/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
8290#[derive(Clone, Default, PartialEq)]
8291#[non_exhaustive]
8292pub struct ListPrivateConnectionsResponse {
8293 /// A list of private connections.
8294 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
8295
8296 /// A token, which can be sent as `page_token` to retrieve the next page.
8297 /// If this field is omitted, there are no subsequent pages.
8298 pub next_page_token: std::string::String,
8299
8300 /// Unreachable resources.
8301 pub unreachable: std::vec::Vec<std::string::String>,
8302
8303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8304}
8305
8306impl ListPrivateConnectionsResponse {
8307 /// Creates a new default instance.
8308 pub fn new() -> Self {
8309 std::default::Default::default()
8310 }
8311
8312 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
8313 ///
8314 /// # Example
8315 /// ```ignore,no_run
8316 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8317 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8318 /// let x = ListPrivateConnectionsResponse::new()
8319 /// .set_private_connections([
8320 /// PrivateConnection::default()/* use setters */,
8321 /// PrivateConnection::default()/* use (different) setters */,
8322 /// ]);
8323 /// ```
8324 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
8325 where
8326 T: std::iter::IntoIterator<Item = V>,
8327 V: std::convert::Into<crate::model::PrivateConnection>,
8328 {
8329 use std::iter::Iterator;
8330 self.private_connections = v.into_iter().map(|i| i.into()).collect();
8331 self
8332 }
8333
8334 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
8335 ///
8336 /// # Example
8337 /// ```ignore,no_run
8338 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8339 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
8340 /// ```
8341 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8342 self.next_page_token = v.into();
8343 self
8344 }
8345
8346 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionsResponse;
8351 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
8352 /// ```
8353 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8354 where
8355 T: std::iter::IntoIterator<Item = V>,
8356 V: std::convert::Into<std::string::String>,
8357 {
8358 use std::iter::Iterator;
8359 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8360 self
8361 }
8362}
8363
8364impl wkt::message::Message for ListPrivateConnectionsResponse {
8365 fn typename() -> &'static str {
8366 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"
8367 }
8368}
8369
8370#[doc(hidden)]
8371impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
8372 type PageItem = crate::model::PrivateConnection;
8373
8374 fn items(self) -> std::vec::Vec<Self::PageItem> {
8375 self.private_connections
8376 }
8377
8378 fn next_page_token(&self) -> std::string::String {
8379 use std::clone::Clone;
8380 self.next_page_token.clone()
8381 }
8382}
8383
8384/// Request message for
8385/// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]
8386///
8387/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]: crate::client::VmwareEngine::update_private_connection
8388#[derive(Clone, Default, PartialEq)]
8389#[non_exhaustive]
8390pub struct UpdatePrivateConnectionRequest {
8391 /// Required. Private connection description.
8392 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
8393
8394 /// Required. Field mask is used to specify the fields to be overwritten in the
8395 /// `PrivateConnection` resource by the update.
8396 /// The fields specified in the `update_mask` are relative to the resource, not
8397 /// the full request. A field will be overwritten if it is in the mask. If the
8398 /// user does not provide a mask then all fields will be overwritten.
8399 pub update_mask: std::option::Option<wkt::FieldMask>,
8400
8401 /// Optional. A request ID to identify requests. Specify a unique request ID
8402 /// so that if you must retry your request, the server will know to ignore
8403 /// the request if it has already been completed. The server guarantees that a
8404 /// request doesn't result in creation of duplicate commitments for at least 60
8405 /// minutes.
8406 ///
8407 /// For example, consider a situation where you make an initial request and the
8408 /// request times out. If you make the request again with the same request
8409 /// ID, the server can check if original operation with the same request ID
8410 /// was received, and if so, will ignore the second request. This prevents
8411 /// clients from accidentally creating duplicate commitments.
8412 ///
8413 /// The request ID must be a valid UUID with the exception that zero UUID is
8414 /// not supported (00000000-0000-0000-0000-000000000000).
8415 pub request_id: std::string::String,
8416
8417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8418}
8419
8420impl UpdatePrivateConnectionRequest {
8421 /// Creates a new default instance.
8422 pub fn new() -> Self {
8423 std::default::Default::default()
8424 }
8425
8426 /// Sets the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8427 ///
8428 /// # Example
8429 /// ```ignore,no_run
8430 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8431 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8432 /// let x = UpdatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
8433 /// ```
8434 pub fn set_private_connection<T>(mut self, v: T) -> Self
8435 where
8436 T: std::convert::Into<crate::model::PrivateConnection>,
8437 {
8438 self.private_connection = std::option::Option::Some(v.into());
8439 self
8440 }
8441
8442 /// Sets or clears the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8447 /// use google_cloud_vmwareengine_v1::model::PrivateConnection;
8448 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
8449 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
8450 /// ```
8451 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
8452 where
8453 T: std::convert::Into<crate::model::PrivateConnection>,
8454 {
8455 self.private_connection = v.map(|x| x.into());
8456 self
8457 }
8458
8459 /// Sets the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8464 /// use wkt::FieldMask;
8465 /// let x = UpdatePrivateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8466 /// ```
8467 pub fn set_update_mask<T>(mut self, v: T) -> Self
8468 where
8469 T: std::convert::Into<wkt::FieldMask>,
8470 {
8471 self.update_mask = std::option::Option::Some(v.into());
8472 self
8473 }
8474
8475 /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
8476 ///
8477 /// # Example
8478 /// ```ignore,no_run
8479 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8480 /// use wkt::FieldMask;
8481 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8482 /// let x = UpdatePrivateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8483 /// ```
8484 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8485 where
8486 T: std::convert::Into<wkt::FieldMask>,
8487 {
8488 self.update_mask = v.map(|x| x.into());
8489 self
8490 }
8491
8492 /// Sets the value of [request_id][crate::model::UpdatePrivateConnectionRequest::request_id].
8493 ///
8494 /// # Example
8495 /// ```ignore,no_run
8496 /// # use google_cloud_vmwareengine_v1::model::UpdatePrivateConnectionRequest;
8497 /// let x = UpdatePrivateConnectionRequest::new().set_request_id("example");
8498 /// ```
8499 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8500 self.request_id = v.into();
8501 self
8502 }
8503}
8504
8505impl wkt::message::Message for UpdatePrivateConnectionRequest {
8506 fn typename() -> &'static str {
8507 "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"
8508 }
8509}
8510
8511/// Request message for
8512/// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]
8513///
8514/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]: crate::client::VmwareEngine::delete_private_connection
8515#[derive(Clone, Default, PartialEq)]
8516#[non_exhaustive]
8517pub struct DeletePrivateConnectionRequest {
8518 /// Required. The resource name of the private connection to be deleted.
8519 /// Resource names are schemeless URIs that follow the conventions in
8520 /// <https://cloud.google.com/apis/design/resource_names>.
8521 /// For example:
8522 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
8523 pub name: std::string::String,
8524
8525 /// Optional. A request ID to identify requests. Specify a unique request ID
8526 /// so that if you must retry your request, the server will know to ignore
8527 /// the request if it has already been completed. The server guarantees that a
8528 /// request doesn't result in creation of duplicate commitments for at least 60
8529 /// minutes.
8530 ///
8531 /// For example, consider a situation where you make an initial request and the
8532 /// request times out. If you make the request again with the same request
8533 /// ID, the server can check if original operation with the same request ID
8534 /// was received, and if so, will ignore the second request. This prevents
8535 /// clients from accidentally creating duplicate commitments.
8536 ///
8537 /// The request ID must be a valid UUID with the exception that zero UUID is
8538 /// not supported (00000000-0000-0000-0000-000000000000).
8539 pub request_id: std::string::String,
8540
8541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8542}
8543
8544impl DeletePrivateConnectionRequest {
8545 /// Creates a new default instance.
8546 pub fn new() -> Self {
8547 std::default::Default::default()
8548 }
8549
8550 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
8551 ///
8552 /// # Example
8553 /// ```ignore,no_run
8554 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8555 /// # let project_id = "project_id";
8556 /// # let location_id = "location_id";
8557 /// # let private_connection_id = "private_connection_id";
8558 /// let x = DeletePrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
8559 /// ```
8560 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8561 self.name = v.into();
8562 self
8563 }
8564
8565 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
8566 ///
8567 /// # Example
8568 /// ```ignore,no_run
8569 /// # use google_cloud_vmwareengine_v1::model::DeletePrivateConnectionRequest;
8570 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
8571 /// ```
8572 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8573 self.request_id = v.into();
8574 self
8575 }
8576}
8577
8578impl wkt::message::Message for DeletePrivateConnectionRequest {
8579 fn typename() -> &'static str {
8580 "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"
8581 }
8582}
8583
8584/// Request message for
8585/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8586///
8587/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8588#[derive(Clone, Default, PartialEq)]
8589#[non_exhaustive]
8590pub struct ListPrivateConnectionPeeringRoutesRequest {
8591 /// Required. The resource name of the private connection to retrieve peering
8592 /// routes from. Resource names are schemeless URIs that follow the conventions
8593 /// in <https://cloud.google.com/apis/design/resource_names>. For example:
8594 /// `projects/my-project/locations/us-west1/privateConnections/my-connection`
8595 pub parent: std::string::String,
8596
8597 /// The maximum number of peering routes to return in one page.
8598 /// The service may return fewer than this value.
8599 /// The maximum value is coerced to 1000.
8600 /// The default value of this field is 500.
8601 pub page_size: i32,
8602
8603 /// A page token, received from a previous `ListPrivateConnectionPeeringRoutes`
8604 /// call. Provide this to retrieve the subsequent page. When paginating, all
8605 /// other parameters provided to `ListPrivateConnectionPeeringRoutes` must
8606 /// match the call that provided the page token.
8607 pub page_token: std::string::String,
8608
8609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8610}
8611
8612impl ListPrivateConnectionPeeringRoutesRequest {
8613 /// Creates a new default instance.
8614 pub fn new() -> Self {
8615 std::default::Default::default()
8616 }
8617
8618 /// Sets the value of [parent][crate::model::ListPrivateConnectionPeeringRoutesRequest::parent].
8619 ///
8620 /// # Example
8621 /// ```ignore,no_run
8622 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8623 /// # let project_id = "project_id";
8624 /// # let location_id = "location_id";
8625 /// # let private_connection_id = "private_connection_id";
8626 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
8627 /// ```
8628 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8629 self.parent = v.into();
8630 self
8631 }
8632
8633 /// Sets the value of [page_size][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_size].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8638 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_size(42);
8639 /// ```
8640 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8641 self.page_size = v.into();
8642 self
8643 }
8644
8645 /// Sets the value of [page_token][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_token].
8646 ///
8647 /// # Example
8648 /// ```ignore,no_run
8649 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesRequest;
8650 /// let x = ListPrivateConnectionPeeringRoutesRequest::new().set_page_token("example");
8651 /// ```
8652 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8653 self.page_token = v.into();
8654 self
8655 }
8656}
8657
8658impl wkt::message::Message for ListPrivateConnectionPeeringRoutesRequest {
8659 fn typename() -> &'static str {
8660 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"
8661 }
8662}
8663
8664/// Response message for
8665/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
8666///
8667/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
8668#[derive(Clone, Default, PartialEq)]
8669#[non_exhaustive]
8670pub struct ListPrivateConnectionPeeringRoutesResponse {
8671 /// A list of peering routes.
8672 pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
8673
8674 /// A token, which can be sent as `page_token` to retrieve the next page.
8675 /// If this field is omitted, there are no subsequent pages.
8676 pub next_page_token: std::string::String,
8677
8678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8679}
8680
8681impl ListPrivateConnectionPeeringRoutesResponse {
8682 /// Creates a new default instance.
8683 pub fn new() -> Self {
8684 std::default::Default::default()
8685 }
8686
8687 /// Sets the value of [peering_routes][crate::model::ListPrivateConnectionPeeringRoutesResponse::peering_routes].
8688 ///
8689 /// # Example
8690 /// ```ignore,no_run
8691 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8692 /// use google_cloud_vmwareengine_v1::model::PeeringRoute;
8693 /// let x = ListPrivateConnectionPeeringRoutesResponse::new()
8694 /// .set_peering_routes([
8695 /// PeeringRoute::default()/* use setters */,
8696 /// PeeringRoute::default()/* use (different) setters */,
8697 /// ]);
8698 /// ```
8699 pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
8700 where
8701 T: std::iter::IntoIterator<Item = V>,
8702 V: std::convert::Into<crate::model::PeeringRoute>,
8703 {
8704 use std::iter::Iterator;
8705 self.peering_routes = v.into_iter().map(|i| i.into()).collect();
8706 self
8707 }
8708
8709 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionPeeringRoutesResponse::next_page_token].
8710 ///
8711 /// # Example
8712 /// ```ignore,no_run
8713 /// # use google_cloud_vmwareengine_v1::model::ListPrivateConnectionPeeringRoutesResponse;
8714 /// let x = ListPrivateConnectionPeeringRoutesResponse::new().set_next_page_token("example");
8715 /// ```
8716 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8717 self.next_page_token = v.into();
8718 self
8719 }
8720}
8721
8722impl wkt::message::Message for ListPrivateConnectionPeeringRoutesResponse {
8723 fn typename() -> &'static str {
8724 "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"
8725 }
8726}
8727
8728#[doc(hidden)]
8729impl google_cloud_gax::paginator::internal::PageableResponse
8730 for ListPrivateConnectionPeeringRoutesResponse
8731{
8732 type PageItem = crate::model::PeeringRoute;
8733
8734 fn items(self) -> std::vec::Vec<Self::PageItem> {
8735 self.peering_routes
8736 }
8737
8738 fn next_page_token(&self) -> std::string::String {
8739 use std::clone::Clone;
8740 self.next_page_token.clone()
8741 }
8742}
8743
8744/// Request message for
8745/// [VmwareEngine.GrantDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]
8746///
8747/// [google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]: crate::client::VmwareEngine::grant_dns_bind_permission
8748#[derive(Clone, Default, PartialEq)]
8749#[non_exhaustive]
8750pub struct GrantDnsBindPermissionRequest {
8751 /// Required. The name of the resource which stores the users/service accounts
8752 /// having the permission to bind to the corresponding intranet VPC of the
8753 /// consumer project. DnsBindPermission is a global resource. Resource names
8754 /// are schemeless URIs that follow the conventions in
8755 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8756 /// `projects/my-project/locations/global/dnsBindPermission`
8757 pub name: std::string::String,
8758
8759 /// Required. The consumer provided user/service account which needs to be
8760 /// granted permission to bind with the intranet VPC corresponding to the
8761 /// consumer project.
8762 pub principal: std::option::Option<crate::model::Principal>,
8763
8764 /// Optional. A request ID to identify requests. Specify a unique request ID
8765 /// so that if you must retry your request, the server will know to ignore
8766 /// the request if it has already been completed. The server guarantees that a
8767 /// request doesn't result in creation of duplicate commitments for at least 60
8768 /// minutes.
8769 ///
8770 /// For example, consider a situation where you make an initial request and the
8771 /// request times out. If you make the request again with the same request
8772 /// ID, the server can check if original operation with the same request ID
8773 /// was received, and if so, will ignore the second request. This prevents
8774 /// clients from accidentally creating duplicate commitments.
8775 ///
8776 /// The request ID must be a valid UUID with the exception that zero UUID is
8777 /// not supported (00000000-0000-0000-0000-000000000000).
8778 pub request_id: std::string::String,
8779
8780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8781}
8782
8783impl GrantDnsBindPermissionRequest {
8784 /// Creates a new default instance.
8785 pub fn new() -> Self {
8786 std::default::Default::default()
8787 }
8788
8789 /// Sets the value of [name][crate::model::GrantDnsBindPermissionRequest::name].
8790 ///
8791 /// # Example
8792 /// ```ignore,no_run
8793 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8794 /// # let project_id = "project_id";
8795 /// # let location_id = "location_id";
8796 /// let x = GrantDnsBindPermissionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsBindPermission"));
8797 /// ```
8798 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8799 self.name = v.into();
8800 self
8801 }
8802
8803 /// Sets the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8804 ///
8805 /// # Example
8806 /// ```ignore,no_run
8807 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8808 /// use google_cloud_vmwareengine_v1::model::Principal;
8809 /// let x = GrantDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8810 /// ```
8811 pub fn set_principal<T>(mut self, v: T) -> Self
8812 where
8813 T: std::convert::Into<crate::model::Principal>,
8814 {
8815 self.principal = std::option::Option::Some(v.into());
8816 self
8817 }
8818
8819 /// Sets or clears the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
8820 ///
8821 /// # Example
8822 /// ```ignore,no_run
8823 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8824 /// use google_cloud_vmwareengine_v1::model::Principal;
8825 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8826 /// let x = GrantDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8827 /// ```
8828 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8829 where
8830 T: std::convert::Into<crate::model::Principal>,
8831 {
8832 self.principal = v.map(|x| x.into());
8833 self
8834 }
8835
8836 /// Sets the value of [request_id][crate::model::GrantDnsBindPermissionRequest::request_id].
8837 ///
8838 /// # Example
8839 /// ```ignore,no_run
8840 /// # use google_cloud_vmwareengine_v1::model::GrantDnsBindPermissionRequest;
8841 /// let x = GrantDnsBindPermissionRequest::new().set_request_id("example");
8842 /// ```
8843 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8844 self.request_id = v.into();
8845 self
8846 }
8847}
8848
8849impl wkt::message::Message for GrantDnsBindPermissionRequest {
8850 fn typename() -> &'static str {
8851 "type.googleapis.com/google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest"
8852 }
8853}
8854
8855/// Request message for
8856/// [VmwareEngine.RevokeDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]
8857///
8858/// [google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]: crate::client::VmwareEngine::revoke_dns_bind_permission
8859#[derive(Clone, Default, PartialEq)]
8860#[non_exhaustive]
8861pub struct RevokeDnsBindPermissionRequest {
8862 /// Required. The name of the resource which stores the users/service accounts
8863 /// having the permission to bind to the corresponding intranet VPC of the
8864 /// consumer project. DnsBindPermission is a global resource. Resource names
8865 /// are schemeless URIs that follow the conventions in
8866 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8867 /// `projects/my-project/locations/global/dnsBindPermission`
8868 pub name: std::string::String,
8869
8870 /// Required. The consumer provided user/service account which needs to be
8871 /// granted permission to bind with the intranet VPC corresponding to the
8872 /// consumer project.
8873 pub principal: std::option::Option<crate::model::Principal>,
8874
8875 /// Optional. A request ID to identify requests. Specify a unique request ID
8876 /// so that if you must retry your request, the server will know to ignore
8877 /// the request if it has already been completed. The server guarantees that a
8878 /// request doesn't result in creation of duplicate commitments for at least 60
8879 /// minutes.
8880 ///
8881 /// For example, consider a situation where you make an initial request and the
8882 /// request times out. If you make the request again with the same request
8883 /// ID, the server can check if original operation with the same request ID
8884 /// was received, and if so, will ignore the second request. This prevents
8885 /// clients from accidentally creating duplicate commitments.
8886 ///
8887 /// The request ID must be a valid UUID with the exception that zero UUID is
8888 /// not supported (00000000-0000-0000-0000-000000000000).
8889 pub request_id: std::string::String,
8890
8891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8892}
8893
8894impl RevokeDnsBindPermissionRequest {
8895 /// Creates a new default instance.
8896 pub fn new() -> Self {
8897 std::default::Default::default()
8898 }
8899
8900 /// Sets the value of [name][crate::model::RevokeDnsBindPermissionRequest::name].
8901 ///
8902 /// # Example
8903 /// ```ignore,no_run
8904 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8905 /// # let project_id = "project_id";
8906 /// # let location_id = "location_id";
8907 /// let x = RevokeDnsBindPermissionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsBindPermission"));
8908 /// ```
8909 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8910 self.name = v.into();
8911 self
8912 }
8913
8914 /// Sets the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8915 ///
8916 /// # Example
8917 /// ```ignore,no_run
8918 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8919 /// use google_cloud_vmwareengine_v1::model::Principal;
8920 /// let x = RevokeDnsBindPermissionRequest::new().set_principal(Principal::default()/* use setters */);
8921 /// ```
8922 pub fn set_principal<T>(mut self, v: T) -> Self
8923 where
8924 T: std::convert::Into<crate::model::Principal>,
8925 {
8926 self.principal = std::option::Option::Some(v.into());
8927 self
8928 }
8929
8930 /// Sets or clears the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
8931 ///
8932 /// # Example
8933 /// ```ignore,no_run
8934 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8935 /// use google_cloud_vmwareengine_v1::model::Principal;
8936 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(Some(Principal::default()/* use setters */));
8937 /// let x = RevokeDnsBindPermissionRequest::new().set_or_clear_principal(None::<Principal>);
8938 /// ```
8939 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
8940 where
8941 T: std::convert::Into<crate::model::Principal>,
8942 {
8943 self.principal = v.map(|x| x.into());
8944 self
8945 }
8946
8947 /// Sets the value of [request_id][crate::model::RevokeDnsBindPermissionRequest::request_id].
8948 ///
8949 /// # Example
8950 /// ```ignore,no_run
8951 /// # use google_cloud_vmwareengine_v1::model::RevokeDnsBindPermissionRequest;
8952 /// let x = RevokeDnsBindPermissionRequest::new().set_request_id("example");
8953 /// ```
8954 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8955 self.request_id = v.into();
8956 self
8957 }
8958}
8959
8960impl wkt::message::Message for RevokeDnsBindPermissionRequest {
8961 fn typename() -> &'static str {
8962 "type.googleapis.com/google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest"
8963 }
8964}
8965
8966/// Request message for
8967/// [VmwareEngine.GetDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]
8968///
8969/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]: crate::client::VmwareEngine::get_dns_bind_permission
8970#[derive(Clone, Default, PartialEq)]
8971#[non_exhaustive]
8972pub struct GetDnsBindPermissionRequest {
8973 /// Required. The name of the resource which stores the users/service accounts
8974 /// having the permission to bind to the corresponding intranet VPC of the
8975 /// consumer project. DnsBindPermission is a global resource. Resource names
8976 /// are schemeless URIs that follow the conventions in
8977 /// <https://cloud.google.com/apis/design/resource_names>. For example:
8978 /// `projects/my-project/locations/global/dnsBindPermission`
8979 pub name: std::string::String,
8980
8981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8982}
8983
8984impl GetDnsBindPermissionRequest {
8985 /// Creates a new default instance.
8986 pub fn new() -> Self {
8987 std::default::Default::default()
8988 }
8989
8990 /// Sets the value of [name][crate::model::GetDnsBindPermissionRequest::name].
8991 ///
8992 /// # Example
8993 /// ```ignore,no_run
8994 /// # use google_cloud_vmwareengine_v1::model::GetDnsBindPermissionRequest;
8995 /// # let project_id = "project_id";
8996 /// # let location_id = "location_id";
8997 /// let x = GetDnsBindPermissionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsBindPermission"));
8998 /// ```
8999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9000 self.name = v.into();
9001 self
9002 }
9003}
9004
9005impl wkt::message::Message for GetDnsBindPermissionRequest {
9006 fn typename() -> &'static str {
9007 "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest"
9008 }
9009}
9010
9011/// Network configuration in the consumer project
9012/// with which the peering has to be done.
9013#[derive(Clone, Default, PartialEq)]
9014#[non_exhaustive]
9015pub struct NetworkConfig {
9016 /// Required. Management CIDR used by VMware management appliances.
9017 pub management_cidr: std::string::String,
9018
9019 /// Optional. The relative resource name of the VMware Engine network attached
9020 /// to the private cloud. Specify the name in the following form:
9021 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
9022 /// where `{project}` can either be a project number or a project ID.
9023 pub vmware_engine_network: std::string::String,
9024
9025 /// Output only. The canonical name of the VMware Engine network in the form:
9026 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
9027 pub vmware_engine_network_canonical: std::string::String,
9028
9029 /// Output only. The IP address layout version of the management IP address
9030 /// range. Possible versions include:
9031 ///
9032 /// * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address
9033 /// layout used by some existing private clouds. This is no longer supported
9034 /// for new private clouds as it does not support all features.
9035 /// * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address
9036 /// layout used by all newly created private clouds. This version supports all
9037 /// current features.
9038 pub management_ip_address_layout_version: i32,
9039
9040 /// Output only. DNS Server IP of the Private Cloud.
9041 /// All DNS queries can be forwarded to this address for name resolution of
9042 /// Private Cloud's management entities like vCenter, NSX-T Manager and
9043 /// ESXi hosts.
9044 pub dns_server_ip: std::string::String,
9045
9046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9047}
9048
9049impl NetworkConfig {
9050 /// Creates a new default instance.
9051 pub fn new() -> Self {
9052 std::default::Default::default()
9053 }
9054
9055 /// Sets the value of [management_cidr][crate::model::NetworkConfig::management_cidr].
9056 ///
9057 /// # Example
9058 /// ```ignore,no_run
9059 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
9060 /// let x = NetworkConfig::new().set_management_cidr("example");
9061 /// ```
9062 pub fn set_management_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9063 self.management_cidr = v.into();
9064 self
9065 }
9066
9067 /// Sets the value of [vmware_engine_network][crate::model::NetworkConfig::vmware_engine_network].
9068 ///
9069 /// # Example
9070 /// ```ignore,no_run
9071 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
9072 /// # let project_id = "project_id";
9073 /// # let location_id = "location_id";
9074 /// # let vmware_engine_network_id = "vmware_engine_network_id";
9075 /// let x = NetworkConfig::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
9076 /// ```
9077 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
9078 mut self,
9079 v: T,
9080 ) -> Self {
9081 self.vmware_engine_network = v.into();
9082 self
9083 }
9084
9085 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkConfig::vmware_engine_network_canonical].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
9090 /// # let project_id = "project_id";
9091 /// # let location_id = "location_id";
9092 /// # let vmware_engine_network_id = "vmware_engine_network_id";
9093 /// let x = NetworkConfig::new().set_vmware_engine_network_canonical(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
9094 /// ```
9095 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
9096 mut self,
9097 v: T,
9098 ) -> Self {
9099 self.vmware_engine_network_canonical = v.into();
9100 self
9101 }
9102
9103 /// Sets the value of [management_ip_address_layout_version][crate::model::NetworkConfig::management_ip_address_layout_version].
9104 ///
9105 /// # Example
9106 /// ```ignore,no_run
9107 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
9108 /// let x = NetworkConfig::new().set_management_ip_address_layout_version(42);
9109 /// ```
9110 pub fn set_management_ip_address_layout_version<T: std::convert::Into<i32>>(
9111 mut self,
9112 v: T,
9113 ) -> Self {
9114 self.management_ip_address_layout_version = v.into();
9115 self
9116 }
9117
9118 /// Sets the value of [dns_server_ip][crate::model::NetworkConfig::dns_server_ip].
9119 ///
9120 /// # Example
9121 /// ```ignore,no_run
9122 /// # use google_cloud_vmwareengine_v1::model::NetworkConfig;
9123 /// let x = NetworkConfig::new().set_dns_server_ip("example");
9124 /// ```
9125 pub fn set_dns_server_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9126 self.dns_server_ip = v.into();
9127 self
9128 }
9129}
9130
9131impl wkt::message::Message for NetworkConfig {
9132 fn typename() -> &'static str {
9133 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkConfig"
9134 }
9135}
9136
9137/// Information about the type and number of nodes associated with the cluster.
9138#[derive(Clone, Default, PartialEq)]
9139#[non_exhaustive]
9140pub struct NodeTypeConfig {
9141 /// Required. The number of nodes of this type in the cluster
9142 pub node_count: i32,
9143
9144 /// Optional. Customized number of cores available to each node of the type.
9145 /// This number must always be one of `nodeType.availableCustomCoreCounts`.
9146 /// If zero is provided max value from `nodeType.availableCustomCoreCounts`
9147 /// will be used.
9148 pub custom_core_count: i32,
9149
9150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9151}
9152
9153impl NodeTypeConfig {
9154 /// Creates a new default instance.
9155 pub fn new() -> Self {
9156 std::default::Default::default()
9157 }
9158
9159 /// Sets the value of [node_count][crate::model::NodeTypeConfig::node_count].
9160 ///
9161 /// # Example
9162 /// ```ignore,no_run
9163 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9164 /// let x = NodeTypeConfig::new().set_node_count(42);
9165 /// ```
9166 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9167 self.node_count = v.into();
9168 self
9169 }
9170
9171 /// Sets the value of [custom_core_count][crate::model::NodeTypeConfig::custom_core_count].
9172 ///
9173 /// # Example
9174 /// ```ignore,no_run
9175 /// # use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9176 /// let x = NodeTypeConfig::new().set_custom_core_count(42);
9177 /// ```
9178 pub fn set_custom_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9179 self.custom_core_count = v.into();
9180 self
9181 }
9182}
9183
9184impl wkt::message::Message for NodeTypeConfig {
9185 fn typename() -> &'static str {
9186 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeTypeConfig"
9187 }
9188}
9189
9190/// Configuration of a stretched cluster.
9191#[derive(Clone, Default, PartialEq)]
9192#[non_exhaustive]
9193pub struct StretchedClusterConfig {
9194 /// Required. Zone that will remain operational when connection between the two
9195 /// zones is lost. Specify the resource name of a zone that belongs to the
9196 /// region of the private cloud. For example:
9197 /// `projects/{project}/locations/europe-west3-a` where `{project}` can either
9198 /// be a project number or a project ID.
9199 pub preferred_location: std::string::String,
9200
9201 /// Required. Additional zone for a higher level of availability and load
9202 /// balancing. Specify the resource name of a zone that belongs to the region
9203 /// of the private cloud. For example:
9204 /// `projects/{project}/locations/europe-west3-b` where `{project}` can either
9205 /// be a project number or a project ID.
9206 pub secondary_location: std::string::String,
9207
9208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9209}
9210
9211impl StretchedClusterConfig {
9212 /// Creates a new default instance.
9213 pub fn new() -> Self {
9214 std::default::Default::default()
9215 }
9216
9217 /// Sets the value of [preferred_location][crate::model::StretchedClusterConfig::preferred_location].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9222 /// let x = StretchedClusterConfig::new().set_preferred_location("example");
9223 /// ```
9224 pub fn set_preferred_location<T: std::convert::Into<std::string::String>>(
9225 mut self,
9226 v: T,
9227 ) -> Self {
9228 self.preferred_location = v.into();
9229 self
9230 }
9231
9232 /// Sets the value of [secondary_location][crate::model::StretchedClusterConfig::secondary_location].
9233 ///
9234 /// # Example
9235 /// ```ignore,no_run
9236 /// # use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9237 /// let x = StretchedClusterConfig::new().set_secondary_location("example");
9238 /// ```
9239 pub fn set_secondary_location<T: std::convert::Into<std::string::String>>(
9240 mut self,
9241 v: T,
9242 ) -> Self {
9243 self.secondary_location = v.into();
9244 self
9245 }
9246}
9247
9248impl wkt::message::Message for StretchedClusterConfig {
9249 fn typename() -> &'static str {
9250 "type.googleapis.com/google.cloud.vmwareengine.v1.StretchedClusterConfig"
9251 }
9252}
9253
9254/// Represents a private cloud resource. Private clouds of type `STANDARD` and
9255/// `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are
9256/// regional.
9257#[derive(Clone, Default, PartialEq)]
9258#[non_exhaustive]
9259pub struct PrivateCloud {
9260 /// Output only. The resource name of this private cloud.
9261 /// Resource names are schemeless URIs that follow the conventions in
9262 /// <https://cloud.google.com/apis/design/resource_names>.
9263 /// For example:
9264 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
9265 pub name: std::string::String,
9266
9267 /// Output only. Creation time of this resource.
9268 pub create_time: std::option::Option<wkt::Timestamp>,
9269
9270 /// Output only. Last update time of this resource.
9271 pub update_time: std::option::Option<wkt::Timestamp>,
9272
9273 /// Output only. Time when the resource was scheduled for deletion.
9274 pub delete_time: std::option::Option<wkt::Timestamp>,
9275
9276 /// Output only. Time when the resource will be irreversibly deleted.
9277 pub expire_time: std::option::Option<wkt::Timestamp>,
9278
9279 /// Output only. State of the resource. New values may be added to this enum
9280 /// when appropriate.
9281 pub state: crate::model::private_cloud::State,
9282
9283 /// Required. Network configuration of the private cloud.
9284 pub network_config: std::option::Option<crate::model::NetworkConfig>,
9285
9286 /// Required. Input only. The management cluster for this private cloud.
9287 /// This field is required during creation of the private cloud to provide
9288 /// details for the default cluster.
9289 ///
9290 /// The following fields can't be changed after private cloud creation:
9291 /// `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.
9292 pub management_cluster: std::option::Option<crate::model::private_cloud::ManagementCluster>,
9293
9294 /// User-provided description for this private cloud.
9295 pub description: std::string::String,
9296
9297 /// Output only. HCX appliance.
9298 pub hcx: std::option::Option<crate::model::Hcx>,
9299
9300 /// Output only. NSX appliance.
9301 pub nsx: std::option::Option<crate::model::Nsx>,
9302
9303 /// Output only. Vcenter appliance.
9304 pub vcenter: std::option::Option<crate::model::Vcenter>,
9305
9306 /// Output only. System-generated unique identifier for the resource.
9307 pub uid: std::string::String,
9308
9309 /// Optional. Type of the private cloud. Defaults to STANDARD.
9310 pub r#type: crate::model::private_cloud::Type,
9311
9312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9313}
9314
9315impl PrivateCloud {
9316 /// Creates a new default instance.
9317 pub fn new() -> Self {
9318 std::default::Default::default()
9319 }
9320
9321 /// Sets the value of [name][crate::model::PrivateCloud::name].
9322 ///
9323 /// # Example
9324 /// ```ignore,no_run
9325 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9326 /// # let project_id = "project_id";
9327 /// # let location_id = "location_id";
9328 /// # let private_cloud_id = "private_cloud_id";
9329 /// let x = PrivateCloud::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}"));
9330 /// ```
9331 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9332 self.name = v.into();
9333 self
9334 }
9335
9336 /// Sets the value of [create_time][crate::model::PrivateCloud::create_time].
9337 ///
9338 /// # Example
9339 /// ```ignore,no_run
9340 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9341 /// use wkt::Timestamp;
9342 /// let x = PrivateCloud::new().set_create_time(Timestamp::default()/* use setters */);
9343 /// ```
9344 pub fn set_create_time<T>(mut self, v: T) -> Self
9345 where
9346 T: std::convert::Into<wkt::Timestamp>,
9347 {
9348 self.create_time = std::option::Option::Some(v.into());
9349 self
9350 }
9351
9352 /// Sets or clears the value of [create_time][crate::model::PrivateCloud::create_time].
9353 ///
9354 /// # Example
9355 /// ```ignore,no_run
9356 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9357 /// use wkt::Timestamp;
9358 /// let x = PrivateCloud::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9359 /// let x = PrivateCloud::new().set_or_clear_create_time(None::<Timestamp>);
9360 /// ```
9361 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9362 where
9363 T: std::convert::Into<wkt::Timestamp>,
9364 {
9365 self.create_time = v.map(|x| x.into());
9366 self
9367 }
9368
9369 /// Sets the value of [update_time][crate::model::PrivateCloud::update_time].
9370 ///
9371 /// # Example
9372 /// ```ignore,no_run
9373 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9374 /// use wkt::Timestamp;
9375 /// let x = PrivateCloud::new().set_update_time(Timestamp::default()/* use setters */);
9376 /// ```
9377 pub fn set_update_time<T>(mut self, v: T) -> Self
9378 where
9379 T: std::convert::Into<wkt::Timestamp>,
9380 {
9381 self.update_time = std::option::Option::Some(v.into());
9382 self
9383 }
9384
9385 /// Sets or clears the value of [update_time][crate::model::PrivateCloud::update_time].
9386 ///
9387 /// # Example
9388 /// ```ignore,no_run
9389 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9390 /// use wkt::Timestamp;
9391 /// let x = PrivateCloud::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9392 /// let x = PrivateCloud::new().set_or_clear_update_time(None::<Timestamp>);
9393 /// ```
9394 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9395 where
9396 T: std::convert::Into<wkt::Timestamp>,
9397 {
9398 self.update_time = v.map(|x| x.into());
9399 self
9400 }
9401
9402 /// Sets the value of [delete_time][crate::model::PrivateCloud::delete_time].
9403 ///
9404 /// # Example
9405 /// ```ignore,no_run
9406 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9407 /// use wkt::Timestamp;
9408 /// let x = PrivateCloud::new().set_delete_time(Timestamp::default()/* use setters */);
9409 /// ```
9410 pub fn set_delete_time<T>(mut self, v: T) -> Self
9411 where
9412 T: std::convert::Into<wkt::Timestamp>,
9413 {
9414 self.delete_time = std::option::Option::Some(v.into());
9415 self
9416 }
9417
9418 /// Sets or clears the value of [delete_time][crate::model::PrivateCloud::delete_time].
9419 ///
9420 /// # Example
9421 /// ```ignore,no_run
9422 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9423 /// use wkt::Timestamp;
9424 /// let x = PrivateCloud::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
9425 /// let x = PrivateCloud::new().set_or_clear_delete_time(None::<Timestamp>);
9426 /// ```
9427 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9428 where
9429 T: std::convert::Into<wkt::Timestamp>,
9430 {
9431 self.delete_time = v.map(|x| x.into());
9432 self
9433 }
9434
9435 /// Sets the value of [expire_time][crate::model::PrivateCloud::expire_time].
9436 ///
9437 /// # Example
9438 /// ```ignore,no_run
9439 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9440 /// use wkt::Timestamp;
9441 /// let x = PrivateCloud::new().set_expire_time(Timestamp::default()/* use setters */);
9442 /// ```
9443 pub fn set_expire_time<T>(mut self, v: T) -> Self
9444 where
9445 T: std::convert::Into<wkt::Timestamp>,
9446 {
9447 self.expire_time = std::option::Option::Some(v.into());
9448 self
9449 }
9450
9451 /// Sets or clears the value of [expire_time][crate::model::PrivateCloud::expire_time].
9452 ///
9453 /// # Example
9454 /// ```ignore,no_run
9455 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9456 /// use wkt::Timestamp;
9457 /// let x = PrivateCloud::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
9458 /// let x = PrivateCloud::new().set_or_clear_expire_time(None::<Timestamp>);
9459 /// ```
9460 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9461 where
9462 T: std::convert::Into<wkt::Timestamp>,
9463 {
9464 self.expire_time = v.map(|x| x.into());
9465 self
9466 }
9467
9468 /// Sets the value of [state][crate::model::PrivateCloud::state].
9469 ///
9470 /// # Example
9471 /// ```ignore,no_run
9472 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9473 /// use google_cloud_vmwareengine_v1::model::private_cloud::State;
9474 /// let x0 = PrivateCloud::new().set_state(State::Active);
9475 /// let x1 = PrivateCloud::new().set_state(State::Creating);
9476 /// let x2 = PrivateCloud::new().set_state(State::Updating);
9477 /// ```
9478 pub fn set_state<T: std::convert::Into<crate::model::private_cloud::State>>(
9479 mut self,
9480 v: T,
9481 ) -> Self {
9482 self.state = v.into();
9483 self
9484 }
9485
9486 /// Sets the value of [network_config][crate::model::PrivateCloud::network_config].
9487 ///
9488 /// # Example
9489 /// ```ignore,no_run
9490 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9491 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9492 /// let x = PrivateCloud::new().set_network_config(NetworkConfig::default()/* use setters */);
9493 /// ```
9494 pub fn set_network_config<T>(mut self, v: T) -> Self
9495 where
9496 T: std::convert::Into<crate::model::NetworkConfig>,
9497 {
9498 self.network_config = std::option::Option::Some(v.into());
9499 self
9500 }
9501
9502 /// Sets or clears the value of [network_config][crate::model::PrivateCloud::network_config].
9503 ///
9504 /// # Example
9505 /// ```ignore,no_run
9506 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9507 /// use google_cloud_vmwareengine_v1::model::NetworkConfig;
9508 /// let x = PrivateCloud::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
9509 /// let x = PrivateCloud::new().set_or_clear_network_config(None::<NetworkConfig>);
9510 /// ```
9511 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
9512 where
9513 T: std::convert::Into<crate::model::NetworkConfig>,
9514 {
9515 self.network_config = v.map(|x| x.into());
9516 self
9517 }
9518
9519 /// Sets the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9520 ///
9521 /// # Example
9522 /// ```ignore,no_run
9523 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9524 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9525 /// let x = PrivateCloud::new().set_management_cluster(ManagementCluster::default()/* use setters */);
9526 /// ```
9527 pub fn set_management_cluster<T>(mut self, v: T) -> Self
9528 where
9529 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9530 {
9531 self.management_cluster = std::option::Option::Some(v.into());
9532 self
9533 }
9534
9535 /// Sets or clears the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
9536 ///
9537 /// # Example
9538 /// ```ignore,no_run
9539 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9540 /// use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9541 /// let x = PrivateCloud::new().set_or_clear_management_cluster(Some(ManagementCluster::default()/* use setters */));
9542 /// let x = PrivateCloud::new().set_or_clear_management_cluster(None::<ManagementCluster>);
9543 /// ```
9544 pub fn set_or_clear_management_cluster<T>(mut self, v: std::option::Option<T>) -> Self
9545 where
9546 T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
9547 {
9548 self.management_cluster = v.map(|x| x.into());
9549 self
9550 }
9551
9552 /// Sets the value of [description][crate::model::PrivateCloud::description].
9553 ///
9554 /// # Example
9555 /// ```ignore,no_run
9556 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9557 /// let x = PrivateCloud::new().set_description("example");
9558 /// ```
9559 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9560 self.description = v.into();
9561 self
9562 }
9563
9564 /// Sets the value of [hcx][crate::model::PrivateCloud::hcx].
9565 ///
9566 /// # Example
9567 /// ```ignore,no_run
9568 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9569 /// use google_cloud_vmwareengine_v1::model::Hcx;
9570 /// let x = PrivateCloud::new().set_hcx(Hcx::default()/* use setters */);
9571 /// ```
9572 pub fn set_hcx<T>(mut self, v: T) -> Self
9573 where
9574 T: std::convert::Into<crate::model::Hcx>,
9575 {
9576 self.hcx = std::option::Option::Some(v.into());
9577 self
9578 }
9579
9580 /// Sets or clears the value of [hcx][crate::model::PrivateCloud::hcx].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9585 /// use google_cloud_vmwareengine_v1::model::Hcx;
9586 /// let x = PrivateCloud::new().set_or_clear_hcx(Some(Hcx::default()/* use setters */));
9587 /// let x = PrivateCloud::new().set_or_clear_hcx(None::<Hcx>);
9588 /// ```
9589 pub fn set_or_clear_hcx<T>(mut self, v: std::option::Option<T>) -> Self
9590 where
9591 T: std::convert::Into<crate::model::Hcx>,
9592 {
9593 self.hcx = v.map(|x| x.into());
9594 self
9595 }
9596
9597 /// Sets the value of [nsx][crate::model::PrivateCloud::nsx].
9598 ///
9599 /// # Example
9600 /// ```ignore,no_run
9601 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9602 /// use google_cloud_vmwareengine_v1::model::Nsx;
9603 /// let x = PrivateCloud::new().set_nsx(Nsx::default()/* use setters */);
9604 /// ```
9605 pub fn set_nsx<T>(mut self, v: T) -> Self
9606 where
9607 T: std::convert::Into<crate::model::Nsx>,
9608 {
9609 self.nsx = std::option::Option::Some(v.into());
9610 self
9611 }
9612
9613 /// Sets or clears the value of [nsx][crate::model::PrivateCloud::nsx].
9614 ///
9615 /// # Example
9616 /// ```ignore,no_run
9617 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9618 /// use google_cloud_vmwareengine_v1::model::Nsx;
9619 /// let x = PrivateCloud::new().set_or_clear_nsx(Some(Nsx::default()/* use setters */));
9620 /// let x = PrivateCloud::new().set_or_clear_nsx(None::<Nsx>);
9621 /// ```
9622 pub fn set_or_clear_nsx<T>(mut self, v: std::option::Option<T>) -> Self
9623 where
9624 T: std::convert::Into<crate::model::Nsx>,
9625 {
9626 self.nsx = v.map(|x| x.into());
9627 self
9628 }
9629
9630 /// Sets the value of [vcenter][crate::model::PrivateCloud::vcenter].
9631 ///
9632 /// # Example
9633 /// ```ignore,no_run
9634 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9635 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9636 /// let x = PrivateCloud::new().set_vcenter(Vcenter::default()/* use setters */);
9637 /// ```
9638 pub fn set_vcenter<T>(mut self, v: T) -> Self
9639 where
9640 T: std::convert::Into<crate::model::Vcenter>,
9641 {
9642 self.vcenter = std::option::Option::Some(v.into());
9643 self
9644 }
9645
9646 /// Sets or clears the value of [vcenter][crate::model::PrivateCloud::vcenter].
9647 ///
9648 /// # Example
9649 /// ```ignore,no_run
9650 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9651 /// use google_cloud_vmwareengine_v1::model::Vcenter;
9652 /// let x = PrivateCloud::new().set_or_clear_vcenter(Some(Vcenter::default()/* use setters */));
9653 /// let x = PrivateCloud::new().set_or_clear_vcenter(None::<Vcenter>);
9654 /// ```
9655 pub fn set_or_clear_vcenter<T>(mut self, v: std::option::Option<T>) -> Self
9656 where
9657 T: std::convert::Into<crate::model::Vcenter>,
9658 {
9659 self.vcenter = v.map(|x| x.into());
9660 self
9661 }
9662
9663 /// Sets the value of [uid][crate::model::PrivateCloud::uid].
9664 ///
9665 /// # Example
9666 /// ```ignore,no_run
9667 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9668 /// let x = PrivateCloud::new().set_uid("example");
9669 /// ```
9670 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9671 self.uid = v.into();
9672 self
9673 }
9674
9675 /// Sets the value of [r#type][crate::model::PrivateCloud::type].
9676 ///
9677 /// # Example
9678 /// ```ignore,no_run
9679 /// # use google_cloud_vmwareengine_v1::model::PrivateCloud;
9680 /// use google_cloud_vmwareengine_v1::model::private_cloud::Type;
9681 /// let x0 = PrivateCloud::new().set_type(Type::TimeLimited);
9682 /// let x1 = PrivateCloud::new().set_type(Type::Stretched);
9683 /// ```
9684 pub fn set_type<T: std::convert::Into<crate::model::private_cloud::Type>>(
9685 mut self,
9686 v: T,
9687 ) -> Self {
9688 self.r#type = v.into();
9689 self
9690 }
9691}
9692
9693impl wkt::message::Message for PrivateCloud {
9694 fn typename() -> &'static str {
9695 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud"
9696 }
9697}
9698
9699/// Defines additional types related to [PrivateCloud].
9700pub mod private_cloud {
9701 #[allow(unused_imports)]
9702 use super::*;
9703
9704 /// Management cluster configuration.
9705 #[derive(Clone, Default, PartialEq)]
9706 #[non_exhaustive]
9707 pub struct ManagementCluster {
9708 /// Required. The user-provided identifier of the new `Cluster`.
9709 /// The identifier must meet the following requirements:
9710 ///
9711 /// * Only contains 1-63 alphanumeric characters and hyphens
9712 /// * Begins with an alphabetical character
9713 /// * Ends with a non-hyphen character
9714 /// * Not formatted as a UUID
9715 /// * Complies with [RFC
9716 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
9717 pub cluster_id: std::string::String,
9718
9719 /// Required. The map of cluster node types in this cluster, where the key is
9720 /// canonical identifier of the node type (corresponds to the `NodeType`).
9721 pub node_type_configs:
9722 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
9723
9724 /// Optional. Configuration of a stretched cluster. Required for STRETCHED
9725 /// private clouds.
9726 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
9727
9728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9729 }
9730
9731 impl ManagementCluster {
9732 /// Creates a new default instance.
9733 pub fn new() -> Self {
9734 std::default::Default::default()
9735 }
9736
9737 /// Sets the value of [cluster_id][crate::model::private_cloud::ManagementCluster::cluster_id].
9738 ///
9739 /// # Example
9740 /// ```ignore,no_run
9741 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9742 /// let x = ManagementCluster::new().set_cluster_id("example");
9743 /// ```
9744 pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9745 self.cluster_id = v.into();
9746 self
9747 }
9748
9749 /// Sets the value of [node_type_configs][crate::model::private_cloud::ManagementCluster::node_type_configs].
9750 ///
9751 /// # Example
9752 /// ```ignore,no_run
9753 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9754 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
9755 /// let x = ManagementCluster::new().set_node_type_configs([
9756 /// ("key0", NodeTypeConfig::default()/* use setters */),
9757 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
9758 /// ]);
9759 /// ```
9760 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
9761 where
9762 T: std::iter::IntoIterator<Item = (K, V)>,
9763 K: std::convert::Into<std::string::String>,
9764 V: std::convert::Into<crate::model::NodeTypeConfig>,
9765 {
9766 use std::iter::Iterator;
9767 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9768 self
9769 }
9770
9771 /// Sets the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9772 ///
9773 /// # Example
9774 /// ```ignore,no_run
9775 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9776 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9777 /// let x = ManagementCluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
9778 /// ```
9779 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
9780 where
9781 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9782 {
9783 self.stretched_cluster_config = std::option::Option::Some(v.into());
9784 self
9785 }
9786
9787 /// Sets or clears the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
9788 ///
9789 /// # Example
9790 /// ```ignore,no_run
9791 /// # use google_cloud_vmwareengine_v1::model::private_cloud::ManagementCluster;
9792 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
9793 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
9794 /// let x = ManagementCluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
9795 /// ```
9796 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
9797 where
9798 T: std::convert::Into<crate::model::StretchedClusterConfig>,
9799 {
9800 self.stretched_cluster_config = v.map(|x| x.into());
9801 self
9802 }
9803 }
9804
9805 impl wkt::message::Message for ManagementCluster {
9806 fn typename() -> &'static str {
9807 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"
9808 }
9809 }
9810
9811 /// Enum State defines possible states of private clouds.
9812 ///
9813 /// # Working with unknown values
9814 ///
9815 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9816 /// additional enum variants at any time. Adding new variants is not considered
9817 /// a breaking change. Applications should write their code in anticipation of:
9818 ///
9819 /// - New values appearing in future releases of the client library, **and**
9820 /// - New values received dynamically, without application changes.
9821 ///
9822 /// Please consult the [Working with enums] section in the user guide for some
9823 /// guidelines.
9824 ///
9825 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9826 #[derive(Clone, Debug, PartialEq)]
9827 #[non_exhaustive]
9828 pub enum State {
9829 /// The default value. This value should never be used.
9830 Unspecified,
9831 /// The private cloud is ready.
9832 Active,
9833 /// The private cloud is being created.
9834 Creating,
9835 /// The private cloud is being updated.
9836 Updating,
9837 /// The private cloud is in failed state.
9838 Failed,
9839 /// The private cloud is scheduled for deletion. The deletion process can be
9840 /// cancelled by using the corresponding undelete method.
9841 Deleted,
9842 /// The private cloud is irreversibly deleted and is being removed from the
9843 /// system.
9844 Purging,
9845 /// If set, the enum was initialized with an unknown value.
9846 ///
9847 /// Applications can examine the value using [State::value] or
9848 /// [State::name].
9849 UnknownValue(state::UnknownValue),
9850 }
9851
9852 #[doc(hidden)]
9853 pub mod state {
9854 #[allow(unused_imports)]
9855 use super::*;
9856 #[derive(Clone, Debug, PartialEq)]
9857 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9858 }
9859
9860 impl State {
9861 /// Gets the enum value.
9862 ///
9863 /// Returns `None` if the enum contains an unknown value deserialized from
9864 /// the string representation of enums.
9865 pub fn value(&self) -> std::option::Option<i32> {
9866 match self {
9867 Self::Unspecified => std::option::Option::Some(0),
9868 Self::Active => std::option::Option::Some(1),
9869 Self::Creating => std::option::Option::Some(2),
9870 Self::Updating => std::option::Option::Some(3),
9871 Self::Failed => std::option::Option::Some(5),
9872 Self::Deleted => std::option::Option::Some(6),
9873 Self::Purging => std::option::Option::Some(7),
9874 Self::UnknownValue(u) => u.0.value(),
9875 }
9876 }
9877
9878 /// Gets the enum value as a string.
9879 ///
9880 /// Returns `None` if the enum contains an unknown value deserialized from
9881 /// the integer representation of enums.
9882 pub fn name(&self) -> std::option::Option<&str> {
9883 match self {
9884 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9885 Self::Active => std::option::Option::Some("ACTIVE"),
9886 Self::Creating => std::option::Option::Some("CREATING"),
9887 Self::Updating => std::option::Option::Some("UPDATING"),
9888 Self::Failed => std::option::Option::Some("FAILED"),
9889 Self::Deleted => std::option::Option::Some("DELETED"),
9890 Self::Purging => std::option::Option::Some("PURGING"),
9891 Self::UnknownValue(u) => u.0.name(),
9892 }
9893 }
9894 }
9895
9896 impl std::default::Default for State {
9897 fn default() -> Self {
9898 use std::convert::From;
9899 Self::from(0)
9900 }
9901 }
9902
9903 impl std::fmt::Display for State {
9904 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9905 wkt::internal::display_enum(f, self.name(), self.value())
9906 }
9907 }
9908
9909 impl std::convert::From<i32> for State {
9910 fn from(value: i32) -> Self {
9911 match value {
9912 0 => Self::Unspecified,
9913 1 => Self::Active,
9914 2 => Self::Creating,
9915 3 => Self::Updating,
9916 5 => Self::Failed,
9917 6 => Self::Deleted,
9918 7 => Self::Purging,
9919 _ => Self::UnknownValue(state::UnknownValue(
9920 wkt::internal::UnknownEnumValue::Integer(value),
9921 )),
9922 }
9923 }
9924 }
9925
9926 impl std::convert::From<&str> for State {
9927 fn from(value: &str) -> Self {
9928 use std::string::ToString;
9929 match value {
9930 "STATE_UNSPECIFIED" => Self::Unspecified,
9931 "ACTIVE" => Self::Active,
9932 "CREATING" => Self::Creating,
9933 "UPDATING" => Self::Updating,
9934 "FAILED" => Self::Failed,
9935 "DELETED" => Self::Deleted,
9936 "PURGING" => Self::Purging,
9937 _ => Self::UnknownValue(state::UnknownValue(
9938 wkt::internal::UnknownEnumValue::String(value.to_string()),
9939 )),
9940 }
9941 }
9942 }
9943
9944 impl serde::ser::Serialize for State {
9945 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9946 where
9947 S: serde::Serializer,
9948 {
9949 match self {
9950 Self::Unspecified => serializer.serialize_i32(0),
9951 Self::Active => serializer.serialize_i32(1),
9952 Self::Creating => serializer.serialize_i32(2),
9953 Self::Updating => serializer.serialize_i32(3),
9954 Self::Failed => serializer.serialize_i32(5),
9955 Self::Deleted => serializer.serialize_i32(6),
9956 Self::Purging => serializer.serialize_i32(7),
9957 Self::UnknownValue(u) => u.0.serialize(serializer),
9958 }
9959 }
9960 }
9961
9962 impl<'de> serde::de::Deserialize<'de> for State {
9963 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9964 where
9965 D: serde::Deserializer<'de>,
9966 {
9967 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9968 ".google.cloud.vmwareengine.v1.PrivateCloud.State",
9969 ))
9970 }
9971 }
9972
9973 /// Enum Type defines private cloud type.
9974 ///
9975 /// # Working with unknown values
9976 ///
9977 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9978 /// additional enum variants at any time. Adding new variants is not considered
9979 /// a breaking change. Applications should write their code in anticipation of:
9980 ///
9981 /// - New values appearing in future releases of the client library, **and**
9982 /// - New values received dynamically, without application changes.
9983 ///
9984 /// Please consult the [Working with enums] section in the user guide for some
9985 /// guidelines.
9986 ///
9987 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9988 #[derive(Clone, Debug, PartialEq)]
9989 #[non_exhaustive]
9990 pub enum Type {
9991 /// Standard private is a zonal resource, with 3+ nodes. Default type.
9992 Standard,
9993 /// Time limited private cloud is a zonal resource, can have only 1 node and
9994 /// has limited life span. Will be deleted after defined period of time,
9995 /// can be converted into standard private cloud by expanding it up to 3
9996 /// or more nodes.
9997 TimeLimited,
9998 /// Stretched private cloud is a regional resource with redundancy,
9999 /// with a minimum of 6 nodes, nodes count has to be even.
10000 Stretched,
10001 /// If set, the enum was initialized with an unknown value.
10002 ///
10003 /// Applications can examine the value using [Type::value] or
10004 /// [Type::name].
10005 UnknownValue(r#type::UnknownValue),
10006 }
10007
10008 #[doc(hidden)]
10009 pub mod r#type {
10010 #[allow(unused_imports)]
10011 use super::*;
10012 #[derive(Clone, Debug, PartialEq)]
10013 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10014 }
10015
10016 impl Type {
10017 /// Gets the enum value.
10018 ///
10019 /// Returns `None` if the enum contains an unknown value deserialized from
10020 /// the string representation of enums.
10021 pub fn value(&self) -> std::option::Option<i32> {
10022 match self {
10023 Self::Standard => std::option::Option::Some(0),
10024 Self::TimeLimited => std::option::Option::Some(1),
10025 Self::Stretched => std::option::Option::Some(2),
10026 Self::UnknownValue(u) => u.0.value(),
10027 }
10028 }
10029
10030 /// Gets the enum value as a string.
10031 ///
10032 /// Returns `None` if the enum contains an unknown value deserialized from
10033 /// the integer representation of enums.
10034 pub fn name(&self) -> std::option::Option<&str> {
10035 match self {
10036 Self::Standard => std::option::Option::Some("STANDARD"),
10037 Self::TimeLimited => std::option::Option::Some("TIME_LIMITED"),
10038 Self::Stretched => std::option::Option::Some("STRETCHED"),
10039 Self::UnknownValue(u) => u.0.name(),
10040 }
10041 }
10042 }
10043
10044 impl std::default::Default for Type {
10045 fn default() -> Self {
10046 use std::convert::From;
10047 Self::from(0)
10048 }
10049 }
10050
10051 impl std::fmt::Display for Type {
10052 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10053 wkt::internal::display_enum(f, self.name(), self.value())
10054 }
10055 }
10056
10057 impl std::convert::From<i32> for Type {
10058 fn from(value: i32) -> Self {
10059 match value {
10060 0 => Self::Standard,
10061 1 => Self::TimeLimited,
10062 2 => Self::Stretched,
10063 _ => Self::UnknownValue(r#type::UnknownValue(
10064 wkt::internal::UnknownEnumValue::Integer(value),
10065 )),
10066 }
10067 }
10068 }
10069
10070 impl std::convert::From<&str> for Type {
10071 fn from(value: &str) -> Self {
10072 use std::string::ToString;
10073 match value {
10074 "STANDARD" => Self::Standard,
10075 "TIME_LIMITED" => Self::TimeLimited,
10076 "STRETCHED" => Self::Stretched,
10077 _ => Self::UnknownValue(r#type::UnknownValue(
10078 wkt::internal::UnknownEnumValue::String(value.to_string()),
10079 )),
10080 }
10081 }
10082 }
10083
10084 impl serde::ser::Serialize for Type {
10085 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10086 where
10087 S: serde::Serializer,
10088 {
10089 match self {
10090 Self::Standard => serializer.serialize_i32(0),
10091 Self::TimeLimited => serializer.serialize_i32(1),
10092 Self::Stretched => serializer.serialize_i32(2),
10093 Self::UnknownValue(u) => u.0.serialize(serializer),
10094 }
10095 }
10096 }
10097
10098 impl<'de> serde::de::Deserialize<'de> for Type {
10099 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10100 where
10101 D: serde::Deserializer<'de>,
10102 {
10103 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10104 ".google.cloud.vmwareengine.v1.PrivateCloud.Type",
10105 ))
10106 }
10107 }
10108}
10109
10110/// A cluster in a private cloud.
10111#[derive(Clone, Default, PartialEq)]
10112#[non_exhaustive]
10113pub struct Cluster {
10114 /// Output only. The resource name of this cluster.
10115 /// Resource names are schemeless URIs that follow the conventions in
10116 /// <https://cloud.google.com/apis/design/resource_names>.
10117 /// For example:
10118 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
10119 pub name: std::string::String,
10120
10121 /// Output only. Creation time of this resource.
10122 pub create_time: std::option::Option<wkt::Timestamp>,
10123
10124 /// Output only. Last update time of this resource.
10125 pub update_time: std::option::Option<wkt::Timestamp>,
10126
10127 /// Output only. State of the resource.
10128 pub state: crate::model::cluster::State,
10129
10130 /// Output only. True if the cluster is a management cluster; false otherwise.
10131 /// There can only be one management cluster in a private cloud
10132 /// and it has to be the first one.
10133 pub management: bool,
10134
10135 /// Optional. Configuration of the autoscaling applied to this cluster.
10136 pub autoscaling_settings: std::option::Option<crate::model::AutoscalingSettings>,
10137
10138 /// Output only. System-generated unique identifier for the resource.
10139 pub uid: std::string::String,
10140
10141 /// Required. The map of cluster node types in this cluster, where the key is
10142 /// canonical identifier of the node type (corresponds to the `NodeType`).
10143 pub node_type_configs:
10144 std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
10145
10146 /// Optional. Configuration of a stretched cluster. Required for clusters that
10147 /// belong to a STRETCHED private cloud.
10148 pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
10149
10150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10151}
10152
10153impl Cluster {
10154 /// Creates a new default instance.
10155 pub fn new() -> Self {
10156 std::default::Default::default()
10157 }
10158
10159 /// Sets the value of [name][crate::model::Cluster::name].
10160 ///
10161 /// # Example
10162 /// ```ignore,no_run
10163 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10164 /// # let project_id = "project_id";
10165 /// # let location_id = "location_id";
10166 /// # let private_cloud_id = "private_cloud_id";
10167 /// # let cluster_id = "cluster_id";
10168 /// let x = Cluster::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}"));
10169 /// ```
10170 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10171 self.name = v.into();
10172 self
10173 }
10174
10175 /// Sets the value of [create_time][crate::model::Cluster::create_time].
10176 ///
10177 /// # Example
10178 /// ```ignore,no_run
10179 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10180 /// use wkt::Timestamp;
10181 /// let x = Cluster::new().set_create_time(Timestamp::default()/* use setters */);
10182 /// ```
10183 pub fn set_create_time<T>(mut self, v: T) -> Self
10184 where
10185 T: std::convert::Into<wkt::Timestamp>,
10186 {
10187 self.create_time = std::option::Option::Some(v.into());
10188 self
10189 }
10190
10191 /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
10192 ///
10193 /// # Example
10194 /// ```ignore,no_run
10195 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10196 /// use wkt::Timestamp;
10197 /// let x = Cluster::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10198 /// let x = Cluster::new().set_or_clear_create_time(None::<Timestamp>);
10199 /// ```
10200 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10201 where
10202 T: std::convert::Into<wkt::Timestamp>,
10203 {
10204 self.create_time = v.map(|x| x.into());
10205 self
10206 }
10207
10208 /// Sets the value of [update_time][crate::model::Cluster::update_time].
10209 ///
10210 /// # Example
10211 /// ```ignore,no_run
10212 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10213 /// use wkt::Timestamp;
10214 /// let x = Cluster::new().set_update_time(Timestamp::default()/* use setters */);
10215 /// ```
10216 pub fn set_update_time<T>(mut self, v: T) -> Self
10217 where
10218 T: std::convert::Into<wkt::Timestamp>,
10219 {
10220 self.update_time = std::option::Option::Some(v.into());
10221 self
10222 }
10223
10224 /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
10225 ///
10226 /// # Example
10227 /// ```ignore,no_run
10228 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10229 /// use wkt::Timestamp;
10230 /// let x = Cluster::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10231 /// let x = Cluster::new().set_or_clear_update_time(None::<Timestamp>);
10232 /// ```
10233 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10234 where
10235 T: std::convert::Into<wkt::Timestamp>,
10236 {
10237 self.update_time = v.map(|x| x.into());
10238 self
10239 }
10240
10241 /// Sets the value of [state][crate::model::Cluster::state].
10242 ///
10243 /// # Example
10244 /// ```ignore,no_run
10245 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10246 /// use google_cloud_vmwareengine_v1::model::cluster::State;
10247 /// let x0 = Cluster::new().set_state(State::Active);
10248 /// let x1 = Cluster::new().set_state(State::Creating);
10249 /// let x2 = Cluster::new().set_state(State::Updating);
10250 /// ```
10251 pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
10252 self.state = v.into();
10253 self
10254 }
10255
10256 /// Sets the value of [management][crate::model::Cluster::management].
10257 ///
10258 /// # Example
10259 /// ```ignore,no_run
10260 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10261 /// let x = Cluster::new().set_management(true);
10262 /// ```
10263 pub fn set_management<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10264 self.management = v.into();
10265 self
10266 }
10267
10268 /// Sets the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
10269 ///
10270 /// # Example
10271 /// ```ignore,no_run
10272 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10273 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
10274 /// let x = Cluster::new().set_autoscaling_settings(AutoscalingSettings::default()/* use setters */);
10275 /// ```
10276 pub fn set_autoscaling_settings<T>(mut self, v: T) -> Self
10277 where
10278 T: std::convert::Into<crate::model::AutoscalingSettings>,
10279 {
10280 self.autoscaling_settings = std::option::Option::Some(v.into());
10281 self
10282 }
10283
10284 /// Sets or clears the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
10285 ///
10286 /// # Example
10287 /// ```ignore,no_run
10288 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10289 /// use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
10290 /// let x = Cluster::new().set_or_clear_autoscaling_settings(Some(AutoscalingSettings::default()/* use setters */));
10291 /// let x = Cluster::new().set_or_clear_autoscaling_settings(None::<AutoscalingSettings>);
10292 /// ```
10293 pub fn set_or_clear_autoscaling_settings<T>(mut self, v: std::option::Option<T>) -> Self
10294 where
10295 T: std::convert::Into<crate::model::AutoscalingSettings>,
10296 {
10297 self.autoscaling_settings = v.map(|x| x.into());
10298 self
10299 }
10300
10301 /// Sets the value of [uid][crate::model::Cluster::uid].
10302 ///
10303 /// # Example
10304 /// ```ignore,no_run
10305 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10306 /// let x = Cluster::new().set_uid("example");
10307 /// ```
10308 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10309 self.uid = v.into();
10310 self
10311 }
10312
10313 /// Sets the value of [node_type_configs][crate::model::Cluster::node_type_configs].
10314 ///
10315 /// # Example
10316 /// ```ignore,no_run
10317 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10318 /// use google_cloud_vmwareengine_v1::model::NodeTypeConfig;
10319 /// let x = Cluster::new().set_node_type_configs([
10320 /// ("key0", NodeTypeConfig::default()/* use setters */),
10321 /// ("key1", NodeTypeConfig::default()/* use (different) setters */),
10322 /// ]);
10323 /// ```
10324 pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
10325 where
10326 T: std::iter::IntoIterator<Item = (K, V)>,
10327 K: std::convert::Into<std::string::String>,
10328 V: std::convert::Into<crate::model::NodeTypeConfig>,
10329 {
10330 use std::iter::Iterator;
10331 self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10332 self
10333 }
10334
10335 /// Sets the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10336 ///
10337 /// # Example
10338 /// ```ignore,no_run
10339 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10340 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10341 /// let x = Cluster::new().set_stretched_cluster_config(StretchedClusterConfig::default()/* use setters */);
10342 /// ```
10343 pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
10344 where
10345 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10346 {
10347 self.stretched_cluster_config = std::option::Option::Some(v.into());
10348 self
10349 }
10350
10351 /// Sets or clears the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
10352 ///
10353 /// # Example
10354 /// ```ignore,no_run
10355 /// # use google_cloud_vmwareengine_v1::model::Cluster;
10356 /// use google_cloud_vmwareengine_v1::model::StretchedClusterConfig;
10357 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(Some(StretchedClusterConfig::default()/* use setters */));
10358 /// let x = Cluster::new().set_or_clear_stretched_cluster_config(None::<StretchedClusterConfig>);
10359 /// ```
10360 pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
10361 where
10362 T: std::convert::Into<crate::model::StretchedClusterConfig>,
10363 {
10364 self.stretched_cluster_config = v.map(|x| x.into());
10365 self
10366 }
10367}
10368
10369impl wkt::message::Message for Cluster {
10370 fn typename() -> &'static str {
10371 "type.googleapis.com/google.cloud.vmwareengine.v1.Cluster"
10372 }
10373}
10374
10375/// Defines additional types related to [Cluster].
10376pub mod cluster {
10377 #[allow(unused_imports)]
10378 use super::*;
10379
10380 /// Enum State defines possible states of private cloud clusters.
10381 ///
10382 /// # Working with unknown values
10383 ///
10384 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10385 /// additional enum variants at any time. Adding new variants is not considered
10386 /// a breaking change. Applications should write their code in anticipation of:
10387 ///
10388 /// - New values appearing in future releases of the client library, **and**
10389 /// - New values received dynamically, without application changes.
10390 ///
10391 /// Please consult the [Working with enums] section in the user guide for some
10392 /// guidelines.
10393 ///
10394 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10395 #[derive(Clone, Debug, PartialEq)]
10396 #[non_exhaustive]
10397 pub enum State {
10398 /// The default value. This value should never be used.
10399 Unspecified,
10400 /// The Cluster is operational and can be used by the user.
10401 Active,
10402 /// The Cluster is being deployed.
10403 Creating,
10404 /// Adding or removing of a node to the cluster, any other cluster specific
10405 /// updates.
10406 Updating,
10407 /// The Cluster is being deleted.
10408 Deleting,
10409 /// The Cluster is undergoing maintenance, for example: a failed node is
10410 /// getting replaced.
10411 Repairing,
10412 /// If set, the enum was initialized with an unknown value.
10413 ///
10414 /// Applications can examine the value using [State::value] or
10415 /// [State::name].
10416 UnknownValue(state::UnknownValue),
10417 }
10418
10419 #[doc(hidden)]
10420 pub mod state {
10421 #[allow(unused_imports)]
10422 use super::*;
10423 #[derive(Clone, Debug, PartialEq)]
10424 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10425 }
10426
10427 impl State {
10428 /// Gets the enum value.
10429 ///
10430 /// Returns `None` if the enum contains an unknown value deserialized from
10431 /// the string representation of enums.
10432 pub fn value(&self) -> std::option::Option<i32> {
10433 match self {
10434 Self::Unspecified => std::option::Option::Some(0),
10435 Self::Active => std::option::Option::Some(1),
10436 Self::Creating => std::option::Option::Some(2),
10437 Self::Updating => std::option::Option::Some(3),
10438 Self::Deleting => std::option::Option::Some(4),
10439 Self::Repairing => std::option::Option::Some(5),
10440 Self::UnknownValue(u) => u.0.value(),
10441 }
10442 }
10443
10444 /// Gets the enum value as a string.
10445 ///
10446 /// Returns `None` if the enum contains an unknown value deserialized from
10447 /// the integer representation of enums.
10448 pub fn name(&self) -> std::option::Option<&str> {
10449 match self {
10450 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10451 Self::Active => std::option::Option::Some("ACTIVE"),
10452 Self::Creating => std::option::Option::Some("CREATING"),
10453 Self::Updating => std::option::Option::Some("UPDATING"),
10454 Self::Deleting => std::option::Option::Some("DELETING"),
10455 Self::Repairing => std::option::Option::Some("REPAIRING"),
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::Updating,
10481 4 => Self::Deleting,
10482 5 => Self::Repairing,
10483 _ => Self::UnknownValue(state::UnknownValue(
10484 wkt::internal::UnknownEnumValue::Integer(value),
10485 )),
10486 }
10487 }
10488 }
10489
10490 impl std::convert::From<&str> for State {
10491 fn from(value: &str) -> Self {
10492 use std::string::ToString;
10493 match value {
10494 "STATE_UNSPECIFIED" => Self::Unspecified,
10495 "ACTIVE" => Self::Active,
10496 "CREATING" => Self::Creating,
10497 "UPDATING" => Self::Updating,
10498 "DELETING" => Self::Deleting,
10499 "REPAIRING" => Self::Repairing,
10500 _ => Self::UnknownValue(state::UnknownValue(
10501 wkt::internal::UnknownEnumValue::String(value.to_string()),
10502 )),
10503 }
10504 }
10505 }
10506
10507 impl serde::ser::Serialize for State {
10508 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10509 where
10510 S: serde::Serializer,
10511 {
10512 match self {
10513 Self::Unspecified => serializer.serialize_i32(0),
10514 Self::Active => serializer.serialize_i32(1),
10515 Self::Creating => serializer.serialize_i32(2),
10516 Self::Updating => serializer.serialize_i32(3),
10517 Self::Deleting => serializer.serialize_i32(4),
10518 Self::Repairing => serializer.serialize_i32(5),
10519 Self::UnknownValue(u) => u.0.serialize(serializer),
10520 }
10521 }
10522 }
10523
10524 impl<'de> serde::de::Deserialize<'de> for State {
10525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10526 where
10527 D: serde::Deserializer<'de>,
10528 {
10529 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10530 ".google.cloud.vmwareengine.v1.Cluster.State",
10531 ))
10532 }
10533 }
10534}
10535
10536/// Node in a cluster.
10537#[derive(Clone, Default, PartialEq)]
10538#[non_exhaustive]
10539pub struct Node {
10540 /// Output only. The resource name of this node.
10541 /// Resource names are schemeless URIs that follow the conventions in
10542 /// <https://cloud.google.com/apis/design/resource_names>.
10543 /// For example:
10544 /// projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node
10545 pub name: std::string::String,
10546
10547 /// Output only. Fully qualified domain name of the node.
10548 pub fqdn: std::string::String,
10549
10550 /// Output only. Internal IP address of the node.
10551 pub internal_ip: std::string::String,
10552
10553 /// Output only. The canonical identifier of the node type (corresponds to the
10554 /// `NodeType`).
10555 /// For example: standard-72.
10556 pub node_type_id: std::string::String,
10557
10558 /// Output only. The version number of the VMware ESXi
10559 /// management component in this cluster.
10560 pub version: std::string::String,
10561
10562 /// Output only. Customized number of cores
10563 pub custom_core_count: i64,
10564
10565 /// Output only. The state of the appliance.
10566 pub state: crate::model::node::State,
10567
10568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10569}
10570
10571impl Node {
10572 /// Creates a new default instance.
10573 pub fn new() -> Self {
10574 std::default::Default::default()
10575 }
10576
10577 /// Sets the value of [name][crate::model::Node::name].
10578 ///
10579 /// # Example
10580 /// ```ignore,no_run
10581 /// # use google_cloud_vmwareengine_v1::model::Node;
10582 /// # let project_id = "project_id";
10583 /// # let location_id = "location_id";
10584 /// # let private_cloud_id = "private_cloud_id";
10585 /// # let cluster_id = "cluster_id";
10586 /// # let node_id = "node_id";
10587 /// let x = Node::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/clusters/{cluster_id}/nodes/{node_id}"));
10588 /// ```
10589 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10590 self.name = v.into();
10591 self
10592 }
10593
10594 /// Sets the value of [fqdn][crate::model::Node::fqdn].
10595 ///
10596 /// # Example
10597 /// ```ignore,no_run
10598 /// # use google_cloud_vmwareengine_v1::model::Node;
10599 /// let x = Node::new().set_fqdn("example");
10600 /// ```
10601 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10602 self.fqdn = v.into();
10603 self
10604 }
10605
10606 /// Sets the value of [internal_ip][crate::model::Node::internal_ip].
10607 ///
10608 /// # Example
10609 /// ```ignore,no_run
10610 /// # use google_cloud_vmwareengine_v1::model::Node;
10611 /// let x = Node::new().set_internal_ip("example");
10612 /// ```
10613 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10614 self.internal_ip = v.into();
10615 self
10616 }
10617
10618 /// Sets the value of [node_type_id][crate::model::Node::node_type_id].
10619 ///
10620 /// # Example
10621 /// ```ignore,no_run
10622 /// # use google_cloud_vmwareengine_v1::model::Node;
10623 /// let x = Node::new().set_node_type_id("example");
10624 /// ```
10625 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10626 self.node_type_id = v.into();
10627 self
10628 }
10629
10630 /// Sets the value of [version][crate::model::Node::version].
10631 ///
10632 /// # Example
10633 /// ```ignore,no_run
10634 /// # use google_cloud_vmwareengine_v1::model::Node;
10635 /// let x = Node::new().set_version("example");
10636 /// ```
10637 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10638 self.version = v.into();
10639 self
10640 }
10641
10642 /// Sets the value of [custom_core_count][crate::model::Node::custom_core_count].
10643 ///
10644 /// # Example
10645 /// ```ignore,no_run
10646 /// # use google_cloud_vmwareengine_v1::model::Node;
10647 /// let x = Node::new().set_custom_core_count(42);
10648 /// ```
10649 pub fn set_custom_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10650 self.custom_core_count = v.into();
10651 self
10652 }
10653
10654 /// Sets the value of [state][crate::model::Node::state].
10655 ///
10656 /// # Example
10657 /// ```ignore,no_run
10658 /// # use google_cloud_vmwareengine_v1::model::Node;
10659 /// use google_cloud_vmwareengine_v1::model::node::State;
10660 /// let x0 = Node::new().set_state(State::Active);
10661 /// let x1 = Node::new().set_state(State::Creating);
10662 /// let x2 = Node::new().set_state(State::Failed);
10663 /// ```
10664 pub fn set_state<T: std::convert::Into<crate::model::node::State>>(mut self, v: T) -> Self {
10665 self.state = v.into();
10666 self
10667 }
10668}
10669
10670impl wkt::message::Message for Node {
10671 fn typename() -> &'static str {
10672 "type.googleapis.com/google.cloud.vmwareengine.v1.Node"
10673 }
10674}
10675
10676/// Defines additional types related to [Node].
10677pub mod node {
10678 #[allow(unused_imports)]
10679 use super::*;
10680
10681 /// Enum State defines possible states of a node in a cluster.
10682 ///
10683 /// # Working with unknown values
10684 ///
10685 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10686 /// additional enum variants at any time. Adding new variants is not considered
10687 /// a breaking change. Applications should write their code in anticipation of:
10688 ///
10689 /// - New values appearing in future releases of the client library, **and**
10690 /// - New values received dynamically, without application changes.
10691 ///
10692 /// Please consult the [Working with enums] section in the user guide for some
10693 /// guidelines.
10694 ///
10695 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10696 #[derive(Clone, Debug, PartialEq)]
10697 #[non_exhaustive]
10698 pub enum State {
10699 /// The default value. This value should never be used.
10700 Unspecified,
10701 /// Node is operational and can be used by the user.
10702 Active,
10703 /// Node is being provisioned.
10704 Creating,
10705 /// Node is in a failed state.
10706 Failed,
10707 /// Node is undergoing maintenance, e.g.: during private cloud upgrade.
10708 Upgrading,
10709 /// If set, the enum was initialized with an unknown value.
10710 ///
10711 /// Applications can examine the value using [State::value] or
10712 /// [State::name].
10713 UnknownValue(state::UnknownValue),
10714 }
10715
10716 #[doc(hidden)]
10717 pub mod state {
10718 #[allow(unused_imports)]
10719 use super::*;
10720 #[derive(Clone, Debug, PartialEq)]
10721 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10722 }
10723
10724 impl State {
10725 /// Gets the enum value.
10726 ///
10727 /// Returns `None` if the enum contains an unknown value deserialized from
10728 /// the string representation of enums.
10729 pub fn value(&self) -> std::option::Option<i32> {
10730 match self {
10731 Self::Unspecified => std::option::Option::Some(0),
10732 Self::Active => std::option::Option::Some(1),
10733 Self::Creating => std::option::Option::Some(2),
10734 Self::Failed => std::option::Option::Some(3),
10735 Self::Upgrading => std::option::Option::Some(4),
10736 Self::UnknownValue(u) => u.0.value(),
10737 }
10738 }
10739
10740 /// Gets the enum value as a string.
10741 ///
10742 /// Returns `None` if the enum contains an unknown value deserialized from
10743 /// the integer representation of enums.
10744 pub fn name(&self) -> std::option::Option<&str> {
10745 match self {
10746 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10747 Self::Active => std::option::Option::Some("ACTIVE"),
10748 Self::Creating => std::option::Option::Some("CREATING"),
10749 Self::Failed => std::option::Option::Some("FAILED"),
10750 Self::Upgrading => std::option::Option::Some("UPGRADING"),
10751 Self::UnknownValue(u) => u.0.name(),
10752 }
10753 }
10754 }
10755
10756 impl std::default::Default for State {
10757 fn default() -> Self {
10758 use std::convert::From;
10759 Self::from(0)
10760 }
10761 }
10762
10763 impl std::fmt::Display for State {
10764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10765 wkt::internal::display_enum(f, self.name(), self.value())
10766 }
10767 }
10768
10769 impl std::convert::From<i32> for State {
10770 fn from(value: i32) -> Self {
10771 match value {
10772 0 => Self::Unspecified,
10773 1 => Self::Active,
10774 2 => Self::Creating,
10775 3 => Self::Failed,
10776 4 => Self::Upgrading,
10777 _ => Self::UnknownValue(state::UnknownValue(
10778 wkt::internal::UnknownEnumValue::Integer(value),
10779 )),
10780 }
10781 }
10782 }
10783
10784 impl std::convert::From<&str> for State {
10785 fn from(value: &str) -> Self {
10786 use std::string::ToString;
10787 match value {
10788 "STATE_UNSPECIFIED" => Self::Unspecified,
10789 "ACTIVE" => Self::Active,
10790 "CREATING" => Self::Creating,
10791 "FAILED" => Self::Failed,
10792 "UPGRADING" => Self::Upgrading,
10793 _ => Self::UnknownValue(state::UnknownValue(
10794 wkt::internal::UnknownEnumValue::String(value.to_string()),
10795 )),
10796 }
10797 }
10798 }
10799
10800 impl serde::ser::Serialize for State {
10801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10802 where
10803 S: serde::Serializer,
10804 {
10805 match self {
10806 Self::Unspecified => serializer.serialize_i32(0),
10807 Self::Active => serializer.serialize_i32(1),
10808 Self::Creating => serializer.serialize_i32(2),
10809 Self::Failed => serializer.serialize_i32(3),
10810 Self::Upgrading => serializer.serialize_i32(4),
10811 Self::UnknownValue(u) => u.0.serialize(serializer),
10812 }
10813 }
10814 }
10815
10816 impl<'de> serde::de::Deserialize<'de> for State {
10817 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10818 where
10819 D: serde::Deserializer<'de>,
10820 {
10821 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10822 ".google.cloud.vmwareengine.v1.Node.State",
10823 ))
10824 }
10825 }
10826}
10827
10828/// Represents an allocated external IP address and its corresponding internal IP
10829/// address in a private cloud.
10830#[derive(Clone, Default, PartialEq)]
10831#[non_exhaustive]
10832pub struct ExternalAddress {
10833 /// Output only. The resource name of this external IP address.
10834 /// Resource names are schemeless URIs that follow the conventions in
10835 /// <https://cloud.google.com/apis/design/resource_names>.
10836 /// For example:
10837 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`
10838 pub name: std::string::String,
10839
10840 /// Output only. Creation time of this resource.
10841 pub create_time: std::option::Option<wkt::Timestamp>,
10842
10843 /// Output only. Last update time of this resource.
10844 pub update_time: std::option::Option<wkt::Timestamp>,
10845
10846 /// The internal IP address of a workload VM.
10847 pub internal_ip: std::string::String,
10848
10849 /// Output only. The external IP address of a workload VM.
10850 pub external_ip: std::string::String,
10851
10852 /// Output only. The state of the resource.
10853 pub state: crate::model::external_address::State,
10854
10855 /// Output only. System-generated unique identifier for the resource.
10856 pub uid: std::string::String,
10857
10858 /// User-provided description for this resource.
10859 pub description: std::string::String,
10860
10861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10862}
10863
10864impl ExternalAddress {
10865 /// Creates a new default instance.
10866 pub fn new() -> Self {
10867 std::default::Default::default()
10868 }
10869
10870 /// Sets the value of [name][crate::model::ExternalAddress::name].
10871 ///
10872 /// # Example
10873 /// ```ignore,no_run
10874 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10875 /// # let project_id = "project_id";
10876 /// # let location_id = "location_id";
10877 /// # let private_cloud_id = "private_cloud_id";
10878 /// # let external_address_id = "external_address_id";
10879 /// let x = ExternalAddress::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/externalAddresses/{external_address_id}"));
10880 /// ```
10881 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10882 self.name = v.into();
10883 self
10884 }
10885
10886 /// Sets the value of [create_time][crate::model::ExternalAddress::create_time].
10887 ///
10888 /// # Example
10889 /// ```ignore,no_run
10890 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10891 /// use wkt::Timestamp;
10892 /// let x = ExternalAddress::new().set_create_time(Timestamp::default()/* use setters */);
10893 /// ```
10894 pub fn set_create_time<T>(mut self, v: T) -> Self
10895 where
10896 T: std::convert::Into<wkt::Timestamp>,
10897 {
10898 self.create_time = std::option::Option::Some(v.into());
10899 self
10900 }
10901
10902 /// Sets or clears the value of [create_time][crate::model::ExternalAddress::create_time].
10903 ///
10904 /// # Example
10905 /// ```ignore,no_run
10906 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10907 /// use wkt::Timestamp;
10908 /// let x = ExternalAddress::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10909 /// let x = ExternalAddress::new().set_or_clear_create_time(None::<Timestamp>);
10910 /// ```
10911 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10912 where
10913 T: std::convert::Into<wkt::Timestamp>,
10914 {
10915 self.create_time = v.map(|x| x.into());
10916 self
10917 }
10918
10919 /// Sets the value of [update_time][crate::model::ExternalAddress::update_time].
10920 ///
10921 /// # Example
10922 /// ```ignore,no_run
10923 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10924 /// use wkt::Timestamp;
10925 /// let x = ExternalAddress::new().set_update_time(Timestamp::default()/* use setters */);
10926 /// ```
10927 pub fn set_update_time<T>(mut self, v: T) -> Self
10928 where
10929 T: std::convert::Into<wkt::Timestamp>,
10930 {
10931 self.update_time = std::option::Option::Some(v.into());
10932 self
10933 }
10934
10935 /// Sets or clears the value of [update_time][crate::model::ExternalAddress::update_time].
10936 ///
10937 /// # Example
10938 /// ```ignore,no_run
10939 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10940 /// use wkt::Timestamp;
10941 /// let x = ExternalAddress::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10942 /// let x = ExternalAddress::new().set_or_clear_update_time(None::<Timestamp>);
10943 /// ```
10944 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10945 where
10946 T: std::convert::Into<wkt::Timestamp>,
10947 {
10948 self.update_time = v.map(|x| x.into());
10949 self
10950 }
10951
10952 /// Sets the value of [internal_ip][crate::model::ExternalAddress::internal_ip].
10953 ///
10954 /// # Example
10955 /// ```ignore,no_run
10956 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10957 /// let x = ExternalAddress::new().set_internal_ip("example");
10958 /// ```
10959 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10960 self.internal_ip = v.into();
10961 self
10962 }
10963
10964 /// Sets the value of [external_ip][crate::model::ExternalAddress::external_ip].
10965 ///
10966 /// # Example
10967 /// ```ignore,no_run
10968 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10969 /// let x = ExternalAddress::new().set_external_ip("example");
10970 /// ```
10971 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10972 self.external_ip = v.into();
10973 self
10974 }
10975
10976 /// Sets the value of [state][crate::model::ExternalAddress::state].
10977 ///
10978 /// # Example
10979 /// ```ignore,no_run
10980 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10981 /// use google_cloud_vmwareengine_v1::model::external_address::State;
10982 /// let x0 = ExternalAddress::new().set_state(State::Active);
10983 /// let x1 = ExternalAddress::new().set_state(State::Creating);
10984 /// let x2 = ExternalAddress::new().set_state(State::Updating);
10985 /// ```
10986 pub fn set_state<T: std::convert::Into<crate::model::external_address::State>>(
10987 mut self,
10988 v: T,
10989 ) -> Self {
10990 self.state = v.into();
10991 self
10992 }
10993
10994 /// Sets the value of [uid][crate::model::ExternalAddress::uid].
10995 ///
10996 /// # Example
10997 /// ```ignore,no_run
10998 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
10999 /// let x = ExternalAddress::new().set_uid("example");
11000 /// ```
11001 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11002 self.uid = v.into();
11003 self
11004 }
11005
11006 /// Sets the value of [description][crate::model::ExternalAddress::description].
11007 ///
11008 /// # Example
11009 /// ```ignore,no_run
11010 /// # use google_cloud_vmwareengine_v1::model::ExternalAddress;
11011 /// let x = ExternalAddress::new().set_description("example");
11012 /// ```
11013 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11014 self.description = v.into();
11015 self
11016 }
11017}
11018
11019impl wkt::message::Message for ExternalAddress {
11020 fn typename() -> &'static str {
11021 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAddress"
11022 }
11023}
11024
11025/// Defines additional types related to [ExternalAddress].
11026pub mod external_address {
11027 #[allow(unused_imports)]
11028 use super::*;
11029
11030 /// Enum State defines possible states of external addresses.
11031 ///
11032 /// # Working with unknown values
11033 ///
11034 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11035 /// additional enum variants at any time. Adding new variants is not considered
11036 /// a breaking change. Applications should write their code in anticipation of:
11037 ///
11038 /// - New values appearing in future releases of the client library, **and**
11039 /// - New values received dynamically, without application changes.
11040 ///
11041 /// Please consult the [Working with enums] section in the user guide for some
11042 /// guidelines.
11043 ///
11044 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11045 #[derive(Clone, Debug, PartialEq)]
11046 #[non_exhaustive]
11047 pub enum State {
11048 /// The default value. This value should never be used.
11049 Unspecified,
11050 /// The address is ready.
11051 Active,
11052 /// The address is being created.
11053 Creating,
11054 /// The address is being updated.
11055 Updating,
11056 /// The address is being deleted.
11057 Deleting,
11058 /// If set, the enum was initialized with an unknown value.
11059 ///
11060 /// Applications can examine the value using [State::value] or
11061 /// [State::name].
11062 UnknownValue(state::UnknownValue),
11063 }
11064
11065 #[doc(hidden)]
11066 pub mod state {
11067 #[allow(unused_imports)]
11068 use super::*;
11069 #[derive(Clone, Debug, PartialEq)]
11070 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11071 }
11072
11073 impl State {
11074 /// Gets the enum value.
11075 ///
11076 /// Returns `None` if the enum contains an unknown value deserialized from
11077 /// the string representation of enums.
11078 pub fn value(&self) -> std::option::Option<i32> {
11079 match self {
11080 Self::Unspecified => std::option::Option::Some(0),
11081 Self::Active => std::option::Option::Some(1),
11082 Self::Creating => std::option::Option::Some(2),
11083 Self::Updating => std::option::Option::Some(3),
11084 Self::Deleting => std::option::Option::Some(4),
11085 Self::UnknownValue(u) => u.0.value(),
11086 }
11087 }
11088
11089 /// Gets the enum value as a string.
11090 ///
11091 /// Returns `None` if the enum contains an unknown value deserialized from
11092 /// the integer representation of enums.
11093 pub fn name(&self) -> std::option::Option<&str> {
11094 match self {
11095 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11096 Self::Active => std::option::Option::Some("ACTIVE"),
11097 Self::Creating => std::option::Option::Some("CREATING"),
11098 Self::Updating => std::option::Option::Some("UPDATING"),
11099 Self::Deleting => std::option::Option::Some("DELETING"),
11100 Self::UnknownValue(u) => u.0.name(),
11101 }
11102 }
11103 }
11104
11105 impl std::default::Default for State {
11106 fn default() -> Self {
11107 use std::convert::From;
11108 Self::from(0)
11109 }
11110 }
11111
11112 impl std::fmt::Display for State {
11113 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11114 wkt::internal::display_enum(f, self.name(), self.value())
11115 }
11116 }
11117
11118 impl std::convert::From<i32> for State {
11119 fn from(value: i32) -> Self {
11120 match value {
11121 0 => Self::Unspecified,
11122 1 => Self::Active,
11123 2 => Self::Creating,
11124 3 => Self::Updating,
11125 4 => Self::Deleting,
11126 _ => Self::UnknownValue(state::UnknownValue(
11127 wkt::internal::UnknownEnumValue::Integer(value),
11128 )),
11129 }
11130 }
11131 }
11132
11133 impl std::convert::From<&str> for State {
11134 fn from(value: &str) -> Self {
11135 use std::string::ToString;
11136 match value {
11137 "STATE_UNSPECIFIED" => Self::Unspecified,
11138 "ACTIVE" => Self::Active,
11139 "CREATING" => Self::Creating,
11140 "UPDATING" => Self::Updating,
11141 "DELETING" => Self::Deleting,
11142 _ => Self::UnknownValue(state::UnknownValue(
11143 wkt::internal::UnknownEnumValue::String(value.to_string()),
11144 )),
11145 }
11146 }
11147 }
11148
11149 impl serde::ser::Serialize for State {
11150 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11151 where
11152 S: serde::Serializer,
11153 {
11154 match self {
11155 Self::Unspecified => serializer.serialize_i32(0),
11156 Self::Active => serializer.serialize_i32(1),
11157 Self::Creating => serializer.serialize_i32(2),
11158 Self::Updating => serializer.serialize_i32(3),
11159 Self::Deleting => serializer.serialize_i32(4),
11160 Self::UnknownValue(u) => u.0.serialize(serializer),
11161 }
11162 }
11163 }
11164
11165 impl<'de> serde::de::Deserialize<'de> for State {
11166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11167 where
11168 D: serde::Deserializer<'de>,
11169 {
11170 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11171 ".google.cloud.vmwareengine.v1.ExternalAddress.State",
11172 ))
11173 }
11174 }
11175}
11176
11177/// Subnet in a private cloud. Either `management` subnets (such as vMotion) that
11178/// are read-only, or `userDefined`, which can also be updated.
11179#[derive(Clone, Default, PartialEq)]
11180#[non_exhaustive]
11181pub struct Subnet {
11182 /// Output only. The resource name of this subnet.
11183 /// Resource names are schemeless URIs that follow the conventions in
11184 /// <https://cloud.google.com/apis/design/resource_names>.
11185 /// For example:
11186 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
11187 pub name: std::string::String,
11188
11189 /// The IP address range of the subnet in CIDR format '10.0.0.0/24'.
11190 pub ip_cidr_range: std::string::String,
11191
11192 /// The IP address of the gateway of this subnet.
11193 /// Must fall within the IP prefix defined above.
11194 pub gateway_ip: std::string::String,
11195
11196 /// Output only. The type of the subnet. For example "management" or
11197 /// "userDefined".
11198 pub r#type: std::string::String,
11199
11200 /// Output only. The state of the resource.
11201 pub state: crate::model::subnet::State,
11202
11203 /// Output only. VLAN ID of the VLAN on which the subnet is configured
11204 pub vlan_id: i32,
11205
11206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11207}
11208
11209impl Subnet {
11210 /// Creates a new default instance.
11211 pub fn new() -> Self {
11212 std::default::Default::default()
11213 }
11214
11215 /// Sets the value of [name][crate::model::Subnet::name].
11216 ///
11217 /// # Example
11218 /// ```ignore,no_run
11219 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11220 /// # let project_id = "project_id";
11221 /// # let location_id = "location_id";
11222 /// # let private_cloud_id = "private_cloud_id";
11223 /// # let subnet_id = "subnet_id";
11224 /// let x = Subnet::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/subnets/{subnet_id}"));
11225 /// ```
11226 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11227 self.name = v.into();
11228 self
11229 }
11230
11231 /// Sets the value of [ip_cidr_range][crate::model::Subnet::ip_cidr_range].
11232 ///
11233 /// # Example
11234 /// ```ignore,no_run
11235 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11236 /// let x = Subnet::new().set_ip_cidr_range("example");
11237 /// ```
11238 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11239 self.ip_cidr_range = v.into();
11240 self
11241 }
11242
11243 /// Sets the value of [gateway_ip][crate::model::Subnet::gateway_ip].
11244 ///
11245 /// # Example
11246 /// ```ignore,no_run
11247 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11248 /// let x = Subnet::new().set_gateway_ip("example");
11249 /// ```
11250 pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11251 self.gateway_ip = v.into();
11252 self
11253 }
11254
11255 /// Sets the value of [r#type][crate::model::Subnet::type].
11256 ///
11257 /// # Example
11258 /// ```ignore,no_run
11259 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11260 /// let x = Subnet::new().set_type("example");
11261 /// ```
11262 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11263 self.r#type = v.into();
11264 self
11265 }
11266
11267 /// Sets the value of [state][crate::model::Subnet::state].
11268 ///
11269 /// # Example
11270 /// ```ignore,no_run
11271 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11272 /// use google_cloud_vmwareengine_v1::model::subnet::State;
11273 /// let x0 = Subnet::new().set_state(State::Active);
11274 /// let x1 = Subnet::new().set_state(State::Creating);
11275 /// let x2 = Subnet::new().set_state(State::Updating);
11276 /// ```
11277 pub fn set_state<T: std::convert::Into<crate::model::subnet::State>>(mut self, v: T) -> Self {
11278 self.state = v.into();
11279 self
11280 }
11281
11282 /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
11283 ///
11284 /// # Example
11285 /// ```ignore,no_run
11286 /// # use google_cloud_vmwareengine_v1::model::Subnet;
11287 /// let x = Subnet::new().set_vlan_id(42);
11288 /// ```
11289 pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11290 self.vlan_id = v.into();
11291 self
11292 }
11293}
11294
11295impl wkt::message::Message for Subnet {
11296 fn typename() -> &'static str {
11297 "type.googleapis.com/google.cloud.vmwareengine.v1.Subnet"
11298 }
11299}
11300
11301/// Defines additional types related to [Subnet].
11302pub mod subnet {
11303 #[allow(unused_imports)]
11304 use super::*;
11305
11306 /// Defines possible states of subnets.
11307 ///
11308 /// # Working with unknown values
11309 ///
11310 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11311 /// additional enum variants at any time. Adding new variants is not considered
11312 /// a breaking change. Applications should write their code in anticipation of:
11313 ///
11314 /// - New values appearing in future releases of the client library, **and**
11315 /// - New values received dynamically, without application changes.
11316 ///
11317 /// Please consult the [Working with enums] section in the user guide for some
11318 /// guidelines.
11319 ///
11320 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11321 #[derive(Clone, Debug, PartialEq)]
11322 #[non_exhaustive]
11323 pub enum State {
11324 /// The default value. This value should never be used.
11325 Unspecified,
11326 /// The subnet is ready.
11327 Active,
11328 /// The subnet is being created.
11329 Creating,
11330 /// The subnet is being updated.
11331 Updating,
11332 /// The subnet is being deleted.
11333 Deleting,
11334 /// Changes requested in the last operation are being propagated.
11335 Reconciling,
11336 /// Last operation on the subnet did not succeed. Subnet's payload is
11337 /// reverted back to its most recent working state.
11338 Failed,
11339 /// If set, the enum was initialized with an unknown value.
11340 ///
11341 /// Applications can examine the value using [State::value] or
11342 /// [State::name].
11343 UnknownValue(state::UnknownValue),
11344 }
11345
11346 #[doc(hidden)]
11347 pub mod state {
11348 #[allow(unused_imports)]
11349 use super::*;
11350 #[derive(Clone, Debug, PartialEq)]
11351 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11352 }
11353
11354 impl State {
11355 /// Gets the enum value.
11356 ///
11357 /// Returns `None` if the enum contains an unknown value deserialized from
11358 /// the string representation of enums.
11359 pub fn value(&self) -> std::option::Option<i32> {
11360 match self {
11361 Self::Unspecified => std::option::Option::Some(0),
11362 Self::Active => std::option::Option::Some(1),
11363 Self::Creating => std::option::Option::Some(2),
11364 Self::Updating => std::option::Option::Some(3),
11365 Self::Deleting => std::option::Option::Some(4),
11366 Self::Reconciling => std::option::Option::Some(5),
11367 Self::Failed => std::option::Option::Some(6),
11368 Self::UnknownValue(u) => u.0.value(),
11369 }
11370 }
11371
11372 /// Gets the enum value as a string.
11373 ///
11374 /// Returns `None` if the enum contains an unknown value deserialized from
11375 /// the integer representation of enums.
11376 pub fn name(&self) -> std::option::Option<&str> {
11377 match self {
11378 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11379 Self::Active => std::option::Option::Some("ACTIVE"),
11380 Self::Creating => std::option::Option::Some("CREATING"),
11381 Self::Updating => std::option::Option::Some("UPDATING"),
11382 Self::Deleting => std::option::Option::Some("DELETING"),
11383 Self::Reconciling => std::option::Option::Some("RECONCILING"),
11384 Self::Failed => std::option::Option::Some("FAILED"),
11385 Self::UnknownValue(u) => u.0.name(),
11386 }
11387 }
11388 }
11389
11390 impl std::default::Default for State {
11391 fn default() -> Self {
11392 use std::convert::From;
11393 Self::from(0)
11394 }
11395 }
11396
11397 impl std::fmt::Display for State {
11398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11399 wkt::internal::display_enum(f, self.name(), self.value())
11400 }
11401 }
11402
11403 impl std::convert::From<i32> for State {
11404 fn from(value: i32) -> Self {
11405 match value {
11406 0 => Self::Unspecified,
11407 1 => Self::Active,
11408 2 => Self::Creating,
11409 3 => Self::Updating,
11410 4 => Self::Deleting,
11411 5 => Self::Reconciling,
11412 6 => Self::Failed,
11413 _ => Self::UnknownValue(state::UnknownValue(
11414 wkt::internal::UnknownEnumValue::Integer(value),
11415 )),
11416 }
11417 }
11418 }
11419
11420 impl std::convert::From<&str> for State {
11421 fn from(value: &str) -> Self {
11422 use std::string::ToString;
11423 match value {
11424 "STATE_UNSPECIFIED" => Self::Unspecified,
11425 "ACTIVE" => Self::Active,
11426 "CREATING" => Self::Creating,
11427 "UPDATING" => Self::Updating,
11428 "DELETING" => Self::Deleting,
11429 "RECONCILING" => Self::Reconciling,
11430 "FAILED" => Self::Failed,
11431 _ => Self::UnknownValue(state::UnknownValue(
11432 wkt::internal::UnknownEnumValue::String(value.to_string()),
11433 )),
11434 }
11435 }
11436 }
11437
11438 impl serde::ser::Serialize for State {
11439 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11440 where
11441 S: serde::Serializer,
11442 {
11443 match self {
11444 Self::Unspecified => serializer.serialize_i32(0),
11445 Self::Active => serializer.serialize_i32(1),
11446 Self::Creating => serializer.serialize_i32(2),
11447 Self::Updating => serializer.serialize_i32(3),
11448 Self::Deleting => serializer.serialize_i32(4),
11449 Self::Reconciling => serializer.serialize_i32(5),
11450 Self::Failed => serializer.serialize_i32(6),
11451 Self::UnknownValue(u) => u.0.serialize(serializer),
11452 }
11453 }
11454 }
11455
11456 impl<'de> serde::de::Deserialize<'de> for State {
11457 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11458 where
11459 D: serde::Deserializer<'de>,
11460 {
11461 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11462 ".google.cloud.vmwareengine.v1.Subnet.State",
11463 ))
11464 }
11465 }
11466}
11467
11468/// External access firewall rules for filtering incoming traffic destined to
11469/// `ExternalAddress` resources.
11470#[derive(Clone, Default, PartialEq)]
11471#[non_exhaustive]
11472pub struct ExternalAccessRule {
11473 /// Output only. The resource name of this external access rule.
11474 /// Resource names are schemeless URIs that follow the conventions in
11475 /// <https://cloud.google.com/apis/design/resource_names>.
11476 /// For example:
11477 /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
11478 pub name: std::string::String,
11479
11480 /// Output only. Creation time of this resource.
11481 pub create_time: std::option::Option<wkt::Timestamp>,
11482
11483 /// Output only. Last update time of this resource.
11484 pub update_time: std::option::Option<wkt::Timestamp>,
11485
11486 /// User-provided description for this external access rule.
11487 pub description: std::string::String,
11488
11489 /// External access rule priority, which determines the external access rule to
11490 /// use when multiple rules apply. If multiple rules have the same priority,
11491 /// their ordering is non-deterministic. If specific ordering is required,
11492 /// assign unique priorities to enforce such ordering. The external access rule
11493 /// priority is an integer from 100 to 4096, both inclusive. Lower integers
11494 /// indicate higher precedence. For example, a rule with priority `100` has
11495 /// higher precedence than a rule with priority `101`.
11496 pub priority: i32,
11497
11498 /// The action that the external access rule performs.
11499 pub action: crate::model::external_access_rule::Action,
11500
11501 /// The IP protocol to which the external access rule applies. This value can
11502 /// be one of the following three protocol strings (not case-sensitive):
11503 /// `tcp`, `udp`, or `icmp`.
11504 pub ip_protocol: std::string::String,
11505
11506 /// If source ranges are specified, the external access rule applies only to
11507 /// traffic that has a source IP address in these ranges. These ranges can
11508 /// either be expressed in the CIDR format or as an IP address. As only inbound
11509 /// rules are supported, `ExternalAddress` resources cannot be the source IP
11510 /// addresses of an external access rule. To match all source addresses,
11511 /// specify `0.0.0.0/0`.
11512 pub source_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11513
11514 /// A list of source ports to which the external access rule applies. This
11515 /// field is only applicable for the UDP or TCP protocol.
11516 /// Each entry must be either an integer or a range. For example: `["22"]`,
11517 /// `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
11518 /// `["0-65535"]`.
11519 pub source_ports: std::vec::Vec<std::string::String>,
11520
11521 /// If destination ranges are specified, the external access rule applies only
11522 /// to the traffic that has a destination IP address in these ranges. The
11523 /// specified IP addresses must have reserved external IP addresses in the
11524 /// scope of the parent network policy. To match all external IP addresses in
11525 /// the scope of the parent network policy, specify `0.0.0.0/0`. To match a
11526 /// specific external IP address, specify it using the
11527 /// `IpRange.external_address` property.
11528 pub destination_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
11529
11530 /// A list of destination ports to which the external access rule applies. This
11531 /// field is only applicable for the UDP or TCP protocol.
11532 /// Each entry must be either an integer or a range. For example: `["22"]`,
11533 /// `["80","443"]`, or `["12345-12349"]`. To match all destination ports,
11534 /// specify `["0-65535"]`.
11535 pub destination_ports: std::vec::Vec<std::string::String>,
11536
11537 /// Output only. The state of the resource.
11538 pub state: crate::model::external_access_rule::State,
11539
11540 /// Output only. System-generated unique identifier for the resource.
11541 pub uid: std::string::String,
11542
11543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11544}
11545
11546impl ExternalAccessRule {
11547 /// Creates a new default instance.
11548 pub fn new() -> Self {
11549 std::default::Default::default()
11550 }
11551
11552 /// Sets the value of [name][crate::model::ExternalAccessRule::name].
11553 ///
11554 /// # Example
11555 /// ```ignore,no_run
11556 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11557 /// # let project_id = "project_id";
11558 /// # let location_id = "location_id";
11559 /// # let network_policy_id = "network_policy_id";
11560 /// # let external_access_rule_id = "external_access_rule_id";
11561 /// let x = ExternalAccessRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}/externalAccessRules/{external_access_rule_id}"));
11562 /// ```
11563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11564 self.name = v.into();
11565 self
11566 }
11567
11568 /// Sets the value of [create_time][crate::model::ExternalAccessRule::create_time].
11569 ///
11570 /// # Example
11571 /// ```ignore,no_run
11572 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11573 /// use wkt::Timestamp;
11574 /// let x = ExternalAccessRule::new().set_create_time(Timestamp::default()/* use setters */);
11575 /// ```
11576 pub fn set_create_time<T>(mut self, v: T) -> Self
11577 where
11578 T: std::convert::Into<wkt::Timestamp>,
11579 {
11580 self.create_time = std::option::Option::Some(v.into());
11581 self
11582 }
11583
11584 /// Sets or clears the value of [create_time][crate::model::ExternalAccessRule::create_time].
11585 ///
11586 /// # Example
11587 /// ```ignore,no_run
11588 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11589 /// use wkt::Timestamp;
11590 /// let x = ExternalAccessRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11591 /// let x = ExternalAccessRule::new().set_or_clear_create_time(None::<Timestamp>);
11592 /// ```
11593 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11594 where
11595 T: std::convert::Into<wkt::Timestamp>,
11596 {
11597 self.create_time = v.map(|x| x.into());
11598 self
11599 }
11600
11601 /// Sets the value of [update_time][crate::model::ExternalAccessRule::update_time].
11602 ///
11603 /// # Example
11604 /// ```ignore,no_run
11605 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11606 /// use wkt::Timestamp;
11607 /// let x = ExternalAccessRule::new().set_update_time(Timestamp::default()/* use setters */);
11608 /// ```
11609 pub fn set_update_time<T>(mut self, v: T) -> Self
11610 where
11611 T: std::convert::Into<wkt::Timestamp>,
11612 {
11613 self.update_time = std::option::Option::Some(v.into());
11614 self
11615 }
11616
11617 /// Sets or clears the value of [update_time][crate::model::ExternalAccessRule::update_time].
11618 ///
11619 /// # Example
11620 /// ```ignore,no_run
11621 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11622 /// use wkt::Timestamp;
11623 /// let x = ExternalAccessRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11624 /// let x = ExternalAccessRule::new().set_or_clear_update_time(None::<Timestamp>);
11625 /// ```
11626 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11627 where
11628 T: std::convert::Into<wkt::Timestamp>,
11629 {
11630 self.update_time = v.map(|x| x.into());
11631 self
11632 }
11633
11634 /// Sets the value of [description][crate::model::ExternalAccessRule::description].
11635 ///
11636 /// # Example
11637 /// ```ignore,no_run
11638 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11639 /// let x = ExternalAccessRule::new().set_description("example");
11640 /// ```
11641 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11642 self.description = v.into();
11643 self
11644 }
11645
11646 /// Sets the value of [priority][crate::model::ExternalAccessRule::priority].
11647 ///
11648 /// # Example
11649 /// ```ignore,no_run
11650 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11651 /// let x = ExternalAccessRule::new().set_priority(42);
11652 /// ```
11653 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11654 self.priority = v.into();
11655 self
11656 }
11657
11658 /// Sets the value of [action][crate::model::ExternalAccessRule::action].
11659 ///
11660 /// # Example
11661 /// ```ignore,no_run
11662 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11663 /// use google_cloud_vmwareengine_v1::model::external_access_rule::Action;
11664 /// let x0 = ExternalAccessRule::new().set_action(Action::Allow);
11665 /// let x1 = ExternalAccessRule::new().set_action(Action::Deny);
11666 /// ```
11667 pub fn set_action<T: std::convert::Into<crate::model::external_access_rule::Action>>(
11668 mut self,
11669 v: T,
11670 ) -> Self {
11671 self.action = v.into();
11672 self
11673 }
11674
11675 /// Sets the value of [ip_protocol][crate::model::ExternalAccessRule::ip_protocol].
11676 ///
11677 /// # Example
11678 /// ```ignore,no_run
11679 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11680 /// let x = ExternalAccessRule::new().set_ip_protocol("example");
11681 /// ```
11682 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11683 self.ip_protocol = v.into();
11684 self
11685 }
11686
11687 /// Sets the value of [source_ip_ranges][crate::model::ExternalAccessRule::source_ip_ranges].
11688 ///
11689 /// # Example
11690 /// ```ignore,no_run
11691 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11692 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11693 /// let x = ExternalAccessRule::new()
11694 /// .set_source_ip_ranges([
11695 /// IpRange::default()/* use setters */,
11696 /// IpRange::default()/* use (different) setters */,
11697 /// ]);
11698 /// ```
11699 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
11700 where
11701 T: std::iter::IntoIterator<Item = V>,
11702 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11703 {
11704 use std::iter::Iterator;
11705 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11706 self
11707 }
11708
11709 /// Sets the value of [source_ports][crate::model::ExternalAccessRule::source_ports].
11710 ///
11711 /// # Example
11712 /// ```ignore,no_run
11713 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11714 /// let x = ExternalAccessRule::new().set_source_ports(["a", "b", "c"]);
11715 /// ```
11716 pub fn set_source_ports<T, V>(mut self, v: T) -> Self
11717 where
11718 T: std::iter::IntoIterator<Item = V>,
11719 V: std::convert::Into<std::string::String>,
11720 {
11721 use std::iter::Iterator;
11722 self.source_ports = v.into_iter().map(|i| i.into()).collect();
11723 self
11724 }
11725
11726 /// Sets the value of [destination_ip_ranges][crate::model::ExternalAccessRule::destination_ip_ranges].
11727 ///
11728 /// # Example
11729 /// ```ignore,no_run
11730 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11731 /// use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11732 /// let x = ExternalAccessRule::new()
11733 /// .set_destination_ip_ranges([
11734 /// IpRange::default()/* use setters */,
11735 /// IpRange::default()/* use (different) setters */,
11736 /// ]);
11737 /// ```
11738 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
11739 where
11740 T: std::iter::IntoIterator<Item = V>,
11741 V: std::convert::Into<crate::model::external_access_rule::IpRange>,
11742 {
11743 use std::iter::Iterator;
11744 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
11745 self
11746 }
11747
11748 /// Sets the value of [destination_ports][crate::model::ExternalAccessRule::destination_ports].
11749 ///
11750 /// # Example
11751 /// ```ignore,no_run
11752 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11753 /// let x = ExternalAccessRule::new().set_destination_ports(["a", "b", "c"]);
11754 /// ```
11755 pub fn set_destination_ports<T, V>(mut self, v: T) -> Self
11756 where
11757 T: std::iter::IntoIterator<Item = V>,
11758 V: std::convert::Into<std::string::String>,
11759 {
11760 use std::iter::Iterator;
11761 self.destination_ports = v.into_iter().map(|i| i.into()).collect();
11762 self
11763 }
11764
11765 /// Sets the value of [state][crate::model::ExternalAccessRule::state].
11766 ///
11767 /// # Example
11768 /// ```ignore,no_run
11769 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11770 /// use google_cloud_vmwareengine_v1::model::external_access_rule::State;
11771 /// let x0 = ExternalAccessRule::new().set_state(State::Active);
11772 /// let x1 = ExternalAccessRule::new().set_state(State::Creating);
11773 /// let x2 = ExternalAccessRule::new().set_state(State::Updating);
11774 /// ```
11775 pub fn set_state<T: std::convert::Into<crate::model::external_access_rule::State>>(
11776 mut self,
11777 v: T,
11778 ) -> Self {
11779 self.state = v.into();
11780 self
11781 }
11782
11783 /// Sets the value of [uid][crate::model::ExternalAccessRule::uid].
11784 ///
11785 /// # Example
11786 /// ```ignore,no_run
11787 /// # use google_cloud_vmwareengine_v1::model::ExternalAccessRule;
11788 /// let x = ExternalAccessRule::new().set_uid("example");
11789 /// ```
11790 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11791 self.uid = v.into();
11792 self
11793 }
11794}
11795
11796impl wkt::message::Message for ExternalAccessRule {
11797 fn typename() -> &'static str {
11798 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule"
11799 }
11800}
11801
11802/// Defines additional types related to [ExternalAccessRule].
11803pub mod external_access_rule {
11804 #[allow(unused_imports)]
11805 use super::*;
11806
11807 /// An IP range provided in any one of the supported formats.
11808 #[derive(Clone, Default, PartialEq)]
11809 #[non_exhaustive]
11810 pub struct IpRange {
11811 #[allow(missing_docs)]
11812 pub ip_range: std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11813
11814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11815 }
11816
11817 impl IpRange {
11818 /// Creates a new default instance.
11819 pub fn new() -> Self {
11820 std::default::Default::default()
11821 }
11822
11823 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range].
11824 ///
11825 /// Note that all the setters affecting `ip_range` are mutually
11826 /// exclusive.
11827 ///
11828 /// # Example
11829 /// ```ignore,no_run
11830 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11831 /// use google_cloud_vmwareengine_v1::model::external_access_rule::ip_range::IpRange as IpRangeOneOf;
11832 /// let x = IpRange::new().set_ip_range(Some(IpRangeOneOf::IpAddress("example".to_string())));
11833 /// ```
11834 pub fn set_ip_range<
11835 T: std::convert::Into<
11836 std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
11837 >,
11838 >(
11839 mut self,
11840 v: T,
11841 ) -> Self {
11842 self.ip_range = v.into();
11843 self
11844 }
11845
11846 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11847 /// if it holds a `IpAddress`, `None` if the field is not set or
11848 /// holds a different branch.
11849 pub fn ip_address(&self) -> std::option::Option<&std::string::String> {
11850 #[allow(unreachable_patterns)]
11851 self.ip_range.as_ref().and_then(|v| match v {
11852 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v) => {
11853 std::option::Option::Some(v)
11854 }
11855 _ => std::option::Option::None,
11856 })
11857 }
11858
11859 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11860 /// to hold a `IpAddress`.
11861 ///
11862 /// Note that all the setters affecting `ip_range` are
11863 /// mutually exclusive.
11864 ///
11865 /// # Example
11866 /// ```ignore,no_run
11867 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11868 /// let x = IpRange::new().set_ip_address("example");
11869 /// assert!(x.ip_address().is_some());
11870 /// assert!(x.ip_address_range().is_none());
11871 /// assert!(x.external_address().is_none());
11872 /// ```
11873 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11874 self.ip_range = std::option::Option::Some(
11875 crate::model::external_access_rule::ip_range::IpRange::IpAddress(v.into()),
11876 );
11877 self
11878 }
11879
11880 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11881 /// if it holds a `IpAddressRange`, `None` if the field is not set or
11882 /// holds a different branch.
11883 pub fn ip_address_range(&self) -> std::option::Option<&std::string::String> {
11884 #[allow(unreachable_patterns)]
11885 self.ip_range.as_ref().and_then(|v| match v {
11886 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v) => {
11887 std::option::Option::Some(v)
11888 }
11889 _ => std::option::Option::None,
11890 })
11891 }
11892
11893 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11894 /// to hold a `IpAddressRange`.
11895 ///
11896 /// Note that all the setters affecting `ip_range` are
11897 /// mutually exclusive.
11898 ///
11899 /// # Example
11900 /// ```ignore,no_run
11901 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11902 /// let x = IpRange::new().set_ip_address_range("example");
11903 /// assert!(x.ip_address_range().is_some());
11904 /// assert!(x.ip_address().is_none());
11905 /// assert!(x.external_address().is_none());
11906 /// ```
11907 pub fn set_ip_address_range<T: std::convert::Into<std::string::String>>(
11908 mut self,
11909 v: T,
11910 ) -> Self {
11911 self.ip_range = std::option::Option::Some(
11912 crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v.into()),
11913 );
11914 self
11915 }
11916
11917 /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11918 /// if it holds a `ExternalAddress`, `None` if the field is not set or
11919 /// holds a different branch.
11920 pub fn external_address(&self) -> std::option::Option<&std::string::String> {
11921 #[allow(unreachable_patterns)]
11922 self.ip_range.as_ref().and_then(|v| match v {
11923 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v) => {
11924 std::option::Option::Some(v)
11925 }
11926 _ => std::option::Option::None,
11927 })
11928 }
11929
11930 /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
11931 /// to hold a `ExternalAddress`.
11932 ///
11933 /// Note that all the setters affecting `ip_range` are
11934 /// mutually exclusive.
11935 ///
11936 /// # Example
11937 /// ```ignore,no_run
11938 /// # use google_cloud_vmwareengine_v1::model::external_access_rule::IpRange;
11939 /// # let project_id = "project_id";
11940 /// # let location_id = "location_id";
11941 /// # let private_cloud_id = "private_cloud_id";
11942 /// # let external_address_id = "external_address_id";
11943 /// let x = IpRange::new().set_external_address(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/externalAddresses/{external_address_id}"));
11944 /// assert!(x.external_address().is_some());
11945 /// assert!(x.ip_address().is_none());
11946 /// assert!(x.ip_address_range().is_none());
11947 /// ```
11948 pub fn set_external_address<T: std::convert::Into<std::string::String>>(
11949 mut self,
11950 v: T,
11951 ) -> Self {
11952 self.ip_range = std::option::Option::Some(
11953 crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v.into()),
11954 );
11955 self
11956 }
11957 }
11958
11959 impl wkt::message::Message for IpRange {
11960 fn typename() -> &'static str {
11961 "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange"
11962 }
11963 }
11964
11965 /// Defines additional types related to [IpRange].
11966 pub mod ip_range {
11967 #[allow(unused_imports)]
11968 use super::*;
11969
11970 #[allow(missing_docs)]
11971 #[derive(Clone, Debug, PartialEq)]
11972 #[non_exhaustive]
11973 pub enum IpRange {
11974 /// A single IP address. For example: `10.0.0.5`.
11975 IpAddress(std::string::String),
11976 /// An IP address range in the CIDR format. For example: `10.0.0.0/24`.
11977 IpAddressRange(std::string::String),
11978 /// The name of an `ExternalAddress` resource. The external address must
11979 /// have been reserved in the scope of this external access rule's parent
11980 /// network policy. Provide the external address name in the form of
11981 /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`.
11982 /// For example:
11983 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
11984 ExternalAddress(std::string::String),
11985 }
11986 }
11987
11988 /// Action determines whether the external access rule permits or blocks
11989 /// traffic, subject to the other components of the rule matching the traffic.
11990 ///
11991 /// # Working with unknown values
11992 ///
11993 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11994 /// additional enum variants at any time. Adding new variants is not considered
11995 /// a breaking change. Applications should write their code in anticipation of:
11996 ///
11997 /// - New values appearing in future releases of the client library, **and**
11998 /// - New values received dynamically, without application changes.
11999 ///
12000 /// Please consult the [Working with enums] section in the user guide for some
12001 /// guidelines.
12002 ///
12003 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12004 #[derive(Clone, Debug, PartialEq)]
12005 #[non_exhaustive]
12006 pub enum Action {
12007 /// Defaults to allow.
12008 Unspecified,
12009 /// Allows connections that match the other specified components.
12010 Allow,
12011 /// Blocks connections that match the other specified components.
12012 Deny,
12013 /// If set, the enum was initialized with an unknown value.
12014 ///
12015 /// Applications can examine the value using [Action::value] or
12016 /// [Action::name].
12017 UnknownValue(action::UnknownValue),
12018 }
12019
12020 #[doc(hidden)]
12021 pub mod action {
12022 #[allow(unused_imports)]
12023 use super::*;
12024 #[derive(Clone, Debug, PartialEq)]
12025 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12026 }
12027
12028 impl Action {
12029 /// Gets the enum value.
12030 ///
12031 /// Returns `None` if the enum contains an unknown value deserialized from
12032 /// the string representation of enums.
12033 pub fn value(&self) -> std::option::Option<i32> {
12034 match self {
12035 Self::Unspecified => std::option::Option::Some(0),
12036 Self::Allow => std::option::Option::Some(1),
12037 Self::Deny => std::option::Option::Some(2),
12038 Self::UnknownValue(u) => u.0.value(),
12039 }
12040 }
12041
12042 /// Gets the enum value as a string.
12043 ///
12044 /// Returns `None` if the enum contains an unknown value deserialized from
12045 /// the integer representation of enums.
12046 pub fn name(&self) -> std::option::Option<&str> {
12047 match self {
12048 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
12049 Self::Allow => std::option::Option::Some("ALLOW"),
12050 Self::Deny => std::option::Option::Some("DENY"),
12051 Self::UnknownValue(u) => u.0.name(),
12052 }
12053 }
12054 }
12055
12056 impl std::default::Default for Action {
12057 fn default() -> Self {
12058 use std::convert::From;
12059 Self::from(0)
12060 }
12061 }
12062
12063 impl std::fmt::Display for Action {
12064 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12065 wkt::internal::display_enum(f, self.name(), self.value())
12066 }
12067 }
12068
12069 impl std::convert::From<i32> for Action {
12070 fn from(value: i32) -> Self {
12071 match value {
12072 0 => Self::Unspecified,
12073 1 => Self::Allow,
12074 2 => Self::Deny,
12075 _ => Self::UnknownValue(action::UnknownValue(
12076 wkt::internal::UnknownEnumValue::Integer(value),
12077 )),
12078 }
12079 }
12080 }
12081
12082 impl std::convert::From<&str> for Action {
12083 fn from(value: &str) -> Self {
12084 use std::string::ToString;
12085 match value {
12086 "ACTION_UNSPECIFIED" => Self::Unspecified,
12087 "ALLOW" => Self::Allow,
12088 "DENY" => Self::Deny,
12089 _ => Self::UnknownValue(action::UnknownValue(
12090 wkt::internal::UnknownEnumValue::String(value.to_string()),
12091 )),
12092 }
12093 }
12094 }
12095
12096 impl serde::ser::Serialize for Action {
12097 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12098 where
12099 S: serde::Serializer,
12100 {
12101 match self {
12102 Self::Unspecified => serializer.serialize_i32(0),
12103 Self::Allow => serializer.serialize_i32(1),
12104 Self::Deny => serializer.serialize_i32(2),
12105 Self::UnknownValue(u) => u.0.serialize(serializer),
12106 }
12107 }
12108 }
12109
12110 impl<'de> serde::de::Deserialize<'de> for Action {
12111 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12112 where
12113 D: serde::Deserializer<'de>,
12114 {
12115 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
12116 ".google.cloud.vmwareengine.v1.ExternalAccessRule.Action",
12117 ))
12118 }
12119 }
12120
12121 /// Defines possible states of external access firewall rules.
12122 ///
12123 /// # Working with unknown values
12124 ///
12125 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12126 /// additional enum variants at any time. Adding new variants is not considered
12127 /// a breaking change. Applications should write their code in anticipation of:
12128 ///
12129 /// - New values appearing in future releases of the client library, **and**
12130 /// - New values received dynamically, without application changes.
12131 ///
12132 /// Please consult the [Working with enums] section in the user guide for some
12133 /// guidelines.
12134 ///
12135 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12136 #[derive(Clone, Debug, PartialEq)]
12137 #[non_exhaustive]
12138 pub enum State {
12139 /// The default value. This value is used if the state is omitted.
12140 Unspecified,
12141 /// The rule is ready.
12142 Active,
12143 /// The rule is being created.
12144 Creating,
12145 /// The rule is being updated.
12146 Updating,
12147 /// The rule is being deleted.
12148 Deleting,
12149 /// If set, the enum was initialized with an unknown value.
12150 ///
12151 /// Applications can examine the value using [State::value] or
12152 /// [State::name].
12153 UnknownValue(state::UnknownValue),
12154 }
12155
12156 #[doc(hidden)]
12157 pub mod state {
12158 #[allow(unused_imports)]
12159 use super::*;
12160 #[derive(Clone, Debug, PartialEq)]
12161 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12162 }
12163
12164 impl State {
12165 /// Gets the enum value.
12166 ///
12167 /// Returns `None` if the enum contains an unknown value deserialized from
12168 /// the string representation of enums.
12169 pub fn value(&self) -> std::option::Option<i32> {
12170 match self {
12171 Self::Unspecified => std::option::Option::Some(0),
12172 Self::Active => std::option::Option::Some(1),
12173 Self::Creating => std::option::Option::Some(2),
12174 Self::Updating => std::option::Option::Some(3),
12175 Self::Deleting => std::option::Option::Some(4),
12176 Self::UnknownValue(u) => u.0.value(),
12177 }
12178 }
12179
12180 /// Gets the enum value as a string.
12181 ///
12182 /// Returns `None` if the enum contains an unknown value deserialized from
12183 /// the integer representation of enums.
12184 pub fn name(&self) -> std::option::Option<&str> {
12185 match self {
12186 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12187 Self::Active => std::option::Option::Some("ACTIVE"),
12188 Self::Creating => std::option::Option::Some("CREATING"),
12189 Self::Updating => std::option::Option::Some("UPDATING"),
12190 Self::Deleting => std::option::Option::Some("DELETING"),
12191 Self::UnknownValue(u) => u.0.name(),
12192 }
12193 }
12194 }
12195
12196 impl std::default::Default for State {
12197 fn default() -> Self {
12198 use std::convert::From;
12199 Self::from(0)
12200 }
12201 }
12202
12203 impl std::fmt::Display for State {
12204 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12205 wkt::internal::display_enum(f, self.name(), self.value())
12206 }
12207 }
12208
12209 impl std::convert::From<i32> for State {
12210 fn from(value: i32) -> Self {
12211 match value {
12212 0 => Self::Unspecified,
12213 1 => Self::Active,
12214 2 => Self::Creating,
12215 3 => Self::Updating,
12216 4 => Self::Deleting,
12217 _ => Self::UnknownValue(state::UnknownValue(
12218 wkt::internal::UnknownEnumValue::Integer(value),
12219 )),
12220 }
12221 }
12222 }
12223
12224 impl std::convert::From<&str> for State {
12225 fn from(value: &str) -> Self {
12226 use std::string::ToString;
12227 match value {
12228 "STATE_UNSPECIFIED" => Self::Unspecified,
12229 "ACTIVE" => Self::Active,
12230 "CREATING" => Self::Creating,
12231 "UPDATING" => Self::Updating,
12232 "DELETING" => Self::Deleting,
12233 _ => Self::UnknownValue(state::UnknownValue(
12234 wkt::internal::UnknownEnumValue::String(value.to_string()),
12235 )),
12236 }
12237 }
12238 }
12239
12240 impl serde::ser::Serialize for State {
12241 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12242 where
12243 S: serde::Serializer,
12244 {
12245 match self {
12246 Self::Unspecified => serializer.serialize_i32(0),
12247 Self::Active => serializer.serialize_i32(1),
12248 Self::Creating => serializer.serialize_i32(2),
12249 Self::Updating => serializer.serialize_i32(3),
12250 Self::Deleting => serializer.serialize_i32(4),
12251 Self::UnknownValue(u) => u.0.serialize(serializer),
12252 }
12253 }
12254 }
12255
12256 impl<'de> serde::de::Deserialize<'de> for State {
12257 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12258 where
12259 D: serde::Deserializer<'de>,
12260 {
12261 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12262 ".google.cloud.vmwareengine.v1.ExternalAccessRule.State",
12263 ))
12264 }
12265 }
12266}
12267
12268/// Logging server to receive vCenter or ESXi logs.
12269#[derive(Clone, Default, PartialEq)]
12270#[non_exhaustive]
12271pub struct LoggingServer {
12272 /// Output only. The resource name of this logging server.
12273 /// Resource names are schemeless URIs that follow the conventions in
12274 /// <https://cloud.google.com/apis/design/resource_names>.
12275 /// For example:
12276 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
12277 pub name: std::string::String,
12278
12279 /// Output only. Creation time of this resource.
12280 pub create_time: std::option::Option<wkt::Timestamp>,
12281
12282 /// Output only. Last update time of this resource.
12283 pub update_time: std::option::Option<wkt::Timestamp>,
12284
12285 /// Required. Fully-qualified domain name (FQDN) or IP Address of the logging
12286 /// server.
12287 pub hostname: std::string::String,
12288
12289 /// Required. Port number at which the logging server receives logs.
12290 pub port: i32,
12291
12292 /// Required. Protocol used by vCenter to send logs to a logging server.
12293 pub protocol: crate::model::logging_server::Protocol,
12294
12295 /// Required. The type of component that produces logs that will be forwarded
12296 /// to this logging server.
12297 pub source_type: crate::model::logging_server::SourceType,
12298
12299 /// Output only. System-generated unique identifier for the resource.
12300 pub uid: std::string::String,
12301
12302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12303}
12304
12305impl LoggingServer {
12306 /// Creates a new default instance.
12307 pub fn new() -> Self {
12308 std::default::Default::default()
12309 }
12310
12311 /// Sets the value of [name][crate::model::LoggingServer::name].
12312 ///
12313 /// # Example
12314 /// ```ignore,no_run
12315 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12316 /// # let project_id = "project_id";
12317 /// # let location_id = "location_id";
12318 /// # let private_cloud_id = "private_cloud_id";
12319 /// # let logging_server_id = "logging_server_id";
12320 /// let x = LoggingServer::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/loggingServers/{logging_server_id}"));
12321 /// ```
12322 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12323 self.name = v.into();
12324 self
12325 }
12326
12327 /// Sets the value of [create_time][crate::model::LoggingServer::create_time].
12328 ///
12329 /// # Example
12330 /// ```ignore,no_run
12331 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12332 /// use wkt::Timestamp;
12333 /// let x = LoggingServer::new().set_create_time(Timestamp::default()/* use setters */);
12334 /// ```
12335 pub fn set_create_time<T>(mut self, v: T) -> Self
12336 where
12337 T: std::convert::Into<wkt::Timestamp>,
12338 {
12339 self.create_time = std::option::Option::Some(v.into());
12340 self
12341 }
12342
12343 /// Sets or clears the value of [create_time][crate::model::LoggingServer::create_time].
12344 ///
12345 /// # Example
12346 /// ```ignore,no_run
12347 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12348 /// use wkt::Timestamp;
12349 /// let x = LoggingServer::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12350 /// let x = LoggingServer::new().set_or_clear_create_time(None::<Timestamp>);
12351 /// ```
12352 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12353 where
12354 T: std::convert::Into<wkt::Timestamp>,
12355 {
12356 self.create_time = v.map(|x| x.into());
12357 self
12358 }
12359
12360 /// Sets the value of [update_time][crate::model::LoggingServer::update_time].
12361 ///
12362 /// # Example
12363 /// ```ignore,no_run
12364 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12365 /// use wkt::Timestamp;
12366 /// let x = LoggingServer::new().set_update_time(Timestamp::default()/* use setters */);
12367 /// ```
12368 pub fn set_update_time<T>(mut self, v: T) -> Self
12369 where
12370 T: std::convert::Into<wkt::Timestamp>,
12371 {
12372 self.update_time = std::option::Option::Some(v.into());
12373 self
12374 }
12375
12376 /// Sets or clears the value of [update_time][crate::model::LoggingServer::update_time].
12377 ///
12378 /// # Example
12379 /// ```ignore,no_run
12380 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12381 /// use wkt::Timestamp;
12382 /// let x = LoggingServer::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12383 /// let x = LoggingServer::new().set_or_clear_update_time(None::<Timestamp>);
12384 /// ```
12385 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12386 where
12387 T: std::convert::Into<wkt::Timestamp>,
12388 {
12389 self.update_time = v.map(|x| x.into());
12390 self
12391 }
12392
12393 /// Sets the value of [hostname][crate::model::LoggingServer::hostname].
12394 ///
12395 /// # Example
12396 /// ```ignore,no_run
12397 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12398 /// let x = LoggingServer::new().set_hostname("example");
12399 /// ```
12400 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12401 self.hostname = v.into();
12402 self
12403 }
12404
12405 /// Sets the value of [port][crate::model::LoggingServer::port].
12406 ///
12407 /// # Example
12408 /// ```ignore,no_run
12409 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12410 /// let x = LoggingServer::new().set_port(42);
12411 /// ```
12412 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12413 self.port = v.into();
12414 self
12415 }
12416
12417 /// Sets the value of [protocol][crate::model::LoggingServer::protocol].
12418 ///
12419 /// # Example
12420 /// ```ignore,no_run
12421 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12422 /// use google_cloud_vmwareengine_v1::model::logging_server::Protocol;
12423 /// let x0 = LoggingServer::new().set_protocol(Protocol::Udp);
12424 /// let x1 = LoggingServer::new().set_protocol(Protocol::Tcp);
12425 /// let x2 = LoggingServer::new().set_protocol(Protocol::Tls);
12426 /// ```
12427 pub fn set_protocol<T: std::convert::Into<crate::model::logging_server::Protocol>>(
12428 mut self,
12429 v: T,
12430 ) -> Self {
12431 self.protocol = v.into();
12432 self
12433 }
12434
12435 /// Sets the value of [source_type][crate::model::LoggingServer::source_type].
12436 ///
12437 /// # Example
12438 /// ```ignore,no_run
12439 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12440 /// use google_cloud_vmwareengine_v1::model::logging_server::SourceType;
12441 /// let x0 = LoggingServer::new().set_source_type(SourceType::Esxi);
12442 /// let x1 = LoggingServer::new().set_source_type(SourceType::Vcsa);
12443 /// ```
12444 pub fn set_source_type<T: std::convert::Into<crate::model::logging_server::SourceType>>(
12445 mut self,
12446 v: T,
12447 ) -> Self {
12448 self.source_type = v.into();
12449 self
12450 }
12451
12452 /// Sets the value of [uid][crate::model::LoggingServer::uid].
12453 ///
12454 /// # Example
12455 /// ```ignore,no_run
12456 /// # use google_cloud_vmwareengine_v1::model::LoggingServer;
12457 /// let x = LoggingServer::new().set_uid("example");
12458 /// ```
12459 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12460 self.uid = v.into();
12461 self
12462 }
12463}
12464
12465impl wkt::message::Message for LoggingServer {
12466 fn typename() -> &'static str {
12467 "type.googleapis.com/google.cloud.vmwareengine.v1.LoggingServer"
12468 }
12469}
12470
12471/// Defines additional types related to [LoggingServer].
12472pub mod logging_server {
12473 #[allow(unused_imports)]
12474 use super::*;
12475
12476 /// Defines possible protocols used to send logs to
12477 /// a logging server.
12478 ///
12479 /// # Working with unknown values
12480 ///
12481 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12482 /// additional enum variants at any time. Adding new variants is not considered
12483 /// a breaking change. Applications should write their code in anticipation of:
12484 ///
12485 /// - New values appearing in future releases of the client library, **and**
12486 /// - New values received dynamically, without application changes.
12487 ///
12488 /// Please consult the [Working with enums] section in the user guide for some
12489 /// guidelines.
12490 ///
12491 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12492 #[derive(Clone, Debug, PartialEq)]
12493 #[non_exhaustive]
12494 pub enum Protocol {
12495 /// Unspecified communications protocol. This is the default value.
12496 Unspecified,
12497 /// UDP
12498 Udp,
12499 /// TCP
12500 Tcp,
12501 /// TLS
12502 Tls,
12503 /// SSL
12504 Ssl,
12505 /// RELP
12506 Relp,
12507 /// If set, the enum was initialized with an unknown value.
12508 ///
12509 /// Applications can examine the value using [Protocol::value] or
12510 /// [Protocol::name].
12511 UnknownValue(protocol::UnknownValue),
12512 }
12513
12514 #[doc(hidden)]
12515 pub mod protocol {
12516 #[allow(unused_imports)]
12517 use super::*;
12518 #[derive(Clone, Debug, PartialEq)]
12519 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12520 }
12521
12522 impl Protocol {
12523 /// Gets the enum value.
12524 ///
12525 /// Returns `None` if the enum contains an unknown value deserialized from
12526 /// the string representation of enums.
12527 pub fn value(&self) -> std::option::Option<i32> {
12528 match self {
12529 Self::Unspecified => std::option::Option::Some(0),
12530 Self::Udp => std::option::Option::Some(1),
12531 Self::Tcp => std::option::Option::Some(2),
12532 Self::Tls => std::option::Option::Some(3),
12533 Self::Ssl => std::option::Option::Some(4),
12534 Self::Relp => std::option::Option::Some(5),
12535 Self::UnknownValue(u) => u.0.value(),
12536 }
12537 }
12538
12539 /// Gets the enum value as a string.
12540 ///
12541 /// Returns `None` if the enum contains an unknown value deserialized from
12542 /// the integer representation of enums.
12543 pub fn name(&self) -> std::option::Option<&str> {
12544 match self {
12545 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
12546 Self::Udp => std::option::Option::Some("UDP"),
12547 Self::Tcp => std::option::Option::Some("TCP"),
12548 Self::Tls => std::option::Option::Some("TLS"),
12549 Self::Ssl => std::option::Option::Some("SSL"),
12550 Self::Relp => std::option::Option::Some("RELP"),
12551 Self::UnknownValue(u) => u.0.name(),
12552 }
12553 }
12554 }
12555
12556 impl std::default::Default for Protocol {
12557 fn default() -> Self {
12558 use std::convert::From;
12559 Self::from(0)
12560 }
12561 }
12562
12563 impl std::fmt::Display for Protocol {
12564 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12565 wkt::internal::display_enum(f, self.name(), self.value())
12566 }
12567 }
12568
12569 impl std::convert::From<i32> for Protocol {
12570 fn from(value: i32) -> Self {
12571 match value {
12572 0 => Self::Unspecified,
12573 1 => Self::Udp,
12574 2 => Self::Tcp,
12575 3 => Self::Tls,
12576 4 => Self::Ssl,
12577 5 => Self::Relp,
12578 _ => Self::UnknownValue(protocol::UnknownValue(
12579 wkt::internal::UnknownEnumValue::Integer(value),
12580 )),
12581 }
12582 }
12583 }
12584
12585 impl std::convert::From<&str> for Protocol {
12586 fn from(value: &str) -> Self {
12587 use std::string::ToString;
12588 match value {
12589 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
12590 "UDP" => Self::Udp,
12591 "TCP" => Self::Tcp,
12592 "TLS" => Self::Tls,
12593 "SSL" => Self::Ssl,
12594 "RELP" => Self::Relp,
12595 _ => Self::UnknownValue(protocol::UnknownValue(
12596 wkt::internal::UnknownEnumValue::String(value.to_string()),
12597 )),
12598 }
12599 }
12600 }
12601
12602 impl serde::ser::Serialize for Protocol {
12603 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12604 where
12605 S: serde::Serializer,
12606 {
12607 match self {
12608 Self::Unspecified => serializer.serialize_i32(0),
12609 Self::Udp => serializer.serialize_i32(1),
12610 Self::Tcp => serializer.serialize_i32(2),
12611 Self::Tls => serializer.serialize_i32(3),
12612 Self::Ssl => serializer.serialize_i32(4),
12613 Self::Relp => serializer.serialize_i32(5),
12614 Self::UnknownValue(u) => u.0.serialize(serializer),
12615 }
12616 }
12617 }
12618
12619 impl<'de> serde::de::Deserialize<'de> for Protocol {
12620 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12621 where
12622 D: serde::Deserializer<'de>,
12623 {
12624 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
12625 ".google.cloud.vmwareengine.v1.LoggingServer.Protocol",
12626 ))
12627 }
12628 }
12629
12630 /// Defines possible types of component that produces logs.
12631 ///
12632 /// # Working with unknown values
12633 ///
12634 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12635 /// additional enum variants at any time. Adding new variants is not considered
12636 /// a breaking change. Applications should write their code in anticipation of:
12637 ///
12638 /// - New values appearing in future releases of the client library, **and**
12639 /// - New values received dynamically, without application changes.
12640 ///
12641 /// Please consult the [Working with enums] section in the user guide for some
12642 /// guidelines.
12643 ///
12644 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12645 #[derive(Clone, Debug, PartialEq)]
12646 #[non_exhaustive]
12647 pub enum SourceType {
12648 /// The default value. This value should never be used.
12649 Unspecified,
12650 /// Logs produced by ESXI hosts
12651 Esxi,
12652 /// Logs produced by vCenter server
12653 Vcsa,
12654 /// If set, the enum was initialized with an unknown value.
12655 ///
12656 /// Applications can examine the value using [SourceType::value] or
12657 /// [SourceType::name].
12658 UnknownValue(source_type::UnknownValue),
12659 }
12660
12661 #[doc(hidden)]
12662 pub mod source_type {
12663 #[allow(unused_imports)]
12664 use super::*;
12665 #[derive(Clone, Debug, PartialEq)]
12666 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12667 }
12668
12669 impl SourceType {
12670 /// Gets the enum value.
12671 ///
12672 /// Returns `None` if the enum contains an unknown value deserialized from
12673 /// the string representation of enums.
12674 pub fn value(&self) -> std::option::Option<i32> {
12675 match self {
12676 Self::Unspecified => std::option::Option::Some(0),
12677 Self::Esxi => std::option::Option::Some(1),
12678 Self::Vcsa => std::option::Option::Some(2),
12679 Self::UnknownValue(u) => u.0.value(),
12680 }
12681 }
12682
12683 /// Gets the enum value as a string.
12684 ///
12685 /// Returns `None` if the enum contains an unknown value deserialized from
12686 /// the integer representation of enums.
12687 pub fn name(&self) -> std::option::Option<&str> {
12688 match self {
12689 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12690 Self::Esxi => std::option::Option::Some("ESXI"),
12691 Self::Vcsa => std::option::Option::Some("VCSA"),
12692 Self::UnknownValue(u) => u.0.name(),
12693 }
12694 }
12695 }
12696
12697 impl std::default::Default for SourceType {
12698 fn default() -> Self {
12699 use std::convert::From;
12700 Self::from(0)
12701 }
12702 }
12703
12704 impl std::fmt::Display for SourceType {
12705 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12706 wkt::internal::display_enum(f, self.name(), self.value())
12707 }
12708 }
12709
12710 impl std::convert::From<i32> for SourceType {
12711 fn from(value: i32) -> Self {
12712 match value {
12713 0 => Self::Unspecified,
12714 1 => Self::Esxi,
12715 2 => Self::Vcsa,
12716 _ => Self::UnknownValue(source_type::UnknownValue(
12717 wkt::internal::UnknownEnumValue::Integer(value),
12718 )),
12719 }
12720 }
12721 }
12722
12723 impl std::convert::From<&str> for SourceType {
12724 fn from(value: &str) -> Self {
12725 use std::string::ToString;
12726 match value {
12727 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12728 "ESXI" => Self::Esxi,
12729 "VCSA" => Self::Vcsa,
12730 _ => Self::UnknownValue(source_type::UnknownValue(
12731 wkt::internal::UnknownEnumValue::String(value.to_string()),
12732 )),
12733 }
12734 }
12735 }
12736
12737 impl serde::ser::Serialize for SourceType {
12738 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12739 where
12740 S: serde::Serializer,
12741 {
12742 match self {
12743 Self::Unspecified => serializer.serialize_i32(0),
12744 Self::Esxi => serializer.serialize_i32(1),
12745 Self::Vcsa => serializer.serialize_i32(2),
12746 Self::UnknownValue(u) => u.0.serialize(serializer),
12747 }
12748 }
12749 }
12750
12751 impl<'de> serde::de::Deserialize<'de> for SourceType {
12752 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12753 where
12754 D: serde::Deserializer<'de>,
12755 {
12756 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12757 ".google.cloud.vmwareengine.v1.LoggingServer.SourceType",
12758 ))
12759 }
12760 }
12761}
12762
12763/// Describes node type.
12764#[derive(Clone, Default, PartialEq)]
12765#[non_exhaustive]
12766pub struct NodeType {
12767 /// Output only. The resource name of this node type.
12768 /// Resource names are schemeless URIs that follow the conventions in
12769 /// <https://cloud.google.com/apis/design/resource_names>.
12770 /// For example:
12771 /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
12772 pub name: std::string::String,
12773
12774 /// Output only. The canonical identifier of the node type
12775 /// (corresponds to the `NodeType`). For example: standard-72.
12776 pub node_type_id: std::string::String,
12777
12778 /// Output only. The friendly name for this node type.
12779 /// For example: ve1-standard-72
12780 pub display_name: std::string::String,
12781
12782 /// Output only. The total number of virtual CPUs in a single node.
12783 pub virtual_cpu_count: i32,
12784
12785 /// Output only. The total number of CPU cores in a single node.
12786 pub total_core_count: i32,
12787
12788 /// Output only. The amount of physical memory available, defined in GB.
12789 pub memory_gb: i32,
12790
12791 /// Output only. The amount of storage available, defined in GB.
12792 pub disk_size_gb: i32,
12793
12794 /// Output only. List of possible values of custom core count.
12795 pub available_custom_core_counts: std::vec::Vec<i32>,
12796
12797 /// Output only. The type of the resource.
12798 pub kind: crate::model::node_type::Kind,
12799
12800 /// Output only. Families of the node type.
12801 /// For node types to be in the same cluster
12802 /// they must share at least one element in the `families`.
12803 pub families: std::vec::Vec<std::string::String>,
12804
12805 /// Output only. Capabilities of this node type.
12806 pub capabilities: std::vec::Vec<crate::model::node_type::Capability>,
12807
12808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12809}
12810
12811impl NodeType {
12812 /// Creates a new default instance.
12813 pub fn new() -> Self {
12814 std::default::Default::default()
12815 }
12816
12817 /// Sets the value of [name][crate::model::NodeType::name].
12818 ///
12819 /// # Example
12820 /// ```ignore,no_run
12821 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12822 /// # let project_id = "project_id";
12823 /// # let location_id = "location_id";
12824 /// # let node_type_id = "node_type_id";
12825 /// let x = NodeType::new().set_name(format!("projects/{project_id}/locations/{location_id}/nodeTypes/{node_type_id}"));
12826 /// ```
12827 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12828 self.name = v.into();
12829 self
12830 }
12831
12832 /// Sets the value of [node_type_id][crate::model::NodeType::node_type_id].
12833 ///
12834 /// # Example
12835 /// ```ignore,no_run
12836 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12837 /// let x = NodeType::new().set_node_type_id("example");
12838 /// ```
12839 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12840 self.node_type_id = v.into();
12841 self
12842 }
12843
12844 /// Sets the value of [display_name][crate::model::NodeType::display_name].
12845 ///
12846 /// # Example
12847 /// ```ignore,no_run
12848 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12849 /// let x = NodeType::new().set_display_name("example");
12850 /// ```
12851 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12852 self.display_name = v.into();
12853 self
12854 }
12855
12856 /// Sets the value of [virtual_cpu_count][crate::model::NodeType::virtual_cpu_count].
12857 ///
12858 /// # Example
12859 /// ```ignore,no_run
12860 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12861 /// let x = NodeType::new().set_virtual_cpu_count(42);
12862 /// ```
12863 pub fn set_virtual_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12864 self.virtual_cpu_count = v.into();
12865 self
12866 }
12867
12868 /// Sets the value of [total_core_count][crate::model::NodeType::total_core_count].
12869 ///
12870 /// # Example
12871 /// ```ignore,no_run
12872 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12873 /// let x = NodeType::new().set_total_core_count(42);
12874 /// ```
12875 pub fn set_total_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12876 self.total_core_count = v.into();
12877 self
12878 }
12879
12880 /// Sets the value of [memory_gb][crate::model::NodeType::memory_gb].
12881 ///
12882 /// # Example
12883 /// ```ignore,no_run
12884 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12885 /// let x = NodeType::new().set_memory_gb(42);
12886 /// ```
12887 pub fn set_memory_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12888 self.memory_gb = v.into();
12889 self
12890 }
12891
12892 /// Sets the value of [disk_size_gb][crate::model::NodeType::disk_size_gb].
12893 ///
12894 /// # Example
12895 /// ```ignore,no_run
12896 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12897 /// let x = NodeType::new().set_disk_size_gb(42);
12898 /// ```
12899 pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12900 self.disk_size_gb = v.into();
12901 self
12902 }
12903
12904 /// Sets the value of [available_custom_core_counts][crate::model::NodeType::available_custom_core_counts].
12905 ///
12906 /// # Example
12907 /// ```ignore,no_run
12908 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12909 /// let x = NodeType::new().set_available_custom_core_counts([1, 2, 3]);
12910 /// ```
12911 pub fn set_available_custom_core_counts<T, V>(mut self, v: T) -> Self
12912 where
12913 T: std::iter::IntoIterator<Item = V>,
12914 V: std::convert::Into<i32>,
12915 {
12916 use std::iter::Iterator;
12917 self.available_custom_core_counts = v.into_iter().map(|i| i.into()).collect();
12918 self
12919 }
12920
12921 /// Sets the value of [kind][crate::model::NodeType::kind].
12922 ///
12923 /// # Example
12924 /// ```ignore,no_run
12925 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12926 /// use google_cloud_vmwareengine_v1::model::node_type::Kind;
12927 /// let x0 = NodeType::new().set_kind(Kind::Standard);
12928 /// let x1 = NodeType::new().set_kind(Kind::StorageOnly);
12929 /// ```
12930 pub fn set_kind<T: std::convert::Into<crate::model::node_type::Kind>>(mut self, v: T) -> Self {
12931 self.kind = v.into();
12932 self
12933 }
12934
12935 /// Sets the value of [families][crate::model::NodeType::families].
12936 ///
12937 /// # Example
12938 /// ```ignore,no_run
12939 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12940 /// let x = NodeType::new().set_families(["a", "b", "c"]);
12941 /// ```
12942 pub fn set_families<T, V>(mut self, v: T) -> Self
12943 where
12944 T: std::iter::IntoIterator<Item = V>,
12945 V: std::convert::Into<std::string::String>,
12946 {
12947 use std::iter::Iterator;
12948 self.families = v.into_iter().map(|i| i.into()).collect();
12949 self
12950 }
12951
12952 /// Sets the value of [capabilities][crate::model::NodeType::capabilities].
12953 ///
12954 /// # Example
12955 /// ```ignore,no_run
12956 /// # use google_cloud_vmwareengine_v1::model::NodeType;
12957 /// use google_cloud_vmwareengine_v1::model::node_type::Capability;
12958 /// let x = NodeType::new().set_capabilities([
12959 /// Capability::StretchedClusters,
12960 /// ]);
12961 /// ```
12962 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
12963 where
12964 T: std::iter::IntoIterator<Item = V>,
12965 V: std::convert::Into<crate::model::node_type::Capability>,
12966 {
12967 use std::iter::Iterator;
12968 self.capabilities = v.into_iter().map(|i| i.into()).collect();
12969 self
12970 }
12971}
12972
12973impl wkt::message::Message for NodeType {
12974 fn typename() -> &'static str {
12975 "type.googleapis.com/google.cloud.vmwareengine.v1.NodeType"
12976 }
12977}
12978
12979/// Defines additional types related to [NodeType].
12980pub mod node_type {
12981 #[allow(unused_imports)]
12982 use super::*;
12983
12984 /// Enum Kind defines possible types of a NodeType.
12985 ///
12986 /// # Working with unknown values
12987 ///
12988 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12989 /// additional enum variants at any time. Adding new variants is not considered
12990 /// a breaking change. Applications should write their code in anticipation of:
12991 ///
12992 /// - New values appearing in future releases of the client library, **and**
12993 /// - New values received dynamically, without application changes.
12994 ///
12995 /// Please consult the [Working with enums] section in the user guide for some
12996 /// guidelines.
12997 ///
12998 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12999 #[derive(Clone, Debug, PartialEq)]
13000 #[non_exhaustive]
13001 pub enum Kind {
13002 /// The default value. This value should never be used.
13003 Unspecified,
13004 /// Standard HCI node.
13005 Standard,
13006 /// Storage only Node.
13007 StorageOnly,
13008 /// If set, the enum was initialized with an unknown value.
13009 ///
13010 /// Applications can examine the value using [Kind::value] or
13011 /// [Kind::name].
13012 UnknownValue(kind::UnknownValue),
13013 }
13014
13015 #[doc(hidden)]
13016 pub mod kind {
13017 #[allow(unused_imports)]
13018 use super::*;
13019 #[derive(Clone, Debug, PartialEq)]
13020 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13021 }
13022
13023 impl Kind {
13024 /// Gets the enum value.
13025 ///
13026 /// Returns `None` if the enum contains an unknown value deserialized from
13027 /// the string representation of enums.
13028 pub fn value(&self) -> std::option::Option<i32> {
13029 match self {
13030 Self::Unspecified => std::option::Option::Some(0),
13031 Self::Standard => std::option::Option::Some(1),
13032 Self::StorageOnly => std::option::Option::Some(2),
13033 Self::UnknownValue(u) => u.0.value(),
13034 }
13035 }
13036
13037 /// Gets the enum value as a string.
13038 ///
13039 /// Returns `None` if the enum contains an unknown value deserialized from
13040 /// the integer representation of enums.
13041 pub fn name(&self) -> std::option::Option<&str> {
13042 match self {
13043 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
13044 Self::Standard => std::option::Option::Some("STANDARD"),
13045 Self::StorageOnly => std::option::Option::Some("STORAGE_ONLY"),
13046 Self::UnknownValue(u) => u.0.name(),
13047 }
13048 }
13049 }
13050
13051 impl std::default::Default for Kind {
13052 fn default() -> Self {
13053 use std::convert::From;
13054 Self::from(0)
13055 }
13056 }
13057
13058 impl std::fmt::Display for Kind {
13059 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13060 wkt::internal::display_enum(f, self.name(), self.value())
13061 }
13062 }
13063
13064 impl std::convert::From<i32> for Kind {
13065 fn from(value: i32) -> Self {
13066 match value {
13067 0 => Self::Unspecified,
13068 1 => Self::Standard,
13069 2 => Self::StorageOnly,
13070 _ => Self::UnknownValue(kind::UnknownValue(
13071 wkt::internal::UnknownEnumValue::Integer(value),
13072 )),
13073 }
13074 }
13075 }
13076
13077 impl std::convert::From<&str> for Kind {
13078 fn from(value: &str) -> Self {
13079 use std::string::ToString;
13080 match value {
13081 "KIND_UNSPECIFIED" => Self::Unspecified,
13082 "STANDARD" => Self::Standard,
13083 "STORAGE_ONLY" => Self::StorageOnly,
13084 _ => Self::UnknownValue(kind::UnknownValue(
13085 wkt::internal::UnknownEnumValue::String(value.to_string()),
13086 )),
13087 }
13088 }
13089 }
13090
13091 impl serde::ser::Serialize for Kind {
13092 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13093 where
13094 S: serde::Serializer,
13095 {
13096 match self {
13097 Self::Unspecified => serializer.serialize_i32(0),
13098 Self::Standard => serializer.serialize_i32(1),
13099 Self::StorageOnly => serializer.serialize_i32(2),
13100 Self::UnknownValue(u) => u.0.serialize(serializer),
13101 }
13102 }
13103 }
13104
13105 impl<'de> serde::de::Deserialize<'de> for Kind {
13106 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13107 where
13108 D: serde::Deserializer<'de>,
13109 {
13110 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
13111 ".google.cloud.vmwareengine.v1.NodeType.Kind",
13112 ))
13113 }
13114 }
13115
13116 /// Capability of a node type.
13117 ///
13118 /// # Working with unknown values
13119 ///
13120 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13121 /// additional enum variants at any time. Adding new variants is not considered
13122 /// a breaking change. Applications should write their code in anticipation of:
13123 ///
13124 /// - New values appearing in future releases of the client library, **and**
13125 /// - New values received dynamically, without application changes.
13126 ///
13127 /// Please consult the [Working with enums] section in the user guide for some
13128 /// guidelines.
13129 ///
13130 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13131 #[derive(Clone, Debug, PartialEq)]
13132 #[non_exhaustive]
13133 pub enum Capability {
13134 /// The default value. This value is used if the capability is omitted or
13135 /// unknown.
13136 Unspecified,
13137 /// This node type supports stretch clusters.
13138 StretchedClusters,
13139 /// If set, the enum was initialized with an unknown value.
13140 ///
13141 /// Applications can examine the value using [Capability::value] or
13142 /// [Capability::name].
13143 UnknownValue(capability::UnknownValue),
13144 }
13145
13146 #[doc(hidden)]
13147 pub mod capability {
13148 #[allow(unused_imports)]
13149 use super::*;
13150 #[derive(Clone, Debug, PartialEq)]
13151 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13152 }
13153
13154 impl Capability {
13155 /// Gets the enum value.
13156 ///
13157 /// Returns `None` if the enum contains an unknown value deserialized from
13158 /// the string representation of enums.
13159 pub fn value(&self) -> std::option::Option<i32> {
13160 match self {
13161 Self::Unspecified => std::option::Option::Some(0),
13162 Self::StretchedClusters => std::option::Option::Some(1),
13163 Self::UnknownValue(u) => u.0.value(),
13164 }
13165 }
13166
13167 /// Gets the enum value as a string.
13168 ///
13169 /// Returns `None` if the enum contains an unknown value deserialized from
13170 /// the integer representation of enums.
13171 pub fn name(&self) -> std::option::Option<&str> {
13172 match self {
13173 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
13174 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
13175 Self::UnknownValue(u) => u.0.name(),
13176 }
13177 }
13178 }
13179
13180 impl std::default::Default for Capability {
13181 fn default() -> Self {
13182 use std::convert::From;
13183 Self::from(0)
13184 }
13185 }
13186
13187 impl std::fmt::Display for Capability {
13188 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13189 wkt::internal::display_enum(f, self.name(), self.value())
13190 }
13191 }
13192
13193 impl std::convert::From<i32> for Capability {
13194 fn from(value: i32) -> Self {
13195 match value {
13196 0 => Self::Unspecified,
13197 1 => Self::StretchedClusters,
13198 _ => Self::UnknownValue(capability::UnknownValue(
13199 wkt::internal::UnknownEnumValue::Integer(value),
13200 )),
13201 }
13202 }
13203 }
13204
13205 impl std::convert::From<&str> for Capability {
13206 fn from(value: &str) -> Self {
13207 use std::string::ToString;
13208 match value {
13209 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
13210 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
13211 _ => Self::UnknownValue(capability::UnknownValue(
13212 wkt::internal::UnknownEnumValue::String(value.to_string()),
13213 )),
13214 }
13215 }
13216 }
13217
13218 impl serde::ser::Serialize for Capability {
13219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13220 where
13221 S: serde::Serializer,
13222 {
13223 match self {
13224 Self::Unspecified => serializer.serialize_i32(0),
13225 Self::StretchedClusters => serializer.serialize_i32(1),
13226 Self::UnknownValue(u) => u.0.serialize(serializer),
13227 }
13228 }
13229 }
13230
13231 impl<'de> serde::de::Deserialize<'de> for Capability {
13232 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13233 where
13234 D: serde::Deserializer<'de>,
13235 {
13236 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
13237 ".google.cloud.vmwareengine.v1.NodeType.Capability",
13238 ))
13239 }
13240 }
13241}
13242
13243/// Credentials for a private cloud.
13244#[derive(Clone, Default, PartialEq)]
13245#[non_exhaustive]
13246pub struct Credentials {
13247 /// Initial username.
13248 pub username: std::string::String,
13249
13250 /// Initial password.
13251 pub password: std::string::String,
13252
13253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13254}
13255
13256impl Credentials {
13257 /// Creates a new default instance.
13258 pub fn new() -> Self {
13259 std::default::Default::default()
13260 }
13261
13262 /// Sets the value of [username][crate::model::Credentials::username].
13263 ///
13264 /// # Example
13265 /// ```ignore,no_run
13266 /// # use google_cloud_vmwareengine_v1::model::Credentials;
13267 /// let x = Credentials::new().set_username("example");
13268 /// ```
13269 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13270 self.username = v.into();
13271 self
13272 }
13273
13274 /// Sets the value of [password][crate::model::Credentials::password].
13275 ///
13276 /// # Example
13277 /// ```ignore,no_run
13278 /// # use google_cloud_vmwareengine_v1::model::Credentials;
13279 /// let x = Credentials::new().set_password("example");
13280 /// ```
13281 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13282 self.password = v.into();
13283 self
13284 }
13285}
13286
13287impl wkt::message::Message for Credentials {
13288 fn typename() -> &'static str {
13289 "type.googleapis.com/google.cloud.vmwareengine.v1.Credentials"
13290 }
13291}
13292
13293/// HCX activation key. A default key is created during
13294/// private cloud provisioning, but this behavior is subject to change
13295/// and you should always verify active keys.
13296/// Use
13297/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
13298/// to retrieve existing keys and
13299/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
13300/// to create new ones.
13301///
13302/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
13303/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
13304#[derive(Clone, Default, PartialEq)]
13305#[non_exhaustive]
13306pub struct HcxActivationKey {
13307 /// Output only. The resource name of this HcxActivationKey.
13308 /// Resource names are schemeless URIs that follow the conventions in
13309 /// <https://cloud.google.com/apis/design/resource_names>.
13310 /// For example:
13311 /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
13312 pub name: std::string::String,
13313
13314 /// Output only. Creation time of HCX activation key.
13315 pub create_time: std::option::Option<wkt::Timestamp>,
13316
13317 /// Output only. State of HCX activation key.
13318 pub state: crate::model::hcx_activation_key::State,
13319
13320 /// Output only. HCX activation key.
13321 pub activation_key: std::string::String,
13322
13323 /// Output only. System-generated unique identifier for the resource.
13324 pub uid: std::string::String,
13325
13326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13327}
13328
13329impl HcxActivationKey {
13330 /// Creates a new default instance.
13331 pub fn new() -> Self {
13332 std::default::Default::default()
13333 }
13334
13335 /// Sets the value of [name][crate::model::HcxActivationKey::name].
13336 ///
13337 /// # Example
13338 /// ```ignore,no_run
13339 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13340 /// # let project_id = "project_id";
13341 /// # let location_id = "location_id";
13342 /// # let private_cloud_id = "private_cloud_id";
13343 /// # let hcx_activation_key_id = "hcx_activation_key_id";
13344 /// let x = HcxActivationKey::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/hcxActivationKeys/{hcx_activation_key_id}"));
13345 /// ```
13346 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13347 self.name = v.into();
13348 self
13349 }
13350
13351 /// Sets the value of [create_time][crate::model::HcxActivationKey::create_time].
13352 ///
13353 /// # Example
13354 /// ```ignore,no_run
13355 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13356 /// use wkt::Timestamp;
13357 /// let x = HcxActivationKey::new().set_create_time(Timestamp::default()/* use setters */);
13358 /// ```
13359 pub fn set_create_time<T>(mut self, v: T) -> Self
13360 where
13361 T: std::convert::Into<wkt::Timestamp>,
13362 {
13363 self.create_time = std::option::Option::Some(v.into());
13364 self
13365 }
13366
13367 /// Sets or clears the value of [create_time][crate::model::HcxActivationKey::create_time].
13368 ///
13369 /// # Example
13370 /// ```ignore,no_run
13371 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13372 /// use wkt::Timestamp;
13373 /// let x = HcxActivationKey::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13374 /// let x = HcxActivationKey::new().set_or_clear_create_time(None::<Timestamp>);
13375 /// ```
13376 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13377 where
13378 T: std::convert::Into<wkt::Timestamp>,
13379 {
13380 self.create_time = v.map(|x| x.into());
13381 self
13382 }
13383
13384 /// Sets the value of [state][crate::model::HcxActivationKey::state].
13385 ///
13386 /// # Example
13387 /// ```ignore,no_run
13388 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13389 /// use google_cloud_vmwareengine_v1::model::hcx_activation_key::State;
13390 /// let x0 = HcxActivationKey::new().set_state(State::Available);
13391 /// let x1 = HcxActivationKey::new().set_state(State::Consumed);
13392 /// let x2 = HcxActivationKey::new().set_state(State::Creating);
13393 /// ```
13394 pub fn set_state<T: std::convert::Into<crate::model::hcx_activation_key::State>>(
13395 mut self,
13396 v: T,
13397 ) -> Self {
13398 self.state = v.into();
13399 self
13400 }
13401
13402 /// Sets the value of [activation_key][crate::model::HcxActivationKey::activation_key].
13403 ///
13404 /// # Example
13405 /// ```ignore,no_run
13406 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13407 /// let x = HcxActivationKey::new().set_activation_key("example");
13408 /// ```
13409 pub fn set_activation_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13410 self.activation_key = v.into();
13411 self
13412 }
13413
13414 /// Sets the value of [uid][crate::model::HcxActivationKey::uid].
13415 ///
13416 /// # Example
13417 /// ```ignore,no_run
13418 /// # use google_cloud_vmwareengine_v1::model::HcxActivationKey;
13419 /// let x = HcxActivationKey::new().set_uid("example");
13420 /// ```
13421 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13422 self.uid = v.into();
13423 self
13424 }
13425}
13426
13427impl wkt::message::Message for HcxActivationKey {
13428 fn typename() -> &'static str {
13429 "type.googleapis.com/google.cloud.vmwareengine.v1.HcxActivationKey"
13430 }
13431}
13432
13433/// Defines additional types related to [HcxActivationKey].
13434pub mod hcx_activation_key {
13435 #[allow(unused_imports)]
13436 use super::*;
13437
13438 /// State of HCX activation key
13439 ///
13440 /// # Working with unknown values
13441 ///
13442 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13443 /// additional enum variants at any time. Adding new variants is not considered
13444 /// a breaking change. Applications should write their code in anticipation of:
13445 ///
13446 /// - New values appearing in future releases of the client library, **and**
13447 /// - New values received dynamically, without application changes.
13448 ///
13449 /// Please consult the [Working with enums] section in the user guide for some
13450 /// guidelines.
13451 ///
13452 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13453 #[derive(Clone, Debug, PartialEq)]
13454 #[non_exhaustive]
13455 pub enum State {
13456 /// Unspecified state.
13457 Unspecified,
13458 /// State of a newly generated activation key.
13459 Available,
13460 /// State of key when it has been used to activate HCX appliance.
13461 Consumed,
13462 /// State of key when it is being created.
13463 Creating,
13464 /// If set, the enum was initialized with an unknown value.
13465 ///
13466 /// Applications can examine the value using [State::value] or
13467 /// [State::name].
13468 UnknownValue(state::UnknownValue),
13469 }
13470
13471 #[doc(hidden)]
13472 pub mod state {
13473 #[allow(unused_imports)]
13474 use super::*;
13475 #[derive(Clone, Debug, PartialEq)]
13476 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13477 }
13478
13479 impl State {
13480 /// Gets the enum value.
13481 ///
13482 /// Returns `None` if the enum contains an unknown value deserialized from
13483 /// the string representation of enums.
13484 pub fn value(&self) -> std::option::Option<i32> {
13485 match self {
13486 Self::Unspecified => std::option::Option::Some(0),
13487 Self::Available => std::option::Option::Some(1),
13488 Self::Consumed => std::option::Option::Some(2),
13489 Self::Creating => std::option::Option::Some(3),
13490 Self::UnknownValue(u) => u.0.value(),
13491 }
13492 }
13493
13494 /// Gets the enum value as a string.
13495 ///
13496 /// Returns `None` if the enum contains an unknown value deserialized from
13497 /// the integer representation of enums.
13498 pub fn name(&self) -> std::option::Option<&str> {
13499 match self {
13500 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13501 Self::Available => std::option::Option::Some("AVAILABLE"),
13502 Self::Consumed => std::option::Option::Some("CONSUMED"),
13503 Self::Creating => std::option::Option::Some("CREATING"),
13504 Self::UnknownValue(u) => u.0.name(),
13505 }
13506 }
13507 }
13508
13509 impl std::default::Default for State {
13510 fn default() -> Self {
13511 use std::convert::From;
13512 Self::from(0)
13513 }
13514 }
13515
13516 impl std::fmt::Display for State {
13517 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13518 wkt::internal::display_enum(f, self.name(), self.value())
13519 }
13520 }
13521
13522 impl std::convert::From<i32> for State {
13523 fn from(value: i32) -> Self {
13524 match value {
13525 0 => Self::Unspecified,
13526 1 => Self::Available,
13527 2 => Self::Consumed,
13528 3 => Self::Creating,
13529 _ => Self::UnknownValue(state::UnknownValue(
13530 wkt::internal::UnknownEnumValue::Integer(value),
13531 )),
13532 }
13533 }
13534 }
13535
13536 impl std::convert::From<&str> for State {
13537 fn from(value: &str) -> Self {
13538 use std::string::ToString;
13539 match value {
13540 "STATE_UNSPECIFIED" => Self::Unspecified,
13541 "AVAILABLE" => Self::Available,
13542 "CONSUMED" => Self::Consumed,
13543 "CREATING" => Self::Creating,
13544 _ => Self::UnknownValue(state::UnknownValue(
13545 wkt::internal::UnknownEnumValue::String(value.to_string()),
13546 )),
13547 }
13548 }
13549 }
13550
13551 impl serde::ser::Serialize for State {
13552 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13553 where
13554 S: serde::Serializer,
13555 {
13556 match self {
13557 Self::Unspecified => serializer.serialize_i32(0),
13558 Self::Available => serializer.serialize_i32(1),
13559 Self::Consumed => serializer.serialize_i32(2),
13560 Self::Creating => serializer.serialize_i32(3),
13561 Self::UnknownValue(u) => u.0.serialize(serializer),
13562 }
13563 }
13564 }
13565
13566 impl<'de> serde::de::Deserialize<'de> for State {
13567 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13568 where
13569 D: serde::Deserializer<'de>,
13570 {
13571 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13572 ".google.cloud.vmwareengine.v1.HcxActivationKey.State",
13573 ))
13574 }
13575 }
13576}
13577
13578/// Details about a HCX Cloud Manager appliance.
13579#[derive(Clone, Default, PartialEq)]
13580#[non_exhaustive]
13581pub struct Hcx {
13582 /// Internal IP address of the appliance.
13583 pub internal_ip: std::string::String,
13584
13585 /// Version of the appliance.
13586 pub version: std::string::String,
13587
13588 /// Output only. The state of the appliance.
13589 pub state: crate::model::hcx::State,
13590
13591 /// Fully qualified domain name of the appliance.
13592 pub fqdn: std::string::String,
13593
13594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13595}
13596
13597impl Hcx {
13598 /// Creates a new default instance.
13599 pub fn new() -> Self {
13600 std::default::Default::default()
13601 }
13602
13603 /// Sets the value of [internal_ip][crate::model::Hcx::internal_ip].
13604 ///
13605 /// # Example
13606 /// ```ignore,no_run
13607 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13608 /// let x = Hcx::new().set_internal_ip("example");
13609 /// ```
13610 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13611 self.internal_ip = v.into();
13612 self
13613 }
13614
13615 /// Sets the value of [version][crate::model::Hcx::version].
13616 ///
13617 /// # Example
13618 /// ```ignore,no_run
13619 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13620 /// let x = Hcx::new().set_version("example");
13621 /// ```
13622 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13623 self.version = v.into();
13624 self
13625 }
13626
13627 /// Sets the value of [state][crate::model::Hcx::state].
13628 ///
13629 /// # Example
13630 /// ```ignore,no_run
13631 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13632 /// use google_cloud_vmwareengine_v1::model::hcx::State;
13633 /// let x0 = Hcx::new().set_state(State::Active);
13634 /// let x1 = Hcx::new().set_state(State::Creating);
13635 /// let x2 = Hcx::new().set_state(State::Activating);
13636 /// ```
13637 pub fn set_state<T: std::convert::Into<crate::model::hcx::State>>(mut self, v: T) -> Self {
13638 self.state = v.into();
13639 self
13640 }
13641
13642 /// Sets the value of [fqdn][crate::model::Hcx::fqdn].
13643 ///
13644 /// # Example
13645 /// ```ignore,no_run
13646 /// # use google_cloud_vmwareengine_v1::model::Hcx;
13647 /// let x = Hcx::new().set_fqdn("example");
13648 /// ```
13649 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13650 self.fqdn = v.into();
13651 self
13652 }
13653}
13654
13655impl wkt::message::Message for Hcx {
13656 fn typename() -> &'static str {
13657 "type.googleapis.com/google.cloud.vmwareengine.v1.Hcx"
13658 }
13659}
13660
13661/// Defines additional types related to [Hcx].
13662pub mod hcx {
13663 #[allow(unused_imports)]
13664 use super::*;
13665
13666 /// State of the appliance
13667 ///
13668 /// # Working with unknown values
13669 ///
13670 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13671 /// additional enum variants at any time. Adding new variants is not considered
13672 /// a breaking change. Applications should write their code in anticipation of:
13673 ///
13674 /// - New values appearing in future releases of the client library, **and**
13675 /// - New values received dynamically, without application changes.
13676 ///
13677 /// Please consult the [Working with enums] section in the user guide for some
13678 /// guidelines.
13679 ///
13680 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13681 #[derive(Clone, Debug, PartialEq)]
13682 #[non_exhaustive]
13683 pub enum State {
13684 /// Unspecified appliance state. This is the default value.
13685 Unspecified,
13686 /// The appliance is operational and can be used.
13687 Active,
13688 /// The appliance is being deployed.
13689 Creating,
13690 /// The appliance is being activated.
13691 Activating,
13692 /// If set, the enum was initialized with an unknown value.
13693 ///
13694 /// Applications can examine the value using [State::value] or
13695 /// [State::name].
13696 UnknownValue(state::UnknownValue),
13697 }
13698
13699 #[doc(hidden)]
13700 pub mod state {
13701 #[allow(unused_imports)]
13702 use super::*;
13703 #[derive(Clone, Debug, PartialEq)]
13704 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13705 }
13706
13707 impl State {
13708 /// Gets the enum value.
13709 ///
13710 /// Returns `None` if the enum contains an unknown value deserialized from
13711 /// the string representation of enums.
13712 pub fn value(&self) -> std::option::Option<i32> {
13713 match self {
13714 Self::Unspecified => std::option::Option::Some(0),
13715 Self::Active => std::option::Option::Some(1),
13716 Self::Creating => std::option::Option::Some(2),
13717 Self::Activating => std::option::Option::Some(3),
13718 Self::UnknownValue(u) => u.0.value(),
13719 }
13720 }
13721
13722 /// Gets the enum value as a string.
13723 ///
13724 /// Returns `None` if the enum contains an unknown value deserialized from
13725 /// the integer representation of enums.
13726 pub fn name(&self) -> std::option::Option<&str> {
13727 match self {
13728 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13729 Self::Active => std::option::Option::Some("ACTIVE"),
13730 Self::Creating => std::option::Option::Some("CREATING"),
13731 Self::Activating => std::option::Option::Some("ACTIVATING"),
13732 Self::UnknownValue(u) => u.0.name(),
13733 }
13734 }
13735 }
13736
13737 impl std::default::Default for State {
13738 fn default() -> Self {
13739 use std::convert::From;
13740 Self::from(0)
13741 }
13742 }
13743
13744 impl std::fmt::Display for State {
13745 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13746 wkt::internal::display_enum(f, self.name(), self.value())
13747 }
13748 }
13749
13750 impl std::convert::From<i32> for State {
13751 fn from(value: i32) -> Self {
13752 match value {
13753 0 => Self::Unspecified,
13754 1 => Self::Active,
13755 2 => Self::Creating,
13756 3 => Self::Activating,
13757 _ => Self::UnknownValue(state::UnknownValue(
13758 wkt::internal::UnknownEnumValue::Integer(value),
13759 )),
13760 }
13761 }
13762 }
13763
13764 impl std::convert::From<&str> for State {
13765 fn from(value: &str) -> Self {
13766 use std::string::ToString;
13767 match value {
13768 "STATE_UNSPECIFIED" => Self::Unspecified,
13769 "ACTIVE" => Self::Active,
13770 "CREATING" => Self::Creating,
13771 "ACTIVATING" => Self::Activating,
13772 _ => Self::UnknownValue(state::UnknownValue(
13773 wkt::internal::UnknownEnumValue::String(value.to_string()),
13774 )),
13775 }
13776 }
13777 }
13778
13779 impl serde::ser::Serialize for State {
13780 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13781 where
13782 S: serde::Serializer,
13783 {
13784 match self {
13785 Self::Unspecified => serializer.serialize_i32(0),
13786 Self::Active => serializer.serialize_i32(1),
13787 Self::Creating => serializer.serialize_i32(2),
13788 Self::Activating => serializer.serialize_i32(3),
13789 Self::UnknownValue(u) => u.0.serialize(serializer),
13790 }
13791 }
13792 }
13793
13794 impl<'de> serde::de::Deserialize<'de> for State {
13795 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13796 where
13797 D: serde::Deserializer<'de>,
13798 {
13799 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13800 ".google.cloud.vmwareengine.v1.Hcx.State",
13801 ))
13802 }
13803 }
13804}
13805
13806/// Details about a NSX Manager appliance.
13807#[derive(Clone, Default, PartialEq)]
13808#[non_exhaustive]
13809pub struct Nsx {
13810 /// Internal IP address of the appliance.
13811 pub internal_ip: std::string::String,
13812
13813 /// Version of the appliance.
13814 pub version: std::string::String,
13815
13816 /// Output only. The state of the appliance.
13817 pub state: crate::model::nsx::State,
13818
13819 /// Fully qualified domain name of the appliance.
13820 pub fqdn: std::string::String,
13821
13822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13823}
13824
13825impl Nsx {
13826 /// Creates a new default instance.
13827 pub fn new() -> Self {
13828 std::default::Default::default()
13829 }
13830
13831 /// Sets the value of [internal_ip][crate::model::Nsx::internal_ip].
13832 ///
13833 /// # Example
13834 /// ```ignore,no_run
13835 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13836 /// let x = Nsx::new().set_internal_ip("example");
13837 /// ```
13838 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13839 self.internal_ip = v.into();
13840 self
13841 }
13842
13843 /// Sets the value of [version][crate::model::Nsx::version].
13844 ///
13845 /// # Example
13846 /// ```ignore,no_run
13847 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13848 /// let x = Nsx::new().set_version("example");
13849 /// ```
13850 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13851 self.version = v.into();
13852 self
13853 }
13854
13855 /// Sets the value of [state][crate::model::Nsx::state].
13856 ///
13857 /// # Example
13858 /// ```ignore,no_run
13859 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13860 /// use google_cloud_vmwareengine_v1::model::nsx::State;
13861 /// let x0 = Nsx::new().set_state(State::Active);
13862 /// let x1 = Nsx::new().set_state(State::Creating);
13863 /// ```
13864 pub fn set_state<T: std::convert::Into<crate::model::nsx::State>>(mut self, v: T) -> Self {
13865 self.state = v.into();
13866 self
13867 }
13868
13869 /// Sets the value of [fqdn][crate::model::Nsx::fqdn].
13870 ///
13871 /// # Example
13872 /// ```ignore,no_run
13873 /// # use google_cloud_vmwareengine_v1::model::Nsx;
13874 /// let x = Nsx::new().set_fqdn("example");
13875 /// ```
13876 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13877 self.fqdn = v.into();
13878 self
13879 }
13880}
13881
13882impl wkt::message::Message for Nsx {
13883 fn typename() -> &'static str {
13884 "type.googleapis.com/google.cloud.vmwareengine.v1.Nsx"
13885 }
13886}
13887
13888/// Defines additional types related to [Nsx].
13889pub mod nsx {
13890 #[allow(unused_imports)]
13891 use super::*;
13892
13893 /// State of the appliance
13894 ///
13895 /// # Working with unknown values
13896 ///
13897 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13898 /// additional enum variants at any time. Adding new variants is not considered
13899 /// a breaking change. Applications should write their code in anticipation of:
13900 ///
13901 /// - New values appearing in future releases of the client library, **and**
13902 /// - New values received dynamically, without application changes.
13903 ///
13904 /// Please consult the [Working with enums] section in the user guide for some
13905 /// guidelines.
13906 ///
13907 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13908 #[derive(Clone, Debug, PartialEq)]
13909 #[non_exhaustive]
13910 pub enum State {
13911 /// Unspecified appliance state. This is the default value.
13912 Unspecified,
13913 /// The appliance is operational and can be used.
13914 Active,
13915 /// The appliance is being deployed.
13916 Creating,
13917 /// If set, the enum was initialized with an unknown value.
13918 ///
13919 /// Applications can examine the value using [State::value] or
13920 /// [State::name].
13921 UnknownValue(state::UnknownValue),
13922 }
13923
13924 #[doc(hidden)]
13925 pub mod state {
13926 #[allow(unused_imports)]
13927 use super::*;
13928 #[derive(Clone, Debug, PartialEq)]
13929 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13930 }
13931
13932 impl State {
13933 /// Gets the enum value.
13934 ///
13935 /// Returns `None` if the enum contains an unknown value deserialized from
13936 /// the string representation of enums.
13937 pub fn value(&self) -> std::option::Option<i32> {
13938 match self {
13939 Self::Unspecified => std::option::Option::Some(0),
13940 Self::Active => std::option::Option::Some(1),
13941 Self::Creating => std::option::Option::Some(2),
13942 Self::UnknownValue(u) => u.0.value(),
13943 }
13944 }
13945
13946 /// Gets the enum value as a string.
13947 ///
13948 /// Returns `None` if the enum contains an unknown value deserialized from
13949 /// the integer representation of enums.
13950 pub fn name(&self) -> std::option::Option<&str> {
13951 match self {
13952 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13953 Self::Active => std::option::Option::Some("ACTIVE"),
13954 Self::Creating => std::option::Option::Some("CREATING"),
13955 Self::UnknownValue(u) => u.0.name(),
13956 }
13957 }
13958 }
13959
13960 impl std::default::Default for State {
13961 fn default() -> Self {
13962 use std::convert::From;
13963 Self::from(0)
13964 }
13965 }
13966
13967 impl std::fmt::Display for State {
13968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13969 wkt::internal::display_enum(f, self.name(), self.value())
13970 }
13971 }
13972
13973 impl std::convert::From<i32> for State {
13974 fn from(value: i32) -> Self {
13975 match value {
13976 0 => Self::Unspecified,
13977 1 => Self::Active,
13978 2 => Self::Creating,
13979 _ => Self::UnknownValue(state::UnknownValue(
13980 wkt::internal::UnknownEnumValue::Integer(value),
13981 )),
13982 }
13983 }
13984 }
13985
13986 impl std::convert::From<&str> for State {
13987 fn from(value: &str) -> Self {
13988 use std::string::ToString;
13989 match value {
13990 "STATE_UNSPECIFIED" => Self::Unspecified,
13991 "ACTIVE" => Self::Active,
13992 "CREATING" => Self::Creating,
13993 _ => Self::UnknownValue(state::UnknownValue(
13994 wkt::internal::UnknownEnumValue::String(value.to_string()),
13995 )),
13996 }
13997 }
13998 }
13999
14000 impl serde::ser::Serialize for State {
14001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14002 where
14003 S: serde::Serializer,
14004 {
14005 match self {
14006 Self::Unspecified => serializer.serialize_i32(0),
14007 Self::Active => serializer.serialize_i32(1),
14008 Self::Creating => serializer.serialize_i32(2),
14009 Self::UnknownValue(u) => u.0.serialize(serializer),
14010 }
14011 }
14012 }
14013
14014 impl<'de> serde::de::Deserialize<'de> for State {
14015 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14016 where
14017 D: serde::Deserializer<'de>,
14018 {
14019 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14020 ".google.cloud.vmwareengine.v1.Nsx.State",
14021 ))
14022 }
14023 }
14024}
14025
14026/// Details about a vCenter Server management appliance.
14027#[derive(Clone, Default, PartialEq)]
14028#[non_exhaustive]
14029pub struct Vcenter {
14030 /// Internal IP address of the appliance.
14031 pub internal_ip: std::string::String,
14032
14033 /// Version of the appliance.
14034 pub version: std::string::String,
14035
14036 /// Output only. The state of the appliance.
14037 pub state: crate::model::vcenter::State,
14038
14039 /// Fully qualified domain name of the appliance.
14040 pub fqdn: std::string::String,
14041
14042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14043}
14044
14045impl Vcenter {
14046 /// Creates a new default instance.
14047 pub fn new() -> Self {
14048 std::default::Default::default()
14049 }
14050
14051 /// Sets the value of [internal_ip][crate::model::Vcenter::internal_ip].
14052 ///
14053 /// # Example
14054 /// ```ignore,no_run
14055 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
14056 /// let x = Vcenter::new().set_internal_ip("example");
14057 /// ```
14058 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14059 self.internal_ip = v.into();
14060 self
14061 }
14062
14063 /// Sets the value of [version][crate::model::Vcenter::version].
14064 ///
14065 /// # Example
14066 /// ```ignore,no_run
14067 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
14068 /// let x = Vcenter::new().set_version("example");
14069 /// ```
14070 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14071 self.version = v.into();
14072 self
14073 }
14074
14075 /// Sets the value of [state][crate::model::Vcenter::state].
14076 ///
14077 /// # Example
14078 /// ```ignore,no_run
14079 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
14080 /// use google_cloud_vmwareengine_v1::model::vcenter::State;
14081 /// let x0 = Vcenter::new().set_state(State::Active);
14082 /// let x1 = Vcenter::new().set_state(State::Creating);
14083 /// ```
14084 pub fn set_state<T: std::convert::Into<crate::model::vcenter::State>>(mut self, v: T) -> Self {
14085 self.state = v.into();
14086 self
14087 }
14088
14089 /// Sets the value of [fqdn][crate::model::Vcenter::fqdn].
14090 ///
14091 /// # Example
14092 /// ```ignore,no_run
14093 /// # use google_cloud_vmwareengine_v1::model::Vcenter;
14094 /// let x = Vcenter::new().set_fqdn("example");
14095 /// ```
14096 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14097 self.fqdn = v.into();
14098 self
14099 }
14100}
14101
14102impl wkt::message::Message for Vcenter {
14103 fn typename() -> &'static str {
14104 "type.googleapis.com/google.cloud.vmwareengine.v1.Vcenter"
14105 }
14106}
14107
14108/// Defines additional types related to [Vcenter].
14109pub mod vcenter {
14110 #[allow(unused_imports)]
14111 use super::*;
14112
14113 /// State of the appliance
14114 ///
14115 /// # Working with unknown values
14116 ///
14117 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14118 /// additional enum variants at any time. Adding new variants is not considered
14119 /// a breaking change. Applications should write their code in anticipation of:
14120 ///
14121 /// - New values appearing in future releases of the client library, **and**
14122 /// - New values received dynamically, without application changes.
14123 ///
14124 /// Please consult the [Working with enums] section in the user guide for some
14125 /// guidelines.
14126 ///
14127 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14128 #[derive(Clone, Debug, PartialEq)]
14129 #[non_exhaustive]
14130 pub enum State {
14131 /// Unspecified appliance state. This is the default value.
14132 Unspecified,
14133 /// The appliance is operational and can be used.
14134 Active,
14135 /// The appliance is being deployed.
14136 Creating,
14137 /// If set, the enum was initialized with an unknown value.
14138 ///
14139 /// Applications can examine the value using [State::value] or
14140 /// [State::name].
14141 UnknownValue(state::UnknownValue),
14142 }
14143
14144 #[doc(hidden)]
14145 pub mod state {
14146 #[allow(unused_imports)]
14147 use super::*;
14148 #[derive(Clone, Debug, PartialEq)]
14149 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14150 }
14151
14152 impl State {
14153 /// Gets the enum value.
14154 ///
14155 /// Returns `None` if the enum contains an unknown value deserialized from
14156 /// the string representation of enums.
14157 pub fn value(&self) -> std::option::Option<i32> {
14158 match self {
14159 Self::Unspecified => std::option::Option::Some(0),
14160 Self::Active => std::option::Option::Some(1),
14161 Self::Creating => std::option::Option::Some(2),
14162 Self::UnknownValue(u) => u.0.value(),
14163 }
14164 }
14165
14166 /// Gets the enum value as a string.
14167 ///
14168 /// Returns `None` if the enum contains an unknown value deserialized from
14169 /// the integer representation of enums.
14170 pub fn name(&self) -> std::option::Option<&str> {
14171 match self {
14172 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14173 Self::Active => std::option::Option::Some("ACTIVE"),
14174 Self::Creating => std::option::Option::Some("CREATING"),
14175 Self::UnknownValue(u) => u.0.name(),
14176 }
14177 }
14178 }
14179
14180 impl std::default::Default for State {
14181 fn default() -> Self {
14182 use std::convert::From;
14183 Self::from(0)
14184 }
14185 }
14186
14187 impl std::fmt::Display for State {
14188 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14189 wkt::internal::display_enum(f, self.name(), self.value())
14190 }
14191 }
14192
14193 impl std::convert::From<i32> for State {
14194 fn from(value: i32) -> Self {
14195 match value {
14196 0 => Self::Unspecified,
14197 1 => Self::Active,
14198 2 => Self::Creating,
14199 _ => Self::UnknownValue(state::UnknownValue(
14200 wkt::internal::UnknownEnumValue::Integer(value),
14201 )),
14202 }
14203 }
14204 }
14205
14206 impl std::convert::From<&str> for State {
14207 fn from(value: &str) -> Self {
14208 use std::string::ToString;
14209 match value {
14210 "STATE_UNSPECIFIED" => Self::Unspecified,
14211 "ACTIVE" => Self::Active,
14212 "CREATING" => Self::Creating,
14213 _ => Self::UnknownValue(state::UnknownValue(
14214 wkt::internal::UnknownEnumValue::String(value.to_string()),
14215 )),
14216 }
14217 }
14218 }
14219
14220 impl serde::ser::Serialize for State {
14221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14222 where
14223 S: serde::Serializer,
14224 {
14225 match self {
14226 Self::Unspecified => serializer.serialize_i32(0),
14227 Self::Active => serializer.serialize_i32(1),
14228 Self::Creating => serializer.serialize_i32(2),
14229 Self::UnknownValue(u) => u.0.serialize(serializer),
14230 }
14231 }
14232 }
14233
14234 impl<'de> serde::de::Deserialize<'de> for State {
14235 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14236 where
14237 D: serde::Deserializer<'de>,
14238 {
14239 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14240 ".google.cloud.vmwareengine.v1.Vcenter.State",
14241 ))
14242 }
14243 }
14244}
14245
14246/// Autoscaling settings define the rules used by VMware Engine to
14247/// automatically scale-out and scale-in the clusters in a private cloud.
14248#[derive(Clone, Default, PartialEq)]
14249#[non_exhaustive]
14250pub struct AutoscalingSettings {
14251 /// Required. The map with autoscaling policies applied to the cluster.
14252 /// The key is the identifier of the policy.
14253 /// It must meet the following requirements:
14254 ///
14255 /// * Only contains 1-63 alphanumeric characters and hyphens
14256 /// * Begins with an alphabetical character
14257 /// * Ends with a non-hyphen character
14258 /// * Not formatted as a UUID
14259 /// * Complies with [RFC
14260 /// 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
14261 ///
14262 /// Currently there map must contain only one element
14263 /// that describes the autoscaling policy for compute nodes.
14264 pub autoscaling_policies: std::collections::HashMap<
14265 std::string::String,
14266 crate::model::autoscaling_settings::AutoscalingPolicy,
14267 >,
14268
14269 /// Optional. Minimum number of nodes of any type in a cluster.
14270 /// If not specified the default limits apply.
14271 pub min_cluster_node_count: i32,
14272
14273 /// Optional. Maximum number of nodes of any type in a cluster.
14274 /// If not specified the default limits apply.
14275 pub max_cluster_node_count: i32,
14276
14277 /// Optional. The minimum duration between consecutive autoscale operations.
14278 /// It starts once addition or removal of nodes is fully completed.
14279 /// Defaults to 30 minutes if not specified. Cool down period must be in whole
14280 /// minutes (for example, 30, 31, 50, 180 minutes).
14281 pub cool_down_period: std::option::Option<wkt::Duration>,
14282
14283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14284}
14285
14286impl AutoscalingSettings {
14287 /// Creates a new default instance.
14288 pub fn new() -> Self {
14289 std::default::Default::default()
14290 }
14291
14292 /// Sets the value of [autoscaling_policies][crate::model::AutoscalingSettings::autoscaling_policies].
14293 ///
14294 /// # Example
14295 /// ```ignore,no_run
14296 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14297 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14298 /// let x = AutoscalingSettings::new().set_autoscaling_policies([
14299 /// ("key0", AutoscalingPolicy::default()/* use setters */),
14300 /// ("key1", AutoscalingPolicy::default()/* use (different) setters */),
14301 /// ]);
14302 /// ```
14303 pub fn set_autoscaling_policies<T, K, V>(mut self, v: T) -> Self
14304 where
14305 T: std::iter::IntoIterator<Item = (K, V)>,
14306 K: std::convert::Into<std::string::String>,
14307 V: std::convert::Into<crate::model::autoscaling_settings::AutoscalingPolicy>,
14308 {
14309 use std::iter::Iterator;
14310 self.autoscaling_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14311 self
14312 }
14313
14314 /// Sets the value of [min_cluster_node_count][crate::model::AutoscalingSettings::min_cluster_node_count].
14315 ///
14316 /// # Example
14317 /// ```ignore,no_run
14318 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14319 /// let x = AutoscalingSettings::new().set_min_cluster_node_count(42);
14320 /// ```
14321 pub fn set_min_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14322 self.min_cluster_node_count = v.into();
14323 self
14324 }
14325
14326 /// Sets the value of [max_cluster_node_count][crate::model::AutoscalingSettings::max_cluster_node_count].
14327 ///
14328 /// # Example
14329 /// ```ignore,no_run
14330 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14331 /// let x = AutoscalingSettings::new().set_max_cluster_node_count(42);
14332 /// ```
14333 pub fn set_max_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14334 self.max_cluster_node_count = v.into();
14335 self
14336 }
14337
14338 /// Sets the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14343 /// use wkt::Duration;
14344 /// let x = AutoscalingSettings::new().set_cool_down_period(Duration::default()/* use setters */);
14345 /// ```
14346 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
14347 where
14348 T: std::convert::Into<wkt::Duration>,
14349 {
14350 self.cool_down_period = std::option::Option::Some(v.into());
14351 self
14352 }
14353
14354 /// Sets or clears the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
14355 ///
14356 /// # Example
14357 /// ```ignore,no_run
14358 /// # use google_cloud_vmwareengine_v1::model::AutoscalingSettings;
14359 /// use wkt::Duration;
14360 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
14361 /// let x = AutoscalingSettings::new().set_or_clear_cool_down_period(None::<Duration>);
14362 /// ```
14363 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
14364 where
14365 T: std::convert::Into<wkt::Duration>,
14366 {
14367 self.cool_down_period = v.map(|x| x.into());
14368 self
14369 }
14370}
14371
14372impl wkt::message::Message for AutoscalingSettings {
14373 fn typename() -> &'static str {
14374 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings"
14375 }
14376}
14377
14378/// Defines additional types related to [AutoscalingSettings].
14379pub mod autoscaling_settings {
14380 #[allow(unused_imports)]
14381 use super::*;
14382
14383 /// Thresholds define the utilization of resources triggering
14384 /// scale-out and scale-in operations.
14385 #[derive(Clone, Default, PartialEq)]
14386 #[non_exhaustive]
14387 pub struct Thresholds {
14388 /// Required. The utilization triggering the scale-out operation in percent.
14389 pub scale_out: i32,
14390
14391 /// Required. The utilization triggering the scale-in operation in percent.
14392 pub scale_in: i32,
14393
14394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14395 }
14396
14397 impl Thresholds {
14398 /// Creates a new default instance.
14399 pub fn new() -> Self {
14400 std::default::Default::default()
14401 }
14402
14403 /// Sets the value of [scale_out][crate::model::autoscaling_settings::Thresholds::scale_out].
14404 ///
14405 /// # Example
14406 /// ```ignore,no_run
14407 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14408 /// let x = Thresholds::new().set_scale_out(42);
14409 /// ```
14410 pub fn set_scale_out<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14411 self.scale_out = v.into();
14412 self
14413 }
14414
14415 /// Sets the value of [scale_in][crate::model::autoscaling_settings::Thresholds::scale_in].
14416 ///
14417 /// # Example
14418 /// ```ignore,no_run
14419 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14420 /// let x = Thresholds::new().set_scale_in(42);
14421 /// ```
14422 pub fn set_scale_in<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14423 self.scale_in = v.into();
14424 self
14425 }
14426 }
14427
14428 impl wkt::message::Message for Thresholds {
14429 fn typename() -> &'static str {
14430 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds"
14431 }
14432 }
14433
14434 /// Autoscaling policy describes the behavior of the autoscaling
14435 /// with respect to the resource utilization.
14436 /// The scale-out operation is initiated if the utilization
14437 /// exceeds ANY of the respective thresholds.
14438 /// The scale-in operation is initiated if the utilization
14439 /// is below ALL of the respective thresholds.
14440 #[derive(Clone, Default, PartialEq)]
14441 #[non_exhaustive]
14442 pub struct AutoscalingPolicy {
14443 /// Required. The canonical identifier of the node type to add or remove.
14444 /// Corresponds to the `NodeType`.
14445 pub node_type_id: std::string::String,
14446
14447 /// Required. Number of nodes to add to a cluster during a scale-out
14448 /// operation. Must be divisible by 2 for stretched clusters. During a
14449 /// scale-in operation only one node (or 2 for stretched clusters) are
14450 /// removed in a single iteration.
14451 pub scale_out_size: i32,
14452
14453 /// Optional. Utilization thresholds pertaining to CPU utilization.
14454 pub cpu_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14455
14456 /// Optional. Utilization thresholds pertaining to amount of granted memory.
14457 pub granted_memory_thresholds:
14458 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14459
14460 /// Optional. Utilization thresholds pertaining to amount of consumed memory.
14461 pub consumed_memory_thresholds:
14462 std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14463
14464 /// Optional. Utilization thresholds pertaining to amount of consumed
14465 /// storage.
14466 pub storage_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
14467
14468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14469 }
14470
14471 impl AutoscalingPolicy {
14472 /// Creates a new default instance.
14473 pub fn new() -> Self {
14474 std::default::Default::default()
14475 }
14476
14477 /// Sets the value of [node_type_id][crate::model::autoscaling_settings::AutoscalingPolicy::node_type_id].
14478 ///
14479 /// # Example
14480 /// ```ignore,no_run
14481 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14482 /// let x = AutoscalingPolicy::new().set_node_type_id("example");
14483 /// ```
14484 pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(
14485 mut self,
14486 v: T,
14487 ) -> Self {
14488 self.node_type_id = v.into();
14489 self
14490 }
14491
14492 /// Sets the value of [scale_out_size][crate::model::autoscaling_settings::AutoscalingPolicy::scale_out_size].
14493 ///
14494 /// # Example
14495 /// ```ignore,no_run
14496 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14497 /// let x = AutoscalingPolicy::new().set_scale_out_size(42);
14498 /// ```
14499 pub fn set_scale_out_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14500 self.scale_out_size = v.into();
14501 self
14502 }
14503
14504 /// Sets the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14505 ///
14506 /// # Example
14507 /// ```ignore,no_run
14508 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14509 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14510 /// let x = AutoscalingPolicy::new().set_cpu_thresholds(Thresholds::default()/* use setters */);
14511 /// ```
14512 pub fn set_cpu_thresholds<T>(mut self, v: T) -> Self
14513 where
14514 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14515 {
14516 self.cpu_thresholds = std::option::Option::Some(v.into());
14517 self
14518 }
14519
14520 /// Sets or clears the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
14521 ///
14522 /// # Example
14523 /// ```ignore,no_run
14524 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14525 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14526 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(Some(Thresholds::default()/* use setters */));
14527 /// let x = AutoscalingPolicy::new().set_or_clear_cpu_thresholds(None::<Thresholds>);
14528 /// ```
14529 pub fn set_or_clear_cpu_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14530 where
14531 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14532 {
14533 self.cpu_thresholds = v.map(|x| x.into());
14534 self
14535 }
14536
14537 /// Sets the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14538 ///
14539 /// # Example
14540 /// ```ignore,no_run
14541 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14542 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14543 /// let x = AutoscalingPolicy::new().set_granted_memory_thresholds(Thresholds::default()/* use setters */);
14544 /// ```
14545 pub fn set_granted_memory_thresholds<T>(mut self, v: T) -> Self
14546 where
14547 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14548 {
14549 self.granted_memory_thresholds = std::option::Option::Some(v.into());
14550 self
14551 }
14552
14553 /// Sets or clears the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
14554 ///
14555 /// # Example
14556 /// ```ignore,no_run
14557 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14558 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14559 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(Some(Thresholds::default()/* use setters */));
14560 /// let x = AutoscalingPolicy::new().set_or_clear_granted_memory_thresholds(None::<Thresholds>);
14561 /// ```
14562 pub fn set_or_clear_granted_memory_thresholds<T>(
14563 mut self,
14564 v: std::option::Option<T>,
14565 ) -> Self
14566 where
14567 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14568 {
14569 self.granted_memory_thresholds = v.map(|x| x.into());
14570 self
14571 }
14572
14573 /// Sets the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14574 ///
14575 /// # Example
14576 /// ```ignore,no_run
14577 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14578 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14579 /// let x = AutoscalingPolicy::new().set_consumed_memory_thresholds(Thresholds::default()/* use setters */);
14580 /// ```
14581 pub fn set_consumed_memory_thresholds<T>(mut self, v: T) -> Self
14582 where
14583 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14584 {
14585 self.consumed_memory_thresholds = std::option::Option::Some(v.into());
14586 self
14587 }
14588
14589 /// Sets or clears the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
14590 ///
14591 /// # Example
14592 /// ```ignore,no_run
14593 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14594 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14595 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(Some(Thresholds::default()/* use setters */));
14596 /// let x = AutoscalingPolicy::new().set_or_clear_consumed_memory_thresholds(None::<Thresholds>);
14597 /// ```
14598 pub fn set_or_clear_consumed_memory_thresholds<T>(
14599 mut self,
14600 v: std::option::Option<T>,
14601 ) -> Self
14602 where
14603 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14604 {
14605 self.consumed_memory_thresholds = v.map(|x| x.into());
14606 self
14607 }
14608
14609 /// Sets the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14610 ///
14611 /// # Example
14612 /// ```ignore,no_run
14613 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14614 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14615 /// let x = AutoscalingPolicy::new().set_storage_thresholds(Thresholds::default()/* use setters */);
14616 /// ```
14617 pub fn set_storage_thresholds<T>(mut self, v: T) -> Self
14618 where
14619 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14620 {
14621 self.storage_thresholds = std::option::Option::Some(v.into());
14622 self
14623 }
14624
14625 /// Sets or clears the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
14626 ///
14627 /// # Example
14628 /// ```ignore,no_run
14629 /// # use google_cloud_vmwareengine_v1::model::autoscaling_settings::AutoscalingPolicy;
14630 /// use google_cloud_vmwareengine_v1::model::autoscaling_settings::Thresholds;
14631 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(Some(Thresholds::default()/* use setters */));
14632 /// let x = AutoscalingPolicy::new().set_or_clear_storage_thresholds(None::<Thresholds>);
14633 /// ```
14634 pub fn set_or_clear_storage_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
14635 where
14636 T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
14637 {
14638 self.storage_thresholds = v.map(|x| x.into());
14639 self
14640 }
14641 }
14642
14643 impl wkt::message::Message for AutoscalingPolicy {
14644 fn typename() -> &'static str {
14645 "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy"
14646 }
14647 }
14648}
14649
14650/// DNS forwarding config.
14651/// This config defines a list of domain to name server mappings,
14652/// and is attached to the private cloud for custom domain resolution.
14653#[derive(Clone, Default, PartialEq)]
14654#[non_exhaustive]
14655pub struct DnsForwarding {
14656 /// Output only. The resource name of this DNS profile.
14657 /// Resource names are schemeless URIs that follow the conventions in
14658 /// <https://cloud.google.com/apis/design/resource_names>.
14659 /// For example:
14660 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
14661 pub name: std::string::String,
14662
14663 /// Output only. Creation time of this resource.
14664 pub create_time: std::option::Option<wkt::Timestamp>,
14665
14666 /// Output only. Last update time of this resource.
14667 pub update_time: std::option::Option<wkt::Timestamp>,
14668
14669 /// Required. List of domain mappings to configure
14670 pub forwarding_rules: std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
14671
14672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14673}
14674
14675impl DnsForwarding {
14676 /// Creates a new default instance.
14677 pub fn new() -> Self {
14678 std::default::Default::default()
14679 }
14680
14681 /// Sets the value of [name][crate::model::DnsForwarding::name].
14682 ///
14683 /// # Example
14684 /// ```ignore,no_run
14685 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14686 /// # let project_id = "project_id";
14687 /// # let location_id = "location_id";
14688 /// # let private_cloud_id = "private_cloud_id";
14689 /// let x = DnsForwarding::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/dnsForwarding"));
14690 /// ```
14691 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14692 self.name = v.into();
14693 self
14694 }
14695
14696 /// Sets the value of [create_time][crate::model::DnsForwarding::create_time].
14697 ///
14698 /// # Example
14699 /// ```ignore,no_run
14700 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14701 /// use wkt::Timestamp;
14702 /// let x = DnsForwarding::new().set_create_time(Timestamp::default()/* use setters */);
14703 /// ```
14704 pub fn set_create_time<T>(mut self, v: T) -> Self
14705 where
14706 T: std::convert::Into<wkt::Timestamp>,
14707 {
14708 self.create_time = std::option::Option::Some(v.into());
14709 self
14710 }
14711
14712 /// Sets or clears the value of [create_time][crate::model::DnsForwarding::create_time].
14713 ///
14714 /// # Example
14715 /// ```ignore,no_run
14716 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14717 /// use wkt::Timestamp;
14718 /// let x = DnsForwarding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14719 /// let x = DnsForwarding::new().set_or_clear_create_time(None::<Timestamp>);
14720 /// ```
14721 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14722 where
14723 T: std::convert::Into<wkt::Timestamp>,
14724 {
14725 self.create_time = v.map(|x| x.into());
14726 self
14727 }
14728
14729 /// Sets the value of [update_time][crate::model::DnsForwarding::update_time].
14730 ///
14731 /// # Example
14732 /// ```ignore,no_run
14733 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14734 /// use wkt::Timestamp;
14735 /// let x = DnsForwarding::new().set_update_time(Timestamp::default()/* use setters */);
14736 /// ```
14737 pub fn set_update_time<T>(mut self, v: T) -> Self
14738 where
14739 T: std::convert::Into<wkt::Timestamp>,
14740 {
14741 self.update_time = std::option::Option::Some(v.into());
14742 self
14743 }
14744
14745 /// Sets or clears the value of [update_time][crate::model::DnsForwarding::update_time].
14746 ///
14747 /// # Example
14748 /// ```ignore,no_run
14749 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14750 /// use wkt::Timestamp;
14751 /// let x = DnsForwarding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14752 /// let x = DnsForwarding::new().set_or_clear_update_time(None::<Timestamp>);
14753 /// ```
14754 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14755 where
14756 T: std::convert::Into<wkt::Timestamp>,
14757 {
14758 self.update_time = v.map(|x| x.into());
14759 self
14760 }
14761
14762 /// Sets the value of [forwarding_rules][crate::model::DnsForwarding::forwarding_rules].
14763 ///
14764 /// # Example
14765 /// ```ignore,no_run
14766 /// # use google_cloud_vmwareengine_v1::model::DnsForwarding;
14767 /// use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14768 /// let x = DnsForwarding::new()
14769 /// .set_forwarding_rules([
14770 /// ForwardingRule::default()/* use setters */,
14771 /// ForwardingRule::default()/* use (different) setters */,
14772 /// ]);
14773 /// ```
14774 pub fn set_forwarding_rules<T, V>(mut self, v: T) -> Self
14775 where
14776 T: std::iter::IntoIterator<Item = V>,
14777 V: std::convert::Into<crate::model::dns_forwarding::ForwardingRule>,
14778 {
14779 use std::iter::Iterator;
14780 self.forwarding_rules = v.into_iter().map(|i| i.into()).collect();
14781 self
14782 }
14783}
14784
14785impl wkt::message::Message for DnsForwarding {
14786 fn typename() -> &'static str {
14787 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding"
14788 }
14789}
14790
14791/// Defines additional types related to [DnsForwarding].
14792pub mod dns_forwarding {
14793 #[allow(unused_imports)]
14794 use super::*;
14795
14796 /// A forwarding rule is a mapping of a `domain` to `name_servers`.
14797 /// This mapping allows VMware Engine to resolve domains for attached private
14798 /// clouds by forwarding DNS requests for a given domain to the specified
14799 /// nameservers.
14800 #[derive(Clone, Default, PartialEq)]
14801 #[non_exhaustive]
14802 pub struct ForwardingRule {
14803 /// Required. Domain used to resolve a `name_servers` list.
14804 pub domain: std::string::String,
14805
14806 /// Required. List of DNS servers to use for domain resolution
14807 pub name_servers: std::vec::Vec<std::string::String>,
14808
14809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14810 }
14811
14812 impl ForwardingRule {
14813 /// Creates a new default instance.
14814 pub fn new() -> Self {
14815 std::default::Default::default()
14816 }
14817
14818 /// Sets the value of [domain][crate::model::dns_forwarding::ForwardingRule::domain].
14819 ///
14820 /// # Example
14821 /// ```ignore,no_run
14822 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14823 /// let x = ForwardingRule::new().set_domain("example");
14824 /// ```
14825 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14826 self.domain = v.into();
14827 self
14828 }
14829
14830 /// Sets the value of [name_servers][crate::model::dns_forwarding::ForwardingRule::name_servers].
14831 ///
14832 /// # Example
14833 /// ```ignore,no_run
14834 /// # use google_cloud_vmwareengine_v1::model::dns_forwarding::ForwardingRule;
14835 /// let x = ForwardingRule::new().set_name_servers(["a", "b", "c"]);
14836 /// ```
14837 pub fn set_name_servers<T, V>(mut self, v: T) -> Self
14838 where
14839 T: std::iter::IntoIterator<Item = V>,
14840 V: std::convert::Into<std::string::String>,
14841 {
14842 use std::iter::Iterator;
14843 self.name_servers = v.into_iter().map(|i| i.into()).collect();
14844 self
14845 }
14846 }
14847
14848 impl wkt::message::Message for ForwardingRule {
14849 fn typename() -> &'static str {
14850 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule"
14851 }
14852 }
14853}
14854
14855/// Details of a network peering.
14856#[derive(Clone, Default, PartialEq)]
14857#[non_exhaustive]
14858pub struct NetworkPeering {
14859 /// Output only. The resource name of the network peering. NetworkPeering is a
14860 /// global resource and location can only be global. Resource names are
14861 /// scheme-less URIs that follow the conventions in
14862 /// <https://cloud.google.com/apis/design/resource_names>.
14863 /// For example:
14864 /// `projects/my-project/locations/global/networkPeerings/my-peering`
14865 pub name: std::string::String,
14866
14867 /// Output only. Creation time of this resource.
14868 pub create_time: std::option::Option<wkt::Timestamp>,
14869
14870 /// Output only. Last update time of this resource.
14871 pub update_time: std::option::Option<wkt::Timestamp>,
14872
14873 /// Required. The relative resource name of the network to peer with
14874 /// a standard VMware Engine network. The provided network can be a
14875 /// consumer VPC network or another standard VMware Engine network. If the
14876 /// `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form:
14877 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
14878 /// Otherwise specify the name in the form:
14879 /// `projects/{project}/global/networks/{network_id}`, where
14880 /// `{project}` can either be a project number or a project ID.
14881 pub peer_network: std::string::String,
14882
14883 /// Optional. True if custom routes are exported to the peered network;
14884 /// false otherwise. The default value is true.
14885 pub export_custom_routes: std::option::Option<bool>,
14886
14887 /// Optional. True if custom routes are imported from the peered network;
14888 /// false otherwise. The default value is true.
14889 pub import_custom_routes: std::option::Option<bool>,
14890
14891 /// Optional. True if full mesh connectivity is created and managed
14892 /// automatically between peered networks; false otherwise. Currently this
14893 /// field is always true because Google Compute Engine automatically creates
14894 /// and manages subnetwork routes between two VPC networks when peering state
14895 /// is 'ACTIVE'.
14896 pub exchange_subnet_routes: std::option::Option<bool>,
14897
14898 /// Optional. True if all subnet routes with a public IP address range are
14899 /// exported; false otherwise. The default value is true. IPv4 special-use
14900 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14901 /// exported to peers and are not controlled by this field.
14902 pub export_custom_routes_with_public_ip: std::option::Option<bool>,
14903
14904 /// Optional. True if all subnet routes with public IP address range are
14905 /// imported; false otherwise. The default value is true. IPv4 special-use
14906 /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
14907 /// imported to peers and are not controlled by this field.
14908 pub import_custom_routes_with_public_ip: std::option::Option<bool>,
14909
14910 /// Output only. State of the network peering. This field
14911 /// has a value of 'ACTIVE' when there's a matching configuration in the peer
14912 /// network. New values may be added to this enum when appropriate.
14913 pub state: crate::model::network_peering::State,
14914
14915 /// Output only. Output Only. Details about the current state of the network
14916 /// peering.
14917 pub state_details: std::string::String,
14918
14919 /// Optional. Maximum transmission unit (MTU) in bytes.
14920 /// The default value is `1500`. If a value of `0` is provided for this field,
14921 /// VMware Engine uses the default value instead.
14922 pub peer_mtu: i32,
14923
14924 /// Required. The type of the network to peer with the VMware Engine network.
14925 pub peer_network_type: crate::model::network_peering::PeerNetworkType,
14926
14927 /// Output only. System-generated unique identifier for the resource.
14928 pub uid: std::string::String,
14929
14930 /// Required. The relative resource name of the VMware Engine network.
14931 /// Specify the name in the following form:
14932 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
14933 /// where `{project}` can either be a project number or a project ID.
14934 pub vmware_engine_network: std::string::String,
14935
14936 /// Optional. User-provided description for this network peering.
14937 pub description: std::string::String,
14938
14939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14940}
14941
14942impl NetworkPeering {
14943 /// Creates a new default instance.
14944 pub fn new() -> Self {
14945 std::default::Default::default()
14946 }
14947
14948 /// Sets the value of [name][crate::model::NetworkPeering::name].
14949 ///
14950 /// # Example
14951 /// ```ignore,no_run
14952 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14953 /// # let project_id = "project_id";
14954 /// # let location_id = "location_id";
14955 /// # let network_peering_id = "network_peering_id";
14956 /// let x = NetworkPeering::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPeerings/{network_peering_id}"));
14957 /// ```
14958 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14959 self.name = v.into();
14960 self
14961 }
14962
14963 /// Sets the value of [create_time][crate::model::NetworkPeering::create_time].
14964 ///
14965 /// # Example
14966 /// ```ignore,no_run
14967 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14968 /// use wkt::Timestamp;
14969 /// let x = NetworkPeering::new().set_create_time(Timestamp::default()/* use setters */);
14970 /// ```
14971 pub fn set_create_time<T>(mut self, v: T) -> Self
14972 where
14973 T: std::convert::Into<wkt::Timestamp>,
14974 {
14975 self.create_time = std::option::Option::Some(v.into());
14976 self
14977 }
14978
14979 /// Sets or clears the value of [create_time][crate::model::NetworkPeering::create_time].
14980 ///
14981 /// # Example
14982 /// ```ignore,no_run
14983 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
14984 /// use wkt::Timestamp;
14985 /// let x = NetworkPeering::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14986 /// let x = NetworkPeering::new().set_or_clear_create_time(None::<Timestamp>);
14987 /// ```
14988 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14989 where
14990 T: std::convert::Into<wkt::Timestamp>,
14991 {
14992 self.create_time = v.map(|x| x.into());
14993 self
14994 }
14995
14996 /// Sets the value of [update_time][crate::model::NetworkPeering::update_time].
14997 ///
14998 /// # Example
14999 /// ```ignore,no_run
15000 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15001 /// use wkt::Timestamp;
15002 /// let x = NetworkPeering::new().set_update_time(Timestamp::default()/* use setters */);
15003 /// ```
15004 pub fn set_update_time<T>(mut self, v: T) -> Self
15005 where
15006 T: std::convert::Into<wkt::Timestamp>,
15007 {
15008 self.update_time = std::option::Option::Some(v.into());
15009 self
15010 }
15011
15012 /// Sets or clears the value of [update_time][crate::model::NetworkPeering::update_time].
15013 ///
15014 /// # Example
15015 /// ```ignore,no_run
15016 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15017 /// use wkt::Timestamp;
15018 /// let x = NetworkPeering::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15019 /// let x = NetworkPeering::new().set_or_clear_update_time(None::<Timestamp>);
15020 /// ```
15021 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15022 where
15023 T: std::convert::Into<wkt::Timestamp>,
15024 {
15025 self.update_time = v.map(|x| x.into());
15026 self
15027 }
15028
15029 /// Sets the value of [peer_network][crate::model::NetworkPeering::peer_network].
15030 ///
15031 /// # Example
15032 /// ```ignore,no_run
15033 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15034 /// let x = NetworkPeering::new().set_peer_network("example");
15035 /// ```
15036 pub fn set_peer_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15037 self.peer_network = v.into();
15038 self
15039 }
15040
15041 /// Sets the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
15042 ///
15043 /// # Example
15044 /// ```ignore,no_run
15045 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15046 /// let x = NetworkPeering::new().set_export_custom_routes(true);
15047 /// ```
15048 pub fn set_export_custom_routes<T>(mut self, v: T) -> Self
15049 where
15050 T: std::convert::Into<bool>,
15051 {
15052 self.export_custom_routes = std::option::Option::Some(v.into());
15053 self
15054 }
15055
15056 /// Sets or clears the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
15057 ///
15058 /// # Example
15059 /// ```ignore,no_run
15060 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15061 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(Some(false));
15062 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes(None::<bool>);
15063 /// ```
15064 pub fn set_or_clear_export_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
15065 where
15066 T: std::convert::Into<bool>,
15067 {
15068 self.export_custom_routes = v.map(|x| x.into());
15069 self
15070 }
15071
15072 /// Sets the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
15073 ///
15074 /// # Example
15075 /// ```ignore,no_run
15076 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15077 /// let x = NetworkPeering::new().set_import_custom_routes(true);
15078 /// ```
15079 pub fn set_import_custom_routes<T>(mut self, v: T) -> Self
15080 where
15081 T: std::convert::Into<bool>,
15082 {
15083 self.import_custom_routes = std::option::Option::Some(v.into());
15084 self
15085 }
15086
15087 /// Sets or clears the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
15088 ///
15089 /// # Example
15090 /// ```ignore,no_run
15091 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15092 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(Some(false));
15093 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes(None::<bool>);
15094 /// ```
15095 pub fn set_or_clear_import_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
15096 where
15097 T: std::convert::Into<bool>,
15098 {
15099 self.import_custom_routes = v.map(|x| x.into());
15100 self
15101 }
15102
15103 /// Sets the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
15104 ///
15105 /// # Example
15106 /// ```ignore,no_run
15107 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15108 /// let x = NetworkPeering::new().set_exchange_subnet_routes(true);
15109 /// ```
15110 pub fn set_exchange_subnet_routes<T>(mut self, v: T) -> Self
15111 where
15112 T: std::convert::Into<bool>,
15113 {
15114 self.exchange_subnet_routes = std::option::Option::Some(v.into());
15115 self
15116 }
15117
15118 /// Sets or clears the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
15119 ///
15120 /// # Example
15121 /// ```ignore,no_run
15122 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15123 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(Some(false));
15124 /// let x = NetworkPeering::new().set_or_clear_exchange_subnet_routes(None::<bool>);
15125 /// ```
15126 pub fn set_or_clear_exchange_subnet_routes<T>(mut self, v: std::option::Option<T>) -> Self
15127 where
15128 T: std::convert::Into<bool>,
15129 {
15130 self.exchange_subnet_routes = v.map(|x| x.into());
15131 self
15132 }
15133
15134 /// Sets the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
15135 ///
15136 /// # Example
15137 /// ```ignore,no_run
15138 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15139 /// let x = NetworkPeering::new().set_export_custom_routes_with_public_ip(true);
15140 /// ```
15141 pub fn set_export_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
15142 where
15143 T: std::convert::Into<bool>,
15144 {
15145 self.export_custom_routes_with_public_ip = std::option::Option::Some(v.into());
15146 self
15147 }
15148
15149 /// Sets or clears the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
15150 ///
15151 /// # Example
15152 /// ```ignore,no_run
15153 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15154 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(Some(false));
15155 /// let x = NetworkPeering::new().set_or_clear_export_custom_routes_with_public_ip(None::<bool>);
15156 /// ```
15157 pub fn set_or_clear_export_custom_routes_with_public_ip<T>(
15158 mut self,
15159 v: std::option::Option<T>,
15160 ) -> Self
15161 where
15162 T: std::convert::Into<bool>,
15163 {
15164 self.export_custom_routes_with_public_ip = v.map(|x| x.into());
15165 self
15166 }
15167
15168 /// Sets the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
15169 ///
15170 /// # Example
15171 /// ```ignore,no_run
15172 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15173 /// let x = NetworkPeering::new().set_import_custom_routes_with_public_ip(true);
15174 /// ```
15175 pub fn set_import_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
15176 where
15177 T: std::convert::Into<bool>,
15178 {
15179 self.import_custom_routes_with_public_ip = std::option::Option::Some(v.into());
15180 self
15181 }
15182
15183 /// Sets or clears the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15188 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(Some(false));
15189 /// let x = NetworkPeering::new().set_or_clear_import_custom_routes_with_public_ip(None::<bool>);
15190 /// ```
15191 pub fn set_or_clear_import_custom_routes_with_public_ip<T>(
15192 mut self,
15193 v: std::option::Option<T>,
15194 ) -> Self
15195 where
15196 T: std::convert::Into<bool>,
15197 {
15198 self.import_custom_routes_with_public_ip = v.map(|x| x.into());
15199 self
15200 }
15201
15202 /// Sets the value of [state][crate::model::NetworkPeering::state].
15203 ///
15204 /// # Example
15205 /// ```ignore,no_run
15206 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15207 /// use google_cloud_vmwareengine_v1::model::network_peering::State;
15208 /// let x0 = NetworkPeering::new().set_state(State::Inactive);
15209 /// let x1 = NetworkPeering::new().set_state(State::Active);
15210 /// let x2 = NetworkPeering::new().set_state(State::Creating);
15211 /// ```
15212 pub fn set_state<T: std::convert::Into<crate::model::network_peering::State>>(
15213 mut self,
15214 v: T,
15215 ) -> Self {
15216 self.state = v.into();
15217 self
15218 }
15219
15220 /// Sets the value of [state_details][crate::model::NetworkPeering::state_details].
15221 ///
15222 /// # Example
15223 /// ```ignore,no_run
15224 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15225 /// let x = NetworkPeering::new().set_state_details("example");
15226 /// ```
15227 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15228 self.state_details = v.into();
15229 self
15230 }
15231
15232 /// Sets the value of [peer_mtu][crate::model::NetworkPeering::peer_mtu].
15233 ///
15234 /// # Example
15235 /// ```ignore,no_run
15236 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15237 /// let x = NetworkPeering::new().set_peer_mtu(42);
15238 /// ```
15239 pub fn set_peer_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15240 self.peer_mtu = v.into();
15241 self
15242 }
15243
15244 /// Sets the value of [peer_network_type][crate::model::NetworkPeering::peer_network_type].
15245 ///
15246 /// # Example
15247 /// ```ignore,no_run
15248 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15249 /// use google_cloud_vmwareengine_v1::model::network_peering::PeerNetworkType;
15250 /// let x0 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::Standard);
15251 /// let x1 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::VmwareEngineNetwork);
15252 /// let x2 = NetworkPeering::new().set_peer_network_type(PeerNetworkType::PrivateServicesAccess);
15253 /// ```
15254 pub fn set_peer_network_type<
15255 T: std::convert::Into<crate::model::network_peering::PeerNetworkType>,
15256 >(
15257 mut self,
15258 v: T,
15259 ) -> Self {
15260 self.peer_network_type = v.into();
15261 self
15262 }
15263
15264 /// Sets the value of [uid][crate::model::NetworkPeering::uid].
15265 ///
15266 /// # Example
15267 /// ```ignore,no_run
15268 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15269 /// let x = NetworkPeering::new().set_uid("example");
15270 /// ```
15271 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15272 self.uid = v.into();
15273 self
15274 }
15275
15276 /// Sets the value of [vmware_engine_network][crate::model::NetworkPeering::vmware_engine_network].
15277 ///
15278 /// # Example
15279 /// ```ignore,no_run
15280 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15281 /// # let project_id = "project_id";
15282 /// # let location_id = "location_id";
15283 /// # let vmware_engine_network_id = "vmware_engine_network_id";
15284 /// let x = NetworkPeering::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
15285 /// ```
15286 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
15287 mut self,
15288 v: T,
15289 ) -> Self {
15290 self.vmware_engine_network = v.into();
15291 self
15292 }
15293
15294 /// Sets the value of [description][crate::model::NetworkPeering::description].
15295 ///
15296 /// # Example
15297 /// ```ignore,no_run
15298 /// # use google_cloud_vmwareengine_v1::model::NetworkPeering;
15299 /// let x = NetworkPeering::new().set_description("example");
15300 /// ```
15301 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15302 self.description = v.into();
15303 self
15304 }
15305}
15306
15307impl wkt::message::Message for NetworkPeering {
15308 fn typename() -> &'static str {
15309 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPeering"
15310 }
15311}
15312
15313/// Defines additional types related to [NetworkPeering].
15314pub mod network_peering {
15315 #[allow(unused_imports)]
15316 use super::*;
15317
15318 /// Possible states of a network peering.
15319 ///
15320 /// # Working with unknown values
15321 ///
15322 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15323 /// additional enum variants at any time. Adding new variants is not considered
15324 /// a breaking change. Applications should write their code in anticipation of:
15325 ///
15326 /// - New values appearing in future releases of the client library, **and**
15327 /// - New values received dynamically, without application changes.
15328 ///
15329 /// Please consult the [Working with enums] section in the user guide for some
15330 /// guidelines.
15331 ///
15332 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15333 #[derive(Clone, Debug, PartialEq)]
15334 #[non_exhaustive]
15335 pub enum State {
15336 /// Unspecified network peering state. This is the default value.
15337 Unspecified,
15338 /// The peering is not active.
15339 Inactive,
15340 /// The peering is active.
15341 Active,
15342 /// The peering is being created.
15343 Creating,
15344 /// The peering is being deleted.
15345 Deleting,
15346 /// If set, the enum was initialized with an unknown value.
15347 ///
15348 /// Applications can examine the value using [State::value] or
15349 /// [State::name].
15350 UnknownValue(state::UnknownValue),
15351 }
15352
15353 #[doc(hidden)]
15354 pub mod state {
15355 #[allow(unused_imports)]
15356 use super::*;
15357 #[derive(Clone, Debug, PartialEq)]
15358 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15359 }
15360
15361 impl State {
15362 /// Gets the enum value.
15363 ///
15364 /// Returns `None` if the enum contains an unknown value deserialized from
15365 /// the string representation of enums.
15366 pub fn value(&self) -> std::option::Option<i32> {
15367 match self {
15368 Self::Unspecified => std::option::Option::Some(0),
15369 Self::Inactive => std::option::Option::Some(1),
15370 Self::Active => std::option::Option::Some(2),
15371 Self::Creating => std::option::Option::Some(3),
15372 Self::Deleting => std::option::Option::Some(4),
15373 Self::UnknownValue(u) => u.0.value(),
15374 }
15375 }
15376
15377 /// Gets the enum value as a string.
15378 ///
15379 /// Returns `None` if the enum contains an unknown value deserialized from
15380 /// the integer representation of enums.
15381 pub fn name(&self) -> std::option::Option<&str> {
15382 match self {
15383 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15384 Self::Inactive => std::option::Option::Some("INACTIVE"),
15385 Self::Active => std::option::Option::Some("ACTIVE"),
15386 Self::Creating => std::option::Option::Some("CREATING"),
15387 Self::Deleting => std::option::Option::Some("DELETING"),
15388 Self::UnknownValue(u) => u.0.name(),
15389 }
15390 }
15391 }
15392
15393 impl std::default::Default for State {
15394 fn default() -> Self {
15395 use std::convert::From;
15396 Self::from(0)
15397 }
15398 }
15399
15400 impl std::fmt::Display for State {
15401 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15402 wkt::internal::display_enum(f, self.name(), self.value())
15403 }
15404 }
15405
15406 impl std::convert::From<i32> for State {
15407 fn from(value: i32) -> Self {
15408 match value {
15409 0 => Self::Unspecified,
15410 1 => Self::Inactive,
15411 2 => Self::Active,
15412 3 => Self::Creating,
15413 4 => Self::Deleting,
15414 _ => Self::UnknownValue(state::UnknownValue(
15415 wkt::internal::UnknownEnumValue::Integer(value),
15416 )),
15417 }
15418 }
15419 }
15420
15421 impl std::convert::From<&str> for State {
15422 fn from(value: &str) -> Self {
15423 use std::string::ToString;
15424 match value {
15425 "STATE_UNSPECIFIED" => Self::Unspecified,
15426 "INACTIVE" => Self::Inactive,
15427 "ACTIVE" => Self::Active,
15428 "CREATING" => Self::Creating,
15429 "DELETING" => Self::Deleting,
15430 _ => Self::UnknownValue(state::UnknownValue(
15431 wkt::internal::UnknownEnumValue::String(value.to_string()),
15432 )),
15433 }
15434 }
15435 }
15436
15437 impl serde::ser::Serialize for State {
15438 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15439 where
15440 S: serde::Serializer,
15441 {
15442 match self {
15443 Self::Unspecified => serializer.serialize_i32(0),
15444 Self::Inactive => serializer.serialize_i32(1),
15445 Self::Active => serializer.serialize_i32(2),
15446 Self::Creating => serializer.serialize_i32(3),
15447 Self::Deleting => serializer.serialize_i32(4),
15448 Self::UnknownValue(u) => u.0.serialize(serializer),
15449 }
15450 }
15451 }
15452
15453 impl<'de> serde::de::Deserialize<'de> for State {
15454 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15455 where
15456 D: serde::Deserializer<'de>,
15457 {
15458 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15459 ".google.cloud.vmwareengine.v1.NetworkPeering.State",
15460 ))
15461 }
15462 }
15463
15464 /// Type or purpose of the network peering connection.
15465 ///
15466 /// # Working with unknown values
15467 ///
15468 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15469 /// additional enum variants at any time. Adding new variants is not considered
15470 /// a breaking change. Applications should write their code in anticipation of:
15471 ///
15472 /// - New values appearing in future releases of the client library, **and**
15473 /// - New values received dynamically, without application changes.
15474 ///
15475 /// Please consult the [Working with enums] section in the user guide for some
15476 /// guidelines.
15477 ///
15478 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15479 #[derive(Clone, Debug, PartialEq)]
15480 #[non_exhaustive]
15481 pub enum PeerNetworkType {
15482 /// Unspecified
15483 Unspecified,
15484 /// Peering connection used for connecting to another VPC network established
15485 /// by the same user. For example, a peering connection to another VPC
15486 /// network in the same project or to an on-premises network.
15487 Standard,
15488 /// Peering connection used for connecting to another VMware Engine network.
15489 VmwareEngineNetwork,
15490 /// Peering connection used for establishing [private services
15491 /// access](https://cloud.google.com/vpc/docs/private-services-access).
15492 PrivateServicesAccess,
15493 /// Peering connection used for connecting to NetApp Cloud Volumes.
15494 NetappCloudVolumes,
15495 /// Peering connection used for connecting to third-party services. Most
15496 /// third-party services require manual setup of reverse peering on the VPC
15497 /// network associated with the third-party service.
15498 ThirdPartyService,
15499 /// Peering connection used for connecting to Dell PowerScale Filers
15500 DellPowerscale,
15501 /// Peering connection used for connecting to Google Cloud NetApp Volumes.
15502 GoogleCloudNetappVolumes,
15503 /// If set, the enum was initialized with an unknown value.
15504 ///
15505 /// Applications can examine the value using [PeerNetworkType::value] or
15506 /// [PeerNetworkType::name].
15507 UnknownValue(peer_network_type::UnknownValue),
15508 }
15509
15510 #[doc(hidden)]
15511 pub mod peer_network_type {
15512 #[allow(unused_imports)]
15513 use super::*;
15514 #[derive(Clone, Debug, PartialEq)]
15515 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15516 }
15517
15518 impl PeerNetworkType {
15519 /// Gets the enum value.
15520 ///
15521 /// Returns `None` if the enum contains an unknown value deserialized from
15522 /// the string representation of enums.
15523 pub fn value(&self) -> std::option::Option<i32> {
15524 match self {
15525 Self::Unspecified => std::option::Option::Some(0),
15526 Self::Standard => std::option::Option::Some(1),
15527 Self::VmwareEngineNetwork => std::option::Option::Some(2),
15528 Self::PrivateServicesAccess => std::option::Option::Some(3),
15529 Self::NetappCloudVolumes => std::option::Option::Some(4),
15530 Self::ThirdPartyService => std::option::Option::Some(5),
15531 Self::DellPowerscale => std::option::Option::Some(6),
15532 Self::GoogleCloudNetappVolumes => std::option::Option::Some(7),
15533 Self::UnknownValue(u) => u.0.value(),
15534 }
15535 }
15536
15537 /// Gets the enum value as a string.
15538 ///
15539 /// Returns `None` if the enum contains an unknown value deserialized from
15540 /// the integer representation of enums.
15541 pub fn name(&self) -> std::option::Option<&str> {
15542 match self {
15543 Self::Unspecified => std::option::Option::Some("PEER_NETWORK_TYPE_UNSPECIFIED"),
15544 Self::Standard => std::option::Option::Some("STANDARD"),
15545 Self::VmwareEngineNetwork => std::option::Option::Some("VMWARE_ENGINE_NETWORK"),
15546 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
15547 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
15548 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
15549 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
15550 Self::GoogleCloudNetappVolumes => {
15551 std::option::Option::Some("GOOGLE_CLOUD_NETAPP_VOLUMES")
15552 }
15553 Self::UnknownValue(u) => u.0.name(),
15554 }
15555 }
15556 }
15557
15558 impl std::default::Default for PeerNetworkType {
15559 fn default() -> Self {
15560 use std::convert::From;
15561 Self::from(0)
15562 }
15563 }
15564
15565 impl std::fmt::Display for PeerNetworkType {
15566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15567 wkt::internal::display_enum(f, self.name(), self.value())
15568 }
15569 }
15570
15571 impl std::convert::From<i32> for PeerNetworkType {
15572 fn from(value: i32) -> Self {
15573 match value {
15574 0 => Self::Unspecified,
15575 1 => Self::Standard,
15576 2 => Self::VmwareEngineNetwork,
15577 3 => Self::PrivateServicesAccess,
15578 4 => Self::NetappCloudVolumes,
15579 5 => Self::ThirdPartyService,
15580 6 => Self::DellPowerscale,
15581 7 => Self::GoogleCloudNetappVolumes,
15582 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15583 wkt::internal::UnknownEnumValue::Integer(value),
15584 )),
15585 }
15586 }
15587 }
15588
15589 impl std::convert::From<&str> for PeerNetworkType {
15590 fn from(value: &str) -> Self {
15591 use std::string::ToString;
15592 match value {
15593 "PEER_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
15594 "STANDARD" => Self::Standard,
15595 "VMWARE_ENGINE_NETWORK" => Self::VmwareEngineNetwork,
15596 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
15597 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
15598 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
15599 "DELL_POWERSCALE" => Self::DellPowerscale,
15600 "GOOGLE_CLOUD_NETAPP_VOLUMES" => Self::GoogleCloudNetappVolumes,
15601 _ => Self::UnknownValue(peer_network_type::UnknownValue(
15602 wkt::internal::UnknownEnumValue::String(value.to_string()),
15603 )),
15604 }
15605 }
15606 }
15607
15608 impl serde::ser::Serialize for PeerNetworkType {
15609 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15610 where
15611 S: serde::Serializer,
15612 {
15613 match self {
15614 Self::Unspecified => serializer.serialize_i32(0),
15615 Self::Standard => serializer.serialize_i32(1),
15616 Self::VmwareEngineNetwork => serializer.serialize_i32(2),
15617 Self::PrivateServicesAccess => serializer.serialize_i32(3),
15618 Self::NetappCloudVolumes => serializer.serialize_i32(4),
15619 Self::ThirdPartyService => serializer.serialize_i32(5),
15620 Self::DellPowerscale => serializer.serialize_i32(6),
15621 Self::GoogleCloudNetappVolumes => serializer.serialize_i32(7),
15622 Self::UnknownValue(u) => u.0.serialize(serializer),
15623 }
15624 }
15625 }
15626
15627 impl<'de> serde::de::Deserialize<'de> for PeerNetworkType {
15628 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15629 where
15630 D: serde::Deserializer<'de>,
15631 {
15632 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeerNetworkType>::new(
15633 ".google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType",
15634 ))
15635 }
15636 }
15637}
15638
15639/// Exchanged network peering route.
15640#[derive(Clone, Default, PartialEq)]
15641#[non_exhaustive]
15642pub struct PeeringRoute {
15643 /// Output only. Destination range of the peering route in CIDR notation.
15644 pub dest_range: std::string::String,
15645
15646 /// Output only. Type of the route in the peer VPC network.
15647 pub r#type: crate::model::peering_route::Type,
15648
15649 /// Output only. Region containing the next hop of the peering route. This
15650 /// field only applies to dynamic routes in the peer VPC network.
15651 pub next_hop_region: std::string::String,
15652
15653 /// Output only. The priority of the peering route.
15654 pub priority: i64,
15655
15656 /// Output only. True if the peering route has been imported from a peered
15657 /// VPC network; false otherwise. The import happens if the field
15658 /// `NetworkPeering.importCustomRoutes` is true for this network,
15659 /// `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
15660 /// the import does not result in a route conflict.
15661 pub imported: bool,
15662
15663 /// Output only. Direction of the routes exchanged with the peer network, from
15664 /// the VMware Engine network perspective:
15665 ///
15666 /// * Routes of direction `INCOMING` are imported from the peer network.
15667 /// * Routes of direction `OUTGOING` are exported from the intranet VPC network
15668 /// of the VMware Engine network.
15669 pub direction: crate::model::peering_route::Direction,
15670
15671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15672}
15673
15674impl PeeringRoute {
15675 /// Creates a new default instance.
15676 pub fn new() -> Self {
15677 std::default::Default::default()
15678 }
15679
15680 /// Sets the value of [dest_range][crate::model::PeeringRoute::dest_range].
15681 ///
15682 /// # Example
15683 /// ```ignore,no_run
15684 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15685 /// let x = PeeringRoute::new().set_dest_range("example");
15686 /// ```
15687 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15688 self.dest_range = v.into();
15689 self
15690 }
15691
15692 /// Sets the value of [r#type][crate::model::PeeringRoute::type].
15693 ///
15694 /// # Example
15695 /// ```ignore,no_run
15696 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15697 /// use google_cloud_vmwareengine_v1::model::peering_route::Type;
15698 /// let x0 = PeeringRoute::new().set_type(Type::DynamicPeeringRoute);
15699 /// let x1 = PeeringRoute::new().set_type(Type::StaticPeeringRoute);
15700 /// let x2 = PeeringRoute::new().set_type(Type::SubnetPeeringRoute);
15701 /// ```
15702 pub fn set_type<T: std::convert::Into<crate::model::peering_route::Type>>(
15703 mut self,
15704 v: T,
15705 ) -> Self {
15706 self.r#type = v.into();
15707 self
15708 }
15709
15710 /// Sets the value of [next_hop_region][crate::model::PeeringRoute::next_hop_region].
15711 ///
15712 /// # Example
15713 /// ```ignore,no_run
15714 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15715 /// let x = PeeringRoute::new().set_next_hop_region("example");
15716 /// ```
15717 pub fn set_next_hop_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15718 self.next_hop_region = v.into();
15719 self
15720 }
15721
15722 /// Sets the value of [priority][crate::model::PeeringRoute::priority].
15723 ///
15724 /// # Example
15725 /// ```ignore,no_run
15726 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15727 /// let x = PeeringRoute::new().set_priority(42);
15728 /// ```
15729 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15730 self.priority = v.into();
15731 self
15732 }
15733
15734 /// Sets the value of [imported][crate::model::PeeringRoute::imported].
15735 ///
15736 /// # Example
15737 /// ```ignore,no_run
15738 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15739 /// let x = PeeringRoute::new().set_imported(true);
15740 /// ```
15741 pub fn set_imported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15742 self.imported = v.into();
15743 self
15744 }
15745
15746 /// Sets the value of [direction][crate::model::PeeringRoute::direction].
15747 ///
15748 /// # Example
15749 /// ```ignore,no_run
15750 /// # use google_cloud_vmwareengine_v1::model::PeeringRoute;
15751 /// use google_cloud_vmwareengine_v1::model::peering_route::Direction;
15752 /// let x0 = PeeringRoute::new().set_direction(Direction::Incoming);
15753 /// let x1 = PeeringRoute::new().set_direction(Direction::Outgoing);
15754 /// ```
15755 pub fn set_direction<T: std::convert::Into<crate::model::peering_route::Direction>>(
15756 mut self,
15757 v: T,
15758 ) -> Self {
15759 self.direction = v.into();
15760 self
15761 }
15762}
15763
15764impl wkt::message::Message for PeeringRoute {
15765 fn typename() -> &'static str {
15766 "type.googleapis.com/google.cloud.vmwareengine.v1.PeeringRoute"
15767 }
15768}
15769
15770/// Defines additional types related to [PeeringRoute].
15771pub mod peering_route {
15772 #[allow(unused_imports)]
15773 use super::*;
15774
15775 /// The type of the peering route.
15776 ///
15777 /// # Working with unknown values
15778 ///
15779 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15780 /// additional enum variants at any time. Adding new variants is not considered
15781 /// a breaking change. Applications should write their code in anticipation of:
15782 ///
15783 /// - New values appearing in future releases of the client library, **and**
15784 /// - New values received dynamically, without application changes.
15785 ///
15786 /// Please consult the [Working with enums] section in the user guide for some
15787 /// guidelines.
15788 ///
15789 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15790 #[derive(Clone, Debug, PartialEq)]
15791 #[non_exhaustive]
15792 pub enum Type {
15793 /// Unspecified peering route type. This is the default value.
15794 Unspecified,
15795 /// Dynamic routes in the peer network.
15796 DynamicPeeringRoute,
15797 /// Static routes in the peer network.
15798 StaticPeeringRoute,
15799 /// Created, updated, and removed automatically by Google Cloud when subnets
15800 /// are created, modified, or deleted in the peer network.
15801 SubnetPeeringRoute,
15802 /// If set, the enum was initialized with an unknown value.
15803 ///
15804 /// Applications can examine the value using [Type::value] or
15805 /// [Type::name].
15806 UnknownValue(r#type::UnknownValue),
15807 }
15808
15809 #[doc(hidden)]
15810 pub mod r#type {
15811 #[allow(unused_imports)]
15812 use super::*;
15813 #[derive(Clone, Debug, PartialEq)]
15814 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15815 }
15816
15817 impl Type {
15818 /// Gets the enum value.
15819 ///
15820 /// Returns `None` if the enum contains an unknown value deserialized from
15821 /// the string representation of enums.
15822 pub fn value(&self) -> std::option::Option<i32> {
15823 match self {
15824 Self::Unspecified => std::option::Option::Some(0),
15825 Self::DynamicPeeringRoute => std::option::Option::Some(1),
15826 Self::StaticPeeringRoute => std::option::Option::Some(2),
15827 Self::SubnetPeeringRoute => std::option::Option::Some(3),
15828 Self::UnknownValue(u) => u.0.value(),
15829 }
15830 }
15831
15832 /// Gets the enum value as a string.
15833 ///
15834 /// Returns `None` if the enum contains an unknown value deserialized from
15835 /// the integer representation of enums.
15836 pub fn name(&self) -> std::option::Option<&str> {
15837 match self {
15838 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15839 Self::DynamicPeeringRoute => std::option::Option::Some("DYNAMIC_PEERING_ROUTE"),
15840 Self::StaticPeeringRoute => std::option::Option::Some("STATIC_PEERING_ROUTE"),
15841 Self::SubnetPeeringRoute => std::option::Option::Some("SUBNET_PEERING_ROUTE"),
15842 Self::UnknownValue(u) => u.0.name(),
15843 }
15844 }
15845 }
15846
15847 impl std::default::Default for Type {
15848 fn default() -> Self {
15849 use std::convert::From;
15850 Self::from(0)
15851 }
15852 }
15853
15854 impl std::fmt::Display for Type {
15855 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15856 wkt::internal::display_enum(f, self.name(), self.value())
15857 }
15858 }
15859
15860 impl std::convert::From<i32> for Type {
15861 fn from(value: i32) -> Self {
15862 match value {
15863 0 => Self::Unspecified,
15864 1 => Self::DynamicPeeringRoute,
15865 2 => Self::StaticPeeringRoute,
15866 3 => Self::SubnetPeeringRoute,
15867 _ => Self::UnknownValue(r#type::UnknownValue(
15868 wkt::internal::UnknownEnumValue::Integer(value),
15869 )),
15870 }
15871 }
15872 }
15873
15874 impl std::convert::From<&str> for Type {
15875 fn from(value: &str) -> Self {
15876 use std::string::ToString;
15877 match value {
15878 "TYPE_UNSPECIFIED" => Self::Unspecified,
15879 "DYNAMIC_PEERING_ROUTE" => Self::DynamicPeeringRoute,
15880 "STATIC_PEERING_ROUTE" => Self::StaticPeeringRoute,
15881 "SUBNET_PEERING_ROUTE" => Self::SubnetPeeringRoute,
15882 _ => Self::UnknownValue(r#type::UnknownValue(
15883 wkt::internal::UnknownEnumValue::String(value.to_string()),
15884 )),
15885 }
15886 }
15887 }
15888
15889 impl serde::ser::Serialize for Type {
15890 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15891 where
15892 S: serde::Serializer,
15893 {
15894 match self {
15895 Self::Unspecified => serializer.serialize_i32(0),
15896 Self::DynamicPeeringRoute => serializer.serialize_i32(1),
15897 Self::StaticPeeringRoute => serializer.serialize_i32(2),
15898 Self::SubnetPeeringRoute => serializer.serialize_i32(3),
15899 Self::UnknownValue(u) => u.0.serialize(serializer),
15900 }
15901 }
15902 }
15903
15904 impl<'de> serde::de::Deserialize<'de> for Type {
15905 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15906 where
15907 D: serde::Deserializer<'de>,
15908 {
15909 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15910 ".google.cloud.vmwareengine.v1.PeeringRoute.Type",
15911 ))
15912 }
15913 }
15914
15915 /// The direction of the exchanged routes.
15916 ///
15917 /// # Working with unknown values
15918 ///
15919 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15920 /// additional enum variants at any time. Adding new variants is not considered
15921 /// a breaking change. Applications should write their code in anticipation of:
15922 ///
15923 /// - New values appearing in future releases of the client library, **and**
15924 /// - New values received dynamically, without application changes.
15925 ///
15926 /// Please consult the [Working with enums] section in the user guide for some
15927 /// guidelines.
15928 ///
15929 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15930 #[derive(Clone, Debug, PartialEq)]
15931 #[non_exhaustive]
15932 pub enum Direction {
15933 /// Unspecified exchanged routes direction. This is default.
15934 Unspecified,
15935 /// Routes imported from the peer network.
15936 Incoming,
15937 /// Routes exported to the peer network.
15938 Outgoing,
15939 /// If set, the enum was initialized with an unknown value.
15940 ///
15941 /// Applications can examine the value using [Direction::value] or
15942 /// [Direction::name].
15943 UnknownValue(direction::UnknownValue),
15944 }
15945
15946 #[doc(hidden)]
15947 pub mod direction {
15948 #[allow(unused_imports)]
15949 use super::*;
15950 #[derive(Clone, Debug, PartialEq)]
15951 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15952 }
15953
15954 impl Direction {
15955 /// Gets the enum value.
15956 ///
15957 /// Returns `None` if the enum contains an unknown value deserialized from
15958 /// the string representation of enums.
15959 pub fn value(&self) -> std::option::Option<i32> {
15960 match self {
15961 Self::Unspecified => std::option::Option::Some(0),
15962 Self::Incoming => std::option::Option::Some(1),
15963 Self::Outgoing => std::option::Option::Some(2),
15964 Self::UnknownValue(u) => u.0.value(),
15965 }
15966 }
15967
15968 /// Gets the enum value as a string.
15969 ///
15970 /// Returns `None` if the enum contains an unknown value deserialized from
15971 /// the integer representation of enums.
15972 pub fn name(&self) -> std::option::Option<&str> {
15973 match self {
15974 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
15975 Self::Incoming => std::option::Option::Some("INCOMING"),
15976 Self::Outgoing => std::option::Option::Some("OUTGOING"),
15977 Self::UnknownValue(u) => u.0.name(),
15978 }
15979 }
15980 }
15981
15982 impl std::default::Default for Direction {
15983 fn default() -> Self {
15984 use std::convert::From;
15985 Self::from(0)
15986 }
15987 }
15988
15989 impl std::fmt::Display for Direction {
15990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15991 wkt::internal::display_enum(f, self.name(), self.value())
15992 }
15993 }
15994
15995 impl std::convert::From<i32> for Direction {
15996 fn from(value: i32) -> Self {
15997 match value {
15998 0 => Self::Unspecified,
15999 1 => Self::Incoming,
16000 2 => Self::Outgoing,
16001 _ => Self::UnknownValue(direction::UnknownValue(
16002 wkt::internal::UnknownEnumValue::Integer(value),
16003 )),
16004 }
16005 }
16006 }
16007
16008 impl std::convert::From<&str> for Direction {
16009 fn from(value: &str) -> Self {
16010 use std::string::ToString;
16011 match value {
16012 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
16013 "INCOMING" => Self::Incoming,
16014 "OUTGOING" => Self::Outgoing,
16015 _ => Self::UnknownValue(direction::UnknownValue(
16016 wkt::internal::UnknownEnumValue::String(value.to_string()),
16017 )),
16018 }
16019 }
16020 }
16021
16022 impl serde::ser::Serialize for Direction {
16023 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16024 where
16025 S: serde::Serializer,
16026 {
16027 match self {
16028 Self::Unspecified => serializer.serialize_i32(0),
16029 Self::Incoming => serializer.serialize_i32(1),
16030 Self::Outgoing => serializer.serialize_i32(2),
16031 Self::UnknownValue(u) => u.0.serialize(serializer),
16032 }
16033 }
16034 }
16035
16036 impl<'de> serde::de::Deserialize<'de> for Direction {
16037 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16038 where
16039 D: serde::Deserializer<'de>,
16040 {
16041 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
16042 ".google.cloud.vmwareengine.v1.PeeringRoute.Direction",
16043 ))
16044 }
16045 }
16046}
16047
16048/// Represents a network policy resource. Network policies are regional
16049/// resources. You can use a network policy to enable or disable internet access
16050/// and external IP access. Network policies are associated with a VMware Engine
16051/// network, which might span across regions. For a given region, a network
16052/// policy applies to all private clouds in the VMware Engine network associated
16053/// with the policy.
16054#[derive(Clone, Default, PartialEq)]
16055#[non_exhaustive]
16056pub struct NetworkPolicy {
16057 /// Output only. The resource name of this network policy.
16058 /// Resource names are schemeless URIs that follow the conventions in
16059 /// <https://cloud.google.com/apis/design/resource_names>.
16060 /// For example:
16061 /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
16062 pub name: std::string::String,
16063
16064 /// Output only. Creation time of this resource.
16065 pub create_time: std::option::Option<wkt::Timestamp>,
16066
16067 /// Output only. Last update time of this resource.
16068 pub update_time: std::option::Option<wkt::Timestamp>,
16069
16070 /// Network service that allows VMware workloads to access the internet.
16071 pub internet_access: std::option::Option<crate::model::network_policy::NetworkService>,
16072
16073 /// Network service that allows External IP addresses to be assigned to VMware
16074 /// workloads. This service can only be enabled when `internet_access` is also
16075 /// enabled.
16076 pub external_ip: std::option::Option<crate::model::network_policy::NetworkService>,
16077
16078 /// Required. IP address range in CIDR notation used to create internet access
16079 /// and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
16080 /// required. The range cannot overlap with any prefixes either in the consumer
16081 /// VPC network or in use by the private clouds attached to that VPC network.
16082 pub edge_services_cidr: std::string::String,
16083
16084 /// Output only. System-generated unique identifier for the resource.
16085 pub uid: std::string::String,
16086
16087 /// Optional. The relative resource name of the VMware Engine network.
16088 /// Specify the name in the following form:
16089 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
16090 /// where `{project}` can either be a project number or a project ID.
16091 pub vmware_engine_network: std::string::String,
16092
16093 /// Optional. User-provided description for this network policy.
16094 pub description: std::string::String,
16095
16096 /// Output only. The canonical name of the VMware Engine network in the form:
16097 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
16098 pub vmware_engine_network_canonical: std::string::String,
16099
16100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16101}
16102
16103impl NetworkPolicy {
16104 /// Creates a new default instance.
16105 pub fn new() -> Self {
16106 std::default::Default::default()
16107 }
16108
16109 /// Sets the value of [name][crate::model::NetworkPolicy::name].
16110 ///
16111 /// # Example
16112 /// ```ignore,no_run
16113 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16114 /// # let project_id = "project_id";
16115 /// # let location_id = "location_id";
16116 /// # let network_policy_id = "network_policy_id";
16117 /// let x = NetworkPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/networkPolicies/{network_policy_id}"));
16118 /// ```
16119 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16120 self.name = v.into();
16121 self
16122 }
16123
16124 /// Sets the value of [create_time][crate::model::NetworkPolicy::create_time].
16125 ///
16126 /// # Example
16127 /// ```ignore,no_run
16128 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16129 /// use wkt::Timestamp;
16130 /// let x = NetworkPolicy::new().set_create_time(Timestamp::default()/* use setters */);
16131 /// ```
16132 pub fn set_create_time<T>(mut self, v: T) -> Self
16133 where
16134 T: std::convert::Into<wkt::Timestamp>,
16135 {
16136 self.create_time = std::option::Option::Some(v.into());
16137 self
16138 }
16139
16140 /// Sets or clears the value of [create_time][crate::model::NetworkPolicy::create_time].
16141 ///
16142 /// # Example
16143 /// ```ignore,no_run
16144 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16145 /// use wkt::Timestamp;
16146 /// let x = NetworkPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16147 /// let x = NetworkPolicy::new().set_or_clear_create_time(None::<Timestamp>);
16148 /// ```
16149 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16150 where
16151 T: std::convert::Into<wkt::Timestamp>,
16152 {
16153 self.create_time = v.map(|x| x.into());
16154 self
16155 }
16156
16157 /// Sets the value of [update_time][crate::model::NetworkPolicy::update_time].
16158 ///
16159 /// # Example
16160 /// ```ignore,no_run
16161 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16162 /// use wkt::Timestamp;
16163 /// let x = NetworkPolicy::new().set_update_time(Timestamp::default()/* use setters */);
16164 /// ```
16165 pub fn set_update_time<T>(mut self, v: T) -> Self
16166 where
16167 T: std::convert::Into<wkt::Timestamp>,
16168 {
16169 self.update_time = std::option::Option::Some(v.into());
16170 self
16171 }
16172
16173 /// Sets or clears the value of [update_time][crate::model::NetworkPolicy::update_time].
16174 ///
16175 /// # Example
16176 /// ```ignore,no_run
16177 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16178 /// use wkt::Timestamp;
16179 /// let x = NetworkPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16180 /// let x = NetworkPolicy::new().set_or_clear_update_time(None::<Timestamp>);
16181 /// ```
16182 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16183 where
16184 T: std::convert::Into<wkt::Timestamp>,
16185 {
16186 self.update_time = v.map(|x| x.into());
16187 self
16188 }
16189
16190 /// Sets the value of [internet_access][crate::model::NetworkPolicy::internet_access].
16191 ///
16192 /// # Example
16193 /// ```ignore,no_run
16194 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16195 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16196 /// let x = NetworkPolicy::new().set_internet_access(NetworkService::default()/* use setters */);
16197 /// ```
16198 pub fn set_internet_access<T>(mut self, v: T) -> Self
16199 where
16200 T: std::convert::Into<crate::model::network_policy::NetworkService>,
16201 {
16202 self.internet_access = std::option::Option::Some(v.into());
16203 self
16204 }
16205
16206 /// Sets or clears the value of [internet_access][crate::model::NetworkPolicy::internet_access].
16207 ///
16208 /// # Example
16209 /// ```ignore,no_run
16210 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16211 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16212 /// let x = NetworkPolicy::new().set_or_clear_internet_access(Some(NetworkService::default()/* use setters */));
16213 /// let x = NetworkPolicy::new().set_or_clear_internet_access(None::<NetworkService>);
16214 /// ```
16215 pub fn set_or_clear_internet_access<T>(mut self, v: std::option::Option<T>) -> Self
16216 where
16217 T: std::convert::Into<crate::model::network_policy::NetworkService>,
16218 {
16219 self.internet_access = v.map(|x| x.into());
16220 self
16221 }
16222
16223 /// Sets the value of [external_ip][crate::model::NetworkPolicy::external_ip].
16224 ///
16225 /// # Example
16226 /// ```ignore,no_run
16227 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16228 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16229 /// let x = NetworkPolicy::new().set_external_ip(NetworkService::default()/* use setters */);
16230 /// ```
16231 pub fn set_external_ip<T>(mut self, v: T) -> Self
16232 where
16233 T: std::convert::Into<crate::model::network_policy::NetworkService>,
16234 {
16235 self.external_ip = std::option::Option::Some(v.into());
16236 self
16237 }
16238
16239 /// Sets or clears the value of [external_ip][crate::model::NetworkPolicy::external_ip].
16240 ///
16241 /// # Example
16242 /// ```ignore,no_run
16243 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16244 /// use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16245 /// let x = NetworkPolicy::new().set_or_clear_external_ip(Some(NetworkService::default()/* use setters */));
16246 /// let x = NetworkPolicy::new().set_or_clear_external_ip(None::<NetworkService>);
16247 /// ```
16248 pub fn set_or_clear_external_ip<T>(mut self, v: std::option::Option<T>) -> Self
16249 where
16250 T: std::convert::Into<crate::model::network_policy::NetworkService>,
16251 {
16252 self.external_ip = v.map(|x| x.into());
16253 self
16254 }
16255
16256 /// Sets the value of [edge_services_cidr][crate::model::NetworkPolicy::edge_services_cidr].
16257 ///
16258 /// # Example
16259 /// ```ignore,no_run
16260 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16261 /// let x = NetworkPolicy::new().set_edge_services_cidr("example");
16262 /// ```
16263 pub fn set_edge_services_cidr<T: std::convert::Into<std::string::String>>(
16264 mut self,
16265 v: T,
16266 ) -> Self {
16267 self.edge_services_cidr = v.into();
16268 self
16269 }
16270
16271 /// Sets the value of [uid][crate::model::NetworkPolicy::uid].
16272 ///
16273 /// # Example
16274 /// ```ignore,no_run
16275 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16276 /// let x = NetworkPolicy::new().set_uid("example");
16277 /// ```
16278 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16279 self.uid = v.into();
16280 self
16281 }
16282
16283 /// Sets the value of [vmware_engine_network][crate::model::NetworkPolicy::vmware_engine_network].
16284 ///
16285 /// # Example
16286 /// ```ignore,no_run
16287 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16288 /// # let project_id = "project_id";
16289 /// # let location_id = "location_id";
16290 /// # let vmware_engine_network_id = "vmware_engine_network_id";
16291 /// let x = NetworkPolicy::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
16292 /// ```
16293 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
16294 mut self,
16295 v: T,
16296 ) -> Self {
16297 self.vmware_engine_network = v.into();
16298 self
16299 }
16300
16301 /// Sets the value of [description][crate::model::NetworkPolicy::description].
16302 ///
16303 /// # Example
16304 /// ```ignore,no_run
16305 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16306 /// let x = NetworkPolicy::new().set_description("example");
16307 /// ```
16308 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16309 self.description = v.into();
16310 self
16311 }
16312
16313 /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkPolicy::vmware_engine_network_canonical].
16314 ///
16315 /// # Example
16316 /// ```ignore,no_run
16317 /// # use google_cloud_vmwareengine_v1::model::NetworkPolicy;
16318 /// # let project_id = "project_id";
16319 /// # let location_id = "location_id";
16320 /// # let vmware_engine_network_id = "vmware_engine_network_id";
16321 /// let x = NetworkPolicy::new().set_vmware_engine_network_canonical(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
16322 /// ```
16323 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
16324 mut self,
16325 v: T,
16326 ) -> Self {
16327 self.vmware_engine_network_canonical = v.into();
16328 self
16329 }
16330}
16331
16332impl wkt::message::Message for NetworkPolicy {
16333 fn typename() -> &'static str {
16334 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy"
16335 }
16336}
16337
16338/// Defines additional types related to [NetworkPolicy].
16339pub mod network_policy {
16340 #[allow(unused_imports)]
16341 use super::*;
16342
16343 /// Represents a network service that is managed by a `NetworkPolicy` resource.
16344 /// A network service provides a way to control an aspect of external access to
16345 /// VMware workloads. For example, whether the VMware workloads in the
16346 /// private clouds governed by a network policy can access or be accessed from
16347 /// the internet.
16348 #[derive(Clone, Default, PartialEq)]
16349 #[non_exhaustive]
16350 pub struct NetworkService {
16351 /// True if the service is enabled; false otherwise.
16352 pub enabled: bool,
16353
16354 /// Output only. State of the service. New values may be added to this enum
16355 /// when appropriate.
16356 pub state: crate::model::network_policy::network_service::State,
16357
16358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16359 }
16360
16361 impl NetworkService {
16362 /// Creates a new default instance.
16363 pub fn new() -> Self {
16364 std::default::Default::default()
16365 }
16366
16367 /// Sets the value of [enabled][crate::model::network_policy::NetworkService::enabled].
16368 ///
16369 /// # Example
16370 /// ```ignore,no_run
16371 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16372 /// let x = NetworkService::new().set_enabled(true);
16373 /// ```
16374 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16375 self.enabled = v.into();
16376 self
16377 }
16378
16379 /// Sets the value of [state][crate::model::network_policy::NetworkService::state].
16380 ///
16381 /// # Example
16382 /// ```ignore,no_run
16383 /// # use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
16384 /// use google_cloud_vmwareengine_v1::model::network_policy::network_service::State;
16385 /// let x0 = NetworkService::new().set_state(State::Unprovisioned);
16386 /// let x1 = NetworkService::new().set_state(State::Reconciling);
16387 /// let x2 = NetworkService::new().set_state(State::Active);
16388 /// ```
16389 pub fn set_state<
16390 T: std::convert::Into<crate::model::network_policy::network_service::State>,
16391 >(
16392 mut self,
16393 v: T,
16394 ) -> Self {
16395 self.state = v.into();
16396 self
16397 }
16398 }
16399
16400 impl wkt::message::Message for NetworkService {
16401 fn typename() -> &'static str {
16402 "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"
16403 }
16404 }
16405
16406 /// Defines additional types related to [NetworkService].
16407 pub mod network_service {
16408 #[allow(unused_imports)]
16409 use super::*;
16410
16411 /// Enum State defines possible states of a network policy controlled
16412 /// service.
16413 ///
16414 /// # Working with unknown values
16415 ///
16416 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16417 /// additional enum variants at any time. Adding new variants is not considered
16418 /// a breaking change. Applications should write their code in anticipation of:
16419 ///
16420 /// - New values appearing in future releases of the client library, **and**
16421 /// - New values received dynamically, without application changes.
16422 ///
16423 /// Please consult the [Working with enums] section in the user guide for some
16424 /// guidelines.
16425 ///
16426 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16427 #[derive(Clone, Debug, PartialEq)]
16428 #[non_exhaustive]
16429 pub enum State {
16430 /// Unspecified service state. This is the default value.
16431 Unspecified,
16432 /// Service is not provisioned.
16433 Unprovisioned,
16434 /// Service is in the process of being provisioned/deprovisioned.
16435 Reconciling,
16436 /// Service is active.
16437 Active,
16438 /// If set, the enum was initialized with an unknown value.
16439 ///
16440 /// Applications can examine the value using [State::value] or
16441 /// [State::name].
16442 UnknownValue(state::UnknownValue),
16443 }
16444
16445 #[doc(hidden)]
16446 pub mod state {
16447 #[allow(unused_imports)]
16448 use super::*;
16449 #[derive(Clone, Debug, PartialEq)]
16450 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16451 }
16452
16453 impl State {
16454 /// Gets the enum value.
16455 ///
16456 /// Returns `None` if the enum contains an unknown value deserialized from
16457 /// the string representation of enums.
16458 pub fn value(&self) -> std::option::Option<i32> {
16459 match self {
16460 Self::Unspecified => std::option::Option::Some(0),
16461 Self::Unprovisioned => std::option::Option::Some(1),
16462 Self::Reconciling => std::option::Option::Some(2),
16463 Self::Active => std::option::Option::Some(3),
16464 Self::UnknownValue(u) => u.0.value(),
16465 }
16466 }
16467
16468 /// Gets the enum value as a string.
16469 ///
16470 /// Returns `None` if the enum contains an unknown value deserialized from
16471 /// the integer representation of enums.
16472 pub fn name(&self) -> std::option::Option<&str> {
16473 match self {
16474 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16475 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
16476 Self::Reconciling => std::option::Option::Some("RECONCILING"),
16477 Self::Active => std::option::Option::Some("ACTIVE"),
16478 Self::UnknownValue(u) => u.0.name(),
16479 }
16480 }
16481 }
16482
16483 impl std::default::Default for State {
16484 fn default() -> Self {
16485 use std::convert::From;
16486 Self::from(0)
16487 }
16488 }
16489
16490 impl std::fmt::Display for State {
16491 fn fmt(
16492 &self,
16493 f: &mut std::fmt::Formatter<'_>,
16494 ) -> std::result::Result<(), std::fmt::Error> {
16495 wkt::internal::display_enum(f, self.name(), self.value())
16496 }
16497 }
16498
16499 impl std::convert::From<i32> for State {
16500 fn from(value: i32) -> Self {
16501 match value {
16502 0 => Self::Unspecified,
16503 1 => Self::Unprovisioned,
16504 2 => Self::Reconciling,
16505 3 => Self::Active,
16506 _ => Self::UnknownValue(state::UnknownValue(
16507 wkt::internal::UnknownEnumValue::Integer(value),
16508 )),
16509 }
16510 }
16511 }
16512
16513 impl std::convert::From<&str> for State {
16514 fn from(value: &str) -> Self {
16515 use std::string::ToString;
16516 match value {
16517 "STATE_UNSPECIFIED" => Self::Unspecified,
16518 "UNPROVISIONED" => Self::Unprovisioned,
16519 "RECONCILING" => Self::Reconciling,
16520 "ACTIVE" => Self::Active,
16521 _ => Self::UnknownValue(state::UnknownValue(
16522 wkt::internal::UnknownEnumValue::String(value.to_string()),
16523 )),
16524 }
16525 }
16526 }
16527
16528 impl serde::ser::Serialize for State {
16529 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16530 where
16531 S: serde::Serializer,
16532 {
16533 match self {
16534 Self::Unspecified => serializer.serialize_i32(0),
16535 Self::Unprovisioned => serializer.serialize_i32(1),
16536 Self::Reconciling => serializer.serialize_i32(2),
16537 Self::Active => serializer.serialize_i32(3),
16538 Self::UnknownValue(u) => u.0.serialize(serializer),
16539 }
16540 }
16541 }
16542
16543 impl<'de> serde::de::Deserialize<'de> for State {
16544 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16545 where
16546 D: serde::Deserializer<'de>,
16547 {
16548 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16549 ".google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State",
16550 ))
16551 }
16552 }
16553 }
16554}
16555
16556/// Represents a binding between a network and the management DNS zone.
16557/// A management DNS zone is the Cloud DNS cross-project binding zone that
16558/// VMware Engine creates for each private cloud. It contains FQDNs and
16559/// corresponding IP addresses for the private cloud's ESXi hosts and management
16560/// VM appliances like vCenter and NSX Manager.
16561#[derive(Clone, Default, PartialEq)]
16562#[non_exhaustive]
16563pub struct ManagementDnsZoneBinding {
16564 /// Output only. The resource name of this binding.
16565 /// Resource names are schemeless URIs that follow the conventions in
16566 /// <https://cloud.google.com/apis/design/resource_names>.
16567 /// For example:
16568 /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16569 pub name: std::string::String,
16570
16571 /// Output only. Creation time of this resource.
16572 pub create_time: std::option::Option<wkt::Timestamp>,
16573
16574 /// Output only. Last update time of this resource.
16575 pub update_time: std::option::Option<wkt::Timestamp>,
16576
16577 /// Output only. The state of the resource.
16578 pub state: crate::model::management_dns_zone_binding::State,
16579
16580 /// User-provided description for this resource.
16581 pub description: std::string::String,
16582
16583 /// Output only. System-generated unique identifier for the resource.
16584 pub uid: std::string::String,
16585
16586 /// Required. The relative resource name of the network to bind to the
16587 /// management DNS zone. This network can be a consumer VPC network or a
16588 /// VMware engine network.
16589 pub bind_network: std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16590
16591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16592}
16593
16594impl ManagementDnsZoneBinding {
16595 /// Creates a new default instance.
16596 pub fn new() -> Self {
16597 std::default::Default::default()
16598 }
16599
16600 /// Sets the value of [name][crate::model::ManagementDnsZoneBinding::name].
16601 ///
16602 /// # Example
16603 /// ```ignore,no_run
16604 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16605 /// # let project_id = "project_id";
16606 /// # let location_id = "location_id";
16607 /// # let private_cloud_id = "private_cloud_id";
16608 /// # let management_dns_zone_binding_id = "management_dns_zone_binding_id";
16609 /// let x = ManagementDnsZoneBinding::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateClouds/{private_cloud_id}/managementDnsZoneBindings/{management_dns_zone_binding_id}"));
16610 /// ```
16611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16612 self.name = v.into();
16613 self
16614 }
16615
16616 /// Sets the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16617 ///
16618 /// # Example
16619 /// ```ignore,no_run
16620 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16621 /// use wkt::Timestamp;
16622 /// let x = ManagementDnsZoneBinding::new().set_create_time(Timestamp::default()/* use setters */);
16623 /// ```
16624 pub fn set_create_time<T>(mut self, v: T) -> Self
16625 where
16626 T: std::convert::Into<wkt::Timestamp>,
16627 {
16628 self.create_time = std::option::Option::Some(v.into());
16629 self
16630 }
16631
16632 /// Sets or clears the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
16633 ///
16634 /// # Example
16635 /// ```ignore,no_run
16636 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16637 /// use wkt::Timestamp;
16638 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16639 /// let x = ManagementDnsZoneBinding::new().set_or_clear_create_time(None::<Timestamp>);
16640 /// ```
16641 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16642 where
16643 T: std::convert::Into<wkt::Timestamp>,
16644 {
16645 self.create_time = v.map(|x| x.into());
16646 self
16647 }
16648
16649 /// Sets the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16650 ///
16651 /// # Example
16652 /// ```ignore,no_run
16653 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16654 /// use wkt::Timestamp;
16655 /// let x = ManagementDnsZoneBinding::new().set_update_time(Timestamp::default()/* use setters */);
16656 /// ```
16657 pub fn set_update_time<T>(mut self, v: T) -> Self
16658 where
16659 T: std::convert::Into<wkt::Timestamp>,
16660 {
16661 self.update_time = std::option::Option::Some(v.into());
16662 self
16663 }
16664
16665 /// Sets or clears the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
16666 ///
16667 /// # Example
16668 /// ```ignore,no_run
16669 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16670 /// use wkt::Timestamp;
16671 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16672 /// let x = ManagementDnsZoneBinding::new().set_or_clear_update_time(None::<Timestamp>);
16673 /// ```
16674 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16675 where
16676 T: std::convert::Into<wkt::Timestamp>,
16677 {
16678 self.update_time = v.map(|x| x.into());
16679 self
16680 }
16681
16682 /// Sets the value of [state][crate::model::ManagementDnsZoneBinding::state].
16683 ///
16684 /// # Example
16685 /// ```ignore,no_run
16686 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16687 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::State;
16688 /// let x0 = ManagementDnsZoneBinding::new().set_state(State::Active);
16689 /// let x1 = ManagementDnsZoneBinding::new().set_state(State::Creating);
16690 /// let x2 = ManagementDnsZoneBinding::new().set_state(State::Updating);
16691 /// ```
16692 pub fn set_state<T: std::convert::Into<crate::model::management_dns_zone_binding::State>>(
16693 mut self,
16694 v: T,
16695 ) -> Self {
16696 self.state = v.into();
16697 self
16698 }
16699
16700 /// Sets the value of [description][crate::model::ManagementDnsZoneBinding::description].
16701 ///
16702 /// # Example
16703 /// ```ignore,no_run
16704 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16705 /// let x = ManagementDnsZoneBinding::new().set_description("example");
16706 /// ```
16707 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16708 self.description = v.into();
16709 self
16710 }
16711
16712 /// Sets the value of [uid][crate::model::ManagementDnsZoneBinding::uid].
16713 ///
16714 /// # Example
16715 /// ```ignore,no_run
16716 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16717 /// let x = ManagementDnsZoneBinding::new().set_uid("example");
16718 /// ```
16719 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16720 self.uid = v.into();
16721 self
16722 }
16723
16724 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network].
16725 ///
16726 /// Note that all the setters affecting `bind_network` are mutually
16727 /// exclusive.
16728 ///
16729 /// # Example
16730 /// ```ignore,no_run
16731 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16732 /// use google_cloud_vmwareengine_v1::model::management_dns_zone_binding::BindNetwork;
16733 /// let x = ManagementDnsZoneBinding::new().set_bind_network(Some(BindNetwork::VpcNetwork("example".to_string())));
16734 /// ```
16735 pub fn set_bind_network<
16736 T: std::convert::Into<
16737 std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
16738 >,
16739 >(
16740 mut self,
16741 v: T,
16742 ) -> Self {
16743 self.bind_network = v.into();
16744 self
16745 }
16746
16747 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16748 /// if it holds a `VpcNetwork`, `None` if the field is not set or
16749 /// holds a different branch.
16750 pub fn vpc_network(&self) -> std::option::Option<&std::string::String> {
16751 #[allow(unreachable_patterns)]
16752 self.bind_network.as_ref().and_then(|v| match v {
16753 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v) => {
16754 std::option::Option::Some(v)
16755 }
16756 _ => std::option::Option::None,
16757 })
16758 }
16759
16760 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16761 /// to hold a `VpcNetwork`.
16762 ///
16763 /// Note that all the setters affecting `bind_network` are
16764 /// mutually exclusive.
16765 ///
16766 /// # Example
16767 /// ```ignore,no_run
16768 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16769 /// let x = ManagementDnsZoneBinding::new().set_vpc_network("example");
16770 /// assert!(x.vpc_network().is_some());
16771 /// assert!(x.vmware_engine_network().is_none());
16772 /// ```
16773 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16774 self.bind_network = std::option::Option::Some(
16775 crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v.into()),
16776 );
16777 self
16778 }
16779
16780 /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16781 /// if it holds a `VmwareEngineNetwork`, `None` if the field is not set or
16782 /// holds a different branch.
16783 pub fn vmware_engine_network(&self) -> std::option::Option<&std::string::String> {
16784 #[allow(unreachable_patterns)]
16785 self.bind_network.as_ref().and_then(|v| match v {
16786 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v) => {
16787 std::option::Option::Some(v)
16788 }
16789 _ => std::option::Option::None,
16790 })
16791 }
16792
16793 /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
16794 /// to hold a `VmwareEngineNetwork`.
16795 ///
16796 /// Note that all the setters affecting `bind_network` are
16797 /// mutually exclusive.
16798 ///
16799 /// # Example
16800 /// ```ignore,no_run
16801 /// # use google_cloud_vmwareengine_v1::model::ManagementDnsZoneBinding;
16802 /// # let project_id = "project_id";
16803 /// # let location_id = "location_id";
16804 /// # let vmware_engine_network_id = "vmware_engine_network_id";
16805 /// let x = ManagementDnsZoneBinding::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
16806 /// assert!(x.vmware_engine_network().is_some());
16807 /// assert!(x.vpc_network().is_none());
16808 /// ```
16809 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
16810 mut self,
16811 v: T,
16812 ) -> Self {
16813 self.bind_network = std::option::Option::Some(
16814 crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v.into()),
16815 );
16816 self
16817 }
16818}
16819
16820impl wkt::message::Message for ManagementDnsZoneBinding {
16821 fn typename() -> &'static str {
16822 "type.googleapis.com/google.cloud.vmwareengine.v1.ManagementDnsZoneBinding"
16823 }
16824}
16825
16826/// Defines additional types related to [ManagementDnsZoneBinding].
16827pub mod management_dns_zone_binding {
16828 #[allow(unused_imports)]
16829 use super::*;
16830
16831 /// Enum State defines possible states of binding between the consumer VPC
16832 /// network and the management DNS zone.
16833 ///
16834 /// # Working with unknown values
16835 ///
16836 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16837 /// additional enum variants at any time. Adding new variants is not considered
16838 /// a breaking change. Applications should write their code in anticipation of:
16839 ///
16840 /// - New values appearing in future releases of the client library, **and**
16841 /// - New values received dynamically, without application changes.
16842 ///
16843 /// Please consult the [Working with enums] section in the user guide for some
16844 /// guidelines.
16845 ///
16846 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16847 #[derive(Clone, Debug, PartialEq)]
16848 #[non_exhaustive]
16849 pub enum State {
16850 /// The default value. This value should never be used.
16851 Unspecified,
16852 /// The binding is ready.
16853 Active,
16854 /// The binding is being created.
16855 Creating,
16856 /// The binding is being updated.
16857 Updating,
16858 /// The binding is being deleted.
16859 Deleting,
16860 /// The binding has failed.
16861 Failed,
16862 /// If set, the enum was initialized with an unknown value.
16863 ///
16864 /// Applications can examine the value using [State::value] or
16865 /// [State::name].
16866 UnknownValue(state::UnknownValue),
16867 }
16868
16869 #[doc(hidden)]
16870 pub mod state {
16871 #[allow(unused_imports)]
16872 use super::*;
16873 #[derive(Clone, Debug, PartialEq)]
16874 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16875 }
16876
16877 impl State {
16878 /// Gets the enum value.
16879 ///
16880 /// Returns `None` if the enum contains an unknown value deserialized from
16881 /// the string representation of enums.
16882 pub fn value(&self) -> std::option::Option<i32> {
16883 match self {
16884 Self::Unspecified => std::option::Option::Some(0),
16885 Self::Active => std::option::Option::Some(1),
16886 Self::Creating => std::option::Option::Some(2),
16887 Self::Updating => std::option::Option::Some(3),
16888 Self::Deleting => std::option::Option::Some(4),
16889 Self::Failed => std::option::Option::Some(5),
16890 Self::UnknownValue(u) => u.0.value(),
16891 }
16892 }
16893
16894 /// Gets the enum value as a string.
16895 ///
16896 /// Returns `None` if the enum contains an unknown value deserialized from
16897 /// the integer representation of enums.
16898 pub fn name(&self) -> std::option::Option<&str> {
16899 match self {
16900 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16901 Self::Active => std::option::Option::Some("ACTIVE"),
16902 Self::Creating => std::option::Option::Some("CREATING"),
16903 Self::Updating => std::option::Option::Some("UPDATING"),
16904 Self::Deleting => std::option::Option::Some("DELETING"),
16905 Self::Failed => std::option::Option::Some("FAILED"),
16906 Self::UnknownValue(u) => u.0.name(),
16907 }
16908 }
16909 }
16910
16911 impl std::default::Default for State {
16912 fn default() -> Self {
16913 use std::convert::From;
16914 Self::from(0)
16915 }
16916 }
16917
16918 impl std::fmt::Display for State {
16919 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16920 wkt::internal::display_enum(f, self.name(), self.value())
16921 }
16922 }
16923
16924 impl std::convert::From<i32> for State {
16925 fn from(value: i32) -> Self {
16926 match value {
16927 0 => Self::Unspecified,
16928 1 => Self::Active,
16929 2 => Self::Creating,
16930 3 => Self::Updating,
16931 4 => Self::Deleting,
16932 5 => Self::Failed,
16933 _ => Self::UnknownValue(state::UnknownValue(
16934 wkt::internal::UnknownEnumValue::Integer(value),
16935 )),
16936 }
16937 }
16938 }
16939
16940 impl std::convert::From<&str> for State {
16941 fn from(value: &str) -> Self {
16942 use std::string::ToString;
16943 match value {
16944 "STATE_UNSPECIFIED" => Self::Unspecified,
16945 "ACTIVE" => Self::Active,
16946 "CREATING" => Self::Creating,
16947 "UPDATING" => Self::Updating,
16948 "DELETING" => Self::Deleting,
16949 "FAILED" => Self::Failed,
16950 _ => Self::UnknownValue(state::UnknownValue(
16951 wkt::internal::UnknownEnumValue::String(value.to_string()),
16952 )),
16953 }
16954 }
16955 }
16956
16957 impl serde::ser::Serialize for State {
16958 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16959 where
16960 S: serde::Serializer,
16961 {
16962 match self {
16963 Self::Unspecified => serializer.serialize_i32(0),
16964 Self::Active => serializer.serialize_i32(1),
16965 Self::Creating => serializer.serialize_i32(2),
16966 Self::Updating => serializer.serialize_i32(3),
16967 Self::Deleting => serializer.serialize_i32(4),
16968 Self::Failed => serializer.serialize_i32(5),
16969 Self::UnknownValue(u) => u.0.serialize(serializer),
16970 }
16971 }
16972 }
16973
16974 impl<'de> serde::de::Deserialize<'de> for State {
16975 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16976 where
16977 D: serde::Deserializer<'de>,
16978 {
16979 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16980 ".google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State",
16981 ))
16982 }
16983 }
16984
16985 /// Required. The relative resource name of the network to bind to the
16986 /// management DNS zone. This network can be a consumer VPC network or a
16987 /// VMware engine network.
16988 #[derive(Clone, Debug, PartialEq)]
16989 #[non_exhaustive]
16990 pub enum BindNetwork {
16991 /// Network to bind is a standard consumer VPC.
16992 /// Specify the name in the following form for consumer
16993 /// VPC network: `projects/{project}/global/networks/{network_id}`.
16994 /// `{project}` can either be a project number or a project ID.
16995 VpcNetwork(std::string::String),
16996 /// Network to bind is a VMware Engine network.
16997 /// Specify the name in the following form for VMware engine network:
16998 /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
16999 /// `{project}` can either be a project number or a project ID.
17000 VmwareEngineNetwork(std::string::String),
17001 }
17002}
17003
17004/// VMware Engine network resource that provides connectivity for VMware Engine
17005/// private clouds.
17006#[derive(Clone, Default, PartialEq)]
17007#[non_exhaustive]
17008pub struct VmwareEngineNetwork {
17009 /// Output only. The resource name of the VMware Engine network.
17010 /// Resource names are schemeless URIs that follow the conventions in
17011 /// <https://cloud.google.com/apis/design/resource_names>.
17012 /// For example:
17013 /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
17014 pub name: std::string::String,
17015
17016 /// Output only. Creation time of this resource.
17017 pub create_time: std::option::Option<wkt::Timestamp>,
17018
17019 /// Output only. Last update time of this resource.
17020 pub update_time: std::option::Option<wkt::Timestamp>,
17021
17022 /// User-provided description for this VMware Engine network.
17023 pub description: std::string::String,
17024
17025 /// Output only. VMware Engine service VPC networks that provide connectivity
17026 /// from a private cloud to customer projects, the internet, and other Google
17027 /// Cloud services.
17028 pub vpc_networks: std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
17029
17030 /// Output only. State of the VMware Engine network.
17031 pub state: crate::model::vmware_engine_network::State,
17032
17033 /// Required. VMware Engine network type.
17034 pub r#type: crate::model::vmware_engine_network::Type,
17035
17036 /// Output only. System-generated unique identifier for the resource.
17037 pub uid: std::string::String,
17038
17039 /// Checksum that may be sent on update and delete requests to ensure that the
17040 /// user-provided value is up to date before the server processes a request.
17041 /// The server computes checksums based on the value of other fields in the
17042 /// request.
17043 pub etag: std::string::String,
17044
17045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17046}
17047
17048impl VmwareEngineNetwork {
17049 /// Creates a new default instance.
17050 pub fn new() -> Self {
17051 std::default::Default::default()
17052 }
17053
17054 /// Sets the value of [name][crate::model::VmwareEngineNetwork::name].
17055 ///
17056 /// # Example
17057 /// ```ignore,no_run
17058 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17059 /// # let project_id = "project_id";
17060 /// # let location_id = "location_id";
17061 /// # let vmware_engine_network_id = "vmware_engine_network_id";
17062 /// let x = VmwareEngineNetwork::new().set_name(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
17063 /// ```
17064 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17065 self.name = v.into();
17066 self
17067 }
17068
17069 /// Sets the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
17070 ///
17071 /// # Example
17072 /// ```ignore,no_run
17073 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17074 /// use wkt::Timestamp;
17075 /// let x = VmwareEngineNetwork::new().set_create_time(Timestamp::default()/* use setters */);
17076 /// ```
17077 pub fn set_create_time<T>(mut self, v: T) -> Self
17078 where
17079 T: std::convert::Into<wkt::Timestamp>,
17080 {
17081 self.create_time = std::option::Option::Some(v.into());
17082 self
17083 }
17084
17085 /// Sets or clears the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
17086 ///
17087 /// # Example
17088 /// ```ignore,no_run
17089 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17090 /// use wkt::Timestamp;
17091 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17092 /// let x = VmwareEngineNetwork::new().set_or_clear_create_time(None::<Timestamp>);
17093 /// ```
17094 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17095 where
17096 T: std::convert::Into<wkt::Timestamp>,
17097 {
17098 self.create_time = v.map(|x| x.into());
17099 self
17100 }
17101
17102 /// Sets the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
17103 ///
17104 /// # Example
17105 /// ```ignore,no_run
17106 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17107 /// use wkt::Timestamp;
17108 /// let x = VmwareEngineNetwork::new().set_update_time(Timestamp::default()/* use setters */);
17109 /// ```
17110 pub fn set_update_time<T>(mut self, v: T) -> Self
17111 where
17112 T: std::convert::Into<wkt::Timestamp>,
17113 {
17114 self.update_time = std::option::Option::Some(v.into());
17115 self
17116 }
17117
17118 /// Sets or clears the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
17119 ///
17120 /// # Example
17121 /// ```ignore,no_run
17122 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17123 /// use wkt::Timestamp;
17124 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17125 /// let x = VmwareEngineNetwork::new().set_or_clear_update_time(None::<Timestamp>);
17126 /// ```
17127 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17128 where
17129 T: std::convert::Into<wkt::Timestamp>,
17130 {
17131 self.update_time = v.map(|x| x.into());
17132 self
17133 }
17134
17135 /// Sets the value of [description][crate::model::VmwareEngineNetwork::description].
17136 ///
17137 /// # Example
17138 /// ```ignore,no_run
17139 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17140 /// let x = VmwareEngineNetwork::new().set_description("example");
17141 /// ```
17142 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17143 self.description = v.into();
17144 self
17145 }
17146
17147 /// Sets the value of [vpc_networks][crate::model::VmwareEngineNetwork::vpc_networks].
17148 ///
17149 /// # Example
17150 /// ```ignore,no_run
17151 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17152 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
17153 /// let x = VmwareEngineNetwork::new()
17154 /// .set_vpc_networks([
17155 /// VpcNetwork::default()/* use setters */,
17156 /// VpcNetwork::default()/* use (different) setters */,
17157 /// ]);
17158 /// ```
17159 pub fn set_vpc_networks<T, V>(mut self, v: T) -> Self
17160 where
17161 T: std::iter::IntoIterator<Item = V>,
17162 V: std::convert::Into<crate::model::vmware_engine_network::VpcNetwork>,
17163 {
17164 use std::iter::Iterator;
17165 self.vpc_networks = v.into_iter().map(|i| i.into()).collect();
17166 self
17167 }
17168
17169 /// Sets the value of [state][crate::model::VmwareEngineNetwork::state].
17170 ///
17171 /// # Example
17172 /// ```ignore,no_run
17173 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17174 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::State;
17175 /// let x0 = VmwareEngineNetwork::new().set_state(State::Creating);
17176 /// let x1 = VmwareEngineNetwork::new().set_state(State::Active);
17177 /// let x2 = VmwareEngineNetwork::new().set_state(State::Updating);
17178 /// ```
17179 pub fn set_state<T: std::convert::Into<crate::model::vmware_engine_network::State>>(
17180 mut self,
17181 v: T,
17182 ) -> Self {
17183 self.state = v.into();
17184 self
17185 }
17186
17187 /// Sets the value of [r#type][crate::model::VmwareEngineNetwork::type].
17188 ///
17189 /// # Example
17190 /// ```ignore,no_run
17191 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17192 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::Type;
17193 /// let x0 = VmwareEngineNetwork::new().set_type(Type::Legacy);
17194 /// let x1 = VmwareEngineNetwork::new().set_type(Type::Standard);
17195 /// ```
17196 pub fn set_type<T: std::convert::Into<crate::model::vmware_engine_network::Type>>(
17197 mut self,
17198 v: T,
17199 ) -> Self {
17200 self.r#type = v.into();
17201 self
17202 }
17203
17204 /// Sets the value of [uid][crate::model::VmwareEngineNetwork::uid].
17205 ///
17206 /// # Example
17207 /// ```ignore,no_run
17208 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17209 /// let x = VmwareEngineNetwork::new().set_uid("example");
17210 /// ```
17211 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17212 self.uid = v.into();
17213 self
17214 }
17215
17216 /// Sets the value of [etag][crate::model::VmwareEngineNetwork::etag].
17217 ///
17218 /// # Example
17219 /// ```ignore,no_run
17220 /// # use google_cloud_vmwareengine_v1::model::VmwareEngineNetwork;
17221 /// let x = VmwareEngineNetwork::new().set_etag("example");
17222 /// ```
17223 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17224 self.etag = v.into();
17225 self
17226 }
17227}
17228
17229impl wkt::message::Message for VmwareEngineNetwork {
17230 fn typename() -> &'static str {
17231 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork"
17232 }
17233}
17234
17235/// Defines additional types related to [VmwareEngineNetwork].
17236pub mod vmware_engine_network {
17237 #[allow(unused_imports)]
17238 use super::*;
17239
17240 /// Represents a VMware Engine VPC network that is managed by a
17241 /// VMware Engine network resource.
17242 #[derive(Clone, Default, PartialEq)]
17243 #[non_exhaustive]
17244 pub struct VpcNetwork {
17245 /// Output only. Type of VPC network (INTRANET, INTERNET, or
17246 /// GOOGLE_CLOUD)
17247 pub r#type: crate::model::vmware_engine_network::vpc_network::Type,
17248
17249 /// Output only. The relative resource name of the service VPC network this
17250 /// VMware Engine network is attached to. For example:
17251 /// `projects/123123/global/networks/my-network`
17252 pub network: std::string::String,
17253
17254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17255 }
17256
17257 impl VpcNetwork {
17258 /// Creates a new default instance.
17259 pub fn new() -> Self {
17260 std::default::Default::default()
17261 }
17262
17263 /// Sets the value of [r#type][crate::model::vmware_engine_network::VpcNetwork::type].
17264 ///
17265 /// # Example
17266 /// ```ignore,no_run
17267 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
17268 /// use google_cloud_vmwareengine_v1::model::vmware_engine_network::vpc_network::Type;
17269 /// let x0 = VpcNetwork::new().set_type(Type::Intranet);
17270 /// let x1 = VpcNetwork::new().set_type(Type::Internet);
17271 /// let x2 = VpcNetwork::new().set_type(Type::GoogleCloud);
17272 /// ```
17273 pub fn set_type<
17274 T: std::convert::Into<crate::model::vmware_engine_network::vpc_network::Type>,
17275 >(
17276 mut self,
17277 v: T,
17278 ) -> Self {
17279 self.r#type = v.into();
17280 self
17281 }
17282
17283 /// Sets the value of [network][crate::model::vmware_engine_network::VpcNetwork::network].
17284 ///
17285 /// # Example
17286 /// ```ignore,no_run
17287 /// # use google_cloud_vmwareengine_v1::model::vmware_engine_network::VpcNetwork;
17288 /// let x = VpcNetwork::new().set_network("example");
17289 /// ```
17290 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17291 self.network = v.into();
17292 self
17293 }
17294 }
17295
17296 impl wkt::message::Message for VpcNetwork {
17297 fn typename() -> &'static str {
17298 "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"
17299 }
17300 }
17301
17302 /// Defines additional types related to [VpcNetwork].
17303 pub mod vpc_network {
17304 #[allow(unused_imports)]
17305 use super::*;
17306
17307 /// Enum Type defines possible types of a VMware Engine network controlled
17308 /// service.
17309 ///
17310 /// # Working with unknown values
17311 ///
17312 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17313 /// additional enum variants at any time. Adding new variants is not considered
17314 /// a breaking change. Applications should write their code in anticipation of:
17315 ///
17316 /// - New values appearing in future releases of the client library, **and**
17317 /// - New values received dynamically, without application changes.
17318 ///
17319 /// Please consult the [Working with enums] section in the user guide for some
17320 /// guidelines.
17321 ///
17322 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17323 #[derive(Clone, Debug, PartialEq)]
17324 #[non_exhaustive]
17325 pub enum Type {
17326 /// The default value. This value should never be used.
17327 Unspecified,
17328 /// VPC network that will be peered with a consumer VPC network or the
17329 /// intranet VPC of another VMware Engine network. Access a private cloud
17330 /// through Compute Engine VMs on a peered VPC network or an on-premises
17331 /// resource connected to a peered consumer VPC network.
17332 Intranet,
17333 /// VPC network used for internet access to and from a private cloud.
17334 Internet,
17335 /// VPC network used for access to Google Cloud services like
17336 /// Cloud Storage.
17337 GoogleCloud,
17338 /// If set, the enum was initialized with an unknown value.
17339 ///
17340 /// Applications can examine the value using [Type::value] or
17341 /// [Type::name].
17342 UnknownValue(r#type::UnknownValue),
17343 }
17344
17345 #[doc(hidden)]
17346 pub mod r#type {
17347 #[allow(unused_imports)]
17348 use super::*;
17349 #[derive(Clone, Debug, PartialEq)]
17350 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17351 }
17352
17353 impl Type {
17354 /// Gets the enum value.
17355 ///
17356 /// Returns `None` if the enum contains an unknown value deserialized from
17357 /// the string representation of enums.
17358 pub fn value(&self) -> std::option::Option<i32> {
17359 match self {
17360 Self::Unspecified => std::option::Option::Some(0),
17361 Self::Intranet => std::option::Option::Some(1),
17362 Self::Internet => std::option::Option::Some(2),
17363 Self::GoogleCloud => std::option::Option::Some(3),
17364 Self::UnknownValue(u) => u.0.value(),
17365 }
17366 }
17367
17368 /// Gets the enum value as a string.
17369 ///
17370 /// Returns `None` if the enum contains an unknown value deserialized from
17371 /// the integer representation of enums.
17372 pub fn name(&self) -> std::option::Option<&str> {
17373 match self {
17374 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17375 Self::Intranet => std::option::Option::Some("INTRANET"),
17376 Self::Internet => std::option::Option::Some("INTERNET"),
17377 Self::GoogleCloud => std::option::Option::Some("GOOGLE_CLOUD"),
17378 Self::UnknownValue(u) => u.0.name(),
17379 }
17380 }
17381 }
17382
17383 impl std::default::Default for Type {
17384 fn default() -> Self {
17385 use std::convert::From;
17386 Self::from(0)
17387 }
17388 }
17389
17390 impl std::fmt::Display for Type {
17391 fn fmt(
17392 &self,
17393 f: &mut std::fmt::Formatter<'_>,
17394 ) -> std::result::Result<(), std::fmt::Error> {
17395 wkt::internal::display_enum(f, self.name(), self.value())
17396 }
17397 }
17398
17399 impl std::convert::From<i32> for Type {
17400 fn from(value: i32) -> Self {
17401 match value {
17402 0 => Self::Unspecified,
17403 1 => Self::Intranet,
17404 2 => Self::Internet,
17405 3 => Self::GoogleCloud,
17406 _ => Self::UnknownValue(r#type::UnknownValue(
17407 wkt::internal::UnknownEnumValue::Integer(value),
17408 )),
17409 }
17410 }
17411 }
17412
17413 impl std::convert::From<&str> for Type {
17414 fn from(value: &str) -> Self {
17415 use std::string::ToString;
17416 match value {
17417 "TYPE_UNSPECIFIED" => Self::Unspecified,
17418 "INTRANET" => Self::Intranet,
17419 "INTERNET" => Self::Internet,
17420 "GOOGLE_CLOUD" => Self::GoogleCloud,
17421 _ => Self::UnknownValue(r#type::UnknownValue(
17422 wkt::internal::UnknownEnumValue::String(value.to_string()),
17423 )),
17424 }
17425 }
17426 }
17427
17428 impl serde::ser::Serialize for Type {
17429 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17430 where
17431 S: serde::Serializer,
17432 {
17433 match self {
17434 Self::Unspecified => serializer.serialize_i32(0),
17435 Self::Intranet => serializer.serialize_i32(1),
17436 Self::Internet => serializer.serialize_i32(2),
17437 Self::GoogleCloud => serializer.serialize_i32(3),
17438 Self::UnknownValue(u) => u.0.serialize(serializer),
17439 }
17440 }
17441 }
17442
17443 impl<'de> serde::de::Deserialize<'de> for Type {
17444 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17445 where
17446 D: serde::Deserializer<'de>,
17447 {
17448 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17449 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type",
17450 ))
17451 }
17452 }
17453 }
17454
17455 /// Enum State defines possible states of VMware Engine network.
17456 ///
17457 /// # Working with unknown values
17458 ///
17459 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17460 /// additional enum variants at any time. Adding new variants is not considered
17461 /// a breaking change. Applications should write their code in anticipation of:
17462 ///
17463 /// - New values appearing in future releases of the client library, **and**
17464 /// - New values received dynamically, without application changes.
17465 ///
17466 /// Please consult the [Working with enums] section in the user guide for some
17467 /// guidelines.
17468 ///
17469 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17470 #[derive(Clone, Debug, PartialEq)]
17471 #[non_exhaustive]
17472 pub enum State {
17473 /// The default value. This value is used if the state is omitted.
17474 Unspecified,
17475 /// The VMware Engine network is being created.
17476 Creating,
17477 /// The VMware Engine network is ready.
17478 Active,
17479 /// The VMware Engine network is being updated.
17480 Updating,
17481 /// The VMware Engine network is being deleted.
17482 Deleting,
17483 /// If set, the enum was initialized with an unknown value.
17484 ///
17485 /// Applications can examine the value using [State::value] or
17486 /// [State::name].
17487 UnknownValue(state::UnknownValue),
17488 }
17489
17490 #[doc(hidden)]
17491 pub mod state {
17492 #[allow(unused_imports)]
17493 use super::*;
17494 #[derive(Clone, Debug, PartialEq)]
17495 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17496 }
17497
17498 impl State {
17499 /// Gets the enum value.
17500 ///
17501 /// Returns `None` if the enum contains an unknown value deserialized from
17502 /// the string representation of enums.
17503 pub fn value(&self) -> std::option::Option<i32> {
17504 match self {
17505 Self::Unspecified => std::option::Option::Some(0),
17506 Self::Creating => std::option::Option::Some(1),
17507 Self::Active => std::option::Option::Some(2),
17508 Self::Updating => std::option::Option::Some(3),
17509 Self::Deleting => std::option::Option::Some(4),
17510 Self::UnknownValue(u) => u.0.value(),
17511 }
17512 }
17513
17514 /// Gets the enum value as a string.
17515 ///
17516 /// Returns `None` if the enum contains an unknown value deserialized from
17517 /// the integer representation of enums.
17518 pub fn name(&self) -> std::option::Option<&str> {
17519 match self {
17520 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17521 Self::Creating => std::option::Option::Some("CREATING"),
17522 Self::Active => std::option::Option::Some("ACTIVE"),
17523 Self::Updating => std::option::Option::Some("UPDATING"),
17524 Self::Deleting => std::option::Option::Some("DELETING"),
17525 Self::UnknownValue(u) => u.0.name(),
17526 }
17527 }
17528 }
17529
17530 impl std::default::Default for State {
17531 fn default() -> Self {
17532 use std::convert::From;
17533 Self::from(0)
17534 }
17535 }
17536
17537 impl std::fmt::Display for State {
17538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17539 wkt::internal::display_enum(f, self.name(), self.value())
17540 }
17541 }
17542
17543 impl std::convert::From<i32> for State {
17544 fn from(value: i32) -> Self {
17545 match value {
17546 0 => Self::Unspecified,
17547 1 => Self::Creating,
17548 2 => Self::Active,
17549 3 => Self::Updating,
17550 4 => Self::Deleting,
17551 _ => Self::UnknownValue(state::UnknownValue(
17552 wkt::internal::UnknownEnumValue::Integer(value),
17553 )),
17554 }
17555 }
17556 }
17557
17558 impl std::convert::From<&str> for State {
17559 fn from(value: &str) -> Self {
17560 use std::string::ToString;
17561 match value {
17562 "STATE_UNSPECIFIED" => Self::Unspecified,
17563 "CREATING" => Self::Creating,
17564 "ACTIVE" => Self::Active,
17565 "UPDATING" => Self::Updating,
17566 "DELETING" => Self::Deleting,
17567 _ => Self::UnknownValue(state::UnknownValue(
17568 wkt::internal::UnknownEnumValue::String(value.to_string()),
17569 )),
17570 }
17571 }
17572 }
17573
17574 impl serde::ser::Serialize for State {
17575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17576 where
17577 S: serde::Serializer,
17578 {
17579 match self {
17580 Self::Unspecified => serializer.serialize_i32(0),
17581 Self::Creating => serializer.serialize_i32(1),
17582 Self::Active => serializer.serialize_i32(2),
17583 Self::Updating => serializer.serialize_i32(3),
17584 Self::Deleting => serializer.serialize_i32(4),
17585 Self::UnknownValue(u) => u.0.serialize(serializer),
17586 }
17587 }
17588 }
17589
17590 impl<'de> serde::de::Deserialize<'de> for State {
17591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17592 where
17593 D: serde::Deserializer<'de>,
17594 {
17595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17596 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.State",
17597 ))
17598 }
17599 }
17600
17601 /// Enum Type defines possible types of VMware Engine network.
17602 ///
17603 /// # Working with unknown values
17604 ///
17605 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17606 /// additional enum variants at any time. Adding new variants is not considered
17607 /// a breaking change. Applications should write their code in anticipation of:
17608 ///
17609 /// - New values appearing in future releases of the client library, **and**
17610 /// - New values received dynamically, without application changes.
17611 ///
17612 /// Please consult the [Working with enums] section in the user guide for some
17613 /// guidelines.
17614 ///
17615 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17616 #[derive(Clone, Debug, PartialEq)]
17617 #[non_exhaustive]
17618 pub enum Type {
17619 /// The default value. This value should never be used.
17620 Unspecified,
17621 /// Network type used by private clouds created in projects without a network
17622 /// of type `STANDARD`. This network type is no longer used for new VMware
17623 /// Engine private cloud deployments.
17624 Legacy,
17625 /// Standard network type used for private cloud connectivity.
17626 Standard,
17627 /// If set, the enum was initialized with an unknown value.
17628 ///
17629 /// Applications can examine the value using [Type::value] or
17630 /// [Type::name].
17631 UnknownValue(r#type::UnknownValue),
17632 }
17633
17634 #[doc(hidden)]
17635 pub mod r#type {
17636 #[allow(unused_imports)]
17637 use super::*;
17638 #[derive(Clone, Debug, PartialEq)]
17639 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17640 }
17641
17642 impl Type {
17643 /// Gets the enum value.
17644 ///
17645 /// Returns `None` if the enum contains an unknown value deserialized from
17646 /// the string representation of enums.
17647 pub fn value(&self) -> std::option::Option<i32> {
17648 match self {
17649 Self::Unspecified => std::option::Option::Some(0),
17650 Self::Legacy => std::option::Option::Some(1),
17651 Self::Standard => std::option::Option::Some(2),
17652 Self::UnknownValue(u) => u.0.value(),
17653 }
17654 }
17655
17656 /// Gets the enum value as a string.
17657 ///
17658 /// Returns `None` if the enum contains an unknown value deserialized from
17659 /// the integer representation of enums.
17660 pub fn name(&self) -> std::option::Option<&str> {
17661 match self {
17662 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
17663 Self::Legacy => std::option::Option::Some("LEGACY"),
17664 Self::Standard => std::option::Option::Some("STANDARD"),
17665 Self::UnknownValue(u) => u.0.name(),
17666 }
17667 }
17668 }
17669
17670 impl std::default::Default for Type {
17671 fn default() -> Self {
17672 use std::convert::From;
17673 Self::from(0)
17674 }
17675 }
17676
17677 impl std::fmt::Display for Type {
17678 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17679 wkt::internal::display_enum(f, self.name(), self.value())
17680 }
17681 }
17682
17683 impl std::convert::From<i32> for Type {
17684 fn from(value: i32) -> Self {
17685 match value {
17686 0 => Self::Unspecified,
17687 1 => Self::Legacy,
17688 2 => Self::Standard,
17689 _ => Self::UnknownValue(r#type::UnknownValue(
17690 wkt::internal::UnknownEnumValue::Integer(value),
17691 )),
17692 }
17693 }
17694 }
17695
17696 impl std::convert::From<&str> for Type {
17697 fn from(value: &str) -> Self {
17698 use std::string::ToString;
17699 match value {
17700 "TYPE_UNSPECIFIED" => Self::Unspecified,
17701 "LEGACY" => Self::Legacy,
17702 "STANDARD" => Self::Standard,
17703 _ => Self::UnknownValue(r#type::UnknownValue(
17704 wkt::internal::UnknownEnumValue::String(value.to_string()),
17705 )),
17706 }
17707 }
17708 }
17709
17710 impl serde::ser::Serialize for Type {
17711 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17712 where
17713 S: serde::Serializer,
17714 {
17715 match self {
17716 Self::Unspecified => serializer.serialize_i32(0),
17717 Self::Legacy => serializer.serialize_i32(1),
17718 Self::Standard => serializer.serialize_i32(2),
17719 Self::UnknownValue(u) => u.0.serialize(serializer),
17720 }
17721 }
17722 }
17723
17724 impl<'de> serde::de::Deserialize<'de> for Type {
17725 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17726 where
17727 D: serde::Deserializer<'de>,
17728 {
17729 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
17730 ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type",
17731 ))
17732 }
17733 }
17734}
17735
17736/// Private connection resource that provides connectivity for VMware Engine
17737/// private clouds.
17738#[derive(Clone, Default, PartialEq)]
17739#[non_exhaustive]
17740pub struct PrivateConnection {
17741 /// Output only. The resource name of the private connection.
17742 /// Resource names are schemeless URIs that follow the conventions in
17743 /// <https://cloud.google.com/apis/design/resource_names>.
17744 /// For example:
17745 /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
17746 pub name: std::string::String,
17747
17748 /// Output only. Creation time of this resource.
17749 pub create_time: std::option::Option<wkt::Timestamp>,
17750
17751 /// Output only. Last update time of this resource.
17752 pub update_time: std::option::Option<wkt::Timestamp>,
17753
17754 /// Optional. User-provided description for this private connection.
17755 pub description: std::string::String,
17756
17757 /// Output only. State of the private connection.
17758 pub state: crate::model::private_connection::State,
17759
17760 /// Required. The relative resource name of Legacy VMware Engine network.
17761 /// Specify the name in the following form:
17762 /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17763 /// where `{project}`, `{location}` will be same as specified in private
17764 /// connection resource name and `{vmware_engine_network_id}` will be in the
17765 /// form of `{location}`-default e.g.
17766 /// projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
17767 pub vmware_engine_network: std::string::String,
17768
17769 /// Output only. The canonical name of the VMware Engine network in the form:
17770 /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
17771 pub vmware_engine_network_canonical: std::string::String,
17772
17773 /// Required. Private connection type.
17774 pub r#type: crate::model::private_connection::Type,
17775
17776 /// Output only. VPC network peering id between given network VPC and
17777 /// VMwareEngineNetwork.
17778 pub peering_id: std::string::String,
17779
17780 /// Optional. Routing Mode.
17781 /// Default value is set to GLOBAL.
17782 /// For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or
17783 /// REGIONAL, for other types only GLOBAL is supported.
17784 pub routing_mode: crate::model::private_connection::RoutingMode,
17785
17786 /// Output only. System-generated unique identifier for the resource.
17787 pub uid: std::string::String,
17788
17789 /// Required. Service network to create private connection.
17790 /// Specify the name in the following form:
17791 /// `projects/{project}/global/networks/{network_id}`
17792 /// For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
17793 /// VPC, e.g. projects/project-tp/global/networks/servicenetworking.
17794 /// For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
17795 /// e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
17796 /// For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
17797 /// projects/project-tp/global/networks/dell-tenant-vpc.
17798 /// For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
17799 /// any other producer VPC to which the VMware Engine Network needs to be
17800 /// connected, e.g. projects/project/global/networks/vpc.
17801 pub service_network: std::string::String,
17802
17803 /// Output only. Peering state between service network and VMware Engine
17804 /// network.
17805 pub peering_state: crate::model::private_connection::PeeringState,
17806
17807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17808}
17809
17810impl PrivateConnection {
17811 /// Creates a new default instance.
17812 pub fn new() -> Self {
17813 std::default::Default::default()
17814 }
17815
17816 /// Sets the value of [name][crate::model::PrivateConnection::name].
17817 ///
17818 /// # Example
17819 /// ```ignore,no_run
17820 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17821 /// # let project_id = "project_id";
17822 /// # let location_id = "location_id";
17823 /// # let private_connection_id = "private_connection_id";
17824 /// let x = PrivateConnection::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
17825 /// ```
17826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17827 self.name = v.into();
17828 self
17829 }
17830
17831 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
17832 ///
17833 /// # Example
17834 /// ```ignore,no_run
17835 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17836 /// use wkt::Timestamp;
17837 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
17838 /// ```
17839 pub fn set_create_time<T>(mut self, v: T) -> Self
17840 where
17841 T: std::convert::Into<wkt::Timestamp>,
17842 {
17843 self.create_time = std::option::Option::Some(v.into());
17844 self
17845 }
17846
17847 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
17848 ///
17849 /// # Example
17850 /// ```ignore,no_run
17851 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17852 /// use wkt::Timestamp;
17853 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17854 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
17855 /// ```
17856 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17857 where
17858 T: std::convert::Into<wkt::Timestamp>,
17859 {
17860 self.create_time = v.map(|x| x.into());
17861 self
17862 }
17863
17864 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
17865 ///
17866 /// # Example
17867 /// ```ignore,no_run
17868 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17869 /// use wkt::Timestamp;
17870 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
17871 /// ```
17872 pub fn set_update_time<T>(mut self, v: T) -> Self
17873 where
17874 T: std::convert::Into<wkt::Timestamp>,
17875 {
17876 self.update_time = std::option::Option::Some(v.into());
17877 self
17878 }
17879
17880 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
17881 ///
17882 /// # Example
17883 /// ```ignore,no_run
17884 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17885 /// use wkt::Timestamp;
17886 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17887 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
17888 /// ```
17889 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17890 where
17891 T: std::convert::Into<wkt::Timestamp>,
17892 {
17893 self.update_time = v.map(|x| x.into());
17894 self
17895 }
17896
17897 /// Sets the value of [description][crate::model::PrivateConnection::description].
17898 ///
17899 /// # Example
17900 /// ```ignore,no_run
17901 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17902 /// let x = PrivateConnection::new().set_description("example");
17903 /// ```
17904 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17905 self.description = v.into();
17906 self
17907 }
17908
17909 /// Sets the value of [state][crate::model::PrivateConnection::state].
17910 ///
17911 /// # Example
17912 /// ```ignore,no_run
17913 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17914 /// use google_cloud_vmwareengine_v1::model::private_connection::State;
17915 /// let x0 = PrivateConnection::new().set_state(State::Creating);
17916 /// let x1 = PrivateConnection::new().set_state(State::Active);
17917 /// let x2 = PrivateConnection::new().set_state(State::Updating);
17918 /// ```
17919 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
17920 mut self,
17921 v: T,
17922 ) -> Self {
17923 self.state = v.into();
17924 self
17925 }
17926
17927 /// Sets the value of [vmware_engine_network][crate::model::PrivateConnection::vmware_engine_network].
17928 ///
17929 /// # Example
17930 /// ```ignore,no_run
17931 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17932 /// # let project_id = "project_id";
17933 /// # let location_id = "location_id";
17934 /// # let vmware_engine_network_id = "vmware_engine_network_id";
17935 /// let x = PrivateConnection::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
17936 /// ```
17937 pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
17938 mut self,
17939 v: T,
17940 ) -> Self {
17941 self.vmware_engine_network = v.into();
17942 self
17943 }
17944
17945 /// Sets the value of [vmware_engine_network_canonical][crate::model::PrivateConnection::vmware_engine_network_canonical].
17946 ///
17947 /// # Example
17948 /// ```ignore,no_run
17949 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17950 /// # let project_id = "project_id";
17951 /// # let location_id = "location_id";
17952 /// # let vmware_engine_network_id = "vmware_engine_network_id";
17953 /// let x = PrivateConnection::new().set_vmware_engine_network_canonical(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));
17954 /// ```
17955 pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
17956 mut self,
17957 v: T,
17958 ) -> Self {
17959 self.vmware_engine_network_canonical = v.into();
17960 self
17961 }
17962
17963 /// Sets the value of [r#type][crate::model::PrivateConnection::type].
17964 ///
17965 /// # Example
17966 /// ```ignore,no_run
17967 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17968 /// use google_cloud_vmwareengine_v1::model::private_connection::Type;
17969 /// let x0 = PrivateConnection::new().set_type(Type::PrivateServiceAccess);
17970 /// let x1 = PrivateConnection::new().set_type(Type::NetappCloudVolumes);
17971 /// let x2 = PrivateConnection::new().set_type(Type::DellPowerscale);
17972 /// ```
17973 pub fn set_type<T: std::convert::Into<crate::model::private_connection::Type>>(
17974 mut self,
17975 v: T,
17976 ) -> Self {
17977 self.r#type = v.into();
17978 self
17979 }
17980
17981 /// Sets the value of [peering_id][crate::model::PrivateConnection::peering_id].
17982 ///
17983 /// # Example
17984 /// ```ignore,no_run
17985 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17986 /// let x = PrivateConnection::new().set_peering_id("example");
17987 /// ```
17988 pub fn set_peering_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17989 self.peering_id = v.into();
17990 self
17991 }
17992
17993 /// Sets the value of [routing_mode][crate::model::PrivateConnection::routing_mode].
17994 ///
17995 /// # Example
17996 /// ```ignore,no_run
17997 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
17998 /// use google_cloud_vmwareengine_v1::model::private_connection::RoutingMode;
17999 /// let x0 = PrivateConnection::new().set_routing_mode(RoutingMode::Global);
18000 /// let x1 = PrivateConnection::new().set_routing_mode(RoutingMode::Regional);
18001 /// ```
18002 pub fn set_routing_mode<
18003 T: std::convert::Into<crate::model::private_connection::RoutingMode>,
18004 >(
18005 mut self,
18006 v: T,
18007 ) -> Self {
18008 self.routing_mode = v.into();
18009 self
18010 }
18011
18012 /// Sets the value of [uid][crate::model::PrivateConnection::uid].
18013 ///
18014 /// # Example
18015 /// ```ignore,no_run
18016 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
18017 /// let x = PrivateConnection::new().set_uid("example");
18018 /// ```
18019 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18020 self.uid = v.into();
18021 self
18022 }
18023
18024 /// Sets the value of [service_network][crate::model::PrivateConnection::service_network].
18025 ///
18026 /// # Example
18027 /// ```ignore,no_run
18028 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
18029 /// let x = PrivateConnection::new().set_service_network("example");
18030 /// ```
18031 pub fn set_service_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18032 self.service_network = v.into();
18033 self
18034 }
18035
18036 /// Sets the value of [peering_state][crate::model::PrivateConnection::peering_state].
18037 ///
18038 /// # Example
18039 /// ```ignore,no_run
18040 /// # use google_cloud_vmwareengine_v1::model::PrivateConnection;
18041 /// use google_cloud_vmwareengine_v1::model::private_connection::PeeringState;
18042 /// let x0 = PrivateConnection::new().set_peering_state(PeeringState::PeeringActive);
18043 /// let x1 = PrivateConnection::new().set_peering_state(PeeringState::PeeringInactive);
18044 /// ```
18045 pub fn set_peering_state<
18046 T: std::convert::Into<crate::model::private_connection::PeeringState>,
18047 >(
18048 mut self,
18049 v: T,
18050 ) -> Self {
18051 self.peering_state = v.into();
18052 self
18053 }
18054}
18055
18056impl wkt::message::Message for PrivateConnection {
18057 fn typename() -> &'static str {
18058 "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateConnection"
18059 }
18060}
18061
18062/// Defines additional types related to [PrivateConnection].
18063pub mod private_connection {
18064 #[allow(unused_imports)]
18065 use super::*;
18066
18067 /// Enum State defines possible states of private connection.
18068 ///
18069 /// # Working with unknown values
18070 ///
18071 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18072 /// additional enum variants at any time. Adding new variants is not considered
18073 /// a breaking change. Applications should write their code in anticipation of:
18074 ///
18075 /// - New values appearing in future releases of the client library, **and**
18076 /// - New values received dynamically, without application changes.
18077 ///
18078 /// Please consult the [Working with enums] section in the user guide for some
18079 /// guidelines.
18080 ///
18081 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18082 #[derive(Clone, Debug, PartialEq)]
18083 #[non_exhaustive]
18084 pub enum State {
18085 /// The default value. This value is used if the state is omitted.
18086 Unspecified,
18087 /// The private connection is being created.
18088 Creating,
18089 /// The private connection is ready.
18090 Active,
18091 /// The private connection is being updated.
18092 Updating,
18093 /// The private connection is being deleted.
18094 Deleting,
18095 /// The private connection is not provisioned, since no private cloud is
18096 /// present for which this private connection is needed.
18097 Unprovisioned,
18098 /// The private connection is in failed state.
18099 Failed,
18100 /// If set, the enum was initialized with an unknown value.
18101 ///
18102 /// Applications can examine the value using [State::value] or
18103 /// [State::name].
18104 UnknownValue(state::UnknownValue),
18105 }
18106
18107 #[doc(hidden)]
18108 pub mod state {
18109 #[allow(unused_imports)]
18110 use super::*;
18111 #[derive(Clone, Debug, PartialEq)]
18112 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18113 }
18114
18115 impl State {
18116 /// Gets the enum value.
18117 ///
18118 /// Returns `None` if the enum contains an unknown value deserialized from
18119 /// the string representation of enums.
18120 pub fn value(&self) -> std::option::Option<i32> {
18121 match self {
18122 Self::Unspecified => std::option::Option::Some(0),
18123 Self::Creating => std::option::Option::Some(1),
18124 Self::Active => std::option::Option::Some(2),
18125 Self::Updating => std::option::Option::Some(3),
18126 Self::Deleting => std::option::Option::Some(4),
18127 Self::Unprovisioned => std::option::Option::Some(5),
18128 Self::Failed => std::option::Option::Some(6),
18129 Self::UnknownValue(u) => u.0.value(),
18130 }
18131 }
18132
18133 /// Gets the enum value as a string.
18134 ///
18135 /// Returns `None` if the enum contains an unknown value deserialized from
18136 /// the integer representation of enums.
18137 pub fn name(&self) -> std::option::Option<&str> {
18138 match self {
18139 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18140 Self::Creating => std::option::Option::Some("CREATING"),
18141 Self::Active => std::option::Option::Some("ACTIVE"),
18142 Self::Updating => std::option::Option::Some("UPDATING"),
18143 Self::Deleting => std::option::Option::Some("DELETING"),
18144 Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
18145 Self::Failed => std::option::Option::Some("FAILED"),
18146 Self::UnknownValue(u) => u.0.name(),
18147 }
18148 }
18149 }
18150
18151 impl std::default::Default for State {
18152 fn default() -> Self {
18153 use std::convert::From;
18154 Self::from(0)
18155 }
18156 }
18157
18158 impl std::fmt::Display for State {
18159 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18160 wkt::internal::display_enum(f, self.name(), self.value())
18161 }
18162 }
18163
18164 impl std::convert::From<i32> for State {
18165 fn from(value: i32) -> Self {
18166 match value {
18167 0 => Self::Unspecified,
18168 1 => Self::Creating,
18169 2 => Self::Active,
18170 3 => Self::Updating,
18171 4 => Self::Deleting,
18172 5 => Self::Unprovisioned,
18173 6 => Self::Failed,
18174 _ => Self::UnknownValue(state::UnknownValue(
18175 wkt::internal::UnknownEnumValue::Integer(value),
18176 )),
18177 }
18178 }
18179 }
18180
18181 impl std::convert::From<&str> for State {
18182 fn from(value: &str) -> Self {
18183 use std::string::ToString;
18184 match value {
18185 "STATE_UNSPECIFIED" => Self::Unspecified,
18186 "CREATING" => Self::Creating,
18187 "ACTIVE" => Self::Active,
18188 "UPDATING" => Self::Updating,
18189 "DELETING" => Self::Deleting,
18190 "UNPROVISIONED" => Self::Unprovisioned,
18191 "FAILED" => Self::Failed,
18192 _ => Self::UnknownValue(state::UnknownValue(
18193 wkt::internal::UnknownEnumValue::String(value.to_string()),
18194 )),
18195 }
18196 }
18197 }
18198
18199 impl serde::ser::Serialize for State {
18200 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18201 where
18202 S: serde::Serializer,
18203 {
18204 match self {
18205 Self::Unspecified => serializer.serialize_i32(0),
18206 Self::Creating => serializer.serialize_i32(1),
18207 Self::Active => serializer.serialize_i32(2),
18208 Self::Updating => serializer.serialize_i32(3),
18209 Self::Deleting => serializer.serialize_i32(4),
18210 Self::Unprovisioned => serializer.serialize_i32(5),
18211 Self::Failed => serializer.serialize_i32(6),
18212 Self::UnknownValue(u) => u.0.serialize(serializer),
18213 }
18214 }
18215 }
18216
18217 impl<'de> serde::de::Deserialize<'de> for State {
18218 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18219 where
18220 D: serde::Deserializer<'de>,
18221 {
18222 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18223 ".google.cloud.vmwareengine.v1.PrivateConnection.State",
18224 ))
18225 }
18226 }
18227
18228 /// Enum Type defines possible types of private connection.
18229 ///
18230 /// # Working with unknown values
18231 ///
18232 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18233 /// additional enum variants at any time. Adding new variants is not considered
18234 /// a breaking change. Applications should write their code in anticipation of:
18235 ///
18236 /// - New values appearing in future releases of the client library, **and**
18237 /// - New values received dynamically, without application changes.
18238 ///
18239 /// Please consult the [Working with enums] section in the user guide for some
18240 /// guidelines.
18241 ///
18242 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18243 #[derive(Clone, Debug, PartialEq)]
18244 #[non_exhaustive]
18245 pub enum Type {
18246 /// The default value. This value should never be used.
18247 Unspecified,
18248 /// Connection used for establishing [private services
18249 /// access](https://cloud.google.com/vpc/docs/private-services-access).
18250 PrivateServiceAccess,
18251 /// Connection used for connecting to NetApp Cloud Volumes.
18252 NetappCloudVolumes,
18253 /// Connection used for connecting to Dell PowerScale.
18254 DellPowerscale,
18255 /// Connection used for connecting to third-party services.
18256 ThirdPartyService,
18257 /// If set, the enum was initialized with an unknown value.
18258 ///
18259 /// Applications can examine the value using [Type::value] or
18260 /// [Type::name].
18261 UnknownValue(r#type::UnknownValue),
18262 }
18263
18264 #[doc(hidden)]
18265 pub mod r#type {
18266 #[allow(unused_imports)]
18267 use super::*;
18268 #[derive(Clone, Debug, PartialEq)]
18269 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18270 }
18271
18272 impl Type {
18273 /// Gets the enum value.
18274 ///
18275 /// Returns `None` if the enum contains an unknown value deserialized from
18276 /// the string representation of enums.
18277 pub fn value(&self) -> std::option::Option<i32> {
18278 match self {
18279 Self::Unspecified => std::option::Option::Some(0),
18280 Self::PrivateServiceAccess => std::option::Option::Some(1),
18281 Self::NetappCloudVolumes => std::option::Option::Some(2),
18282 Self::DellPowerscale => std::option::Option::Some(3),
18283 Self::ThirdPartyService => std::option::Option::Some(4),
18284 Self::UnknownValue(u) => u.0.value(),
18285 }
18286 }
18287
18288 /// Gets the enum value as a string.
18289 ///
18290 /// Returns `None` if the enum contains an unknown value deserialized from
18291 /// the integer representation of enums.
18292 pub fn name(&self) -> std::option::Option<&str> {
18293 match self {
18294 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
18295 Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
18296 Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
18297 Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
18298 Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
18299 Self::UnknownValue(u) => u.0.name(),
18300 }
18301 }
18302 }
18303
18304 impl std::default::Default for Type {
18305 fn default() -> Self {
18306 use std::convert::From;
18307 Self::from(0)
18308 }
18309 }
18310
18311 impl std::fmt::Display for Type {
18312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18313 wkt::internal::display_enum(f, self.name(), self.value())
18314 }
18315 }
18316
18317 impl std::convert::From<i32> for Type {
18318 fn from(value: i32) -> Self {
18319 match value {
18320 0 => Self::Unspecified,
18321 1 => Self::PrivateServiceAccess,
18322 2 => Self::NetappCloudVolumes,
18323 3 => Self::DellPowerscale,
18324 4 => Self::ThirdPartyService,
18325 _ => Self::UnknownValue(r#type::UnknownValue(
18326 wkt::internal::UnknownEnumValue::Integer(value),
18327 )),
18328 }
18329 }
18330 }
18331
18332 impl std::convert::From<&str> for Type {
18333 fn from(value: &str) -> Self {
18334 use std::string::ToString;
18335 match value {
18336 "TYPE_UNSPECIFIED" => Self::Unspecified,
18337 "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
18338 "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
18339 "DELL_POWERSCALE" => Self::DellPowerscale,
18340 "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
18341 _ => Self::UnknownValue(r#type::UnknownValue(
18342 wkt::internal::UnknownEnumValue::String(value.to_string()),
18343 )),
18344 }
18345 }
18346 }
18347
18348 impl serde::ser::Serialize for Type {
18349 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18350 where
18351 S: serde::Serializer,
18352 {
18353 match self {
18354 Self::Unspecified => serializer.serialize_i32(0),
18355 Self::PrivateServiceAccess => serializer.serialize_i32(1),
18356 Self::NetappCloudVolumes => serializer.serialize_i32(2),
18357 Self::DellPowerscale => serializer.serialize_i32(3),
18358 Self::ThirdPartyService => serializer.serialize_i32(4),
18359 Self::UnknownValue(u) => u.0.serialize(serializer),
18360 }
18361 }
18362 }
18363
18364 impl<'de> serde::de::Deserialize<'de> for Type {
18365 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18366 where
18367 D: serde::Deserializer<'de>,
18368 {
18369 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
18370 ".google.cloud.vmwareengine.v1.PrivateConnection.Type",
18371 ))
18372 }
18373 }
18374
18375 /// Possible types for RoutingMode
18376 ///
18377 /// # Working with unknown values
18378 ///
18379 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18380 /// additional enum variants at any time. Adding new variants is not considered
18381 /// a breaking change. Applications should write their code in anticipation of:
18382 ///
18383 /// - New values appearing in future releases of the client library, **and**
18384 /// - New values received dynamically, without application changes.
18385 ///
18386 /// Please consult the [Working with enums] section in the user guide for some
18387 /// guidelines.
18388 ///
18389 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18390 #[derive(Clone, Debug, PartialEq)]
18391 #[non_exhaustive]
18392 pub enum RoutingMode {
18393 /// The default value. This value should never be used.
18394 Unspecified,
18395 /// Global Routing Mode
18396 Global,
18397 /// Regional Routing Mode
18398 Regional,
18399 /// If set, the enum was initialized with an unknown value.
18400 ///
18401 /// Applications can examine the value using [RoutingMode::value] or
18402 /// [RoutingMode::name].
18403 UnknownValue(routing_mode::UnknownValue),
18404 }
18405
18406 #[doc(hidden)]
18407 pub mod routing_mode {
18408 #[allow(unused_imports)]
18409 use super::*;
18410 #[derive(Clone, Debug, PartialEq)]
18411 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18412 }
18413
18414 impl RoutingMode {
18415 /// Gets the enum value.
18416 ///
18417 /// Returns `None` if the enum contains an unknown value deserialized from
18418 /// the string representation of enums.
18419 pub fn value(&self) -> std::option::Option<i32> {
18420 match self {
18421 Self::Unspecified => std::option::Option::Some(0),
18422 Self::Global => std::option::Option::Some(1),
18423 Self::Regional => std::option::Option::Some(2),
18424 Self::UnknownValue(u) => u.0.value(),
18425 }
18426 }
18427
18428 /// Gets the enum value as a string.
18429 ///
18430 /// Returns `None` if the enum contains an unknown value deserialized from
18431 /// the integer representation of enums.
18432 pub fn name(&self) -> std::option::Option<&str> {
18433 match self {
18434 Self::Unspecified => std::option::Option::Some("ROUTING_MODE_UNSPECIFIED"),
18435 Self::Global => std::option::Option::Some("GLOBAL"),
18436 Self::Regional => std::option::Option::Some("REGIONAL"),
18437 Self::UnknownValue(u) => u.0.name(),
18438 }
18439 }
18440 }
18441
18442 impl std::default::Default for RoutingMode {
18443 fn default() -> Self {
18444 use std::convert::From;
18445 Self::from(0)
18446 }
18447 }
18448
18449 impl std::fmt::Display for RoutingMode {
18450 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18451 wkt::internal::display_enum(f, self.name(), self.value())
18452 }
18453 }
18454
18455 impl std::convert::From<i32> for RoutingMode {
18456 fn from(value: i32) -> Self {
18457 match value {
18458 0 => Self::Unspecified,
18459 1 => Self::Global,
18460 2 => Self::Regional,
18461 _ => Self::UnknownValue(routing_mode::UnknownValue(
18462 wkt::internal::UnknownEnumValue::Integer(value),
18463 )),
18464 }
18465 }
18466 }
18467
18468 impl std::convert::From<&str> for RoutingMode {
18469 fn from(value: &str) -> Self {
18470 use std::string::ToString;
18471 match value {
18472 "ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
18473 "GLOBAL" => Self::Global,
18474 "REGIONAL" => Self::Regional,
18475 _ => Self::UnknownValue(routing_mode::UnknownValue(
18476 wkt::internal::UnknownEnumValue::String(value.to_string()),
18477 )),
18478 }
18479 }
18480 }
18481
18482 impl serde::ser::Serialize for RoutingMode {
18483 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18484 where
18485 S: serde::Serializer,
18486 {
18487 match self {
18488 Self::Unspecified => serializer.serialize_i32(0),
18489 Self::Global => serializer.serialize_i32(1),
18490 Self::Regional => serializer.serialize_i32(2),
18491 Self::UnknownValue(u) => u.0.serialize(serializer),
18492 }
18493 }
18494 }
18495
18496 impl<'de> serde::de::Deserialize<'de> for RoutingMode {
18497 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18498 where
18499 D: serde::Deserializer<'de>,
18500 {
18501 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingMode>::new(
18502 ".google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode",
18503 ))
18504 }
18505 }
18506
18507 /// Enum PeeringState defines the possible states of peering between service
18508 /// network and the vpc network peered to service network
18509 ///
18510 /// # Working with unknown values
18511 ///
18512 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18513 /// additional enum variants at any time. Adding new variants is not considered
18514 /// a breaking change. Applications should write their code in anticipation of:
18515 ///
18516 /// - New values appearing in future releases of the client library, **and**
18517 /// - New values received dynamically, without application changes.
18518 ///
18519 /// Please consult the [Working with enums] section in the user guide for some
18520 /// guidelines.
18521 ///
18522 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18523 #[derive(Clone, Debug, PartialEq)]
18524 #[non_exhaustive]
18525 pub enum PeeringState {
18526 /// The default value. This value is used if the peering state is omitted or
18527 /// unknown.
18528 Unspecified,
18529 /// The peering is in active state.
18530 PeeringActive,
18531 /// The peering is in inactive state.
18532 PeeringInactive,
18533 /// If set, the enum was initialized with an unknown value.
18534 ///
18535 /// Applications can examine the value using [PeeringState::value] or
18536 /// [PeeringState::name].
18537 UnknownValue(peering_state::UnknownValue),
18538 }
18539
18540 #[doc(hidden)]
18541 pub mod peering_state {
18542 #[allow(unused_imports)]
18543 use super::*;
18544 #[derive(Clone, Debug, PartialEq)]
18545 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18546 }
18547
18548 impl PeeringState {
18549 /// Gets the enum value.
18550 ///
18551 /// Returns `None` if the enum contains an unknown value deserialized from
18552 /// the string representation of enums.
18553 pub fn value(&self) -> std::option::Option<i32> {
18554 match self {
18555 Self::Unspecified => std::option::Option::Some(0),
18556 Self::PeeringActive => std::option::Option::Some(1),
18557 Self::PeeringInactive => std::option::Option::Some(2),
18558 Self::UnknownValue(u) => u.0.value(),
18559 }
18560 }
18561
18562 /// Gets the enum value as a string.
18563 ///
18564 /// Returns `None` if the enum contains an unknown value deserialized from
18565 /// the integer representation of enums.
18566 pub fn name(&self) -> std::option::Option<&str> {
18567 match self {
18568 Self::Unspecified => std::option::Option::Some("PEERING_STATE_UNSPECIFIED"),
18569 Self::PeeringActive => std::option::Option::Some("PEERING_ACTIVE"),
18570 Self::PeeringInactive => std::option::Option::Some("PEERING_INACTIVE"),
18571 Self::UnknownValue(u) => u.0.name(),
18572 }
18573 }
18574 }
18575
18576 impl std::default::Default for PeeringState {
18577 fn default() -> Self {
18578 use std::convert::From;
18579 Self::from(0)
18580 }
18581 }
18582
18583 impl std::fmt::Display for PeeringState {
18584 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18585 wkt::internal::display_enum(f, self.name(), self.value())
18586 }
18587 }
18588
18589 impl std::convert::From<i32> for PeeringState {
18590 fn from(value: i32) -> Self {
18591 match value {
18592 0 => Self::Unspecified,
18593 1 => Self::PeeringActive,
18594 2 => Self::PeeringInactive,
18595 _ => Self::UnknownValue(peering_state::UnknownValue(
18596 wkt::internal::UnknownEnumValue::Integer(value),
18597 )),
18598 }
18599 }
18600 }
18601
18602 impl std::convert::From<&str> for PeeringState {
18603 fn from(value: &str) -> Self {
18604 use std::string::ToString;
18605 match value {
18606 "PEERING_STATE_UNSPECIFIED" => Self::Unspecified,
18607 "PEERING_ACTIVE" => Self::PeeringActive,
18608 "PEERING_INACTIVE" => Self::PeeringInactive,
18609 _ => Self::UnknownValue(peering_state::UnknownValue(
18610 wkt::internal::UnknownEnumValue::String(value.to_string()),
18611 )),
18612 }
18613 }
18614 }
18615
18616 impl serde::ser::Serialize for PeeringState {
18617 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18618 where
18619 S: serde::Serializer,
18620 {
18621 match self {
18622 Self::Unspecified => serializer.serialize_i32(0),
18623 Self::PeeringActive => serializer.serialize_i32(1),
18624 Self::PeeringInactive => serializer.serialize_i32(2),
18625 Self::UnknownValue(u) => u.0.serialize(serializer),
18626 }
18627 }
18628 }
18629
18630 impl<'de> serde::de::Deserialize<'de> for PeeringState {
18631 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18632 where
18633 D: serde::Deserializer<'de>,
18634 {
18635 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeeringState>::new(
18636 ".google.cloud.vmwareengine.v1.PrivateConnection.PeeringState",
18637 ))
18638 }
18639 }
18640}
18641
18642/// VmwareEngine specific metadata for the given
18643/// [google.cloud.location.Location][google.cloud.location.Location]. It is
18644/// returned as a content of the `google.cloud.location.Location.metadata` field.
18645///
18646/// [google.cloud.location.Location]: google_cloud_location::model::Location
18647#[derive(Clone, Default, PartialEq)]
18648#[non_exhaustive]
18649pub struct LocationMetadata {
18650 /// Output only. Capabilities of this location.
18651 pub capabilities: std::vec::Vec<crate::model::location_metadata::Capability>,
18652
18653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18654}
18655
18656impl LocationMetadata {
18657 /// Creates a new default instance.
18658 pub fn new() -> Self {
18659 std::default::Default::default()
18660 }
18661
18662 /// Sets the value of [capabilities][crate::model::LocationMetadata::capabilities].
18663 ///
18664 /// # Example
18665 /// ```ignore,no_run
18666 /// # use google_cloud_vmwareengine_v1::model::LocationMetadata;
18667 /// use google_cloud_vmwareengine_v1::model::location_metadata::Capability;
18668 /// let x = LocationMetadata::new().set_capabilities([
18669 /// Capability::StretchedClusters,
18670 /// ]);
18671 /// ```
18672 pub fn set_capabilities<T, V>(mut self, v: T) -> Self
18673 where
18674 T: std::iter::IntoIterator<Item = V>,
18675 V: std::convert::Into<crate::model::location_metadata::Capability>,
18676 {
18677 use std::iter::Iterator;
18678 self.capabilities = v.into_iter().map(|i| i.into()).collect();
18679 self
18680 }
18681}
18682
18683impl wkt::message::Message for LocationMetadata {
18684 fn typename() -> &'static str {
18685 "type.googleapis.com/google.cloud.vmwareengine.v1.LocationMetadata"
18686 }
18687}
18688
18689/// Defines additional types related to [LocationMetadata].
18690pub mod location_metadata {
18691 #[allow(unused_imports)]
18692 use super::*;
18693
18694 /// Capability of a location.
18695 ///
18696 /// # Working with unknown values
18697 ///
18698 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18699 /// additional enum variants at any time. Adding new variants is not considered
18700 /// a breaking change. Applications should write their code in anticipation of:
18701 ///
18702 /// - New values appearing in future releases of the client library, **and**
18703 /// - New values received dynamically, without application changes.
18704 ///
18705 /// Please consult the [Working with enums] section in the user guide for some
18706 /// guidelines.
18707 ///
18708 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18709 #[derive(Clone, Debug, PartialEq)]
18710 #[non_exhaustive]
18711 pub enum Capability {
18712 /// The default value. This value is used if the capability is omitted or
18713 /// unknown.
18714 Unspecified,
18715 /// Stretch clusters are supported in this location.
18716 StretchedClusters,
18717 /// If set, the enum was initialized with an unknown value.
18718 ///
18719 /// Applications can examine the value using [Capability::value] or
18720 /// [Capability::name].
18721 UnknownValue(capability::UnknownValue),
18722 }
18723
18724 #[doc(hidden)]
18725 pub mod capability {
18726 #[allow(unused_imports)]
18727 use super::*;
18728 #[derive(Clone, Debug, PartialEq)]
18729 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18730 }
18731
18732 impl Capability {
18733 /// Gets the enum value.
18734 ///
18735 /// Returns `None` if the enum contains an unknown value deserialized from
18736 /// the string representation of enums.
18737 pub fn value(&self) -> std::option::Option<i32> {
18738 match self {
18739 Self::Unspecified => std::option::Option::Some(0),
18740 Self::StretchedClusters => std::option::Option::Some(1),
18741 Self::UnknownValue(u) => u.0.value(),
18742 }
18743 }
18744
18745 /// Gets the enum value as a string.
18746 ///
18747 /// Returns `None` if the enum contains an unknown value deserialized from
18748 /// the integer representation of enums.
18749 pub fn name(&self) -> std::option::Option<&str> {
18750 match self {
18751 Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
18752 Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
18753 Self::UnknownValue(u) => u.0.name(),
18754 }
18755 }
18756 }
18757
18758 impl std::default::Default for Capability {
18759 fn default() -> Self {
18760 use std::convert::From;
18761 Self::from(0)
18762 }
18763 }
18764
18765 impl std::fmt::Display for Capability {
18766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18767 wkt::internal::display_enum(f, self.name(), self.value())
18768 }
18769 }
18770
18771 impl std::convert::From<i32> for Capability {
18772 fn from(value: i32) -> Self {
18773 match value {
18774 0 => Self::Unspecified,
18775 1 => Self::StretchedClusters,
18776 _ => Self::UnknownValue(capability::UnknownValue(
18777 wkt::internal::UnknownEnumValue::Integer(value),
18778 )),
18779 }
18780 }
18781 }
18782
18783 impl std::convert::From<&str> for Capability {
18784 fn from(value: &str) -> Self {
18785 use std::string::ToString;
18786 match value {
18787 "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
18788 "STRETCHED_CLUSTERS" => Self::StretchedClusters,
18789 _ => Self::UnknownValue(capability::UnknownValue(
18790 wkt::internal::UnknownEnumValue::String(value.to_string()),
18791 )),
18792 }
18793 }
18794 }
18795
18796 impl serde::ser::Serialize for Capability {
18797 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18798 where
18799 S: serde::Serializer,
18800 {
18801 match self {
18802 Self::Unspecified => serializer.serialize_i32(0),
18803 Self::StretchedClusters => serializer.serialize_i32(1),
18804 Self::UnknownValue(u) => u.0.serialize(serializer),
18805 }
18806 }
18807 }
18808
18809 impl<'de> serde::de::Deserialize<'de> for Capability {
18810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18811 where
18812 D: serde::Deserializer<'de>,
18813 {
18814 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
18815 ".google.cloud.vmwareengine.v1.LocationMetadata.Capability",
18816 ))
18817 }
18818 }
18819}
18820
18821/// DnsBindPermission resource that contains the accounts having the consumer DNS
18822/// bind permission on the corresponding intranet VPC of the consumer project.
18823#[derive(Clone, Default, PartialEq)]
18824#[non_exhaustive]
18825pub struct DnsBindPermission {
18826 /// Required. Output only. The name of the resource which stores the
18827 /// users/service accounts having the permission to bind to the corresponding
18828 /// intranet VPC of the consumer project. DnsBindPermission is a global
18829 /// resource and location can only be global. Resource names are schemeless
18830 /// URIs that follow the conventions in
18831 /// <https://cloud.google.com/apis/design/resource_names>. For example:
18832 /// `projects/my-project/locations/global/dnsBindPermission`
18833 pub name: std::string::String,
18834
18835 /// Output only. Users/Service accounts which have access for binding on the
18836 /// intranet VPC project corresponding to the consumer project.
18837 pub principals: std::vec::Vec<crate::model::Principal>,
18838
18839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18840}
18841
18842impl DnsBindPermission {
18843 /// Creates a new default instance.
18844 pub fn new() -> Self {
18845 std::default::Default::default()
18846 }
18847
18848 /// Sets the value of [name][crate::model::DnsBindPermission::name].
18849 ///
18850 /// # Example
18851 /// ```ignore,no_run
18852 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18853 /// # let project_id = "project_id";
18854 /// # let location_id = "location_id";
18855 /// let x = DnsBindPermission::new().set_name(format!("projects/{project_id}/locations/{location_id}/dnsBindPermission"));
18856 /// ```
18857 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18858 self.name = v.into();
18859 self
18860 }
18861
18862 /// Sets the value of [principals][crate::model::DnsBindPermission::principals].
18863 ///
18864 /// # Example
18865 /// ```ignore,no_run
18866 /// # use google_cloud_vmwareengine_v1::model::DnsBindPermission;
18867 /// use google_cloud_vmwareengine_v1::model::Principal;
18868 /// let x = DnsBindPermission::new()
18869 /// .set_principals([
18870 /// Principal::default()/* use setters */,
18871 /// Principal::default()/* use (different) setters */,
18872 /// ]);
18873 /// ```
18874 pub fn set_principals<T, V>(mut self, v: T) -> Self
18875 where
18876 T: std::iter::IntoIterator<Item = V>,
18877 V: std::convert::Into<crate::model::Principal>,
18878 {
18879 use std::iter::Iterator;
18880 self.principals = v.into_iter().map(|i| i.into()).collect();
18881 self
18882 }
18883}
18884
18885impl wkt::message::Message for DnsBindPermission {
18886 fn typename() -> &'static str {
18887 "type.googleapis.com/google.cloud.vmwareengine.v1.DnsBindPermission"
18888 }
18889}
18890
18891/// Users/Service accounts which have access for DNS binding on the intranet
18892/// VPC corresponding to the consumer project.
18893#[derive(Clone, Default, PartialEq)]
18894#[non_exhaustive]
18895pub struct Principal {
18896 /// The consumer provided user/service account which needs to be
18897 /// granted permission to DNS bind with the intranet VPC corresponding to the
18898 /// consumer project.
18899 pub principal: std::option::Option<crate::model::principal::Principal>,
18900
18901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18902}
18903
18904impl Principal {
18905 /// Creates a new default instance.
18906 pub fn new() -> Self {
18907 std::default::Default::default()
18908 }
18909
18910 /// Sets the value of [principal][crate::model::Principal::principal].
18911 ///
18912 /// Note that all the setters affecting `principal` are mutually
18913 /// exclusive.
18914 ///
18915 /// # Example
18916 /// ```ignore,no_run
18917 /// # use google_cloud_vmwareengine_v1::model::Principal;
18918 /// use google_cloud_vmwareengine_v1::model::principal::Principal as PrincipalOneOf;
18919 /// let x = Principal::new().set_principal(Some(PrincipalOneOf::User("example".to_string())));
18920 /// ```
18921 pub fn set_principal<
18922 T: std::convert::Into<std::option::Option<crate::model::principal::Principal>>,
18923 >(
18924 mut self,
18925 v: T,
18926 ) -> Self {
18927 self.principal = v.into();
18928 self
18929 }
18930
18931 /// The value of [principal][crate::model::Principal::principal]
18932 /// if it holds a `User`, `None` if the field is not set or
18933 /// holds a different branch.
18934 pub fn user(&self) -> std::option::Option<&std::string::String> {
18935 #[allow(unreachable_patterns)]
18936 self.principal.as_ref().and_then(|v| match v {
18937 crate::model::principal::Principal::User(v) => std::option::Option::Some(v),
18938 _ => std::option::Option::None,
18939 })
18940 }
18941
18942 /// Sets the value of [principal][crate::model::Principal::principal]
18943 /// to hold a `User`.
18944 ///
18945 /// Note that all the setters affecting `principal` are
18946 /// mutually exclusive.
18947 ///
18948 /// # Example
18949 /// ```ignore,no_run
18950 /// # use google_cloud_vmwareengine_v1::model::Principal;
18951 /// let x = Principal::new().set_user("example");
18952 /// assert!(x.user().is_some());
18953 /// assert!(x.service_account().is_none());
18954 /// ```
18955 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18956 self.principal =
18957 std::option::Option::Some(crate::model::principal::Principal::User(v.into()));
18958 self
18959 }
18960
18961 /// The value of [principal][crate::model::Principal::principal]
18962 /// if it holds a `ServiceAccount`, `None` if the field is not set or
18963 /// holds a different branch.
18964 pub fn service_account(&self) -> std::option::Option<&std::string::String> {
18965 #[allow(unreachable_patterns)]
18966 self.principal.as_ref().and_then(|v| match v {
18967 crate::model::principal::Principal::ServiceAccount(v) => std::option::Option::Some(v),
18968 _ => std::option::Option::None,
18969 })
18970 }
18971
18972 /// Sets the value of [principal][crate::model::Principal::principal]
18973 /// to hold a `ServiceAccount`.
18974 ///
18975 /// Note that all the setters affecting `principal` are
18976 /// mutually exclusive.
18977 ///
18978 /// # Example
18979 /// ```ignore,no_run
18980 /// # use google_cloud_vmwareengine_v1::model::Principal;
18981 /// let x = Principal::new().set_service_account("example");
18982 /// assert!(x.service_account().is_some());
18983 /// assert!(x.user().is_none());
18984 /// ```
18985 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18986 self.principal =
18987 std::option::Option::Some(crate::model::principal::Principal::ServiceAccount(v.into()));
18988 self
18989 }
18990}
18991
18992impl wkt::message::Message for Principal {
18993 fn typename() -> &'static str {
18994 "type.googleapis.com/google.cloud.vmwareengine.v1.Principal"
18995 }
18996}
18997
18998/// Defines additional types related to [Principal].
18999pub mod principal {
19000 #[allow(unused_imports)]
19001 use super::*;
19002
19003 /// The consumer provided user/service account which needs to be
19004 /// granted permission to DNS bind with the intranet VPC corresponding to the
19005 /// consumer project.
19006 #[derive(Clone, Debug, PartialEq)]
19007 #[non_exhaustive]
19008 pub enum Principal {
19009 /// The user who needs to be granted permission.
19010 User(std::string::String),
19011 /// The service account which needs to be granted the permission.
19012 ServiceAccount(std::string::String),
19013 }
19014}