google_cloud_vmwareengine_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37/// Request message for
38/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
39///
40/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListPrivateCloudsRequest {
44    /// Required. The resource name of the private cloud to be queried for
45    /// clusters. Resource names are schemeless URIs that follow the conventions in
46    /// <https://cloud.google.com/apis/design/resource_names>.
47    /// For example:
48    /// `projects/my-project/locations/us-central1-a`
49    pub parent: std::string::String,
50
51    /// The maximum number of private clouds to return in one page.
52    /// The service may return fewer than this value.
53    /// The maximum value is coerced to 1000.
54    /// The default value of this field is 500.
55    pub page_size: i32,
56
57    /// A page token, received from a previous `ListPrivateClouds` call.
58    /// Provide this to retrieve the subsequent page.
59    ///
60    /// When paginating, all other parameters provided to `ListPrivateClouds` must
61    /// match the call that provided the page token.
62    pub page_token: std::string::String,
63
64    /// A filter expression that matches resources returned in the response.
65    /// The expression must specify the field name, a comparison operator, and the
66    /// value that you want to use for filtering. The value must be a string, a
67    /// number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or
68    /// `<`.
69    ///
70    /// For example, if you are filtering a list of private clouds, you can exclude
71    /// the ones named `example-pc` by specifying `name != "example-pc"`.
72    ///
73    /// You can also filter nested fields. For example, you could specify
74    /// `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds
75    /// only if they have a matching address in their network configuration.
76    ///
77    /// To filter on multiple expressions, provide each separate expression within
78    /// parentheses. For example:
79    ///
80    /// ```norust
81    /// (name = "example-pc")
82    /// (createTime > "2021-04-12T08:15:10.40Z")
83    /// ```
84    ///
85    /// By default, each expression is an `AND` expression. However, you can
86    /// include `AND` and `OR` expressions explicitly. For example:
87    ///
88    /// ```norust
89    /// (name = "private-cloud-1") AND
90    /// (createTime > "2021-04-12T08:15:10.40Z") OR
91    /// (name = "private-cloud-2")
92    /// ```
93    pub filter: std::string::String,
94
95    /// Sorts list results by a certain order. By default, returned results are
96    /// ordered by `name` in ascending order. You can also sort results in
97    /// descending order based on the `name` value using `orderBy="name desc"`.
98    /// Currently, only ordering by `name` is supported.
99    pub order_by: std::string::String,
100
101    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
102}
103
104impl ListPrivateCloudsRequest {
105    pub fn new() -> Self {
106        std::default::Default::default()
107    }
108
109    /// Sets the value of [parent][crate::model::ListPrivateCloudsRequest::parent].
110    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.parent = v.into();
112        self
113    }
114
115    /// Sets the value of [page_size][crate::model::ListPrivateCloudsRequest::page_size].
116    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
117        self.page_size = v.into();
118        self
119    }
120
121    /// Sets the value of [page_token][crate::model::ListPrivateCloudsRequest::page_token].
122    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123        self.page_token = v.into();
124        self
125    }
126
127    /// Sets the value of [filter][crate::model::ListPrivateCloudsRequest::filter].
128    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129        self.filter = v.into();
130        self
131    }
132
133    /// Sets the value of [order_by][crate::model::ListPrivateCloudsRequest::order_by].
134    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
135        self.order_by = v.into();
136        self
137    }
138}
139
140impl wkt::message::Message for ListPrivateCloudsRequest {
141    fn typename() -> &'static str {
142        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"
143    }
144}
145
146#[doc(hidden)]
147impl<'de> serde::de::Deserialize<'de> for ListPrivateCloudsRequest {
148    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
149    where
150        D: serde::Deserializer<'de>,
151    {
152        #[allow(non_camel_case_types)]
153        #[doc(hidden)]
154        #[derive(PartialEq, Eq, Hash)]
155        enum __FieldTag {
156            __parent,
157            __page_size,
158            __page_token,
159            __filter,
160            __order_by,
161            Unknown(std::string::String),
162        }
163        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
164            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
165            where
166                D: serde::Deserializer<'de>,
167            {
168                struct Visitor;
169                impl<'de> serde::de::Visitor<'de> for Visitor {
170                    type Value = __FieldTag;
171                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
172                        formatter.write_str("a field name for ListPrivateCloudsRequest")
173                    }
174                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
175                    where
176                        E: serde::de::Error,
177                    {
178                        use std::result::Result::Ok;
179                        use std::string::ToString;
180                        match value {
181                            "parent" => Ok(__FieldTag::__parent),
182                            "pageSize" => Ok(__FieldTag::__page_size),
183                            "page_size" => Ok(__FieldTag::__page_size),
184                            "pageToken" => Ok(__FieldTag::__page_token),
185                            "page_token" => Ok(__FieldTag::__page_token),
186                            "filter" => Ok(__FieldTag::__filter),
187                            "orderBy" => Ok(__FieldTag::__order_by),
188                            "order_by" => Ok(__FieldTag::__order_by),
189                            _ => Ok(__FieldTag::Unknown(value.to_string())),
190                        }
191                    }
192                }
193                deserializer.deserialize_identifier(Visitor)
194            }
195        }
196        struct Visitor;
197        impl<'de> serde::de::Visitor<'de> for Visitor {
198            type Value = ListPrivateCloudsRequest;
199            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
200                formatter.write_str("struct ListPrivateCloudsRequest")
201            }
202            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
203            where
204                A: serde::de::MapAccess<'de>,
205            {
206                #[allow(unused_imports)]
207                use serde::de::Error;
208                use std::option::Option::Some;
209                let mut fields = std::collections::HashSet::new();
210                let mut result = Self::Value::new();
211                while let Some(tag) = map.next_key::<__FieldTag>()? {
212                    #[allow(clippy::match_single_binding)]
213                    match tag {
214                        __FieldTag::__parent => {
215                            if !fields.insert(__FieldTag::__parent) {
216                                return std::result::Result::Err(A::Error::duplicate_field(
217                                    "multiple values for parent",
218                                ));
219                            }
220                            result.parent = map
221                                .next_value::<std::option::Option<std::string::String>>()?
222                                .unwrap_or_default();
223                        }
224                        __FieldTag::__page_size => {
225                            if !fields.insert(__FieldTag::__page_size) {
226                                return std::result::Result::Err(A::Error::duplicate_field(
227                                    "multiple values for page_size",
228                                ));
229                            }
230                            struct __With(std::option::Option<i32>);
231                            impl<'de> serde::de::Deserialize<'de> for __With {
232                                fn deserialize<D>(
233                                    deserializer: D,
234                                ) -> std::result::Result<Self, D::Error>
235                                where
236                                    D: serde::de::Deserializer<'de>,
237                                {
238                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
239                                }
240                            }
241                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
242                        }
243                        __FieldTag::__page_token => {
244                            if !fields.insert(__FieldTag::__page_token) {
245                                return std::result::Result::Err(A::Error::duplicate_field(
246                                    "multiple values for page_token",
247                                ));
248                            }
249                            result.page_token = map
250                                .next_value::<std::option::Option<std::string::String>>()?
251                                .unwrap_or_default();
252                        }
253                        __FieldTag::__filter => {
254                            if !fields.insert(__FieldTag::__filter) {
255                                return std::result::Result::Err(A::Error::duplicate_field(
256                                    "multiple values for filter",
257                                ));
258                            }
259                            result.filter = map
260                                .next_value::<std::option::Option<std::string::String>>()?
261                                .unwrap_or_default();
262                        }
263                        __FieldTag::__order_by => {
264                            if !fields.insert(__FieldTag::__order_by) {
265                                return std::result::Result::Err(A::Error::duplicate_field(
266                                    "multiple values for order_by",
267                                ));
268                            }
269                            result.order_by = map
270                                .next_value::<std::option::Option<std::string::String>>()?
271                                .unwrap_or_default();
272                        }
273                        __FieldTag::Unknown(key) => {
274                            let value = map.next_value::<serde_json::Value>()?;
275                            result._unknown_fields.insert(key, value);
276                        }
277                    }
278                }
279                std::result::Result::Ok(result)
280            }
281        }
282        deserializer.deserialize_any(Visitor)
283    }
284}
285
286#[doc(hidden)]
287impl serde::ser::Serialize for ListPrivateCloudsRequest {
288    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
289    where
290        S: serde::ser::Serializer,
291    {
292        use serde::ser::SerializeMap;
293        #[allow(unused_imports)]
294        use std::option::Option::Some;
295        let mut state = serializer.serialize_map(std::option::Option::None)?;
296        if !self.parent.is_empty() {
297            state.serialize_entry("parent", &self.parent)?;
298        }
299        if !wkt::internal::is_default(&self.page_size) {
300            struct __With<'a>(&'a i32);
301            impl<'a> serde::ser::Serialize for __With<'a> {
302                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
303                where
304                    S: serde::ser::Serializer,
305                {
306                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
307                }
308            }
309            state.serialize_entry("pageSize", &__With(&self.page_size))?;
310        }
311        if !self.page_token.is_empty() {
312            state.serialize_entry("pageToken", &self.page_token)?;
313        }
314        if !self.filter.is_empty() {
315            state.serialize_entry("filter", &self.filter)?;
316        }
317        if !self.order_by.is_empty() {
318            state.serialize_entry("orderBy", &self.order_by)?;
319        }
320        if !self._unknown_fields.is_empty() {
321            for (key, value) in self._unknown_fields.iter() {
322                state.serialize_entry(key, &value)?;
323            }
324        }
325        state.end()
326    }
327}
328
329impl std::fmt::Debug for ListPrivateCloudsRequest {
330    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
331        let mut debug_struct = f.debug_struct("ListPrivateCloudsRequest");
332        debug_struct.field("parent", &self.parent);
333        debug_struct.field("page_size", &self.page_size);
334        debug_struct.field("page_token", &self.page_token);
335        debug_struct.field("filter", &self.filter);
336        debug_struct.field("order_by", &self.order_by);
337        if !self._unknown_fields.is_empty() {
338            debug_struct.field("_unknown_fields", &self._unknown_fields);
339        }
340        debug_struct.finish()
341    }
342}
343
344/// Response message for
345/// [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]
346///
347/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds]: crate::client::VmwareEngine::list_private_clouds
348#[derive(Clone, Default, PartialEq)]
349#[non_exhaustive]
350pub struct ListPrivateCloudsResponse {
351    /// A list of private clouds.
352    pub private_clouds: std::vec::Vec<crate::model::PrivateCloud>,
353
354    /// A token, which can be sent as `page_token` to retrieve the next page.
355    /// If this field is omitted, there are no subsequent pages.
356    pub next_page_token: std::string::String,
357
358    /// Locations that could not be reached when making an aggregated query using
359    /// wildcards.
360    pub unreachable: std::vec::Vec<std::string::String>,
361
362    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
363}
364
365impl ListPrivateCloudsResponse {
366    pub fn new() -> Self {
367        std::default::Default::default()
368    }
369
370    /// Sets the value of [private_clouds][crate::model::ListPrivateCloudsResponse::private_clouds].
371    pub fn set_private_clouds<T, V>(mut self, v: T) -> Self
372    where
373        T: std::iter::IntoIterator<Item = V>,
374        V: std::convert::Into<crate::model::PrivateCloud>,
375    {
376        use std::iter::Iterator;
377        self.private_clouds = v.into_iter().map(|i| i.into()).collect();
378        self
379    }
380
381    /// Sets the value of [next_page_token][crate::model::ListPrivateCloudsResponse::next_page_token].
382    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
383        self.next_page_token = v.into();
384        self
385    }
386
387    /// Sets the value of [unreachable][crate::model::ListPrivateCloudsResponse::unreachable].
388    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
389    where
390        T: std::iter::IntoIterator<Item = V>,
391        V: std::convert::Into<std::string::String>,
392    {
393        use std::iter::Iterator;
394        self.unreachable = v.into_iter().map(|i| i.into()).collect();
395        self
396    }
397}
398
399impl wkt::message::Message for ListPrivateCloudsResponse {
400    fn typename() -> &'static str {
401        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"
402    }
403}
404
405#[doc(hidden)]
406impl gax::paginator::internal::PageableResponse for ListPrivateCloudsResponse {
407    type PageItem = crate::model::PrivateCloud;
408
409    fn items(self) -> std::vec::Vec<Self::PageItem> {
410        self.private_clouds
411    }
412
413    fn next_page_token(&self) -> std::string::String {
414        use std::clone::Clone;
415        self.next_page_token.clone()
416    }
417}
418
419#[doc(hidden)]
420impl<'de> serde::de::Deserialize<'de> for ListPrivateCloudsResponse {
421    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
422    where
423        D: serde::Deserializer<'de>,
424    {
425        #[allow(non_camel_case_types)]
426        #[doc(hidden)]
427        #[derive(PartialEq, Eq, Hash)]
428        enum __FieldTag {
429            __private_clouds,
430            __next_page_token,
431            __unreachable,
432            Unknown(std::string::String),
433        }
434        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
435            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
436            where
437                D: serde::Deserializer<'de>,
438            {
439                struct Visitor;
440                impl<'de> serde::de::Visitor<'de> for Visitor {
441                    type Value = __FieldTag;
442                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
443                        formatter.write_str("a field name for ListPrivateCloudsResponse")
444                    }
445                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
446                    where
447                        E: serde::de::Error,
448                    {
449                        use std::result::Result::Ok;
450                        use std::string::ToString;
451                        match value {
452                            "privateClouds" => Ok(__FieldTag::__private_clouds),
453                            "private_clouds" => Ok(__FieldTag::__private_clouds),
454                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
455                            "next_page_token" => Ok(__FieldTag::__next_page_token),
456                            "unreachable" => Ok(__FieldTag::__unreachable),
457                            _ => Ok(__FieldTag::Unknown(value.to_string())),
458                        }
459                    }
460                }
461                deserializer.deserialize_identifier(Visitor)
462            }
463        }
464        struct Visitor;
465        impl<'de> serde::de::Visitor<'de> for Visitor {
466            type Value = ListPrivateCloudsResponse;
467            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
468                formatter.write_str("struct ListPrivateCloudsResponse")
469            }
470            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
471            where
472                A: serde::de::MapAccess<'de>,
473            {
474                #[allow(unused_imports)]
475                use serde::de::Error;
476                use std::option::Option::Some;
477                let mut fields = std::collections::HashSet::new();
478                let mut result = Self::Value::new();
479                while let Some(tag) = map.next_key::<__FieldTag>()? {
480                    #[allow(clippy::match_single_binding)]
481                    match tag {
482                        __FieldTag::__private_clouds => {
483                            if !fields.insert(__FieldTag::__private_clouds) {
484                                return std::result::Result::Err(A::Error::duplicate_field(
485                                    "multiple values for private_clouds",
486                                ));
487                            }
488                            result.private_clouds = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PrivateCloud>>>()?.unwrap_or_default();
489                        }
490                        __FieldTag::__next_page_token => {
491                            if !fields.insert(__FieldTag::__next_page_token) {
492                                return std::result::Result::Err(A::Error::duplicate_field(
493                                    "multiple values for next_page_token",
494                                ));
495                            }
496                            result.next_page_token = map
497                                .next_value::<std::option::Option<std::string::String>>()?
498                                .unwrap_or_default();
499                        }
500                        __FieldTag::__unreachable => {
501                            if !fields.insert(__FieldTag::__unreachable) {
502                                return std::result::Result::Err(A::Error::duplicate_field(
503                                    "multiple values for unreachable",
504                                ));
505                            }
506                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
507                        }
508                        __FieldTag::Unknown(key) => {
509                            let value = map.next_value::<serde_json::Value>()?;
510                            result._unknown_fields.insert(key, value);
511                        }
512                    }
513                }
514                std::result::Result::Ok(result)
515            }
516        }
517        deserializer.deserialize_any(Visitor)
518    }
519}
520
521#[doc(hidden)]
522impl serde::ser::Serialize for ListPrivateCloudsResponse {
523    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
524    where
525        S: serde::ser::Serializer,
526    {
527        use serde::ser::SerializeMap;
528        #[allow(unused_imports)]
529        use std::option::Option::Some;
530        let mut state = serializer.serialize_map(std::option::Option::None)?;
531        if !self.private_clouds.is_empty() {
532            state.serialize_entry("privateClouds", &self.private_clouds)?;
533        }
534        if !self.next_page_token.is_empty() {
535            state.serialize_entry("nextPageToken", &self.next_page_token)?;
536        }
537        if !self.unreachable.is_empty() {
538            state.serialize_entry("unreachable", &self.unreachable)?;
539        }
540        if !self._unknown_fields.is_empty() {
541            for (key, value) in self._unknown_fields.iter() {
542                state.serialize_entry(key, &value)?;
543            }
544        }
545        state.end()
546    }
547}
548
549impl std::fmt::Debug for ListPrivateCloudsResponse {
550    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
551        let mut debug_struct = f.debug_struct("ListPrivateCloudsResponse");
552        debug_struct.field("private_clouds", &self.private_clouds);
553        debug_struct.field("next_page_token", &self.next_page_token);
554        debug_struct.field("unreachable", &self.unreachable);
555        if !self._unknown_fields.is_empty() {
556            debug_struct.field("_unknown_fields", &self._unknown_fields);
557        }
558        debug_struct.finish()
559    }
560}
561
562/// Request message for
563/// [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]
564///
565/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud]: crate::client::VmwareEngine::get_private_cloud
566#[derive(Clone, Default, PartialEq)]
567#[non_exhaustive]
568pub struct GetPrivateCloudRequest {
569    /// Required. The resource name of the private cloud to retrieve.
570    /// Resource names are schemeless URIs that follow the conventions in
571    /// <https://cloud.google.com/apis/design/resource_names>.
572    /// For example:
573    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
574    pub name: std::string::String,
575
576    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
577}
578
579impl GetPrivateCloudRequest {
580    pub fn new() -> Self {
581        std::default::Default::default()
582    }
583
584    /// Sets the value of [name][crate::model::GetPrivateCloudRequest::name].
585    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
586        self.name = v.into();
587        self
588    }
589}
590
591impl wkt::message::Message for GetPrivateCloudRequest {
592    fn typename() -> &'static str {
593        "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"
594    }
595}
596
597#[doc(hidden)]
598impl<'de> serde::de::Deserialize<'de> for GetPrivateCloudRequest {
599    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
600    where
601        D: serde::Deserializer<'de>,
602    {
603        #[allow(non_camel_case_types)]
604        #[doc(hidden)]
605        #[derive(PartialEq, Eq, Hash)]
606        enum __FieldTag {
607            __name,
608            Unknown(std::string::String),
609        }
610        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
611            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
612            where
613                D: serde::Deserializer<'de>,
614            {
615                struct Visitor;
616                impl<'de> serde::de::Visitor<'de> for Visitor {
617                    type Value = __FieldTag;
618                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
619                        formatter.write_str("a field name for GetPrivateCloudRequest")
620                    }
621                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
622                    where
623                        E: serde::de::Error,
624                    {
625                        use std::result::Result::Ok;
626                        use std::string::ToString;
627                        match value {
628                            "name" => Ok(__FieldTag::__name),
629                            _ => Ok(__FieldTag::Unknown(value.to_string())),
630                        }
631                    }
632                }
633                deserializer.deserialize_identifier(Visitor)
634            }
635        }
636        struct Visitor;
637        impl<'de> serde::de::Visitor<'de> for Visitor {
638            type Value = GetPrivateCloudRequest;
639            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
640                formatter.write_str("struct GetPrivateCloudRequest")
641            }
642            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
643            where
644                A: serde::de::MapAccess<'de>,
645            {
646                #[allow(unused_imports)]
647                use serde::de::Error;
648                use std::option::Option::Some;
649                let mut fields = std::collections::HashSet::new();
650                let mut result = Self::Value::new();
651                while let Some(tag) = map.next_key::<__FieldTag>()? {
652                    #[allow(clippy::match_single_binding)]
653                    match tag {
654                        __FieldTag::__name => {
655                            if !fields.insert(__FieldTag::__name) {
656                                return std::result::Result::Err(A::Error::duplicate_field(
657                                    "multiple values for name",
658                                ));
659                            }
660                            result.name = map
661                                .next_value::<std::option::Option<std::string::String>>()?
662                                .unwrap_or_default();
663                        }
664                        __FieldTag::Unknown(key) => {
665                            let value = map.next_value::<serde_json::Value>()?;
666                            result._unknown_fields.insert(key, value);
667                        }
668                    }
669                }
670                std::result::Result::Ok(result)
671            }
672        }
673        deserializer.deserialize_any(Visitor)
674    }
675}
676
677#[doc(hidden)]
678impl serde::ser::Serialize for GetPrivateCloudRequest {
679    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
680    where
681        S: serde::ser::Serializer,
682    {
683        use serde::ser::SerializeMap;
684        #[allow(unused_imports)]
685        use std::option::Option::Some;
686        let mut state = serializer.serialize_map(std::option::Option::None)?;
687        if !self.name.is_empty() {
688            state.serialize_entry("name", &self.name)?;
689        }
690        if !self._unknown_fields.is_empty() {
691            for (key, value) in self._unknown_fields.iter() {
692                state.serialize_entry(key, &value)?;
693            }
694        }
695        state.end()
696    }
697}
698
699impl std::fmt::Debug for GetPrivateCloudRequest {
700    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
701        let mut debug_struct = f.debug_struct("GetPrivateCloudRequest");
702        debug_struct.field("name", &self.name);
703        if !self._unknown_fields.is_empty() {
704            debug_struct.field("_unknown_fields", &self._unknown_fields);
705        }
706        debug_struct.finish()
707    }
708}
709
710/// Request message for
711/// [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]
712///
713/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud]: crate::client::VmwareEngine::create_private_cloud
714#[derive(Clone, Default, PartialEq)]
715#[non_exhaustive]
716pub struct CreatePrivateCloudRequest {
717    /// Required. The resource name of the location to create the new
718    /// private cloud in. Resource names are schemeless URIs that follow the
719    /// conventions in <https://cloud.google.com/apis/design/resource_names>.
720    /// For example:
721    /// `projects/my-project/locations/us-central1-a`
722    pub parent: std::string::String,
723
724    /// Required. The user-provided identifier of the private cloud to be created.
725    /// This identifier must be unique among each `PrivateCloud` within the parent
726    /// and becomes the final token in the name URI.
727    /// The identifier must meet the following requirements:
728    ///
729    /// * Only contains 1-63 alphanumeric characters and hyphens
730    /// * Begins with an alphabetical character
731    /// * Ends with a non-hyphen character
732    /// * Not formatted as a UUID
733    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
734    ///   (section 3.5)
735    pub private_cloud_id: std::string::String,
736
737    /// Required. The initial description of the new private cloud.
738    pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
739
740    /// Optional. The request ID must be a valid UUID with the exception that zero
741    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
742    pub request_id: std::string::String,
743
744    /// Optional. True if you want the request to be validated and not executed;
745    /// false otherwise.
746    pub validate_only: bool,
747
748    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
749}
750
751impl CreatePrivateCloudRequest {
752    pub fn new() -> Self {
753        std::default::Default::default()
754    }
755
756    /// Sets the value of [parent][crate::model::CreatePrivateCloudRequest::parent].
757    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
758        self.parent = v.into();
759        self
760    }
761
762    /// Sets the value of [private_cloud_id][crate::model::CreatePrivateCloudRequest::private_cloud_id].
763    pub fn set_private_cloud_id<T: std::convert::Into<std::string::String>>(
764        mut self,
765        v: T,
766    ) -> Self {
767        self.private_cloud_id = v.into();
768        self
769    }
770
771    /// Sets the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
772    pub fn set_private_cloud<T>(mut self, v: T) -> Self
773    where
774        T: std::convert::Into<crate::model::PrivateCloud>,
775    {
776        self.private_cloud = std::option::Option::Some(v.into());
777        self
778    }
779
780    /// Sets or clears the value of [private_cloud][crate::model::CreatePrivateCloudRequest::private_cloud].
781    pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
782    where
783        T: std::convert::Into<crate::model::PrivateCloud>,
784    {
785        self.private_cloud = v.map(|x| x.into());
786        self
787    }
788
789    /// Sets the value of [request_id][crate::model::CreatePrivateCloudRequest::request_id].
790    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
791        self.request_id = v.into();
792        self
793    }
794
795    /// Sets the value of [validate_only][crate::model::CreatePrivateCloudRequest::validate_only].
796    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
797        self.validate_only = v.into();
798        self
799    }
800}
801
802impl wkt::message::Message for CreatePrivateCloudRequest {
803    fn typename() -> &'static str {
804        "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"
805    }
806}
807
808#[doc(hidden)]
809impl<'de> serde::de::Deserialize<'de> for CreatePrivateCloudRequest {
810    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
811    where
812        D: serde::Deserializer<'de>,
813    {
814        #[allow(non_camel_case_types)]
815        #[doc(hidden)]
816        #[derive(PartialEq, Eq, Hash)]
817        enum __FieldTag {
818            __parent,
819            __private_cloud_id,
820            __private_cloud,
821            __request_id,
822            __validate_only,
823            Unknown(std::string::String),
824        }
825        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
826            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
827            where
828                D: serde::Deserializer<'de>,
829            {
830                struct Visitor;
831                impl<'de> serde::de::Visitor<'de> for Visitor {
832                    type Value = __FieldTag;
833                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
834                        formatter.write_str("a field name for CreatePrivateCloudRequest")
835                    }
836                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
837                    where
838                        E: serde::de::Error,
839                    {
840                        use std::result::Result::Ok;
841                        use std::string::ToString;
842                        match value {
843                            "parent" => Ok(__FieldTag::__parent),
844                            "privateCloudId" => Ok(__FieldTag::__private_cloud_id),
845                            "private_cloud_id" => Ok(__FieldTag::__private_cloud_id),
846                            "privateCloud" => Ok(__FieldTag::__private_cloud),
847                            "private_cloud" => Ok(__FieldTag::__private_cloud),
848                            "requestId" => Ok(__FieldTag::__request_id),
849                            "request_id" => Ok(__FieldTag::__request_id),
850                            "validateOnly" => Ok(__FieldTag::__validate_only),
851                            "validate_only" => Ok(__FieldTag::__validate_only),
852                            _ => Ok(__FieldTag::Unknown(value.to_string())),
853                        }
854                    }
855                }
856                deserializer.deserialize_identifier(Visitor)
857            }
858        }
859        struct Visitor;
860        impl<'de> serde::de::Visitor<'de> for Visitor {
861            type Value = CreatePrivateCloudRequest;
862            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
863                formatter.write_str("struct CreatePrivateCloudRequest")
864            }
865            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
866            where
867                A: serde::de::MapAccess<'de>,
868            {
869                #[allow(unused_imports)]
870                use serde::de::Error;
871                use std::option::Option::Some;
872                let mut fields = std::collections::HashSet::new();
873                let mut result = Self::Value::new();
874                while let Some(tag) = map.next_key::<__FieldTag>()? {
875                    #[allow(clippy::match_single_binding)]
876                    match tag {
877                        __FieldTag::__parent => {
878                            if !fields.insert(__FieldTag::__parent) {
879                                return std::result::Result::Err(A::Error::duplicate_field(
880                                    "multiple values for parent",
881                                ));
882                            }
883                            result.parent = map
884                                .next_value::<std::option::Option<std::string::String>>()?
885                                .unwrap_or_default();
886                        }
887                        __FieldTag::__private_cloud_id => {
888                            if !fields.insert(__FieldTag::__private_cloud_id) {
889                                return std::result::Result::Err(A::Error::duplicate_field(
890                                    "multiple values for private_cloud_id",
891                                ));
892                            }
893                            result.private_cloud_id = map
894                                .next_value::<std::option::Option<std::string::String>>()?
895                                .unwrap_or_default();
896                        }
897                        __FieldTag::__private_cloud => {
898                            if !fields.insert(__FieldTag::__private_cloud) {
899                                return std::result::Result::Err(A::Error::duplicate_field(
900                                    "multiple values for private_cloud",
901                                ));
902                            }
903                            result.private_cloud = map
904                                .next_value::<std::option::Option<crate::model::PrivateCloud>>()?;
905                        }
906                        __FieldTag::__request_id => {
907                            if !fields.insert(__FieldTag::__request_id) {
908                                return std::result::Result::Err(A::Error::duplicate_field(
909                                    "multiple values for request_id",
910                                ));
911                            }
912                            result.request_id = map
913                                .next_value::<std::option::Option<std::string::String>>()?
914                                .unwrap_or_default();
915                        }
916                        __FieldTag::__validate_only => {
917                            if !fields.insert(__FieldTag::__validate_only) {
918                                return std::result::Result::Err(A::Error::duplicate_field(
919                                    "multiple values for validate_only",
920                                ));
921                            }
922                            result.validate_only = map
923                                .next_value::<std::option::Option<bool>>()?
924                                .unwrap_or_default();
925                        }
926                        __FieldTag::Unknown(key) => {
927                            let value = map.next_value::<serde_json::Value>()?;
928                            result._unknown_fields.insert(key, value);
929                        }
930                    }
931                }
932                std::result::Result::Ok(result)
933            }
934        }
935        deserializer.deserialize_any(Visitor)
936    }
937}
938
939#[doc(hidden)]
940impl serde::ser::Serialize for CreatePrivateCloudRequest {
941    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
942    where
943        S: serde::ser::Serializer,
944    {
945        use serde::ser::SerializeMap;
946        #[allow(unused_imports)]
947        use std::option::Option::Some;
948        let mut state = serializer.serialize_map(std::option::Option::None)?;
949        if !self.parent.is_empty() {
950            state.serialize_entry("parent", &self.parent)?;
951        }
952        if !self.private_cloud_id.is_empty() {
953            state.serialize_entry("privateCloudId", &self.private_cloud_id)?;
954        }
955        if self.private_cloud.is_some() {
956            state.serialize_entry("privateCloud", &self.private_cloud)?;
957        }
958        if !self.request_id.is_empty() {
959            state.serialize_entry("requestId", &self.request_id)?;
960        }
961        if !wkt::internal::is_default(&self.validate_only) {
962            state.serialize_entry("validateOnly", &self.validate_only)?;
963        }
964        if !self._unknown_fields.is_empty() {
965            for (key, value) in self._unknown_fields.iter() {
966                state.serialize_entry(key, &value)?;
967            }
968        }
969        state.end()
970    }
971}
972
973impl std::fmt::Debug for CreatePrivateCloudRequest {
974    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
975        let mut debug_struct = f.debug_struct("CreatePrivateCloudRequest");
976        debug_struct.field("parent", &self.parent);
977        debug_struct.field("private_cloud_id", &self.private_cloud_id);
978        debug_struct.field("private_cloud", &self.private_cloud);
979        debug_struct.field("request_id", &self.request_id);
980        debug_struct.field("validate_only", &self.validate_only);
981        if !self._unknown_fields.is_empty() {
982            debug_struct.field("_unknown_fields", &self._unknown_fields);
983        }
984        debug_struct.finish()
985    }
986}
987
988/// Request message for
989/// [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]
990///
991/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud]: crate::client::VmwareEngine::update_private_cloud
992#[derive(Clone, Default, PartialEq)]
993#[non_exhaustive]
994pub struct UpdatePrivateCloudRequest {
995    /// Required. Private cloud description.
996    pub private_cloud: std::option::Option<crate::model::PrivateCloud>,
997
998    /// Required. Field mask is used to specify the fields to be overwritten in the
999    /// `PrivateCloud` resource by the update. The fields specified in `updateMask`
1000    /// are relative to the resource, not the full request. A field will be
1001    /// overwritten if it is in the mask. If the user does not provide a mask then
1002    /// all fields will be overwritten.
1003    pub update_mask: std::option::Option<wkt::FieldMask>,
1004
1005    /// Optional. The request ID must be a valid UUID with the exception that zero
1006    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1007    pub request_id: std::string::String,
1008
1009    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1010}
1011
1012impl UpdatePrivateCloudRequest {
1013    pub fn new() -> Self {
1014        std::default::Default::default()
1015    }
1016
1017    /// Sets the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
1018    pub fn set_private_cloud<T>(mut self, v: T) -> Self
1019    where
1020        T: std::convert::Into<crate::model::PrivateCloud>,
1021    {
1022        self.private_cloud = std::option::Option::Some(v.into());
1023        self
1024    }
1025
1026    /// Sets or clears the value of [private_cloud][crate::model::UpdatePrivateCloudRequest::private_cloud].
1027    pub fn set_or_clear_private_cloud<T>(mut self, v: std::option::Option<T>) -> Self
1028    where
1029        T: std::convert::Into<crate::model::PrivateCloud>,
1030    {
1031        self.private_cloud = v.map(|x| x.into());
1032        self
1033    }
1034
1035    /// Sets the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
1036    pub fn set_update_mask<T>(mut self, v: T) -> Self
1037    where
1038        T: std::convert::Into<wkt::FieldMask>,
1039    {
1040        self.update_mask = std::option::Option::Some(v.into());
1041        self
1042    }
1043
1044    /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateCloudRequest::update_mask].
1045    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1046    where
1047        T: std::convert::Into<wkt::FieldMask>,
1048    {
1049        self.update_mask = v.map(|x| x.into());
1050        self
1051    }
1052
1053    /// Sets the value of [request_id][crate::model::UpdatePrivateCloudRequest::request_id].
1054    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1055        self.request_id = v.into();
1056        self
1057    }
1058}
1059
1060impl wkt::message::Message for UpdatePrivateCloudRequest {
1061    fn typename() -> &'static str {
1062        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"
1063    }
1064}
1065
1066#[doc(hidden)]
1067impl<'de> serde::de::Deserialize<'de> for UpdatePrivateCloudRequest {
1068    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1069    where
1070        D: serde::Deserializer<'de>,
1071    {
1072        #[allow(non_camel_case_types)]
1073        #[doc(hidden)]
1074        #[derive(PartialEq, Eq, Hash)]
1075        enum __FieldTag {
1076            __private_cloud,
1077            __update_mask,
1078            __request_id,
1079            Unknown(std::string::String),
1080        }
1081        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1082            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1083            where
1084                D: serde::Deserializer<'de>,
1085            {
1086                struct Visitor;
1087                impl<'de> serde::de::Visitor<'de> for Visitor {
1088                    type Value = __FieldTag;
1089                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1090                        formatter.write_str("a field name for UpdatePrivateCloudRequest")
1091                    }
1092                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1093                    where
1094                        E: serde::de::Error,
1095                    {
1096                        use std::result::Result::Ok;
1097                        use std::string::ToString;
1098                        match value {
1099                            "privateCloud" => Ok(__FieldTag::__private_cloud),
1100                            "private_cloud" => Ok(__FieldTag::__private_cloud),
1101                            "updateMask" => Ok(__FieldTag::__update_mask),
1102                            "update_mask" => Ok(__FieldTag::__update_mask),
1103                            "requestId" => Ok(__FieldTag::__request_id),
1104                            "request_id" => Ok(__FieldTag::__request_id),
1105                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1106                        }
1107                    }
1108                }
1109                deserializer.deserialize_identifier(Visitor)
1110            }
1111        }
1112        struct Visitor;
1113        impl<'de> serde::de::Visitor<'de> for Visitor {
1114            type Value = UpdatePrivateCloudRequest;
1115            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1116                formatter.write_str("struct UpdatePrivateCloudRequest")
1117            }
1118            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1119            where
1120                A: serde::de::MapAccess<'de>,
1121            {
1122                #[allow(unused_imports)]
1123                use serde::de::Error;
1124                use std::option::Option::Some;
1125                let mut fields = std::collections::HashSet::new();
1126                let mut result = Self::Value::new();
1127                while let Some(tag) = map.next_key::<__FieldTag>()? {
1128                    #[allow(clippy::match_single_binding)]
1129                    match tag {
1130                        __FieldTag::__private_cloud => {
1131                            if !fields.insert(__FieldTag::__private_cloud) {
1132                                return std::result::Result::Err(A::Error::duplicate_field(
1133                                    "multiple values for private_cloud",
1134                                ));
1135                            }
1136                            result.private_cloud = map
1137                                .next_value::<std::option::Option<crate::model::PrivateCloud>>()?;
1138                        }
1139                        __FieldTag::__update_mask => {
1140                            if !fields.insert(__FieldTag::__update_mask) {
1141                                return std::result::Result::Err(A::Error::duplicate_field(
1142                                    "multiple values for update_mask",
1143                                ));
1144                            }
1145                            result.update_mask =
1146                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
1147                        }
1148                        __FieldTag::__request_id => {
1149                            if !fields.insert(__FieldTag::__request_id) {
1150                                return std::result::Result::Err(A::Error::duplicate_field(
1151                                    "multiple values for request_id",
1152                                ));
1153                            }
1154                            result.request_id = map
1155                                .next_value::<std::option::Option<std::string::String>>()?
1156                                .unwrap_or_default();
1157                        }
1158                        __FieldTag::Unknown(key) => {
1159                            let value = map.next_value::<serde_json::Value>()?;
1160                            result._unknown_fields.insert(key, value);
1161                        }
1162                    }
1163                }
1164                std::result::Result::Ok(result)
1165            }
1166        }
1167        deserializer.deserialize_any(Visitor)
1168    }
1169}
1170
1171#[doc(hidden)]
1172impl serde::ser::Serialize for UpdatePrivateCloudRequest {
1173    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1174    where
1175        S: serde::ser::Serializer,
1176    {
1177        use serde::ser::SerializeMap;
1178        #[allow(unused_imports)]
1179        use std::option::Option::Some;
1180        let mut state = serializer.serialize_map(std::option::Option::None)?;
1181        if self.private_cloud.is_some() {
1182            state.serialize_entry("privateCloud", &self.private_cloud)?;
1183        }
1184        if self.update_mask.is_some() {
1185            state.serialize_entry("updateMask", &self.update_mask)?;
1186        }
1187        if !self.request_id.is_empty() {
1188            state.serialize_entry("requestId", &self.request_id)?;
1189        }
1190        if !self._unknown_fields.is_empty() {
1191            for (key, value) in self._unknown_fields.iter() {
1192                state.serialize_entry(key, &value)?;
1193            }
1194        }
1195        state.end()
1196    }
1197}
1198
1199impl std::fmt::Debug for UpdatePrivateCloudRequest {
1200    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1201        let mut debug_struct = f.debug_struct("UpdatePrivateCloudRequest");
1202        debug_struct.field("private_cloud", &self.private_cloud);
1203        debug_struct.field("update_mask", &self.update_mask);
1204        debug_struct.field("request_id", &self.request_id);
1205        if !self._unknown_fields.is_empty() {
1206            debug_struct.field("_unknown_fields", &self._unknown_fields);
1207        }
1208        debug_struct.finish()
1209    }
1210}
1211
1212/// Request message for
1213/// [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]
1214///
1215/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud]: crate::client::VmwareEngine::delete_private_cloud
1216#[derive(Clone, Default, PartialEq)]
1217#[non_exhaustive]
1218pub struct DeletePrivateCloudRequest {
1219    /// Required. The resource name of the private cloud to delete.
1220    /// Resource names are schemeless URIs that follow the conventions in
1221    /// <https://cloud.google.com/apis/design/resource_names>.
1222    /// For example:
1223    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1224    pub name: std::string::String,
1225
1226    /// Optional. The request ID must be a valid UUID with the exception that zero
1227    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1228    pub request_id: std::string::String,
1229
1230    /// Optional. If set to true, cascade delete is enabled and all children of
1231    /// this private cloud resource are also deleted. When this flag is set to
1232    /// false, the private cloud will not be deleted if there are any children
1233    /// other than the management cluster. The management cluster is always
1234    /// deleted.
1235    pub force: bool,
1236
1237    /// Optional. Time delay of the deletion specified in hours. The default value
1238    /// is `3`. Specifying a non-zero value for this field changes the value of
1239    /// `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned
1240    /// deletion time. Deletion can be cancelled before `expire_time` elapses using
1241    /// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud].
1242    /// Specifying a value of `0` for this field instead begins the deletion
1243    /// process and ceases billing immediately. During the final deletion process,
1244    /// the value of `PrivateCloud.state` becomes `PURGING`.
1245    ///
1246    /// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
1247    pub delay_hours: std::option::Option<i32>,
1248
1249    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1250}
1251
1252impl DeletePrivateCloudRequest {
1253    pub fn new() -> Self {
1254        std::default::Default::default()
1255    }
1256
1257    /// Sets the value of [name][crate::model::DeletePrivateCloudRequest::name].
1258    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1259        self.name = v.into();
1260        self
1261    }
1262
1263    /// Sets the value of [request_id][crate::model::DeletePrivateCloudRequest::request_id].
1264    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1265        self.request_id = v.into();
1266        self
1267    }
1268
1269    /// Sets the value of [force][crate::model::DeletePrivateCloudRequest::force].
1270    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1271        self.force = v.into();
1272        self
1273    }
1274
1275    /// Sets the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
1276    pub fn set_delay_hours<T>(mut self, v: T) -> Self
1277    where
1278        T: std::convert::Into<i32>,
1279    {
1280        self.delay_hours = std::option::Option::Some(v.into());
1281        self
1282    }
1283
1284    /// Sets or clears the value of [delay_hours][crate::model::DeletePrivateCloudRequest::delay_hours].
1285    pub fn set_or_clear_delay_hours<T>(mut self, v: std::option::Option<T>) -> Self
1286    where
1287        T: std::convert::Into<i32>,
1288    {
1289        self.delay_hours = v.map(|x| x.into());
1290        self
1291    }
1292}
1293
1294impl wkt::message::Message for DeletePrivateCloudRequest {
1295    fn typename() -> &'static str {
1296        "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"
1297    }
1298}
1299
1300#[doc(hidden)]
1301impl<'de> serde::de::Deserialize<'de> for DeletePrivateCloudRequest {
1302    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1303    where
1304        D: serde::Deserializer<'de>,
1305    {
1306        #[allow(non_camel_case_types)]
1307        #[doc(hidden)]
1308        #[derive(PartialEq, Eq, Hash)]
1309        enum __FieldTag {
1310            __name,
1311            __request_id,
1312            __force,
1313            __delay_hours,
1314            Unknown(std::string::String),
1315        }
1316        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1317            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1318            where
1319                D: serde::Deserializer<'de>,
1320            {
1321                struct Visitor;
1322                impl<'de> serde::de::Visitor<'de> for Visitor {
1323                    type Value = __FieldTag;
1324                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1325                        formatter.write_str("a field name for DeletePrivateCloudRequest")
1326                    }
1327                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1328                    where
1329                        E: serde::de::Error,
1330                    {
1331                        use std::result::Result::Ok;
1332                        use std::string::ToString;
1333                        match value {
1334                            "name" => Ok(__FieldTag::__name),
1335                            "requestId" => Ok(__FieldTag::__request_id),
1336                            "request_id" => Ok(__FieldTag::__request_id),
1337                            "force" => Ok(__FieldTag::__force),
1338                            "delayHours" => Ok(__FieldTag::__delay_hours),
1339                            "delay_hours" => Ok(__FieldTag::__delay_hours),
1340                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1341                        }
1342                    }
1343                }
1344                deserializer.deserialize_identifier(Visitor)
1345            }
1346        }
1347        struct Visitor;
1348        impl<'de> serde::de::Visitor<'de> for Visitor {
1349            type Value = DeletePrivateCloudRequest;
1350            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1351                formatter.write_str("struct DeletePrivateCloudRequest")
1352            }
1353            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1354            where
1355                A: serde::de::MapAccess<'de>,
1356            {
1357                #[allow(unused_imports)]
1358                use serde::de::Error;
1359                use std::option::Option::Some;
1360                let mut fields = std::collections::HashSet::new();
1361                let mut result = Self::Value::new();
1362                while let Some(tag) = map.next_key::<__FieldTag>()? {
1363                    #[allow(clippy::match_single_binding)]
1364                    match tag {
1365                        __FieldTag::__name => {
1366                            if !fields.insert(__FieldTag::__name) {
1367                                return std::result::Result::Err(A::Error::duplicate_field(
1368                                    "multiple values for name",
1369                                ));
1370                            }
1371                            result.name = map
1372                                .next_value::<std::option::Option<std::string::String>>()?
1373                                .unwrap_or_default();
1374                        }
1375                        __FieldTag::__request_id => {
1376                            if !fields.insert(__FieldTag::__request_id) {
1377                                return std::result::Result::Err(A::Error::duplicate_field(
1378                                    "multiple values for request_id",
1379                                ));
1380                            }
1381                            result.request_id = map
1382                                .next_value::<std::option::Option<std::string::String>>()?
1383                                .unwrap_or_default();
1384                        }
1385                        __FieldTag::__force => {
1386                            if !fields.insert(__FieldTag::__force) {
1387                                return std::result::Result::Err(A::Error::duplicate_field(
1388                                    "multiple values for force",
1389                                ));
1390                            }
1391                            result.force = map
1392                                .next_value::<std::option::Option<bool>>()?
1393                                .unwrap_or_default();
1394                        }
1395                        __FieldTag::__delay_hours => {
1396                            if !fields.insert(__FieldTag::__delay_hours) {
1397                                return std::result::Result::Err(A::Error::duplicate_field(
1398                                    "multiple values for delay_hours",
1399                                ));
1400                            }
1401                            struct __With(std::option::Option<i32>);
1402                            impl<'de> serde::de::Deserialize<'de> for __With {
1403                                fn deserialize<D>(
1404                                    deserializer: D,
1405                                ) -> std::result::Result<Self, D::Error>
1406                                where
1407                                    D: serde::de::Deserializer<'de>,
1408                                {
1409                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1410                                }
1411                            }
1412                            result.delay_hours = map.next_value::<__With>()?.0;
1413                        }
1414                        __FieldTag::Unknown(key) => {
1415                            let value = map.next_value::<serde_json::Value>()?;
1416                            result._unknown_fields.insert(key, value);
1417                        }
1418                    }
1419                }
1420                std::result::Result::Ok(result)
1421            }
1422        }
1423        deserializer.deserialize_any(Visitor)
1424    }
1425}
1426
1427#[doc(hidden)]
1428impl serde::ser::Serialize for DeletePrivateCloudRequest {
1429    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1430    where
1431        S: serde::ser::Serializer,
1432    {
1433        use serde::ser::SerializeMap;
1434        #[allow(unused_imports)]
1435        use std::option::Option::Some;
1436        let mut state = serializer.serialize_map(std::option::Option::None)?;
1437        if !self.name.is_empty() {
1438            state.serialize_entry("name", &self.name)?;
1439        }
1440        if !self.request_id.is_empty() {
1441            state.serialize_entry("requestId", &self.request_id)?;
1442        }
1443        if !wkt::internal::is_default(&self.force) {
1444            state.serialize_entry("force", &self.force)?;
1445        }
1446        if self.delay_hours.is_some() {
1447            struct __With<'a>(&'a std::option::Option<i32>);
1448            impl<'a> serde::ser::Serialize for __With<'a> {
1449                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1450                where
1451                    S: serde::ser::Serializer,
1452                {
1453                    serde_with::As::<std::option::Option<wkt::internal::I32>>::serialize(
1454                        self.0, serializer,
1455                    )
1456                }
1457            }
1458            state.serialize_entry("delayHours", &__With(&self.delay_hours))?;
1459        }
1460        if !self._unknown_fields.is_empty() {
1461            for (key, value) in self._unknown_fields.iter() {
1462                state.serialize_entry(key, &value)?;
1463            }
1464        }
1465        state.end()
1466    }
1467}
1468
1469impl std::fmt::Debug for DeletePrivateCloudRequest {
1470    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1471        let mut debug_struct = f.debug_struct("DeletePrivateCloudRequest");
1472        debug_struct.field("name", &self.name);
1473        debug_struct.field("request_id", &self.request_id);
1474        debug_struct.field("force", &self.force);
1475        debug_struct.field("delay_hours", &self.delay_hours);
1476        if !self._unknown_fields.is_empty() {
1477            debug_struct.field("_unknown_fields", &self._unknown_fields);
1478        }
1479        debug_struct.finish()
1480    }
1481}
1482
1483/// Request message for
1484/// [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]
1485///
1486/// [google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]: crate::client::VmwareEngine::undelete_private_cloud
1487#[derive(Clone, Default, PartialEq)]
1488#[non_exhaustive]
1489pub struct UndeletePrivateCloudRequest {
1490    /// Required. The resource name of the private cloud scheduled for deletion.
1491    /// Resource names are schemeless URIs that follow the conventions in
1492    /// <https://cloud.google.com/apis/design/resource_names>.
1493    /// For example:
1494    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1495    pub name: std::string::String,
1496
1497    /// Optional. The request ID must be a valid UUID with the exception that zero
1498    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
1499    pub request_id: std::string::String,
1500
1501    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1502}
1503
1504impl UndeletePrivateCloudRequest {
1505    pub fn new() -> Self {
1506        std::default::Default::default()
1507    }
1508
1509    /// Sets the value of [name][crate::model::UndeletePrivateCloudRequest::name].
1510    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1511        self.name = v.into();
1512        self
1513    }
1514
1515    /// Sets the value of [request_id][crate::model::UndeletePrivateCloudRequest::request_id].
1516    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1517        self.request_id = v.into();
1518        self
1519    }
1520}
1521
1522impl wkt::message::Message for UndeletePrivateCloudRequest {
1523    fn typename() -> &'static str {
1524        "type.googleapis.com/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"
1525    }
1526}
1527
1528#[doc(hidden)]
1529impl<'de> serde::de::Deserialize<'de> for UndeletePrivateCloudRequest {
1530    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1531    where
1532        D: serde::Deserializer<'de>,
1533    {
1534        #[allow(non_camel_case_types)]
1535        #[doc(hidden)]
1536        #[derive(PartialEq, Eq, Hash)]
1537        enum __FieldTag {
1538            __name,
1539            __request_id,
1540            Unknown(std::string::String),
1541        }
1542        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1543            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1544            where
1545                D: serde::Deserializer<'de>,
1546            {
1547                struct Visitor;
1548                impl<'de> serde::de::Visitor<'de> for Visitor {
1549                    type Value = __FieldTag;
1550                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1551                        formatter.write_str("a field name for UndeletePrivateCloudRequest")
1552                    }
1553                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1554                    where
1555                        E: serde::de::Error,
1556                    {
1557                        use std::result::Result::Ok;
1558                        use std::string::ToString;
1559                        match value {
1560                            "name" => Ok(__FieldTag::__name),
1561                            "requestId" => Ok(__FieldTag::__request_id),
1562                            "request_id" => Ok(__FieldTag::__request_id),
1563                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1564                        }
1565                    }
1566                }
1567                deserializer.deserialize_identifier(Visitor)
1568            }
1569        }
1570        struct Visitor;
1571        impl<'de> serde::de::Visitor<'de> for Visitor {
1572            type Value = UndeletePrivateCloudRequest;
1573            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1574                formatter.write_str("struct UndeletePrivateCloudRequest")
1575            }
1576            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1577            where
1578                A: serde::de::MapAccess<'de>,
1579            {
1580                #[allow(unused_imports)]
1581                use serde::de::Error;
1582                use std::option::Option::Some;
1583                let mut fields = std::collections::HashSet::new();
1584                let mut result = Self::Value::new();
1585                while let Some(tag) = map.next_key::<__FieldTag>()? {
1586                    #[allow(clippy::match_single_binding)]
1587                    match tag {
1588                        __FieldTag::__name => {
1589                            if !fields.insert(__FieldTag::__name) {
1590                                return std::result::Result::Err(A::Error::duplicate_field(
1591                                    "multiple values for name",
1592                                ));
1593                            }
1594                            result.name = map
1595                                .next_value::<std::option::Option<std::string::String>>()?
1596                                .unwrap_or_default();
1597                        }
1598                        __FieldTag::__request_id => {
1599                            if !fields.insert(__FieldTag::__request_id) {
1600                                return std::result::Result::Err(A::Error::duplicate_field(
1601                                    "multiple values for request_id",
1602                                ));
1603                            }
1604                            result.request_id = map
1605                                .next_value::<std::option::Option<std::string::String>>()?
1606                                .unwrap_or_default();
1607                        }
1608                        __FieldTag::Unknown(key) => {
1609                            let value = map.next_value::<serde_json::Value>()?;
1610                            result._unknown_fields.insert(key, value);
1611                        }
1612                    }
1613                }
1614                std::result::Result::Ok(result)
1615            }
1616        }
1617        deserializer.deserialize_any(Visitor)
1618    }
1619}
1620
1621#[doc(hidden)]
1622impl serde::ser::Serialize for UndeletePrivateCloudRequest {
1623    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1624    where
1625        S: serde::ser::Serializer,
1626    {
1627        use serde::ser::SerializeMap;
1628        #[allow(unused_imports)]
1629        use std::option::Option::Some;
1630        let mut state = serializer.serialize_map(std::option::Option::None)?;
1631        if !self.name.is_empty() {
1632            state.serialize_entry("name", &self.name)?;
1633        }
1634        if !self.request_id.is_empty() {
1635            state.serialize_entry("requestId", &self.request_id)?;
1636        }
1637        if !self._unknown_fields.is_empty() {
1638            for (key, value) in self._unknown_fields.iter() {
1639                state.serialize_entry(key, &value)?;
1640            }
1641        }
1642        state.end()
1643    }
1644}
1645
1646impl std::fmt::Debug for UndeletePrivateCloudRequest {
1647    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1648        let mut debug_struct = f.debug_struct("UndeletePrivateCloudRequest");
1649        debug_struct.field("name", &self.name);
1650        debug_struct.field("request_id", &self.request_id);
1651        if !self._unknown_fields.is_empty() {
1652            debug_struct.field("_unknown_fields", &self._unknown_fields);
1653        }
1654        debug_struct.finish()
1655    }
1656}
1657
1658/// Request message for
1659/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
1660///
1661/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
1662#[derive(Clone, Default, PartialEq)]
1663#[non_exhaustive]
1664pub struct ListClustersRequest {
1665    /// Required. The resource name of the private cloud to query for clusters.
1666    /// Resource names are schemeless URIs that follow the conventions in
1667    /// <https://cloud.google.com/apis/design/resource_names>.
1668    /// For example:
1669    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
1670    pub parent: std::string::String,
1671
1672    /// The maximum number of clusters to return in one page.
1673    /// The service may return fewer than this value.
1674    /// The maximum value is coerced to 1000.
1675    /// The default value of this field is 500.
1676    pub page_size: i32,
1677
1678    /// A page token, received from a previous `ListClusters` call.
1679    /// Provide this to retrieve the subsequent page.
1680    ///
1681    /// When paginating, all other parameters provided to `ListClusters`
1682    /// must match the call that provided the page token.
1683    pub page_token: std::string::String,
1684
1685    /// To filter on multiple expressions, provide each separate expression within
1686    /// parentheses. For example:
1687    ///
1688    /// ```norust
1689    /// (name = "example-cluster")
1690    /// (nodeCount = "3")
1691    /// ```
1692    ///
1693    /// By default, each expression is an `AND` expression. However, you can
1694    /// include `AND` and `OR` expressions explicitly. For example:
1695    ///
1696    /// ```norust
1697    /// (name = "example-cluster-1") AND
1698    /// (createTime > "2021-04-12T08:15:10.40Z") OR
1699    /// (name = "example-cluster-2")
1700    /// ```
1701    pub filter: std::string::String,
1702
1703    /// Sorts list results by a certain order. By default, returned results are
1704    /// ordered by `name` in ascending order. You can also sort results in
1705    /// descending order based on the `name` value using `orderBy="name desc"`.
1706    /// Currently, only ordering by `name` is supported.
1707    pub order_by: std::string::String,
1708
1709    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1710}
1711
1712impl ListClustersRequest {
1713    pub fn new() -> Self {
1714        std::default::Default::default()
1715    }
1716
1717    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
1718    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1719        self.parent = v.into();
1720        self
1721    }
1722
1723    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
1724    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1725        self.page_size = v.into();
1726        self
1727    }
1728
1729    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
1730    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1731        self.page_token = v.into();
1732        self
1733    }
1734
1735    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
1736    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1737        self.filter = v.into();
1738        self
1739    }
1740
1741    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
1742    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1743        self.order_by = v.into();
1744        self
1745    }
1746}
1747
1748impl wkt::message::Message for ListClustersRequest {
1749    fn typename() -> &'static str {
1750        "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersRequest"
1751    }
1752}
1753
1754#[doc(hidden)]
1755impl<'de> serde::de::Deserialize<'de> for ListClustersRequest {
1756    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1757    where
1758        D: serde::Deserializer<'de>,
1759    {
1760        #[allow(non_camel_case_types)]
1761        #[doc(hidden)]
1762        #[derive(PartialEq, Eq, Hash)]
1763        enum __FieldTag {
1764            __parent,
1765            __page_size,
1766            __page_token,
1767            __filter,
1768            __order_by,
1769            Unknown(std::string::String),
1770        }
1771        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1772            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1773            where
1774                D: serde::Deserializer<'de>,
1775            {
1776                struct Visitor;
1777                impl<'de> serde::de::Visitor<'de> for Visitor {
1778                    type Value = __FieldTag;
1779                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1780                        formatter.write_str("a field name for ListClustersRequest")
1781                    }
1782                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1783                    where
1784                        E: serde::de::Error,
1785                    {
1786                        use std::result::Result::Ok;
1787                        use std::string::ToString;
1788                        match value {
1789                            "parent" => Ok(__FieldTag::__parent),
1790                            "pageSize" => Ok(__FieldTag::__page_size),
1791                            "page_size" => Ok(__FieldTag::__page_size),
1792                            "pageToken" => Ok(__FieldTag::__page_token),
1793                            "page_token" => Ok(__FieldTag::__page_token),
1794                            "filter" => Ok(__FieldTag::__filter),
1795                            "orderBy" => Ok(__FieldTag::__order_by),
1796                            "order_by" => Ok(__FieldTag::__order_by),
1797                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1798                        }
1799                    }
1800                }
1801                deserializer.deserialize_identifier(Visitor)
1802            }
1803        }
1804        struct Visitor;
1805        impl<'de> serde::de::Visitor<'de> for Visitor {
1806            type Value = ListClustersRequest;
1807            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1808                formatter.write_str("struct ListClustersRequest")
1809            }
1810            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1811            where
1812                A: serde::de::MapAccess<'de>,
1813            {
1814                #[allow(unused_imports)]
1815                use serde::de::Error;
1816                use std::option::Option::Some;
1817                let mut fields = std::collections::HashSet::new();
1818                let mut result = Self::Value::new();
1819                while let Some(tag) = map.next_key::<__FieldTag>()? {
1820                    #[allow(clippy::match_single_binding)]
1821                    match tag {
1822                        __FieldTag::__parent => {
1823                            if !fields.insert(__FieldTag::__parent) {
1824                                return std::result::Result::Err(A::Error::duplicate_field(
1825                                    "multiple values for parent",
1826                                ));
1827                            }
1828                            result.parent = map
1829                                .next_value::<std::option::Option<std::string::String>>()?
1830                                .unwrap_or_default();
1831                        }
1832                        __FieldTag::__page_size => {
1833                            if !fields.insert(__FieldTag::__page_size) {
1834                                return std::result::Result::Err(A::Error::duplicate_field(
1835                                    "multiple values for page_size",
1836                                ));
1837                            }
1838                            struct __With(std::option::Option<i32>);
1839                            impl<'de> serde::de::Deserialize<'de> for __With {
1840                                fn deserialize<D>(
1841                                    deserializer: D,
1842                                ) -> std::result::Result<Self, D::Error>
1843                                where
1844                                    D: serde::de::Deserializer<'de>,
1845                                {
1846                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1847                                }
1848                            }
1849                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1850                        }
1851                        __FieldTag::__page_token => {
1852                            if !fields.insert(__FieldTag::__page_token) {
1853                                return std::result::Result::Err(A::Error::duplicate_field(
1854                                    "multiple values for page_token",
1855                                ));
1856                            }
1857                            result.page_token = map
1858                                .next_value::<std::option::Option<std::string::String>>()?
1859                                .unwrap_or_default();
1860                        }
1861                        __FieldTag::__filter => {
1862                            if !fields.insert(__FieldTag::__filter) {
1863                                return std::result::Result::Err(A::Error::duplicate_field(
1864                                    "multiple values for filter",
1865                                ));
1866                            }
1867                            result.filter = map
1868                                .next_value::<std::option::Option<std::string::String>>()?
1869                                .unwrap_or_default();
1870                        }
1871                        __FieldTag::__order_by => {
1872                            if !fields.insert(__FieldTag::__order_by) {
1873                                return std::result::Result::Err(A::Error::duplicate_field(
1874                                    "multiple values for order_by",
1875                                ));
1876                            }
1877                            result.order_by = map
1878                                .next_value::<std::option::Option<std::string::String>>()?
1879                                .unwrap_or_default();
1880                        }
1881                        __FieldTag::Unknown(key) => {
1882                            let value = map.next_value::<serde_json::Value>()?;
1883                            result._unknown_fields.insert(key, value);
1884                        }
1885                    }
1886                }
1887                std::result::Result::Ok(result)
1888            }
1889        }
1890        deserializer.deserialize_any(Visitor)
1891    }
1892}
1893
1894#[doc(hidden)]
1895impl serde::ser::Serialize for ListClustersRequest {
1896    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1897    where
1898        S: serde::ser::Serializer,
1899    {
1900        use serde::ser::SerializeMap;
1901        #[allow(unused_imports)]
1902        use std::option::Option::Some;
1903        let mut state = serializer.serialize_map(std::option::Option::None)?;
1904        if !self.parent.is_empty() {
1905            state.serialize_entry("parent", &self.parent)?;
1906        }
1907        if !wkt::internal::is_default(&self.page_size) {
1908            struct __With<'a>(&'a i32);
1909            impl<'a> serde::ser::Serialize for __With<'a> {
1910                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1911                where
1912                    S: serde::ser::Serializer,
1913                {
1914                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1915                }
1916            }
1917            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1918        }
1919        if !self.page_token.is_empty() {
1920            state.serialize_entry("pageToken", &self.page_token)?;
1921        }
1922        if !self.filter.is_empty() {
1923            state.serialize_entry("filter", &self.filter)?;
1924        }
1925        if !self.order_by.is_empty() {
1926            state.serialize_entry("orderBy", &self.order_by)?;
1927        }
1928        if !self._unknown_fields.is_empty() {
1929            for (key, value) in self._unknown_fields.iter() {
1930                state.serialize_entry(key, &value)?;
1931            }
1932        }
1933        state.end()
1934    }
1935}
1936
1937impl std::fmt::Debug for ListClustersRequest {
1938    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1939        let mut debug_struct = f.debug_struct("ListClustersRequest");
1940        debug_struct.field("parent", &self.parent);
1941        debug_struct.field("page_size", &self.page_size);
1942        debug_struct.field("page_token", &self.page_token);
1943        debug_struct.field("filter", &self.filter);
1944        debug_struct.field("order_by", &self.order_by);
1945        if !self._unknown_fields.is_empty() {
1946            debug_struct.field("_unknown_fields", &self._unknown_fields);
1947        }
1948        debug_struct.finish()
1949    }
1950}
1951
1952/// Response message for
1953/// [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]
1954///
1955/// [google.cloud.vmwareengine.v1.VmwareEngine.ListClusters]: crate::client::VmwareEngine::list_clusters
1956#[derive(Clone, Default, PartialEq)]
1957#[non_exhaustive]
1958pub struct ListClustersResponse {
1959    /// A list of private cloud clusters.
1960    pub clusters: std::vec::Vec<crate::model::Cluster>,
1961
1962    /// A token, which can be sent as `page_token` to retrieve the next page.
1963    /// If this field is omitted, there are no subsequent pages.
1964    pub next_page_token: std::string::String,
1965
1966    /// Locations that could not be reached when making an aggregated query using
1967    /// wildcards.
1968    pub unreachable: std::vec::Vec<std::string::String>,
1969
1970    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1971}
1972
1973impl ListClustersResponse {
1974    pub fn new() -> Self {
1975        std::default::Default::default()
1976    }
1977
1978    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
1979    pub fn set_clusters<T, V>(mut self, v: T) -> Self
1980    where
1981        T: std::iter::IntoIterator<Item = V>,
1982        V: std::convert::Into<crate::model::Cluster>,
1983    {
1984        use std::iter::Iterator;
1985        self.clusters = v.into_iter().map(|i| i.into()).collect();
1986        self
1987    }
1988
1989    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
1990    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1991        self.next_page_token = v.into();
1992        self
1993    }
1994
1995    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
1996    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1997    where
1998        T: std::iter::IntoIterator<Item = V>,
1999        V: std::convert::Into<std::string::String>,
2000    {
2001        use std::iter::Iterator;
2002        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2003        self
2004    }
2005}
2006
2007impl wkt::message::Message for ListClustersResponse {
2008    fn typename() -> &'static str {
2009        "type.googleapis.com/google.cloud.vmwareengine.v1.ListClustersResponse"
2010    }
2011}
2012
2013#[doc(hidden)]
2014impl gax::paginator::internal::PageableResponse for ListClustersResponse {
2015    type PageItem = crate::model::Cluster;
2016
2017    fn items(self) -> std::vec::Vec<Self::PageItem> {
2018        self.clusters
2019    }
2020
2021    fn next_page_token(&self) -> std::string::String {
2022        use std::clone::Clone;
2023        self.next_page_token.clone()
2024    }
2025}
2026
2027#[doc(hidden)]
2028impl<'de> serde::de::Deserialize<'de> for ListClustersResponse {
2029    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2030    where
2031        D: serde::Deserializer<'de>,
2032    {
2033        #[allow(non_camel_case_types)]
2034        #[doc(hidden)]
2035        #[derive(PartialEq, Eq, Hash)]
2036        enum __FieldTag {
2037            __clusters,
2038            __next_page_token,
2039            __unreachable,
2040            Unknown(std::string::String),
2041        }
2042        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2043            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2044            where
2045                D: serde::Deserializer<'de>,
2046            {
2047                struct Visitor;
2048                impl<'de> serde::de::Visitor<'de> for Visitor {
2049                    type Value = __FieldTag;
2050                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2051                        formatter.write_str("a field name for ListClustersResponse")
2052                    }
2053                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2054                    where
2055                        E: serde::de::Error,
2056                    {
2057                        use std::result::Result::Ok;
2058                        use std::string::ToString;
2059                        match value {
2060                            "clusters" => Ok(__FieldTag::__clusters),
2061                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
2062                            "next_page_token" => Ok(__FieldTag::__next_page_token),
2063                            "unreachable" => Ok(__FieldTag::__unreachable),
2064                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2065                        }
2066                    }
2067                }
2068                deserializer.deserialize_identifier(Visitor)
2069            }
2070        }
2071        struct Visitor;
2072        impl<'de> serde::de::Visitor<'de> for Visitor {
2073            type Value = ListClustersResponse;
2074            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2075                formatter.write_str("struct ListClustersResponse")
2076            }
2077            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2078            where
2079                A: serde::de::MapAccess<'de>,
2080            {
2081                #[allow(unused_imports)]
2082                use serde::de::Error;
2083                use std::option::Option::Some;
2084                let mut fields = std::collections::HashSet::new();
2085                let mut result = Self::Value::new();
2086                while let Some(tag) = map.next_key::<__FieldTag>()? {
2087                    #[allow(clippy::match_single_binding)]
2088                    match tag {
2089                        __FieldTag::__clusters => {
2090                            if !fields.insert(__FieldTag::__clusters) {
2091                                return std::result::Result::Err(A::Error::duplicate_field(
2092                                    "multiple values for clusters",
2093                                ));
2094                            }
2095                            result.clusters = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Cluster>>>()?.unwrap_or_default();
2096                        }
2097                        __FieldTag::__next_page_token => {
2098                            if !fields.insert(__FieldTag::__next_page_token) {
2099                                return std::result::Result::Err(A::Error::duplicate_field(
2100                                    "multiple values for next_page_token",
2101                                ));
2102                            }
2103                            result.next_page_token = map
2104                                .next_value::<std::option::Option<std::string::String>>()?
2105                                .unwrap_or_default();
2106                        }
2107                        __FieldTag::__unreachable => {
2108                            if !fields.insert(__FieldTag::__unreachable) {
2109                                return std::result::Result::Err(A::Error::duplicate_field(
2110                                    "multiple values for unreachable",
2111                                ));
2112                            }
2113                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
2114                        }
2115                        __FieldTag::Unknown(key) => {
2116                            let value = map.next_value::<serde_json::Value>()?;
2117                            result._unknown_fields.insert(key, value);
2118                        }
2119                    }
2120                }
2121                std::result::Result::Ok(result)
2122            }
2123        }
2124        deserializer.deserialize_any(Visitor)
2125    }
2126}
2127
2128#[doc(hidden)]
2129impl serde::ser::Serialize for ListClustersResponse {
2130    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2131    where
2132        S: serde::ser::Serializer,
2133    {
2134        use serde::ser::SerializeMap;
2135        #[allow(unused_imports)]
2136        use std::option::Option::Some;
2137        let mut state = serializer.serialize_map(std::option::Option::None)?;
2138        if !self.clusters.is_empty() {
2139            state.serialize_entry("clusters", &self.clusters)?;
2140        }
2141        if !self.next_page_token.is_empty() {
2142            state.serialize_entry("nextPageToken", &self.next_page_token)?;
2143        }
2144        if !self.unreachable.is_empty() {
2145            state.serialize_entry("unreachable", &self.unreachable)?;
2146        }
2147        if !self._unknown_fields.is_empty() {
2148            for (key, value) in self._unknown_fields.iter() {
2149                state.serialize_entry(key, &value)?;
2150            }
2151        }
2152        state.end()
2153    }
2154}
2155
2156impl std::fmt::Debug for ListClustersResponse {
2157    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2158        let mut debug_struct = f.debug_struct("ListClustersResponse");
2159        debug_struct.field("clusters", &self.clusters);
2160        debug_struct.field("next_page_token", &self.next_page_token);
2161        debug_struct.field("unreachable", &self.unreachable);
2162        if !self._unknown_fields.is_empty() {
2163            debug_struct.field("_unknown_fields", &self._unknown_fields);
2164        }
2165        debug_struct.finish()
2166    }
2167}
2168
2169/// Request message for
2170/// [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]
2171///
2172/// [google.cloud.vmwareengine.v1.VmwareEngine.GetCluster]: crate::client::VmwareEngine::get_cluster
2173#[derive(Clone, Default, PartialEq)]
2174#[non_exhaustive]
2175pub struct GetClusterRequest {
2176    /// Required. The cluster resource name to retrieve.
2177    /// Resource names are schemeless URIs that follow the conventions in
2178    /// <https://cloud.google.com/apis/design/resource_names>.
2179    /// For example:
2180    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
2181    pub name: std::string::String,
2182
2183    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2184}
2185
2186impl GetClusterRequest {
2187    pub fn new() -> Self {
2188        std::default::Default::default()
2189    }
2190
2191    /// Sets the value of [name][crate::model::GetClusterRequest::name].
2192    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2193        self.name = v.into();
2194        self
2195    }
2196}
2197
2198impl wkt::message::Message for GetClusterRequest {
2199    fn typename() -> &'static str {
2200        "type.googleapis.com/google.cloud.vmwareengine.v1.GetClusterRequest"
2201    }
2202}
2203
2204#[doc(hidden)]
2205impl<'de> serde::de::Deserialize<'de> for GetClusterRequest {
2206    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2207    where
2208        D: serde::Deserializer<'de>,
2209    {
2210        #[allow(non_camel_case_types)]
2211        #[doc(hidden)]
2212        #[derive(PartialEq, Eq, Hash)]
2213        enum __FieldTag {
2214            __name,
2215            Unknown(std::string::String),
2216        }
2217        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2218            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2219            where
2220                D: serde::Deserializer<'de>,
2221            {
2222                struct Visitor;
2223                impl<'de> serde::de::Visitor<'de> for Visitor {
2224                    type Value = __FieldTag;
2225                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2226                        formatter.write_str("a field name for GetClusterRequest")
2227                    }
2228                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2229                    where
2230                        E: serde::de::Error,
2231                    {
2232                        use std::result::Result::Ok;
2233                        use std::string::ToString;
2234                        match value {
2235                            "name" => Ok(__FieldTag::__name),
2236                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2237                        }
2238                    }
2239                }
2240                deserializer.deserialize_identifier(Visitor)
2241            }
2242        }
2243        struct Visitor;
2244        impl<'de> serde::de::Visitor<'de> for Visitor {
2245            type Value = GetClusterRequest;
2246            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2247                formatter.write_str("struct GetClusterRequest")
2248            }
2249            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2250            where
2251                A: serde::de::MapAccess<'de>,
2252            {
2253                #[allow(unused_imports)]
2254                use serde::de::Error;
2255                use std::option::Option::Some;
2256                let mut fields = std::collections::HashSet::new();
2257                let mut result = Self::Value::new();
2258                while let Some(tag) = map.next_key::<__FieldTag>()? {
2259                    #[allow(clippy::match_single_binding)]
2260                    match tag {
2261                        __FieldTag::__name => {
2262                            if !fields.insert(__FieldTag::__name) {
2263                                return std::result::Result::Err(A::Error::duplicate_field(
2264                                    "multiple values for name",
2265                                ));
2266                            }
2267                            result.name = map
2268                                .next_value::<std::option::Option<std::string::String>>()?
2269                                .unwrap_or_default();
2270                        }
2271                        __FieldTag::Unknown(key) => {
2272                            let value = map.next_value::<serde_json::Value>()?;
2273                            result._unknown_fields.insert(key, value);
2274                        }
2275                    }
2276                }
2277                std::result::Result::Ok(result)
2278            }
2279        }
2280        deserializer.deserialize_any(Visitor)
2281    }
2282}
2283
2284#[doc(hidden)]
2285impl serde::ser::Serialize for GetClusterRequest {
2286    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2287    where
2288        S: serde::ser::Serializer,
2289    {
2290        use serde::ser::SerializeMap;
2291        #[allow(unused_imports)]
2292        use std::option::Option::Some;
2293        let mut state = serializer.serialize_map(std::option::Option::None)?;
2294        if !self.name.is_empty() {
2295            state.serialize_entry("name", &self.name)?;
2296        }
2297        if !self._unknown_fields.is_empty() {
2298            for (key, value) in self._unknown_fields.iter() {
2299                state.serialize_entry(key, &value)?;
2300            }
2301        }
2302        state.end()
2303    }
2304}
2305
2306impl std::fmt::Debug for GetClusterRequest {
2307    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2308        let mut debug_struct = f.debug_struct("GetClusterRequest");
2309        debug_struct.field("name", &self.name);
2310        if !self._unknown_fields.is_empty() {
2311            debug_struct.field("_unknown_fields", &self._unknown_fields);
2312        }
2313        debug_struct.finish()
2314    }
2315}
2316
2317/// Request message for
2318/// [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]
2319///
2320/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster]: crate::client::VmwareEngine::create_cluster
2321#[derive(Clone, Default, PartialEq)]
2322#[non_exhaustive]
2323pub struct CreateClusterRequest {
2324    /// Required. The resource name of the private cloud to create a new cluster
2325    /// in. Resource names are schemeless URIs that follow the conventions in
2326    /// <https://cloud.google.com/apis/design/resource_names>.
2327    /// For example:
2328    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
2329    pub parent: std::string::String,
2330
2331    /// Required. The user-provided identifier of the new `Cluster`.
2332    /// This identifier must be unique among clusters within the parent and becomes
2333    /// the final token in the name URI.
2334    /// The identifier must meet the following requirements:
2335    ///
2336    /// * Only contains 1-63 alphanumeric characters and hyphens
2337    /// * Begins with an alphabetical character
2338    /// * Ends with a non-hyphen character
2339    /// * Not formatted as a UUID
2340    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
2341    ///   (section 3.5)
2342    pub cluster_id: std::string::String,
2343
2344    /// Required. The initial description of the new cluster.
2345    pub cluster: std::option::Option<crate::model::Cluster>,
2346
2347    /// Optional. The request ID must be a valid UUID with the exception that zero
2348    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
2349    pub request_id: std::string::String,
2350
2351    /// Optional. True if you want the request to be validated and not executed;
2352    /// false otherwise.
2353    pub validate_only: bool,
2354
2355    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2356}
2357
2358impl CreateClusterRequest {
2359    pub fn new() -> Self {
2360        std::default::Default::default()
2361    }
2362
2363    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
2364    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2365        self.parent = v.into();
2366        self
2367    }
2368
2369    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
2370    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2371        self.cluster_id = v.into();
2372        self
2373    }
2374
2375    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
2376    pub fn set_cluster<T>(mut self, v: T) -> Self
2377    where
2378        T: std::convert::Into<crate::model::Cluster>,
2379    {
2380        self.cluster = std::option::Option::Some(v.into());
2381        self
2382    }
2383
2384    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
2385    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
2386    where
2387        T: std::convert::Into<crate::model::Cluster>,
2388    {
2389        self.cluster = v.map(|x| x.into());
2390        self
2391    }
2392
2393    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
2394    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2395        self.request_id = v.into();
2396        self
2397    }
2398
2399    /// Sets the value of [validate_only][crate::model::CreateClusterRequest::validate_only].
2400    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2401        self.validate_only = v.into();
2402        self
2403    }
2404}
2405
2406impl wkt::message::Message for CreateClusterRequest {
2407    fn typename() -> &'static str {
2408        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateClusterRequest"
2409    }
2410}
2411
2412#[doc(hidden)]
2413impl<'de> serde::de::Deserialize<'de> for CreateClusterRequest {
2414    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2415    where
2416        D: serde::Deserializer<'de>,
2417    {
2418        #[allow(non_camel_case_types)]
2419        #[doc(hidden)]
2420        #[derive(PartialEq, Eq, Hash)]
2421        enum __FieldTag {
2422            __parent,
2423            __cluster_id,
2424            __cluster,
2425            __request_id,
2426            __validate_only,
2427            Unknown(std::string::String),
2428        }
2429        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2430            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2431            where
2432                D: serde::Deserializer<'de>,
2433            {
2434                struct Visitor;
2435                impl<'de> serde::de::Visitor<'de> for Visitor {
2436                    type Value = __FieldTag;
2437                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2438                        formatter.write_str("a field name for CreateClusterRequest")
2439                    }
2440                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2441                    where
2442                        E: serde::de::Error,
2443                    {
2444                        use std::result::Result::Ok;
2445                        use std::string::ToString;
2446                        match value {
2447                            "parent" => Ok(__FieldTag::__parent),
2448                            "clusterId" => Ok(__FieldTag::__cluster_id),
2449                            "cluster_id" => Ok(__FieldTag::__cluster_id),
2450                            "cluster" => Ok(__FieldTag::__cluster),
2451                            "requestId" => Ok(__FieldTag::__request_id),
2452                            "request_id" => Ok(__FieldTag::__request_id),
2453                            "validateOnly" => Ok(__FieldTag::__validate_only),
2454                            "validate_only" => Ok(__FieldTag::__validate_only),
2455                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2456                        }
2457                    }
2458                }
2459                deserializer.deserialize_identifier(Visitor)
2460            }
2461        }
2462        struct Visitor;
2463        impl<'de> serde::de::Visitor<'de> for Visitor {
2464            type Value = CreateClusterRequest;
2465            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2466                formatter.write_str("struct CreateClusterRequest")
2467            }
2468            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2469            where
2470                A: serde::de::MapAccess<'de>,
2471            {
2472                #[allow(unused_imports)]
2473                use serde::de::Error;
2474                use std::option::Option::Some;
2475                let mut fields = std::collections::HashSet::new();
2476                let mut result = Self::Value::new();
2477                while let Some(tag) = map.next_key::<__FieldTag>()? {
2478                    #[allow(clippy::match_single_binding)]
2479                    match tag {
2480                        __FieldTag::__parent => {
2481                            if !fields.insert(__FieldTag::__parent) {
2482                                return std::result::Result::Err(A::Error::duplicate_field(
2483                                    "multiple values for parent",
2484                                ));
2485                            }
2486                            result.parent = map
2487                                .next_value::<std::option::Option<std::string::String>>()?
2488                                .unwrap_or_default();
2489                        }
2490                        __FieldTag::__cluster_id => {
2491                            if !fields.insert(__FieldTag::__cluster_id) {
2492                                return std::result::Result::Err(A::Error::duplicate_field(
2493                                    "multiple values for cluster_id",
2494                                ));
2495                            }
2496                            result.cluster_id = map
2497                                .next_value::<std::option::Option<std::string::String>>()?
2498                                .unwrap_or_default();
2499                        }
2500                        __FieldTag::__cluster => {
2501                            if !fields.insert(__FieldTag::__cluster) {
2502                                return std::result::Result::Err(A::Error::duplicate_field(
2503                                    "multiple values for cluster",
2504                                ));
2505                            }
2506                            result.cluster =
2507                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
2508                        }
2509                        __FieldTag::__request_id => {
2510                            if !fields.insert(__FieldTag::__request_id) {
2511                                return std::result::Result::Err(A::Error::duplicate_field(
2512                                    "multiple values for request_id",
2513                                ));
2514                            }
2515                            result.request_id = map
2516                                .next_value::<std::option::Option<std::string::String>>()?
2517                                .unwrap_or_default();
2518                        }
2519                        __FieldTag::__validate_only => {
2520                            if !fields.insert(__FieldTag::__validate_only) {
2521                                return std::result::Result::Err(A::Error::duplicate_field(
2522                                    "multiple values for validate_only",
2523                                ));
2524                            }
2525                            result.validate_only = map
2526                                .next_value::<std::option::Option<bool>>()?
2527                                .unwrap_or_default();
2528                        }
2529                        __FieldTag::Unknown(key) => {
2530                            let value = map.next_value::<serde_json::Value>()?;
2531                            result._unknown_fields.insert(key, value);
2532                        }
2533                    }
2534                }
2535                std::result::Result::Ok(result)
2536            }
2537        }
2538        deserializer.deserialize_any(Visitor)
2539    }
2540}
2541
2542#[doc(hidden)]
2543impl serde::ser::Serialize for CreateClusterRequest {
2544    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2545    where
2546        S: serde::ser::Serializer,
2547    {
2548        use serde::ser::SerializeMap;
2549        #[allow(unused_imports)]
2550        use std::option::Option::Some;
2551        let mut state = serializer.serialize_map(std::option::Option::None)?;
2552        if !self.parent.is_empty() {
2553            state.serialize_entry("parent", &self.parent)?;
2554        }
2555        if !self.cluster_id.is_empty() {
2556            state.serialize_entry("clusterId", &self.cluster_id)?;
2557        }
2558        if self.cluster.is_some() {
2559            state.serialize_entry("cluster", &self.cluster)?;
2560        }
2561        if !self.request_id.is_empty() {
2562            state.serialize_entry("requestId", &self.request_id)?;
2563        }
2564        if !wkt::internal::is_default(&self.validate_only) {
2565            state.serialize_entry("validateOnly", &self.validate_only)?;
2566        }
2567        if !self._unknown_fields.is_empty() {
2568            for (key, value) in self._unknown_fields.iter() {
2569                state.serialize_entry(key, &value)?;
2570            }
2571        }
2572        state.end()
2573    }
2574}
2575
2576impl std::fmt::Debug for CreateClusterRequest {
2577    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2578        let mut debug_struct = f.debug_struct("CreateClusterRequest");
2579        debug_struct.field("parent", &self.parent);
2580        debug_struct.field("cluster_id", &self.cluster_id);
2581        debug_struct.field("cluster", &self.cluster);
2582        debug_struct.field("request_id", &self.request_id);
2583        debug_struct.field("validate_only", &self.validate_only);
2584        if !self._unknown_fields.is_empty() {
2585            debug_struct.field("_unknown_fields", &self._unknown_fields);
2586        }
2587        debug_struct.finish()
2588    }
2589}
2590
2591/// Request message for
2592/// [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]
2593///
2594/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster]: crate::client::VmwareEngine::update_cluster
2595#[derive(Clone, Default, PartialEq)]
2596#[non_exhaustive]
2597pub struct UpdateClusterRequest {
2598    /// Required. Field mask is used to specify the fields to be overwritten in the
2599    /// `Cluster` resource by the update. The fields specified in the `updateMask`
2600    /// are relative to the resource, not the full request. A field will be
2601    /// overwritten if it is in the mask. If the user does not provide a mask then
2602    /// all fields will be overwritten.
2603    pub update_mask: std::option::Option<wkt::FieldMask>,
2604
2605    /// Required. The description of the cluster.
2606    pub cluster: std::option::Option<crate::model::Cluster>,
2607
2608    /// Optional. The request ID must be a valid UUID with the exception that
2609    /// zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2610    pub request_id: std::string::String,
2611
2612    /// Optional. True if you want the request to be validated and not executed;
2613    /// false otherwise.
2614    pub validate_only: bool,
2615
2616    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2617}
2618
2619impl UpdateClusterRequest {
2620    pub fn new() -> Self {
2621        std::default::Default::default()
2622    }
2623
2624    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
2625    pub fn set_update_mask<T>(mut self, v: T) -> Self
2626    where
2627        T: std::convert::Into<wkt::FieldMask>,
2628    {
2629        self.update_mask = std::option::Option::Some(v.into());
2630        self
2631    }
2632
2633    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
2634    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2635    where
2636        T: std::convert::Into<wkt::FieldMask>,
2637    {
2638        self.update_mask = v.map(|x| x.into());
2639        self
2640    }
2641
2642    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
2643    pub fn set_cluster<T>(mut self, v: T) -> Self
2644    where
2645        T: std::convert::Into<crate::model::Cluster>,
2646    {
2647        self.cluster = std::option::Option::Some(v.into());
2648        self
2649    }
2650
2651    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
2652    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
2653    where
2654        T: std::convert::Into<crate::model::Cluster>,
2655    {
2656        self.cluster = v.map(|x| x.into());
2657        self
2658    }
2659
2660    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
2661    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2662        self.request_id = v.into();
2663        self
2664    }
2665
2666    /// Sets the value of [validate_only][crate::model::UpdateClusterRequest::validate_only].
2667    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2668        self.validate_only = v.into();
2669        self
2670    }
2671}
2672
2673impl wkt::message::Message for UpdateClusterRequest {
2674    fn typename() -> &'static str {
2675        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateClusterRequest"
2676    }
2677}
2678
2679#[doc(hidden)]
2680impl<'de> serde::de::Deserialize<'de> for UpdateClusterRequest {
2681    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2682    where
2683        D: serde::Deserializer<'de>,
2684    {
2685        #[allow(non_camel_case_types)]
2686        #[doc(hidden)]
2687        #[derive(PartialEq, Eq, Hash)]
2688        enum __FieldTag {
2689            __update_mask,
2690            __cluster,
2691            __request_id,
2692            __validate_only,
2693            Unknown(std::string::String),
2694        }
2695        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2696            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2697            where
2698                D: serde::Deserializer<'de>,
2699            {
2700                struct Visitor;
2701                impl<'de> serde::de::Visitor<'de> for Visitor {
2702                    type Value = __FieldTag;
2703                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2704                        formatter.write_str("a field name for UpdateClusterRequest")
2705                    }
2706                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2707                    where
2708                        E: serde::de::Error,
2709                    {
2710                        use std::result::Result::Ok;
2711                        use std::string::ToString;
2712                        match value {
2713                            "updateMask" => Ok(__FieldTag::__update_mask),
2714                            "update_mask" => Ok(__FieldTag::__update_mask),
2715                            "cluster" => Ok(__FieldTag::__cluster),
2716                            "requestId" => Ok(__FieldTag::__request_id),
2717                            "request_id" => Ok(__FieldTag::__request_id),
2718                            "validateOnly" => Ok(__FieldTag::__validate_only),
2719                            "validate_only" => Ok(__FieldTag::__validate_only),
2720                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2721                        }
2722                    }
2723                }
2724                deserializer.deserialize_identifier(Visitor)
2725            }
2726        }
2727        struct Visitor;
2728        impl<'de> serde::de::Visitor<'de> for Visitor {
2729            type Value = UpdateClusterRequest;
2730            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2731                formatter.write_str("struct UpdateClusterRequest")
2732            }
2733            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2734            where
2735                A: serde::de::MapAccess<'de>,
2736            {
2737                #[allow(unused_imports)]
2738                use serde::de::Error;
2739                use std::option::Option::Some;
2740                let mut fields = std::collections::HashSet::new();
2741                let mut result = Self::Value::new();
2742                while let Some(tag) = map.next_key::<__FieldTag>()? {
2743                    #[allow(clippy::match_single_binding)]
2744                    match tag {
2745                        __FieldTag::__update_mask => {
2746                            if !fields.insert(__FieldTag::__update_mask) {
2747                                return std::result::Result::Err(A::Error::duplicate_field(
2748                                    "multiple values for update_mask",
2749                                ));
2750                            }
2751                            result.update_mask =
2752                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
2753                        }
2754                        __FieldTag::__cluster => {
2755                            if !fields.insert(__FieldTag::__cluster) {
2756                                return std::result::Result::Err(A::Error::duplicate_field(
2757                                    "multiple values for cluster",
2758                                ));
2759                            }
2760                            result.cluster =
2761                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
2762                        }
2763                        __FieldTag::__request_id => {
2764                            if !fields.insert(__FieldTag::__request_id) {
2765                                return std::result::Result::Err(A::Error::duplicate_field(
2766                                    "multiple values for request_id",
2767                                ));
2768                            }
2769                            result.request_id = map
2770                                .next_value::<std::option::Option<std::string::String>>()?
2771                                .unwrap_or_default();
2772                        }
2773                        __FieldTag::__validate_only => {
2774                            if !fields.insert(__FieldTag::__validate_only) {
2775                                return std::result::Result::Err(A::Error::duplicate_field(
2776                                    "multiple values for validate_only",
2777                                ));
2778                            }
2779                            result.validate_only = map
2780                                .next_value::<std::option::Option<bool>>()?
2781                                .unwrap_or_default();
2782                        }
2783                        __FieldTag::Unknown(key) => {
2784                            let value = map.next_value::<serde_json::Value>()?;
2785                            result._unknown_fields.insert(key, value);
2786                        }
2787                    }
2788                }
2789                std::result::Result::Ok(result)
2790            }
2791        }
2792        deserializer.deserialize_any(Visitor)
2793    }
2794}
2795
2796#[doc(hidden)]
2797impl serde::ser::Serialize for UpdateClusterRequest {
2798    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2799    where
2800        S: serde::ser::Serializer,
2801    {
2802        use serde::ser::SerializeMap;
2803        #[allow(unused_imports)]
2804        use std::option::Option::Some;
2805        let mut state = serializer.serialize_map(std::option::Option::None)?;
2806        if self.update_mask.is_some() {
2807            state.serialize_entry("updateMask", &self.update_mask)?;
2808        }
2809        if self.cluster.is_some() {
2810            state.serialize_entry("cluster", &self.cluster)?;
2811        }
2812        if !self.request_id.is_empty() {
2813            state.serialize_entry("requestId", &self.request_id)?;
2814        }
2815        if !wkt::internal::is_default(&self.validate_only) {
2816            state.serialize_entry("validateOnly", &self.validate_only)?;
2817        }
2818        if !self._unknown_fields.is_empty() {
2819            for (key, value) in self._unknown_fields.iter() {
2820                state.serialize_entry(key, &value)?;
2821            }
2822        }
2823        state.end()
2824    }
2825}
2826
2827impl std::fmt::Debug for UpdateClusterRequest {
2828    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2829        let mut debug_struct = f.debug_struct("UpdateClusterRequest");
2830        debug_struct.field("update_mask", &self.update_mask);
2831        debug_struct.field("cluster", &self.cluster);
2832        debug_struct.field("request_id", &self.request_id);
2833        debug_struct.field("validate_only", &self.validate_only);
2834        if !self._unknown_fields.is_empty() {
2835            debug_struct.field("_unknown_fields", &self._unknown_fields);
2836        }
2837        debug_struct.finish()
2838    }
2839}
2840
2841/// Request message for
2842/// [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]
2843///
2844/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster]: crate::client::VmwareEngine::delete_cluster
2845#[derive(Clone, Default, PartialEq)]
2846#[non_exhaustive]
2847pub struct DeleteClusterRequest {
2848    /// Required. The resource name of the cluster to delete.
2849    /// Resource names are schemeless URIs that follow the conventions in
2850    /// <https://cloud.google.com/apis/design/resource_names>.
2851    /// For example:
2852    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
2853    pub name: std::string::String,
2854
2855    /// Optional. The request ID must be a valid UUID with the exception that zero
2856    /// UUID is not supported (00000000-0000-0000-0000-000000000000).
2857    pub request_id: std::string::String,
2858
2859    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2860}
2861
2862impl DeleteClusterRequest {
2863    pub fn new() -> Self {
2864        std::default::Default::default()
2865    }
2866
2867    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
2868    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2869        self.name = v.into();
2870        self
2871    }
2872
2873    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
2874    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2875        self.request_id = v.into();
2876        self
2877    }
2878}
2879
2880impl wkt::message::Message for DeleteClusterRequest {
2881    fn typename() -> &'static str {
2882        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteClusterRequest"
2883    }
2884}
2885
2886#[doc(hidden)]
2887impl<'de> serde::de::Deserialize<'de> for DeleteClusterRequest {
2888    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2889    where
2890        D: serde::Deserializer<'de>,
2891    {
2892        #[allow(non_camel_case_types)]
2893        #[doc(hidden)]
2894        #[derive(PartialEq, Eq, Hash)]
2895        enum __FieldTag {
2896            __name,
2897            __request_id,
2898            Unknown(std::string::String),
2899        }
2900        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2901            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2902            where
2903                D: serde::Deserializer<'de>,
2904            {
2905                struct Visitor;
2906                impl<'de> serde::de::Visitor<'de> for Visitor {
2907                    type Value = __FieldTag;
2908                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2909                        formatter.write_str("a field name for DeleteClusterRequest")
2910                    }
2911                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2912                    where
2913                        E: serde::de::Error,
2914                    {
2915                        use std::result::Result::Ok;
2916                        use std::string::ToString;
2917                        match value {
2918                            "name" => Ok(__FieldTag::__name),
2919                            "requestId" => Ok(__FieldTag::__request_id),
2920                            "request_id" => Ok(__FieldTag::__request_id),
2921                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2922                        }
2923                    }
2924                }
2925                deserializer.deserialize_identifier(Visitor)
2926            }
2927        }
2928        struct Visitor;
2929        impl<'de> serde::de::Visitor<'de> for Visitor {
2930            type Value = DeleteClusterRequest;
2931            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2932                formatter.write_str("struct DeleteClusterRequest")
2933            }
2934            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2935            where
2936                A: serde::de::MapAccess<'de>,
2937            {
2938                #[allow(unused_imports)]
2939                use serde::de::Error;
2940                use std::option::Option::Some;
2941                let mut fields = std::collections::HashSet::new();
2942                let mut result = Self::Value::new();
2943                while let Some(tag) = map.next_key::<__FieldTag>()? {
2944                    #[allow(clippy::match_single_binding)]
2945                    match tag {
2946                        __FieldTag::__name => {
2947                            if !fields.insert(__FieldTag::__name) {
2948                                return std::result::Result::Err(A::Error::duplicate_field(
2949                                    "multiple values for name",
2950                                ));
2951                            }
2952                            result.name = map
2953                                .next_value::<std::option::Option<std::string::String>>()?
2954                                .unwrap_or_default();
2955                        }
2956                        __FieldTag::__request_id => {
2957                            if !fields.insert(__FieldTag::__request_id) {
2958                                return std::result::Result::Err(A::Error::duplicate_field(
2959                                    "multiple values for request_id",
2960                                ));
2961                            }
2962                            result.request_id = map
2963                                .next_value::<std::option::Option<std::string::String>>()?
2964                                .unwrap_or_default();
2965                        }
2966                        __FieldTag::Unknown(key) => {
2967                            let value = map.next_value::<serde_json::Value>()?;
2968                            result._unknown_fields.insert(key, value);
2969                        }
2970                    }
2971                }
2972                std::result::Result::Ok(result)
2973            }
2974        }
2975        deserializer.deserialize_any(Visitor)
2976    }
2977}
2978
2979#[doc(hidden)]
2980impl serde::ser::Serialize for DeleteClusterRequest {
2981    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2982    where
2983        S: serde::ser::Serializer,
2984    {
2985        use serde::ser::SerializeMap;
2986        #[allow(unused_imports)]
2987        use std::option::Option::Some;
2988        let mut state = serializer.serialize_map(std::option::Option::None)?;
2989        if !self.name.is_empty() {
2990            state.serialize_entry("name", &self.name)?;
2991        }
2992        if !self.request_id.is_empty() {
2993            state.serialize_entry("requestId", &self.request_id)?;
2994        }
2995        if !self._unknown_fields.is_empty() {
2996            for (key, value) in self._unknown_fields.iter() {
2997                state.serialize_entry(key, &value)?;
2998            }
2999        }
3000        state.end()
3001    }
3002}
3003
3004impl std::fmt::Debug for DeleteClusterRequest {
3005    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3006        let mut debug_struct = f.debug_struct("DeleteClusterRequest");
3007        debug_struct.field("name", &self.name);
3008        debug_struct.field("request_id", &self.request_id);
3009        if !self._unknown_fields.is_empty() {
3010            debug_struct.field("_unknown_fields", &self._unknown_fields);
3011        }
3012        debug_struct.finish()
3013    }
3014}
3015
3016/// Request message for
3017/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
3018///
3019/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
3020#[derive(Clone, Default, PartialEq)]
3021#[non_exhaustive]
3022pub struct ListNodesRequest {
3023    /// Required. The resource name of the cluster to be queried for nodes.
3024    /// Resource names are schemeless URIs that follow the conventions in
3025    /// <https://cloud.google.com/apis/design/resource_names>.
3026    /// For example:
3027    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
3028    pub parent: std::string::String,
3029
3030    /// The maximum number of nodes to return in one page.
3031    /// The service may return fewer than this value.
3032    /// The maximum value is coerced to 1000.
3033    /// The default value of this field is 500.
3034    pub page_size: i32,
3035
3036    /// A page token, received from a previous `ListNodes` call.
3037    /// Provide this to retrieve the subsequent page.
3038    ///
3039    /// When paginating, all other parameters provided to
3040    /// `ListNodes` must match the call that provided the page
3041    /// token.
3042    pub page_token: std::string::String,
3043
3044    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3045}
3046
3047impl ListNodesRequest {
3048    pub fn new() -> Self {
3049        std::default::Default::default()
3050    }
3051
3052    /// Sets the value of [parent][crate::model::ListNodesRequest::parent].
3053    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3054        self.parent = v.into();
3055        self
3056    }
3057
3058    /// Sets the value of [page_size][crate::model::ListNodesRequest::page_size].
3059    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3060        self.page_size = v.into();
3061        self
3062    }
3063
3064    /// Sets the value of [page_token][crate::model::ListNodesRequest::page_token].
3065    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3066        self.page_token = v.into();
3067        self
3068    }
3069}
3070
3071impl wkt::message::Message for ListNodesRequest {
3072    fn typename() -> &'static str {
3073        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesRequest"
3074    }
3075}
3076
3077#[doc(hidden)]
3078impl<'de> serde::de::Deserialize<'de> for ListNodesRequest {
3079    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3080    where
3081        D: serde::Deserializer<'de>,
3082    {
3083        #[allow(non_camel_case_types)]
3084        #[doc(hidden)]
3085        #[derive(PartialEq, Eq, Hash)]
3086        enum __FieldTag {
3087            __parent,
3088            __page_size,
3089            __page_token,
3090            Unknown(std::string::String),
3091        }
3092        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3093            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3094            where
3095                D: serde::Deserializer<'de>,
3096            {
3097                struct Visitor;
3098                impl<'de> serde::de::Visitor<'de> for Visitor {
3099                    type Value = __FieldTag;
3100                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3101                        formatter.write_str("a field name for ListNodesRequest")
3102                    }
3103                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3104                    where
3105                        E: serde::de::Error,
3106                    {
3107                        use std::result::Result::Ok;
3108                        use std::string::ToString;
3109                        match value {
3110                            "parent" => Ok(__FieldTag::__parent),
3111                            "pageSize" => Ok(__FieldTag::__page_size),
3112                            "page_size" => Ok(__FieldTag::__page_size),
3113                            "pageToken" => Ok(__FieldTag::__page_token),
3114                            "page_token" => Ok(__FieldTag::__page_token),
3115                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3116                        }
3117                    }
3118                }
3119                deserializer.deserialize_identifier(Visitor)
3120            }
3121        }
3122        struct Visitor;
3123        impl<'de> serde::de::Visitor<'de> for Visitor {
3124            type Value = ListNodesRequest;
3125            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3126                formatter.write_str("struct ListNodesRequest")
3127            }
3128            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3129            where
3130                A: serde::de::MapAccess<'de>,
3131            {
3132                #[allow(unused_imports)]
3133                use serde::de::Error;
3134                use std::option::Option::Some;
3135                let mut fields = std::collections::HashSet::new();
3136                let mut result = Self::Value::new();
3137                while let Some(tag) = map.next_key::<__FieldTag>()? {
3138                    #[allow(clippy::match_single_binding)]
3139                    match tag {
3140                        __FieldTag::__parent => {
3141                            if !fields.insert(__FieldTag::__parent) {
3142                                return std::result::Result::Err(A::Error::duplicate_field(
3143                                    "multiple values for parent",
3144                                ));
3145                            }
3146                            result.parent = map
3147                                .next_value::<std::option::Option<std::string::String>>()?
3148                                .unwrap_or_default();
3149                        }
3150                        __FieldTag::__page_size => {
3151                            if !fields.insert(__FieldTag::__page_size) {
3152                                return std::result::Result::Err(A::Error::duplicate_field(
3153                                    "multiple values for page_size",
3154                                ));
3155                            }
3156                            struct __With(std::option::Option<i32>);
3157                            impl<'de> serde::de::Deserialize<'de> for __With {
3158                                fn deserialize<D>(
3159                                    deserializer: D,
3160                                ) -> std::result::Result<Self, D::Error>
3161                                where
3162                                    D: serde::de::Deserializer<'de>,
3163                                {
3164                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3165                                }
3166                            }
3167                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3168                        }
3169                        __FieldTag::__page_token => {
3170                            if !fields.insert(__FieldTag::__page_token) {
3171                                return std::result::Result::Err(A::Error::duplicate_field(
3172                                    "multiple values for page_token",
3173                                ));
3174                            }
3175                            result.page_token = map
3176                                .next_value::<std::option::Option<std::string::String>>()?
3177                                .unwrap_or_default();
3178                        }
3179                        __FieldTag::Unknown(key) => {
3180                            let value = map.next_value::<serde_json::Value>()?;
3181                            result._unknown_fields.insert(key, value);
3182                        }
3183                    }
3184                }
3185                std::result::Result::Ok(result)
3186            }
3187        }
3188        deserializer.deserialize_any(Visitor)
3189    }
3190}
3191
3192#[doc(hidden)]
3193impl serde::ser::Serialize for ListNodesRequest {
3194    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3195    where
3196        S: serde::ser::Serializer,
3197    {
3198        use serde::ser::SerializeMap;
3199        #[allow(unused_imports)]
3200        use std::option::Option::Some;
3201        let mut state = serializer.serialize_map(std::option::Option::None)?;
3202        if !self.parent.is_empty() {
3203            state.serialize_entry("parent", &self.parent)?;
3204        }
3205        if !wkt::internal::is_default(&self.page_size) {
3206            struct __With<'a>(&'a i32);
3207            impl<'a> serde::ser::Serialize for __With<'a> {
3208                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3209                where
3210                    S: serde::ser::Serializer,
3211                {
3212                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3213                }
3214            }
3215            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3216        }
3217        if !self.page_token.is_empty() {
3218            state.serialize_entry("pageToken", &self.page_token)?;
3219        }
3220        if !self._unknown_fields.is_empty() {
3221            for (key, value) in self._unknown_fields.iter() {
3222                state.serialize_entry(key, &value)?;
3223            }
3224        }
3225        state.end()
3226    }
3227}
3228
3229impl std::fmt::Debug for ListNodesRequest {
3230    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3231        let mut debug_struct = f.debug_struct("ListNodesRequest");
3232        debug_struct.field("parent", &self.parent);
3233        debug_struct.field("page_size", &self.page_size);
3234        debug_struct.field("page_token", &self.page_token);
3235        if !self._unknown_fields.is_empty() {
3236            debug_struct.field("_unknown_fields", &self._unknown_fields);
3237        }
3238        debug_struct.finish()
3239    }
3240}
3241
3242/// Response message for
3243/// [VmwareEngine.ListNodes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]
3244///
3245/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodes]: crate::client::VmwareEngine::list_nodes
3246#[derive(Clone, Default, PartialEq)]
3247#[non_exhaustive]
3248pub struct ListNodesResponse {
3249    /// The nodes.
3250    pub nodes: std::vec::Vec<crate::model::Node>,
3251
3252    /// A token, which can be sent as `page_token` to retrieve the next page.
3253    /// If this field is omitted, there are no subsequent pages.
3254    pub next_page_token: std::string::String,
3255
3256    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3257}
3258
3259impl ListNodesResponse {
3260    pub fn new() -> Self {
3261        std::default::Default::default()
3262    }
3263
3264    /// Sets the value of [nodes][crate::model::ListNodesResponse::nodes].
3265    pub fn set_nodes<T, V>(mut self, v: T) -> Self
3266    where
3267        T: std::iter::IntoIterator<Item = V>,
3268        V: std::convert::Into<crate::model::Node>,
3269    {
3270        use std::iter::Iterator;
3271        self.nodes = v.into_iter().map(|i| i.into()).collect();
3272        self
3273    }
3274
3275    /// Sets the value of [next_page_token][crate::model::ListNodesResponse::next_page_token].
3276    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3277        self.next_page_token = v.into();
3278        self
3279    }
3280}
3281
3282impl wkt::message::Message for ListNodesResponse {
3283    fn typename() -> &'static str {
3284        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodesResponse"
3285    }
3286}
3287
3288#[doc(hidden)]
3289impl gax::paginator::internal::PageableResponse for ListNodesResponse {
3290    type PageItem = crate::model::Node;
3291
3292    fn items(self) -> std::vec::Vec<Self::PageItem> {
3293        self.nodes
3294    }
3295
3296    fn next_page_token(&self) -> std::string::String {
3297        use std::clone::Clone;
3298        self.next_page_token.clone()
3299    }
3300}
3301
3302#[doc(hidden)]
3303impl<'de> serde::de::Deserialize<'de> for ListNodesResponse {
3304    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3305    where
3306        D: serde::Deserializer<'de>,
3307    {
3308        #[allow(non_camel_case_types)]
3309        #[doc(hidden)]
3310        #[derive(PartialEq, Eq, Hash)]
3311        enum __FieldTag {
3312            __nodes,
3313            __next_page_token,
3314            Unknown(std::string::String),
3315        }
3316        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3317            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3318            where
3319                D: serde::Deserializer<'de>,
3320            {
3321                struct Visitor;
3322                impl<'de> serde::de::Visitor<'de> for Visitor {
3323                    type Value = __FieldTag;
3324                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3325                        formatter.write_str("a field name for ListNodesResponse")
3326                    }
3327                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3328                    where
3329                        E: serde::de::Error,
3330                    {
3331                        use std::result::Result::Ok;
3332                        use std::string::ToString;
3333                        match value {
3334                            "nodes" => Ok(__FieldTag::__nodes),
3335                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3336                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3337                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3338                        }
3339                    }
3340                }
3341                deserializer.deserialize_identifier(Visitor)
3342            }
3343        }
3344        struct Visitor;
3345        impl<'de> serde::de::Visitor<'de> for Visitor {
3346            type Value = ListNodesResponse;
3347            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3348                formatter.write_str("struct ListNodesResponse")
3349            }
3350            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3351            where
3352                A: serde::de::MapAccess<'de>,
3353            {
3354                #[allow(unused_imports)]
3355                use serde::de::Error;
3356                use std::option::Option::Some;
3357                let mut fields = std::collections::HashSet::new();
3358                let mut result = Self::Value::new();
3359                while let Some(tag) = map.next_key::<__FieldTag>()? {
3360                    #[allow(clippy::match_single_binding)]
3361                    match tag {
3362                        __FieldTag::__nodes => {
3363                            if !fields.insert(__FieldTag::__nodes) {
3364                                return std::result::Result::Err(A::Error::duplicate_field(
3365                                    "multiple values for nodes",
3366                                ));
3367                            }
3368                            result.nodes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Node>>>()?.unwrap_or_default();
3369                        }
3370                        __FieldTag::__next_page_token => {
3371                            if !fields.insert(__FieldTag::__next_page_token) {
3372                                return std::result::Result::Err(A::Error::duplicate_field(
3373                                    "multiple values for next_page_token",
3374                                ));
3375                            }
3376                            result.next_page_token = map
3377                                .next_value::<std::option::Option<std::string::String>>()?
3378                                .unwrap_or_default();
3379                        }
3380                        __FieldTag::Unknown(key) => {
3381                            let value = map.next_value::<serde_json::Value>()?;
3382                            result._unknown_fields.insert(key, value);
3383                        }
3384                    }
3385                }
3386                std::result::Result::Ok(result)
3387            }
3388        }
3389        deserializer.deserialize_any(Visitor)
3390    }
3391}
3392
3393#[doc(hidden)]
3394impl serde::ser::Serialize for ListNodesResponse {
3395    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3396    where
3397        S: serde::ser::Serializer,
3398    {
3399        use serde::ser::SerializeMap;
3400        #[allow(unused_imports)]
3401        use std::option::Option::Some;
3402        let mut state = serializer.serialize_map(std::option::Option::None)?;
3403        if !self.nodes.is_empty() {
3404            state.serialize_entry("nodes", &self.nodes)?;
3405        }
3406        if !self.next_page_token.is_empty() {
3407            state.serialize_entry("nextPageToken", &self.next_page_token)?;
3408        }
3409        if !self._unknown_fields.is_empty() {
3410            for (key, value) in self._unknown_fields.iter() {
3411                state.serialize_entry(key, &value)?;
3412            }
3413        }
3414        state.end()
3415    }
3416}
3417
3418impl std::fmt::Debug for ListNodesResponse {
3419    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3420        let mut debug_struct = f.debug_struct("ListNodesResponse");
3421        debug_struct.field("nodes", &self.nodes);
3422        debug_struct.field("next_page_token", &self.next_page_token);
3423        if !self._unknown_fields.is_empty() {
3424            debug_struct.field("_unknown_fields", &self._unknown_fields);
3425        }
3426        debug_struct.finish()
3427    }
3428}
3429
3430/// Request message for
3431/// [VmwareEngine.GetNode][google.cloud.vmwareengine.v1.VmwareEngine.GetNode]
3432///
3433/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNode]: crate::client::VmwareEngine::get_node
3434#[derive(Clone, Default, PartialEq)]
3435#[non_exhaustive]
3436pub struct GetNodeRequest {
3437    /// Required. The resource name of the node to retrieve.
3438    /// For example:
3439    /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}`
3440    pub name: std::string::String,
3441
3442    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3443}
3444
3445impl GetNodeRequest {
3446    pub fn new() -> Self {
3447        std::default::Default::default()
3448    }
3449
3450    /// Sets the value of [name][crate::model::GetNodeRequest::name].
3451    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3452        self.name = v.into();
3453        self
3454    }
3455}
3456
3457impl wkt::message::Message for GetNodeRequest {
3458    fn typename() -> &'static str {
3459        "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeRequest"
3460    }
3461}
3462
3463#[doc(hidden)]
3464impl<'de> serde::de::Deserialize<'de> for GetNodeRequest {
3465    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3466    where
3467        D: serde::Deserializer<'de>,
3468    {
3469        #[allow(non_camel_case_types)]
3470        #[doc(hidden)]
3471        #[derive(PartialEq, Eq, Hash)]
3472        enum __FieldTag {
3473            __name,
3474            Unknown(std::string::String),
3475        }
3476        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3477            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3478            where
3479                D: serde::Deserializer<'de>,
3480            {
3481                struct Visitor;
3482                impl<'de> serde::de::Visitor<'de> for Visitor {
3483                    type Value = __FieldTag;
3484                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3485                        formatter.write_str("a field name for GetNodeRequest")
3486                    }
3487                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3488                    where
3489                        E: serde::de::Error,
3490                    {
3491                        use std::result::Result::Ok;
3492                        use std::string::ToString;
3493                        match value {
3494                            "name" => Ok(__FieldTag::__name),
3495                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3496                        }
3497                    }
3498                }
3499                deserializer.deserialize_identifier(Visitor)
3500            }
3501        }
3502        struct Visitor;
3503        impl<'de> serde::de::Visitor<'de> for Visitor {
3504            type Value = GetNodeRequest;
3505            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3506                formatter.write_str("struct GetNodeRequest")
3507            }
3508            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3509            where
3510                A: serde::de::MapAccess<'de>,
3511            {
3512                #[allow(unused_imports)]
3513                use serde::de::Error;
3514                use std::option::Option::Some;
3515                let mut fields = std::collections::HashSet::new();
3516                let mut result = Self::Value::new();
3517                while let Some(tag) = map.next_key::<__FieldTag>()? {
3518                    #[allow(clippy::match_single_binding)]
3519                    match tag {
3520                        __FieldTag::__name => {
3521                            if !fields.insert(__FieldTag::__name) {
3522                                return std::result::Result::Err(A::Error::duplicate_field(
3523                                    "multiple values for name",
3524                                ));
3525                            }
3526                            result.name = map
3527                                .next_value::<std::option::Option<std::string::String>>()?
3528                                .unwrap_or_default();
3529                        }
3530                        __FieldTag::Unknown(key) => {
3531                            let value = map.next_value::<serde_json::Value>()?;
3532                            result._unknown_fields.insert(key, value);
3533                        }
3534                    }
3535                }
3536                std::result::Result::Ok(result)
3537            }
3538        }
3539        deserializer.deserialize_any(Visitor)
3540    }
3541}
3542
3543#[doc(hidden)]
3544impl serde::ser::Serialize for GetNodeRequest {
3545    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3546    where
3547        S: serde::ser::Serializer,
3548    {
3549        use serde::ser::SerializeMap;
3550        #[allow(unused_imports)]
3551        use std::option::Option::Some;
3552        let mut state = serializer.serialize_map(std::option::Option::None)?;
3553        if !self.name.is_empty() {
3554            state.serialize_entry("name", &self.name)?;
3555        }
3556        if !self._unknown_fields.is_empty() {
3557            for (key, value) in self._unknown_fields.iter() {
3558                state.serialize_entry(key, &value)?;
3559            }
3560        }
3561        state.end()
3562    }
3563}
3564
3565impl std::fmt::Debug for GetNodeRequest {
3566    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3567        let mut debug_struct = f.debug_struct("GetNodeRequest");
3568        debug_struct.field("name", &self.name);
3569        if !self._unknown_fields.is_empty() {
3570            debug_struct.field("_unknown_fields", &self._unknown_fields);
3571        }
3572        debug_struct.finish()
3573    }
3574}
3575
3576/// Request message for
3577/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
3578///
3579/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
3580#[derive(Clone, Default, PartialEq)]
3581#[non_exhaustive]
3582pub struct ListExternalAddressesRequest {
3583    /// Required. The resource name of the private cloud to be queried for
3584    /// external IP addresses.
3585    /// Resource names are schemeless URIs that follow the conventions in
3586    /// <https://cloud.google.com/apis/design/resource_names>.
3587    /// For example:
3588    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
3589    pub parent: std::string::String,
3590
3591    /// The maximum number of external IP addresses to return in one page.
3592    /// The service may return fewer than this value.
3593    /// The maximum value is coerced to 1000.
3594    /// The default value of this field is 500.
3595    pub page_size: i32,
3596
3597    /// A page token, received from a previous `ListExternalAddresses` call.
3598    /// Provide this to retrieve the subsequent page.
3599    ///
3600    /// When paginating, all other parameters provided to
3601    /// `ListExternalAddresses` must match the call that provided the page token.
3602    pub page_token: std::string::String,
3603
3604    /// A filter expression that matches resources returned in the response.
3605    /// The expression must specify the field name, a comparison
3606    /// operator, and the value that you want to use for filtering. The value
3607    /// must be a string, a number, or a boolean. The comparison operator
3608    /// must be `=`, `!=`, `>`, or `<`.
3609    ///
3610    /// For example, if you are filtering a list of IP addresses, you can
3611    /// exclude the ones named `example-ip` by specifying
3612    /// `name != "example-ip"`.
3613    ///
3614    /// To filter on multiple expressions, provide each separate expression within
3615    /// parentheses. For example:
3616    ///
3617    /// ```norust
3618    /// (name = "example-ip")
3619    /// (createTime > "2021-04-12T08:15:10.40Z")
3620    /// ```
3621    ///
3622    /// By default, each expression is an `AND` expression. However, you
3623    /// can include `AND` and `OR` expressions explicitly.
3624    /// For example:
3625    ///
3626    /// ```norust
3627    /// (name = "example-ip-1") AND
3628    /// (createTime > "2021-04-12T08:15:10.40Z") OR
3629    /// (name = "example-ip-2")
3630    /// ```
3631    pub filter: std::string::String,
3632
3633    /// Sorts list results by a certain order. By default, returned results
3634    /// are ordered by `name` in ascending order.
3635    /// You can also sort results in descending order based on the `name` value
3636    /// using `orderBy="name desc"`.
3637    /// Currently, only ordering by `name` is supported.
3638    pub order_by: std::string::String,
3639
3640    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3641}
3642
3643impl ListExternalAddressesRequest {
3644    pub fn new() -> Self {
3645        std::default::Default::default()
3646    }
3647
3648    /// Sets the value of [parent][crate::model::ListExternalAddressesRequest::parent].
3649    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3650        self.parent = v.into();
3651        self
3652    }
3653
3654    /// Sets the value of [page_size][crate::model::ListExternalAddressesRequest::page_size].
3655    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3656        self.page_size = v.into();
3657        self
3658    }
3659
3660    /// Sets the value of [page_token][crate::model::ListExternalAddressesRequest::page_token].
3661    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3662        self.page_token = v.into();
3663        self
3664    }
3665
3666    /// Sets the value of [filter][crate::model::ListExternalAddressesRequest::filter].
3667    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3668        self.filter = v.into();
3669        self
3670    }
3671
3672    /// Sets the value of [order_by][crate::model::ListExternalAddressesRequest::order_by].
3673    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3674        self.order_by = v.into();
3675        self
3676    }
3677}
3678
3679impl wkt::message::Message for ListExternalAddressesRequest {
3680    fn typename() -> &'static str {
3681        "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesRequest"
3682    }
3683}
3684
3685#[doc(hidden)]
3686impl<'de> serde::de::Deserialize<'de> for ListExternalAddressesRequest {
3687    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3688    where
3689        D: serde::Deserializer<'de>,
3690    {
3691        #[allow(non_camel_case_types)]
3692        #[doc(hidden)]
3693        #[derive(PartialEq, Eq, Hash)]
3694        enum __FieldTag {
3695            __parent,
3696            __page_size,
3697            __page_token,
3698            __filter,
3699            __order_by,
3700            Unknown(std::string::String),
3701        }
3702        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3703            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3704            where
3705                D: serde::Deserializer<'de>,
3706            {
3707                struct Visitor;
3708                impl<'de> serde::de::Visitor<'de> for Visitor {
3709                    type Value = __FieldTag;
3710                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3711                        formatter.write_str("a field name for ListExternalAddressesRequest")
3712                    }
3713                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3714                    where
3715                        E: serde::de::Error,
3716                    {
3717                        use std::result::Result::Ok;
3718                        use std::string::ToString;
3719                        match value {
3720                            "parent" => Ok(__FieldTag::__parent),
3721                            "pageSize" => Ok(__FieldTag::__page_size),
3722                            "page_size" => Ok(__FieldTag::__page_size),
3723                            "pageToken" => Ok(__FieldTag::__page_token),
3724                            "page_token" => Ok(__FieldTag::__page_token),
3725                            "filter" => Ok(__FieldTag::__filter),
3726                            "orderBy" => Ok(__FieldTag::__order_by),
3727                            "order_by" => Ok(__FieldTag::__order_by),
3728                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3729                        }
3730                    }
3731                }
3732                deserializer.deserialize_identifier(Visitor)
3733            }
3734        }
3735        struct Visitor;
3736        impl<'de> serde::de::Visitor<'de> for Visitor {
3737            type Value = ListExternalAddressesRequest;
3738            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3739                formatter.write_str("struct ListExternalAddressesRequest")
3740            }
3741            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3742            where
3743                A: serde::de::MapAccess<'de>,
3744            {
3745                #[allow(unused_imports)]
3746                use serde::de::Error;
3747                use std::option::Option::Some;
3748                let mut fields = std::collections::HashSet::new();
3749                let mut result = Self::Value::new();
3750                while let Some(tag) = map.next_key::<__FieldTag>()? {
3751                    #[allow(clippy::match_single_binding)]
3752                    match tag {
3753                        __FieldTag::__parent => {
3754                            if !fields.insert(__FieldTag::__parent) {
3755                                return std::result::Result::Err(A::Error::duplicate_field(
3756                                    "multiple values for parent",
3757                                ));
3758                            }
3759                            result.parent = map
3760                                .next_value::<std::option::Option<std::string::String>>()?
3761                                .unwrap_or_default();
3762                        }
3763                        __FieldTag::__page_size => {
3764                            if !fields.insert(__FieldTag::__page_size) {
3765                                return std::result::Result::Err(A::Error::duplicate_field(
3766                                    "multiple values for page_size",
3767                                ));
3768                            }
3769                            struct __With(std::option::Option<i32>);
3770                            impl<'de> serde::de::Deserialize<'de> for __With {
3771                                fn deserialize<D>(
3772                                    deserializer: D,
3773                                ) -> std::result::Result<Self, D::Error>
3774                                where
3775                                    D: serde::de::Deserializer<'de>,
3776                                {
3777                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3778                                }
3779                            }
3780                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3781                        }
3782                        __FieldTag::__page_token => {
3783                            if !fields.insert(__FieldTag::__page_token) {
3784                                return std::result::Result::Err(A::Error::duplicate_field(
3785                                    "multiple values for page_token",
3786                                ));
3787                            }
3788                            result.page_token = map
3789                                .next_value::<std::option::Option<std::string::String>>()?
3790                                .unwrap_or_default();
3791                        }
3792                        __FieldTag::__filter => {
3793                            if !fields.insert(__FieldTag::__filter) {
3794                                return std::result::Result::Err(A::Error::duplicate_field(
3795                                    "multiple values for filter",
3796                                ));
3797                            }
3798                            result.filter = map
3799                                .next_value::<std::option::Option<std::string::String>>()?
3800                                .unwrap_or_default();
3801                        }
3802                        __FieldTag::__order_by => {
3803                            if !fields.insert(__FieldTag::__order_by) {
3804                                return std::result::Result::Err(A::Error::duplicate_field(
3805                                    "multiple values for order_by",
3806                                ));
3807                            }
3808                            result.order_by = map
3809                                .next_value::<std::option::Option<std::string::String>>()?
3810                                .unwrap_or_default();
3811                        }
3812                        __FieldTag::Unknown(key) => {
3813                            let value = map.next_value::<serde_json::Value>()?;
3814                            result._unknown_fields.insert(key, value);
3815                        }
3816                    }
3817                }
3818                std::result::Result::Ok(result)
3819            }
3820        }
3821        deserializer.deserialize_any(Visitor)
3822    }
3823}
3824
3825#[doc(hidden)]
3826impl serde::ser::Serialize for ListExternalAddressesRequest {
3827    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3828    where
3829        S: serde::ser::Serializer,
3830    {
3831        use serde::ser::SerializeMap;
3832        #[allow(unused_imports)]
3833        use std::option::Option::Some;
3834        let mut state = serializer.serialize_map(std::option::Option::None)?;
3835        if !self.parent.is_empty() {
3836            state.serialize_entry("parent", &self.parent)?;
3837        }
3838        if !wkt::internal::is_default(&self.page_size) {
3839            struct __With<'a>(&'a i32);
3840            impl<'a> serde::ser::Serialize for __With<'a> {
3841                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3842                where
3843                    S: serde::ser::Serializer,
3844                {
3845                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3846                }
3847            }
3848            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3849        }
3850        if !self.page_token.is_empty() {
3851            state.serialize_entry("pageToken", &self.page_token)?;
3852        }
3853        if !self.filter.is_empty() {
3854            state.serialize_entry("filter", &self.filter)?;
3855        }
3856        if !self.order_by.is_empty() {
3857            state.serialize_entry("orderBy", &self.order_by)?;
3858        }
3859        if !self._unknown_fields.is_empty() {
3860            for (key, value) in self._unknown_fields.iter() {
3861                state.serialize_entry(key, &value)?;
3862            }
3863        }
3864        state.end()
3865    }
3866}
3867
3868impl std::fmt::Debug for ListExternalAddressesRequest {
3869    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3870        let mut debug_struct = f.debug_struct("ListExternalAddressesRequest");
3871        debug_struct.field("parent", &self.parent);
3872        debug_struct.field("page_size", &self.page_size);
3873        debug_struct.field("page_token", &self.page_token);
3874        debug_struct.field("filter", &self.filter);
3875        debug_struct.field("order_by", &self.order_by);
3876        if !self._unknown_fields.is_empty() {
3877            debug_struct.field("_unknown_fields", &self._unknown_fields);
3878        }
3879        debug_struct.finish()
3880    }
3881}
3882
3883/// Response message for
3884/// [VmwareEngine.ListExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]
3885///
3886/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses]: crate::client::VmwareEngine::list_external_addresses
3887#[derive(Clone, Default, PartialEq)]
3888#[non_exhaustive]
3889pub struct ListExternalAddressesResponse {
3890    /// A list of external IP addresses.
3891    pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
3892
3893    /// A token, which can be sent as `page_token` to retrieve the next page.
3894    /// If this field is omitted, there are no subsequent pages.
3895    pub next_page_token: std::string::String,
3896
3897    /// Locations that could not be reached when making an aggregated query using
3898    /// wildcards.
3899    pub unreachable: std::vec::Vec<std::string::String>,
3900
3901    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3902}
3903
3904impl ListExternalAddressesResponse {
3905    pub fn new() -> Self {
3906        std::default::Default::default()
3907    }
3908
3909    /// Sets the value of [external_addresses][crate::model::ListExternalAddressesResponse::external_addresses].
3910    pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
3911    where
3912        T: std::iter::IntoIterator<Item = V>,
3913        V: std::convert::Into<crate::model::ExternalAddress>,
3914    {
3915        use std::iter::Iterator;
3916        self.external_addresses = v.into_iter().map(|i| i.into()).collect();
3917        self
3918    }
3919
3920    /// Sets the value of [next_page_token][crate::model::ListExternalAddressesResponse::next_page_token].
3921    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3922        self.next_page_token = v.into();
3923        self
3924    }
3925
3926    /// Sets the value of [unreachable][crate::model::ListExternalAddressesResponse::unreachable].
3927    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3928    where
3929        T: std::iter::IntoIterator<Item = V>,
3930        V: std::convert::Into<std::string::String>,
3931    {
3932        use std::iter::Iterator;
3933        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3934        self
3935    }
3936}
3937
3938impl wkt::message::Message for ListExternalAddressesResponse {
3939    fn typename() -> &'static str {
3940        "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAddressesResponse"
3941    }
3942}
3943
3944#[doc(hidden)]
3945impl gax::paginator::internal::PageableResponse for ListExternalAddressesResponse {
3946    type PageItem = crate::model::ExternalAddress;
3947
3948    fn items(self) -> std::vec::Vec<Self::PageItem> {
3949        self.external_addresses
3950    }
3951
3952    fn next_page_token(&self) -> std::string::String {
3953        use std::clone::Clone;
3954        self.next_page_token.clone()
3955    }
3956}
3957
3958#[doc(hidden)]
3959impl<'de> serde::de::Deserialize<'de> for ListExternalAddressesResponse {
3960    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3961    where
3962        D: serde::Deserializer<'de>,
3963    {
3964        #[allow(non_camel_case_types)]
3965        #[doc(hidden)]
3966        #[derive(PartialEq, Eq, Hash)]
3967        enum __FieldTag {
3968            __external_addresses,
3969            __next_page_token,
3970            __unreachable,
3971            Unknown(std::string::String),
3972        }
3973        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3974            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3975            where
3976                D: serde::Deserializer<'de>,
3977            {
3978                struct Visitor;
3979                impl<'de> serde::de::Visitor<'de> for Visitor {
3980                    type Value = __FieldTag;
3981                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3982                        formatter.write_str("a field name for ListExternalAddressesResponse")
3983                    }
3984                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3985                    where
3986                        E: serde::de::Error,
3987                    {
3988                        use std::result::Result::Ok;
3989                        use std::string::ToString;
3990                        match value {
3991                            "externalAddresses" => Ok(__FieldTag::__external_addresses),
3992                            "external_addresses" => Ok(__FieldTag::__external_addresses),
3993                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3994                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3995                            "unreachable" => Ok(__FieldTag::__unreachable),
3996                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3997                        }
3998                    }
3999                }
4000                deserializer.deserialize_identifier(Visitor)
4001            }
4002        }
4003        struct Visitor;
4004        impl<'de> serde::de::Visitor<'de> for Visitor {
4005            type Value = ListExternalAddressesResponse;
4006            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4007                formatter.write_str("struct ListExternalAddressesResponse")
4008            }
4009            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4010            where
4011                A: serde::de::MapAccess<'de>,
4012            {
4013                #[allow(unused_imports)]
4014                use serde::de::Error;
4015                use std::option::Option::Some;
4016                let mut fields = std::collections::HashSet::new();
4017                let mut result = Self::Value::new();
4018                while let Some(tag) = map.next_key::<__FieldTag>()? {
4019                    #[allow(clippy::match_single_binding)]
4020                    match tag {
4021                        __FieldTag::__external_addresses => {
4022                            if !fields.insert(__FieldTag::__external_addresses) {
4023                                return std::result::Result::Err(A::Error::duplicate_field(
4024                                    "multiple values for external_addresses",
4025                                ));
4026                            }
4027                            result.external_addresses =
4028                                map.next_value::<std::option::Option<
4029                                    std::vec::Vec<crate::model::ExternalAddress>,
4030                                >>()?
4031                                .unwrap_or_default();
4032                        }
4033                        __FieldTag::__next_page_token => {
4034                            if !fields.insert(__FieldTag::__next_page_token) {
4035                                return std::result::Result::Err(A::Error::duplicate_field(
4036                                    "multiple values for next_page_token",
4037                                ));
4038                            }
4039                            result.next_page_token = map
4040                                .next_value::<std::option::Option<std::string::String>>()?
4041                                .unwrap_or_default();
4042                        }
4043                        __FieldTag::__unreachable => {
4044                            if !fields.insert(__FieldTag::__unreachable) {
4045                                return std::result::Result::Err(A::Error::duplicate_field(
4046                                    "multiple values for unreachable",
4047                                ));
4048                            }
4049                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
4050                        }
4051                        __FieldTag::Unknown(key) => {
4052                            let value = map.next_value::<serde_json::Value>()?;
4053                            result._unknown_fields.insert(key, value);
4054                        }
4055                    }
4056                }
4057                std::result::Result::Ok(result)
4058            }
4059        }
4060        deserializer.deserialize_any(Visitor)
4061    }
4062}
4063
4064#[doc(hidden)]
4065impl serde::ser::Serialize for ListExternalAddressesResponse {
4066    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4067    where
4068        S: serde::ser::Serializer,
4069    {
4070        use serde::ser::SerializeMap;
4071        #[allow(unused_imports)]
4072        use std::option::Option::Some;
4073        let mut state = serializer.serialize_map(std::option::Option::None)?;
4074        if !self.external_addresses.is_empty() {
4075            state.serialize_entry("externalAddresses", &self.external_addresses)?;
4076        }
4077        if !self.next_page_token.is_empty() {
4078            state.serialize_entry("nextPageToken", &self.next_page_token)?;
4079        }
4080        if !self.unreachable.is_empty() {
4081            state.serialize_entry("unreachable", &self.unreachable)?;
4082        }
4083        if !self._unknown_fields.is_empty() {
4084            for (key, value) in self._unknown_fields.iter() {
4085                state.serialize_entry(key, &value)?;
4086            }
4087        }
4088        state.end()
4089    }
4090}
4091
4092impl std::fmt::Debug for ListExternalAddressesResponse {
4093    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4094        let mut debug_struct = f.debug_struct("ListExternalAddressesResponse");
4095        debug_struct.field("external_addresses", &self.external_addresses);
4096        debug_struct.field("next_page_token", &self.next_page_token);
4097        debug_struct.field("unreachable", &self.unreachable);
4098        if !self._unknown_fields.is_empty() {
4099            debug_struct.field("_unknown_fields", &self._unknown_fields);
4100        }
4101        debug_struct.finish()
4102    }
4103}
4104
4105/// Request message for
4106/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
4107///
4108/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
4109#[derive(Clone, Default, PartialEq)]
4110#[non_exhaustive]
4111pub struct FetchNetworkPolicyExternalAddressesRequest {
4112    /// Required. The resource name of the network policy to query for assigned
4113    /// external IP addresses. Resource names are schemeless URIs that follow the
4114    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
4115    /// example:
4116    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
4117    pub network_policy: std::string::String,
4118
4119    /// The maximum number of external IP addresses to return in one page.
4120    /// The service may return fewer than this value.
4121    /// The maximum value is coerced to 1000.
4122    /// The default value of this field is 500.
4123    pub page_size: i32,
4124
4125    /// A page token, received from a previous
4126    /// `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the
4127    /// subsequent page.
4128    ///
4129    /// When paginating, all parameters provided to
4130    /// `FetchNetworkPolicyExternalAddresses`, except for `page_size` and
4131    /// `page_token`, must match the call that provided the page token.
4132    pub page_token: std::string::String,
4133
4134    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4135}
4136
4137impl FetchNetworkPolicyExternalAddressesRequest {
4138    pub fn new() -> Self {
4139        std::default::Default::default()
4140    }
4141
4142    /// Sets the value of [network_policy][crate::model::FetchNetworkPolicyExternalAddressesRequest::network_policy].
4143    pub fn set_network_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4144        self.network_policy = v.into();
4145        self
4146    }
4147
4148    /// Sets the value of [page_size][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_size].
4149    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4150        self.page_size = v.into();
4151        self
4152    }
4153
4154    /// Sets the value of [page_token][crate::model::FetchNetworkPolicyExternalAddressesRequest::page_token].
4155    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4156        self.page_token = v.into();
4157        self
4158    }
4159}
4160
4161impl wkt::message::Message for FetchNetworkPolicyExternalAddressesRequest {
4162    fn typename() -> &'static str {
4163        "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest"
4164    }
4165}
4166
4167#[doc(hidden)]
4168impl<'de> serde::de::Deserialize<'de> for FetchNetworkPolicyExternalAddressesRequest {
4169    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4170    where
4171        D: serde::Deserializer<'de>,
4172    {
4173        #[allow(non_camel_case_types)]
4174        #[doc(hidden)]
4175        #[derive(PartialEq, Eq, Hash)]
4176        enum __FieldTag {
4177            __network_policy,
4178            __page_size,
4179            __page_token,
4180            Unknown(std::string::String),
4181        }
4182        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4183            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4184            where
4185                D: serde::Deserializer<'de>,
4186            {
4187                struct Visitor;
4188                impl<'de> serde::de::Visitor<'de> for Visitor {
4189                    type Value = __FieldTag;
4190                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4191                        formatter.write_str(
4192                            "a field name for FetchNetworkPolicyExternalAddressesRequest",
4193                        )
4194                    }
4195                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4196                    where
4197                        E: serde::de::Error,
4198                    {
4199                        use std::result::Result::Ok;
4200                        use std::string::ToString;
4201                        match value {
4202                            "networkPolicy" => Ok(__FieldTag::__network_policy),
4203                            "network_policy" => Ok(__FieldTag::__network_policy),
4204                            "pageSize" => Ok(__FieldTag::__page_size),
4205                            "page_size" => Ok(__FieldTag::__page_size),
4206                            "pageToken" => Ok(__FieldTag::__page_token),
4207                            "page_token" => Ok(__FieldTag::__page_token),
4208                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4209                        }
4210                    }
4211                }
4212                deserializer.deserialize_identifier(Visitor)
4213            }
4214        }
4215        struct Visitor;
4216        impl<'de> serde::de::Visitor<'de> for Visitor {
4217            type Value = FetchNetworkPolicyExternalAddressesRequest;
4218            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4219                formatter.write_str("struct FetchNetworkPolicyExternalAddressesRequest")
4220            }
4221            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4222            where
4223                A: serde::de::MapAccess<'de>,
4224            {
4225                #[allow(unused_imports)]
4226                use serde::de::Error;
4227                use std::option::Option::Some;
4228                let mut fields = std::collections::HashSet::new();
4229                let mut result = Self::Value::new();
4230                while let Some(tag) = map.next_key::<__FieldTag>()? {
4231                    #[allow(clippy::match_single_binding)]
4232                    match tag {
4233                        __FieldTag::__network_policy => {
4234                            if !fields.insert(__FieldTag::__network_policy) {
4235                                return std::result::Result::Err(A::Error::duplicate_field(
4236                                    "multiple values for network_policy",
4237                                ));
4238                            }
4239                            result.network_policy = map
4240                                .next_value::<std::option::Option<std::string::String>>()?
4241                                .unwrap_or_default();
4242                        }
4243                        __FieldTag::__page_size => {
4244                            if !fields.insert(__FieldTag::__page_size) {
4245                                return std::result::Result::Err(A::Error::duplicate_field(
4246                                    "multiple values for page_size",
4247                                ));
4248                            }
4249                            struct __With(std::option::Option<i32>);
4250                            impl<'de> serde::de::Deserialize<'de> for __With {
4251                                fn deserialize<D>(
4252                                    deserializer: D,
4253                                ) -> std::result::Result<Self, D::Error>
4254                                where
4255                                    D: serde::de::Deserializer<'de>,
4256                                {
4257                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4258                                }
4259                            }
4260                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4261                        }
4262                        __FieldTag::__page_token => {
4263                            if !fields.insert(__FieldTag::__page_token) {
4264                                return std::result::Result::Err(A::Error::duplicate_field(
4265                                    "multiple values for page_token",
4266                                ));
4267                            }
4268                            result.page_token = map
4269                                .next_value::<std::option::Option<std::string::String>>()?
4270                                .unwrap_or_default();
4271                        }
4272                        __FieldTag::Unknown(key) => {
4273                            let value = map.next_value::<serde_json::Value>()?;
4274                            result._unknown_fields.insert(key, value);
4275                        }
4276                    }
4277                }
4278                std::result::Result::Ok(result)
4279            }
4280        }
4281        deserializer.deserialize_any(Visitor)
4282    }
4283}
4284
4285#[doc(hidden)]
4286impl serde::ser::Serialize for FetchNetworkPolicyExternalAddressesRequest {
4287    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4288    where
4289        S: serde::ser::Serializer,
4290    {
4291        use serde::ser::SerializeMap;
4292        #[allow(unused_imports)]
4293        use std::option::Option::Some;
4294        let mut state = serializer.serialize_map(std::option::Option::None)?;
4295        if !self.network_policy.is_empty() {
4296            state.serialize_entry("networkPolicy", &self.network_policy)?;
4297        }
4298        if !wkt::internal::is_default(&self.page_size) {
4299            struct __With<'a>(&'a i32);
4300            impl<'a> serde::ser::Serialize for __With<'a> {
4301                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4302                where
4303                    S: serde::ser::Serializer,
4304                {
4305                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4306                }
4307            }
4308            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4309        }
4310        if !self.page_token.is_empty() {
4311            state.serialize_entry("pageToken", &self.page_token)?;
4312        }
4313        if !self._unknown_fields.is_empty() {
4314            for (key, value) in self._unknown_fields.iter() {
4315                state.serialize_entry(key, &value)?;
4316            }
4317        }
4318        state.end()
4319    }
4320}
4321
4322impl std::fmt::Debug for FetchNetworkPolicyExternalAddressesRequest {
4323    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4324        let mut debug_struct = f.debug_struct("FetchNetworkPolicyExternalAddressesRequest");
4325        debug_struct.field("network_policy", &self.network_policy);
4326        debug_struct.field("page_size", &self.page_size);
4327        debug_struct.field("page_token", &self.page_token);
4328        if !self._unknown_fields.is_empty() {
4329            debug_struct.field("_unknown_fields", &self._unknown_fields);
4330        }
4331        debug_struct.finish()
4332    }
4333}
4334
4335/// Response message for
4336/// [VmwareEngine.FetchNetworkPolicyExternalAddresses][google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]
4337///
4338/// [google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses]: crate::client::VmwareEngine::fetch_network_policy_external_addresses
4339#[derive(Clone, Default, PartialEq)]
4340#[non_exhaustive]
4341pub struct FetchNetworkPolicyExternalAddressesResponse {
4342    /// A list of external IP addresses assigned to VMware workload VMs within the
4343    /// scope of the given network policy.
4344    pub external_addresses: std::vec::Vec<crate::model::ExternalAddress>,
4345
4346    /// A token, which can be sent as `page_token` to retrieve the next page.
4347    /// If this field is omitted, there are no subsequent pages.
4348    pub next_page_token: std::string::String,
4349
4350    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4351}
4352
4353impl FetchNetworkPolicyExternalAddressesResponse {
4354    pub fn new() -> Self {
4355        std::default::Default::default()
4356    }
4357
4358    /// Sets the value of [external_addresses][crate::model::FetchNetworkPolicyExternalAddressesResponse::external_addresses].
4359    pub fn set_external_addresses<T, V>(mut self, v: T) -> Self
4360    where
4361        T: std::iter::IntoIterator<Item = V>,
4362        V: std::convert::Into<crate::model::ExternalAddress>,
4363    {
4364        use std::iter::Iterator;
4365        self.external_addresses = v.into_iter().map(|i| i.into()).collect();
4366        self
4367    }
4368
4369    /// Sets the value of [next_page_token][crate::model::FetchNetworkPolicyExternalAddressesResponse::next_page_token].
4370    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4371        self.next_page_token = v.into();
4372        self
4373    }
4374}
4375
4376impl wkt::message::Message for FetchNetworkPolicyExternalAddressesResponse {
4377    fn typename() -> &'static str {
4378        "type.googleapis.com/google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse"
4379    }
4380}
4381
4382#[doc(hidden)]
4383impl gax::paginator::internal::PageableResponse for FetchNetworkPolicyExternalAddressesResponse {
4384    type PageItem = crate::model::ExternalAddress;
4385
4386    fn items(self) -> std::vec::Vec<Self::PageItem> {
4387        self.external_addresses
4388    }
4389
4390    fn next_page_token(&self) -> std::string::String {
4391        use std::clone::Clone;
4392        self.next_page_token.clone()
4393    }
4394}
4395
4396#[doc(hidden)]
4397impl<'de> serde::de::Deserialize<'de> for FetchNetworkPolicyExternalAddressesResponse {
4398    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4399    where
4400        D: serde::Deserializer<'de>,
4401    {
4402        #[allow(non_camel_case_types)]
4403        #[doc(hidden)]
4404        #[derive(PartialEq, Eq, Hash)]
4405        enum __FieldTag {
4406            __external_addresses,
4407            __next_page_token,
4408            Unknown(std::string::String),
4409        }
4410        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4411            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4412            where
4413                D: serde::Deserializer<'de>,
4414            {
4415                struct Visitor;
4416                impl<'de> serde::de::Visitor<'de> for Visitor {
4417                    type Value = __FieldTag;
4418                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4419                        formatter.write_str(
4420                            "a field name for FetchNetworkPolicyExternalAddressesResponse",
4421                        )
4422                    }
4423                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4424                    where
4425                        E: serde::de::Error,
4426                    {
4427                        use std::result::Result::Ok;
4428                        use std::string::ToString;
4429                        match value {
4430                            "externalAddresses" => Ok(__FieldTag::__external_addresses),
4431                            "external_addresses" => Ok(__FieldTag::__external_addresses),
4432                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
4433                            "next_page_token" => Ok(__FieldTag::__next_page_token),
4434                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4435                        }
4436                    }
4437                }
4438                deserializer.deserialize_identifier(Visitor)
4439            }
4440        }
4441        struct Visitor;
4442        impl<'de> serde::de::Visitor<'de> for Visitor {
4443            type Value = FetchNetworkPolicyExternalAddressesResponse;
4444            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4445                formatter.write_str("struct FetchNetworkPolicyExternalAddressesResponse")
4446            }
4447            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4448            where
4449                A: serde::de::MapAccess<'de>,
4450            {
4451                #[allow(unused_imports)]
4452                use serde::de::Error;
4453                use std::option::Option::Some;
4454                let mut fields = std::collections::HashSet::new();
4455                let mut result = Self::Value::new();
4456                while let Some(tag) = map.next_key::<__FieldTag>()? {
4457                    #[allow(clippy::match_single_binding)]
4458                    match tag {
4459                        __FieldTag::__external_addresses => {
4460                            if !fields.insert(__FieldTag::__external_addresses) {
4461                                return std::result::Result::Err(A::Error::duplicate_field(
4462                                    "multiple values for external_addresses",
4463                                ));
4464                            }
4465                            result.external_addresses =
4466                                map.next_value::<std::option::Option<
4467                                    std::vec::Vec<crate::model::ExternalAddress>,
4468                                >>()?
4469                                .unwrap_or_default();
4470                        }
4471                        __FieldTag::__next_page_token => {
4472                            if !fields.insert(__FieldTag::__next_page_token) {
4473                                return std::result::Result::Err(A::Error::duplicate_field(
4474                                    "multiple values for next_page_token",
4475                                ));
4476                            }
4477                            result.next_page_token = map
4478                                .next_value::<std::option::Option<std::string::String>>()?
4479                                .unwrap_or_default();
4480                        }
4481                        __FieldTag::Unknown(key) => {
4482                            let value = map.next_value::<serde_json::Value>()?;
4483                            result._unknown_fields.insert(key, value);
4484                        }
4485                    }
4486                }
4487                std::result::Result::Ok(result)
4488            }
4489        }
4490        deserializer.deserialize_any(Visitor)
4491    }
4492}
4493
4494#[doc(hidden)]
4495impl serde::ser::Serialize for FetchNetworkPolicyExternalAddressesResponse {
4496    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4497    where
4498        S: serde::ser::Serializer,
4499    {
4500        use serde::ser::SerializeMap;
4501        #[allow(unused_imports)]
4502        use std::option::Option::Some;
4503        let mut state = serializer.serialize_map(std::option::Option::None)?;
4504        if !self.external_addresses.is_empty() {
4505            state.serialize_entry("externalAddresses", &self.external_addresses)?;
4506        }
4507        if !self.next_page_token.is_empty() {
4508            state.serialize_entry("nextPageToken", &self.next_page_token)?;
4509        }
4510        if !self._unknown_fields.is_empty() {
4511            for (key, value) in self._unknown_fields.iter() {
4512                state.serialize_entry(key, &value)?;
4513            }
4514        }
4515        state.end()
4516    }
4517}
4518
4519impl std::fmt::Debug for FetchNetworkPolicyExternalAddressesResponse {
4520    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4521        let mut debug_struct = f.debug_struct("FetchNetworkPolicyExternalAddressesResponse");
4522        debug_struct.field("external_addresses", &self.external_addresses);
4523        debug_struct.field("next_page_token", &self.next_page_token);
4524        if !self._unknown_fields.is_empty() {
4525            debug_struct.field("_unknown_fields", &self._unknown_fields);
4526        }
4527        debug_struct.finish()
4528    }
4529}
4530
4531/// Request message for
4532/// [VmwareEngine.GetExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]
4533///
4534/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress]: crate::client::VmwareEngine::get_external_address
4535#[derive(Clone, Default, PartialEq)]
4536#[non_exhaustive]
4537pub struct GetExternalAddressRequest {
4538    /// Required. The resource name of the external IP address to retrieve.
4539    /// Resource names are schemeless URIs that follow the conventions in
4540    /// <https://cloud.google.com/apis/design/resource_names>.
4541    /// For example:
4542    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
4543    pub name: std::string::String,
4544
4545    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4546}
4547
4548impl GetExternalAddressRequest {
4549    pub fn new() -> Self {
4550        std::default::Default::default()
4551    }
4552
4553    /// Sets the value of [name][crate::model::GetExternalAddressRequest::name].
4554    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4555        self.name = v.into();
4556        self
4557    }
4558}
4559
4560impl wkt::message::Message for GetExternalAddressRequest {
4561    fn typename() -> &'static str {
4562        "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAddressRequest"
4563    }
4564}
4565
4566#[doc(hidden)]
4567impl<'de> serde::de::Deserialize<'de> for GetExternalAddressRequest {
4568    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4569    where
4570        D: serde::Deserializer<'de>,
4571    {
4572        #[allow(non_camel_case_types)]
4573        #[doc(hidden)]
4574        #[derive(PartialEq, Eq, Hash)]
4575        enum __FieldTag {
4576            __name,
4577            Unknown(std::string::String),
4578        }
4579        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4580            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4581            where
4582                D: serde::Deserializer<'de>,
4583            {
4584                struct Visitor;
4585                impl<'de> serde::de::Visitor<'de> for Visitor {
4586                    type Value = __FieldTag;
4587                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4588                        formatter.write_str("a field name for GetExternalAddressRequest")
4589                    }
4590                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4591                    where
4592                        E: serde::de::Error,
4593                    {
4594                        use std::result::Result::Ok;
4595                        use std::string::ToString;
4596                        match value {
4597                            "name" => Ok(__FieldTag::__name),
4598                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4599                        }
4600                    }
4601                }
4602                deserializer.deserialize_identifier(Visitor)
4603            }
4604        }
4605        struct Visitor;
4606        impl<'de> serde::de::Visitor<'de> for Visitor {
4607            type Value = GetExternalAddressRequest;
4608            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4609                formatter.write_str("struct GetExternalAddressRequest")
4610            }
4611            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4612            where
4613                A: serde::de::MapAccess<'de>,
4614            {
4615                #[allow(unused_imports)]
4616                use serde::de::Error;
4617                use std::option::Option::Some;
4618                let mut fields = std::collections::HashSet::new();
4619                let mut result = Self::Value::new();
4620                while let Some(tag) = map.next_key::<__FieldTag>()? {
4621                    #[allow(clippy::match_single_binding)]
4622                    match tag {
4623                        __FieldTag::__name => {
4624                            if !fields.insert(__FieldTag::__name) {
4625                                return std::result::Result::Err(A::Error::duplicate_field(
4626                                    "multiple values for name",
4627                                ));
4628                            }
4629                            result.name = map
4630                                .next_value::<std::option::Option<std::string::String>>()?
4631                                .unwrap_or_default();
4632                        }
4633                        __FieldTag::Unknown(key) => {
4634                            let value = map.next_value::<serde_json::Value>()?;
4635                            result._unknown_fields.insert(key, value);
4636                        }
4637                    }
4638                }
4639                std::result::Result::Ok(result)
4640            }
4641        }
4642        deserializer.deserialize_any(Visitor)
4643    }
4644}
4645
4646#[doc(hidden)]
4647impl serde::ser::Serialize for GetExternalAddressRequest {
4648    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4649    where
4650        S: serde::ser::Serializer,
4651    {
4652        use serde::ser::SerializeMap;
4653        #[allow(unused_imports)]
4654        use std::option::Option::Some;
4655        let mut state = serializer.serialize_map(std::option::Option::None)?;
4656        if !self.name.is_empty() {
4657            state.serialize_entry("name", &self.name)?;
4658        }
4659        if !self._unknown_fields.is_empty() {
4660            for (key, value) in self._unknown_fields.iter() {
4661                state.serialize_entry(key, &value)?;
4662            }
4663        }
4664        state.end()
4665    }
4666}
4667
4668impl std::fmt::Debug for GetExternalAddressRequest {
4669    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4670        let mut debug_struct = f.debug_struct("GetExternalAddressRequest");
4671        debug_struct.field("name", &self.name);
4672        if !self._unknown_fields.is_empty() {
4673            debug_struct.field("_unknown_fields", &self._unknown_fields);
4674        }
4675        debug_struct.finish()
4676    }
4677}
4678
4679/// Request message for
4680/// [VmwareEngine.CreateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]
4681///
4682/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress]: crate::client::VmwareEngine::create_external_address
4683#[derive(Clone, Default, PartialEq)]
4684#[non_exhaustive]
4685pub struct CreateExternalAddressRequest {
4686    /// Required. The resource name of the private cloud
4687    /// to create a new external IP address in.
4688    /// Resource names are schemeless URIs that follow the conventions in
4689    /// <https://cloud.google.com/apis/design/resource_names>.
4690    /// For example:
4691    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
4692    pub parent: std::string::String,
4693
4694    /// Required. The initial description of a new external IP address.
4695    pub external_address: std::option::Option<crate::model::ExternalAddress>,
4696
4697    /// Required. The user-provided identifier of the `ExternalAddress` to be
4698    /// created. This identifier must be unique among `ExternalAddress` resources
4699    /// within the parent and becomes the final token in the name URI. The
4700    /// identifier must meet the following requirements:
4701    ///
4702    /// * Only contains 1-63 alphanumeric characters and hyphens
4703    /// * Begins with an alphabetical character
4704    /// * Ends with a non-hyphen character
4705    /// * Not formatted as a UUID
4706    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
4707    ///   (section 3.5)
4708    pub external_address_id: std::string::String,
4709
4710    /// Optional. A request ID to identify requests. Specify a unique request ID
4711    /// so that if you must retry your request, the server will know to ignore
4712    /// the request if it has already been completed. The server guarantees that a
4713    /// request doesn't result in creation of duplicate commitments for at least 60
4714    /// minutes.
4715    ///
4716    /// For example, consider a situation where you make an initial request and the
4717    /// request times out. If you make the request again with the same request ID,
4718    /// the server can check if the original operation with the same request ID was
4719    /// received, and if so, will ignore the second request. This prevents clients
4720    /// from accidentally creating duplicate commitments.
4721    ///
4722    /// The request ID must be a valid UUID with the exception that zero UUID is
4723    /// not supported (00000000-0000-0000-0000-000000000000).
4724    pub request_id: std::string::String,
4725
4726    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4727}
4728
4729impl CreateExternalAddressRequest {
4730    pub fn new() -> Self {
4731        std::default::Default::default()
4732    }
4733
4734    /// Sets the value of [parent][crate::model::CreateExternalAddressRequest::parent].
4735    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736        self.parent = v.into();
4737        self
4738    }
4739
4740    /// Sets the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
4741    pub fn set_external_address<T>(mut self, v: T) -> Self
4742    where
4743        T: std::convert::Into<crate::model::ExternalAddress>,
4744    {
4745        self.external_address = std::option::Option::Some(v.into());
4746        self
4747    }
4748
4749    /// Sets or clears the value of [external_address][crate::model::CreateExternalAddressRequest::external_address].
4750    pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
4751    where
4752        T: std::convert::Into<crate::model::ExternalAddress>,
4753    {
4754        self.external_address = v.map(|x| x.into());
4755        self
4756    }
4757
4758    /// Sets the value of [external_address_id][crate::model::CreateExternalAddressRequest::external_address_id].
4759    pub fn set_external_address_id<T: std::convert::Into<std::string::String>>(
4760        mut self,
4761        v: T,
4762    ) -> Self {
4763        self.external_address_id = v.into();
4764        self
4765    }
4766
4767    /// Sets the value of [request_id][crate::model::CreateExternalAddressRequest::request_id].
4768    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4769        self.request_id = v.into();
4770        self
4771    }
4772}
4773
4774impl wkt::message::Message for CreateExternalAddressRequest {
4775    fn typename() -> &'static str {
4776        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAddressRequest"
4777    }
4778}
4779
4780#[doc(hidden)]
4781impl<'de> serde::de::Deserialize<'de> for CreateExternalAddressRequest {
4782    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4783    where
4784        D: serde::Deserializer<'de>,
4785    {
4786        #[allow(non_camel_case_types)]
4787        #[doc(hidden)]
4788        #[derive(PartialEq, Eq, Hash)]
4789        enum __FieldTag {
4790            __parent,
4791            __external_address,
4792            __external_address_id,
4793            __request_id,
4794            Unknown(std::string::String),
4795        }
4796        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4797            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4798            where
4799                D: serde::Deserializer<'de>,
4800            {
4801                struct Visitor;
4802                impl<'de> serde::de::Visitor<'de> for Visitor {
4803                    type Value = __FieldTag;
4804                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4805                        formatter.write_str("a field name for CreateExternalAddressRequest")
4806                    }
4807                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4808                    where
4809                        E: serde::de::Error,
4810                    {
4811                        use std::result::Result::Ok;
4812                        use std::string::ToString;
4813                        match value {
4814                            "parent" => Ok(__FieldTag::__parent),
4815                            "externalAddress" => Ok(__FieldTag::__external_address),
4816                            "external_address" => Ok(__FieldTag::__external_address),
4817                            "externalAddressId" => Ok(__FieldTag::__external_address_id),
4818                            "external_address_id" => Ok(__FieldTag::__external_address_id),
4819                            "requestId" => Ok(__FieldTag::__request_id),
4820                            "request_id" => Ok(__FieldTag::__request_id),
4821                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4822                        }
4823                    }
4824                }
4825                deserializer.deserialize_identifier(Visitor)
4826            }
4827        }
4828        struct Visitor;
4829        impl<'de> serde::de::Visitor<'de> for Visitor {
4830            type Value = CreateExternalAddressRequest;
4831            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4832                formatter.write_str("struct CreateExternalAddressRequest")
4833            }
4834            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4835            where
4836                A: serde::de::MapAccess<'de>,
4837            {
4838                #[allow(unused_imports)]
4839                use serde::de::Error;
4840                use std::option::Option::Some;
4841                let mut fields = std::collections::HashSet::new();
4842                let mut result = Self::Value::new();
4843                while let Some(tag) = map.next_key::<__FieldTag>()? {
4844                    #[allow(clippy::match_single_binding)]
4845                    match tag {
4846                        __FieldTag::__parent => {
4847                            if !fields.insert(__FieldTag::__parent) {
4848                                return std::result::Result::Err(A::Error::duplicate_field(
4849                                    "multiple values for parent",
4850                                ));
4851                            }
4852                            result.parent = map
4853                                .next_value::<std::option::Option<std::string::String>>()?
4854                                .unwrap_or_default();
4855                        }
4856                        __FieldTag::__external_address => {
4857                            if !fields.insert(__FieldTag::__external_address) {
4858                                return std::result::Result::Err(A::Error::duplicate_field(
4859                                    "multiple values for external_address",
4860                                ));
4861                            }
4862                            result.external_address = map
4863                                .next_value::<std::option::Option<crate::model::ExternalAddress>>(
4864                                )?;
4865                        }
4866                        __FieldTag::__external_address_id => {
4867                            if !fields.insert(__FieldTag::__external_address_id) {
4868                                return std::result::Result::Err(A::Error::duplicate_field(
4869                                    "multiple values for external_address_id",
4870                                ));
4871                            }
4872                            result.external_address_id = map
4873                                .next_value::<std::option::Option<std::string::String>>()?
4874                                .unwrap_or_default();
4875                        }
4876                        __FieldTag::__request_id => {
4877                            if !fields.insert(__FieldTag::__request_id) {
4878                                return std::result::Result::Err(A::Error::duplicate_field(
4879                                    "multiple values for request_id",
4880                                ));
4881                            }
4882                            result.request_id = map
4883                                .next_value::<std::option::Option<std::string::String>>()?
4884                                .unwrap_or_default();
4885                        }
4886                        __FieldTag::Unknown(key) => {
4887                            let value = map.next_value::<serde_json::Value>()?;
4888                            result._unknown_fields.insert(key, value);
4889                        }
4890                    }
4891                }
4892                std::result::Result::Ok(result)
4893            }
4894        }
4895        deserializer.deserialize_any(Visitor)
4896    }
4897}
4898
4899#[doc(hidden)]
4900impl serde::ser::Serialize for CreateExternalAddressRequest {
4901    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4902    where
4903        S: serde::ser::Serializer,
4904    {
4905        use serde::ser::SerializeMap;
4906        #[allow(unused_imports)]
4907        use std::option::Option::Some;
4908        let mut state = serializer.serialize_map(std::option::Option::None)?;
4909        if !self.parent.is_empty() {
4910            state.serialize_entry("parent", &self.parent)?;
4911        }
4912        if self.external_address.is_some() {
4913            state.serialize_entry("externalAddress", &self.external_address)?;
4914        }
4915        if !self.external_address_id.is_empty() {
4916            state.serialize_entry("externalAddressId", &self.external_address_id)?;
4917        }
4918        if !self.request_id.is_empty() {
4919            state.serialize_entry("requestId", &self.request_id)?;
4920        }
4921        if !self._unknown_fields.is_empty() {
4922            for (key, value) in self._unknown_fields.iter() {
4923                state.serialize_entry(key, &value)?;
4924            }
4925        }
4926        state.end()
4927    }
4928}
4929
4930impl std::fmt::Debug for CreateExternalAddressRequest {
4931    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4932        let mut debug_struct = f.debug_struct("CreateExternalAddressRequest");
4933        debug_struct.field("parent", &self.parent);
4934        debug_struct.field("external_address", &self.external_address);
4935        debug_struct.field("external_address_id", &self.external_address_id);
4936        debug_struct.field("request_id", &self.request_id);
4937        if !self._unknown_fields.is_empty() {
4938            debug_struct.field("_unknown_fields", &self._unknown_fields);
4939        }
4940        debug_struct.finish()
4941    }
4942}
4943
4944/// Request message for
4945/// [VmwareEngine.UpdateExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]
4946///
4947/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress]: crate::client::VmwareEngine::update_external_address
4948#[derive(Clone, Default, PartialEq)]
4949#[non_exhaustive]
4950pub struct UpdateExternalAddressRequest {
4951    /// Required. Field mask is used to specify the fields to be overwritten in the
4952    /// `ExternalAddress` resource by the update.
4953    /// The fields specified in the `update_mask` are relative to the resource, not
4954    /// the full request. A field will be overwritten if it is in the mask. If the
4955    /// user does not provide a mask then all fields will be overwritten.
4956    pub update_mask: std::option::Option<wkt::FieldMask>,
4957
4958    /// Required. External IP address description.
4959    pub external_address: std::option::Option<crate::model::ExternalAddress>,
4960
4961    /// Optional. A request ID to identify requests. Specify a unique request ID
4962    /// so that if you must retry your request, the server will know to ignore
4963    /// the request if it has already been completed. The server guarantees that a
4964    /// request doesn't result in creation of duplicate commitments for at least 60
4965    /// minutes.
4966    ///
4967    /// For example, consider a situation where you make an initial request and the
4968    /// request times out. If you make the request again with the same request ID,
4969    /// the server can check if the original operation with the same request ID was
4970    /// received, and if so, will ignore the second request. This prevents clients
4971    /// from accidentally creating duplicate commitments.
4972    ///
4973    /// The request ID must be a valid UUID with the exception that zero UUID is
4974    /// not supported (00000000-0000-0000-0000-000000000000).
4975    pub request_id: std::string::String,
4976
4977    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4978}
4979
4980impl UpdateExternalAddressRequest {
4981    pub fn new() -> Self {
4982        std::default::Default::default()
4983    }
4984
4985    /// Sets the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
4986    pub fn set_update_mask<T>(mut self, v: T) -> Self
4987    where
4988        T: std::convert::Into<wkt::FieldMask>,
4989    {
4990        self.update_mask = std::option::Option::Some(v.into());
4991        self
4992    }
4993
4994    /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAddressRequest::update_mask].
4995    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4996    where
4997        T: std::convert::Into<wkt::FieldMask>,
4998    {
4999        self.update_mask = v.map(|x| x.into());
5000        self
5001    }
5002
5003    /// Sets the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
5004    pub fn set_external_address<T>(mut self, v: T) -> Self
5005    where
5006        T: std::convert::Into<crate::model::ExternalAddress>,
5007    {
5008        self.external_address = std::option::Option::Some(v.into());
5009        self
5010    }
5011
5012    /// Sets or clears the value of [external_address][crate::model::UpdateExternalAddressRequest::external_address].
5013    pub fn set_or_clear_external_address<T>(mut self, v: std::option::Option<T>) -> Self
5014    where
5015        T: std::convert::Into<crate::model::ExternalAddress>,
5016    {
5017        self.external_address = v.map(|x| x.into());
5018        self
5019    }
5020
5021    /// Sets the value of [request_id][crate::model::UpdateExternalAddressRequest::request_id].
5022    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023        self.request_id = v.into();
5024        self
5025    }
5026}
5027
5028impl wkt::message::Message for UpdateExternalAddressRequest {
5029    fn typename() -> &'static str {
5030        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAddressRequest"
5031    }
5032}
5033
5034#[doc(hidden)]
5035impl<'de> serde::de::Deserialize<'de> for UpdateExternalAddressRequest {
5036    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5037    where
5038        D: serde::Deserializer<'de>,
5039    {
5040        #[allow(non_camel_case_types)]
5041        #[doc(hidden)]
5042        #[derive(PartialEq, Eq, Hash)]
5043        enum __FieldTag {
5044            __update_mask,
5045            __external_address,
5046            __request_id,
5047            Unknown(std::string::String),
5048        }
5049        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5050            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5051            where
5052                D: serde::Deserializer<'de>,
5053            {
5054                struct Visitor;
5055                impl<'de> serde::de::Visitor<'de> for Visitor {
5056                    type Value = __FieldTag;
5057                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5058                        formatter.write_str("a field name for UpdateExternalAddressRequest")
5059                    }
5060                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5061                    where
5062                        E: serde::de::Error,
5063                    {
5064                        use std::result::Result::Ok;
5065                        use std::string::ToString;
5066                        match value {
5067                            "updateMask" => Ok(__FieldTag::__update_mask),
5068                            "update_mask" => Ok(__FieldTag::__update_mask),
5069                            "externalAddress" => Ok(__FieldTag::__external_address),
5070                            "external_address" => Ok(__FieldTag::__external_address),
5071                            "requestId" => Ok(__FieldTag::__request_id),
5072                            "request_id" => Ok(__FieldTag::__request_id),
5073                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5074                        }
5075                    }
5076                }
5077                deserializer.deserialize_identifier(Visitor)
5078            }
5079        }
5080        struct Visitor;
5081        impl<'de> serde::de::Visitor<'de> for Visitor {
5082            type Value = UpdateExternalAddressRequest;
5083            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5084                formatter.write_str("struct UpdateExternalAddressRequest")
5085            }
5086            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5087            where
5088                A: serde::de::MapAccess<'de>,
5089            {
5090                #[allow(unused_imports)]
5091                use serde::de::Error;
5092                use std::option::Option::Some;
5093                let mut fields = std::collections::HashSet::new();
5094                let mut result = Self::Value::new();
5095                while let Some(tag) = map.next_key::<__FieldTag>()? {
5096                    #[allow(clippy::match_single_binding)]
5097                    match tag {
5098                        __FieldTag::__update_mask => {
5099                            if !fields.insert(__FieldTag::__update_mask) {
5100                                return std::result::Result::Err(A::Error::duplicate_field(
5101                                    "multiple values for update_mask",
5102                                ));
5103                            }
5104                            result.update_mask =
5105                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
5106                        }
5107                        __FieldTag::__external_address => {
5108                            if !fields.insert(__FieldTag::__external_address) {
5109                                return std::result::Result::Err(A::Error::duplicate_field(
5110                                    "multiple values for external_address",
5111                                ));
5112                            }
5113                            result.external_address = map
5114                                .next_value::<std::option::Option<crate::model::ExternalAddress>>(
5115                                )?;
5116                        }
5117                        __FieldTag::__request_id => {
5118                            if !fields.insert(__FieldTag::__request_id) {
5119                                return std::result::Result::Err(A::Error::duplicate_field(
5120                                    "multiple values for request_id",
5121                                ));
5122                            }
5123                            result.request_id = map
5124                                .next_value::<std::option::Option<std::string::String>>()?
5125                                .unwrap_or_default();
5126                        }
5127                        __FieldTag::Unknown(key) => {
5128                            let value = map.next_value::<serde_json::Value>()?;
5129                            result._unknown_fields.insert(key, value);
5130                        }
5131                    }
5132                }
5133                std::result::Result::Ok(result)
5134            }
5135        }
5136        deserializer.deserialize_any(Visitor)
5137    }
5138}
5139
5140#[doc(hidden)]
5141impl serde::ser::Serialize for UpdateExternalAddressRequest {
5142    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5143    where
5144        S: serde::ser::Serializer,
5145    {
5146        use serde::ser::SerializeMap;
5147        #[allow(unused_imports)]
5148        use std::option::Option::Some;
5149        let mut state = serializer.serialize_map(std::option::Option::None)?;
5150        if self.update_mask.is_some() {
5151            state.serialize_entry("updateMask", &self.update_mask)?;
5152        }
5153        if self.external_address.is_some() {
5154            state.serialize_entry("externalAddress", &self.external_address)?;
5155        }
5156        if !self.request_id.is_empty() {
5157            state.serialize_entry("requestId", &self.request_id)?;
5158        }
5159        if !self._unknown_fields.is_empty() {
5160            for (key, value) in self._unknown_fields.iter() {
5161                state.serialize_entry(key, &value)?;
5162            }
5163        }
5164        state.end()
5165    }
5166}
5167
5168impl std::fmt::Debug for UpdateExternalAddressRequest {
5169    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5170        let mut debug_struct = f.debug_struct("UpdateExternalAddressRequest");
5171        debug_struct.field("update_mask", &self.update_mask);
5172        debug_struct.field("external_address", &self.external_address);
5173        debug_struct.field("request_id", &self.request_id);
5174        if !self._unknown_fields.is_empty() {
5175            debug_struct.field("_unknown_fields", &self._unknown_fields);
5176        }
5177        debug_struct.finish()
5178    }
5179}
5180
5181/// Request message for
5182/// [VmwareEngine.DeleteExternalAddress][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]
5183///
5184/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress]: crate::client::VmwareEngine::delete_external_address
5185#[derive(Clone, Default, PartialEq)]
5186#[non_exhaustive]
5187pub struct DeleteExternalAddressRequest {
5188    /// Required. The resource name of the external IP address to delete.
5189    /// Resource names are schemeless URIs that follow the conventions in
5190    /// <https://cloud.google.com/apis/design/resource_names>.
5191    /// For example:
5192    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip`
5193    pub name: std::string::String,
5194
5195    /// Optional. A request ID to identify requests. Specify a unique request ID
5196    /// so that if you must retry your request, the server will know to ignore
5197    /// the request if it has already been completed. The server guarantees that a
5198    /// request doesn't result in creation of duplicate commitments for at least 60
5199    /// minutes.
5200    ///
5201    /// For example, consider a situation where you make an initial request and the
5202    /// request times out. If you make the request again with the same request
5203    /// ID, the server can check if the original operation with the same request ID
5204    /// was received, and if so, will ignore the second request. This prevents
5205    /// clients from accidentally creating duplicate commitments.
5206    ///
5207    /// The request ID must be a valid UUID with the exception that zero UUID is
5208    /// not supported (00000000-0000-0000-0000-000000000000).
5209    pub request_id: std::string::String,
5210
5211    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5212}
5213
5214impl DeleteExternalAddressRequest {
5215    pub fn new() -> Self {
5216        std::default::Default::default()
5217    }
5218
5219    /// Sets the value of [name][crate::model::DeleteExternalAddressRequest::name].
5220    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5221        self.name = v.into();
5222        self
5223    }
5224
5225    /// Sets the value of [request_id][crate::model::DeleteExternalAddressRequest::request_id].
5226    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5227        self.request_id = v.into();
5228        self
5229    }
5230}
5231
5232impl wkt::message::Message for DeleteExternalAddressRequest {
5233    fn typename() -> &'static str {
5234        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAddressRequest"
5235    }
5236}
5237
5238#[doc(hidden)]
5239impl<'de> serde::de::Deserialize<'de> for DeleteExternalAddressRequest {
5240    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5241    where
5242        D: serde::Deserializer<'de>,
5243    {
5244        #[allow(non_camel_case_types)]
5245        #[doc(hidden)]
5246        #[derive(PartialEq, Eq, Hash)]
5247        enum __FieldTag {
5248            __name,
5249            __request_id,
5250            Unknown(std::string::String),
5251        }
5252        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5253            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5254            where
5255                D: serde::Deserializer<'de>,
5256            {
5257                struct Visitor;
5258                impl<'de> serde::de::Visitor<'de> for Visitor {
5259                    type Value = __FieldTag;
5260                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5261                        formatter.write_str("a field name for DeleteExternalAddressRequest")
5262                    }
5263                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5264                    where
5265                        E: serde::de::Error,
5266                    {
5267                        use std::result::Result::Ok;
5268                        use std::string::ToString;
5269                        match value {
5270                            "name" => Ok(__FieldTag::__name),
5271                            "requestId" => Ok(__FieldTag::__request_id),
5272                            "request_id" => Ok(__FieldTag::__request_id),
5273                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5274                        }
5275                    }
5276                }
5277                deserializer.deserialize_identifier(Visitor)
5278            }
5279        }
5280        struct Visitor;
5281        impl<'de> serde::de::Visitor<'de> for Visitor {
5282            type Value = DeleteExternalAddressRequest;
5283            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5284                formatter.write_str("struct DeleteExternalAddressRequest")
5285            }
5286            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5287            where
5288                A: serde::de::MapAccess<'de>,
5289            {
5290                #[allow(unused_imports)]
5291                use serde::de::Error;
5292                use std::option::Option::Some;
5293                let mut fields = std::collections::HashSet::new();
5294                let mut result = Self::Value::new();
5295                while let Some(tag) = map.next_key::<__FieldTag>()? {
5296                    #[allow(clippy::match_single_binding)]
5297                    match tag {
5298                        __FieldTag::__name => {
5299                            if !fields.insert(__FieldTag::__name) {
5300                                return std::result::Result::Err(A::Error::duplicate_field(
5301                                    "multiple values for name",
5302                                ));
5303                            }
5304                            result.name = map
5305                                .next_value::<std::option::Option<std::string::String>>()?
5306                                .unwrap_or_default();
5307                        }
5308                        __FieldTag::__request_id => {
5309                            if !fields.insert(__FieldTag::__request_id) {
5310                                return std::result::Result::Err(A::Error::duplicate_field(
5311                                    "multiple values for request_id",
5312                                ));
5313                            }
5314                            result.request_id = map
5315                                .next_value::<std::option::Option<std::string::String>>()?
5316                                .unwrap_or_default();
5317                        }
5318                        __FieldTag::Unknown(key) => {
5319                            let value = map.next_value::<serde_json::Value>()?;
5320                            result._unknown_fields.insert(key, value);
5321                        }
5322                    }
5323                }
5324                std::result::Result::Ok(result)
5325            }
5326        }
5327        deserializer.deserialize_any(Visitor)
5328    }
5329}
5330
5331#[doc(hidden)]
5332impl serde::ser::Serialize for DeleteExternalAddressRequest {
5333    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5334    where
5335        S: serde::ser::Serializer,
5336    {
5337        use serde::ser::SerializeMap;
5338        #[allow(unused_imports)]
5339        use std::option::Option::Some;
5340        let mut state = serializer.serialize_map(std::option::Option::None)?;
5341        if !self.name.is_empty() {
5342            state.serialize_entry("name", &self.name)?;
5343        }
5344        if !self.request_id.is_empty() {
5345            state.serialize_entry("requestId", &self.request_id)?;
5346        }
5347        if !self._unknown_fields.is_empty() {
5348            for (key, value) in self._unknown_fields.iter() {
5349                state.serialize_entry(key, &value)?;
5350            }
5351        }
5352        state.end()
5353    }
5354}
5355
5356impl std::fmt::Debug for DeleteExternalAddressRequest {
5357    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5358        let mut debug_struct = f.debug_struct("DeleteExternalAddressRequest");
5359        debug_struct.field("name", &self.name);
5360        debug_struct.field("request_id", &self.request_id);
5361        if !self._unknown_fields.is_empty() {
5362            debug_struct.field("_unknown_fields", &self._unknown_fields);
5363        }
5364        debug_struct.finish()
5365    }
5366}
5367
5368/// Request message for
5369/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
5370///
5371/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
5372#[derive(Clone, Default, PartialEq)]
5373#[non_exhaustive]
5374pub struct ListSubnetsRequest {
5375    /// Required. The resource name of the private cloud to be queried for
5376    /// subnets.
5377    /// Resource names are schemeless URIs that follow the conventions in
5378    /// <https://cloud.google.com/apis/design/resource_names>.
5379    /// For example:
5380    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
5381    pub parent: std::string::String,
5382
5383    /// The maximum number of subnets to return in one page.
5384    /// The service may return fewer than this value.
5385    /// The maximum value is coerced to 1000.
5386    /// The default value of this field is 500.
5387    pub page_size: i32,
5388
5389    /// A page token, received from a previous `ListSubnetsRequest` call.
5390    /// Provide this to retrieve the subsequent page.
5391    ///
5392    /// When paginating, all other parameters provided to
5393    /// `ListSubnetsRequest` must match the call that provided the page token.
5394    pub page_token: std::string::String,
5395
5396    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5397}
5398
5399impl ListSubnetsRequest {
5400    pub fn new() -> Self {
5401        std::default::Default::default()
5402    }
5403
5404    /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
5405    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5406        self.parent = v.into();
5407        self
5408    }
5409
5410    /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
5411    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5412        self.page_size = v.into();
5413        self
5414    }
5415
5416    /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
5417    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5418        self.page_token = v.into();
5419        self
5420    }
5421}
5422
5423impl wkt::message::Message for ListSubnetsRequest {
5424    fn typename() -> &'static str {
5425        "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsRequest"
5426    }
5427}
5428
5429#[doc(hidden)]
5430impl<'de> serde::de::Deserialize<'de> for ListSubnetsRequest {
5431    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5432    where
5433        D: serde::Deserializer<'de>,
5434    {
5435        #[allow(non_camel_case_types)]
5436        #[doc(hidden)]
5437        #[derive(PartialEq, Eq, Hash)]
5438        enum __FieldTag {
5439            __parent,
5440            __page_size,
5441            __page_token,
5442            Unknown(std::string::String),
5443        }
5444        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5445            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5446            where
5447                D: serde::Deserializer<'de>,
5448            {
5449                struct Visitor;
5450                impl<'de> serde::de::Visitor<'de> for Visitor {
5451                    type Value = __FieldTag;
5452                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5453                        formatter.write_str("a field name for ListSubnetsRequest")
5454                    }
5455                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5456                    where
5457                        E: serde::de::Error,
5458                    {
5459                        use std::result::Result::Ok;
5460                        use std::string::ToString;
5461                        match value {
5462                            "parent" => Ok(__FieldTag::__parent),
5463                            "pageSize" => Ok(__FieldTag::__page_size),
5464                            "page_size" => Ok(__FieldTag::__page_size),
5465                            "pageToken" => Ok(__FieldTag::__page_token),
5466                            "page_token" => Ok(__FieldTag::__page_token),
5467                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5468                        }
5469                    }
5470                }
5471                deserializer.deserialize_identifier(Visitor)
5472            }
5473        }
5474        struct Visitor;
5475        impl<'de> serde::de::Visitor<'de> for Visitor {
5476            type Value = ListSubnetsRequest;
5477            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5478                formatter.write_str("struct ListSubnetsRequest")
5479            }
5480            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5481            where
5482                A: serde::de::MapAccess<'de>,
5483            {
5484                #[allow(unused_imports)]
5485                use serde::de::Error;
5486                use std::option::Option::Some;
5487                let mut fields = std::collections::HashSet::new();
5488                let mut result = Self::Value::new();
5489                while let Some(tag) = map.next_key::<__FieldTag>()? {
5490                    #[allow(clippy::match_single_binding)]
5491                    match tag {
5492                        __FieldTag::__parent => {
5493                            if !fields.insert(__FieldTag::__parent) {
5494                                return std::result::Result::Err(A::Error::duplicate_field(
5495                                    "multiple values for parent",
5496                                ));
5497                            }
5498                            result.parent = map
5499                                .next_value::<std::option::Option<std::string::String>>()?
5500                                .unwrap_or_default();
5501                        }
5502                        __FieldTag::__page_size => {
5503                            if !fields.insert(__FieldTag::__page_size) {
5504                                return std::result::Result::Err(A::Error::duplicate_field(
5505                                    "multiple values for page_size",
5506                                ));
5507                            }
5508                            struct __With(std::option::Option<i32>);
5509                            impl<'de> serde::de::Deserialize<'de> for __With {
5510                                fn deserialize<D>(
5511                                    deserializer: D,
5512                                ) -> std::result::Result<Self, D::Error>
5513                                where
5514                                    D: serde::de::Deserializer<'de>,
5515                                {
5516                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5517                                }
5518                            }
5519                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
5520                        }
5521                        __FieldTag::__page_token => {
5522                            if !fields.insert(__FieldTag::__page_token) {
5523                                return std::result::Result::Err(A::Error::duplicate_field(
5524                                    "multiple values for page_token",
5525                                ));
5526                            }
5527                            result.page_token = map
5528                                .next_value::<std::option::Option<std::string::String>>()?
5529                                .unwrap_or_default();
5530                        }
5531                        __FieldTag::Unknown(key) => {
5532                            let value = map.next_value::<serde_json::Value>()?;
5533                            result._unknown_fields.insert(key, value);
5534                        }
5535                    }
5536                }
5537                std::result::Result::Ok(result)
5538            }
5539        }
5540        deserializer.deserialize_any(Visitor)
5541    }
5542}
5543
5544#[doc(hidden)]
5545impl serde::ser::Serialize for ListSubnetsRequest {
5546    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5547    where
5548        S: serde::ser::Serializer,
5549    {
5550        use serde::ser::SerializeMap;
5551        #[allow(unused_imports)]
5552        use std::option::Option::Some;
5553        let mut state = serializer.serialize_map(std::option::Option::None)?;
5554        if !self.parent.is_empty() {
5555            state.serialize_entry("parent", &self.parent)?;
5556        }
5557        if !wkt::internal::is_default(&self.page_size) {
5558            struct __With<'a>(&'a i32);
5559            impl<'a> serde::ser::Serialize for __With<'a> {
5560                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5561                where
5562                    S: serde::ser::Serializer,
5563                {
5564                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5565                }
5566            }
5567            state.serialize_entry("pageSize", &__With(&self.page_size))?;
5568        }
5569        if !self.page_token.is_empty() {
5570            state.serialize_entry("pageToken", &self.page_token)?;
5571        }
5572        if !self._unknown_fields.is_empty() {
5573            for (key, value) in self._unknown_fields.iter() {
5574                state.serialize_entry(key, &value)?;
5575            }
5576        }
5577        state.end()
5578    }
5579}
5580
5581impl std::fmt::Debug for ListSubnetsRequest {
5582    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5583        let mut debug_struct = f.debug_struct("ListSubnetsRequest");
5584        debug_struct.field("parent", &self.parent);
5585        debug_struct.field("page_size", &self.page_size);
5586        debug_struct.field("page_token", &self.page_token);
5587        if !self._unknown_fields.is_empty() {
5588            debug_struct.field("_unknown_fields", &self._unknown_fields);
5589        }
5590        debug_struct.finish()
5591    }
5592}
5593
5594/// Response message for
5595/// [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]
5596///
5597/// [google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets]: crate::client::VmwareEngine::list_subnets
5598#[derive(Clone, Default, PartialEq)]
5599#[non_exhaustive]
5600pub struct ListSubnetsResponse {
5601    /// A list of subnets.
5602    pub subnets: std::vec::Vec<crate::model::Subnet>,
5603
5604    /// A token, which can be sent as `page_token` to retrieve the next page.
5605    /// If this field is omitted, there are no subsequent pages.
5606    pub next_page_token: std::string::String,
5607
5608    /// Locations that could not be reached when making an aggregated query using
5609    /// wildcards.
5610    pub unreachable: std::vec::Vec<std::string::String>,
5611
5612    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5613}
5614
5615impl ListSubnetsResponse {
5616    pub fn new() -> Self {
5617        std::default::Default::default()
5618    }
5619
5620    /// Sets the value of [subnets][crate::model::ListSubnetsResponse::subnets].
5621    pub fn set_subnets<T, V>(mut self, v: T) -> Self
5622    where
5623        T: std::iter::IntoIterator<Item = V>,
5624        V: std::convert::Into<crate::model::Subnet>,
5625    {
5626        use std::iter::Iterator;
5627        self.subnets = v.into_iter().map(|i| i.into()).collect();
5628        self
5629    }
5630
5631    /// Sets the value of [next_page_token][crate::model::ListSubnetsResponse::next_page_token].
5632    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5633        self.next_page_token = v.into();
5634        self
5635    }
5636
5637    /// Sets the value of [unreachable][crate::model::ListSubnetsResponse::unreachable].
5638    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5639    where
5640        T: std::iter::IntoIterator<Item = V>,
5641        V: std::convert::Into<std::string::String>,
5642    {
5643        use std::iter::Iterator;
5644        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5645        self
5646    }
5647}
5648
5649impl wkt::message::Message for ListSubnetsResponse {
5650    fn typename() -> &'static str {
5651        "type.googleapis.com/google.cloud.vmwareengine.v1.ListSubnetsResponse"
5652    }
5653}
5654
5655#[doc(hidden)]
5656impl gax::paginator::internal::PageableResponse for ListSubnetsResponse {
5657    type PageItem = crate::model::Subnet;
5658
5659    fn items(self) -> std::vec::Vec<Self::PageItem> {
5660        self.subnets
5661    }
5662
5663    fn next_page_token(&self) -> std::string::String {
5664        use std::clone::Clone;
5665        self.next_page_token.clone()
5666    }
5667}
5668
5669#[doc(hidden)]
5670impl<'de> serde::de::Deserialize<'de> for ListSubnetsResponse {
5671    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5672    where
5673        D: serde::Deserializer<'de>,
5674    {
5675        #[allow(non_camel_case_types)]
5676        #[doc(hidden)]
5677        #[derive(PartialEq, Eq, Hash)]
5678        enum __FieldTag {
5679            __subnets,
5680            __next_page_token,
5681            __unreachable,
5682            Unknown(std::string::String),
5683        }
5684        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5685            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5686            where
5687                D: serde::Deserializer<'de>,
5688            {
5689                struct Visitor;
5690                impl<'de> serde::de::Visitor<'de> for Visitor {
5691                    type Value = __FieldTag;
5692                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5693                        formatter.write_str("a field name for ListSubnetsResponse")
5694                    }
5695                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5696                    where
5697                        E: serde::de::Error,
5698                    {
5699                        use std::result::Result::Ok;
5700                        use std::string::ToString;
5701                        match value {
5702                            "subnets" => Ok(__FieldTag::__subnets),
5703                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
5704                            "next_page_token" => Ok(__FieldTag::__next_page_token),
5705                            "unreachable" => Ok(__FieldTag::__unreachable),
5706                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5707                        }
5708                    }
5709                }
5710                deserializer.deserialize_identifier(Visitor)
5711            }
5712        }
5713        struct Visitor;
5714        impl<'de> serde::de::Visitor<'de> for Visitor {
5715            type Value = ListSubnetsResponse;
5716            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5717                formatter.write_str("struct ListSubnetsResponse")
5718            }
5719            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5720            where
5721                A: serde::de::MapAccess<'de>,
5722            {
5723                #[allow(unused_imports)]
5724                use serde::de::Error;
5725                use std::option::Option::Some;
5726                let mut fields = std::collections::HashSet::new();
5727                let mut result = Self::Value::new();
5728                while let Some(tag) = map.next_key::<__FieldTag>()? {
5729                    #[allow(clippy::match_single_binding)]
5730                    match tag {
5731                        __FieldTag::__subnets => {
5732                            if !fields.insert(__FieldTag::__subnets) {
5733                                return std::result::Result::Err(A::Error::duplicate_field(
5734                                    "multiple values for subnets",
5735                                ));
5736                            }
5737                            result.subnets = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Subnet>>>()?.unwrap_or_default();
5738                        }
5739                        __FieldTag::__next_page_token => {
5740                            if !fields.insert(__FieldTag::__next_page_token) {
5741                                return std::result::Result::Err(A::Error::duplicate_field(
5742                                    "multiple values for next_page_token",
5743                                ));
5744                            }
5745                            result.next_page_token = map
5746                                .next_value::<std::option::Option<std::string::String>>()?
5747                                .unwrap_or_default();
5748                        }
5749                        __FieldTag::__unreachable => {
5750                            if !fields.insert(__FieldTag::__unreachable) {
5751                                return std::result::Result::Err(A::Error::duplicate_field(
5752                                    "multiple values for unreachable",
5753                                ));
5754                            }
5755                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
5756                        }
5757                        __FieldTag::Unknown(key) => {
5758                            let value = map.next_value::<serde_json::Value>()?;
5759                            result._unknown_fields.insert(key, value);
5760                        }
5761                    }
5762                }
5763                std::result::Result::Ok(result)
5764            }
5765        }
5766        deserializer.deserialize_any(Visitor)
5767    }
5768}
5769
5770#[doc(hidden)]
5771impl serde::ser::Serialize for ListSubnetsResponse {
5772    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5773    where
5774        S: serde::ser::Serializer,
5775    {
5776        use serde::ser::SerializeMap;
5777        #[allow(unused_imports)]
5778        use std::option::Option::Some;
5779        let mut state = serializer.serialize_map(std::option::Option::None)?;
5780        if !self.subnets.is_empty() {
5781            state.serialize_entry("subnets", &self.subnets)?;
5782        }
5783        if !self.next_page_token.is_empty() {
5784            state.serialize_entry("nextPageToken", &self.next_page_token)?;
5785        }
5786        if !self.unreachable.is_empty() {
5787            state.serialize_entry("unreachable", &self.unreachable)?;
5788        }
5789        if !self._unknown_fields.is_empty() {
5790            for (key, value) in self._unknown_fields.iter() {
5791                state.serialize_entry(key, &value)?;
5792            }
5793        }
5794        state.end()
5795    }
5796}
5797
5798impl std::fmt::Debug for ListSubnetsResponse {
5799    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5800        let mut debug_struct = f.debug_struct("ListSubnetsResponse");
5801        debug_struct.field("subnets", &self.subnets);
5802        debug_struct.field("next_page_token", &self.next_page_token);
5803        debug_struct.field("unreachable", &self.unreachable);
5804        if !self._unknown_fields.is_empty() {
5805            debug_struct.field("_unknown_fields", &self._unknown_fields);
5806        }
5807        debug_struct.finish()
5808    }
5809}
5810
5811/// Request message for
5812/// [VmwareEngine.GetSubnet][google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]
5813///
5814/// [google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet]: crate::client::VmwareEngine::get_subnet
5815#[derive(Clone, Default, PartialEq)]
5816#[non_exhaustive]
5817pub struct GetSubnetRequest {
5818    /// Required. The resource name of the subnet to retrieve.
5819    /// Resource names are schemeless URIs that follow the conventions in
5820    /// <https://cloud.google.com/apis/design/resource_names>.
5821    /// For example:
5822    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
5823    pub name: std::string::String,
5824
5825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5826}
5827
5828impl GetSubnetRequest {
5829    pub fn new() -> Self {
5830        std::default::Default::default()
5831    }
5832
5833    /// Sets the value of [name][crate::model::GetSubnetRequest::name].
5834    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5835        self.name = v.into();
5836        self
5837    }
5838}
5839
5840impl wkt::message::Message for GetSubnetRequest {
5841    fn typename() -> &'static str {
5842        "type.googleapis.com/google.cloud.vmwareengine.v1.GetSubnetRequest"
5843    }
5844}
5845
5846#[doc(hidden)]
5847impl<'de> serde::de::Deserialize<'de> for GetSubnetRequest {
5848    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5849    where
5850        D: serde::Deserializer<'de>,
5851    {
5852        #[allow(non_camel_case_types)]
5853        #[doc(hidden)]
5854        #[derive(PartialEq, Eq, Hash)]
5855        enum __FieldTag {
5856            __name,
5857            Unknown(std::string::String),
5858        }
5859        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5860            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5861            where
5862                D: serde::Deserializer<'de>,
5863            {
5864                struct Visitor;
5865                impl<'de> serde::de::Visitor<'de> for Visitor {
5866                    type Value = __FieldTag;
5867                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5868                        formatter.write_str("a field name for GetSubnetRequest")
5869                    }
5870                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5871                    where
5872                        E: serde::de::Error,
5873                    {
5874                        use std::result::Result::Ok;
5875                        use std::string::ToString;
5876                        match value {
5877                            "name" => Ok(__FieldTag::__name),
5878                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5879                        }
5880                    }
5881                }
5882                deserializer.deserialize_identifier(Visitor)
5883            }
5884        }
5885        struct Visitor;
5886        impl<'de> serde::de::Visitor<'de> for Visitor {
5887            type Value = GetSubnetRequest;
5888            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5889                formatter.write_str("struct GetSubnetRequest")
5890            }
5891            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5892            where
5893                A: serde::de::MapAccess<'de>,
5894            {
5895                #[allow(unused_imports)]
5896                use serde::de::Error;
5897                use std::option::Option::Some;
5898                let mut fields = std::collections::HashSet::new();
5899                let mut result = Self::Value::new();
5900                while let Some(tag) = map.next_key::<__FieldTag>()? {
5901                    #[allow(clippy::match_single_binding)]
5902                    match tag {
5903                        __FieldTag::__name => {
5904                            if !fields.insert(__FieldTag::__name) {
5905                                return std::result::Result::Err(A::Error::duplicate_field(
5906                                    "multiple values for name",
5907                                ));
5908                            }
5909                            result.name = map
5910                                .next_value::<std::option::Option<std::string::String>>()?
5911                                .unwrap_or_default();
5912                        }
5913                        __FieldTag::Unknown(key) => {
5914                            let value = map.next_value::<serde_json::Value>()?;
5915                            result._unknown_fields.insert(key, value);
5916                        }
5917                    }
5918                }
5919                std::result::Result::Ok(result)
5920            }
5921        }
5922        deserializer.deserialize_any(Visitor)
5923    }
5924}
5925
5926#[doc(hidden)]
5927impl serde::ser::Serialize for GetSubnetRequest {
5928    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5929    where
5930        S: serde::ser::Serializer,
5931    {
5932        use serde::ser::SerializeMap;
5933        #[allow(unused_imports)]
5934        use std::option::Option::Some;
5935        let mut state = serializer.serialize_map(std::option::Option::None)?;
5936        if !self.name.is_empty() {
5937            state.serialize_entry("name", &self.name)?;
5938        }
5939        if !self._unknown_fields.is_empty() {
5940            for (key, value) in self._unknown_fields.iter() {
5941                state.serialize_entry(key, &value)?;
5942            }
5943        }
5944        state.end()
5945    }
5946}
5947
5948impl std::fmt::Debug for GetSubnetRequest {
5949    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5950        let mut debug_struct = f.debug_struct("GetSubnetRequest");
5951        debug_struct.field("name", &self.name);
5952        if !self._unknown_fields.is_empty() {
5953            debug_struct.field("_unknown_fields", &self._unknown_fields);
5954        }
5955        debug_struct.finish()
5956    }
5957}
5958
5959/// Request message for
5960/// [VmwareEngine.UpdateSubnet][google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]
5961///
5962/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet]: crate::client::VmwareEngine::update_subnet
5963#[derive(Clone, Default, PartialEq)]
5964#[non_exhaustive]
5965pub struct UpdateSubnetRequest {
5966    /// Required. Field mask is used to specify the fields to be overwritten in the
5967    /// `Subnet` resource by the update.
5968    /// The fields specified in the `update_mask` are relative to the resource, not
5969    /// the full request. A field will be overwritten if it is in the mask. If the
5970    /// user does not provide a mask then all fields will be overwritten.
5971    pub update_mask: std::option::Option<wkt::FieldMask>,
5972
5973    /// Required. Subnet description.
5974    pub subnet: std::option::Option<crate::model::Subnet>,
5975
5976    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5977}
5978
5979impl UpdateSubnetRequest {
5980    pub fn new() -> Self {
5981        std::default::Default::default()
5982    }
5983
5984    /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
5985    pub fn set_update_mask<T>(mut self, v: T) -> Self
5986    where
5987        T: std::convert::Into<wkt::FieldMask>,
5988    {
5989        self.update_mask = std::option::Option::Some(v.into());
5990        self
5991    }
5992
5993    /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
5994    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5995    where
5996        T: std::convert::Into<wkt::FieldMask>,
5997    {
5998        self.update_mask = v.map(|x| x.into());
5999        self
6000    }
6001
6002    /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
6003    pub fn set_subnet<T>(mut self, v: T) -> Self
6004    where
6005        T: std::convert::Into<crate::model::Subnet>,
6006    {
6007        self.subnet = std::option::Option::Some(v.into());
6008        self
6009    }
6010
6011    /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
6012    pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
6013    where
6014        T: std::convert::Into<crate::model::Subnet>,
6015    {
6016        self.subnet = v.map(|x| x.into());
6017        self
6018    }
6019}
6020
6021impl wkt::message::Message for UpdateSubnetRequest {
6022    fn typename() -> &'static str {
6023        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateSubnetRequest"
6024    }
6025}
6026
6027#[doc(hidden)]
6028impl<'de> serde::de::Deserialize<'de> for UpdateSubnetRequest {
6029    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6030    where
6031        D: serde::Deserializer<'de>,
6032    {
6033        #[allow(non_camel_case_types)]
6034        #[doc(hidden)]
6035        #[derive(PartialEq, Eq, Hash)]
6036        enum __FieldTag {
6037            __update_mask,
6038            __subnet,
6039            Unknown(std::string::String),
6040        }
6041        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6042            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6043            where
6044                D: serde::Deserializer<'de>,
6045            {
6046                struct Visitor;
6047                impl<'de> serde::de::Visitor<'de> for Visitor {
6048                    type Value = __FieldTag;
6049                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6050                        formatter.write_str("a field name for UpdateSubnetRequest")
6051                    }
6052                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6053                    where
6054                        E: serde::de::Error,
6055                    {
6056                        use std::result::Result::Ok;
6057                        use std::string::ToString;
6058                        match value {
6059                            "updateMask" => Ok(__FieldTag::__update_mask),
6060                            "update_mask" => Ok(__FieldTag::__update_mask),
6061                            "subnet" => Ok(__FieldTag::__subnet),
6062                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6063                        }
6064                    }
6065                }
6066                deserializer.deserialize_identifier(Visitor)
6067            }
6068        }
6069        struct Visitor;
6070        impl<'de> serde::de::Visitor<'de> for Visitor {
6071            type Value = UpdateSubnetRequest;
6072            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6073                formatter.write_str("struct UpdateSubnetRequest")
6074            }
6075            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6076            where
6077                A: serde::de::MapAccess<'de>,
6078            {
6079                #[allow(unused_imports)]
6080                use serde::de::Error;
6081                use std::option::Option::Some;
6082                let mut fields = std::collections::HashSet::new();
6083                let mut result = Self::Value::new();
6084                while let Some(tag) = map.next_key::<__FieldTag>()? {
6085                    #[allow(clippy::match_single_binding)]
6086                    match tag {
6087                        __FieldTag::__update_mask => {
6088                            if !fields.insert(__FieldTag::__update_mask) {
6089                                return std::result::Result::Err(A::Error::duplicate_field(
6090                                    "multiple values for update_mask",
6091                                ));
6092                            }
6093                            result.update_mask =
6094                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6095                        }
6096                        __FieldTag::__subnet => {
6097                            if !fields.insert(__FieldTag::__subnet) {
6098                                return std::result::Result::Err(A::Error::duplicate_field(
6099                                    "multiple values for subnet",
6100                                ));
6101                            }
6102                            result.subnet =
6103                                map.next_value::<std::option::Option<crate::model::Subnet>>()?;
6104                        }
6105                        __FieldTag::Unknown(key) => {
6106                            let value = map.next_value::<serde_json::Value>()?;
6107                            result._unknown_fields.insert(key, value);
6108                        }
6109                    }
6110                }
6111                std::result::Result::Ok(result)
6112            }
6113        }
6114        deserializer.deserialize_any(Visitor)
6115    }
6116}
6117
6118#[doc(hidden)]
6119impl serde::ser::Serialize for UpdateSubnetRequest {
6120    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6121    where
6122        S: serde::ser::Serializer,
6123    {
6124        use serde::ser::SerializeMap;
6125        #[allow(unused_imports)]
6126        use std::option::Option::Some;
6127        let mut state = serializer.serialize_map(std::option::Option::None)?;
6128        if self.update_mask.is_some() {
6129            state.serialize_entry("updateMask", &self.update_mask)?;
6130        }
6131        if self.subnet.is_some() {
6132            state.serialize_entry("subnet", &self.subnet)?;
6133        }
6134        if !self._unknown_fields.is_empty() {
6135            for (key, value) in self._unknown_fields.iter() {
6136                state.serialize_entry(key, &value)?;
6137            }
6138        }
6139        state.end()
6140    }
6141}
6142
6143impl std::fmt::Debug for UpdateSubnetRequest {
6144    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6145        let mut debug_struct = f.debug_struct("UpdateSubnetRequest");
6146        debug_struct.field("update_mask", &self.update_mask);
6147        debug_struct.field("subnet", &self.subnet);
6148        if !self._unknown_fields.is_empty() {
6149            debug_struct.field("_unknown_fields", &self._unknown_fields);
6150        }
6151        debug_struct.finish()
6152    }
6153}
6154
6155/// Request message for
6156/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
6157///
6158/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
6159#[derive(Clone, Default, PartialEq)]
6160#[non_exhaustive]
6161pub struct ListExternalAccessRulesRequest {
6162    /// Required. The resource name of the network policy to query for external
6163    /// access firewall rules. Resource names are schemeless URIs that follow the
6164    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
6165    /// example:
6166    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
6167    pub parent: std::string::String,
6168
6169    /// The maximum number of external access rules to return in one page.
6170    /// The service may return fewer than this value.
6171    /// The maximum value is coerced to 1000.
6172    /// The default value of this field is 500.
6173    pub page_size: i32,
6174
6175    /// A page token, received from a previous `ListExternalAccessRulesRequest`
6176    /// call. Provide this to retrieve the subsequent page.
6177    ///
6178    /// When paginating, all other parameters provided to
6179    /// `ListExternalAccessRulesRequest` must match the call that provided the page
6180    /// token.
6181    pub page_token: std::string::String,
6182
6183    /// A filter expression that matches resources returned in the response.
6184    /// The expression must specify the field name, a comparison
6185    /// operator, and the value that you want to use for filtering. The value
6186    /// must be a string, a number, or a boolean. The comparison operator
6187    /// must be `=`, `!=`, `>`, or `<`.
6188    ///
6189    /// For example, if you are filtering a list of external access rules, you can
6190    /// exclude the ones named `example-rule` by specifying
6191    /// `name != "example-rule"`.
6192    ///
6193    /// To filter on multiple expressions, provide each separate expression within
6194    /// parentheses. For example:
6195    ///
6196    /// ```norust
6197    /// (name = "example-rule")
6198    /// (createTime > "2021-04-12T08:15:10.40Z")
6199    /// ```
6200    ///
6201    /// By default, each expression is an `AND` expression. However, you
6202    /// can include `AND` and `OR` expressions explicitly.
6203    /// For example:
6204    ///
6205    /// ```norust
6206    /// (name = "example-rule-1") AND
6207    /// (createTime > "2021-04-12T08:15:10.40Z") OR
6208    /// (name = "example-rule-2")
6209    /// ```
6210    pub filter: std::string::String,
6211
6212    /// Sorts list results by a certain order. By default, returned results
6213    /// are ordered by `name` in ascending order.
6214    /// You can also sort results in descending order based on the `name` value
6215    /// using `orderBy="name desc"`.
6216    /// Currently, only ordering by `name` is supported.
6217    pub order_by: std::string::String,
6218
6219    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6220}
6221
6222impl ListExternalAccessRulesRequest {
6223    pub fn new() -> Self {
6224        std::default::Default::default()
6225    }
6226
6227    /// Sets the value of [parent][crate::model::ListExternalAccessRulesRequest::parent].
6228    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6229        self.parent = v.into();
6230        self
6231    }
6232
6233    /// Sets the value of [page_size][crate::model::ListExternalAccessRulesRequest::page_size].
6234    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6235        self.page_size = v.into();
6236        self
6237    }
6238
6239    /// Sets the value of [page_token][crate::model::ListExternalAccessRulesRequest::page_token].
6240    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6241        self.page_token = v.into();
6242        self
6243    }
6244
6245    /// Sets the value of [filter][crate::model::ListExternalAccessRulesRequest::filter].
6246    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6247        self.filter = v.into();
6248        self
6249    }
6250
6251    /// Sets the value of [order_by][crate::model::ListExternalAccessRulesRequest::order_by].
6252    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6253        self.order_by = v.into();
6254        self
6255    }
6256}
6257
6258impl wkt::message::Message for ListExternalAccessRulesRequest {
6259    fn typename() -> &'static str {
6260        "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest"
6261    }
6262}
6263
6264#[doc(hidden)]
6265impl<'de> serde::de::Deserialize<'de> for ListExternalAccessRulesRequest {
6266    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6267    where
6268        D: serde::Deserializer<'de>,
6269    {
6270        #[allow(non_camel_case_types)]
6271        #[doc(hidden)]
6272        #[derive(PartialEq, Eq, Hash)]
6273        enum __FieldTag {
6274            __parent,
6275            __page_size,
6276            __page_token,
6277            __filter,
6278            __order_by,
6279            Unknown(std::string::String),
6280        }
6281        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6282            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6283            where
6284                D: serde::Deserializer<'de>,
6285            {
6286                struct Visitor;
6287                impl<'de> serde::de::Visitor<'de> for Visitor {
6288                    type Value = __FieldTag;
6289                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6290                        formatter.write_str("a field name for ListExternalAccessRulesRequest")
6291                    }
6292                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6293                    where
6294                        E: serde::de::Error,
6295                    {
6296                        use std::result::Result::Ok;
6297                        use std::string::ToString;
6298                        match value {
6299                            "parent" => Ok(__FieldTag::__parent),
6300                            "pageSize" => Ok(__FieldTag::__page_size),
6301                            "page_size" => Ok(__FieldTag::__page_size),
6302                            "pageToken" => Ok(__FieldTag::__page_token),
6303                            "page_token" => Ok(__FieldTag::__page_token),
6304                            "filter" => Ok(__FieldTag::__filter),
6305                            "orderBy" => Ok(__FieldTag::__order_by),
6306                            "order_by" => Ok(__FieldTag::__order_by),
6307                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6308                        }
6309                    }
6310                }
6311                deserializer.deserialize_identifier(Visitor)
6312            }
6313        }
6314        struct Visitor;
6315        impl<'de> serde::de::Visitor<'de> for Visitor {
6316            type Value = ListExternalAccessRulesRequest;
6317            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6318                formatter.write_str("struct ListExternalAccessRulesRequest")
6319            }
6320            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6321            where
6322                A: serde::de::MapAccess<'de>,
6323            {
6324                #[allow(unused_imports)]
6325                use serde::de::Error;
6326                use std::option::Option::Some;
6327                let mut fields = std::collections::HashSet::new();
6328                let mut result = Self::Value::new();
6329                while let Some(tag) = map.next_key::<__FieldTag>()? {
6330                    #[allow(clippy::match_single_binding)]
6331                    match tag {
6332                        __FieldTag::__parent => {
6333                            if !fields.insert(__FieldTag::__parent) {
6334                                return std::result::Result::Err(A::Error::duplicate_field(
6335                                    "multiple values for parent",
6336                                ));
6337                            }
6338                            result.parent = map
6339                                .next_value::<std::option::Option<std::string::String>>()?
6340                                .unwrap_or_default();
6341                        }
6342                        __FieldTag::__page_size => {
6343                            if !fields.insert(__FieldTag::__page_size) {
6344                                return std::result::Result::Err(A::Error::duplicate_field(
6345                                    "multiple values for page_size",
6346                                ));
6347                            }
6348                            struct __With(std::option::Option<i32>);
6349                            impl<'de> serde::de::Deserialize<'de> for __With {
6350                                fn deserialize<D>(
6351                                    deserializer: D,
6352                                ) -> std::result::Result<Self, D::Error>
6353                                where
6354                                    D: serde::de::Deserializer<'de>,
6355                                {
6356                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6357                                }
6358                            }
6359                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6360                        }
6361                        __FieldTag::__page_token => {
6362                            if !fields.insert(__FieldTag::__page_token) {
6363                                return std::result::Result::Err(A::Error::duplicate_field(
6364                                    "multiple values for page_token",
6365                                ));
6366                            }
6367                            result.page_token = map
6368                                .next_value::<std::option::Option<std::string::String>>()?
6369                                .unwrap_or_default();
6370                        }
6371                        __FieldTag::__filter => {
6372                            if !fields.insert(__FieldTag::__filter) {
6373                                return std::result::Result::Err(A::Error::duplicate_field(
6374                                    "multiple values for filter",
6375                                ));
6376                            }
6377                            result.filter = map
6378                                .next_value::<std::option::Option<std::string::String>>()?
6379                                .unwrap_or_default();
6380                        }
6381                        __FieldTag::__order_by => {
6382                            if !fields.insert(__FieldTag::__order_by) {
6383                                return std::result::Result::Err(A::Error::duplicate_field(
6384                                    "multiple values for order_by",
6385                                ));
6386                            }
6387                            result.order_by = map
6388                                .next_value::<std::option::Option<std::string::String>>()?
6389                                .unwrap_or_default();
6390                        }
6391                        __FieldTag::Unknown(key) => {
6392                            let value = map.next_value::<serde_json::Value>()?;
6393                            result._unknown_fields.insert(key, value);
6394                        }
6395                    }
6396                }
6397                std::result::Result::Ok(result)
6398            }
6399        }
6400        deserializer.deserialize_any(Visitor)
6401    }
6402}
6403
6404#[doc(hidden)]
6405impl serde::ser::Serialize for ListExternalAccessRulesRequest {
6406    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6407    where
6408        S: serde::ser::Serializer,
6409    {
6410        use serde::ser::SerializeMap;
6411        #[allow(unused_imports)]
6412        use std::option::Option::Some;
6413        let mut state = serializer.serialize_map(std::option::Option::None)?;
6414        if !self.parent.is_empty() {
6415            state.serialize_entry("parent", &self.parent)?;
6416        }
6417        if !wkt::internal::is_default(&self.page_size) {
6418            struct __With<'a>(&'a i32);
6419            impl<'a> serde::ser::Serialize for __With<'a> {
6420                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6421                where
6422                    S: serde::ser::Serializer,
6423                {
6424                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6425                }
6426            }
6427            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6428        }
6429        if !self.page_token.is_empty() {
6430            state.serialize_entry("pageToken", &self.page_token)?;
6431        }
6432        if !self.filter.is_empty() {
6433            state.serialize_entry("filter", &self.filter)?;
6434        }
6435        if !self.order_by.is_empty() {
6436            state.serialize_entry("orderBy", &self.order_by)?;
6437        }
6438        if !self._unknown_fields.is_empty() {
6439            for (key, value) in self._unknown_fields.iter() {
6440                state.serialize_entry(key, &value)?;
6441            }
6442        }
6443        state.end()
6444    }
6445}
6446
6447impl std::fmt::Debug for ListExternalAccessRulesRequest {
6448    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6449        let mut debug_struct = f.debug_struct("ListExternalAccessRulesRequest");
6450        debug_struct.field("parent", &self.parent);
6451        debug_struct.field("page_size", &self.page_size);
6452        debug_struct.field("page_token", &self.page_token);
6453        debug_struct.field("filter", &self.filter);
6454        debug_struct.field("order_by", &self.order_by);
6455        if !self._unknown_fields.is_empty() {
6456            debug_struct.field("_unknown_fields", &self._unknown_fields);
6457        }
6458        debug_struct.finish()
6459    }
6460}
6461
6462/// Response message for
6463/// [VmwareEngine.ListExternalAccessRules][google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]
6464///
6465/// [google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules]: crate::client::VmwareEngine::list_external_access_rules
6466#[derive(Clone, Default, PartialEq)]
6467#[non_exhaustive]
6468pub struct ListExternalAccessRulesResponse {
6469    /// A list of external access firewall rules.
6470    pub external_access_rules: std::vec::Vec<crate::model::ExternalAccessRule>,
6471
6472    /// A token, which can be sent as `page_token` to retrieve the next page.
6473    /// If this field is omitted, there are no subsequent pages.
6474    pub next_page_token: std::string::String,
6475
6476    /// Locations that could not be reached when making an aggregated query using
6477    /// wildcards.
6478    pub unreachable: std::vec::Vec<std::string::String>,
6479
6480    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6481}
6482
6483impl ListExternalAccessRulesResponse {
6484    pub fn new() -> Self {
6485        std::default::Default::default()
6486    }
6487
6488    /// Sets the value of [external_access_rules][crate::model::ListExternalAccessRulesResponse::external_access_rules].
6489    pub fn set_external_access_rules<T, V>(mut self, v: T) -> Self
6490    where
6491        T: std::iter::IntoIterator<Item = V>,
6492        V: std::convert::Into<crate::model::ExternalAccessRule>,
6493    {
6494        use std::iter::Iterator;
6495        self.external_access_rules = v.into_iter().map(|i| i.into()).collect();
6496        self
6497    }
6498
6499    /// Sets the value of [next_page_token][crate::model::ListExternalAccessRulesResponse::next_page_token].
6500    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501        self.next_page_token = v.into();
6502        self
6503    }
6504
6505    /// Sets the value of [unreachable][crate::model::ListExternalAccessRulesResponse::unreachable].
6506    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6507    where
6508        T: std::iter::IntoIterator<Item = V>,
6509        V: std::convert::Into<std::string::String>,
6510    {
6511        use std::iter::Iterator;
6512        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6513        self
6514    }
6515}
6516
6517impl wkt::message::Message for ListExternalAccessRulesResponse {
6518    fn typename() -> &'static str {
6519        "type.googleapis.com/google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse"
6520    }
6521}
6522
6523#[doc(hidden)]
6524impl gax::paginator::internal::PageableResponse for ListExternalAccessRulesResponse {
6525    type PageItem = crate::model::ExternalAccessRule;
6526
6527    fn items(self) -> std::vec::Vec<Self::PageItem> {
6528        self.external_access_rules
6529    }
6530
6531    fn next_page_token(&self) -> std::string::String {
6532        use std::clone::Clone;
6533        self.next_page_token.clone()
6534    }
6535}
6536
6537#[doc(hidden)]
6538impl<'de> serde::de::Deserialize<'de> for ListExternalAccessRulesResponse {
6539    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6540    where
6541        D: serde::Deserializer<'de>,
6542    {
6543        #[allow(non_camel_case_types)]
6544        #[doc(hidden)]
6545        #[derive(PartialEq, Eq, Hash)]
6546        enum __FieldTag {
6547            __external_access_rules,
6548            __next_page_token,
6549            __unreachable,
6550            Unknown(std::string::String),
6551        }
6552        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6553            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6554            where
6555                D: serde::Deserializer<'de>,
6556            {
6557                struct Visitor;
6558                impl<'de> serde::de::Visitor<'de> for Visitor {
6559                    type Value = __FieldTag;
6560                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6561                        formatter.write_str("a field name for ListExternalAccessRulesResponse")
6562                    }
6563                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6564                    where
6565                        E: serde::de::Error,
6566                    {
6567                        use std::result::Result::Ok;
6568                        use std::string::ToString;
6569                        match value {
6570                            "externalAccessRules" => Ok(__FieldTag::__external_access_rules),
6571                            "external_access_rules" => Ok(__FieldTag::__external_access_rules),
6572                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
6573                            "next_page_token" => Ok(__FieldTag::__next_page_token),
6574                            "unreachable" => Ok(__FieldTag::__unreachable),
6575                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6576                        }
6577                    }
6578                }
6579                deserializer.deserialize_identifier(Visitor)
6580            }
6581        }
6582        struct Visitor;
6583        impl<'de> serde::de::Visitor<'de> for Visitor {
6584            type Value = ListExternalAccessRulesResponse;
6585            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6586                formatter.write_str("struct ListExternalAccessRulesResponse")
6587            }
6588            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6589            where
6590                A: serde::de::MapAccess<'de>,
6591            {
6592                #[allow(unused_imports)]
6593                use serde::de::Error;
6594                use std::option::Option::Some;
6595                let mut fields = std::collections::HashSet::new();
6596                let mut result = Self::Value::new();
6597                while let Some(tag) = map.next_key::<__FieldTag>()? {
6598                    #[allow(clippy::match_single_binding)]
6599                    match tag {
6600                        __FieldTag::__external_access_rules => {
6601                            if !fields.insert(__FieldTag::__external_access_rules) {
6602                                return std::result::Result::Err(A::Error::duplicate_field(
6603                                    "multiple values for external_access_rules",
6604                                ));
6605                            }
6606                            result.external_access_rules = map
6607                                .next_value::<std::option::Option<
6608                                    std::vec::Vec<crate::model::ExternalAccessRule>,
6609                                >>()?
6610                                .unwrap_or_default();
6611                        }
6612                        __FieldTag::__next_page_token => {
6613                            if !fields.insert(__FieldTag::__next_page_token) {
6614                                return std::result::Result::Err(A::Error::duplicate_field(
6615                                    "multiple values for next_page_token",
6616                                ));
6617                            }
6618                            result.next_page_token = map
6619                                .next_value::<std::option::Option<std::string::String>>()?
6620                                .unwrap_or_default();
6621                        }
6622                        __FieldTag::__unreachable => {
6623                            if !fields.insert(__FieldTag::__unreachable) {
6624                                return std::result::Result::Err(A::Error::duplicate_field(
6625                                    "multiple values for unreachable",
6626                                ));
6627                            }
6628                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6629                        }
6630                        __FieldTag::Unknown(key) => {
6631                            let value = map.next_value::<serde_json::Value>()?;
6632                            result._unknown_fields.insert(key, value);
6633                        }
6634                    }
6635                }
6636                std::result::Result::Ok(result)
6637            }
6638        }
6639        deserializer.deserialize_any(Visitor)
6640    }
6641}
6642
6643#[doc(hidden)]
6644impl serde::ser::Serialize for ListExternalAccessRulesResponse {
6645    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6646    where
6647        S: serde::ser::Serializer,
6648    {
6649        use serde::ser::SerializeMap;
6650        #[allow(unused_imports)]
6651        use std::option::Option::Some;
6652        let mut state = serializer.serialize_map(std::option::Option::None)?;
6653        if !self.external_access_rules.is_empty() {
6654            state.serialize_entry("externalAccessRules", &self.external_access_rules)?;
6655        }
6656        if !self.next_page_token.is_empty() {
6657            state.serialize_entry("nextPageToken", &self.next_page_token)?;
6658        }
6659        if !self.unreachable.is_empty() {
6660            state.serialize_entry("unreachable", &self.unreachable)?;
6661        }
6662        if !self._unknown_fields.is_empty() {
6663            for (key, value) in self._unknown_fields.iter() {
6664                state.serialize_entry(key, &value)?;
6665            }
6666        }
6667        state.end()
6668    }
6669}
6670
6671impl std::fmt::Debug for ListExternalAccessRulesResponse {
6672    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6673        let mut debug_struct = f.debug_struct("ListExternalAccessRulesResponse");
6674        debug_struct.field("external_access_rules", &self.external_access_rules);
6675        debug_struct.field("next_page_token", &self.next_page_token);
6676        debug_struct.field("unreachable", &self.unreachable);
6677        if !self._unknown_fields.is_empty() {
6678            debug_struct.field("_unknown_fields", &self._unknown_fields);
6679        }
6680        debug_struct.finish()
6681    }
6682}
6683
6684/// Request message for
6685/// [VmwareEngine.GetExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]
6686///
6687/// [google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule]: crate::client::VmwareEngine::get_external_access_rule
6688#[derive(Clone, Default, PartialEq)]
6689#[non_exhaustive]
6690pub struct GetExternalAccessRuleRequest {
6691    /// Required. The resource name of the external access firewall rule to
6692    /// retrieve. Resource names are schemeless URIs that follow the conventions in
6693    /// <https://cloud.google.com/apis/design/resource_names>.
6694    /// For example:
6695    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
6696    pub name: std::string::String,
6697
6698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6699}
6700
6701impl GetExternalAccessRuleRequest {
6702    pub fn new() -> Self {
6703        std::default::Default::default()
6704    }
6705
6706    /// Sets the value of [name][crate::model::GetExternalAccessRuleRequest::name].
6707    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6708        self.name = v.into();
6709        self
6710    }
6711}
6712
6713impl wkt::message::Message for GetExternalAccessRuleRequest {
6714    fn typename() -> &'static str {
6715        "type.googleapis.com/google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest"
6716    }
6717}
6718
6719#[doc(hidden)]
6720impl<'de> serde::de::Deserialize<'de> for GetExternalAccessRuleRequest {
6721    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6722    where
6723        D: serde::Deserializer<'de>,
6724    {
6725        #[allow(non_camel_case_types)]
6726        #[doc(hidden)]
6727        #[derive(PartialEq, Eq, Hash)]
6728        enum __FieldTag {
6729            __name,
6730            Unknown(std::string::String),
6731        }
6732        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6733            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6734            where
6735                D: serde::Deserializer<'de>,
6736            {
6737                struct Visitor;
6738                impl<'de> serde::de::Visitor<'de> for Visitor {
6739                    type Value = __FieldTag;
6740                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6741                        formatter.write_str("a field name for GetExternalAccessRuleRequest")
6742                    }
6743                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6744                    where
6745                        E: serde::de::Error,
6746                    {
6747                        use std::result::Result::Ok;
6748                        use std::string::ToString;
6749                        match value {
6750                            "name" => Ok(__FieldTag::__name),
6751                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6752                        }
6753                    }
6754                }
6755                deserializer.deserialize_identifier(Visitor)
6756            }
6757        }
6758        struct Visitor;
6759        impl<'de> serde::de::Visitor<'de> for Visitor {
6760            type Value = GetExternalAccessRuleRequest;
6761            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6762                formatter.write_str("struct GetExternalAccessRuleRequest")
6763            }
6764            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6765            where
6766                A: serde::de::MapAccess<'de>,
6767            {
6768                #[allow(unused_imports)]
6769                use serde::de::Error;
6770                use std::option::Option::Some;
6771                let mut fields = std::collections::HashSet::new();
6772                let mut result = Self::Value::new();
6773                while let Some(tag) = map.next_key::<__FieldTag>()? {
6774                    #[allow(clippy::match_single_binding)]
6775                    match tag {
6776                        __FieldTag::__name => {
6777                            if !fields.insert(__FieldTag::__name) {
6778                                return std::result::Result::Err(A::Error::duplicate_field(
6779                                    "multiple values for name",
6780                                ));
6781                            }
6782                            result.name = map
6783                                .next_value::<std::option::Option<std::string::String>>()?
6784                                .unwrap_or_default();
6785                        }
6786                        __FieldTag::Unknown(key) => {
6787                            let value = map.next_value::<serde_json::Value>()?;
6788                            result._unknown_fields.insert(key, value);
6789                        }
6790                    }
6791                }
6792                std::result::Result::Ok(result)
6793            }
6794        }
6795        deserializer.deserialize_any(Visitor)
6796    }
6797}
6798
6799#[doc(hidden)]
6800impl serde::ser::Serialize for GetExternalAccessRuleRequest {
6801    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6802    where
6803        S: serde::ser::Serializer,
6804    {
6805        use serde::ser::SerializeMap;
6806        #[allow(unused_imports)]
6807        use std::option::Option::Some;
6808        let mut state = serializer.serialize_map(std::option::Option::None)?;
6809        if !self.name.is_empty() {
6810            state.serialize_entry("name", &self.name)?;
6811        }
6812        if !self._unknown_fields.is_empty() {
6813            for (key, value) in self._unknown_fields.iter() {
6814                state.serialize_entry(key, &value)?;
6815            }
6816        }
6817        state.end()
6818    }
6819}
6820
6821impl std::fmt::Debug for GetExternalAccessRuleRequest {
6822    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6823        let mut debug_struct = f.debug_struct("GetExternalAccessRuleRequest");
6824        debug_struct.field("name", &self.name);
6825        if !self._unknown_fields.is_empty() {
6826            debug_struct.field("_unknown_fields", &self._unknown_fields);
6827        }
6828        debug_struct.finish()
6829    }
6830}
6831
6832/// Request message for
6833/// [VmwareEngine.CreateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]
6834///
6835/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule]: crate::client::VmwareEngine::create_external_access_rule
6836#[derive(Clone, Default, PartialEq)]
6837#[non_exhaustive]
6838pub struct CreateExternalAccessRuleRequest {
6839    /// Required. The resource name of the network policy
6840    /// to create a new external access firewall rule in.
6841    /// Resource names are schemeless URIs that follow the conventions in
6842    /// <https://cloud.google.com/apis/design/resource_names>.
6843    /// For example:
6844    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy`
6845    pub parent: std::string::String,
6846
6847    /// Required. The initial description of a new external access rule.
6848    pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
6849
6850    /// Required. The user-provided identifier of the `ExternalAccessRule` to be
6851    /// created. This identifier must be unique among `ExternalAccessRule`
6852    /// resources within the parent and becomes the final token in the name URI.
6853    /// The identifier must meet the following requirements:
6854    ///
6855    /// * Only contains 1-63 alphanumeric characters and hyphens
6856    /// * Begins with an alphabetical character
6857    /// * Ends with a non-hyphen character
6858    /// * Not formatted as a UUID
6859    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
6860    ///   (section 3.5)
6861    pub external_access_rule_id: std::string::String,
6862
6863    /// A request ID to identify requests. Specify a unique request ID
6864    /// so that if you must retry your request, the server will know to ignore
6865    /// the request if it has already been completed. The server guarantees that a
6866    /// request doesn't result in creation of duplicate commitments for at least 60
6867    /// minutes.
6868    ///
6869    /// For example, consider a situation where you make an initial request and the
6870    /// request times out. If you make the request again with the same request ID,
6871    /// the server can check if the original operation with the same request ID was
6872    /// received, and if so, will ignore the second request. This prevents clients
6873    /// from accidentally creating duplicate commitments.
6874    ///
6875    /// The request ID must be a valid UUID with the exception that zero UUID is
6876    /// not supported (00000000-0000-0000-0000-000000000000).
6877    pub request_id: std::string::String,
6878
6879    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6880}
6881
6882impl CreateExternalAccessRuleRequest {
6883    pub fn new() -> Self {
6884        std::default::Default::default()
6885    }
6886
6887    /// Sets the value of [parent][crate::model::CreateExternalAccessRuleRequest::parent].
6888    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6889        self.parent = v.into();
6890        self
6891    }
6892
6893    /// Sets the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
6894    pub fn set_external_access_rule<T>(mut self, v: T) -> Self
6895    where
6896        T: std::convert::Into<crate::model::ExternalAccessRule>,
6897    {
6898        self.external_access_rule = std::option::Option::Some(v.into());
6899        self
6900    }
6901
6902    /// Sets or clears the value of [external_access_rule][crate::model::CreateExternalAccessRuleRequest::external_access_rule].
6903    pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
6904    where
6905        T: std::convert::Into<crate::model::ExternalAccessRule>,
6906    {
6907        self.external_access_rule = v.map(|x| x.into());
6908        self
6909    }
6910
6911    /// Sets the value of [external_access_rule_id][crate::model::CreateExternalAccessRuleRequest::external_access_rule_id].
6912    pub fn set_external_access_rule_id<T: std::convert::Into<std::string::String>>(
6913        mut self,
6914        v: T,
6915    ) -> Self {
6916        self.external_access_rule_id = v.into();
6917        self
6918    }
6919
6920    /// Sets the value of [request_id][crate::model::CreateExternalAccessRuleRequest::request_id].
6921    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6922        self.request_id = v.into();
6923        self
6924    }
6925}
6926
6927impl wkt::message::Message for CreateExternalAccessRuleRequest {
6928    fn typename() -> &'static str {
6929        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest"
6930    }
6931}
6932
6933#[doc(hidden)]
6934impl<'de> serde::de::Deserialize<'de> for CreateExternalAccessRuleRequest {
6935    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6936    where
6937        D: serde::Deserializer<'de>,
6938    {
6939        #[allow(non_camel_case_types)]
6940        #[doc(hidden)]
6941        #[derive(PartialEq, Eq, Hash)]
6942        enum __FieldTag {
6943            __parent,
6944            __external_access_rule,
6945            __external_access_rule_id,
6946            __request_id,
6947            Unknown(std::string::String),
6948        }
6949        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6950            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6951            where
6952                D: serde::Deserializer<'de>,
6953            {
6954                struct Visitor;
6955                impl<'de> serde::de::Visitor<'de> for Visitor {
6956                    type Value = __FieldTag;
6957                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6958                        formatter.write_str("a field name for CreateExternalAccessRuleRequest")
6959                    }
6960                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6961                    where
6962                        E: serde::de::Error,
6963                    {
6964                        use std::result::Result::Ok;
6965                        use std::string::ToString;
6966                        match value {
6967                            "parent" => Ok(__FieldTag::__parent),
6968                            "externalAccessRule" => Ok(__FieldTag::__external_access_rule),
6969                            "external_access_rule" => Ok(__FieldTag::__external_access_rule),
6970                            "externalAccessRuleId" => Ok(__FieldTag::__external_access_rule_id),
6971                            "external_access_rule_id" => Ok(__FieldTag::__external_access_rule_id),
6972                            "requestId" => Ok(__FieldTag::__request_id),
6973                            "request_id" => Ok(__FieldTag::__request_id),
6974                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6975                        }
6976                    }
6977                }
6978                deserializer.deserialize_identifier(Visitor)
6979            }
6980        }
6981        struct Visitor;
6982        impl<'de> serde::de::Visitor<'de> for Visitor {
6983            type Value = CreateExternalAccessRuleRequest;
6984            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6985                formatter.write_str("struct CreateExternalAccessRuleRequest")
6986            }
6987            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6988            where
6989                A: serde::de::MapAccess<'de>,
6990            {
6991                #[allow(unused_imports)]
6992                use serde::de::Error;
6993                use std::option::Option::Some;
6994                let mut fields = std::collections::HashSet::new();
6995                let mut result = Self::Value::new();
6996                while let Some(tag) = map.next_key::<__FieldTag>()? {
6997                    #[allow(clippy::match_single_binding)]
6998                    match tag {
6999                        __FieldTag::__parent => {
7000                            if !fields.insert(__FieldTag::__parent) {
7001                                return std::result::Result::Err(A::Error::duplicate_field(
7002                                    "multiple values for parent",
7003                                ));
7004                            }
7005                            result.parent = map
7006                                .next_value::<std::option::Option<std::string::String>>()?
7007                                .unwrap_or_default();
7008                        }
7009                        __FieldTag::__external_access_rule => {
7010                            if !fields.insert(__FieldTag::__external_access_rule) {
7011                                return std::result::Result::Err(A::Error::duplicate_field(
7012                                    "multiple values for external_access_rule",
7013                                ));
7014                            }
7015                            result.external_access_rule = map.next_value::<std::option::Option<crate::model::ExternalAccessRule>>()?
7016                                ;
7017                        }
7018                        __FieldTag::__external_access_rule_id => {
7019                            if !fields.insert(__FieldTag::__external_access_rule_id) {
7020                                return std::result::Result::Err(A::Error::duplicate_field(
7021                                    "multiple values for external_access_rule_id",
7022                                ));
7023                            }
7024                            result.external_access_rule_id = map
7025                                .next_value::<std::option::Option<std::string::String>>()?
7026                                .unwrap_or_default();
7027                        }
7028                        __FieldTag::__request_id => {
7029                            if !fields.insert(__FieldTag::__request_id) {
7030                                return std::result::Result::Err(A::Error::duplicate_field(
7031                                    "multiple values for request_id",
7032                                ));
7033                            }
7034                            result.request_id = map
7035                                .next_value::<std::option::Option<std::string::String>>()?
7036                                .unwrap_or_default();
7037                        }
7038                        __FieldTag::Unknown(key) => {
7039                            let value = map.next_value::<serde_json::Value>()?;
7040                            result._unknown_fields.insert(key, value);
7041                        }
7042                    }
7043                }
7044                std::result::Result::Ok(result)
7045            }
7046        }
7047        deserializer.deserialize_any(Visitor)
7048    }
7049}
7050
7051#[doc(hidden)]
7052impl serde::ser::Serialize for CreateExternalAccessRuleRequest {
7053    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7054    where
7055        S: serde::ser::Serializer,
7056    {
7057        use serde::ser::SerializeMap;
7058        #[allow(unused_imports)]
7059        use std::option::Option::Some;
7060        let mut state = serializer.serialize_map(std::option::Option::None)?;
7061        if !self.parent.is_empty() {
7062            state.serialize_entry("parent", &self.parent)?;
7063        }
7064        if self.external_access_rule.is_some() {
7065            state.serialize_entry("externalAccessRule", &self.external_access_rule)?;
7066        }
7067        if !self.external_access_rule_id.is_empty() {
7068            state.serialize_entry("externalAccessRuleId", &self.external_access_rule_id)?;
7069        }
7070        if !self.request_id.is_empty() {
7071            state.serialize_entry("requestId", &self.request_id)?;
7072        }
7073        if !self._unknown_fields.is_empty() {
7074            for (key, value) in self._unknown_fields.iter() {
7075                state.serialize_entry(key, &value)?;
7076            }
7077        }
7078        state.end()
7079    }
7080}
7081
7082impl std::fmt::Debug for CreateExternalAccessRuleRequest {
7083    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7084        let mut debug_struct = f.debug_struct("CreateExternalAccessRuleRequest");
7085        debug_struct.field("parent", &self.parent);
7086        debug_struct.field("external_access_rule", &self.external_access_rule);
7087        debug_struct.field("external_access_rule_id", &self.external_access_rule_id);
7088        debug_struct.field("request_id", &self.request_id);
7089        if !self._unknown_fields.is_empty() {
7090            debug_struct.field("_unknown_fields", &self._unknown_fields);
7091        }
7092        debug_struct.finish()
7093    }
7094}
7095
7096/// Request message for
7097/// [VmwareEngine.UpdateExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]
7098///
7099/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule]: crate::client::VmwareEngine::update_external_access_rule
7100#[derive(Clone, Default, PartialEq)]
7101#[non_exhaustive]
7102pub struct UpdateExternalAccessRuleRequest {
7103    /// Required. Field mask is used to specify the fields to be overwritten in the
7104    /// `ExternalAccessRule` resource by the update.
7105    /// The fields specified in the `update_mask` are relative to the resource, not
7106    /// the full request. A field will be overwritten if it is in the mask. If the
7107    /// user does not provide a mask then all fields will be overwritten.
7108    pub update_mask: std::option::Option<wkt::FieldMask>,
7109
7110    /// Required. Description of the external access rule.
7111    pub external_access_rule: std::option::Option<crate::model::ExternalAccessRule>,
7112
7113    /// Optional. A request ID to identify requests. Specify a unique request ID
7114    /// so that if you must retry your request, the server will know to ignore
7115    /// the request if it has already been completed. The server guarantees that a
7116    /// request doesn't result in creation of duplicate commitments for at least 60
7117    /// minutes.
7118    ///
7119    /// For example, consider a situation where you make an initial request and the
7120    /// request times out. If you make the request again with the same request ID,
7121    /// the server can check if the original operation with the same request ID was
7122    /// received, and if so, will ignore the second request. This prevents clients
7123    /// from accidentally creating duplicate commitments.
7124    ///
7125    /// The request ID must be a valid UUID with the exception that zero UUID is
7126    /// not supported (00000000-0000-0000-0000-000000000000).
7127    pub request_id: std::string::String,
7128
7129    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7130}
7131
7132impl UpdateExternalAccessRuleRequest {
7133    pub fn new() -> Self {
7134        std::default::Default::default()
7135    }
7136
7137    /// Sets the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
7138    pub fn set_update_mask<T>(mut self, v: T) -> Self
7139    where
7140        T: std::convert::Into<wkt::FieldMask>,
7141    {
7142        self.update_mask = std::option::Option::Some(v.into());
7143        self
7144    }
7145
7146    /// Sets or clears the value of [update_mask][crate::model::UpdateExternalAccessRuleRequest::update_mask].
7147    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7148    where
7149        T: std::convert::Into<wkt::FieldMask>,
7150    {
7151        self.update_mask = v.map(|x| x.into());
7152        self
7153    }
7154
7155    /// Sets the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
7156    pub fn set_external_access_rule<T>(mut self, v: T) -> Self
7157    where
7158        T: std::convert::Into<crate::model::ExternalAccessRule>,
7159    {
7160        self.external_access_rule = std::option::Option::Some(v.into());
7161        self
7162    }
7163
7164    /// Sets or clears the value of [external_access_rule][crate::model::UpdateExternalAccessRuleRequest::external_access_rule].
7165    pub fn set_or_clear_external_access_rule<T>(mut self, v: std::option::Option<T>) -> Self
7166    where
7167        T: std::convert::Into<crate::model::ExternalAccessRule>,
7168    {
7169        self.external_access_rule = v.map(|x| x.into());
7170        self
7171    }
7172
7173    /// Sets the value of [request_id][crate::model::UpdateExternalAccessRuleRequest::request_id].
7174    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7175        self.request_id = v.into();
7176        self
7177    }
7178}
7179
7180impl wkt::message::Message for UpdateExternalAccessRuleRequest {
7181    fn typename() -> &'static str {
7182        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest"
7183    }
7184}
7185
7186#[doc(hidden)]
7187impl<'de> serde::de::Deserialize<'de> for UpdateExternalAccessRuleRequest {
7188    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7189    where
7190        D: serde::Deserializer<'de>,
7191    {
7192        #[allow(non_camel_case_types)]
7193        #[doc(hidden)]
7194        #[derive(PartialEq, Eq, Hash)]
7195        enum __FieldTag {
7196            __update_mask,
7197            __external_access_rule,
7198            __request_id,
7199            Unknown(std::string::String),
7200        }
7201        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7202            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7203            where
7204                D: serde::Deserializer<'de>,
7205            {
7206                struct Visitor;
7207                impl<'de> serde::de::Visitor<'de> for Visitor {
7208                    type Value = __FieldTag;
7209                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7210                        formatter.write_str("a field name for UpdateExternalAccessRuleRequest")
7211                    }
7212                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7213                    where
7214                        E: serde::de::Error,
7215                    {
7216                        use std::result::Result::Ok;
7217                        use std::string::ToString;
7218                        match value {
7219                            "updateMask" => Ok(__FieldTag::__update_mask),
7220                            "update_mask" => Ok(__FieldTag::__update_mask),
7221                            "externalAccessRule" => Ok(__FieldTag::__external_access_rule),
7222                            "external_access_rule" => Ok(__FieldTag::__external_access_rule),
7223                            "requestId" => Ok(__FieldTag::__request_id),
7224                            "request_id" => Ok(__FieldTag::__request_id),
7225                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7226                        }
7227                    }
7228                }
7229                deserializer.deserialize_identifier(Visitor)
7230            }
7231        }
7232        struct Visitor;
7233        impl<'de> serde::de::Visitor<'de> for Visitor {
7234            type Value = UpdateExternalAccessRuleRequest;
7235            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7236                formatter.write_str("struct UpdateExternalAccessRuleRequest")
7237            }
7238            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7239            where
7240                A: serde::de::MapAccess<'de>,
7241            {
7242                #[allow(unused_imports)]
7243                use serde::de::Error;
7244                use std::option::Option::Some;
7245                let mut fields = std::collections::HashSet::new();
7246                let mut result = Self::Value::new();
7247                while let Some(tag) = map.next_key::<__FieldTag>()? {
7248                    #[allow(clippy::match_single_binding)]
7249                    match tag {
7250                        __FieldTag::__update_mask => {
7251                            if !fields.insert(__FieldTag::__update_mask) {
7252                                return std::result::Result::Err(A::Error::duplicate_field(
7253                                    "multiple values for update_mask",
7254                                ));
7255                            }
7256                            result.update_mask =
7257                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
7258                        }
7259                        __FieldTag::__external_access_rule => {
7260                            if !fields.insert(__FieldTag::__external_access_rule) {
7261                                return std::result::Result::Err(A::Error::duplicate_field(
7262                                    "multiple values for external_access_rule",
7263                                ));
7264                            }
7265                            result.external_access_rule = map.next_value::<std::option::Option<crate::model::ExternalAccessRule>>()?
7266                                ;
7267                        }
7268                        __FieldTag::__request_id => {
7269                            if !fields.insert(__FieldTag::__request_id) {
7270                                return std::result::Result::Err(A::Error::duplicate_field(
7271                                    "multiple values for request_id",
7272                                ));
7273                            }
7274                            result.request_id = map
7275                                .next_value::<std::option::Option<std::string::String>>()?
7276                                .unwrap_or_default();
7277                        }
7278                        __FieldTag::Unknown(key) => {
7279                            let value = map.next_value::<serde_json::Value>()?;
7280                            result._unknown_fields.insert(key, value);
7281                        }
7282                    }
7283                }
7284                std::result::Result::Ok(result)
7285            }
7286        }
7287        deserializer.deserialize_any(Visitor)
7288    }
7289}
7290
7291#[doc(hidden)]
7292impl serde::ser::Serialize for UpdateExternalAccessRuleRequest {
7293    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7294    where
7295        S: serde::ser::Serializer,
7296    {
7297        use serde::ser::SerializeMap;
7298        #[allow(unused_imports)]
7299        use std::option::Option::Some;
7300        let mut state = serializer.serialize_map(std::option::Option::None)?;
7301        if self.update_mask.is_some() {
7302            state.serialize_entry("updateMask", &self.update_mask)?;
7303        }
7304        if self.external_access_rule.is_some() {
7305            state.serialize_entry("externalAccessRule", &self.external_access_rule)?;
7306        }
7307        if !self.request_id.is_empty() {
7308            state.serialize_entry("requestId", &self.request_id)?;
7309        }
7310        if !self._unknown_fields.is_empty() {
7311            for (key, value) in self._unknown_fields.iter() {
7312                state.serialize_entry(key, &value)?;
7313            }
7314        }
7315        state.end()
7316    }
7317}
7318
7319impl std::fmt::Debug for UpdateExternalAccessRuleRequest {
7320    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7321        let mut debug_struct = f.debug_struct("UpdateExternalAccessRuleRequest");
7322        debug_struct.field("update_mask", &self.update_mask);
7323        debug_struct.field("external_access_rule", &self.external_access_rule);
7324        debug_struct.field("request_id", &self.request_id);
7325        if !self._unknown_fields.is_empty() {
7326            debug_struct.field("_unknown_fields", &self._unknown_fields);
7327        }
7328        debug_struct.finish()
7329    }
7330}
7331
7332/// Request message for
7333/// [VmwareEngine.DeleteExternalAccessRule][google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]
7334///
7335/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule]: crate::client::VmwareEngine::delete_external_access_rule
7336#[derive(Clone, Default, PartialEq)]
7337#[non_exhaustive]
7338pub struct DeleteExternalAccessRuleRequest {
7339    /// Required. The resource name of the external access firewall rule to delete.
7340    /// Resource names are schemeless URIs that follow the conventions in
7341    /// <https://cloud.google.com/apis/design/resource_names>.
7342    /// For example:
7343    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
7344    pub name: std::string::String,
7345
7346    /// Optional. A request ID to identify requests. Specify a unique request ID
7347    /// so that if you must retry your request, the server will know to ignore
7348    /// the request if it has already been completed. The server guarantees that a
7349    /// request doesn't result in creation of duplicate commitments for at least 60
7350    /// minutes.
7351    ///
7352    /// For example, consider a situation where you make an initial request and the
7353    /// request times out. If you make the request again with the same request
7354    /// ID, the server can check if the original operation with the same request ID
7355    /// was received, and if so, will ignore the second request. This prevents
7356    /// clients from accidentally creating duplicate commitments.
7357    ///
7358    /// The request ID must be a valid UUID with the exception that zero UUID is
7359    /// not supported (00000000-0000-0000-0000-000000000000).
7360    pub request_id: std::string::String,
7361
7362    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7363}
7364
7365impl DeleteExternalAccessRuleRequest {
7366    pub fn new() -> Self {
7367        std::default::Default::default()
7368    }
7369
7370    /// Sets the value of [name][crate::model::DeleteExternalAccessRuleRequest::name].
7371    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7372        self.name = v.into();
7373        self
7374    }
7375
7376    /// Sets the value of [request_id][crate::model::DeleteExternalAccessRuleRequest::request_id].
7377    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7378        self.request_id = v.into();
7379        self
7380    }
7381}
7382
7383impl wkt::message::Message for DeleteExternalAccessRuleRequest {
7384    fn typename() -> &'static str {
7385        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest"
7386    }
7387}
7388
7389#[doc(hidden)]
7390impl<'de> serde::de::Deserialize<'de> for DeleteExternalAccessRuleRequest {
7391    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7392    where
7393        D: serde::Deserializer<'de>,
7394    {
7395        #[allow(non_camel_case_types)]
7396        #[doc(hidden)]
7397        #[derive(PartialEq, Eq, Hash)]
7398        enum __FieldTag {
7399            __name,
7400            __request_id,
7401            Unknown(std::string::String),
7402        }
7403        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7404            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7405            where
7406                D: serde::Deserializer<'de>,
7407            {
7408                struct Visitor;
7409                impl<'de> serde::de::Visitor<'de> for Visitor {
7410                    type Value = __FieldTag;
7411                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7412                        formatter.write_str("a field name for DeleteExternalAccessRuleRequest")
7413                    }
7414                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7415                    where
7416                        E: serde::de::Error,
7417                    {
7418                        use std::result::Result::Ok;
7419                        use std::string::ToString;
7420                        match value {
7421                            "name" => Ok(__FieldTag::__name),
7422                            "requestId" => Ok(__FieldTag::__request_id),
7423                            "request_id" => Ok(__FieldTag::__request_id),
7424                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7425                        }
7426                    }
7427                }
7428                deserializer.deserialize_identifier(Visitor)
7429            }
7430        }
7431        struct Visitor;
7432        impl<'de> serde::de::Visitor<'de> for Visitor {
7433            type Value = DeleteExternalAccessRuleRequest;
7434            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7435                formatter.write_str("struct DeleteExternalAccessRuleRequest")
7436            }
7437            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7438            where
7439                A: serde::de::MapAccess<'de>,
7440            {
7441                #[allow(unused_imports)]
7442                use serde::de::Error;
7443                use std::option::Option::Some;
7444                let mut fields = std::collections::HashSet::new();
7445                let mut result = Self::Value::new();
7446                while let Some(tag) = map.next_key::<__FieldTag>()? {
7447                    #[allow(clippy::match_single_binding)]
7448                    match tag {
7449                        __FieldTag::__name => {
7450                            if !fields.insert(__FieldTag::__name) {
7451                                return std::result::Result::Err(A::Error::duplicate_field(
7452                                    "multiple values for name",
7453                                ));
7454                            }
7455                            result.name = map
7456                                .next_value::<std::option::Option<std::string::String>>()?
7457                                .unwrap_or_default();
7458                        }
7459                        __FieldTag::__request_id => {
7460                            if !fields.insert(__FieldTag::__request_id) {
7461                                return std::result::Result::Err(A::Error::duplicate_field(
7462                                    "multiple values for request_id",
7463                                ));
7464                            }
7465                            result.request_id = map
7466                                .next_value::<std::option::Option<std::string::String>>()?
7467                                .unwrap_or_default();
7468                        }
7469                        __FieldTag::Unknown(key) => {
7470                            let value = map.next_value::<serde_json::Value>()?;
7471                            result._unknown_fields.insert(key, value);
7472                        }
7473                    }
7474                }
7475                std::result::Result::Ok(result)
7476            }
7477        }
7478        deserializer.deserialize_any(Visitor)
7479    }
7480}
7481
7482#[doc(hidden)]
7483impl serde::ser::Serialize for DeleteExternalAccessRuleRequest {
7484    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7485    where
7486        S: serde::ser::Serializer,
7487    {
7488        use serde::ser::SerializeMap;
7489        #[allow(unused_imports)]
7490        use std::option::Option::Some;
7491        let mut state = serializer.serialize_map(std::option::Option::None)?;
7492        if !self.name.is_empty() {
7493            state.serialize_entry("name", &self.name)?;
7494        }
7495        if !self.request_id.is_empty() {
7496            state.serialize_entry("requestId", &self.request_id)?;
7497        }
7498        if !self._unknown_fields.is_empty() {
7499            for (key, value) in self._unknown_fields.iter() {
7500                state.serialize_entry(key, &value)?;
7501            }
7502        }
7503        state.end()
7504    }
7505}
7506
7507impl std::fmt::Debug for DeleteExternalAccessRuleRequest {
7508    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7509        let mut debug_struct = f.debug_struct("DeleteExternalAccessRuleRequest");
7510        debug_struct.field("name", &self.name);
7511        debug_struct.field("request_id", &self.request_id);
7512        if !self._unknown_fields.is_empty() {
7513            debug_struct.field("_unknown_fields", &self._unknown_fields);
7514        }
7515        debug_struct.finish()
7516    }
7517}
7518
7519/// Request message for
7520/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
7521///
7522/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
7523#[derive(Clone, Default, PartialEq)]
7524#[non_exhaustive]
7525pub struct ListLoggingServersRequest {
7526    /// Required. The resource name of the private cloud to be queried for
7527    /// logging servers.
7528    /// Resource names are schemeless URIs that follow the conventions in
7529    /// <https://cloud.google.com/apis/design/resource_names>.
7530    /// For example:
7531    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
7532    pub parent: std::string::String,
7533
7534    /// The maximum number of logging servers to return in one page.
7535    /// The service may return fewer than this value.
7536    /// The maximum value is coerced to 1000.
7537    /// The default value of this field is 500.
7538    pub page_size: i32,
7539
7540    /// A page token, received from a previous `ListLoggingServersRequest` call.
7541    /// Provide this to retrieve the subsequent page.
7542    ///
7543    /// When paginating, all other parameters provided to
7544    /// `ListLoggingServersRequest` must match the call that provided the page
7545    /// token.
7546    pub page_token: std::string::String,
7547
7548    /// A filter expression that matches resources returned in the response.
7549    /// The expression must specify the field name, a comparison
7550    /// operator, and the value that you want to use for filtering. The value
7551    /// must be a string, a number, or a boolean. The comparison operator
7552    /// must be `=`, `!=`, `>`, or `<`.
7553    ///
7554    /// For example, if you are filtering a list of logging servers, you can
7555    /// exclude the ones named `example-server` by specifying
7556    /// `name != "example-server"`.
7557    ///
7558    /// To filter on multiple expressions, provide each separate expression within
7559    /// parentheses. For example:
7560    ///
7561    /// ```norust
7562    /// (name = "example-server")
7563    /// (createTime > "2021-04-12T08:15:10.40Z")
7564    /// ```
7565    ///
7566    /// By default, each expression is an `AND` expression. However, you
7567    /// can include `AND` and `OR` expressions explicitly.
7568    /// For example:
7569    ///
7570    /// ```norust
7571    /// (name = "example-server-1") AND
7572    /// (createTime > "2021-04-12T08:15:10.40Z") OR
7573    /// (name = "example-server-2")
7574    /// ```
7575    pub filter: std::string::String,
7576
7577    /// Sorts list results by a certain order. By default, returned results
7578    /// are ordered by `name` in ascending order.
7579    /// You can also sort results in descending order based on the `name` value
7580    /// using `orderBy="name desc"`.
7581    /// Currently, only ordering by `name` is supported.
7582    pub order_by: std::string::String,
7583
7584    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7585}
7586
7587impl ListLoggingServersRequest {
7588    pub fn new() -> Self {
7589        std::default::Default::default()
7590    }
7591
7592    /// Sets the value of [parent][crate::model::ListLoggingServersRequest::parent].
7593    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7594        self.parent = v.into();
7595        self
7596    }
7597
7598    /// Sets the value of [page_size][crate::model::ListLoggingServersRequest::page_size].
7599    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7600        self.page_size = v.into();
7601        self
7602    }
7603
7604    /// Sets the value of [page_token][crate::model::ListLoggingServersRequest::page_token].
7605    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7606        self.page_token = v.into();
7607        self
7608    }
7609
7610    /// Sets the value of [filter][crate::model::ListLoggingServersRequest::filter].
7611    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7612        self.filter = v.into();
7613        self
7614    }
7615
7616    /// Sets the value of [order_by][crate::model::ListLoggingServersRequest::order_by].
7617    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7618        self.order_by = v.into();
7619        self
7620    }
7621}
7622
7623impl wkt::message::Message for ListLoggingServersRequest {
7624    fn typename() -> &'static str {
7625        "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersRequest"
7626    }
7627}
7628
7629#[doc(hidden)]
7630impl<'de> serde::de::Deserialize<'de> for ListLoggingServersRequest {
7631    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7632    where
7633        D: serde::Deserializer<'de>,
7634    {
7635        #[allow(non_camel_case_types)]
7636        #[doc(hidden)]
7637        #[derive(PartialEq, Eq, Hash)]
7638        enum __FieldTag {
7639            __parent,
7640            __page_size,
7641            __page_token,
7642            __filter,
7643            __order_by,
7644            Unknown(std::string::String),
7645        }
7646        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7647            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7648            where
7649                D: serde::Deserializer<'de>,
7650            {
7651                struct Visitor;
7652                impl<'de> serde::de::Visitor<'de> for Visitor {
7653                    type Value = __FieldTag;
7654                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7655                        formatter.write_str("a field name for ListLoggingServersRequest")
7656                    }
7657                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7658                    where
7659                        E: serde::de::Error,
7660                    {
7661                        use std::result::Result::Ok;
7662                        use std::string::ToString;
7663                        match value {
7664                            "parent" => Ok(__FieldTag::__parent),
7665                            "pageSize" => Ok(__FieldTag::__page_size),
7666                            "page_size" => Ok(__FieldTag::__page_size),
7667                            "pageToken" => Ok(__FieldTag::__page_token),
7668                            "page_token" => Ok(__FieldTag::__page_token),
7669                            "filter" => Ok(__FieldTag::__filter),
7670                            "orderBy" => Ok(__FieldTag::__order_by),
7671                            "order_by" => Ok(__FieldTag::__order_by),
7672                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7673                        }
7674                    }
7675                }
7676                deserializer.deserialize_identifier(Visitor)
7677            }
7678        }
7679        struct Visitor;
7680        impl<'de> serde::de::Visitor<'de> for Visitor {
7681            type Value = ListLoggingServersRequest;
7682            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7683                formatter.write_str("struct ListLoggingServersRequest")
7684            }
7685            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7686            where
7687                A: serde::de::MapAccess<'de>,
7688            {
7689                #[allow(unused_imports)]
7690                use serde::de::Error;
7691                use std::option::Option::Some;
7692                let mut fields = std::collections::HashSet::new();
7693                let mut result = Self::Value::new();
7694                while let Some(tag) = map.next_key::<__FieldTag>()? {
7695                    #[allow(clippy::match_single_binding)]
7696                    match tag {
7697                        __FieldTag::__parent => {
7698                            if !fields.insert(__FieldTag::__parent) {
7699                                return std::result::Result::Err(A::Error::duplicate_field(
7700                                    "multiple values for parent",
7701                                ));
7702                            }
7703                            result.parent = map
7704                                .next_value::<std::option::Option<std::string::String>>()?
7705                                .unwrap_or_default();
7706                        }
7707                        __FieldTag::__page_size => {
7708                            if !fields.insert(__FieldTag::__page_size) {
7709                                return std::result::Result::Err(A::Error::duplicate_field(
7710                                    "multiple values for page_size",
7711                                ));
7712                            }
7713                            struct __With(std::option::Option<i32>);
7714                            impl<'de> serde::de::Deserialize<'de> for __With {
7715                                fn deserialize<D>(
7716                                    deserializer: D,
7717                                ) -> std::result::Result<Self, D::Error>
7718                                where
7719                                    D: serde::de::Deserializer<'de>,
7720                                {
7721                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
7722                                }
7723                            }
7724                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
7725                        }
7726                        __FieldTag::__page_token => {
7727                            if !fields.insert(__FieldTag::__page_token) {
7728                                return std::result::Result::Err(A::Error::duplicate_field(
7729                                    "multiple values for page_token",
7730                                ));
7731                            }
7732                            result.page_token = map
7733                                .next_value::<std::option::Option<std::string::String>>()?
7734                                .unwrap_or_default();
7735                        }
7736                        __FieldTag::__filter => {
7737                            if !fields.insert(__FieldTag::__filter) {
7738                                return std::result::Result::Err(A::Error::duplicate_field(
7739                                    "multiple values for filter",
7740                                ));
7741                            }
7742                            result.filter = map
7743                                .next_value::<std::option::Option<std::string::String>>()?
7744                                .unwrap_or_default();
7745                        }
7746                        __FieldTag::__order_by => {
7747                            if !fields.insert(__FieldTag::__order_by) {
7748                                return std::result::Result::Err(A::Error::duplicate_field(
7749                                    "multiple values for order_by",
7750                                ));
7751                            }
7752                            result.order_by = map
7753                                .next_value::<std::option::Option<std::string::String>>()?
7754                                .unwrap_or_default();
7755                        }
7756                        __FieldTag::Unknown(key) => {
7757                            let value = map.next_value::<serde_json::Value>()?;
7758                            result._unknown_fields.insert(key, value);
7759                        }
7760                    }
7761                }
7762                std::result::Result::Ok(result)
7763            }
7764        }
7765        deserializer.deserialize_any(Visitor)
7766    }
7767}
7768
7769#[doc(hidden)]
7770impl serde::ser::Serialize for ListLoggingServersRequest {
7771    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7772    where
7773        S: serde::ser::Serializer,
7774    {
7775        use serde::ser::SerializeMap;
7776        #[allow(unused_imports)]
7777        use std::option::Option::Some;
7778        let mut state = serializer.serialize_map(std::option::Option::None)?;
7779        if !self.parent.is_empty() {
7780            state.serialize_entry("parent", &self.parent)?;
7781        }
7782        if !wkt::internal::is_default(&self.page_size) {
7783            struct __With<'a>(&'a i32);
7784            impl<'a> serde::ser::Serialize for __With<'a> {
7785                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7786                where
7787                    S: serde::ser::Serializer,
7788                {
7789                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
7790                }
7791            }
7792            state.serialize_entry("pageSize", &__With(&self.page_size))?;
7793        }
7794        if !self.page_token.is_empty() {
7795            state.serialize_entry("pageToken", &self.page_token)?;
7796        }
7797        if !self.filter.is_empty() {
7798            state.serialize_entry("filter", &self.filter)?;
7799        }
7800        if !self.order_by.is_empty() {
7801            state.serialize_entry("orderBy", &self.order_by)?;
7802        }
7803        if !self._unknown_fields.is_empty() {
7804            for (key, value) in self._unknown_fields.iter() {
7805                state.serialize_entry(key, &value)?;
7806            }
7807        }
7808        state.end()
7809    }
7810}
7811
7812impl std::fmt::Debug for ListLoggingServersRequest {
7813    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7814        let mut debug_struct = f.debug_struct("ListLoggingServersRequest");
7815        debug_struct.field("parent", &self.parent);
7816        debug_struct.field("page_size", &self.page_size);
7817        debug_struct.field("page_token", &self.page_token);
7818        debug_struct.field("filter", &self.filter);
7819        debug_struct.field("order_by", &self.order_by);
7820        if !self._unknown_fields.is_empty() {
7821            debug_struct.field("_unknown_fields", &self._unknown_fields);
7822        }
7823        debug_struct.finish()
7824    }
7825}
7826
7827/// Response message for
7828/// [VmwareEngine.ListLoggingServers][google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]
7829///
7830/// [google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers]: crate::client::VmwareEngine::list_logging_servers
7831#[derive(Clone, Default, PartialEq)]
7832#[non_exhaustive]
7833pub struct ListLoggingServersResponse {
7834    /// A list of Logging Servers.
7835    pub logging_servers: std::vec::Vec<crate::model::LoggingServer>,
7836
7837    /// A token, which can be send as `page_token` to retrieve the next page.
7838    /// If this field is omitted, there are no subsequent pages.
7839    pub next_page_token: std::string::String,
7840
7841    /// Locations that could not be reached when making an aggregated query using
7842    /// wildcards.
7843    pub unreachable: std::vec::Vec<std::string::String>,
7844
7845    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7846}
7847
7848impl ListLoggingServersResponse {
7849    pub fn new() -> Self {
7850        std::default::Default::default()
7851    }
7852
7853    /// Sets the value of [logging_servers][crate::model::ListLoggingServersResponse::logging_servers].
7854    pub fn set_logging_servers<T, V>(mut self, v: T) -> Self
7855    where
7856        T: std::iter::IntoIterator<Item = V>,
7857        V: std::convert::Into<crate::model::LoggingServer>,
7858    {
7859        use std::iter::Iterator;
7860        self.logging_servers = v.into_iter().map(|i| i.into()).collect();
7861        self
7862    }
7863
7864    /// Sets the value of [next_page_token][crate::model::ListLoggingServersResponse::next_page_token].
7865    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7866        self.next_page_token = v.into();
7867        self
7868    }
7869
7870    /// Sets the value of [unreachable][crate::model::ListLoggingServersResponse::unreachable].
7871    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7872    where
7873        T: std::iter::IntoIterator<Item = V>,
7874        V: std::convert::Into<std::string::String>,
7875    {
7876        use std::iter::Iterator;
7877        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7878        self
7879    }
7880}
7881
7882impl wkt::message::Message for ListLoggingServersResponse {
7883    fn typename() -> &'static str {
7884        "type.googleapis.com/google.cloud.vmwareengine.v1.ListLoggingServersResponse"
7885    }
7886}
7887
7888#[doc(hidden)]
7889impl gax::paginator::internal::PageableResponse for ListLoggingServersResponse {
7890    type PageItem = crate::model::LoggingServer;
7891
7892    fn items(self) -> std::vec::Vec<Self::PageItem> {
7893        self.logging_servers
7894    }
7895
7896    fn next_page_token(&self) -> std::string::String {
7897        use std::clone::Clone;
7898        self.next_page_token.clone()
7899    }
7900}
7901
7902#[doc(hidden)]
7903impl<'de> serde::de::Deserialize<'de> for ListLoggingServersResponse {
7904    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7905    where
7906        D: serde::Deserializer<'de>,
7907    {
7908        #[allow(non_camel_case_types)]
7909        #[doc(hidden)]
7910        #[derive(PartialEq, Eq, Hash)]
7911        enum __FieldTag {
7912            __logging_servers,
7913            __next_page_token,
7914            __unreachable,
7915            Unknown(std::string::String),
7916        }
7917        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7918            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7919            where
7920                D: serde::Deserializer<'de>,
7921            {
7922                struct Visitor;
7923                impl<'de> serde::de::Visitor<'de> for Visitor {
7924                    type Value = __FieldTag;
7925                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7926                        formatter.write_str("a field name for ListLoggingServersResponse")
7927                    }
7928                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7929                    where
7930                        E: serde::de::Error,
7931                    {
7932                        use std::result::Result::Ok;
7933                        use std::string::ToString;
7934                        match value {
7935                            "loggingServers" => Ok(__FieldTag::__logging_servers),
7936                            "logging_servers" => Ok(__FieldTag::__logging_servers),
7937                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
7938                            "next_page_token" => Ok(__FieldTag::__next_page_token),
7939                            "unreachable" => Ok(__FieldTag::__unreachable),
7940                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7941                        }
7942                    }
7943                }
7944                deserializer.deserialize_identifier(Visitor)
7945            }
7946        }
7947        struct Visitor;
7948        impl<'de> serde::de::Visitor<'de> for Visitor {
7949            type Value = ListLoggingServersResponse;
7950            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7951                formatter.write_str("struct ListLoggingServersResponse")
7952            }
7953            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7954            where
7955                A: serde::de::MapAccess<'de>,
7956            {
7957                #[allow(unused_imports)]
7958                use serde::de::Error;
7959                use std::option::Option::Some;
7960                let mut fields = std::collections::HashSet::new();
7961                let mut result = Self::Value::new();
7962                while let Some(tag) = map.next_key::<__FieldTag>()? {
7963                    #[allow(clippy::match_single_binding)]
7964                    match tag {
7965                        __FieldTag::__logging_servers => {
7966                            if !fields.insert(__FieldTag::__logging_servers) {
7967                                return std::result::Result::Err(A::Error::duplicate_field(
7968                                    "multiple values for logging_servers",
7969                                ));
7970                            }
7971                            result.logging_servers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::LoggingServer>>>()?.unwrap_or_default();
7972                        }
7973                        __FieldTag::__next_page_token => {
7974                            if !fields.insert(__FieldTag::__next_page_token) {
7975                                return std::result::Result::Err(A::Error::duplicate_field(
7976                                    "multiple values for next_page_token",
7977                                ));
7978                            }
7979                            result.next_page_token = map
7980                                .next_value::<std::option::Option<std::string::String>>()?
7981                                .unwrap_or_default();
7982                        }
7983                        __FieldTag::__unreachable => {
7984                            if !fields.insert(__FieldTag::__unreachable) {
7985                                return std::result::Result::Err(A::Error::duplicate_field(
7986                                    "multiple values for unreachable",
7987                                ));
7988                            }
7989                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
7990                        }
7991                        __FieldTag::Unknown(key) => {
7992                            let value = map.next_value::<serde_json::Value>()?;
7993                            result._unknown_fields.insert(key, value);
7994                        }
7995                    }
7996                }
7997                std::result::Result::Ok(result)
7998            }
7999        }
8000        deserializer.deserialize_any(Visitor)
8001    }
8002}
8003
8004#[doc(hidden)]
8005impl serde::ser::Serialize for ListLoggingServersResponse {
8006    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8007    where
8008        S: serde::ser::Serializer,
8009    {
8010        use serde::ser::SerializeMap;
8011        #[allow(unused_imports)]
8012        use std::option::Option::Some;
8013        let mut state = serializer.serialize_map(std::option::Option::None)?;
8014        if !self.logging_servers.is_empty() {
8015            state.serialize_entry("loggingServers", &self.logging_servers)?;
8016        }
8017        if !self.next_page_token.is_empty() {
8018            state.serialize_entry("nextPageToken", &self.next_page_token)?;
8019        }
8020        if !self.unreachable.is_empty() {
8021            state.serialize_entry("unreachable", &self.unreachable)?;
8022        }
8023        if !self._unknown_fields.is_empty() {
8024            for (key, value) in self._unknown_fields.iter() {
8025                state.serialize_entry(key, &value)?;
8026            }
8027        }
8028        state.end()
8029    }
8030}
8031
8032impl std::fmt::Debug for ListLoggingServersResponse {
8033    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8034        let mut debug_struct = f.debug_struct("ListLoggingServersResponse");
8035        debug_struct.field("logging_servers", &self.logging_servers);
8036        debug_struct.field("next_page_token", &self.next_page_token);
8037        debug_struct.field("unreachable", &self.unreachable);
8038        if !self._unknown_fields.is_empty() {
8039            debug_struct.field("_unknown_fields", &self._unknown_fields);
8040        }
8041        debug_struct.finish()
8042    }
8043}
8044
8045/// Request message for
8046/// [VmwareEngine.GetLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]
8047///
8048/// [google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer]: crate::client::VmwareEngine::get_logging_server
8049#[derive(Clone, Default, PartialEq)]
8050#[non_exhaustive]
8051pub struct GetLoggingServerRequest {
8052    /// Required. The resource name of the Logging Server to retrieve.
8053    /// Resource names are schemeless URIs that follow the conventions in
8054    /// <https://cloud.google.com/apis/design/resource_names>.
8055    /// For example:
8056    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
8057    pub name: std::string::String,
8058
8059    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8060}
8061
8062impl GetLoggingServerRequest {
8063    pub fn new() -> Self {
8064        std::default::Default::default()
8065    }
8066
8067    /// Sets the value of [name][crate::model::GetLoggingServerRequest::name].
8068    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8069        self.name = v.into();
8070        self
8071    }
8072}
8073
8074impl wkt::message::Message for GetLoggingServerRequest {
8075    fn typename() -> &'static str {
8076        "type.googleapis.com/google.cloud.vmwareengine.v1.GetLoggingServerRequest"
8077    }
8078}
8079
8080#[doc(hidden)]
8081impl<'de> serde::de::Deserialize<'de> for GetLoggingServerRequest {
8082    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8083    where
8084        D: serde::Deserializer<'de>,
8085    {
8086        #[allow(non_camel_case_types)]
8087        #[doc(hidden)]
8088        #[derive(PartialEq, Eq, Hash)]
8089        enum __FieldTag {
8090            __name,
8091            Unknown(std::string::String),
8092        }
8093        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8094            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8095            where
8096                D: serde::Deserializer<'de>,
8097            {
8098                struct Visitor;
8099                impl<'de> serde::de::Visitor<'de> for Visitor {
8100                    type Value = __FieldTag;
8101                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8102                        formatter.write_str("a field name for GetLoggingServerRequest")
8103                    }
8104                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8105                    where
8106                        E: serde::de::Error,
8107                    {
8108                        use std::result::Result::Ok;
8109                        use std::string::ToString;
8110                        match value {
8111                            "name" => Ok(__FieldTag::__name),
8112                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8113                        }
8114                    }
8115                }
8116                deserializer.deserialize_identifier(Visitor)
8117            }
8118        }
8119        struct Visitor;
8120        impl<'de> serde::de::Visitor<'de> for Visitor {
8121            type Value = GetLoggingServerRequest;
8122            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8123                formatter.write_str("struct GetLoggingServerRequest")
8124            }
8125            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8126            where
8127                A: serde::de::MapAccess<'de>,
8128            {
8129                #[allow(unused_imports)]
8130                use serde::de::Error;
8131                use std::option::Option::Some;
8132                let mut fields = std::collections::HashSet::new();
8133                let mut result = Self::Value::new();
8134                while let Some(tag) = map.next_key::<__FieldTag>()? {
8135                    #[allow(clippy::match_single_binding)]
8136                    match tag {
8137                        __FieldTag::__name => {
8138                            if !fields.insert(__FieldTag::__name) {
8139                                return std::result::Result::Err(A::Error::duplicate_field(
8140                                    "multiple values for name",
8141                                ));
8142                            }
8143                            result.name = map
8144                                .next_value::<std::option::Option<std::string::String>>()?
8145                                .unwrap_or_default();
8146                        }
8147                        __FieldTag::Unknown(key) => {
8148                            let value = map.next_value::<serde_json::Value>()?;
8149                            result._unknown_fields.insert(key, value);
8150                        }
8151                    }
8152                }
8153                std::result::Result::Ok(result)
8154            }
8155        }
8156        deserializer.deserialize_any(Visitor)
8157    }
8158}
8159
8160#[doc(hidden)]
8161impl serde::ser::Serialize for GetLoggingServerRequest {
8162    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8163    where
8164        S: serde::ser::Serializer,
8165    {
8166        use serde::ser::SerializeMap;
8167        #[allow(unused_imports)]
8168        use std::option::Option::Some;
8169        let mut state = serializer.serialize_map(std::option::Option::None)?;
8170        if !self.name.is_empty() {
8171            state.serialize_entry("name", &self.name)?;
8172        }
8173        if !self._unknown_fields.is_empty() {
8174            for (key, value) in self._unknown_fields.iter() {
8175                state.serialize_entry(key, &value)?;
8176            }
8177        }
8178        state.end()
8179    }
8180}
8181
8182impl std::fmt::Debug for GetLoggingServerRequest {
8183    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8184        let mut debug_struct = f.debug_struct("GetLoggingServerRequest");
8185        debug_struct.field("name", &self.name);
8186        if !self._unknown_fields.is_empty() {
8187            debug_struct.field("_unknown_fields", &self._unknown_fields);
8188        }
8189        debug_struct.finish()
8190    }
8191}
8192
8193/// Request message for
8194/// [VmwareEngine.CreateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]
8195///
8196/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer]: crate::client::VmwareEngine::create_logging_server
8197#[derive(Clone, Default, PartialEq)]
8198#[non_exhaustive]
8199pub struct CreateLoggingServerRequest {
8200    /// Required. The resource name of the private cloud
8201    /// to create a new Logging Server in.
8202    /// Resource names are schemeless URIs that follow the conventions in
8203    /// <https://cloud.google.com/apis/design/resource_names>.
8204    /// For example:
8205    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
8206    pub parent: std::string::String,
8207
8208    /// Required. The initial description of a new logging server.
8209    pub logging_server: std::option::Option<crate::model::LoggingServer>,
8210
8211    /// Required. The user-provided identifier of the `LoggingServer` to be
8212    /// created. This identifier must be unique among `LoggingServer` resources
8213    /// within the parent and becomes the final token in the name URI.
8214    /// The identifier must meet the following requirements:
8215    ///
8216    /// * Only contains 1-63 alphanumeric characters and hyphens
8217    /// * Begins with an alphabetical character
8218    /// * Ends with a non-hyphen character
8219    /// * Not formatted as a UUID
8220    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
8221    ///   (section 3.5)
8222    pub logging_server_id: std::string::String,
8223
8224    /// Optional. A request ID to identify requests. Specify a unique request ID
8225    /// so that if you must retry your request, the server will know to ignore
8226    /// the request if it has already been completed. The server guarantees that a
8227    /// request doesn't result in creation of duplicate commitments for at least 60
8228    /// minutes.
8229    ///
8230    /// For example, consider a situation where you make an initial request and the
8231    /// request times out. If you make the request again with the same request ID,
8232    /// the server can check if original operation with the same request ID was
8233    /// received, and if so, will ignore the second request. This prevents clients
8234    /// from accidentally creating duplicate commitments.
8235    ///
8236    /// The request ID must be a valid UUID with the exception that zero UUID is
8237    /// not supported (00000000-0000-0000-0000-000000000000).
8238    pub request_id: std::string::String,
8239
8240    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8241}
8242
8243impl CreateLoggingServerRequest {
8244    pub fn new() -> Self {
8245        std::default::Default::default()
8246    }
8247
8248    /// Sets the value of [parent][crate::model::CreateLoggingServerRequest::parent].
8249    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8250        self.parent = v.into();
8251        self
8252    }
8253
8254    /// Sets the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
8255    pub fn set_logging_server<T>(mut self, v: T) -> Self
8256    where
8257        T: std::convert::Into<crate::model::LoggingServer>,
8258    {
8259        self.logging_server = std::option::Option::Some(v.into());
8260        self
8261    }
8262
8263    /// Sets or clears the value of [logging_server][crate::model::CreateLoggingServerRequest::logging_server].
8264    pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
8265    where
8266        T: std::convert::Into<crate::model::LoggingServer>,
8267    {
8268        self.logging_server = v.map(|x| x.into());
8269        self
8270    }
8271
8272    /// Sets the value of [logging_server_id][crate::model::CreateLoggingServerRequest::logging_server_id].
8273    pub fn set_logging_server_id<T: std::convert::Into<std::string::String>>(
8274        mut self,
8275        v: T,
8276    ) -> Self {
8277        self.logging_server_id = v.into();
8278        self
8279    }
8280
8281    /// Sets the value of [request_id][crate::model::CreateLoggingServerRequest::request_id].
8282    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8283        self.request_id = v.into();
8284        self
8285    }
8286}
8287
8288impl wkt::message::Message for CreateLoggingServerRequest {
8289    fn typename() -> &'static str {
8290        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateLoggingServerRequest"
8291    }
8292}
8293
8294#[doc(hidden)]
8295impl<'de> serde::de::Deserialize<'de> for CreateLoggingServerRequest {
8296    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8297    where
8298        D: serde::Deserializer<'de>,
8299    {
8300        #[allow(non_camel_case_types)]
8301        #[doc(hidden)]
8302        #[derive(PartialEq, Eq, Hash)]
8303        enum __FieldTag {
8304            __parent,
8305            __logging_server,
8306            __logging_server_id,
8307            __request_id,
8308            Unknown(std::string::String),
8309        }
8310        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8311            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8312            where
8313                D: serde::Deserializer<'de>,
8314            {
8315                struct Visitor;
8316                impl<'de> serde::de::Visitor<'de> for Visitor {
8317                    type Value = __FieldTag;
8318                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8319                        formatter.write_str("a field name for CreateLoggingServerRequest")
8320                    }
8321                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8322                    where
8323                        E: serde::de::Error,
8324                    {
8325                        use std::result::Result::Ok;
8326                        use std::string::ToString;
8327                        match value {
8328                            "parent" => Ok(__FieldTag::__parent),
8329                            "loggingServer" => Ok(__FieldTag::__logging_server),
8330                            "logging_server" => Ok(__FieldTag::__logging_server),
8331                            "loggingServerId" => Ok(__FieldTag::__logging_server_id),
8332                            "logging_server_id" => Ok(__FieldTag::__logging_server_id),
8333                            "requestId" => Ok(__FieldTag::__request_id),
8334                            "request_id" => Ok(__FieldTag::__request_id),
8335                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8336                        }
8337                    }
8338                }
8339                deserializer.deserialize_identifier(Visitor)
8340            }
8341        }
8342        struct Visitor;
8343        impl<'de> serde::de::Visitor<'de> for Visitor {
8344            type Value = CreateLoggingServerRequest;
8345            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8346                formatter.write_str("struct CreateLoggingServerRequest")
8347            }
8348            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8349            where
8350                A: serde::de::MapAccess<'de>,
8351            {
8352                #[allow(unused_imports)]
8353                use serde::de::Error;
8354                use std::option::Option::Some;
8355                let mut fields = std::collections::HashSet::new();
8356                let mut result = Self::Value::new();
8357                while let Some(tag) = map.next_key::<__FieldTag>()? {
8358                    #[allow(clippy::match_single_binding)]
8359                    match tag {
8360                        __FieldTag::__parent => {
8361                            if !fields.insert(__FieldTag::__parent) {
8362                                return std::result::Result::Err(A::Error::duplicate_field(
8363                                    "multiple values for parent",
8364                                ));
8365                            }
8366                            result.parent = map
8367                                .next_value::<std::option::Option<std::string::String>>()?
8368                                .unwrap_or_default();
8369                        }
8370                        __FieldTag::__logging_server => {
8371                            if !fields.insert(__FieldTag::__logging_server) {
8372                                return std::result::Result::Err(A::Error::duplicate_field(
8373                                    "multiple values for logging_server",
8374                                ));
8375                            }
8376                            result.logging_server = map
8377                                .next_value::<std::option::Option<crate::model::LoggingServer>>()?;
8378                        }
8379                        __FieldTag::__logging_server_id => {
8380                            if !fields.insert(__FieldTag::__logging_server_id) {
8381                                return std::result::Result::Err(A::Error::duplicate_field(
8382                                    "multiple values for logging_server_id",
8383                                ));
8384                            }
8385                            result.logging_server_id = map
8386                                .next_value::<std::option::Option<std::string::String>>()?
8387                                .unwrap_or_default();
8388                        }
8389                        __FieldTag::__request_id => {
8390                            if !fields.insert(__FieldTag::__request_id) {
8391                                return std::result::Result::Err(A::Error::duplicate_field(
8392                                    "multiple values for request_id",
8393                                ));
8394                            }
8395                            result.request_id = map
8396                                .next_value::<std::option::Option<std::string::String>>()?
8397                                .unwrap_or_default();
8398                        }
8399                        __FieldTag::Unknown(key) => {
8400                            let value = map.next_value::<serde_json::Value>()?;
8401                            result._unknown_fields.insert(key, value);
8402                        }
8403                    }
8404                }
8405                std::result::Result::Ok(result)
8406            }
8407        }
8408        deserializer.deserialize_any(Visitor)
8409    }
8410}
8411
8412#[doc(hidden)]
8413impl serde::ser::Serialize for CreateLoggingServerRequest {
8414    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8415    where
8416        S: serde::ser::Serializer,
8417    {
8418        use serde::ser::SerializeMap;
8419        #[allow(unused_imports)]
8420        use std::option::Option::Some;
8421        let mut state = serializer.serialize_map(std::option::Option::None)?;
8422        if !self.parent.is_empty() {
8423            state.serialize_entry("parent", &self.parent)?;
8424        }
8425        if self.logging_server.is_some() {
8426            state.serialize_entry("loggingServer", &self.logging_server)?;
8427        }
8428        if !self.logging_server_id.is_empty() {
8429            state.serialize_entry("loggingServerId", &self.logging_server_id)?;
8430        }
8431        if !self.request_id.is_empty() {
8432            state.serialize_entry("requestId", &self.request_id)?;
8433        }
8434        if !self._unknown_fields.is_empty() {
8435            for (key, value) in self._unknown_fields.iter() {
8436                state.serialize_entry(key, &value)?;
8437            }
8438        }
8439        state.end()
8440    }
8441}
8442
8443impl std::fmt::Debug for CreateLoggingServerRequest {
8444    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8445        let mut debug_struct = f.debug_struct("CreateLoggingServerRequest");
8446        debug_struct.field("parent", &self.parent);
8447        debug_struct.field("logging_server", &self.logging_server);
8448        debug_struct.field("logging_server_id", &self.logging_server_id);
8449        debug_struct.field("request_id", &self.request_id);
8450        if !self._unknown_fields.is_empty() {
8451            debug_struct.field("_unknown_fields", &self._unknown_fields);
8452        }
8453        debug_struct.finish()
8454    }
8455}
8456
8457/// Request message for
8458/// [VmwareEngine.UpdateLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]
8459///
8460/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer]: crate::client::VmwareEngine::update_logging_server
8461#[derive(Clone, Default, PartialEq)]
8462#[non_exhaustive]
8463pub struct UpdateLoggingServerRequest {
8464    /// Required. Field mask is used to specify the fields to be overwritten in the
8465    /// `LoggingServer` resource by the update.
8466    /// The fields specified in the `update_mask` are relative to the resource, not
8467    /// the full request. A field will be overwritten if it is in the mask. If the
8468    /// user does not provide a mask then all fields will be overwritten.
8469    pub update_mask: std::option::Option<wkt::FieldMask>,
8470
8471    /// Required. Logging server description.
8472    pub logging_server: std::option::Option<crate::model::LoggingServer>,
8473
8474    /// Optional. A request ID to identify requests. Specify a unique request ID
8475    /// so that if you must retry your request, the server will know to ignore
8476    /// the request if it has already been completed. The server guarantees that a
8477    /// request doesn't result in creation of duplicate commitments for at least 60
8478    /// minutes.
8479    ///
8480    /// For example, consider a situation where you make an initial request and the
8481    /// request times out. If you make the request again with the same request ID,
8482    /// the server can check if original operation with the same request ID was
8483    /// received, and if so, will ignore the second request. This prevents clients
8484    /// from accidentally creating duplicate commitments.
8485    ///
8486    /// The request ID must be a valid UUID with the exception that zero UUID is
8487    /// not supported (00000000-0000-0000-0000-000000000000).
8488    pub request_id: std::string::String,
8489
8490    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8491}
8492
8493impl UpdateLoggingServerRequest {
8494    pub fn new() -> Self {
8495        std::default::Default::default()
8496    }
8497
8498    /// Sets the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
8499    pub fn set_update_mask<T>(mut self, v: T) -> Self
8500    where
8501        T: std::convert::Into<wkt::FieldMask>,
8502    {
8503        self.update_mask = std::option::Option::Some(v.into());
8504        self
8505    }
8506
8507    /// Sets or clears the value of [update_mask][crate::model::UpdateLoggingServerRequest::update_mask].
8508    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8509    where
8510        T: std::convert::Into<wkt::FieldMask>,
8511    {
8512        self.update_mask = v.map(|x| x.into());
8513        self
8514    }
8515
8516    /// Sets the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
8517    pub fn set_logging_server<T>(mut self, v: T) -> Self
8518    where
8519        T: std::convert::Into<crate::model::LoggingServer>,
8520    {
8521        self.logging_server = std::option::Option::Some(v.into());
8522        self
8523    }
8524
8525    /// Sets or clears the value of [logging_server][crate::model::UpdateLoggingServerRequest::logging_server].
8526    pub fn set_or_clear_logging_server<T>(mut self, v: std::option::Option<T>) -> Self
8527    where
8528        T: std::convert::Into<crate::model::LoggingServer>,
8529    {
8530        self.logging_server = v.map(|x| x.into());
8531        self
8532    }
8533
8534    /// Sets the value of [request_id][crate::model::UpdateLoggingServerRequest::request_id].
8535    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8536        self.request_id = v.into();
8537        self
8538    }
8539}
8540
8541impl wkt::message::Message for UpdateLoggingServerRequest {
8542    fn typename() -> &'static str {
8543        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateLoggingServerRequest"
8544    }
8545}
8546
8547#[doc(hidden)]
8548impl<'de> serde::de::Deserialize<'de> for UpdateLoggingServerRequest {
8549    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8550    where
8551        D: serde::Deserializer<'de>,
8552    {
8553        #[allow(non_camel_case_types)]
8554        #[doc(hidden)]
8555        #[derive(PartialEq, Eq, Hash)]
8556        enum __FieldTag {
8557            __update_mask,
8558            __logging_server,
8559            __request_id,
8560            Unknown(std::string::String),
8561        }
8562        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8563            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8564            where
8565                D: serde::Deserializer<'de>,
8566            {
8567                struct Visitor;
8568                impl<'de> serde::de::Visitor<'de> for Visitor {
8569                    type Value = __FieldTag;
8570                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8571                        formatter.write_str("a field name for UpdateLoggingServerRequest")
8572                    }
8573                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8574                    where
8575                        E: serde::de::Error,
8576                    {
8577                        use std::result::Result::Ok;
8578                        use std::string::ToString;
8579                        match value {
8580                            "updateMask" => Ok(__FieldTag::__update_mask),
8581                            "update_mask" => Ok(__FieldTag::__update_mask),
8582                            "loggingServer" => Ok(__FieldTag::__logging_server),
8583                            "logging_server" => Ok(__FieldTag::__logging_server),
8584                            "requestId" => Ok(__FieldTag::__request_id),
8585                            "request_id" => Ok(__FieldTag::__request_id),
8586                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8587                        }
8588                    }
8589                }
8590                deserializer.deserialize_identifier(Visitor)
8591            }
8592        }
8593        struct Visitor;
8594        impl<'de> serde::de::Visitor<'de> for Visitor {
8595            type Value = UpdateLoggingServerRequest;
8596            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8597                formatter.write_str("struct UpdateLoggingServerRequest")
8598            }
8599            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8600            where
8601                A: serde::de::MapAccess<'de>,
8602            {
8603                #[allow(unused_imports)]
8604                use serde::de::Error;
8605                use std::option::Option::Some;
8606                let mut fields = std::collections::HashSet::new();
8607                let mut result = Self::Value::new();
8608                while let Some(tag) = map.next_key::<__FieldTag>()? {
8609                    #[allow(clippy::match_single_binding)]
8610                    match tag {
8611                        __FieldTag::__update_mask => {
8612                            if !fields.insert(__FieldTag::__update_mask) {
8613                                return std::result::Result::Err(A::Error::duplicate_field(
8614                                    "multiple values for update_mask",
8615                                ));
8616                            }
8617                            result.update_mask =
8618                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
8619                        }
8620                        __FieldTag::__logging_server => {
8621                            if !fields.insert(__FieldTag::__logging_server) {
8622                                return std::result::Result::Err(A::Error::duplicate_field(
8623                                    "multiple values for logging_server",
8624                                ));
8625                            }
8626                            result.logging_server = map
8627                                .next_value::<std::option::Option<crate::model::LoggingServer>>()?;
8628                        }
8629                        __FieldTag::__request_id => {
8630                            if !fields.insert(__FieldTag::__request_id) {
8631                                return std::result::Result::Err(A::Error::duplicate_field(
8632                                    "multiple values for request_id",
8633                                ));
8634                            }
8635                            result.request_id = map
8636                                .next_value::<std::option::Option<std::string::String>>()?
8637                                .unwrap_or_default();
8638                        }
8639                        __FieldTag::Unknown(key) => {
8640                            let value = map.next_value::<serde_json::Value>()?;
8641                            result._unknown_fields.insert(key, value);
8642                        }
8643                    }
8644                }
8645                std::result::Result::Ok(result)
8646            }
8647        }
8648        deserializer.deserialize_any(Visitor)
8649    }
8650}
8651
8652#[doc(hidden)]
8653impl serde::ser::Serialize for UpdateLoggingServerRequest {
8654    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8655    where
8656        S: serde::ser::Serializer,
8657    {
8658        use serde::ser::SerializeMap;
8659        #[allow(unused_imports)]
8660        use std::option::Option::Some;
8661        let mut state = serializer.serialize_map(std::option::Option::None)?;
8662        if self.update_mask.is_some() {
8663            state.serialize_entry("updateMask", &self.update_mask)?;
8664        }
8665        if self.logging_server.is_some() {
8666            state.serialize_entry("loggingServer", &self.logging_server)?;
8667        }
8668        if !self.request_id.is_empty() {
8669            state.serialize_entry("requestId", &self.request_id)?;
8670        }
8671        if !self._unknown_fields.is_empty() {
8672            for (key, value) in self._unknown_fields.iter() {
8673                state.serialize_entry(key, &value)?;
8674            }
8675        }
8676        state.end()
8677    }
8678}
8679
8680impl std::fmt::Debug for UpdateLoggingServerRequest {
8681    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8682        let mut debug_struct = f.debug_struct("UpdateLoggingServerRequest");
8683        debug_struct.field("update_mask", &self.update_mask);
8684        debug_struct.field("logging_server", &self.logging_server);
8685        debug_struct.field("request_id", &self.request_id);
8686        if !self._unknown_fields.is_empty() {
8687            debug_struct.field("_unknown_fields", &self._unknown_fields);
8688        }
8689        debug_struct.finish()
8690    }
8691}
8692
8693/// Request message for
8694/// [VmwareEngine.DeleteLoggingServer][google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]
8695///
8696/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer]: crate::client::VmwareEngine::delete_logging_server
8697#[derive(Clone, Default, PartialEq)]
8698#[non_exhaustive]
8699pub struct DeleteLoggingServerRequest {
8700    /// Required. The resource name of the logging server to delete.
8701    /// Resource names are schemeless URIs that follow the conventions in
8702    /// <https://cloud.google.com/apis/design/resource_names>.
8703    /// For example:
8704    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
8705    pub name: std::string::String,
8706
8707    /// Optional. A request ID to identify requests. Specify a unique request ID
8708    /// so that if you must retry your request, the server will know to ignore
8709    /// the request if it has already been completed. The server guarantees that a
8710    /// request doesn't result in creation of duplicate commitments for at least 60
8711    /// minutes.
8712    ///
8713    /// For example, consider a situation where you make an initial request and the
8714    /// request times out. If you make the request again with the same request
8715    /// ID, the server can check if original operation with the same request ID
8716    /// was received, and if so, will ignore the second request. This prevents
8717    /// clients from accidentally creating duplicate commitments.
8718    ///
8719    /// The request ID must be a valid UUID with the exception that zero UUID is
8720    /// not supported (00000000-0000-0000-0000-000000000000).
8721    pub request_id: std::string::String,
8722
8723    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8724}
8725
8726impl DeleteLoggingServerRequest {
8727    pub fn new() -> Self {
8728        std::default::Default::default()
8729    }
8730
8731    /// Sets the value of [name][crate::model::DeleteLoggingServerRequest::name].
8732    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8733        self.name = v.into();
8734        self
8735    }
8736
8737    /// Sets the value of [request_id][crate::model::DeleteLoggingServerRequest::request_id].
8738    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8739        self.request_id = v.into();
8740        self
8741    }
8742}
8743
8744impl wkt::message::Message for DeleteLoggingServerRequest {
8745    fn typename() -> &'static str {
8746        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteLoggingServerRequest"
8747    }
8748}
8749
8750#[doc(hidden)]
8751impl<'de> serde::de::Deserialize<'de> for DeleteLoggingServerRequest {
8752    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8753    where
8754        D: serde::Deserializer<'de>,
8755    {
8756        #[allow(non_camel_case_types)]
8757        #[doc(hidden)]
8758        #[derive(PartialEq, Eq, Hash)]
8759        enum __FieldTag {
8760            __name,
8761            __request_id,
8762            Unknown(std::string::String),
8763        }
8764        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8765            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8766            where
8767                D: serde::Deserializer<'de>,
8768            {
8769                struct Visitor;
8770                impl<'de> serde::de::Visitor<'de> for Visitor {
8771                    type Value = __FieldTag;
8772                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8773                        formatter.write_str("a field name for DeleteLoggingServerRequest")
8774                    }
8775                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8776                    where
8777                        E: serde::de::Error,
8778                    {
8779                        use std::result::Result::Ok;
8780                        use std::string::ToString;
8781                        match value {
8782                            "name" => Ok(__FieldTag::__name),
8783                            "requestId" => Ok(__FieldTag::__request_id),
8784                            "request_id" => Ok(__FieldTag::__request_id),
8785                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8786                        }
8787                    }
8788                }
8789                deserializer.deserialize_identifier(Visitor)
8790            }
8791        }
8792        struct Visitor;
8793        impl<'de> serde::de::Visitor<'de> for Visitor {
8794            type Value = DeleteLoggingServerRequest;
8795            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8796                formatter.write_str("struct DeleteLoggingServerRequest")
8797            }
8798            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8799            where
8800                A: serde::de::MapAccess<'de>,
8801            {
8802                #[allow(unused_imports)]
8803                use serde::de::Error;
8804                use std::option::Option::Some;
8805                let mut fields = std::collections::HashSet::new();
8806                let mut result = Self::Value::new();
8807                while let Some(tag) = map.next_key::<__FieldTag>()? {
8808                    #[allow(clippy::match_single_binding)]
8809                    match tag {
8810                        __FieldTag::__name => {
8811                            if !fields.insert(__FieldTag::__name) {
8812                                return std::result::Result::Err(A::Error::duplicate_field(
8813                                    "multiple values for name",
8814                                ));
8815                            }
8816                            result.name = map
8817                                .next_value::<std::option::Option<std::string::String>>()?
8818                                .unwrap_or_default();
8819                        }
8820                        __FieldTag::__request_id => {
8821                            if !fields.insert(__FieldTag::__request_id) {
8822                                return std::result::Result::Err(A::Error::duplicate_field(
8823                                    "multiple values for request_id",
8824                                ));
8825                            }
8826                            result.request_id = map
8827                                .next_value::<std::option::Option<std::string::String>>()?
8828                                .unwrap_or_default();
8829                        }
8830                        __FieldTag::Unknown(key) => {
8831                            let value = map.next_value::<serde_json::Value>()?;
8832                            result._unknown_fields.insert(key, value);
8833                        }
8834                    }
8835                }
8836                std::result::Result::Ok(result)
8837            }
8838        }
8839        deserializer.deserialize_any(Visitor)
8840    }
8841}
8842
8843#[doc(hidden)]
8844impl serde::ser::Serialize for DeleteLoggingServerRequest {
8845    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8846    where
8847        S: serde::ser::Serializer,
8848    {
8849        use serde::ser::SerializeMap;
8850        #[allow(unused_imports)]
8851        use std::option::Option::Some;
8852        let mut state = serializer.serialize_map(std::option::Option::None)?;
8853        if !self.name.is_empty() {
8854            state.serialize_entry("name", &self.name)?;
8855        }
8856        if !self.request_id.is_empty() {
8857            state.serialize_entry("requestId", &self.request_id)?;
8858        }
8859        if !self._unknown_fields.is_empty() {
8860            for (key, value) in self._unknown_fields.iter() {
8861                state.serialize_entry(key, &value)?;
8862            }
8863        }
8864        state.end()
8865    }
8866}
8867
8868impl std::fmt::Debug for DeleteLoggingServerRequest {
8869    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8870        let mut debug_struct = f.debug_struct("DeleteLoggingServerRequest");
8871        debug_struct.field("name", &self.name);
8872        debug_struct.field("request_id", &self.request_id);
8873        if !self._unknown_fields.is_empty() {
8874            debug_struct.field("_unknown_fields", &self._unknown_fields);
8875        }
8876        debug_struct.finish()
8877    }
8878}
8879
8880/// Represents the metadata of the long-running operation.
8881#[derive(Clone, Default, PartialEq)]
8882#[non_exhaustive]
8883pub struct OperationMetadata {
8884    /// Output only. The time the operation was created.
8885    pub create_time: std::option::Option<wkt::Timestamp>,
8886
8887    /// Output only. The time the operation finished running.
8888    pub end_time: std::option::Option<wkt::Timestamp>,
8889
8890    /// Output only. Server-defined resource path for the target of the operation.
8891    pub target: std::string::String,
8892
8893    /// Output only. Name of the verb executed by the operation.
8894    pub verb: std::string::String,
8895
8896    /// Output only. Human-readable status of the operation, if any.
8897    pub status_message: std::string::String,
8898
8899    /// Output only. True if the user has requested cancellation
8900    /// of the operation; false otherwise.
8901    /// Operations that have successfully been cancelled
8902    /// have [Operation.error][] value with a
8903    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
8904    /// `Code.CANCELLED`.
8905    ///
8906    /// [google.rpc.Status.code]: rpc::model::Status::code
8907    pub requested_cancellation: bool,
8908
8909    /// Output only. API version used to start the operation.
8910    pub api_version: std::string::String,
8911
8912    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8913}
8914
8915impl OperationMetadata {
8916    pub fn new() -> Self {
8917        std::default::Default::default()
8918    }
8919
8920    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
8921    pub fn set_create_time<T>(mut self, v: T) -> Self
8922    where
8923        T: std::convert::Into<wkt::Timestamp>,
8924    {
8925        self.create_time = std::option::Option::Some(v.into());
8926        self
8927    }
8928
8929    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
8930    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8931    where
8932        T: std::convert::Into<wkt::Timestamp>,
8933    {
8934        self.create_time = v.map(|x| x.into());
8935        self
8936    }
8937
8938    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
8939    pub fn set_end_time<T>(mut self, v: T) -> Self
8940    where
8941        T: std::convert::Into<wkt::Timestamp>,
8942    {
8943        self.end_time = std::option::Option::Some(v.into());
8944        self
8945    }
8946
8947    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
8948    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8949    where
8950        T: std::convert::Into<wkt::Timestamp>,
8951    {
8952        self.end_time = v.map(|x| x.into());
8953        self
8954    }
8955
8956    /// Sets the value of [target][crate::model::OperationMetadata::target].
8957    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8958        self.target = v.into();
8959        self
8960    }
8961
8962    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
8963    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8964        self.verb = v.into();
8965        self
8966    }
8967
8968    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
8969    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8970        self.status_message = v.into();
8971        self
8972    }
8973
8974    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
8975    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8976        self.requested_cancellation = v.into();
8977        self
8978    }
8979
8980    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
8981    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8982        self.api_version = v.into();
8983        self
8984    }
8985}
8986
8987impl wkt::message::Message for OperationMetadata {
8988    fn typename() -> &'static str {
8989        "type.googleapis.com/google.cloud.vmwareengine.v1.OperationMetadata"
8990    }
8991}
8992
8993#[doc(hidden)]
8994impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
8995    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8996    where
8997        D: serde::Deserializer<'de>,
8998    {
8999        #[allow(non_camel_case_types)]
9000        #[doc(hidden)]
9001        #[derive(PartialEq, Eq, Hash)]
9002        enum __FieldTag {
9003            __create_time,
9004            __end_time,
9005            __target,
9006            __verb,
9007            __status_message,
9008            __requested_cancellation,
9009            __api_version,
9010            Unknown(std::string::String),
9011        }
9012        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9013            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9014            where
9015                D: serde::Deserializer<'de>,
9016            {
9017                struct Visitor;
9018                impl<'de> serde::de::Visitor<'de> for Visitor {
9019                    type Value = __FieldTag;
9020                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9021                        formatter.write_str("a field name for OperationMetadata")
9022                    }
9023                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9024                    where
9025                        E: serde::de::Error,
9026                    {
9027                        use std::result::Result::Ok;
9028                        use std::string::ToString;
9029                        match value {
9030                            "createTime" => Ok(__FieldTag::__create_time),
9031                            "create_time" => Ok(__FieldTag::__create_time),
9032                            "endTime" => Ok(__FieldTag::__end_time),
9033                            "end_time" => Ok(__FieldTag::__end_time),
9034                            "target" => Ok(__FieldTag::__target),
9035                            "verb" => Ok(__FieldTag::__verb),
9036                            "statusMessage" => Ok(__FieldTag::__status_message),
9037                            "status_message" => Ok(__FieldTag::__status_message),
9038                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
9039                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
9040                            "apiVersion" => Ok(__FieldTag::__api_version),
9041                            "api_version" => Ok(__FieldTag::__api_version),
9042                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9043                        }
9044                    }
9045                }
9046                deserializer.deserialize_identifier(Visitor)
9047            }
9048        }
9049        struct Visitor;
9050        impl<'de> serde::de::Visitor<'de> for Visitor {
9051            type Value = OperationMetadata;
9052            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9053                formatter.write_str("struct OperationMetadata")
9054            }
9055            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9056            where
9057                A: serde::de::MapAccess<'de>,
9058            {
9059                #[allow(unused_imports)]
9060                use serde::de::Error;
9061                use std::option::Option::Some;
9062                let mut fields = std::collections::HashSet::new();
9063                let mut result = Self::Value::new();
9064                while let Some(tag) = map.next_key::<__FieldTag>()? {
9065                    #[allow(clippy::match_single_binding)]
9066                    match tag {
9067                        __FieldTag::__create_time => {
9068                            if !fields.insert(__FieldTag::__create_time) {
9069                                return std::result::Result::Err(A::Error::duplicate_field(
9070                                    "multiple values for create_time",
9071                                ));
9072                            }
9073                            result.create_time =
9074                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9075                        }
9076                        __FieldTag::__end_time => {
9077                            if !fields.insert(__FieldTag::__end_time) {
9078                                return std::result::Result::Err(A::Error::duplicate_field(
9079                                    "multiple values for end_time",
9080                                ));
9081                            }
9082                            result.end_time =
9083                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9084                        }
9085                        __FieldTag::__target => {
9086                            if !fields.insert(__FieldTag::__target) {
9087                                return std::result::Result::Err(A::Error::duplicate_field(
9088                                    "multiple values for target",
9089                                ));
9090                            }
9091                            result.target = map
9092                                .next_value::<std::option::Option<std::string::String>>()?
9093                                .unwrap_or_default();
9094                        }
9095                        __FieldTag::__verb => {
9096                            if !fields.insert(__FieldTag::__verb) {
9097                                return std::result::Result::Err(A::Error::duplicate_field(
9098                                    "multiple values for verb",
9099                                ));
9100                            }
9101                            result.verb = map
9102                                .next_value::<std::option::Option<std::string::String>>()?
9103                                .unwrap_or_default();
9104                        }
9105                        __FieldTag::__status_message => {
9106                            if !fields.insert(__FieldTag::__status_message) {
9107                                return std::result::Result::Err(A::Error::duplicate_field(
9108                                    "multiple values for status_message",
9109                                ));
9110                            }
9111                            result.status_message = map
9112                                .next_value::<std::option::Option<std::string::String>>()?
9113                                .unwrap_or_default();
9114                        }
9115                        __FieldTag::__requested_cancellation => {
9116                            if !fields.insert(__FieldTag::__requested_cancellation) {
9117                                return std::result::Result::Err(A::Error::duplicate_field(
9118                                    "multiple values for requested_cancellation",
9119                                ));
9120                            }
9121                            result.requested_cancellation = map
9122                                .next_value::<std::option::Option<bool>>()?
9123                                .unwrap_or_default();
9124                        }
9125                        __FieldTag::__api_version => {
9126                            if !fields.insert(__FieldTag::__api_version) {
9127                                return std::result::Result::Err(A::Error::duplicate_field(
9128                                    "multiple values for api_version",
9129                                ));
9130                            }
9131                            result.api_version = map
9132                                .next_value::<std::option::Option<std::string::String>>()?
9133                                .unwrap_or_default();
9134                        }
9135                        __FieldTag::Unknown(key) => {
9136                            let value = map.next_value::<serde_json::Value>()?;
9137                            result._unknown_fields.insert(key, value);
9138                        }
9139                    }
9140                }
9141                std::result::Result::Ok(result)
9142            }
9143        }
9144        deserializer.deserialize_any(Visitor)
9145    }
9146}
9147
9148#[doc(hidden)]
9149impl serde::ser::Serialize for OperationMetadata {
9150    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9151    where
9152        S: serde::ser::Serializer,
9153    {
9154        use serde::ser::SerializeMap;
9155        #[allow(unused_imports)]
9156        use std::option::Option::Some;
9157        let mut state = serializer.serialize_map(std::option::Option::None)?;
9158        if self.create_time.is_some() {
9159            state.serialize_entry("createTime", &self.create_time)?;
9160        }
9161        if self.end_time.is_some() {
9162            state.serialize_entry("endTime", &self.end_time)?;
9163        }
9164        if !self.target.is_empty() {
9165            state.serialize_entry("target", &self.target)?;
9166        }
9167        if !self.verb.is_empty() {
9168            state.serialize_entry("verb", &self.verb)?;
9169        }
9170        if !self.status_message.is_empty() {
9171            state.serialize_entry("statusMessage", &self.status_message)?;
9172        }
9173        if !wkt::internal::is_default(&self.requested_cancellation) {
9174            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
9175        }
9176        if !self.api_version.is_empty() {
9177            state.serialize_entry("apiVersion", &self.api_version)?;
9178        }
9179        if !self._unknown_fields.is_empty() {
9180            for (key, value) in self._unknown_fields.iter() {
9181                state.serialize_entry(key, &value)?;
9182            }
9183        }
9184        state.end()
9185    }
9186}
9187
9188impl std::fmt::Debug for OperationMetadata {
9189    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9190        let mut debug_struct = f.debug_struct("OperationMetadata");
9191        debug_struct.field("create_time", &self.create_time);
9192        debug_struct.field("end_time", &self.end_time);
9193        debug_struct.field("target", &self.target);
9194        debug_struct.field("verb", &self.verb);
9195        debug_struct.field("status_message", &self.status_message);
9196        debug_struct.field("requested_cancellation", &self.requested_cancellation);
9197        debug_struct.field("api_version", &self.api_version);
9198        if !self._unknown_fields.is_empty() {
9199            debug_struct.field("_unknown_fields", &self._unknown_fields);
9200        }
9201        debug_struct.finish()
9202    }
9203}
9204
9205/// Request message for
9206/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
9207///
9208/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
9209#[derive(Clone, Default, PartialEq)]
9210#[non_exhaustive]
9211pub struct ListNodeTypesRequest {
9212    /// Required. The resource name of the location to be queried for node types.
9213    /// Resource names are schemeless URIs that follow the conventions in
9214    /// <https://cloud.google.com/apis/design/resource_names>.
9215    /// For example:
9216    /// `projects/my-project/locations/us-central1-a`
9217    pub parent: std::string::String,
9218
9219    /// The maximum number of node types to return in one page.
9220    /// The service may return fewer than this value.
9221    /// The maximum value is coerced to 1000.
9222    /// The default value of this field is 500.
9223    pub page_size: i32,
9224
9225    /// A page token, received from a previous `ListNodeTypes` call.
9226    /// Provide this to retrieve the subsequent page.
9227    ///
9228    /// When paginating, all other parameters provided to
9229    /// `ListNodeTypes` must match the call that provided the page token.
9230    pub page_token: std::string::String,
9231
9232    /// A filter expression that matches resources returned in the response.
9233    /// The expression must specify the field name, a comparison
9234    /// operator, and the value that you want to use for filtering. The value
9235    /// must be a string, a number, or a boolean. The comparison operator
9236    /// must be `=`, `!=`, `>`, or `<`.
9237    ///
9238    /// For example, if you are filtering a list of node types, you can
9239    /// exclude the ones named `standard-72` by specifying
9240    /// `name != "standard-72"`.
9241    ///
9242    /// To filter on multiple expressions, provide each separate expression within
9243    /// parentheses. For example:
9244    ///
9245    /// ```norust
9246    /// (name = "standard-72")
9247    /// (virtual_cpu_count > 2)
9248    /// ```
9249    ///
9250    /// By default, each expression is an `AND` expression. However, you
9251    /// can include `AND` and `OR` expressions explicitly.
9252    /// For example:
9253    ///
9254    /// ```norust
9255    /// (name = "standard-96") AND
9256    /// (virtual_cpu_count > 2) OR
9257    /// (name = "standard-72")
9258    /// ```
9259    pub filter: std::string::String,
9260
9261    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9262}
9263
9264impl ListNodeTypesRequest {
9265    pub fn new() -> Self {
9266        std::default::Default::default()
9267    }
9268
9269    /// Sets the value of [parent][crate::model::ListNodeTypesRequest::parent].
9270    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9271        self.parent = v.into();
9272        self
9273    }
9274
9275    /// Sets the value of [page_size][crate::model::ListNodeTypesRequest::page_size].
9276    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9277        self.page_size = v.into();
9278        self
9279    }
9280
9281    /// Sets the value of [page_token][crate::model::ListNodeTypesRequest::page_token].
9282    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9283        self.page_token = v.into();
9284        self
9285    }
9286
9287    /// Sets the value of [filter][crate::model::ListNodeTypesRequest::filter].
9288    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9289        self.filter = v.into();
9290        self
9291    }
9292}
9293
9294impl wkt::message::Message for ListNodeTypesRequest {
9295    fn typename() -> &'static str {
9296        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesRequest"
9297    }
9298}
9299
9300#[doc(hidden)]
9301impl<'de> serde::de::Deserialize<'de> for ListNodeTypesRequest {
9302    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9303    where
9304        D: serde::Deserializer<'de>,
9305    {
9306        #[allow(non_camel_case_types)]
9307        #[doc(hidden)]
9308        #[derive(PartialEq, Eq, Hash)]
9309        enum __FieldTag {
9310            __parent,
9311            __page_size,
9312            __page_token,
9313            __filter,
9314            Unknown(std::string::String),
9315        }
9316        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9317            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9318            where
9319                D: serde::Deserializer<'de>,
9320            {
9321                struct Visitor;
9322                impl<'de> serde::de::Visitor<'de> for Visitor {
9323                    type Value = __FieldTag;
9324                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9325                        formatter.write_str("a field name for ListNodeTypesRequest")
9326                    }
9327                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9328                    where
9329                        E: serde::de::Error,
9330                    {
9331                        use std::result::Result::Ok;
9332                        use std::string::ToString;
9333                        match value {
9334                            "parent" => Ok(__FieldTag::__parent),
9335                            "pageSize" => Ok(__FieldTag::__page_size),
9336                            "page_size" => Ok(__FieldTag::__page_size),
9337                            "pageToken" => Ok(__FieldTag::__page_token),
9338                            "page_token" => Ok(__FieldTag::__page_token),
9339                            "filter" => Ok(__FieldTag::__filter),
9340                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9341                        }
9342                    }
9343                }
9344                deserializer.deserialize_identifier(Visitor)
9345            }
9346        }
9347        struct Visitor;
9348        impl<'de> serde::de::Visitor<'de> for Visitor {
9349            type Value = ListNodeTypesRequest;
9350            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9351                formatter.write_str("struct ListNodeTypesRequest")
9352            }
9353            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9354            where
9355                A: serde::de::MapAccess<'de>,
9356            {
9357                #[allow(unused_imports)]
9358                use serde::de::Error;
9359                use std::option::Option::Some;
9360                let mut fields = std::collections::HashSet::new();
9361                let mut result = Self::Value::new();
9362                while let Some(tag) = map.next_key::<__FieldTag>()? {
9363                    #[allow(clippy::match_single_binding)]
9364                    match tag {
9365                        __FieldTag::__parent => {
9366                            if !fields.insert(__FieldTag::__parent) {
9367                                return std::result::Result::Err(A::Error::duplicate_field(
9368                                    "multiple values for parent",
9369                                ));
9370                            }
9371                            result.parent = map
9372                                .next_value::<std::option::Option<std::string::String>>()?
9373                                .unwrap_or_default();
9374                        }
9375                        __FieldTag::__page_size => {
9376                            if !fields.insert(__FieldTag::__page_size) {
9377                                return std::result::Result::Err(A::Error::duplicate_field(
9378                                    "multiple values for page_size",
9379                                ));
9380                            }
9381                            struct __With(std::option::Option<i32>);
9382                            impl<'de> serde::de::Deserialize<'de> for __With {
9383                                fn deserialize<D>(
9384                                    deserializer: D,
9385                                ) -> std::result::Result<Self, D::Error>
9386                                where
9387                                    D: serde::de::Deserializer<'de>,
9388                                {
9389                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9390                                }
9391                            }
9392                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
9393                        }
9394                        __FieldTag::__page_token => {
9395                            if !fields.insert(__FieldTag::__page_token) {
9396                                return std::result::Result::Err(A::Error::duplicate_field(
9397                                    "multiple values for page_token",
9398                                ));
9399                            }
9400                            result.page_token = map
9401                                .next_value::<std::option::Option<std::string::String>>()?
9402                                .unwrap_or_default();
9403                        }
9404                        __FieldTag::__filter => {
9405                            if !fields.insert(__FieldTag::__filter) {
9406                                return std::result::Result::Err(A::Error::duplicate_field(
9407                                    "multiple values for filter",
9408                                ));
9409                            }
9410                            result.filter = map
9411                                .next_value::<std::option::Option<std::string::String>>()?
9412                                .unwrap_or_default();
9413                        }
9414                        __FieldTag::Unknown(key) => {
9415                            let value = map.next_value::<serde_json::Value>()?;
9416                            result._unknown_fields.insert(key, value);
9417                        }
9418                    }
9419                }
9420                std::result::Result::Ok(result)
9421            }
9422        }
9423        deserializer.deserialize_any(Visitor)
9424    }
9425}
9426
9427#[doc(hidden)]
9428impl serde::ser::Serialize for ListNodeTypesRequest {
9429    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9430    where
9431        S: serde::ser::Serializer,
9432    {
9433        use serde::ser::SerializeMap;
9434        #[allow(unused_imports)]
9435        use std::option::Option::Some;
9436        let mut state = serializer.serialize_map(std::option::Option::None)?;
9437        if !self.parent.is_empty() {
9438            state.serialize_entry("parent", &self.parent)?;
9439        }
9440        if !wkt::internal::is_default(&self.page_size) {
9441            struct __With<'a>(&'a i32);
9442            impl<'a> serde::ser::Serialize for __With<'a> {
9443                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9444                where
9445                    S: serde::ser::Serializer,
9446                {
9447                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
9448                }
9449            }
9450            state.serialize_entry("pageSize", &__With(&self.page_size))?;
9451        }
9452        if !self.page_token.is_empty() {
9453            state.serialize_entry("pageToken", &self.page_token)?;
9454        }
9455        if !self.filter.is_empty() {
9456            state.serialize_entry("filter", &self.filter)?;
9457        }
9458        if !self._unknown_fields.is_empty() {
9459            for (key, value) in self._unknown_fields.iter() {
9460                state.serialize_entry(key, &value)?;
9461            }
9462        }
9463        state.end()
9464    }
9465}
9466
9467impl std::fmt::Debug for ListNodeTypesRequest {
9468    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9469        let mut debug_struct = f.debug_struct("ListNodeTypesRequest");
9470        debug_struct.field("parent", &self.parent);
9471        debug_struct.field("page_size", &self.page_size);
9472        debug_struct.field("page_token", &self.page_token);
9473        debug_struct.field("filter", &self.filter);
9474        if !self._unknown_fields.is_empty() {
9475            debug_struct.field("_unknown_fields", &self._unknown_fields);
9476        }
9477        debug_struct.finish()
9478    }
9479}
9480
9481/// Response message for
9482/// [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]
9483///
9484/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes]: crate::client::VmwareEngine::list_node_types
9485#[derive(Clone, Default, PartialEq)]
9486#[non_exhaustive]
9487pub struct ListNodeTypesResponse {
9488    /// A list of Node Types.
9489    pub node_types: std::vec::Vec<crate::model::NodeType>,
9490
9491    /// A token, which can be sent as `page_token` to retrieve the next page.
9492    /// If this field is omitted, there are no subsequent pages.
9493    pub next_page_token: std::string::String,
9494
9495    /// Locations that could not be reached when making an aggregated query using
9496    /// wildcards.
9497    pub unreachable: std::vec::Vec<std::string::String>,
9498
9499    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9500}
9501
9502impl ListNodeTypesResponse {
9503    pub fn new() -> Self {
9504        std::default::Default::default()
9505    }
9506
9507    /// Sets the value of [node_types][crate::model::ListNodeTypesResponse::node_types].
9508    pub fn set_node_types<T, V>(mut self, v: T) -> Self
9509    where
9510        T: std::iter::IntoIterator<Item = V>,
9511        V: std::convert::Into<crate::model::NodeType>,
9512    {
9513        use std::iter::Iterator;
9514        self.node_types = v.into_iter().map(|i| i.into()).collect();
9515        self
9516    }
9517
9518    /// Sets the value of [next_page_token][crate::model::ListNodeTypesResponse::next_page_token].
9519    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9520        self.next_page_token = v.into();
9521        self
9522    }
9523
9524    /// Sets the value of [unreachable][crate::model::ListNodeTypesResponse::unreachable].
9525    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9526    where
9527        T: std::iter::IntoIterator<Item = V>,
9528        V: std::convert::Into<std::string::String>,
9529    {
9530        use std::iter::Iterator;
9531        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9532        self
9533    }
9534}
9535
9536impl wkt::message::Message for ListNodeTypesResponse {
9537    fn typename() -> &'static str {
9538        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNodeTypesResponse"
9539    }
9540}
9541
9542#[doc(hidden)]
9543impl gax::paginator::internal::PageableResponse for ListNodeTypesResponse {
9544    type PageItem = crate::model::NodeType;
9545
9546    fn items(self) -> std::vec::Vec<Self::PageItem> {
9547        self.node_types
9548    }
9549
9550    fn next_page_token(&self) -> std::string::String {
9551        use std::clone::Clone;
9552        self.next_page_token.clone()
9553    }
9554}
9555
9556#[doc(hidden)]
9557impl<'de> serde::de::Deserialize<'de> for ListNodeTypesResponse {
9558    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9559    where
9560        D: serde::Deserializer<'de>,
9561    {
9562        #[allow(non_camel_case_types)]
9563        #[doc(hidden)]
9564        #[derive(PartialEq, Eq, Hash)]
9565        enum __FieldTag {
9566            __node_types,
9567            __next_page_token,
9568            __unreachable,
9569            Unknown(std::string::String),
9570        }
9571        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9572            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9573            where
9574                D: serde::Deserializer<'de>,
9575            {
9576                struct Visitor;
9577                impl<'de> serde::de::Visitor<'de> for Visitor {
9578                    type Value = __FieldTag;
9579                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9580                        formatter.write_str("a field name for ListNodeTypesResponse")
9581                    }
9582                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9583                    where
9584                        E: serde::de::Error,
9585                    {
9586                        use std::result::Result::Ok;
9587                        use std::string::ToString;
9588                        match value {
9589                            "nodeTypes" => Ok(__FieldTag::__node_types),
9590                            "node_types" => Ok(__FieldTag::__node_types),
9591                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
9592                            "next_page_token" => Ok(__FieldTag::__next_page_token),
9593                            "unreachable" => Ok(__FieldTag::__unreachable),
9594                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9595                        }
9596                    }
9597                }
9598                deserializer.deserialize_identifier(Visitor)
9599            }
9600        }
9601        struct Visitor;
9602        impl<'de> serde::de::Visitor<'de> for Visitor {
9603            type Value = ListNodeTypesResponse;
9604            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9605                formatter.write_str("struct ListNodeTypesResponse")
9606            }
9607            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9608            where
9609                A: serde::de::MapAccess<'de>,
9610            {
9611                #[allow(unused_imports)]
9612                use serde::de::Error;
9613                use std::option::Option::Some;
9614                let mut fields = std::collections::HashSet::new();
9615                let mut result = Self::Value::new();
9616                while let Some(tag) = map.next_key::<__FieldTag>()? {
9617                    #[allow(clippy::match_single_binding)]
9618                    match tag {
9619                        __FieldTag::__node_types => {
9620                            if !fields.insert(__FieldTag::__node_types) {
9621                                return std::result::Result::Err(A::Error::duplicate_field(
9622                                    "multiple values for node_types",
9623                                ));
9624                            }
9625                            result.node_types = map.next_value::<std::option::Option<std::vec::Vec<crate::model::NodeType>>>()?.unwrap_or_default();
9626                        }
9627                        __FieldTag::__next_page_token => {
9628                            if !fields.insert(__FieldTag::__next_page_token) {
9629                                return std::result::Result::Err(A::Error::duplicate_field(
9630                                    "multiple values for next_page_token",
9631                                ));
9632                            }
9633                            result.next_page_token = map
9634                                .next_value::<std::option::Option<std::string::String>>()?
9635                                .unwrap_or_default();
9636                        }
9637                        __FieldTag::__unreachable => {
9638                            if !fields.insert(__FieldTag::__unreachable) {
9639                                return std::result::Result::Err(A::Error::duplicate_field(
9640                                    "multiple values for unreachable",
9641                                ));
9642                            }
9643                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9644                        }
9645                        __FieldTag::Unknown(key) => {
9646                            let value = map.next_value::<serde_json::Value>()?;
9647                            result._unknown_fields.insert(key, value);
9648                        }
9649                    }
9650                }
9651                std::result::Result::Ok(result)
9652            }
9653        }
9654        deserializer.deserialize_any(Visitor)
9655    }
9656}
9657
9658#[doc(hidden)]
9659impl serde::ser::Serialize for ListNodeTypesResponse {
9660    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9661    where
9662        S: serde::ser::Serializer,
9663    {
9664        use serde::ser::SerializeMap;
9665        #[allow(unused_imports)]
9666        use std::option::Option::Some;
9667        let mut state = serializer.serialize_map(std::option::Option::None)?;
9668        if !self.node_types.is_empty() {
9669            state.serialize_entry("nodeTypes", &self.node_types)?;
9670        }
9671        if !self.next_page_token.is_empty() {
9672            state.serialize_entry("nextPageToken", &self.next_page_token)?;
9673        }
9674        if !self.unreachable.is_empty() {
9675            state.serialize_entry("unreachable", &self.unreachable)?;
9676        }
9677        if !self._unknown_fields.is_empty() {
9678            for (key, value) in self._unknown_fields.iter() {
9679                state.serialize_entry(key, &value)?;
9680            }
9681        }
9682        state.end()
9683    }
9684}
9685
9686impl std::fmt::Debug for ListNodeTypesResponse {
9687    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9688        let mut debug_struct = f.debug_struct("ListNodeTypesResponse");
9689        debug_struct.field("node_types", &self.node_types);
9690        debug_struct.field("next_page_token", &self.next_page_token);
9691        debug_struct.field("unreachable", &self.unreachable);
9692        if !self._unknown_fields.is_empty() {
9693            debug_struct.field("_unknown_fields", &self._unknown_fields);
9694        }
9695        debug_struct.finish()
9696    }
9697}
9698
9699/// Request message for
9700/// [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]
9701///
9702/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType]: crate::client::VmwareEngine::get_node_type
9703#[derive(Clone, Default, PartialEq)]
9704#[non_exhaustive]
9705pub struct GetNodeTypeRequest {
9706    /// Required. The resource name of the node type to retrieve.
9707    /// Resource names are schemeless URIs that follow the conventions in
9708    /// <https://cloud.google.com/apis/design/resource_names>.
9709    /// For example:
9710    /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
9711    pub name: std::string::String,
9712
9713    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9714}
9715
9716impl GetNodeTypeRequest {
9717    pub fn new() -> Self {
9718        std::default::Default::default()
9719    }
9720
9721    /// Sets the value of [name][crate::model::GetNodeTypeRequest::name].
9722    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9723        self.name = v.into();
9724        self
9725    }
9726}
9727
9728impl wkt::message::Message for GetNodeTypeRequest {
9729    fn typename() -> &'static str {
9730        "type.googleapis.com/google.cloud.vmwareengine.v1.GetNodeTypeRequest"
9731    }
9732}
9733
9734#[doc(hidden)]
9735impl<'de> serde::de::Deserialize<'de> for GetNodeTypeRequest {
9736    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9737    where
9738        D: serde::Deserializer<'de>,
9739    {
9740        #[allow(non_camel_case_types)]
9741        #[doc(hidden)]
9742        #[derive(PartialEq, Eq, Hash)]
9743        enum __FieldTag {
9744            __name,
9745            Unknown(std::string::String),
9746        }
9747        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9748            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9749            where
9750                D: serde::Deserializer<'de>,
9751            {
9752                struct Visitor;
9753                impl<'de> serde::de::Visitor<'de> for Visitor {
9754                    type Value = __FieldTag;
9755                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9756                        formatter.write_str("a field name for GetNodeTypeRequest")
9757                    }
9758                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9759                    where
9760                        E: serde::de::Error,
9761                    {
9762                        use std::result::Result::Ok;
9763                        use std::string::ToString;
9764                        match value {
9765                            "name" => Ok(__FieldTag::__name),
9766                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9767                        }
9768                    }
9769                }
9770                deserializer.deserialize_identifier(Visitor)
9771            }
9772        }
9773        struct Visitor;
9774        impl<'de> serde::de::Visitor<'de> for Visitor {
9775            type Value = GetNodeTypeRequest;
9776            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9777                formatter.write_str("struct GetNodeTypeRequest")
9778            }
9779            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9780            where
9781                A: serde::de::MapAccess<'de>,
9782            {
9783                #[allow(unused_imports)]
9784                use serde::de::Error;
9785                use std::option::Option::Some;
9786                let mut fields = std::collections::HashSet::new();
9787                let mut result = Self::Value::new();
9788                while let Some(tag) = map.next_key::<__FieldTag>()? {
9789                    #[allow(clippy::match_single_binding)]
9790                    match tag {
9791                        __FieldTag::__name => {
9792                            if !fields.insert(__FieldTag::__name) {
9793                                return std::result::Result::Err(A::Error::duplicate_field(
9794                                    "multiple values for name",
9795                                ));
9796                            }
9797                            result.name = map
9798                                .next_value::<std::option::Option<std::string::String>>()?
9799                                .unwrap_or_default();
9800                        }
9801                        __FieldTag::Unknown(key) => {
9802                            let value = map.next_value::<serde_json::Value>()?;
9803                            result._unknown_fields.insert(key, value);
9804                        }
9805                    }
9806                }
9807                std::result::Result::Ok(result)
9808            }
9809        }
9810        deserializer.deserialize_any(Visitor)
9811    }
9812}
9813
9814#[doc(hidden)]
9815impl serde::ser::Serialize for GetNodeTypeRequest {
9816    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9817    where
9818        S: serde::ser::Serializer,
9819    {
9820        use serde::ser::SerializeMap;
9821        #[allow(unused_imports)]
9822        use std::option::Option::Some;
9823        let mut state = serializer.serialize_map(std::option::Option::None)?;
9824        if !self.name.is_empty() {
9825            state.serialize_entry("name", &self.name)?;
9826        }
9827        if !self._unknown_fields.is_empty() {
9828            for (key, value) in self._unknown_fields.iter() {
9829                state.serialize_entry(key, &value)?;
9830            }
9831        }
9832        state.end()
9833    }
9834}
9835
9836impl std::fmt::Debug for GetNodeTypeRequest {
9837    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9838        let mut debug_struct = f.debug_struct("GetNodeTypeRequest");
9839        debug_struct.field("name", &self.name);
9840        if !self._unknown_fields.is_empty() {
9841            debug_struct.field("_unknown_fields", &self._unknown_fields);
9842        }
9843        debug_struct.finish()
9844    }
9845}
9846
9847/// Request message for
9848/// [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]
9849///
9850/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials]: crate::client::VmwareEngine::show_nsx_credentials
9851#[derive(Clone, Default, PartialEq)]
9852#[non_exhaustive]
9853pub struct ShowNsxCredentialsRequest {
9854    /// Required. The resource name of the private cloud
9855    /// to be queried for credentials.
9856    /// Resource names are schemeless URIs that follow the conventions in
9857    /// <https://cloud.google.com/apis/design/resource_names>.
9858    /// For example:
9859    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
9860    pub private_cloud: std::string::String,
9861
9862    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9863}
9864
9865impl ShowNsxCredentialsRequest {
9866    pub fn new() -> Self {
9867        std::default::Default::default()
9868    }
9869
9870    /// Sets the value of [private_cloud][crate::model::ShowNsxCredentialsRequest::private_cloud].
9871    pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872        self.private_cloud = v.into();
9873        self
9874    }
9875}
9876
9877impl wkt::message::Message for ShowNsxCredentialsRequest {
9878    fn typename() -> &'static str {
9879        "type.googleapis.com/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"
9880    }
9881}
9882
9883#[doc(hidden)]
9884impl<'de> serde::de::Deserialize<'de> for ShowNsxCredentialsRequest {
9885    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9886    where
9887        D: serde::Deserializer<'de>,
9888    {
9889        #[allow(non_camel_case_types)]
9890        #[doc(hidden)]
9891        #[derive(PartialEq, Eq, Hash)]
9892        enum __FieldTag {
9893            __private_cloud,
9894            Unknown(std::string::String),
9895        }
9896        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9897            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9898            where
9899                D: serde::Deserializer<'de>,
9900            {
9901                struct Visitor;
9902                impl<'de> serde::de::Visitor<'de> for Visitor {
9903                    type Value = __FieldTag;
9904                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9905                        formatter.write_str("a field name for ShowNsxCredentialsRequest")
9906                    }
9907                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9908                    where
9909                        E: serde::de::Error,
9910                    {
9911                        use std::result::Result::Ok;
9912                        use std::string::ToString;
9913                        match value {
9914                            "privateCloud" => Ok(__FieldTag::__private_cloud),
9915                            "private_cloud" => Ok(__FieldTag::__private_cloud),
9916                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9917                        }
9918                    }
9919                }
9920                deserializer.deserialize_identifier(Visitor)
9921            }
9922        }
9923        struct Visitor;
9924        impl<'de> serde::de::Visitor<'de> for Visitor {
9925            type Value = ShowNsxCredentialsRequest;
9926            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9927                formatter.write_str("struct ShowNsxCredentialsRequest")
9928            }
9929            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9930            where
9931                A: serde::de::MapAccess<'de>,
9932            {
9933                #[allow(unused_imports)]
9934                use serde::de::Error;
9935                use std::option::Option::Some;
9936                let mut fields = std::collections::HashSet::new();
9937                let mut result = Self::Value::new();
9938                while let Some(tag) = map.next_key::<__FieldTag>()? {
9939                    #[allow(clippy::match_single_binding)]
9940                    match tag {
9941                        __FieldTag::__private_cloud => {
9942                            if !fields.insert(__FieldTag::__private_cloud) {
9943                                return std::result::Result::Err(A::Error::duplicate_field(
9944                                    "multiple values for private_cloud",
9945                                ));
9946                            }
9947                            result.private_cloud = map
9948                                .next_value::<std::option::Option<std::string::String>>()?
9949                                .unwrap_or_default();
9950                        }
9951                        __FieldTag::Unknown(key) => {
9952                            let value = map.next_value::<serde_json::Value>()?;
9953                            result._unknown_fields.insert(key, value);
9954                        }
9955                    }
9956                }
9957                std::result::Result::Ok(result)
9958            }
9959        }
9960        deserializer.deserialize_any(Visitor)
9961    }
9962}
9963
9964#[doc(hidden)]
9965impl serde::ser::Serialize for ShowNsxCredentialsRequest {
9966    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9967    where
9968        S: serde::ser::Serializer,
9969    {
9970        use serde::ser::SerializeMap;
9971        #[allow(unused_imports)]
9972        use std::option::Option::Some;
9973        let mut state = serializer.serialize_map(std::option::Option::None)?;
9974        if !self.private_cloud.is_empty() {
9975            state.serialize_entry("privateCloud", &self.private_cloud)?;
9976        }
9977        if !self._unknown_fields.is_empty() {
9978            for (key, value) in self._unknown_fields.iter() {
9979                state.serialize_entry(key, &value)?;
9980            }
9981        }
9982        state.end()
9983    }
9984}
9985
9986impl std::fmt::Debug for ShowNsxCredentialsRequest {
9987    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9988        let mut debug_struct = f.debug_struct("ShowNsxCredentialsRequest");
9989        debug_struct.field("private_cloud", &self.private_cloud);
9990        if !self._unknown_fields.is_empty() {
9991            debug_struct.field("_unknown_fields", &self._unknown_fields);
9992        }
9993        debug_struct.finish()
9994    }
9995}
9996
9997/// Request message for
9998/// [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]
9999///
10000/// [google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials]: crate::client::VmwareEngine::show_vcenter_credentials
10001#[derive(Clone, Default, PartialEq)]
10002#[non_exhaustive]
10003pub struct ShowVcenterCredentialsRequest {
10004    /// Required. The resource name of the private cloud
10005    /// to be queried for credentials.
10006    /// Resource names are schemeless URIs that follow the conventions in
10007    /// <https://cloud.google.com/apis/design/resource_names>.
10008    /// For example:
10009    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
10010    pub private_cloud: std::string::String,
10011
10012    /// Optional. The username of the user to be queried for credentials.
10013    /// The default value of this field is CloudOwner@gve.local.
10014    /// The provided value must be one of the following:
10015    /// CloudOwner@gve.local,
10016    /// solution-user-01@gve.local,
10017    /// solution-user-02@gve.local,
10018    /// solution-user-03@gve.local,
10019    /// solution-user-04@gve.local,
10020    /// solution-user-05@gve.local,
10021    /// zertoadmin@gve.local.
10022    pub username: std::string::String,
10023
10024    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10025}
10026
10027impl ShowVcenterCredentialsRequest {
10028    pub fn new() -> Self {
10029        std::default::Default::default()
10030    }
10031
10032    /// Sets the value of [private_cloud][crate::model::ShowVcenterCredentialsRequest::private_cloud].
10033    pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10034        self.private_cloud = v.into();
10035        self
10036    }
10037
10038    /// Sets the value of [username][crate::model::ShowVcenterCredentialsRequest::username].
10039    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10040        self.username = v.into();
10041        self
10042    }
10043}
10044
10045impl wkt::message::Message for ShowVcenterCredentialsRequest {
10046    fn typename() -> &'static str {
10047        "type.googleapis.com/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"
10048    }
10049}
10050
10051#[doc(hidden)]
10052impl<'de> serde::de::Deserialize<'de> for ShowVcenterCredentialsRequest {
10053    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10054    where
10055        D: serde::Deserializer<'de>,
10056    {
10057        #[allow(non_camel_case_types)]
10058        #[doc(hidden)]
10059        #[derive(PartialEq, Eq, Hash)]
10060        enum __FieldTag {
10061            __private_cloud,
10062            __username,
10063            Unknown(std::string::String),
10064        }
10065        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10066            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10067            where
10068                D: serde::Deserializer<'de>,
10069            {
10070                struct Visitor;
10071                impl<'de> serde::de::Visitor<'de> for Visitor {
10072                    type Value = __FieldTag;
10073                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10074                        formatter.write_str("a field name for ShowVcenterCredentialsRequest")
10075                    }
10076                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10077                    where
10078                        E: serde::de::Error,
10079                    {
10080                        use std::result::Result::Ok;
10081                        use std::string::ToString;
10082                        match value {
10083                            "privateCloud" => Ok(__FieldTag::__private_cloud),
10084                            "private_cloud" => Ok(__FieldTag::__private_cloud),
10085                            "username" => Ok(__FieldTag::__username),
10086                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10087                        }
10088                    }
10089                }
10090                deserializer.deserialize_identifier(Visitor)
10091            }
10092        }
10093        struct Visitor;
10094        impl<'de> serde::de::Visitor<'de> for Visitor {
10095            type Value = ShowVcenterCredentialsRequest;
10096            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10097                formatter.write_str("struct ShowVcenterCredentialsRequest")
10098            }
10099            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10100            where
10101                A: serde::de::MapAccess<'de>,
10102            {
10103                #[allow(unused_imports)]
10104                use serde::de::Error;
10105                use std::option::Option::Some;
10106                let mut fields = std::collections::HashSet::new();
10107                let mut result = Self::Value::new();
10108                while let Some(tag) = map.next_key::<__FieldTag>()? {
10109                    #[allow(clippy::match_single_binding)]
10110                    match tag {
10111                        __FieldTag::__private_cloud => {
10112                            if !fields.insert(__FieldTag::__private_cloud) {
10113                                return std::result::Result::Err(A::Error::duplicate_field(
10114                                    "multiple values for private_cloud",
10115                                ));
10116                            }
10117                            result.private_cloud = map
10118                                .next_value::<std::option::Option<std::string::String>>()?
10119                                .unwrap_or_default();
10120                        }
10121                        __FieldTag::__username => {
10122                            if !fields.insert(__FieldTag::__username) {
10123                                return std::result::Result::Err(A::Error::duplicate_field(
10124                                    "multiple values for username",
10125                                ));
10126                            }
10127                            result.username = map
10128                                .next_value::<std::option::Option<std::string::String>>()?
10129                                .unwrap_or_default();
10130                        }
10131                        __FieldTag::Unknown(key) => {
10132                            let value = map.next_value::<serde_json::Value>()?;
10133                            result._unknown_fields.insert(key, value);
10134                        }
10135                    }
10136                }
10137                std::result::Result::Ok(result)
10138            }
10139        }
10140        deserializer.deserialize_any(Visitor)
10141    }
10142}
10143
10144#[doc(hidden)]
10145impl serde::ser::Serialize for ShowVcenterCredentialsRequest {
10146    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10147    where
10148        S: serde::ser::Serializer,
10149    {
10150        use serde::ser::SerializeMap;
10151        #[allow(unused_imports)]
10152        use std::option::Option::Some;
10153        let mut state = serializer.serialize_map(std::option::Option::None)?;
10154        if !self.private_cloud.is_empty() {
10155            state.serialize_entry("privateCloud", &self.private_cloud)?;
10156        }
10157        if !self.username.is_empty() {
10158            state.serialize_entry("username", &self.username)?;
10159        }
10160        if !self._unknown_fields.is_empty() {
10161            for (key, value) in self._unknown_fields.iter() {
10162                state.serialize_entry(key, &value)?;
10163            }
10164        }
10165        state.end()
10166    }
10167}
10168
10169impl std::fmt::Debug for ShowVcenterCredentialsRequest {
10170    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10171        let mut debug_struct = f.debug_struct("ShowVcenterCredentialsRequest");
10172        debug_struct.field("private_cloud", &self.private_cloud);
10173        debug_struct.field("username", &self.username);
10174        if !self._unknown_fields.is_empty() {
10175            debug_struct.field("_unknown_fields", &self._unknown_fields);
10176        }
10177        debug_struct.finish()
10178    }
10179}
10180
10181/// Request message for
10182/// [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]
10183///
10184/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials]: crate::client::VmwareEngine::reset_nsx_credentials
10185#[derive(Clone, Default, PartialEq)]
10186#[non_exhaustive]
10187pub struct ResetNsxCredentialsRequest {
10188    /// Required. The resource name of the private cloud
10189    /// to reset credentials for.
10190    /// Resource names are schemeless URIs that follow the conventions in
10191    /// <https://cloud.google.com/apis/design/resource_names>.
10192    /// For example:
10193    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
10194    pub private_cloud: std::string::String,
10195
10196    /// Optional. A request ID to identify requests. Specify a unique request ID
10197    /// so that if you must retry your request, the server will know to ignore
10198    /// the request if it has already been completed. The server guarantees that a
10199    /// request doesn't result in creation of duplicate commitments for at least 60
10200    /// minutes.
10201    ///
10202    /// For example, consider a situation where you make an initial request and the
10203    /// request times out. If you make the request again with the same request
10204    /// ID, the server can check if original operation with the same request ID
10205    /// was received, and if so, will ignore the second request. This prevents
10206    /// clients from accidentally creating duplicate commitments.
10207    ///
10208    /// The request ID must be a valid UUID with the exception that zero UUID is
10209    /// not supported (00000000-0000-0000-0000-000000000000).
10210    pub request_id: std::string::String,
10211
10212    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10213}
10214
10215impl ResetNsxCredentialsRequest {
10216    pub fn new() -> Self {
10217        std::default::Default::default()
10218    }
10219
10220    /// Sets the value of [private_cloud][crate::model::ResetNsxCredentialsRequest::private_cloud].
10221    pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10222        self.private_cloud = v.into();
10223        self
10224    }
10225
10226    /// Sets the value of [request_id][crate::model::ResetNsxCredentialsRequest::request_id].
10227    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10228        self.request_id = v.into();
10229        self
10230    }
10231}
10232
10233impl wkt::message::Message for ResetNsxCredentialsRequest {
10234    fn typename() -> &'static str {
10235        "type.googleapis.com/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"
10236    }
10237}
10238
10239#[doc(hidden)]
10240impl<'de> serde::de::Deserialize<'de> for ResetNsxCredentialsRequest {
10241    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10242    where
10243        D: serde::Deserializer<'de>,
10244    {
10245        #[allow(non_camel_case_types)]
10246        #[doc(hidden)]
10247        #[derive(PartialEq, Eq, Hash)]
10248        enum __FieldTag {
10249            __private_cloud,
10250            __request_id,
10251            Unknown(std::string::String),
10252        }
10253        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10254            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10255            where
10256                D: serde::Deserializer<'de>,
10257            {
10258                struct Visitor;
10259                impl<'de> serde::de::Visitor<'de> for Visitor {
10260                    type Value = __FieldTag;
10261                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10262                        formatter.write_str("a field name for ResetNsxCredentialsRequest")
10263                    }
10264                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10265                    where
10266                        E: serde::de::Error,
10267                    {
10268                        use std::result::Result::Ok;
10269                        use std::string::ToString;
10270                        match value {
10271                            "privateCloud" => Ok(__FieldTag::__private_cloud),
10272                            "private_cloud" => Ok(__FieldTag::__private_cloud),
10273                            "requestId" => Ok(__FieldTag::__request_id),
10274                            "request_id" => Ok(__FieldTag::__request_id),
10275                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10276                        }
10277                    }
10278                }
10279                deserializer.deserialize_identifier(Visitor)
10280            }
10281        }
10282        struct Visitor;
10283        impl<'de> serde::de::Visitor<'de> for Visitor {
10284            type Value = ResetNsxCredentialsRequest;
10285            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10286                formatter.write_str("struct ResetNsxCredentialsRequest")
10287            }
10288            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10289            where
10290                A: serde::de::MapAccess<'de>,
10291            {
10292                #[allow(unused_imports)]
10293                use serde::de::Error;
10294                use std::option::Option::Some;
10295                let mut fields = std::collections::HashSet::new();
10296                let mut result = Self::Value::new();
10297                while let Some(tag) = map.next_key::<__FieldTag>()? {
10298                    #[allow(clippy::match_single_binding)]
10299                    match tag {
10300                        __FieldTag::__private_cloud => {
10301                            if !fields.insert(__FieldTag::__private_cloud) {
10302                                return std::result::Result::Err(A::Error::duplicate_field(
10303                                    "multiple values for private_cloud",
10304                                ));
10305                            }
10306                            result.private_cloud = map
10307                                .next_value::<std::option::Option<std::string::String>>()?
10308                                .unwrap_or_default();
10309                        }
10310                        __FieldTag::__request_id => {
10311                            if !fields.insert(__FieldTag::__request_id) {
10312                                return std::result::Result::Err(A::Error::duplicate_field(
10313                                    "multiple values for request_id",
10314                                ));
10315                            }
10316                            result.request_id = map
10317                                .next_value::<std::option::Option<std::string::String>>()?
10318                                .unwrap_or_default();
10319                        }
10320                        __FieldTag::Unknown(key) => {
10321                            let value = map.next_value::<serde_json::Value>()?;
10322                            result._unknown_fields.insert(key, value);
10323                        }
10324                    }
10325                }
10326                std::result::Result::Ok(result)
10327            }
10328        }
10329        deserializer.deserialize_any(Visitor)
10330    }
10331}
10332
10333#[doc(hidden)]
10334impl serde::ser::Serialize for ResetNsxCredentialsRequest {
10335    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10336    where
10337        S: serde::ser::Serializer,
10338    {
10339        use serde::ser::SerializeMap;
10340        #[allow(unused_imports)]
10341        use std::option::Option::Some;
10342        let mut state = serializer.serialize_map(std::option::Option::None)?;
10343        if !self.private_cloud.is_empty() {
10344            state.serialize_entry("privateCloud", &self.private_cloud)?;
10345        }
10346        if !self.request_id.is_empty() {
10347            state.serialize_entry("requestId", &self.request_id)?;
10348        }
10349        if !self._unknown_fields.is_empty() {
10350            for (key, value) in self._unknown_fields.iter() {
10351                state.serialize_entry(key, &value)?;
10352            }
10353        }
10354        state.end()
10355    }
10356}
10357
10358impl std::fmt::Debug for ResetNsxCredentialsRequest {
10359    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10360        let mut debug_struct = f.debug_struct("ResetNsxCredentialsRequest");
10361        debug_struct.field("private_cloud", &self.private_cloud);
10362        debug_struct.field("request_id", &self.request_id);
10363        if !self._unknown_fields.is_empty() {
10364            debug_struct.field("_unknown_fields", &self._unknown_fields);
10365        }
10366        debug_struct.finish()
10367    }
10368}
10369
10370/// Request message for
10371/// [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]
10372///
10373/// [google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials]: crate::client::VmwareEngine::reset_vcenter_credentials
10374#[derive(Clone, Default, PartialEq)]
10375#[non_exhaustive]
10376pub struct ResetVcenterCredentialsRequest {
10377    /// Required. The resource name of the private cloud
10378    /// to reset credentials for.
10379    /// Resource names are schemeless URIs that follow the conventions in
10380    /// <https://cloud.google.com/apis/design/resource_names>.
10381    /// For example:
10382    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
10383    pub private_cloud: std::string::String,
10384
10385    /// Optional. A request ID to identify requests. Specify a unique request ID
10386    /// so that if you must retry your request, the server will know to ignore
10387    /// the request if it has already been completed. The server guarantees that a
10388    /// request doesn't result in creation of duplicate commitments for at least 60
10389    /// minutes.
10390    ///
10391    /// For example, consider a situation where you make an initial request and the
10392    /// request times out. If you make the request again with the same request
10393    /// ID, the server can check if original operation with the same request ID
10394    /// was received, and if so, will ignore the second request. This prevents
10395    /// clients from accidentally creating duplicate commitments.
10396    ///
10397    /// The request ID must be a valid UUID with the exception that zero UUID is
10398    /// not supported (00000000-0000-0000-0000-000000000000).
10399    pub request_id: std::string::String,
10400
10401    /// Optional. The username of the user to be to reset the credentials.
10402    /// The default value of this field is CloudOwner@gve.local.
10403    /// The provided value should be one of the following:
10404    /// solution-user-01@gve.local,
10405    /// solution-user-02@gve.local,
10406    /// solution-user-03@gve.local,
10407    /// solution-user-04@gve.local,
10408    /// solution-user-05@gve.local,
10409    /// zertoadmin@gve.local.
10410    pub username: std::string::String,
10411
10412    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10413}
10414
10415impl ResetVcenterCredentialsRequest {
10416    pub fn new() -> Self {
10417        std::default::Default::default()
10418    }
10419
10420    /// Sets the value of [private_cloud][crate::model::ResetVcenterCredentialsRequest::private_cloud].
10421    pub fn set_private_cloud<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10422        self.private_cloud = v.into();
10423        self
10424    }
10425
10426    /// Sets the value of [request_id][crate::model::ResetVcenterCredentialsRequest::request_id].
10427    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10428        self.request_id = v.into();
10429        self
10430    }
10431
10432    /// Sets the value of [username][crate::model::ResetVcenterCredentialsRequest::username].
10433    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10434        self.username = v.into();
10435        self
10436    }
10437}
10438
10439impl wkt::message::Message for ResetVcenterCredentialsRequest {
10440    fn typename() -> &'static str {
10441        "type.googleapis.com/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"
10442    }
10443}
10444
10445#[doc(hidden)]
10446impl<'de> serde::de::Deserialize<'de> for ResetVcenterCredentialsRequest {
10447    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10448    where
10449        D: serde::Deserializer<'de>,
10450    {
10451        #[allow(non_camel_case_types)]
10452        #[doc(hidden)]
10453        #[derive(PartialEq, Eq, Hash)]
10454        enum __FieldTag {
10455            __private_cloud,
10456            __request_id,
10457            __username,
10458            Unknown(std::string::String),
10459        }
10460        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10461            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10462            where
10463                D: serde::Deserializer<'de>,
10464            {
10465                struct Visitor;
10466                impl<'de> serde::de::Visitor<'de> for Visitor {
10467                    type Value = __FieldTag;
10468                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10469                        formatter.write_str("a field name for ResetVcenterCredentialsRequest")
10470                    }
10471                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10472                    where
10473                        E: serde::de::Error,
10474                    {
10475                        use std::result::Result::Ok;
10476                        use std::string::ToString;
10477                        match value {
10478                            "privateCloud" => Ok(__FieldTag::__private_cloud),
10479                            "private_cloud" => Ok(__FieldTag::__private_cloud),
10480                            "requestId" => Ok(__FieldTag::__request_id),
10481                            "request_id" => Ok(__FieldTag::__request_id),
10482                            "username" => Ok(__FieldTag::__username),
10483                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10484                        }
10485                    }
10486                }
10487                deserializer.deserialize_identifier(Visitor)
10488            }
10489        }
10490        struct Visitor;
10491        impl<'de> serde::de::Visitor<'de> for Visitor {
10492            type Value = ResetVcenterCredentialsRequest;
10493            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10494                formatter.write_str("struct ResetVcenterCredentialsRequest")
10495            }
10496            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10497            where
10498                A: serde::de::MapAccess<'de>,
10499            {
10500                #[allow(unused_imports)]
10501                use serde::de::Error;
10502                use std::option::Option::Some;
10503                let mut fields = std::collections::HashSet::new();
10504                let mut result = Self::Value::new();
10505                while let Some(tag) = map.next_key::<__FieldTag>()? {
10506                    #[allow(clippy::match_single_binding)]
10507                    match tag {
10508                        __FieldTag::__private_cloud => {
10509                            if !fields.insert(__FieldTag::__private_cloud) {
10510                                return std::result::Result::Err(A::Error::duplicate_field(
10511                                    "multiple values for private_cloud",
10512                                ));
10513                            }
10514                            result.private_cloud = map
10515                                .next_value::<std::option::Option<std::string::String>>()?
10516                                .unwrap_or_default();
10517                        }
10518                        __FieldTag::__request_id => {
10519                            if !fields.insert(__FieldTag::__request_id) {
10520                                return std::result::Result::Err(A::Error::duplicate_field(
10521                                    "multiple values for request_id",
10522                                ));
10523                            }
10524                            result.request_id = map
10525                                .next_value::<std::option::Option<std::string::String>>()?
10526                                .unwrap_or_default();
10527                        }
10528                        __FieldTag::__username => {
10529                            if !fields.insert(__FieldTag::__username) {
10530                                return std::result::Result::Err(A::Error::duplicate_field(
10531                                    "multiple values for username",
10532                                ));
10533                            }
10534                            result.username = map
10535                                .next_value::<std::option::Option<std::string::String>>()?
10536                                .unwrap_or_default();
10537                        }
10538                        __FieldTag::Unknown(key) => {
10539                            let value = map.next_value::<serde_json::Value>()?;
10540                            result._unknown_fields.insert(key, value);
10541                        }
10542                    }
10543                }
10544                std::result::Result::Ok(result)
10545            }
10546        }
10547        deserializer.deserialize_any(Visitor)
10548    }
10549}
10550
10551#[doc(hidden)]
10552impl serde::ser::Serialize for ResetVcenterCredentialsRequest {
10553    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10554    where
10555        S: serde::ser::Serializer,
10556    {
10557        use serde::ser::SerializeMap;
10558        #[allow(unused_imports)]
10559        use std::option::Option::Some;
10560        let mut state = serializer.serialize_map(std::option::Option::None)?;
10561        if !self.private_cloud.is_empty() {
10562            state.serialize_entry("privateCloud", &self.private_cloud)?;
10563        }
10564        if !self.request_id.is_empty() {
10565            state.serialize_entry("requestId", &self.request_id)?;
10566        }
10567        if !self.username.is_empty() {
10568            state.serialize_entry("username", &self.username)?;
10569        }
10570        if !self._unknown_fields.is_empty() {
10571            for (key, value) in self._unknown_fields.iter() {
10572                state.serialize_entry(key, &value)?;
10573            }
10574        }
10575        state.end()
10576    }
10577}
10578
10579impl std::fmt::Debug for ResetVcenterCredentialsRequest {
10580    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10581        let mut debug_struct = f.debug_struct("ResetVcenterCredentialsRequest");
10582        debug_struct.field("private_cloud", &self.private_cloud);
10583        debug_struct.field("request_id", &self.request_id);
10584        debug_struct.field("username", &self.username);
10585        if !self._unknown_fields.is_empty() {
10586            debug_struct.field("_unknown_fields", &self._unknown_fields);
10587        }
10588        debug_struct.finish()
10589    }
10590}
10591
10592/// Response message for
10593/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
10594///
10595/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
10596#[derive(Clone, Default, PartialEq)]
10597#[non_exhaustive]
10598pub struct ListHcxActivationKeysResponse {
10599    /// List of HCX activation keys.
10600    pub hcx_activation_keys: std::vec::Vec<crate::model::HcxActivationKey>,
10601
10602    /// A token, which can be sent as `page_token` to retrieve the next page.
10603    /// If this field is omitted, there are no subsequent pages.
10604    pub next_page_token: std::string::String,
10605
10606    /// Locations that could not be reached when making an aggregated query using
10607    /// wildcards.
10608    pub unreachable: std::vec::Vec<std::string::String>,
10609
10610    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10611}
10612
10613impl ListHcxActivationKeysResponse {
10614    pub fn new() -> Self {
10615        std::default::Default::default()
10616    }
10617
10618    /// Sets the value of [hcx_activation_keys][crate::model::ListHcxActivationKeysResponse::hcx_activation_keys].
10619    pub fn set_hcx_activation_keys<T, V>(mut self, v: T) -> Self
10620    where
10621        T: std::iter::IntoIterator<Item = V>,
10622        V: std::convert::Into<crate::model::HcxActivationKey>,
10623    {
10624        use std::iter::Iterator;
10625        self.hcx_activation_keys = v.into_iter().map(|i| i.into()).collect();
10626        self
10627    }
10628
10629    /// Sets the value of [next_page_token][crate::model::ListHcxActivationKeysResponse::next_page_token].
10630    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10631        self.next_page_token = v.into();
10632        self
10633    }
10634
10635    /// Sets the value of [unreachable][crate::model::ListHcxActivationKeysResponse::unreachable].
10636    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10637    where
10638        T: std::iter::IntoIterator<Item = V>,
10639        V: std::convert::Into<std::string::String>,
10640    {
10641        use std::iter::Iterator;
10642        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10643        self
10644    }
10645}
10646
10647impl wkt::message::Message for ListHcxActivationKeysResponse {
10648    fn typename() -> &'static str {
10649        "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"
10650    }
10651}
10652
10653#[doc(hidden)]
10654impl gax::paginator::internal::PageableResponse for ListHcxActivationKeysResponse {
10655    type PageItem = crate::model::HcxActivationKey;
10656
10657    fn items(self) -> std::vec::Vec<Self::PageItem> {
10658        self.hcx_activation_keys
10659    }
10660
10661    fn next_page_token(&self) -> std::string::String {
10662        use std::clone::Clone;
10663        self.next_page_token.clone()
10664    }
10665}
10666
10667#[doc(hidden)]
10668impl<'de> serde::de::Deserialize<'de> for ListHcxActivationKeysResponse {
10669    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10670    where
10671        D: serde::Deserializer<'de>,
10672    {
10673        #[allow(non_camel_case_types)]
10674        #[doc(hidden)]
10675        #[derive(PartialEq, Eq, Hash)]
10676        enum __FieldTag {
10677            __hcx_activation_keys,
10678            __next_page_token,
10679            __unreachable,
10680            Unknown(std::string::String),
10681        }
10682        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10683            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10684            where
10685                D: serde::Deserializer<'de>,
10686            {
10687                struct Visitor;
10688                impl<'de> serde::de::Visitor<'de> for Visitor {
10689                    type Value = __FieldTag;
10690                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10691                        formatter.write_str("a field name for ListHcxActivationKeysResponse")
10692                    }
10693                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10694                    where
10695                        E: serde::de::Error,
10696                    {
10697                        use std::result::Result::Ok;
10698                        use std::string::ToString;
10699                        match value {
10700                            "hcxActivationKeys" => Ok(__FieldTag::__hcx_activation_keys),
10701                            "hcx_activation_keys" => Ok(__FieldTag::__hcx_activation_keys),
10702                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
10703                            "next_page_token" => Ok(__FieldTag::__next_page_token),
10704                            "unreachable" => Ok(__FieldTag::__unreachable),
10705                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10706                        }
10707                    }
10708                }
10709                deserializer.deserialize_identifier(Visitor)
10710            }
10711        }
10712        struct Visitor;
10713        impl<'de> serde::de::Visitor<'de> for Visitor {
10714            type Value = ListHcxActivationKeysResponse;
10715            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10716                formatter.write_str("struct ListHcxActivationKeysResponse")
10717            }
10718            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10719            where
10720                A: serde::de::MapAccess<'de>,
10721            {
10722                #[allow(unused_imports)]
10723                use serde::de::Error;
10724                use std::option::Option::Some;
10725                let mut fields = std::collections::HashSet::new();
10726                let mut result = Self::Value::new();
10727                while let Some(tag) = map.next_key::<__FieldTag>()? {
10728                    #[allow(clippy::match_single_binding)]
10729                    match tag {
10730                        __FieldTag::__hcx_activation_keys => {
10731                            if !fields.insert(__FieldTag::__hcx_activation_keys) {
10732                                return std::result::Result::Err(A::Error::duplicate_field(
10733                                    "multiple values for hcx_activation_keys",
10734                                ));
10735                            }
10736                            result.hcx_activation_keys =
10737                                map.next_value::<std::option::Option<
10738                                    std::vec::Vec<crate::model::HcxActivationKey>,
10739                                >>()?
10740                                .unwrap_or_default();
10741                        }
10742                        __FieldTag::__next_page_token => {
10743                            if !fields.insert(__FieldTag::__next_page_token) {
10744                                return std::result::Result::Err(A::Error::duplicate_field(
10745                                    "multiple values for next_page_token",
10746                                ));
10747                            }
10748                            result.next_page_token = map
10749                                .next_value::<std::option::Option<std::string::String>>()?
10750                                .unwrap_or_default();
10751                        }
10752                        __FieldTag::__unreachable => {
10753                            if !fields.insert(__FieldTag::__unreachable) {
10754                                return std::result::Result::Err(A::Error::duplicate_field(
10755                                    "multiple values for unreachable",
10756                                ));
10757                            }
10758                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
10759                        }
10760                        __FieldTag::Unknown(key) => {
10761                            let value = map.next_value::<serde_json::Value>()?;
10762                            result._unknown_fields.insert(key, value);
10763                        }
10764                    }
10765                }
10766                std::result::Result::Ok(result)
10767            }
10768        }
10769        deserializer.deserialize_any(Visitor)
10770    }
10771}
10772
10773#[doc(hidden)]
10774impl serde::ser::Serialize for ListHcxActivationKeysResponse {
10775    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10776    where
10777        S: serde::ser::Serializer,
10778    {
10779        use serde::ser::SerializeMap;
10780        #[allow(unused_imports)]
10781        use std::option::Option::Some;
10782        let mut state = serializer.serialize_map(std::option::Option::None)?;
10783        if !self.hcx_activation_keys.is_empty() {
10784            state.serialize_entry("hcxActivationKeys", &self.hcx_activation_keys)?;
10785        }
10786        if !self.next_page_token.is_empty() {
10787            state.serialize_entry("nextPageToken", &self.next_page_token)?;
10788        }
10789        if !self.unreachable.is_empty() {
10790            state.serialize_entry("unreachable", &self.unreachable)?;
10791        }
10792        if !self._unknown_fields.is_empty() {
10793            for (key, value) in self._unknown_fields.iter() {
10794                state.serialize_entry(key, &value)?;
10795            }
10796        }
10797        state.end()
10798    }
10799}
10800
10801impl std::fmt::Debug for ListHcxActivationKeysResponse {
10802    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10803        let mut debug_struct = f.debug_struct("ListHcxActivationKeysResponse");
10804        debug_struct.field("hcx_activation_keys", &self.hcx_activation_keys);
10805        debug_struct.field("next_page_token", &self.next_page_token);
10806        debug_struct.field("unreachable", &self.unreachable);
10807        if !self._unknown_fields.is_empty() {
10808            debug_struct.field("_unknown_fields", &self._unknown_fields);
10809        }
10810        debug_struct.finish()
10811    }
10812}
10813
10814/// Request message for
10815/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
10816///
10817/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
10818#[derive(Clone, Default, PartialEq)]
10819#[non_exhaustive]
10820pub struct ListHcxActivationKeysRequest {
10821    /// Required. The resource name of the private cloud
10822    /// to be queried for HCX activation keys.
10823    /// Resource names are schemeless URIs that follow the conventions in
10824    /// <https://cloud.google.com/apis/design/resource_names>.
10825    /// For example:
10826    /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
10827    pub parent: std::string::String,
10828
10829    /// The maximum number of HCX activation keys to return in one page.
10830    /// The service may return fewer than this value.
10831    /// The maximum value is coerced to 1000.
10832    /// The default value of this field is 500.
10833    pub page_size: i32,
10834
10835    /// A page token, received from a previous `ListHcxActivationKeys` call.
10836    /// Provide this to retrieve the subsequent page.
10837    ///
10838    /// When paginating, all other parameters provided to
10839    /// `ListHcxActivationKeys` must match the call that provided the page
10840    /// token.
10841    pub page_token: std::string::String,
10842
10843    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10844}
10845
10846impl ListHcxActivationKeysRequest {
10847    pub fn new() -> Self {
10848        std::default::Default::default()
10849    }
10850
10851    /// Sets the value of [parent][crate::model::ListHcxActivationKeysRequest::parent].
10852    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10853        self.parent = v.into();
10854        self
10855    }
10856
10857    /// Sets the value of [page_size][crate::model::ListHcxActivationKeysRequest::page_size].
10858    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10859        self.page_size = v.into();
10860        self
10861    }
10862
10863    /// Sets the value of [page_token][crate::model::ListHcxActivationKeysRequest::page_token].
10864    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10865        self.page_token = v.into();
10866        self
10867    }
10868}
10869
10870impl wkt::message::Message for ListHcxActivationKeysRequest {
10871    fn typename() -> &'static str {
10872        "type.googleapis.com/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"
10873    }
10874}
10875
10876#[doc(hidden)]
10877impl<'de> serde::de::Deserialize<'de> for ListHcxActivationKeysRequest {
10878    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10879    where
10880        D: serde::Deserializer<'de>,
10881    {
10882        #[allow(non_camel_case_types)]
10883        #[doc(hidden)]
10884        #[derive(PartialEq, Eq, Hash)]
10885        enum __FieldTag {
10886            __parent,
10887            __page_size,
10888            __page_token,
10889            Unknown(std::string::String),
10890        }
10891        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10892            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10893            where
10894                D: serde::Deserializer<'de>,
10895            {
10896                struct Visitor;
10897                impl<'de> serde::de::Visitor<'de> for Visitor {
10898                    type Value = __FieldTag;
10899                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10900                        formatter.write_str("a field name for ListHcxActivationKeysRequest")
10901                    }
10902                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10903                    where
10904                        E: serde::de::Error,
10905                    {
10906                        use std::result::Result::Ok;
10907                        use std::string::ToString;
10908                        match value {
10909                            "parent" => Ok(__FieldTag::__parent),
10910                            "pageSize" => Ok(__FieldTag::__page_size),
10911                            "page_size" => Ok(__FieldTag::__page_size),
10912                            "pageToken" => Ok(__FieldTag::__page_token),
10913                            "page_token" => Ok(__FieldTag::__page_token),
10914                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10915                        }
10916                    }
10917                }
10918                deserializer.deserialize_identifier(Visitor)
10919            }
10920        }
10921        struct Visitor;
10922        impl<'de> serde::de::Visitor<'de> for Visitor {
10923            type Value = ListHcxActivationKeysRequest;
10924            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10925                formatter.write_str("struct ListHcxActivationKeysRequest")
10926            }
10927            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10928            where
10929                A: serde::de::MapAccess<'de>,
10930            {
10931                #[allow(unused_imports)]
10932                use serde::de::Error;
10933                use std::option::Option::Some;
10934                let mut fields = std::collections::HashSet::new();
10935                let mut result = Self::Value::new();
10936                while let Some(tag) = map.next_key::<__FieldTag>()? {
10937                    #[allow(clippy::match_single_binding)]
10938                    match tag {
10939                        __FieldTag::__parent => {
10940                            if !fields.insert(__FieldTag::__parent) {
10941                                return std::result::Result::Err(A::Error::duplicate_field(
10942                                    "multiple values for parent",
10943                                ));
10944                            }
10945                            result.parent = map
10946                                .next_value::<std::option::Option<std::string::String>>()?
10947                                .unwrap_or_default();
10948                        }
10949                        __FieldTag::__page_size => {
10950                            if !fields.insert(__FieldTag::__page_size) {
10951                                return std::result::Result::Err(A::Error::duplicate_field(
10952                                    "multiple values for page_size",
10953                                ));
10954                            }
10955                            struct __With(std::option::Option<i32>);
10956                            impl<'de> serde::de::Deserialize<'de> for __With {
10957                                fn deserialize<D>(
10958                                    deserializer: D,
10959                                ) -> std::result::Result<Self, D::Error>
10960                                where
10961                                    D: serde::de::Deserializer<'de>,
10962                                {
10963                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10964                                }
10965                            }
10966                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
10967                        }
10968                        __FieldTag::__page_token => {
10969                            if !fields.insert(__FieldTag::__page_token) {
10970                                return std::result::Result::Err(A::Error::duplicate_field(
10971                                    "multiple values for page_token",
10972                                ));
10973                            }
10974                            result.page_token = map
10975                                .next_value::<std::option::Option<std::string::String>>()?
10976                                .unwrap_or_default();
10977                        }
10978                        __FieldTag::Unknown(key) => {
10979                            let value = map.next_value::<serde_json::Value>()?;
10980                            result._unknown_fields.insert(key, value);
10981                        }
10982                    }
10983                }
10984                std::result::Result::Ok(result)
10985            }
10986        }
10987        deserializer.deserialize_any(Visitor)
10988    }
10989}
10990
10991#[doc(hidden)]
10992impl serde::ser::Serialize for ListHcxActivationKeysRequest {
10993    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10994    where
10995        S: serde::ser::Serializer,
10996    {
10997        use serde::ser::SerializeMap;
10998        #[allow(unused_imports)]
10999        use std::option::Option::Some;
11000        let mut state = serializer.serialize_map(std::option::Option::None)?;
11001        if !self.parent.is_empty() {
11002            state.serialize_entry("parent", &self.parent)?;
11003        }
11004        if !wkt::internal::is_default(&self.page_size) {
11005            struct __With<'a>(&'a i32);
11006            impl<'a> serde::ser::Serialize for __With<'a> {
11007                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11008                where
11009                    S: serde::ser::Serializer,
11010                {
11011                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11012                }
11013            }
11014            state.serialize_entry("pageSize", &__With(&self.page_size))?;
11015        }
11016        if !self.page_token.is_empty() {
11017            state.serialize_entry("pageToken", &self.page_token)?;
11018        }
11019        if !self._unknown_fields.is_empty() {
11020            for (key, value) in self._unknown_fields.iter() {
11021                state.serialize_entry(key, &value)?;
11022            }
11023        }
11024        state.end()
11025    }
11026}
11027
11028impl std::fmt::Debug for ListHcxActivationKeysRequest {
11029    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11030        let mut debug_struct = f.debug_struct("ListHcxActivationKeysRequest");
11031        debug_struct.field("parent", &self.parent);
11032        debug_struct.field("page_size", &self.page_size);
11033        debug_struct.field("page_token", &self.page_token);
11034        if !self._unknown_fields.is_empty() {
11035            debug_struct.field("_unknown_fields", &self._unknown_fields);
11036        }
11037        debug_struct.finish()
11038    }
11039}
11040
11041/// Request message for [VmwareEngine.GetHcxActivationKeys][]
11042#[derive(Clone, Default, PartialEq)]
11043#[non_exhaustive]
11044pub struct GetHcxActivationKeyRequest {
11045    /// Required. The resource name of the HCX activation key to retrieve.
11046    /// Resource names are schemeless URIs that follow the conventions in
11047    /// <https://cloud.google.com/apis/design/resource_names>.
11048    /// For example:
11049    /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
11050    pub name: std::string::String,
11051
11052    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11053}
11054
11055impl GetHcxActivationKeyRequest {
11056    pub fn new() -> Self {
11057        std::default::Default::default()
11058    }
11059
11060    /// Sets the value of [name][crate::model::GetHcxActivationKeyRequest::name].
11061    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11062        self.name = v.into();
11063        self
11064    }
11065}
11066
11067impl wkt::message::Message for GetHcxActivationKeyRequest {
11068    fn typename() -> &'static str {
11069        "type.googleapis.com/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"
11070    }
11071}
11072
11073#[doc(hidden)]
11074impl<'de> serde::de::Deserialize<'de> for GetHcxActivationKeyRequest {
11075    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11076    where
11077        D: serde::Deserializer<'de>,
11078    {
11079        #[allow(non_camel_case_types)]
11080        #[doc(hidden)]
11081        #[derive(PartialEq, Eq, Hash)]
11082        enum __FieldTag {
11083            __name,
11084            Unknown(std::string::String),
11085        }
11086        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11087            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11088            where
11089                D: serde::Deserializer<'de>,
11090            {
11091                struct Visitor;
11092                impl<'de> serde::de::Visitor<'de> for Visitor {
11093                    type Value = __FieldTag;
11094                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11095                        formatter.write_str("a field name for GetHcxActivationKeyRequest")
11096                    }
11097                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11098                    where
11099                        E: serde::de::Error,
11100                    {
11101                        use std::result::Result::Ok;
11102                        use std::string::ToString;
11103                        match value {
11104                            "name" => Ok(__FieldTag::__name),
11105                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11106                        }
11107                    }
11108                }
11109                deserializer.deserialize_identifier(Visitor)
11110            }
11111        }
11112        struct Visitor;
11113        impl<'de> serde::de::Visitor<'de> for Visitor {
11114            type Value = GetHcxActivationKeyRequest;
11115            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11116                formatter.write_str("struct GetHcxActivationKeyRequest")
11117            }
11118            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11119            where
11120                A: serde::de::MapAccess<'de>,
11121            {
11122                #[allow(unused_imports)]
11123                use serde::de::Error;
11124                use std::option::Option::Some;
11125                let mut fields = std::collections::HashSet::new();
11126                let mut result = Self::Value::new();
11127                while let Some(tag) = map.next_key::<__FieldTag>()? {
11128                    #[allow(clippy::match_single_binding)]
11129                    match tag {
11130                        __FieldTag::__name => {
11131                            if !fields.insert(__FieldTag::__name) {
11132                                return std::result::Result::Err(A::Error::duplicate_field(
11133                                    "multiple values for name",
11134                                ));
11135                            }
11136                            result.name = map
11137                                .next_value::<std::option::Option<std::string::String>>()?
11138                                .unwrap_or_default();
11139                        }
11140                        __FieldTag::Unknown(key) => {
11141                            let value = map.next_value::<serde_json::Value>()?;
11142                            result._unknown_fields.insert(key, value);
11143                        }
11144                    }
11145                }
11146                std::result::Result::Ok(result)
11147            }
11148        }
11149        deserializer.deserialize_any(Visitor)
11150    }
11151}
11152
11153#[doc(hidden)]
11154impl serde::ser::Serialize for GetHcxActivationKeyRequest {
11155    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11156    where
11157        S: serde::ser::Serializer,
11158    {
11159        use serde::ser::SerializeMap;
11160        #[allow(unused_imports)]
11161        use std::option::Option::Some;
11162        let mut state = serializer.serialize_map(std::option::Option::None)?;
11163        if !self.name.is_empty() {
11164            state.serialize_entry("name", &self.name)?;
11165        }
11166        if !self._unknown_fields.is_empty() {
11167            for (key, value) in self._unknown_fields.iter() {
11168                state.serialize_entry(key, &value)?;
11169            }
11170        }
11171        state.end()
11172    }
11173}
11174
11175impl std::fmt::Debug for GetHcxActivationKeyRequest {
11176    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11177        let mut debug_struct = f.debug_struct("GetHcxActivationKeyRequest");
11178        debug_struct.field("name", &self.name);
11179        if !self._unknown_fields.is_empty() {
11180            debug_struct.field("_unknown_fields", &self._unknown_fields);
11181        }
11182        debug_struct.finish()
11183    }
11184}
11185
11186/// Request message for
11187/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
11188///
11189/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
11190#[derive(Clone, Default, PartialEq)]
11191#[non_exhaustive]
11192pub struct CreateHcxActivationKeyRequest {
11193    /// Required. The resource name of the private cloud to create the key for.
11194    /// Resource names are schemeless URIs that follow the conventions in
11195    /// <https://cloud.google.com/apis/design/resource_names>.
11196    /// For example:
11197    /// `projects/my-project/locations/us-central1/privateClouds/my-cloud`
11198    pub parent: std::string::String,
11199
11200    /// Required. The initial description of a new HCX activation key. When
11201    /// creating a new key, this field must be an empty object.
11202    pub hcx_activation_key: std::option::Option<crate::model::HcxActivationKey>,
11203
11204    /// Required. The user-provided identifier of the `HcxActivationKey` to be
11205    /// created. This identifier must be unique among `HcxActivationKey` resources
11206    /// within the parent and becomes the final token in the name URI.
11207    /// The identifier must meet the following requirements:
11208    ///
11209    /// * Only contains 1-63 alphanumeric characters and hyphens
11210    /// * Begins with an alphabetical character
11211    /// * Ends with a non-hyphen character
11212    /// * Not formatted as a UUID
11213    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
11214    ///   (section 3.5)
11215    pub hcx_activation_key_id: std::string::String,
11216
11217    /// A request ID to identify requests. Specify a unique request ID
11218    /// so that if you must retry your request, the server will know to ignore
11219    /// the request if it has already been completed. The server guarantees that a
11220    /// request doesn't result in creation of duplicate commitments for at least 60
11221    /// minutes.
11222    ///
11223    /// For example, consider a situation where you make an initial request and the
11224    /// request times out. If you make the request again with the same request ID,
11225    /// the server can check if original operation with the same request ID was
11226    /// received, and if so, will ignore the second request. This prevents clients
11227    /// from accidentally creating duplicate commitments.
11228    ///
11229    /// The request ID must be a valid UUID with the exception that zero UUID is
11230    /// not supported (00000000-0000-0000-0000-000000000000).
11231    pub request_id: std::string::String,
11232
11233    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11234}
11235
11236impl CreateHcxActivationKeyRequest {
11237    pub fn new() -> Self {
11238        std::default::Default::default()
11239    }
11240
11241    /// Sets the value of [parent][crate::model::CreateHcxActivationKeyRequest::parent].
11242    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11243        self.parent = v.into();
11244        self
11245    }
11246
11247    /// Sets the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
11248    pub fn set_hcx_activation_key<T>(mut self, v: T) -> Self
11249    where
11250        T: std::convert::Into<crate::model::HcxActivationKey>,
11251    {
11252        self.hcx_activation_key = std::option::Option::Some(v.into());
11253        self
11254    }
11255
11256    /// Sets or clears the value of [hcx_activation_key][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key].
11257    pub fn set_or_clear_hcx_activation_key<T>(mut self, v: std::option::Option<T>) -> Self
11258    where
11259        T: std::convert::Into<crate::model::HcxActivationKey>,
11260    {
11261        self.hcx_activation_key = v.map(|x| x.into());
11262        self
11263    }
11264
11265    /// Sets the value of [hcx_activation_key_id][crate::model::CreateHcxActivationKeyRequest::hcx_activation_key_id].
11266    pub fn set_hcx_activation_key_id<T: std::convert::Into<std::string::String>>(
11267        mut self,
11268        v: T,
11269    ) -> Self {
11270        self.hcx_activation_key_id = v.into();
11271        self
11272    }
11273
11274    /// Sets the value of [request_id][crate::model::CreateHcxActivationKeyRequest::request_id].
11275    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11276        self.request_id = v.into();
11277        self
11278    }
11279}
11280
11281impl wkt::message::Message for CreateHcxActivationKeyRequest {
11282    fn typename() -> &'static str {
11283        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"
11284    }
11285}
11286
11287#[doc(hidden)]
11288impl<'de> serde::de::Deserialize<'de> for CreateHcxActivationKeyRequest {
11289    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11290    where
11291        D: serde::Deserializer<'de>,
11292    {
11293        #[allow(non_camel_case_types)]
11294        #[doc(hidden)]
11295        #[derive(PartialEq, Eq, Hash)]
11296        enum __FieldTag {
11297            __parent,
11298            __hcx_activation_key,
11299            __hcx_activation_key_id,
11300            __request_id,
11301            Unknown(std::string::String),
11302        }
11303        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11304            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11305            where
11306                D: serde::Deserializer<'de>,
11307            {
11308                struct Visitor;
11309                impl<'de> serde::de::Visitor<'de> for Visitor {
11310                    type Value = __FieldTag;
11311                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11312                        formatter.write_str("a field name for CreateHcxActivationKeyRequest")
11313                    }
11314                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11315                    where
11316                        E: serde::de::Error,
11317                    {
11318                        use std::result::Result::Ok;
11319                        use std::string::ToString;
11320                        match value {
11321                            "parent" => Ok(__FieldTag::__parent),
11322                            "hcxActivationKey" => Ok(__FieldTag::__hcx_activation_key),
11323                            "hcx_activation_key" => Ok(__FieldTag::__hcx_activation_key),
11324                            "hcxActivationKeyId" => Ok(__FieldTag::__hcx_activation_key_id),
11325                            "hcx_activation_key_id" => Ok(__FieldTag::__hcx_activation_key_id),
11326                            "requestId" => Ok(__FieldTag::__request_id),
11327                            "request_id" => Ok(__FieldTag::__request_id),
11328                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11329                        }
11330                    }
11331                }
11332                deserializer.deserialize_identifier(Visitor)
11333            }
11334        }
11335        struct Visitor;
11336        impl<'de> serde::de::Visitor<'de> for Visitor {
11337            type Value = CreateHcxActivationKeyRequest;
11338            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11339                formatter.write_str("struct CreateHcxActivationKeyRequest")
11340            }
11341            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11342            where
11343                A: serde::de::MapAccess<'de>,
11344            {
11345                #[allow(unused_imports)]
11346                use serde::de::Error;
11347                use std::option::Option::Some;
11348                let mut fields = std::collections::HashSet::new();
11349                let mut result = Self::Value::new();
11350                while let Some(tag) = map.next_key::<__FieldTag>()? {
11351                    #[allow(clippy::match_single_binding)]
11352                    match tag {
11353                        __FieldTag::__parent => {
11354                            if !fields.insert(__FieldTag::__parent) {
11355                                return std::result::Result::Err(A::Error::duplicate_field(
11356                                    "multiple values for parent",
11357                                ));
11358                            }
11359                            result.parent = map
11360                                .next_value::<std::option::Option<std::string::String>>()?
11361                                .unwrap_or_default();
11362                        }
11363                        __FieldTag::__hcx_activation_key => {
11364                            if !fields.insert(__FieldTag::__hcx_activation_key) {
11365                                return std::result::Result::Err(A::Error::duplicate_field(
11366                                    "multiple values for hcx_activation_key",
11367                                ));
11368                            }
11369                            result.hcx_activation_key = map
11370                                .next_value::<std::option::Option<crate::model::HcxActivationKey>>(
11371                                )?;
11372                        }
11373                        __FieldTag::__hcx_activation_key_id => {
11374                            if !fields.insert(__FieldTag::__hcx_activation_key_id) {
11375                                return std::result::Result::Err(A::Error::duplicate_field(
11376                                    "multiple values for hcx_activation_key_id",
11377                                ));
11378                            }
11379                            result.hcx_activation_key_id = map
11380                                .next_value::<std::option::Option<std::string::String>>()?
11381                                .unwrap_or_default();
11382                        }
11383                        __FieldTag::__request_id => {
11384                            if !fields.insert(__FieldTag::__request_id) {
11385                                return std::result::Result::Err(A::Error::duplicate_field(
11386                                    "multiple values for request_id",
11387                                ));
11388                            }
11389                            result.request_id = map
11390                                .next_value::<std::option::Option<std::string::String>>()?
11391                                .unwrap_or_default();
11392                        }
11393                        __FieldTag::Unknown(key) => {
11394                            let value = map.next_value::<serde_json::Value>()?;
11395                            result._unknown_fields.insert(key, value);
11396                        }
11397                    }
11398                }
11399                std::result::Result::Ok(result)
11400            }
11401        }
11402        deserializer.deserialize_any(Visitor)
11403    }
11404}
11405
11406#[doc(hidden)]
11407impl serde::ser::Serialize for CreateHcxActivationKeyRequest {
11408    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11409    where
11410        S: serde::ser::Serializer,
11411    {
11412        use serde::ser::SerializeMap;
11413        #[allow(unused_imports)]
11414        use std::option::Option::Some;
11415        let mut state = serializer.serialize_map(std::option::Option::None)?;
11416        if !self.parent.is_empty() {
11417            state.serialize_entry("parent", &self.parent)?;
11418        }
11419        if self.hcx_activation_key.is_some() {
11420            state.serialize_entry("hcxActivationKey", &self.hcx_activation_key)?;
11421        }
11422        if !self.hcx_activation_key_id.is_empty() {
11423            state.serialize_entry("hcxActivationKeyId", &self.hcx_activation_key_id)?;
11424        }
11425        if !self.request_id.is_empty() {
11426            state.serialize_entry("requestId", &self.request_id)?;
11427        }
11428        if !self._unknown_fields.is_empty() {
11429            for (key, value) in self._unknown_fields.iter() {
11430                state.serialize_entry(key, &value)?;
11431            }
11432        }
11433        state.end()
11434    }
11435}
11436
11437impl std::fmt::Debug for CreateHcxActivationKeyRequest {
11438    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11439        let mut debug_struct = f.debug_struct("CreateHcxActivationKeyRequest");
11440        debug_struct.field("parent", &self.parent);
11441        debug_struct.field("hcx_activation_key", &self.hcx_activation_key);
11442        debug_struct.field("hcx_activation_key_id", &self.hcx_activation_key_id);
11443        debug_struct.field("request_id", &self.request_id);
11444        if !self._unknown_fields.is_empty() {
11445            debug_struct.field("_unknown_fields", &self._unknown_fields);
11446        }
11447        debug_struct.finish()
11448    }
11449}
11450
11451/// Request message for
11452/// [VmwareEngine.GetDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]
11453///
11454/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding]: crate::client::VmwareEngine::get_dns_forwarding
11455#[derive(Clone, Default, PartialEq)]
11456#[non_exhaustive]
11457pub struct GetDnsForwardingRequest {
11458    /// Required. The resource name of a `DnsForwarding` to retrieve.
11459    /// Resource names are schemeless URIs that follow the conventions in
11460    /// <https://cloud.google.com/apis/design/resource_names>.
11461    /// For example:
11462    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
11463    pub name: std::string::String,
11464
11465    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11466}
11467
11468impl GetDnsForwardingRequest {
11469    pub fn new() -> Self {
11470        std::default::Default::default()
11471    }
11472
11473    /// Sets the value of [name][crate::model::GetDnsForwardingRequest::name].
11474    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11475        self.name = v.into();
11476        self
11477    }
11478}
11479
11480impl wkt::message::Message for GetDnsForwardingRequest {
11481    fn typename() -> &'static str {
11482        "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsForwardingRequest"
11483    }
11484}
11485
11486#[doc(hidden)]
11487impl<'de> serde::de::Deserialize<'de> for GetDnsForwardingRequest {
11488    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11489    where
11490        D: serde::Deserializer<'de>,
11491    {
11492        #[allow(non_camel_case_types)]
11493        #[doc(hidden)]
11494        #[derive(PartialEq, Eq, Hash)]
11495        enum __FieldTag {
11496            __name,
11497            Unknown(std::string::String),
11498        }
11499        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11500            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11501            where
11502                D: serde::Deserializer<'de>,
11503            {
11504                struct Visitor;
11505                impl<'de> serde::de::Visitor<'de> for Visitor {
11506                    type Value = __FieldTag;
11507                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11508                        formatter.write_str("a field name for GetDnsForwardingRequest")
11509                    }
11510                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11511                    where
11512                        E: serde::de::Error,
11513                    {
11514                        use std::result::Result::Ok;
11515                        use std::string::ToString;
11516                        match value {
11517                            "name" => Ok(__FieldTag::__name),
11518                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11519                        }
11520                    }
11521                }
11522                deserializer.deserialize_identifier(Visitor)
11523            }
11524        }
11525        struct Visitor;
11526        impl<'de> serde::de::Visitor<'de> for Visitor {
11527            type Value = GetDnsForwardingRequest;
11528            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11529                formatter.write_str("struct GetDnsForwardingRequest")
11530            }
11531            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11532            where
11533                A: serde::de::MapAccess<'de>,
11534            {
11535                #[allow(unused_imports)]
11536                use serde::de::Error;
11537                use std::option::Option::Some;
11538                let mut fields = std::collections::HashSet::new();
11539                let mut result = Self::Value::new();
11540                while let Some(tag) = map.next_key::<__FieldTag>()? {
11541                    #[allow(clippy::match_single_binding)]
11542                    match tag {
11543                        __FieldTag::__name => {
11544                            if !fields.insert(__FieldTag::__name) {
11545                                return std::result::Result::Err(A::Error::duplicate_field(
11546                                    "multiple values for name",
11547                                ));
11548                            }
11549                            result.name = map
11550                                .next_value::<std::option::Option<std::string::String>>()?
11551                                .unwrap_or_default();
11552                        }
11553                        __FieldTag::Unknown(key) => {
11554                            let value = map.next_value::<serde_json::Value>()?;
11555                            result._unknown_fields.insert(key, value);
11556                        }
11557                    }
11558                }
11559                std::result::Result::Ok(result)
11560            }
11561        }
11562        deserializer.deserialize_any(Visitor)
11563    }
11564}
11565
11566#[doc(hidden)]
11567impl serde::ser::Serialize for GetDnsForwardingRequest {
11568    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11569    where
11570        S: serde::ser::Serializer,
11571    {
11572        use serde::ser::SerializeMap;
11573        #[allow(unused_imports)]
11574        use std::option::Option::Some;
11575        let mut state = serializer.serialize_map(std::option::Option::None)?;
11576        if !self.name.is_empty() {
11577            state.serialize_entry("name", &self.name)?;
11578        }
11579        if !self._unknown_fields.is_empty() {
11580            for (key, value) in self._unknown_fields.iter() {
11581                state.serialize_entry(key, &value)?;
11582            }
11583        }
11584        state.end()
11585    }
11586}
11587
11588impl std::fmt::Debug for GetDnsForwardingRequest {
11589    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11590        let mut debug_struct = f.debug_struct("GetDnsForwardingRequest");
11591        debug_struct.field("name", &self.name);
11592        if !self._unknown_fields.is_empty() {
11593            debug_struct.field("_unknown_fields", &self._unknown_fields);
11594        }
11595        debug_struct.finish()
11596    }
11597}
11598
11599/// Request message for
11600/// [VmwareEngine.UpdateDnsForwarding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]
11601///
11602/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding]: crate::client::VmwareEngine::update_dns_forwarding
11603#[derive(Clone, Default, PartialEq)]
11604#[non_exhaustive]
11605pub struct UpdateDnsForwardingRequest {
11606    /// Required. DnsForwarding config details.
11607    pub dns_forwarding: std::option::Option<crate::model::DnsForwarding>,
11608
11609    /// Required. Field mask is used to specify the fields to be overwritten in the
11610    /// `DnsForwarding` resource by the update.
11611    /// The fields specified in the `update_mask` are relative to the resource, not
11612    /// the full request. A field will be overwritten if it is in the mask. If the
11613    /// user does not provide a mask then all fields will be overwritten.
11614    pub update_mask: std::option::Option<wkt::FieldMask>,
11615
11616    /// Optional. A request ID to identify requests. Specify a unique request ID
11617    /// so that if you must retry your request, the server will know to ignore
11618    /// the request if it has already been completed. The server guarantees that a
11619    /// request doesn't result in creation of duplicate commitments for at least 60
11620    /// minutes.
11621    ///
11622    /// For example, consider a situation where you make an initial request and the
11623    /// request times out. If you make the request again with the same request ID,
11624    /// the server can check if original operation with the same request ID was
11625    /// received, and if so, will ignore the second request. This prevents clients
11626    /// from accidentally creating duplicate commitments.
11627    ///
11628    /// The request ID must be a valid UUID with the exception that zero UUID is
11629    /// not supported (00000000-0000-0000-0000-000000000000).
11630    pub request_id: std::string::String,
11631
11632    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11633}
11634
11635impl UpdateDnsForwardingRequest {
11636    pub fn new() -> Self {
11637        std::default::Default::default()
11638    }
11639
11640    /// Sets the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
11641    pub fn set_dns_forwarding<T>(mut self, v: T) -> Self
11642    where
11643        T: std::convert::Into<crate::model::DnsForwarding>,
11644    {
11645        self.dns_forwarding = std::option::Option::Some(v.into());
11646        self
11647    }
11648
11649    /// Sets or clears the value of [dns_forwarding][crate::model::UpdateDnsForwardingRequest::dns_forwarding].
11650    pub fn set_or_clear_dns_forwarding<T>(mut self, v: std::option::Option<T>) -> Self
11651    where
11652        T: std::convert::Into<crate::model::DnsForwarding>,
11653    {
11654        self.dns_forwarding = v.map(|x| x.into());
11655        self
11656    }
11657
11658    /// Sets the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
11659    pub fn set_update_mask<T>(mut self, v: T) -> Self
11660    where
11661        T: std::convert::Into<wkt::FieldMask>,
11662    {
11663        self.update_mask = std::option::Option::Some(v.into());
11664        self
11665    }
11666
11667    /// Sets or clears the value of [update_mask][crate::model::UpdateDnsForwardingRequest::update_mask].
11668    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11669    where
11670        T: std::convert::Into<wkt::FieldMask>,
11671    {
11672        self.update_mask = v.map(|x| x.into());
11673        self
11674    }
11675
11676    /// Sets the value of [request_id][crate::model::UpdateDnsForwardingRequest::request_id].
11677    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11678        self.request_id = v.into();
11679        self
11680    }
11681}
11682
11683impl wkt::message::Message for UpdateDnsForwardingRequest {
11684    fn typename() -> &'static str {
11685        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest"
11686    }
11687}
11688
11689#[doc(hidden)]
11690impl<'de> serde::de::Deserialize<'de> for UpdateDnsForwardingRequest {
11691    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11692    where
11693        D: serde::Deserializer<'de>,
11694    {
11695        #[allow(non_camel_case_types)]
11696        #[doc(hidden)]
11697        #[derive(PartialEq, Eq, Hash)]
11698        enum __FieldTag {
11699            __dns_forwarding,
11700            __update_mask,
11701            __request_id,
11702            Unknown(std::string::String),
11703        }
11704        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11705            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11706            where
11707                D: serde::Deserializer<'de>,
11708            {
11709                struct Visitor;
11710                impl<'de> serde::de::Visitor<'de> for Visitor {
11711                    type Value = __FieldTag;
11712                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11713                        formatter.write_str("a field name for UpdateDnsForwardingRequest")
11714                    }
11715                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11716                    where
11717                        E: serde::de::Error,
11718                    {
11719                        use std::result::Result::Ok;
11720                        use std::string::ToString;
11721                        match value {
11722                            "dnsForwarding" => Ok(__FieldTag::__dns_forwarding),
11723                            "dns_forwarding" => Ok(__FieldTag::__dns_forwarding),
11724                            "updateMask" => Ok(__FieldTag::__update_mask),
11725                            "update_mask" => Ok(__FieldTag::__update_mask),
11726                            "requestId" => Ok(__FieldTag::__request_id),
11727                            "request_id" => Ok(__FieldTag::__request_id),
11728                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11729                        }
11730                    }
11731                }
11732                deserializer.deserialize_identifier(Visitor)
11733            }
11734        }
11735        struct Visitor;
11736        impl<'de> serde::de::Visitor<'de> for Visitor {
11737            type Value = UpdateDnsForwardingRequest;
11738            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11739                formatter.write_str("struct UpdateDnsForwardingRequest")
11740            }
11741            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11742            where
11743                A: serde::de::MapAccess<'de>,
11744            {
11745                #[allow(unused_imports)]
11746                use serde::de::Error;
11747                use std::option::Option::Some;
11748                let mut fields = std::collections::HashSet::new();
11749                let mut result = Self::Value::new();
11750                while let Some(tag) = map.next_key::<__FieldTag>()? {
11751                    #[allow(clippy::match_single_binding)]
11752                    match tag {
11753                        __FieldTag::__dns_forwarding => {
11754                            if !fields.insert(__FieldTag::__dns_forwarding) {
11755                                return std::result::Result::Err(A::Error::duplicate_field(
11756                                    "multiple values for dns_forwarding",
11757                                ));
11758                            }
11759                            result.dns_forwarding = map
11760                                .next_value::<std::option::Option<crate::model::DnsForwarding>>()?;
11761                        }
11762                        __FieldTag::__update_mask => {
11763                            if !fields.insert(__FieldTag::__update_mask) {
11764                                return std::result::Result::Err(A::Error::duplicate_field(
11765                                    "multiple values for update_mask",
11766                                ));
11767                            }
11768                            result.update_mask =
11769                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
11770                        }
11771                        __FieldTag::__request_id => {
11772                            if !fields.insert(__FieldTag::__request_id) {
11773                                return std::result::Result::Err(A::Error::duplicate_field(
11774                                    "multiple values for request_id",
11775                                ));
11776                            }
11777                            result.request_id = map
11778                                .next_value::<std::option::Option<std::string::String>>()?
11779                                .unwrap_or_default();
11780                        }
11781                        __FieldTag::Unknown(key) => {
11782                            let value = map.next_value::<serde_json::Value>()?;
11783                            result._unknown_fields.insert(key, value);
11784                        }
11785                    }
11786                }
11787                std::result::Result::Ok(result)
11788            }
11789        }
11790        deserializer.deserialize_any(Visitor)
11791    }
11792}
11793
11794#[doc(hidden)]
11795impl serde::ser::Serialize for UpdateDnsForwardingRequest {
11796    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11797    where
11798        S: serde::ser::Serializer,
11799    {
11800        use serde::ser::SerializeMap;
11801        #[allow(unused_imports)]
11802        use std::option::Option::Some;
11803        let mut state = serializer.serialize_map(std::option::Option::None)?;
11804        if self.dns_forwarding.is_some() {
11805            state.serialize_entry("dnsForwarding", &self.dns_forwarding)?;
11806        }
11807        if self.update_mask.is_some() {
11808            state.serialize_entry("updateMask", &self.update_mask)?;
11809        }
11810        if !self.request_id.is_empty() {
11811            state.serialize_entry("requestId", &self.request_id)?;
11812        }
11813        if !self._unknown_fields.is_empty() {
11814            for (key, value) in self._unknown_fields.iter() {
11815                state.serialize_entry(key, &value)?;
11816            }
11817        }
11818        state.end()
11819    }
11820}
11821
11822impl std::fmt::Debug for UpdateDnsForwardingRequest {
11823    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11824        let mut debug_struct = f.debug_struct("UpdateDnsForwardingRequest");
11825        debug_struct.field("dns_forwarding", &self.dns_forwarding);
11826        debug_struct.field("update_mask", &self.update_mask);
11827        debug_struct.field("request_id", &self.request_id);
11828        if !self._unknown_fields.is_empty() {
11829            debug_struct.field("_unknown_fields", &self._unknown_fields);
11830        }
11831        debug_struct.finish()
11832    }
11833}
11834
11835/// Request message for
11836/// [VmwareEngine.CreateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]
11837///
11838/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering]: crate::client::VmwareEngine::create_network_peering
11839#[derive(Clone, Default, PartialEq)]
11840#[non_exhaustive]
11841pub struct CreateNetworkPeeringRequest {
11842    /// Required. The resource name of the location to create the new network
11843    /// peering in. This value is always `global`, because `NetworkPeering` is a
11844    /// global resource. Resource names are schemeless URIs that follow the
11845    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
11846    /// example: `projects/my-project/locations/global`
11847    pub parent: std::string::String,
11848
11849    /// Required. The user-provided identifier of the new `NetworkPeering`.
11850    /// This identifier must be unique among `NetworkPeering` resources within the
11851    /// parent and becomes the final token in the name URI.
11852    /// The identifier must meet the following requirements:
11853    ///
11854    /// * Only contains 1-63 alphanumeric characters and hyphens
11855    /// * Begins with an alphabetical character
11856    /// * Ends with a non-hyphen character
11857    /// * Not formatted as a UUID
11858    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
11859    ///   (section 3.5)
11860    pub network_peering_id: std::string::String,
11861
11862    /// Required. The initial description of the new network peering.
11863    pub network_peering: std::option::Option<crate::model::NetworkPeering>,
11864
11865    /// Optional. A request ID to identify requests. Specify a unique request ID
11866    /// so that if you must retry your request, the server will know to ignore
11867    /// the request if it has already been completed. The server guarantees that a
11868    /// request doesn't result in creation of duplicate commitments for at least 60
11869    /// minutes.
11870    ///
11871    /// For example, consider a situation where you make an initial request and the
11872    /// request times out. If you make the request again with the same request
11873    /// ID, the server can check if original operation with the same request ID
11874    /// was received, and if so, will ignore the second request. This prevents
11875    /// clients from accidentally creating duplicate commitments.
11876    ///
11877    /// The request ID must be a valid UUID with the exception that zero UUID is
11878    /// not supported (00000000-0000-0000-0000-000000000000).
11879    pub request_id: std::string::String,
11880
11881    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11882}
11883
11884impl CreateNetworkPeeringRequest {
11885    pub fn new() -> Self {
11886        std::default::Default::default()
11887    }
11888
11889    /// Sets the value of [parent][crate::model::CreateNetworkPeeringRequest::parent].
11890    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11891        self.parent = v.into();
11892        self
11893    }
11894
11895    /// Sets the value of [network_peering_id][crate::model::CreateNetworkPeeringRequest::network_peering_id].
11896    pub fn set_network_peering_id<T: std::convert::Into<std::string::String>>(
11897        mut self,
11898        v: T,
11899    ) -> Self {
11900        self.network_peering_id = v.into();
11901        self
11902    }
11903
11904    /// Sets the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
11905    pub fn set_network_peering<T>(mut self, v: T) -> Self
11906    where
11907        T: std::convert::Into<crate::model::NetworkPeering>,
11908    {
11909        self.network_peering = std::option::Option::Some(v.into());
11910        self
11911    }
11912
11913    /// Sets or clears the value of [network_peering][crate::model::CreateNetworkPeeringRequest::network_peering].
11914    pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
11915    where
11916        T: std::convert::Into<crate::model::NetworkPeering>,
11917    {
11918        self.network_peering = v.map(|x| x.into());
11919        self
11920    }
11921
11922    /// Sets the value of [request_id][crate::model::CreateNetworkPeeringRequest::request_id].
11923    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11924        self.request_id = v.into();
11925        self
11926    }
11927}
11928
11929impl wkt::message::Message for CreateNetworkPeeringRequest {
11930    fn typename() -> &'static str {
11931        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest"
11932    }
11933}
11934
11935#[doc(hidden)]
11936impl<'de> serde::de::Deserialize<'de> for CreateNetworkPeeringRequest {
11937    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11938    where
11939        D: serde::Deserializer<'de>,
11940    {
11941        #[allow(non_camel_case_types)]
11942        #[doc(hidden)]
11943        #[derive(PartialEq, Eq, Hash)]
11944        enum __FieldTag {
11945            __parent,
11946            __network_peering_id,
11947            __network_peering,
11948            __request_id,
11949            Unknown(std::string::String),
11950        }
11951        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11952            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11953            where
11954                D: serde::Deserializer<'de>,
11955            {
11956                struct Visitor;
11957                impl<'de> serde::de::Visitor<'de> for Visitor {
11958                    type Value = __FieldTag;
11959                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11960                        formatter.write_str("a field name for CreateNetworkPeeringRequest")
11961                    }
11962                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11963                    where
11964                        E: serde::de::Error,
11965                    {
11966                        use std::result::Result::Ok;
11967                        use std::string::ToString;
11968                        match value {
11969                            "parent" => Ok(__FieldTag::__parent),
11970                            "networkPeeringId" => Ok(__FieldTag::__network_peering_id),
11971                            "network_peering_id" => Ok(__FieldTag::__network_peering_id),
11972                            "networkPeering" => Ok(__FieldTag::__network_peering),
11973                            "network_peering" => Ok(__FieldTag::__network_peering),
11974                            "requestId" => Ok(__FieldTag::__request_id),
11975                            "request_id" => Ok(__FieldTag::__request_id),
11976                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11977                        }
11978                    }
11979                }
11980                deserializer.deserialize_identifier(Visitor)
11981            }
11982        }
11983        struct Visitor;
11984        impl<'de> serde::de::Visitor<'de> for Visitor {
11985            type Value = CreateNetworkPeeringRequest;
11986            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11987                formatter.write_str("struct CreateNetworkPeeringRequest")
11988            }
11989            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11990            where
11991                A: serde::de::MapAccess<'de>,
11992            {
11993                #[allow(unused_imports)]
11994                use serde::de::Error;
11995                use std::option::Option::Some;
11996                let mut fields = std::collections::HashSet::new();
11997                let mut result = Self::Value::new();
11998                while let Some(tag) = map.next_key::<__FieldTag>()? {
11999                    #[allow(clippy::match_single_binding)]
12000                    match tag {
12001                        __FieldTag::__parent => {
12002                            if !fields.insert(__FieldTag::__parent) {
12003                                return std::result::Result::Err(A::Error::duplicate_field(
12004                                    "multiple values for parent",
12005                                ));
12006                            }
12007                            result.parent = map
12008                                .next_value::<std::option::Option<std::string::String>>()?
12009                                .unwrap_or_default();
12010                        }
12011                        __FieldTag::__network_peering_id => {
12012                            if !fields.insert(__FieldTag::__network_peering_id) {
12013                                return std::result::Result::Err(A::Error::duplicate_field(
12014                                    "multiple values for network_peering_id",
12015                                ));
12016                            }
12017                            result.network_peering_id = map
12018                                .next_value::<std::option::Option<std::string::String>>()?
12019                                .unwrap_or_default();
12020                        }
12021                        __FieldTag::__network_peering => {
12022                            if !fields.insert(__FieldTag::__network_peering) {
12023                                return std::result::Result::Err(A::Error::duplicate_field(
12024                                    "multiple values for network_peering",
12025                                ));
12026                            }
12027                            result.network_peering = map
12028                                .next_value::<std::option::Option<crate::model::NetworkPeering>>(
12029                                )?;
12030                        }
12031                        __FieldTag::__request_id => {
12032                            if !fields.insert(__FieldTag::__request_id) {
12033                                return std::result::Result::Err(A::Error::duplicate_field(
12034                                    "multiple values for request_id",
12035                                ));
12036                            }
12037                            result.request_id = map
12038                                .next_value::<std::option::Option<std::string::String>>()?
12039                                .unwrap_or_default();
12040                        }
12041                        __FieldTag::Unknown(key) => {
12042                            let value = map.next_value::<serde_json::Value>()?;
12043                            result._unknown_fields.insert(key, value);
12044                        }
12045                    }
12046                }
12047                std::result::Result::Ok(result)
12048            }
12049        }
12050        deserializer.deserialize_any(Visitor)
12051    }
12052}
12053
12054#[doc(hidden)]
12055impl serde::ser::Serialize for CreateNetworkPeeringRequest {
12056    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12057    where
12058        S: serde::ser::Serializer,
12059    {
12060        use serde::ser::SerializeMap;
12061        #[allow(unused_imports)]
12062        use std::option::Option::Some;
12063        let mut state = serializer.serialize_map(std::option::Option::None)?;
12064        if !self.parent.is_empty() {
12065            state.serialize_entry("parent", &self.parent)?;
12066        }
12067        if !self.network_peering_id.is_empty() {
12068            state.serialize_entry("networkPeeringId", &self.network_peering_id)?;
12069        }
12070        if self.network_peering.is_some() {
12071            state.serialize_entry("networkPeering", &self.network_peering)?;
12072        }
12073        if !self.request_id.is_empty() {
12074            state.serialize_entry("requestId", &self.request_id)?;
12075        }
12076        if !self._unknown_fields.is_empty() {
12077            for (key, value) in self._unknown_fields.iter() {
12078                state.serialize_entry(key, &value)?;
12079            }
12080        }
12081        state.end()
12082    }
12083}
12084
12085impl std::fmt::Debug for CreateNetworkPeeringRequest {
12086    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12087        let mut debug_struct = f.debug_struct("CreateNetworkPeeringRequest");
12088        debug_struct.field("parent", &self.parent);
12089        debug_struct.field("network_peering_id", &self.network_peering_id);
12090        debug_struct.field("network_peering", &self.network_peering);
12091        debug_struct.field("request_id", &self.request_id);
12092        if !self._unknown_fields.is_empty() {
12093            debug_struct.field("_unknown_fields", &self._unknown_fields);
12094        }
12095        debug_struct.finish()
12096    }
12097}
12098
12099/// Request message for
12100/// [VmwareEngine.DeleteNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]
12101///
12102/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering]: crate::client::VmwareEngine::delete_network_peering
12103#[derive(Clone, Default, PartialEq)]
12104#[non_exhaustive]
12105pub struct DeleteNetworkPeeringRequest {
12106    /// Required. The resource name of the network peering to be deleted.
12107    /// Resource names are schemeless URIs that follow the conventions in
12108    /// <https://cloud.google.com/apis/design/resource_names>.
12109    /// For example:
12110    /// `projects/my-project/locations/global/networkPeerings/my-peering`
12111    pub name: std::string::String,
12112
12113    /// Optional. A request ID to identify requests. Specify a unique request ID
12114    /// so that if you must retry your request, the server will know to ignore
12115    /// the request if it has already been completed. The server guarantees that a
12116    /// request doesn't result in creation of duplicate commitments for at least 60
12117    /// minutes.
12118    ///
12119    /// For example, consider a situation where you make an initial request and the
12120    /// request times out. If you make the request again with the same request
12121    /// ID, the server can check if original operation with the same request ID
12122    /// was received, and if so, will ignore the second request. This prevents
12123    /// clients from accidentally creating duplicate commitments.
12124    ///
12125    /// The request ID must be a valid UUID with the exception that zero UUID is
12126    /// not supported (00000000-0000-0000-0000-000000000000).
12127    pub request_id: std::string::String,
12128
12129    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12130}
12131
12132impl DeleteNetworkPeeringRequest {
12133    pub fn new() -> Self {
12134        std::default::Default::default()
12135    }
12136
12137    /// Sets the value of [name][crate::model::DeleteNetworkPeeringRequest::name].
12138    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12139        self.name = v.into();
12140        self
12141    }
12142
12143    /// Sets the value of [request_id][crate::model::DeleteNetworkPeeringRequest::request_id].
12144    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12145        self.request_id = v.into();
12146        self
12147    }
12148}
12149
12150impl wkt::message::Message for DeleteNetworkPeeringRequest {
12151    fn typename() -> &'static str {
12152        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest"
12153    }
12154}
12155
12156#[doc(hidden)]
12157impl<'de> serde::de::Deserialize<'de> for DeleteNetworkPeeringRequest {
12158    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12159    where
12160        D: serde::Deserializer<'de>,
12161    {
12162        #[allow(non_camel_case_types)]
12163        #[doc(hidden)]
12164        #[derive(PartialEq, Eq, Hash)]
12165        enum __FieldTag {
12166            __name,
12167            __request_id,
12168            Unknown(std::string::String),
12169        }
12170        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12171            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12172            where
12173                D: serde::Deserializer<'de>,
12174            {
12175                struct Visitor;
12176                impl<'de> serde::de::Visitor<'de> for Visitor {
12177                    type Value = __FieldTag;
12178                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12179                        formatter.write_str("a field name for DeleteNetworkPeeringRequest")
12180                    }
12181                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12182                    where
12183                        E: serde::de::Error,
12184                    {
12185                        use std::result::Result::Ok;
12186                        use std::string::ToString;
12187                        match value {
12188                            "name" => Ok(__FieldTag::__name),
12189                            "requestId" => Ok(__FieldTag::__request_id),
12190                            "request_id" => Ok(__FieldTag::__request_id),
12191                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12192                        }
12193                    }
12194                }
12195                deserializer.deserialize_identifier(Visitor)
12196            }
12197        }
12198        struct Visitor;
12199        impl<'de> serde::de::Visitor<'de> for Visitor {
12200            type Value = DeleteNetworkPeeringRequest;
12201            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12202                formatter.write_str("struct DeleteNetworkPeeringRequest")
12203            }
12204            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12205            where
12206                A: serde::de::MapAccess<'de>,
12207            {
12208                #[allow(unused_imports)]
12209                use serde::de::Error;
12210                use std::option::Option::Some;
12211                let mut fields = std::collections::HashSet::new();
12212                let mut result = Self::Value::new();
12213                while let Some(tag) = map.next_key::<__FieldTag>()? {
12214                    #[allow(clippy::match_single_binding)]
12215                    match tag {
12216                        __FieldTag::__name => {
12217                            if !fields.insert(__FieldTag::__name) {
12218                                return std::result::Result::Err(A::Error::duplicate_field(
12219                                    "multiple values for name",
12220                                ));
12221                            }
12222                            result.name = map
12223                                .next_value::<std::option::Option<std::string::String>>()?
12224                                .unwrap_or_default();
12225                        }
12226                        __FieldTag::__request_id => {
12227                            if !fields.insert(__FieldTag::__request_id) {
12228                                return std::result::Result::Err(A::Error::duplicate_field(
12229                                    "multiple values for request_id",
12230                                ));
12231                            }
12232                            result.request_id = map
12233                                .next_value::<std::option::Option<std::string::String>>()?
12234                                .unwrap_or_default();
12235                        }
12236                        __FieldTag::Unknown(key) => {
12237                            let value = map.next_value::<serde_json::Value>()?;
12238                            result._unknown_fields.insert(key, value);
12239                        }
12240                    }
12241                }
12242                std::result::Result::Ok(result)
12243            }
12244        }
12245        deserializer.deserialize_any(Visitor)
12246    }
12247}
12248
12249#[doc(hidden)]
12250impl serde::ser::Serialize for DeleteNetworkPeeringRequest {
12251    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12252    where
12253        S: serde::ser::Serializer,
12254    {
12255        use serde::ser::SerializeMap;
12256        #[allow(unused_imports)]
12257        use std::option::Option::Some;
12258        let mut state = serializer.serialize_map(std::option::Option::None)?;
12259        if !self.name.is_empty() {
12260            state.serialize_entry("name", &self.name)?;
12261        }
12262        if !self.request_id.is_empty() {
12263            state.serialize_entry("requestId", &self.request_id)?;
12264        }
12265        if !self._unknown_fields.is_empty() {
12266            for (key, value) in self._unknown_fields.iter() {
12267                state.serialize_entry(key, &value)?;
12268            }
12269        }
12270        state.end()
12271    }
12272}
12273
12274impl std::fmt::Debug for DeleteNetworkPeeringRequest {
12275    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12276        let mut debug_struct = f.debug_struct("DeleteNetworkPeeringRequest");
12277        debug_struct.field("name", &self.name);
12278        debug_struct.field("request_id", &self.request_id);
12279        if !self._unknown_fields.is_empty() {
12280            debug_struct.field("_unknown_fields", &self._unknown_fields);
12281        }
12282        debug_struct.finish()
12283    }
12284}
12285
12286/// Request message for
12287/// [VmwareEngine.GetNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]
12288///
12289/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering]: crate::client::VmwareEngine::get_network_peering
12290#[derive(Clone, Default, PartialEq)]
12291#[non_exhaustive]
12292pub struct GetNetworkPeeringRequest {
12293    /// Required. The resource name of the network peering to retrieve.
12294    /// Resource names are schemeless URIs that follow the conventions in
12295    /// <https://cloud.google.com/apis/design/resource_names>.
12296    /// For example:
12297    /// `projects/my-project/locations/global/networkPeerings/my-peering`
12298    pub name: std::string::String,
12299
12300    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12301}
12302
12303impl GetNetworkPeeringRequest {
12304    pub fn new() -> Self {
12305        std::default::Default::default()
12306    }
12307
12308    /// Sets the value of [name][crate::model::GetNetworkPeeringRequest::name].
12309    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12310        self.name = v.into();
12311        self
12312    }
12313}
12314
12315impl wkt::message::Message for GetNetworkPeeringRequest {
12316    fn typename() -> &'static str {
12317        "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPeeringRequest"
12318    }
12319}
12320
12321#[doc(hidden)]
12322impl<'de> serde::de::Deserialize<'de> for GetNetworkPeeringRequest {
12323    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12324    where
12325        D: serde::Deserializer<'de>,
12326    {
12327        #[allow(non_camel_case_types)]
12328        #[doc(hidden)]
12329        #[derive(PartialEq, Eq, Hash)]
12330        enum __FieldTag {
12331            __name,
12332            Unknown(std::string::String),
12333        }
12334        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12335            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12336            where
12337                D: serde::Deserializer<'de>,
12338            {
12339                struct Visitor;
12340                impl<'de> serde::de::Visitor<'de> for Visitor {
12341                    type Value = __FieldTag;
12342                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12343                        formatter.write_str("a field name for GetNetworkPeeringRequest")
12344                    }
12345                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12346                    where
12347                        E: serde::de::Error,
12348                    {
12349                        use std::result::Result::Ok;
12350                        use std::string::ToString;
12351                        match value {
12352                            "name" => Ok(__FieldTag::__name),
12353                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12354                        }
12355                    }
12356                }
12357                deserializer.deserialize_identifier(Visitor)
12358            }
12359        }
12360        struct Visitor;
12361        impl<'de> serde::de::Visitor<'de> for Visitor {
12362            type Value = GetNetworkPeeringRequest;
12363            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12364                formatter.write_str("struct GetNetworkPeeringRequest")
12365            }
12366            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12367            where
12368                A: serde::de::MapAccess<'de>,
12369            {
12370                #[allow(unused_imports)]
12371                use serde::de::Error;
12372                use std::option::Option::Some;
12373                let mut fields = std::collections::HashSet::new();
12374                let mut result = Self::Value::new();
12375                while let Some(tag) = map.next_key::<__FieldTag>()? {
12376                    #[allow(clippy::match_single_binding)]
12377                    match tag {
12378                        __FieldTag::__name => {
12379                            if !fields.insert(__FieldTag::__name) {
12380                                return std::result::Result::Err(A::Error::duplicate_field(
12381                                    "multiple values for name",
12382                                ));
12383                            }
12384                            result.name = map
12385                                .next_value::<std::option::Option<std::string::String>>()?
12386                                .unwrap_or_default();
12387                        }
12388                        __FieldTag::Unknown(key) => {
12389                            let value = map.next_value::<serde_json::Value>()?;
12390                            result._unknown_fields.insert(key, value);
12391                        }
12392                    }
12393                }
12394                std::result::Result::Ok(result)
12395            }
12396        }
12397        deserializer.deserialize_any(Visitor)
12398    }
12399}
12400
12401#[doc(hidden)]
12402impl serde::ser::Serialize for GetNetworkPeeringRequest {
12403    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12404    where
12405        S: serde::ser::Serializer,
12406    {
12407        use serde::ser::SerializeMap;
12408        #[allow(unused_imports)]
12409        use std::option::Option::Some;
12410        let mut state = serializer.serialize_map(std::option::Option::None)?;
12411        if !self.name.is_empty() {
12412            state.serialize_entry("name", &self.name)?;
12413        }
12414        if !self._unknown_fields.is_empty() {
12415            for (key, value) in self._unknown_fields.iter() {
12416                state.serialize_entry(key, &value)?;
12417            }
12418        }
12419        state.end()
12420    }
12421}
12422
12423impl std::fmt::Debug for GetNetworkPeeringRequest {
12424    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12425        let mut debug_struct = f.debug_struct("GetNetworkPeeringRequest");
12426        debug_struct.field("name", &self.name);
12427        if !self._unknown_fields.is_empty() {
12428            debug_struct.field("_unknown_fields", &self._unknown_fields);
12429        }
12430        debug_struct.finish()
12431    }
12432}
12433
12434/// Request message for
12435/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
12436///
12437/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
12438#[derive(Clone, Default, PartialEq)]
12439#[non_exhaustive]
12440pub struct ListNetworkPeeringsRequest {
12441    /// Required. The resource name of the location (global) to query for
12442    /// network peerings. Resource names are schemeless URIs that follow the
12443    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
12444    /// example: `projects/my-project/locations/global`
12445    pub parent: std::string::String,
12446
12447    /// The maximum number of network peerings to return in one page.
12448    /// The maximum value is coerced to 1000.
12449    /// The default value of this field is 500.
12450    pub page_size: i32,
12451
12452    /// A page token, received from a previous `ListNetworkPeerings` call.
12453    /// Provide this to retrieve the subsequent page.
12454    ///
12455    /// When paginating, all other parameters provided to
12456    /// `ListNetworkPeerings` must match the call that provided the page
12457    /// token.
12458    pub page_token: std::string::String,
12459
12460    /// A filter expression that matches resources returned in the response.
12461    /// The expression must specify the field name, a comparison
12462    /// operator, and the value that you want to use for filtering. The value
12463    /// must be a string, a number, or a boolean. The comparison operator
12464    /// must be `=`, `!=`, `>`, or `<`.
12465    ///
12466    /// For example, if you are filtering a list of network peerings, you can
12467    /// exclude the ones named `example-peering` by specifying
12468    /// `name != "example-peering"`.
12469    ///
12470    /// To filter on multiple expressions, provide each separate expression within
12471    /// parentheses. For example:
12472    ///
12473    /// ```norust
12474    /// (name = "example-peering")
12475    /// (createTime > "2021-04-12T08:15:10.40Z")
12476    /// ```
12477    ///
12478    /// By default, each expression is an `AND` expression. However, you
12479    /// can include `AND` and `OR` expressions explicitly.
12480    /// For example:
12481    ///
12482    /// ```norust
12483    /// (name = "example-peering-1") AND
12484    /// (createTime > "2021-04-12T08:15:10.40Z") OR
12485    /// (name = "example-peering-2")
12486    /// ```
12487    pub filter: std::string::String,
12488
12489    /// Sorts list results by a certain order. By default, returned results
12490    /// are ordered by `name` in ascending order.
12491    /// You can also sort results in descending order based on the `name` value
12492    /// using `orderBy="name desc"`.
12493    /// Currently, only ordering by `name` is supported.
12494    pub order_by: std::string::String,
12495
12496    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12497}
12498
12499impl ListNetworkPeeringsRequest {
12500    pub fn new() -> Self {
12501        std::default::Default::default()
12502    }
12503
12504    /// Sets the value of [parent][crate::model::ListNetworkPeeringsRequest::parent].
12505    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12506        self.parent = v.into();
12507        self
12508    }
12509
12510    /// Sets the value of [page_size][crate::model::ListNetworkPeeringsRequest::page_size].
12511    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12512        self.page_size = v.into();
12513        self
12514    }
12515
12516    /// Sets the value of [page_token][crate::model::ListNetworkPeeringsRequest::page_token].
12517    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12518        self.page_token = v.into();
12519        self
12520    }
12521
12522    /// Sets the value of [filter][crate::model::ListNetworkPeeringsRequest::filter].
12523    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12524        self.filter = v.into();
12525        self
12526    }
12527
12528    /// Sets the value of [order_by][crate::model::ListNetworkPeeringsRequest::order_by].
12529    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12530        self.order_by = v.into();
12531        self
12532    }
12533}
12534
12535impl wkt::message::Message for ListNetworkPeeringsRequest {
12536    fn typename() -> &'static str {
12537        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest"
12538    }
12539}
12540
12541#[doc(hidden)]
12542impl<'de> serde::de::Deserialize<'de> for ListNetworkPeeringsRequest {
12543    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12544    where
12545        D: serde::Deserializer<'de>,
12546    {
12547        #[allow(non_camel_case_types)]
12548        #[doc(hidden)]
12549        #[derive(PartialEq, Eq, Hash)]
12550        enum __FieldTag {
12551            __parent,
12552            __page_size,
12553            __page_token,
12554            __filter,
12555            __order_by,
12556            Unknown(std::string::String),
12557        }
12558        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12559            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12560            where
12561                D: serde::Deserializer<'de>,
12562            {
12563                struct Visitor;
12564                impl<'de> serde::de::Visitor<'de> for Visitor {
12565                    type Value = __FieldTag;
12566                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12567                        formatter.write_str("a field name for ListNetworkPeeringsRequest")
12568                    }
12569                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12570                    where
12571                        E: serde::de::Error,
12572                    {
12573                        use std::result::Result::Ok;
12574                        use std::string::ToString;
12575                        match value {
12576                            "parent" => Ok(__FieldTag::__parent),
12577                            "pageSize" => Ok(__FieldTag::__page_size),
12578                            "page_size" => Ok(__FieldTag::__page_size),
12579                            "pageToken" => Ok(__FieldTag::__page_token),
12580                            "page_token" => Ok(__FieldTag::__page_token),
12581                            "filter" => Ok(__FieldTag::__filter),
12582                            "orderBy" => Ok(__FieldTag::__order_by),
12583                            "order_by" => Ok(__FieldTag::__order_by),
12584                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12585                        }
12586                    }
12587                }
12588                deserializer.deserialize_identifier(Visitor)
12589            }
12590        }
12591        struct Visitor;
12592        impl<'de> serde::de::Visitor<'de> for Visitor {
12593            type Value = ListNetworkPeeringsRequest;
12594            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12595                formatter.write_str("struct ListNetworkPeeringsRequest")
12596            }
12597            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12598            where
12599                A: serde::de::MapAccess<'de>,
12600            {
12601                #[allow(unused_imports)]
12602                use serde::de::Error;
12603                use std::option::Option::Some;
12604                let mut fields = std::collections::HashSet::new();
12605                let mut result = Self::Value::new();
12606                while let Some(tag) = map.next_key::<__FieldTag>()? {
12607                    #[allow(clippy::match_single_binding)]
12608                    match tag {
12609                        __FieldTag::__parent => {
12610                            if !fields.insert(__FieldTag::__parent) {
12611                                return std::result::Result::Err(A::Error::duplicate_field(
12612                                    "multiple values for parent",
12613                                ));
12614                            }
12615                            result.parent = map
12616                                .next_value::<std::option::Option<std::string::String>>()?
12617                                .unwrap_or_default();
12618                        }
12619                        __FieldTag::__page_size => {
12620                            if !fields.insert(__FieldTag::__page_size) {
12621                                return std::result::Result::Err(A::Error::duplicate_field(
12622                                    "multiple values for page_size",
12623                                ));
12624                            }
12625                            struct __With(std::option::Option<i32>);
12626                            impl<'de> serde::de::Deserialize<'de> for __With {
12627                                fn deserialize<D>(
12628                                    deserializer: D,
12629                                ) -> std::result::Result<Self, D::Error>
12630                                where
12631                                    D: serde::de::Deserializer<'de>,
12632                                {
12633                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12634                                }
12635                            }
12636                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
12637                        }
12638                        __FieldTag::__page_token => {
12639                            if !fields.insert(__FieldTag::__page_token) {
12640                                return std::result::Result::Err(A::Error::duplicate_field(
12641                                    "multiple values for page_token",
12642                                ));
12643                            }
12644                            result.page_token = map
12645                                .next_value::<std::option::Option<std::string::String>>()?
12646                                .unwrap_or_default();
12647                        }
12648                        __FieldTag::__filter => {
12649                            if !fields.insert(__FieldTag::__filter) {
12650                                return std::result::Result::Err(A::Error::duplicate_field(
12651                                    "multiple values for filter",
12652                                ));
12653                            }
12654                            result.filter = map
12655                                .next_value::<std::option::Option<std::string::String>>()?
12656                                .unwrap_or_default();
12657                        }
12658                        __FieldTag::__order_by => {
12659                            if !fields.insert(__FieldTag::__order_by) {
12660                                return std::result::Result::Err(A::Error::duplicate_field(
12661                                    "multiple values for order_by",
12662                                ));
12663                            }
12664                            result.order_by = map
12665                                .next_value::<std::option::Option<std::string::String>>()?
12666                                .unwrap_or_default();
12667                        }
12668                        __FieldTag::Unknown(key) => {
12669                            let value = map.next_value::<serde_json::Value>()?;
12670                            result._unknown_fields.insert(key, value);
12671                        }
12672                    }
12673                }
12674                std::result::Result::Ok(result)
12675            }
12676        }
12677        deserializer.deserialize_any(Visitor)
12678    }
12679}
12680
12681#[doc(hidden)]
12682impl serde::ser::Serialize for ListNetworkPeeringsRequest {
12683    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12684    where
12685        S: serde::ser::Serializer,
12686    {
12687        use serde::ser::SerializeMap;
12688        #[allow(unused_imports)]
12689        use std::option::Option::Some;
12690        let mut state = serializer.serialize_map(std::option::Option::None)?;
12691        if !self.parent.is_empty() {
12692            state.serialize_entry("parent", &self.parent)?;
12693        }
12694        if !wkt::internal::is_default(&self.page_size) {
12695            struct __With<'a>(&'a i32);
12696            impl<'a> serde::ser::Serialize for __With<'a> {
12697                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12698                where
12699                    S: serde::ser::Serializer,
12700                {
12701                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12702                }
12703            }
12704            state.serialize_entry("pageSize", &__With(&self.page_size))?;
12705        }
12706        if !self.page_token.is_empty() {
12707            state.serialize_entry("pageToken", &self.page_token)?;
12708        }
12709        if !self.filter.is_empty() {
12710            state.serialize_entry("filter", &self.filter)?;
12711        }
12712        if !self.order_by.is_empty() {
12713            state.serialize_entry("orderBy", &self.order_by)?;
12714        }
12715        if !self._unknown_fields.is_empty() {
12716            for (key, value) in self._unknown_fields.iter() {
12717                state.serialize_entry(key, &value)?;
12718            }
12719        }
12720        state.end()
12721    }
12722}
12723
12724impl std::fmt::Debug for ListNetworkPeeringsRequest {
12725    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12726        let mut debug_struct = f.debug_struct("ListNetworkPeeringsRequest");
12727        debug_struct.field("parent", &self.parent);
12728        debug_struct.field("page_size", &self.page_size);
12729        debug_struct.field("page_token", &self.page_token);
12730        debug_struct.field("filter", &self.filter);
12731        debug_struct.field("order_by", &self.order_by);
12732        if !self._unknown_fields.is_empty() {
12733            debug_struct.field("_unknown_fields", &self._unknown_fields);
12734        }
12735        debug_struct.finish()
12736    }
12737}
12738
12739/// Request message for
12740/// [VmwareEngine.UpdateNetworkPeering][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]
12741///
12742/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering]: crate::client::VmwareEngine::update_network_peering
12743#[derive(Clone, Default, PartialEq)]
12744#[non_exhaustive]
12745pub struct UpdateNetworkPeeringRequest {
12746    /// Required. Network peering description.
12747    pub network_peering: std::option::Option<crate::model::NetworkPeering>,
12748
12749    /// Required. Field mask is used to specify the fields to be overwritten in the
12750    /// `NetworkPeering` resource by the update.
12751    /// The fields specified in the `update_mask` are relative to the resource, not
12752    /// the full request. A field will be overwritten if it is in the mask. If the
12753    /// user does not provide a mask then all fields will be overwritten.
12754    pub update_mask: std::option::Option<wkt::FieldMask>,
12755
12756    /// Optional. A request ID to identify requests. Specify a unique request ID
12757    /// so that if you must retry your request, the server will know to ignore
12758    /// the request if it has already been completed. The server guarantees that a
12759    /// request doesn't result in creation of duplicate commitments for at least 60
12760    /// minutes.
12761    ///
12762    /// For example, consider a situation where you make an initial request and the
12763    /// request times out. If you make the request again with the same request
12764    /// ID, the server can check if original operation with the same request ID
12765    /// was received, and if so, will ignore the second request. This prevents
12766    /// clients from accidentally creating duplicate commitments.
12767    ///
12768    /// The request ID must be a valid UUID with the exception that zero UUID is
12769    /// not supported (00000000-0000-0000-0000-000000000000).
12770    pub request_id: std::string::String,
12771
12772    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12773}
12774
12775impl UpdateNetworkPeeringRequest {
12776    pub fn new() -> Self {
12777        std::default::Default::default()
12778    }
12779
12780    /// Sets the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
12781    pub fn set_network_peering<T>(mut self, v: T) -> Self
12782    where
12783        T: std::convert::Into<crate::model::NetworkPeering>,
12784    {
12785        self.network_peering = std::option::Option::Some(v.into());
12786        self
12787    }
12788
12789    /// Sets or clears the value of [network_peering][crate::model::UpdateNetworkPeeringRequest::network_peering].
12790    pub fn set_or_clear_network_peering<T>(mut self, v: std::option::Option<T>) -> Self
12791    where
12792        T: std::convert::Into<crate::model::NetworkPeering>,
12793    {
12794        self.network_peering = v.map(|x| x.into());
12795        self
12796    }
12797
12798    /// Sets the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
12799    pub fn set_update_mask<T>(mut self, v: T) -> Self
12800    where
12801        T: std::convert::Into<wkt::FieldMask>,
12802    {
12803        self.update_mask = std::option::Option::Some(v.into());
12804        self
12805    }
12806
12807    /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPeeringRequest::update_mask].
12808    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12809    where
12810        T: std::convert::Into<wkt::FieldMask>,
12811    {
12812        self.update_mask = v.map(|x| x.into());
12813        self
12814    }
12815
12816    /// Sets the value of [request_id][crate::model::UpdateNetworkPeeringRequest::request_id].
12817    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12818        self.request_id = v.into();
12819        self
12820    }
12821}
12822
12823impl wkt::message::Message for UpdateNetworkPeeringRequest {
12824    fn typename() -> &'static str {
12825        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest"
12826    }
12827}
12828
12829#[doc(hidden)]
12830impl<'de> serde::de::Deserialize<'de> for UpdateNetworkPeeringRequest {
12831    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12832    where
12833        D: serde::Deserializer<'de>,
12834    {
12835        #[allow(non_camel_case_types)]
12836        #[doc(hidden)]
12837        #[derive(PartialEq, Eq, Hash)]
12838        enum __FieldTag {
12839            __network_peering,
12840            __update_mask,
12841            __request_id,
12842            Unknown(std::string::String),
12843        }
12844        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12845            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12846            where
12847                D: serde::Deserializer<'de>,
12848            {
12849                struct Visitor;
12850                impl<'de> serde::de::Visitor<'de> for Visitor {
12851                    type Value = __FieldTag;
12852                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12853                        formatter.write_str("a field name for UpdateNetworkPeeringRequest")
12854                    }
12855                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12856                    where
12857                        E: serde::de::Error,
12858                    {
12859                        use std::result::Result::Ok;
12860                        use std::string::ToString;
12861                        match value {
12862                            "networkPeering" => Ok(__FieldTag::__network_peering),
12863                            "network_peering" => Ok(__FieldTag::__network_peering),
12864                            "updateMask" => Ok(__FieldTag::__update_mask),
12865                            "update_mask" => Ok(__FieldTag::__update_mask),
12866                            "requestId" => Ok(__FieldTag::__request_id),
12867                            "request_id" => Ok(__FieldTag::__request_id),
12868                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12869                        }
12870                    }
12871                }
12872                deserializer.deserialize_identifier(Visitor)
12873            }
12874        }
12875        struct Visitor;
12876        impl<'de> serde::de::Visitor<'de> for Visitor {
12877            type Value = UpdateNetworkPeeringRequest;
12878            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12879                formatter.write_str("struct UpdateNetworkPeeringRequest")
12880            }
12881            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12882            where
12883                A: serde::de::MapAccess<'de>,
12884            {
12885                #[allow(unused_imports)]
12886                use serde::de::Error;
12887                use std::option::Option::Some;
12888                let mut fields = std::collections::HashSet::new();
12889                let mut result = Self::Value::new();
12890                while let Some(tag) = map.next_key::<__FieldTag>()? {
12891                    #[allow(clippy::match_single_binding)]
12892                    match tag {
12893                        __FieldTag::__network_peering => {
12894                            if !fields.insert(__FieldTag::__network_peering) {
12895                                return std::result::Result::Err(A::Error::duplicate_field(
12896                                    "multiple values for network_peering",
12897                                ));
12898                            }
12899                            result.network_peering = map
12900                                .next_value::<std::option::Option<crate::model::NetworkPeering>>(
12901                                )?;
12902                        }
12903                        __FieldTag::__update_mask => {
12904                            if !fields.insert(__FieldTag::__update_mask) {
12905                                return std::result::Result::Err(A::Error::duplicate_field(
12906                                    "multiple values for update_mask",
12907                                ));
12908                            }
12909                            result.update_mask =
12910                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
12911                        }
12912                        __FieldTag::__request_id => {
12913                            if !fields.insert(__FieldTag::__request_id) {
12914                                return std::result::Result::Err(A::Error::duplicate_field(
12915                                    "multiple values for request_id",
12916                                ));
12917                            }
12918                            result.request_id = map
12919                                .next_value::<std::option::Option<std::string::String>>()?
12920                                .unwrap_or_default();
12921                        }
12922                        __FieldTag::Unknown(key) => {
12923                            let value = map.next_value::<serde_json::Value>()?;
12924                            result._unknown_fields.insert(key, value);
12925                        }
12926                    }
12927                }
12928                std::result::Result::Ok(result)
12929            }
12930        }
12931        deserializer.deserialize_any(Visitor)
12932    }
12933}
12934
12935#[doc(hidden)]
12936impl serde::ser::Serialize for UpdateNetworkPeeringRequest {
12937    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12938    where
12939        S: serde::ser::Serializer,
12940    {
12941        use serde::ser::SerializeMap;
12942        #[allow(unused_imports)]
12943        use std::option::Option::Some;
12944        let mut state = serializer.serialize_map(std::option::Option::None)?;
12945        if self.network_peering.is_some() {
12946            state.serialize_entry("networkPeering", &self.network_peering)?;
12947        }
12948        if self.update_mask.is_some() {
12949            state.serialize_entry("updateMask", &self.update_mask)?;
12950        }
12951        if !self.request_id.is_empty() {
12952            state.serialize_entry("requestId", &self.request_id)?;
12953        }
12954        if !self._unknown_fields.is_empty() {
12955            for (key, value) in self._unknown_fields.iter() {
12956                state.serialize_entry(key, &value)?;
12957            }
12958        }
12959        state.end()
12960    }
12961}
12962
12963impl std::fmt::Debug for UpdateNetworkPeeringRequest {
12964    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12965        let mut debug_struct = f.debug_struct("UpdateNetworkPeeringRequest");
12966        debug_struct.field("network_peering", &self.network_peering);
12967        debug_struct.field("update_mask", &self.update_mask);
12968        debug_struct.field("request_id", &self.request_id);
12969        if !self._unknown_fields.is_empty() {
12970            debug_struct.field("_unknown_fields", &self._unknown_fields);
12971        }
12972        debug_struct.finish()
12973    }
12974}
12975
12976/// Response message for
12977/// [VmwareEngine.ListNetworkPeerings][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]
12978///
12979/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings]: crate::client::VmwareEngine::list_network_peerings
12980#[derive(Clone, Default, PartialEq)]
12981#[non_exhaustive]
12982pub struct ListNetworkPeeringsResponse {
12983    /// A list of network peerings.
12984    pub network_peerings: std::vec::Vec<crate::model::NetworkPeering>,
12985
12986    /// A token, which can be sent as `page_token` to retrieve the next page.
12987    /// If this field is omitted, there are no subsequent pages.
12988    pub next_page_token: std::string::String,
12989
12990    /// Unreachable resources.
12991    pub unreachable: std::vec::Vec<std::string::String>,
12992
12993    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12994}
12995
12996impl ListNetworkPeeringsResponse {
12997    pub fn new() -> Self {
12998        std::default::Default::default()
12999    }
13000
13001    /// Sets the value of [network_peerings][crate::model::ListNetworkPeeringsResponse::network_peerings].
13002    pub fn set_network_peerings<T, V>(mut self, v: T) -> Self
13003    where
13004        T: std::iter::IntoIterator<Item = V>,
13005        V: std::convert::Into<crate::model::NetworkPeering>,
13006    {
13007        use std::iter::Iterator;
13008        self.network_peerings = v.into_iter().map(|i| i.into()).collect();
13009        self
13010    }
13011
13012    /// Sets the value of [next_page_token][crate::model::ListNetworkPeeringsResponse::next_page_token].
13013    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13014        self.next_page_token = v.into();
13015        self
13016    }
13017
13018    /// Sets the value of [unreachable][crate::model::ListNetworkPeeringsResponse::unreachable].
13019    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13020    where
13021        T: std::iter::IntoIterator<Item = V>,
13022        V: std::convert::Into<std::string::String>,
13023    {
13024        use std::iter::Iterator;
13025        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13026        self
13027    }
13028}
13029
13030impl wkt::message::Message for ListNetworkPeeringsResponse {
13031    fn typename() -> &'static str {
13032        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse"
13033    }
13034}
13035
13036#[doc(hidden)]
13037impl gax::paginator::internal::PageableResponse for ListNetworkPeeringsResponse {
13038    type PageItem = crate::model::NetworkPeering;
13039
13040    fn items(self) -> std::vec::Vec<Self::PageItem> {
13041        self.network_peerings
13042    }
13043
13044    fn next_page_token(&self) -> std::string::String {
13045        use std::clone::Clone;
13046        self.next_page_token.clone()
13047    }
13048}
13049
13050#[doc(hidden)]
13051impl<'de> serde::de::Deserialize<'de> for ListNetworkPeeringsResponse {
13052    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13053    where
13054        D: serde::Deserializer<'de>,
13055    {
13056        #[allow(non_camel_case_types)]
13057        #[doc(hidden)]
13058        #[derive(PartialEq, Eq, Hash)]
13059        enum __FieldTag {
13060            __network_peerings,
13061            __next_page_token,
13062            __unreachable,
13063            Unknown(std::string::String),
13064        }
13065        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13066            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13067            where
13068                D: serde::Deserializer<'de>,
13069            {
13070                struct Visitor;
13071                impl<'de> serde::de::Visitor<'de> for Visitor {
13072                    type Value = __FieldTag;
13073                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13074                        formatter.write_str("a field name for ListNetworkPeeringsResponse")
13075                    }
13076                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13077                    where
13078                        E: serde::de::Error,
13079                    {
13080                        use std::result::Result::Ok;
13081                        use std::string::ToString;
13082                        match value {
13083                            "networkPeerings" => Ok(__FieldTag::__network_peerings),
13084                            "network_peerings" => Ok(__FieldTag::__network_peerings),
13085                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
13086                            "next_page_token" => Ok(__FieldTag::__next_page_token),
13087                            "unreachable" => Ok(__FieldTag::__unreachable),
13088                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13089                        }
13090                    }
13091                }
13092                deserializer.deserialize_identifier(Visitor)
13093            }
13094        }
13095        struct Visitor;
13096        impl<'de> serde::de::Visitor<'de> for Visitor {
13097            type Value = ListNetworkPeeringsResponse;
13098            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13099                formatter.write_str("struct ListNetworkPeeringsResponse")
13100            }
13101            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13102            where
13103                A: serde::de::MapAccess<'de>,
13104            {
13105                #[allow(unused_imports)]
13106                use serde::de::Error;
13107                use std::option::Option::Some;
13108                let mut fields = std::collections::HashSet::new();
13109                let mut result = Self::Value::new();
13110                while let Some(tag) = map.next_key::<__FieldTag>()? {
13111                    #[allow(clippy::match_single_binding)]
13112                    match tag {
13113                        __FieldTag::__network_peerings => {
13114                            if !fields.insert(__FieldTag::__network_peerings) {
13115                                return std::result::Result::Err(A::Error::duplicate_field(
13116                                    "multiple values for network_peerings",
13117                                ));
13118                            }
13119                            result.network_peerings =
13120                                map.next_value::<std::option::Option<
13121                                    std::vec::Vec<crate::model::NetworkPeering>,
13122                                >>()?
13123                                .unwrap_or_default();
13124                        }
13125                        __FieldTag::__next_page_token => {
13126                            if !fields.insert(__FieldTag::__next_page_token) {
13127                                return std::result::Result::Err(A::Error::duplicate_field(
13128                                    "multiple values for next_page_token",
13129                                ));
13130                            }
13131                            result.next_page_token = map
13132                                .next_value::<std::option::Option<std::string::String>>()?
13133                                .unwrap_or_default();
13134                        }
13135                        __FieldTag::__unreachable => {
13136                            if !fields.insert(__FieldTag::__unreachable) {
13137                                return std::result::Result::Err(A::Error::duplicate_field(
13138                                    "multiple values for unreachable",
13139                                ));
13140                            }
13141                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
13142                        }
13143                        __FieldTag::Unknown(key) => {
13144                            let value = map.next_value::<serde_json::Value>()?;
13145                            result._unknown_fields.insert(key, value);
13146                        }
13147                    }
13148                }
13149                std::result::Result::Ok(result)
13150            }
13151        }
13152        deserializer.deserialize_any(Visitor)
13153    }
13154}
13155
13156#[doc(hidden)]
13157impl serde::ser::Serialize for ListNetworkPeeringsResponse {
13158    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13159    where
13160        S: serde::ser::Serializer,
13161    {
13162        use serde::ser::SerializeMap;
13163        #[allow(unused_imports)]
13164        use std::option::Option::Some;
13165        let mut state = serializer.serialize_map(std::option::Option::None)?;
13166        if !self.network_peerings.is_empty() {
13167            state.serialize_entry("networkPeerings", &self.network_peerings)?;
13168        }
13169        if !self.next_page_token.is_empty() {
13170            state.serialize_entry("nextPageToken", &self.next_page_token)?;
13171        }
13172        if !self.unreachable.is_empty() {
13173            state.serialize_entry("unreachable", &self.unreachable)?;
13174        }
13175        if !self._unknown_fields.is_empty() {
13176            for (key, value) in self._unknown_fields.iter() {
13177                state.serialize_entry(key, &value)?;
13178            }
13179        }
13180        state.end()
13181    }
13182}
13183
13184impl std::fmt::Debug for ListNetworkPeeringsResponse {
13185    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13186        let mut debug_struct = f.debug_struct("ListNetworkPeeringsResponse");
13187        debug_struct.field("network_peerings", &self.network_peerings);
13188        debug_struct.field("next_page_token", &self.next_page_token);
13189        debug_struct.field("unreachable", &self.unreachable);
13190        if !self._unknown_fields.is_empty() {
13191            debug_struct.field("_unknown_fields", &self._unknown_fields);
13192        }
13193        debug_struct.finish()
13194    }
13195}
13196
13197/// Request message for
13198/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
13199///
13200/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
13201#[derive(Clone, Default, PartialEq)]
13202#[non_exhaustive]
13203pub struct ListPeeringRoutesRequest {
13204    /// Required. The resource name of the network peering to retrieve peering
13205    /// routes from. Resource names are schemeless URIs that follow the conventions
13206    /// in <https://cloud.google.com/apis/design/resource_names>. For example:
13207    /// `projects/my-project/locations/global/networkPeerings/my-peering`
13208    pub parent: std::string::String,
13209
13210    /// The maximum number of peering routes to return in one page.
13211    /// The service may return fewer than this value.
13212    /// The maximum value is coerced to 1000.
13213    /// The default value of this field is 500.
13214    pub page_size: i32,
13215
13216    /// A page token, received from a previous `ListPeeringRoutes` call.
13217    /// Provide this to retrieve the subsequent page.
13218    /// When paginating, all other parameters provided to `ListPeeringRoutes` must
13219    /// match the call that provided the page token.
13220    pub page_token: std::string::String,
13221
13222    /// A filter expression that matches resources returned in the response.
13223    /// Currently, only filtering on the `direction` field is supported. To return
13224    /// routes imported from the peer network, provide "direction=INCOMING". To
13225    /// return routes exported from the VMware Engine network, provide
13226    /// "direction=OUTGOING". Other filter expressions return an error.
13227    pub filter: std::string::String,
13228
13229    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13230}
13231
13232impl ListPeeringRoutesRequest {
13233    pub fn new() -> Self {
13234        std::default::Default::default()
13235    }
13236
13237    /// Sets the value of [parent][crate::model::ListPeeringRoutesRequest::parent].
13238    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13239        self.parent = v.into();
13240        self
13241    }
13242
13243    /// Sets the value of [page_size][crate::model::ListPeeringRoutesRequest::page_size].
13244    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13245        self.page_size = v.into();
13246        self
13247    }
13248
13249    /// Sets the value of [page_token][crate::model::ListPeeringRoutesRequest::page_token].
13250    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13251        self.page_token = v.into();
13252        self
13253    }
13254
13255    /// Sets the value of [filter][crate::model::ListPeeringRoutesRequest::filter].
13256    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13257        self.filter = v.into();
13258        self
13259    }
13260}
13261
13262impl wkt::message::Message for ListPeeringRoutesRequest {
13263    fn typename() -> &'static str {
13264        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesRequest"
13265    }
13266}
13267
13268#[doc(hidden)]
13269impl<'de> serde::de::Deserialize<'de> for ListPeeringRoutesRequest {
13270    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13271    where
13272        D: serde::Deserializer<'de>,
13273    {
13274        #[allow(non_camel_case_types)]
13275        #[doc(hidden)]
13276        #[derive(PartialEq, Eq, Hash)]
13277        enum __FieldTag {
13278            __parent,
13279            __page_size,
13280            __page_token,
13281            __filter,
13282            Unknown(std::string::String),
13283        }
13284        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13285            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13286            where
13287                D: serde::Deserializer<'de>,
13288            {
13289                struct Visitor;
13290                impl<'de> serde::de::Visitor<'de> for Visitor {
13291                    type Value = __FieldTag;
13292                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13293                        formatter.write_str("a field name for ListPeeringRoutesRequest")
13294                    }
13295                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13296                    where
13297                        E: serde::de::Error,
13298                    {
13299                        use std::result::Result::Ok;
13300                        use std::string::ToString;
13301                        match value {
13302                            "parent" => Ok(__FieldTag::__parent),
13303                            "pageSize" => Ok(__FieldTag::__page_size),
13304                            "page_size" => Ok(__FieldTag::__page_size),
13305                            "pageToken" => Ok(__FieldTag::__page_token),
13306                            "page_token" => Ok(__FieldTag::__page_token),
13307                            "filter" => Ok(__FieldTag::__filter),
13308                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13309                        }
13310                    }
13311                }
13312                deserializer.deserialize_identifier(Visitor)
13313            }
13314        }
13315        struct Visitor;
13316        impl<'de> serde::de::Visitor<'de> for Visitor {
13317            type Value = ListPeeringRoutesRequest;
13318            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13319                formatter.write_str("struct ListPeeringRoutesRequest")
13320            }
13321            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13322            where
13323                A: serde::de::MapAccess<'de>,
13324            {
13325                #[allow(unused_imports)]
13326                use serde::de::Error;
13327                use std::option::Option::Some;
13328                let mut fields = std::collections::HashSet::new();
13329                let mut result = Self::Value::new();
13330                while let Some(tag) = map.next_key::<__FieldTag>()? {
13331                    #[allow(clippy::match_single_binding)]
13332                    match tag {
13333                        __FieldTag::__parent => {
13334                            if !fields.insert(__FieldTag::__parent) {
13335                                return std::result::Result::Err(A::Error::duplicate_field(
13336                                    "multiple values for parent",
13337                                ));
13338                            }
13339                            result.parent = map
13340                                .next_value::<std::option::Option<std::string::String>>()?
13341                                .unwrap_or_default();
13342                        }
13343                        __FieldTag::__page_size => {
13344                            if !fields.insert(__FieldTag::__page_size) {
13345                                return std::result::Result::Err(A::Error::duplicate_field(
13346                                    "multiple values for page_size",
13347                                ));
13348                            }
13349                            struct __With(std::option::Option<i32>);
13350                            impl<'de> serde::de::Deserialize<'de> for __With {
13351                                fn deserialize<D>(
13352                                    deserializer: D,
13353                                ) -> std::result::Result<Self, D::Error>
13354                                where
13355                                    D: serde::de::Deserializer<'de>,
13356                                {
13357                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13358                                }
13359                            }
13360                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
13361                        }
13362                        __FieldTag::__page_token => {
13363                            if !fields.insert(__FieldTag::__page_token) {
13364                                return std::result::Result::Err(A::Error::duplicate_field(
13365                                    "multiple values for page_token",
13366                                ));
13367                            }
13368                            result.page_token = map
13369                                .next_value::<std::option::Option<std::string::String>>()?
13370                                .unwrap_or_default();
13371                        }
13372                        __FieldTag::__filter => {
13373                            if !fields.insert(__FieldTag::__filter) {
13374                                return std::result::Result::Err(A::Error::duplicate_field(
13375                                    "multiple values for filter",
13376                                ));
13377                            }
13378                            result.filter = map
13379                                .next_value::<std::option::Option<std::string::String>>()?
13380                                .unwrap_or_default();
13381                        }
13382                        __FieldTag::Unknown(key) => {
13383                            let value = map.next_value::<serde_json::Value>()?;
13384                            result._unknown_fields.insert(key, value);
13385                        }
13386                    }
13387                }
13388                std::result::Result::Ok(result)
13389            }
13390        }
13391        deserializer.deserialize_any(Visitor)
13392    }
13393}
13394
13395#[doc(hidden)]
13396impl serde::ser::Serialize for ListPeeringRoutesRequest {
13397    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13398    where
13399        S: serde::ser::Serializer,
13400    {
13401        use serde::ser::SerializeMap;
13402        #[allow(unused_imports)]
13403        use std::option::Option::Some;
13404        let mut state = serializer.serialize_map(std::option::Option::None)?;
13405        if !self.parent.is_empty() {
13406            state.serialize_entry("parent", &self.parent)?;
13407        }
13408        if !wkt::internal::is_default(&self.page_size) {
13409            struct __With<'a>(&'a i32);
13410            impl<'a> serde::ser::Serialize for __With<'a> {
13411                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13412                where
13413                    S: serde::ser::Serializer,
13414                {
13415                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13416                }
13417            }
13418            state.serialize_entry("pageSize", &__With(&self.page_size))?;
13419        }
13420        if !self.page_token.is_empty() {
13421            state.serialize_entry("pageToken", &self.page_token)?;
13422        }
13423        if !self.filter.is_empty() {
13424            state.serialize_entry("filter", &self.filter)?;
13425        }
13426        if !self._unknown_fields.is_empty() {
13427            for (key, value) in self._unknown_fields.iter() {
13428                state.serialize_entry(key, &value)?;
13429            }
13430        }
13431        state.end()
13432    }
13433}
13434
13435impl std::fmt::Debug for ListPeeringRoutesRequest {
13436    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13437        let mut debug_struct = f.debug_struct("ListPeeringRoutesRequest");
13438        debug_struct.field("parent", &self.parent);
13439        debug_struct.field("page_size", &self.page_size);
13440        debug_struct.field("page_token", &self.page_token);
13441        debug_struct.field("filter", &self.filter);
13442        if !self._unknown_fields.is_empty() {
13443            debug_struct.field("_unknown_fields", &self._unknown_fields);
13444        }
13445        debug_struct.finish()
13446    }
13447}
13448
13449/// Response message for
13450/// [VmwareEngine.ListPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]
13451///
13452/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes]: crate::client::VmwareEngine::list_peering_routes
13453#[derive(Clone, Default, PartialEq)]
13454#[non_exhaustive]
13455pub struct ListPeeringRoutesResponse {
13456    /// A list of peering routes.
13457    pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
13458
13459    /// A token, which can be sent as `page_token` to retrieve the next page.
13460    /// If this field is omitted, there are no subsequent pages.
13461    pub next_page_token: std::string::String,
13462
13463    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13464}
13465
13466impl ListPeeringRoutesResponse {
13467    pub fn new() -> Self {
13468        std::default::Default::default()
13469    }
13470
13471    /// Sets the value of [peering_routes][crate::model::ListPeeringRoutesResponse::peering_routes].
13472    pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
13473    where
13474        T: std::iter::IntoIterator<Item = V>,
13475        V: std::convert::Into<crate::model::PeeringRoute>,
13476    {
13477        use std::iter::Iterator;
13478        self.peering_routes = v.into_iter().map(|i| i.into()).collect();
13479        self
13480    }
13481
13482    /// Sets the value of [next_page_token][crate::model::ListPeeringRoutesResponse::next_page_token].
13483    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13484        self.next_page_token = v.into();
13485        self
13486    }
13487}
13488
13489impl wkt::message::Message for ListPeeringRoutesResponse {
13490    fn typename() -> &'static str {
13491        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPeeringRoutesResponse"
13492    }
13493}
13494
13495#[doc(hidden)]
13496impl gax::paginator::internal::PageableResponse for ListPeeringRoutesResponse {
13497    type PageItem = crate::model::PeeringRoute;
13498
13499    fn items(self) -> std::vec::Vec<Self::PageItem> {
13500        self.peering_routes
13501    }
13502
13503    fn next_page_token(&self) -> std::string::String {
13504        use std::clone::Clone;
13505        self.next_page_token.clone()
13506    }
13507}
13508
13509#[doc(hidden)]
13510impl<'de> serde::de::Deserialize<'de> for ListPeeringRoutesResponse {
13511    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13512    where
13513        D: serde::Deserializer<'de>,
13514    {
13515        #[allow(non_camel_case_types)]
13516        #[doc(hidden)]
13517        #[derive(PartialEq, Eq, Hash)]
13518        enum __FieldTag {
13519            __peering_routes,
13520            __next_page_token,
13521            Unknown(std::string::String),
13522        }
13523        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13524            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13525            where
13526                D: serde::Deserializer<'de>,
13527            {
13528                struct Visitor;
13529                impl<'de> serde::de::Visitor<'de> for Visitor {
13530                    type Value = __FieldTag;
13531                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13532                        formatter.write_str("a field name for ListPeeringRoutesResponse")
13533                    }
13534                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13535                    where
13536                        E: serde::de::Error,
13537                    {
13538                        use std::result::Result::Ok;
13539                        use std::string::ToString;
13540                        match value {
13541                            "peeringRoutes" => Ok(__FieldTag::__peering_routes),
13542                            "peering_routes" => Ok(__FieldTag::__peering_routes),
13543                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
13544                            "next_page_token" => Ok(__FieldTag::__next_page_token),
13545                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13546                        }
13547                    }
13548                }
13549                deserializer.deserialize_identifier(Visitor)
13550            }
13551        }
13552        struct Visitor;
13553        impl<'de> serde::de::Visitor<'de> for Visitor {
13554            type Value = ListPeeringRoutesResponse;
13555            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13556                formatter.write_str("struct ListPeeringRoutesResponse")
13557            }
13558            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13559            where
13560                A: serde::de::MapAccess<'de>,
13561            {
13562                #[allow(unused_imports)]
13563                use serde::de::Error;
13564                use std::option::Option::Some;
13565                let mut fields = std::collections::HashSet::new();
13566                let mut result = Self::Value::new();
13567                while let Some(tag) = map.next_key::<__FieldTag>()? {
13568                    #[allow(clippy::match_single_binding)]
13569                    match tag {
13570                        __FieldTag::__peering_routes => {
13571                            if !fields.insert(__FieldTag::__peering_routes) {
13572                                return std::result::Result::Err(A::Error::duplicate_field(
13573                                    "multiple values for peering_routes",
13574                                ));
13575                            }
13576                            result.peering_routes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PeeringRoute>>>()?.unwrap_or_default();
13577                        }
13578                        __FieldTag::__next_page_token => {
13579                            if !fields.insert(__FieldTag::__next_page_token) {
13580                                return std::result::Result::Err(A::Error::duplicate_field(
13581                                    "multiple values for next_page_token",
13582                                ));
13583                            }
13584                            result.next_page_token = map
13585                                .next_value::<std::option::Option<std::string::String>>()?
13586                                .unwrap_or_default();
13587                        }
13588                        __FieldTag::Unknown(key) => {
13589                            let value = map.next_value::<serde_json::Value>()?;
13590                            result._unknown_fields.insert(key, value);
13591                        }
13592                    }
13593                }
13594                std::result::Result::Ok(result)
13595            }
13596        }
13597        deserializer.deserialize_any(Visitor)
13598    }
13599}
13600
13601#[doc(hidden)]
13602impl serde::ser::Serialize for ListPeeringRoutesResponse {
13603    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13604    where
13605        S: serde::ser::Serializer,
13606    {
13607        use serde::ser::SerializeMap;
13608        #[allow(unused_imports)]
13609        use std::option::Option::Some;
13610        let mut state = serializer.serialize_map(std::option::Option::None)?;
13611        if !self.peering_routes.is_empty() {
13612            state.serialize_entry("peeringRoutes", &self.peering_routes)?;
13613        }
13614        if !self.next_page_token.is_empty() {
13615            state.serialize_entry("nextPageToken", &self.next_page_token)?;
13616        }
13617        if !self._unknown_fields.is_empty() {
13618            for (key, value) in self._unknown_fields.iter() {
13619                state.serialize_entry(key, &value)?;
13620            }
13621        }
13622        state.end()
13623    }
13624}
13625
13626impl std::fmt::Debug for ListPeeringRoutesResponse {
13627    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13628        let mut debug_struct = f.debug_struct("ListPeeringRoutesResponse");
13629        debug_struct.field("peering_routes", &self.peering_routes);
13630        debug_struct.field("next_page_token", &self.next_page_token);
13631        if !self._unknown_fields.is_empty() {
13632            debug_struct.field("_unknown_fields", &self._unknown_fields);
13633        }
13634        debug_struct.finish()
13635    }
13636}
13637
13638/// Request message for
13639/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
13640///
13641/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
13642#[derive(Clone, Default, PartialEq)]
13643#[non_exhaustive]
13644pub struct ListNetworkPoliciesRequest {
13645    /// Required. The resource name of the location (region) to query for
13646    /// network policies. Resource names are schemeless URIs that follow the
13647    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
13648    /// example: `projects/my-project/locations/us-central1`
13649    pub parent: std::string::String,
13650
13651    /// The maximum number of network policies to return in one page.
13652    /// The service may return fewer than this value.
13653    /// The maximum value is coerced to 1000.
13654    /// The default value of this field is 500.
13655    pub page_size: i32,
13656
13657    /// A page token, received from a previous `ListNetworkPolicies` call.
13658    /// Provide this to retrieve the subsequent page.
13659    ///
13660    /// When paginating, all other parameters provided to
13661    /// `ListNetworkPolicies` must match the call that provided the page
13662    /// token.
13663    pub page_token: std::string::String,
13664
13665    /// A filter expression that matches resources returned in the response.
13666    /// The expression must specify the field name, a comparison
13667    /// operator, and the value that you want to use for filtering. The value
13668    /// must be a string, a number, or a boolean. The comparison operator
13669    /// must be `=`, `!=`, `>`, or `<`.
13670    ///
13671    /// For example, if you are filtering a list of network policies, you can
13672    /// exclude the ones named `example-policy` by specifying
13673    /// `name != "example-policy"`.
13674    ///
13675    /// To filter on multiple expressions, provide each separate expression within
13676    /// parentheses. For example:
13677    ///
13678    /// ```norust
13679    /// (name = "example-policy")
13680    /// (createTime > "2021-04-12T08:15:10.40Z")
13681    /// ```
13682    ///
13683    /// By default, each expression is an `AND` expression. However, you
13684    /// can include `AND` and `OR` expressions explicitly.
13685    /// For example:
13686    ///
13687    /// ```norust
13688    /// (name = "example-policy-1") AND
13689    /// (createTime > "2021-04-12T08:15:10.40Z") OR
13690    /// (name = "example-policy-2")
13691    /// ```
13692    pub filter: std::string::String,
13693
13694    /// Sorts list results by a certain order. By default, returned results
13695    /// are ordered by `name` in ascending order.
13696    /// You can also sort results in descending order based on the `name` value
13697    /// using `orderBy="name desc"`.
13698    /// Currently, only ordering by `name` is supported.
13699    pub order_by: std::string::String,
13700
13701    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13702}
13703
13704impl ListNetworkPoliciesRequest {
13705    pub fn new() -> Self {
13706        std::default::Default::default()
13707    }
13708
13709    /// Sets the value of [parent][crate::model::ListNetworkPoliciesRequest::parent].
13710    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13711        self.parent = v.into();
13712        self
13713    }
13714
13715    /// Sets the value of [page_size][crate::model::ListNetworkPoliciesRequest::page_size].
13716    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13717        self.page_size = v.into();
13718        self
13719    }
13720
13721    /// Sets the value of [page_token][crate::model::ListNetworkPoliciesRequest::page_token].
13722    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13723        self.page_token = v.into();
13724        self
13725    }
13726
13727    /// Sets the value of [filter][crate::model::ListNetworkPoliciesRequest::filter].
13728    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13729        self.filter = v.into();
13730        self
13731    }
13732
13733    /// Sets the value of [order_by][crate::model::ListNetworkPoliciesRequest::order_by].
13734    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13735        self.order_by = v.into();
13736        self
13737    }
13738}
13739
13740impl wkt::message::Message for ListNetworkPoliciesRequest {
13741    fn typename() -> &'static str {
13742        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"
13743    }
13744}
13745
13746#[doc(hidden)]
13747impl<'de> serde::de::Deserialize<'de> for ListNetworkPoliciesRequest {
13748    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13749    where
13750        D: serde::Deserializer<'de>,
13751    {
13752        #[allow(non_camel_case_types)]
13753        #[doc(hidden)]
13754        #[derive(PartialEq, Eq, Hash)]
13755        enum __FieldTag {
13756            __parent,
13757            __page_size,
13758            __page_token,
13759            __filter,
13760            __order_by,
13761            Unknown(std::string::String),
13762        }
13763        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13764            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13765            where
13766                D: serde::Deserializer<'de>,
13767            {
13768                struct Visitor;
13769                impl<'de> serde::de::Visitor<'de> for Visitor {
13770                    type Value = __FieldTag;
13771                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13772                        formatter.write_str("a field name for ListNetworkPoliciesRequest")
13773                    }
13774                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13775                    where
13776                        E: serde::de::Error,
13777                    {
13778                        use std::result::Result::Ok;
13779                        use std::string::ToString;
13780                        match value {
13781                            "parent" => Ok(__FieldTag::__parent),
13782                            "pageSize" => Ok(__FieldTag::__page_size),
13783                            "page_size" => Ok(__FieldTag::__page_size),
13784                            "pageToken" => Ok(__FieldTag::__page_token),
13785                            "page_token" => Ok(__FieldTag::__page_token),
13786                            "filter" => Ok(__FieldTag::__filter),
13787                            "orderBy" => Ok(__FieldTag::__order_by),
13788                            "order_by" => Ok(__FieldTag::__order_by),
13789                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13790                        }
13791                    }
13792                }
13793                deserializer.deserialize_identifier(Visitor)
13794            }
13795        }
13796        struct Visitor;
13797        impl<'de> serde::de::Visitor<'de> for Visitor {
13798            type Value = ListNetworkPoliciesRequest;
13799            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13800                formatter.write_str("struct ListNetworkPoliciesRequest")
13801            }
13802            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13803            where
13804                A: serde::de::MapAccess<'de>,
13805            {
13806                #[allow(unused_imports)]
13807                use serde::de::Error;
13808                use std::option::Option::Some;
13809                let mut fields = std::collections::HashSet::new();
13810                let mut result = Self::Value::new();
13811                while let Some(tag) = map.next_key::<__FieldTag>()? {
13812                    #[allow(clippy::match_single_binding)]
13813                    match tag {
13814                        __FieldTag::__parent => {
13815                            if !fields.insert(__FieldTag::__parent) {
13816                                return std::result::Result::Err(A::Error::duplicate_field(
13817                                    "multiple values for parent",
13818                                ));
13819                            }
13820                            result.parent = map
13821                                .next_value::<std::option::Option<std::string::String>>()?
13822                                .unwrap_or_default();
13823                        }
13824                        __FieldTag::__page_size => {
13825                            if !fields.insert(__FieldTag::__page_size) {
13826                                return std::result::Result::Err(A::Error::duplicate_field(
13827                                    "multiple values for page_size",
13828                                ));
13829                            }
13830                            struct __With(std::option::Option<i32>);
13831                            impl<'de> serde::de::Deserialize<'de> for __With {
13832                                fn deserialize<D>(
13833                                    deserializer: D,
13834                                ) -> std::result::Result<Self, D::Error>
13835                                where
13836                                    D: serde::de::Deserializer<'de>,
13837                                {
13838                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13839                                }
13840                            }
13841                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
13842                        }
13843                        __FieldTag::__page_token => {
13844                            if !fields.insert(__FieldTag::__page_token) {
13845                                return std::result::Result::Err(A::Error::duplicate_field(
13846                                    "multiple values for page_token",
13847                                ));
13848                            }
13849                            result.page_token = map
13850                                .next_value::<std::option::Option<std::string::String>>()?
13851                                .unwrap_or_default();
13852                        }
13853                        __FieldTag::__filter => {
13854                            if !fields.insert(__FieldTag::__filter) {
13855                                return std::result::Result::Err(A::Error::duplicate_field(
13856                                    "multiple values for filter",
13857                                ));
13858                            }
13859                            result.filter = map
13860                                .next_value::<std::option::Option<std::string::String>>()?
13861                                .unwrap_or_default();
13862                        }
13863                        __FieldTag::__order_by => {
13864                            if !fields.insert(__FieldTag::__order_by) {
13865                                return std::result::Result::Err(A::Error::duplicate_field(
13866                                    "multiple values for order_by",
13867                                ));
13868                            }
13869                            result.order_by = map
13870                                .next_value::<std::option::Option<std::string::String>>()?
13871                                .unwrap_or_default();
13872                        }
13873                        __FieldTag::Unknown(key) => {
13874                            let value = map.next_value::<serde_json::Value>()?;
13875                            result._unknown_fields.insert(key, value);
13876                        }
13877                    }
13878                }
13879                std::result::Result::Ok(result)
13880            }
13881        }
13882        deserializer.deserialize_any(Visitor)
13883    }
13884}
13885
13886#[doc(hidden)]
13887impl serde::ser::Serialize for ListNetworkPoliciesRequest {
13888    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13889    where
13890        S: serde::ser::Serializer,
13891    {
13892        use serde::ser::SerializeMap;
13893        #[allow(unused_imports)]
13894        use std::option::Option::Some;
13895        let mut state = serializer.serialize_map(std::option::Option::None)?;
13896        if !self.parent.is_empty() {
13897            state.serialize_entry("parent", &self.parent)?;
13898        }
13899        if !wkt::internal::is_default(&self.page_size) {
13900            struct __With<'a>(&'a i32);
13901            impl<'a> serde::ser::Serialize for __With<'a> {
13902                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13903                where
13904                    S: serde::ser::Serializer,
13905                {
13906                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13907                }
13908            }
13909            state.serialize_entry("pageSize", &__With(&self.page_size))?;
13910        }
13911        if !self.page_token.is_empty() {
13912            state.serialize_entry("pageToken", &self.page_token)?;
13913        }
13914        if !self.filter.is_empty() {
13915            state.serialize_entry("filter", &self.filter)?;
13916        }
13917        if !self.order_by.is_empty() {
13918            state.serialize_entry("orderBy", &self.order_by)?;
13919        }
13920        if !self._unknown_fields.is_empty() {
13921            for (key, value) in self._unknown_fields.iter() {
13922                state.serialize_entry(key, &value)?;
13923            }
13924        }
13925        state.end()
13926    }
13927}
13928
13929impl std::fmt::Debug for ListNetworkPoliciesRequest {
13930    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13931        let mut debug_struct = f.debug_struct("ListNetworkPoliciesRequest");
13932        debug_struct.field("parent", &self.parent);
13933        debug_struct.field("page_size", &self.page_size);
13934        debug_struct.field("page_token", &self.page_token);
13935        debug_struct.field("filter", &self.filter);
13936        debug_struct.field("order_by", &self.order_by);
13937        if !self._unknown_fields.is_empty() {
13938            debug_struct.field("_unknown_fields", &self._unknown_fields);
13939        }
13940        debug_struct.finish()
13941    }
13942}
13943
13944/// Response message for
13945/// [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]
13946///
13947/// [google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies]: crate::client::VmwareEngine::list_network_policies
13948#[derive(Clone, Default, PartialEq)]
13949#[non_exhaustive]
13950pub struct ListNetworkPoliciesResponse {
13951    /// A list of network policies.
13952    pub network_policies: std::vec::Vec<crate::model::NetworkPolicy>,
13953
13954    /// A token, which can be send as `page_token` to retrieve the next page.
13955    /// If this field is omitted, there are no subsequent pages.
13956    pub next_page_token: std::string::String,
13957
13958    /// Locations that could not be reached when making an aggregated query using
13959    /// wildcards.
13960    pub unreachable: std::vec::Vec<std::string::String>,
13961
13962    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13963}
13964
13965impl ListNetworkPoliciesResponse {
13966    pub fn new() -> Self {
13967        std::default::Default::default()
13968    }
13969
13970    /// Sets the value of [network_policies][crate::model::ListNetworkPoliciesResponse::network_policies].
13971    pub fn set_network_policies<T, V>(mut self, v: T) -> Self
13972    where
13973        T: std::iter::IntoIterator<Item = V>,
13974        V: std::convert::Into<crate::model::NetworkPolicy>,
13975    {
13976        use std::iter::Iterator;
13977        self.network_policies = v.into_iter().map(|i| i.into()).collect();
13978        self
13979    }
13980
13981    /// Sets the value of [next_page_token][crate::model::ListNetworkPoliciesResponse::next_page_token].
13982    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13983        self.next_page_token = v.into();
13984        self
13985    }
13986
13987    /// Sets the value of [unreachable][crate::model::ListNetworkPoliciesResponse::unreachable].
13988    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13989    where
13990        T: std::iter::IntoIterator<Item = V>,
13991        V: std::convert::Into<std::string::String>,
13992    {
13993        use std::iter::Iterator;
13994        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13995        self
13996    }
13997}
13998
13999impl wkt::message::Message for ListNetworkPoliciesResponse {
14000    fn typename() -> &'static str {
14001        "type.googleapis.com/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"
14002    }
14003}
14004
14005#[doc(hidden)]
14006impl gax::paginator::internal::PageableResponse for ListNetworkPoliciesResponse {
14007    type PageItem = crate::model::NetworkPolicy;
14008
14009    fn items(self) -> std::vec::Vec<Self::PageItem> {
14010        self.network_policies
14011    }
14012
14013    fn next_page_token(&self) -> std::string::String {
14014        use std::clone::Clone;
14015        self.next_page_token.clone()
14016    }
14017}
14018
14019#[doc(hidden)]
14020impl<'de> serde::de::Deserialize<'de> for ListNetworkPoliciesResponse {
14021    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14022    where
14023        D: serde::Deserializer<'de>,
14024    {
14025        #[allow(non_camel_case_types)]
14026        #[doc(hidden)]
14027        #[derive(PartialEq, Eq, Hash)]
14028        enum __FieldTag {
14029            __network_policies,
14030            __next_page_token,
14031            __unreachable,
14032            Unknown(std::string::String),
14033        }
14034        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14035            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14036            where
14037                D: serde::Deserializer<'de>,
14038            {
14039                struct Visitor;
14040                impl<'de> serde::de::Visitor<'de> for Visitor {
14041                    type Value = __FieldTag;
14042                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14043                        formatter.write_str("a field name for ListNetworkPoliciesResponse")
14044                    }
14045                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14046                    where
14047                        E: serde::de::Error,
14048                    {
14049                        use std::result::Result::Ok;
14050                        use std::string::ToString;
14051                        match value {
14052                            "networkPolicies" => Ok(__FieldTag::__network_policies),
14053                            "network_policies" => Ok(__FieldTag::__network_policies),
14054                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
14055                            "next_page_token" => Ok(__FieldTag::__next_page_token),
14056                            "unreachable" => Ok(__FieldTag::__unreachable),
14057                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14058                        }
14059                    }
14060                }
14061                deserializer.deserialize_identifier(Visitor)
14062            }
14063        }
14064        struct Visitor;
14065        impl<'de> serde::de::Visitor<'de> for Visitor {
14066            type Value = ListNetworkPoliciesResponse;
14067            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14068                formatter.write_str("struct ListNetworkPoliciesResponse")
14069            }
14070            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14071            where
14072                A: serde::de::MapAccess<'de>,
14073            {
14074                #[allow(unused_imports)]
14075                use serde::de::Error;
14076                use std::option::Option::Some;
14077                let mut fields = std::collections::HashSet::new();
14078                let mut result = Self::Value::new();
14079                while let Some(tag) = map.next_key::<__FieldTag>()? {
14080                    #[allow(clippy::match_single_binding)]
14081                    match tag {
14082                        __FieldTag::__network_policies => {
14083                            if !fields.insert(__FieldTag::__network_policies) {
14084                                return std::result::Result::Err(A::Error::duplicate_field(
14085                                    "multiple values for network_policies",
14086                                ));
14087                            }
14088                            result.network_policies = map.next_value::<std::option::Option<std::vec::Vec<crate::model::NetworkPolicy>>>()?.unwrap_or_default();
14089                        }
14090                        __FieldTag::__next_page_token => {
14091                            if !fields.insert(__FieldTag::__next_page_token) {
14092                                return std::result::Result::Err(A::Error::duplicate_field(
14093                                    "multiple values for next_page_token",
14094                                ));
14095                            }
14096                            result.next_page_token = map
14097                                .next_value::<std::option::Option<std::string::String>>()?
14098                                .unwrap_or_default();
14099                        }
14100                        __FieldTag::__unreachable => {
14101                            if !fields.insert(__FieldTag::__unreachable) {
14102                                return std::result::Result::Err(A::Error::duplicate_field(
14103                                    "multiple values for unreachable",
14104                                ));
14105                            }
14106                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
14107                        }
14108                        __FieldTag::Unknown(key) => {
14109                            let value = map.next_value::<serde_json::Value>()?;
14110                            result._unknown_fields.insert(key, value);
14111                        }
14112                    }
14113                }
14114                std::result::Result::Ok(result)
14115            }
14116        }
14117        deserializer.deserialize_any(Visitor)
14118    }
14119}
14120
14121#[doc(hidden)]
14122impl serde::ser::Serialize for ListNetworkPoliciesResponse {
14123    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14124    where
14125        S: serde::ser::Serializer,
14126    {
14127        use serde::ser::SerializeMap;
14128        #[allow(unused_imports)]
14129        use std::option::Option::Some;
14130        let mut state = serializer.serialize_map(std::option::Option::None)?;
14131        if !self.network_policies.is_empty() {
14132            state.serialize_entry("networkPolicies", &self.network_policies)?;
14133        }
14134        if !self.next_page_token.is_empty() {
14135            state.serialize_entry("nextPageToken", &self.next_page_token)?;
14136        }
14137        if !self.unreachable.is_empty() {
14138            state.serialize_entry("unreachable", &self.unreachable)?;
14139        }
14140        if !self._unknown_fields.is_empty() {
14141            for (key, value) in self._unknown_fields.iter() {
14142                state.serialize_entry(key, &value)?;
14143            }
14144        }
14145        state.end()
14146    }
14147}
14148
14149impl std::fmt::Debug for ListNetworkPoliciesResponse {
14150    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14151        let mut debug_struct = f.debug_struct("ListNetworkPoliciesResponse");
14152        debug_struct.field("network_policies", &self.network_policies);
14153        debug_struct.field("next_page_token", &self.next_page_token);
14154        debug_struct.field("unreachable", &self.unreachable);
14155        if !self._unknown_fields.is_empty() {
14156            debug_struct.field("_unknown_fields", &self._unknown_fields);
14157        }
14158        debug_struct.finish()
14159    }
14160}
14161
14162/// Request message for
14163/// [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]
14164///
14165/// [google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy]: crate::client::VmwareEngine::get_network_policy
14166#[derive(Clone, Default, PartialEq)]
14167#[non_exhaustive]
14168pub struct GetNetworkPolicyRequest {
14169    /// Required. The resource name of the network policy to retrieve.
14170    /// Resource names are schemeless URIs that follow the conventions in
14171    /// <https://cloud.google.com/apis/design/resource_names>.
14172    /// For example:
14173    /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
14174    pub name: std::string::String,
14175
14176    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14177}
14178
14179impl GetNetworkPolicyRequest {
14180    pub fn new() -> Self {
14181        std::default::Default::default()
14182    }
14183
14184    /// Sets the value of [name][crate::model::GetNetworkPolicyRequest::name].
14185    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14186        self.name = v.into();
14187        self
14188    }
14189}
14190
14191impl wkt::message::Message for GetNetworkPolicyRequest {
14192    fn typename() -> &'static str {
14193        "type.googleapis.com/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"
14194    }
14195}
14196
14197#[doc(hidden)]
14198impl<'de> serde::de::Deserialize<'de> for GetNetworkPolicyRequest {
14199    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14200    where
14201        D: serde::Deserializer<'de>,
14202    {
14203        #[allow(non_camel_case_types)]
14204        #[doc(hidden)]
14205        #[derive(PartialEq, Eq, Hash)]
14206        enum __FieldTag {
14207            __name,
14208            Unknown(std::string::String),
14209        }
14210        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14211            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14212            where
14213                D: serde::Deserializer<'de>,
14214            {
14215                struct Visitor;
14216                impl<'de> serde::de::Visitor<'de> for Visitor {
14217                    type Value = __FieldTag;
14218                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14219                        formatter.write_str("a field name for GetNetworkPolicyRequest")
14220                    }
14221                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14222                    where
14223                        E: serde::de::Error,
14224                    {
14225                        use std::result::Result::Ok;
14226                        use std::string::ToString;
14227                        match value {
14228                            "name" => Ok(__FieldTag::__name),
14229                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14230                        }
14231                    }
14232                }
14233                deserializer.deserialize_identifier(Visitor)
14234            }
14235        }
14236        struct Visitor;
14237        impl<'de> serde::de::Visitor<'de> for Visitor {
14238            type Value = GetNetworkPolicyRequest;
14239            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14240                formatter.write_str("struct GetNetworkPolicyRequest")
14241            }
14242            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14243            where
14244                A: serde::de::MapAccess<'de>,
14245            {
14246                #[allow(unused_imports)]
14247                use serde::de::Error;
14248                use std::option::Option::Some;
14249                let mut fields = std::collections::HashSet::new();
14250                let mut result = Self::Value::new();
14251                while let Some(tag) = map.next_key::<__FieldTag>()? {
14252                    #[allow(clippy::match_single_binding)]
14253                    match tag {
14254                        __FieldTag::__name => {
14255                            if !fields.insert(__FieldTag::__name) {
14256                                return std::result::Result::Err(A::Error::duplicate_field(
14257                                    "multiple values for name",
14258                                ));
14259                            }
14260                            result.name = map
14261                                .next_value::<std::option::Option<std::string::String>>()?
14262                                .unwrap_or_default();
14263                        }
14264                        __FieldTag::Unknown(key) => {
14265                            let value = map.next_value::<serde_json::Value>()?;
14266                            result._unknown_fields.insert(key, value);
14267                        }
14268                    }
14269                }
14270                std::result::Result::Ok(result)
14271            }
14272        }
14273        deserializer.deserialize_any(Visitor)
14274    }
14275}
14276
14277#[doc(hidden)]
14278impl serde::ser::Serialize for GetNetworkPolicyRequest {
14279    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14280    where
14281        S: serde::ser::Serializer,
14282    {
14283        use serde::ser::SerializeMap;
14284        #[allow(unused_imports)]
14285        use std::option::Option::Some;
14286        let mut state = serializer.serialize_map(std::option::Option::None)?;
14287        if !self.name.is_empty() {
14288            state.serialize_entry("name", &self.name)?;
14289        }
14290        if !self._unknown_fields.is_empty() {
14291            for (key, value) in self._unknown_fields.iter() {
14292                state.serialize_entry(key, &value)?;
14293            }
14294        }
14295        state.end()
14296    }
14297}
14298
14299impl std::fmt::Debug for GetNetworkPolicyRequest {
14300    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14301        let mut debug_struct = f.debug_struct("GetNetworkPolicyRequest");
14302        debug_struct.field("name", &self.name);
14303        if !self._unknown_fields.is_empty() {
14304            debug_struct.field("_unknown_fields", &self._unknown_fields);
14305        }
14306        debug_struct.finish()
14307    }
14308}
14309
14310/// Request message for
14311/// [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]
14312///
14313/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy]: crate::client::VmwareEngine::update_network_policy
14314#[derive(Clone, Default, PartialEq)]
14315#[non_exhaustive]
14316pub struct UpdateNetworkPolicyRequest {
14317    /// Required. Network policy description.
14318    pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
14319
14320    /// Required. Field mask is used to specify the fields to be overwritten in the
14321    /// `NetworkPolicy` resource by the update.
14322    /// The fields specified in the `update_mask` are relative to the resource, not
14323    /// the full request. A field will be overwritten if it is in the mask. If the
14324    /// user does not provide a mask then all fields will be overwritten.
14325    pub update_mask: std::option::Option<wkt::FieldMask>,
14326
14327    /// Optional. A request ID to identify requests. Specify a unique request ID
14328    /// so that if you must retry your request, the server will know to ignore
14329    /// the request if it has already been completed. The server guarantees that a
14330    /// request doesn't result in creation of duplicate commitments for at least 60
14331    /// minutes.
14332    ///
14333    /// For example, consider a situation where you make an initial request and the
14334    /// request times out. If you make the request again with the same request
14335    /// ID, the server can check if original operation with the same request ID
14336    /// was received, and if so, will ignore the second request. This prevents
14337    /// clients from accidentally creating duplicate commitments.
14338    ///
14339    /// The request ID must be a valid UUID with the exception that zero UUID is
14340    /// not supported (00000000-0000-0000-0000-000000000000).
14341    pub request_id: std::string::String,
14342
14343    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14344}
14345
14346impl UpdateNetworkPolicyRequest {
14347    pub fn new() -> Self {
14348        std::default::Default::default()
14349    }
14350
14351    /// Sets the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
14352    pub fn set_network_policy<T>(mut self, v: T) -> Self
14353    where
14354        T: std::convert::Into<crate::model::NetworkPolicy>,
14355    {
14356        self.network_policy = std::option::Option::Some(v.into());
14357        self
14358    }
14359
14360    /// Sets or clears the value of [network_policy][crate::model::UpdateNetworkPolicyRequest::network_policy].
14361    pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
14362    where
14363        T: std::convert::Into<crate::model::NetworkPolicy>,
14364    {
14365        self.network_policy = v.map(|x| x.into());
14366        self
14367    }
14368
14369    /// Sets the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
14370    pub fn set_update_mask<T>(mut self, v: T) -> Self
14371    where
14372        T: std::convert::Into<wkt::FieldMask>,
14373    {
14374        self.update_mask = std::option::Option::Some(v.into());
14375        self
14376    }
14377
14378    /// Sets or clears the value of [update_mask][crate::model::UpdateNetworkPolicyRequest::update_mask].
14379    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14380    where
14381        T: std::convert::Into<wkt::FieldMask>,
14382    {
14383        self.update_mask = v.map(|x| x.into());
14384        self
14385    }
14386
14387    /// Sets the value of [request_id][crate::model::UpdateNetworkPolicyRequest::request_id].
14388    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14389        self.request_id = v.into();
14390        self
14391    }
14392}
14393
14394impl wkt::message::Message for UpdateNetworkPolicyRequest {
14395    fn typename() -> &'static str {
14396        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"
14397    }
14398}
14399
14400#[doc(hidden)]
14401impl<'de> serde::de::Deserialize<'de> for UpdateNetworkPolicyRequest {
14402    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14403    where
14404        D: serde::Deserializer<'de>,
14405    {
14406        #[allow(non_camel_case_types)]
14407        #[doc(hidden)]
14408        #[derive(PartialEq, Eq, Hash)]
14409        enum __FieldTag {
14410            __network_policy,
14411            __update_mask,
14412            __request_id,
14413            Unknown(std::string::String),
14414        }
14415        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14416            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14417            where
14418                D: serde::Deserializer<'de>,
14419            {
14420                struct Visitor;
14421                impl<'de> serde::de::Visitor<'de> for Visitor {
14422                    type Value = __FieldTag;
14423                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14424                        formatter.write_str("a field name for UpdateNetworkPolicyRequest")
14425                    }
14426                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14427                    where
14428                        E: serde::de::Error,
14429                    {
14430                        use std::result::Result::Ok;
14431                        use std::string::ToString;
14432                        match value {
14433                            "networkPolicy" => Ok(__FieldTag::__network_policy),
14434                            "network_policy" => Ok(__FieldTag::__network_policy),
14435                            "updateMask" => Ok(__FieldTag::__update_mask),
14436                            "update_mask" => Ok(__FieldTag::__update_mask),
14437                            "requestId" => Ok(__FieldTag::__request_id),
14438                            "request_id" => Ok(__FieldTag::__request_id),
14439                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14440                        }
14441                    }
14442                }
14443                deserializer.deserialize_identifier(Visitor)
14444            }
14445        }
14446        struct Visitor;
14447        impl<'de> serde::de::Visitor<'de> for Visitor {
14448            type Value = UpdateNetworkPolicyRequest;
14449            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14450                formatter.write_str("struct UpdateNetworkPolicyRequest")
14451            }
14452            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14453            where
14454                A: serde::de::MapAccess<'de>,
14455            {
14456                #[allow(unused_imports)]
14457                use serde::de::Error;
14458                use std::option::Option::Some;
14459                let mut fields = std::collections::HashSet::new();
14460                let mut result = Self::Value::new();
14461                while let Some(tag) = map.next_key::<__FieldTag>()? {
14462                    #[allow(clippy::match_single_binding)]
14463                    match tag {
14464                        __FieldTag::__network_policy => {
14465                            if !fields.insert(__FieldTag::__network_policy) {
14466                                return std::result::Result::Err(A::Error::duplicate_field(
14467                                    "multiple values for network_policy",
14468                                ));
14469                            }
14470                            result.network_policy = map
14471                                .next_value::<std::option::Option<crate::model::NetworkPolicy>>()?;
14472                        }
14473                        __FieldTag::__update_mask => {
14474                            if !fields.insert(__FieldTag::__update_mask) {
14475                                return std::result::Result::Err(A::Error::duplicate_field(
14476                                    "multiple values for update_mask",
14477                                ));
14478                            }
14479                            result.update_mask =
14480                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
14481                        }
14482                        __FieldTag::__request_id => {
14483                            if !fields.insert(__FieldTag::__request_id) {
14484                                return std::result::Result::Err(A::Error::duplicate_field(
14485                                    "multiple values for request_id",
14486                                ));
14487                            }
14488                            result.request_id = map
14489                                .next_value::<std::option::Option<std::string::String>>()?
14490                                .unwrap_or_default();
14491                        }
14492                        __FieldTag::Unknown(key) => {
14493                            let value = map.next_value::<serde_json::Value>()?;
14494                            result._unknown_fields.insert(key, value);
14495                        }
14496                    }
14497                }
14498                std::result::Result::Ok(result)
14499            }
14500        }
14501        deserializer.deserialize_any(Visitor)
14502    }
14503}
14504
14505#[doc(hidden)]
14506impl serde::ser::Serialize for UpdateNetworkPolicyRequest {
14507    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14508    where
14509        S: serde::ser::Serializer,
14510    {
14511        use serde::ser::SerializeMap;
14512        #[allow(unused_imports)]
14513        use std::option::Option::Some;
14514        let mut state = serializer.serialize_map(std::option::Option::None)?;
14515        if self.network_policy.is_some() {
14516            state.serialize_entry("networkPolicy", &self.network_policy)?;
14517        }
14518        if self.update_mask.is_some() {
14519            state.serialize_entry("updateMask", &self.update_mask)?;
14520        }
14521        if !self.request_id.is_empty() {
14522            state.serialize_entry("requestId", &self.request_id)?;
14523        }
14524        if !self._unknown_fields.is_empty() {
14525            for (key, value) in self._unknown_fields.iter() {
14526                state.serialize_entry(key, &value)?;
14527            }
14528        }
14529        state.end()
14530    }
14531}
14532
14533impl std::fmt::Debug for UpdateNetworkPolicyRequest {
14534    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14535        let mut debug_struct = f.debug_struct("UpdateNetworkPolicyRequest");
14536        debug_struct.field("network_policy", &self.network_policy);
14537        debug_struct.field("update_mask", &self.update_mask);
14538        debug_struct.field("request_id", &self.request_id);
14539        if !self._unknown_fields.is_empty() {
14540            debug_struct.field("_unknown_fields", &self._unknown_fields);
14541        }
14542        debug_struct.finish()
14543    }
14544}
14545
14546/// Request message for
14547/// [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]
14548///
14549/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy]: crate::client::VmwareEngine::create_network_policy
14550#[derive(Clone, Default, PartialEq)]
14551#[non_exhaustive]
14552pub struct CreateNetworkPolicyRequest {
14553    /// Required. The resource name of the location (region)
14554    /// to create the new network policy in.
14555    /// Resource names are schemeless URIs that follow the conventions in
14556    /// <https://cloud.google.com/apis/design/resource_names>.
14557    /// For example:
14558    /// `projects/my-project/locations/us-central1`
14559    pub parent: std::string::String,
14560
14561    /// Required. The user-provided identifier of the network policy to be created.
14562    /// This identifier must be unique within parent
14563    /// `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes
14564    /// the final token in the name URI.
14565    /// The identifier must meet the following requirements:
14566    ///
14567    /// * Only contains 1-63 alphanumeric characters and hyphens
14568    /// * Begins with an alphabetical character
14569    /// * Ends with a non-hyphen character
14570    /// * Not formatted as a UUID
14571    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
14572    ///   (section 3.5)
14573    pub network_policy_id: std::string::String,
14574
14575    /// Required. The network policy configuration to use in the request.
14576    pub network_policy: std::option::Option<crate::model::NetworkPolicy>,
14577
14578    /// Optional. A request ID to identify requests. Specify a unique request ID
14579    /// so that if you must retry your request, the server will know to ignore
14580    /// the request if it has already been completed. The server guarantees that a
14581    /// request doesn't result in creation of duplicate commitments for at least 60
14582    /// minutes.
14583    ///
14584    /// For example, consider a situation where you make an initial request and the
14585    /// request times out. If you make the request again with the same request
14586    /// ID, the server can check if original operation with the same request ID
14587    /// was received, and if so, will ignore the second request. This prevents
14588    /// clients from accidentally creating duplicate commitments.
14589    ///
14590    /// The request ID must be a valid UUID with the exception that zero UUID is
14591    /// not supported (00000000-0000-0000-0000-000000000000).
14592    pub request_id: std::string::String,
14593
14594    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14595}
14596
14597impl CreateNetworkPolicyRequest {
14598    pub fn new() -> Self {
14599        std::default::Default::default()
14600    }
14601
14602    /// Sets the value of [parent][crate::model::CreateNetworkPolicyRequest::parent].
14603    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14604        self.parent = v.into();
14605        self
14606    }
14607
14608    /// Sets the value of [network_policy_id][crate::model::CreateNetworkPolicyRequest::network_policy_id].
14609    pub fn set_network_policy_id<T: std::convert::Into<std::string::String>>(
14610        mut self,
14611        v: T,
14612    ) -> Self {
14613        self.network_policy_id = v.into();
14614        self
14615    }
14616
14617    /// Sets the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
14618    pub fn set_network_policy<T>(mut self, v: T) -> Self
14619    where
14620        T: std::convert::Into<crate::model::NetworkPolicy>,
14621    {
14622        self.network_policy = std::option::Option::Some(v.into());
14623        self
14624    }
14625
14626    /// Sets or clears the value of [network_policy][crate::model::CreateNetworkPolicyRequest::network_policy].
14627    pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
14628    where
14629        T: std::convert::Into<crate::model::NetworkPolicy>,
14630    {
14631        self.network_policy = v.map(|x| x.into());
14632        self
14633    }
14634
14635    /// Sets the value of [request_id][crate::model::CreateNetworkPolicyRequest::request_id].
14636    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14637        self.request_id = v.into();
14638        self
14639    }
14640}
14641
14642impl wkt::message::Message for CreateNetworkPolicyRequest {
14643    fn typename() -> &'static str {
14644        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"
14645    }
14646}
14647
14648#[doc(hidden)]
14649impl<'de> serde::de::Deserialize<'de> for CreateNetworkPolicyRequest {
14650    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14651    where
14652        D: serde::Deserializer<'de>,
14653    {
14654        #[allow(non_camel_case_types)]
14655        #[doc(hidden)]
14656        #[derive(PartialEq, Eq, Hash)]
14657        enum __FieldTag {
14658            __parent,
14659            __network_policy_id,
14660            __network_policy,
14661            __request_id,
14662            Unknown(std::string::String),
14663        }
14664        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14665            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14666            where
14667                D: serde::Deserializer<'de>,
14668            {
14669                struct Visitor;
14670                impl<'de> serde::de::Visitor<'de> for Visitor {
14671                    type Value = __FieldTag;
14672                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14673                        formatter.write_str("a field name for CreateNetworkPolicyRequest")
14674                    }
14675                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14676                    where
14677                        E: serde::de::Error,
14678                    {
14679                        use std::result::Result::Ok;
14680                        use std::string::ToString;
14681                        match value {
14682                            "parent" => Ok(__FieldTag::__parent),
14683                            "networkPolicyId" => Ok(__FieldTag::__network_policy_id),
14684                            "network_policy_id" => Ok(__FieldTag::__network_policy_id),
14685                            "networkPolicy" => Ok(__FieldTag::__network_policy),
14686                            "network_policy" => Ok(__FieldTag::__network_policy),
14687                            "requestId" => Ok(__FieldTag::__request_id),
14688                            "request_id" => Ok(__FieldTag::__request_id),
14689                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14690                        }
14691                    }
14692                }
14693                deserializer.deserialize_identifier(Visitor)
14694            }
14695        }
14696        struct Visitor;
14697        impl<'de> serde::de::Visitor<'de> for Visitor {
14698            type Value = CreateNetworkPolicyRequest;
14699            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14700                formatter.write_str("struct CreateNetworkPolicyRequest")
14701            }
14702            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14703            where
14704                A: serde::de::MapAccess<'de>,
14705            {
14706                #[allow(unused_imports)]
14707                use serde::de::Error;
14708                use std::option::Option::Some;
14709                let mut fields = std::collections::HashSet::new();
14710                let mut result = Self::Value::new();
14711                while let Some(tag) = map.next_key::<__FieldTag>()? {
14712                    #[allow(clippy::match_single_binding)]
14713                    match tag {
14714                        __FieldTag::__parent => {
14715                            if !fields.insert(__FieldTag::__parent) {
14716                                return std::result::Result::Err(A::Error::duplicate_field(
14717                                    "multiple values for parent",
14718                                ));
14719                            }
14720                            result.parent = map
14721                                .next_value::<std::option::Option<std::string::String>>()?
14722                                .unwrap_or_default();
14723                        }
14724                        __FieldTag::__network_policy_id => {
14725                            if !fields.insert(__FieldTag::__network_policy_id) {
14726                                return std::result::Result::Err(A::Error::duplicate_field(
14727                                    "multiple values for network_policy_id",
14728                                ));
14729                            }
14730                            result.network_policy_id = map
14731                                .next_value::<std::option::Option<std::string::String>>()?
14732                                .unwrap_or_default();
14733                        }
14734                        __FieldTag::__network_policy => {
14735                            if !fields.insert(__FieldTag::__network_policy) {
14736                                return std::result::Result::Err(A::Error::duplicate_field(
14737                                    "multiple values for network_policy",
14738                                ));
14739                            }
14740                            result.network_policy = map
14741                                .next_value::<std::option::Option<crate::model::NetworkPolicy>>()?;
14742                        }
14743                        __FieldTag::__request_id => {
14744                            if !fields.insert(__FieldTag::__request_id) {
14745                                return std::result::Result::Err(A::Error::duplicate_field(
14746                                    "multiple values for request_id",
14747                                ));
14748                            }
14749                            result.request_id = map
14750                                .next_value::<std::option::Option<std::string::String>>()?
14751                                .unwrap_or_default();
14752                        }
14753                        __FieldTag::Unknown(key) => {
14754                            let value = map.next_value::<serde_json::Value>()?;
14755                            result._unknown_fields.insert(key, value);
14756                        }
14757                    }
14758                }
14759                std::result::Result::Ok(result)
14760            }
14761        }
14762        deserializer.deserialize_any(Visitor)
14763    }
14764}
14765
14766#[doc(hidden)]
14767impl serde::ser::Serialize for CreateNetworkPolicyRequest {
14768    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14769    where
14770        S: serde::ser::Serializer,
14771    {
14772        use serde::ser::SerializeMap;
14773        #[allow(unused_imports)]
14774        use std::option::Option::Some;
14775        let mut state = serializer.serialize_map(std::option::Option::None)?;
14776        if !self.parent.is_empty() {
14777            state.serialize_entry("parent", &self.parent)?;
14778        }
14779        if !self.network_policy_id.is_empty() {
14780            state.serialize_entry("networkPolicyId", &self.network_policy_id)?;
14781        }
14782        if self.network_policy.is_some() {
14783            state.serialize_entry("networkPolicy", &self.network_policy)?;
14784        }
14785        if !self.request_id.is_empty() {
14786            state.serialize_entry("requestId", &self.request_id)?;
14787        }
14788        if !self._unknown_fields.is_empty() {
14789            for (key, value) in self._unknown_fields.iter() {
14790                state.serialize_entry(key, &value)?;
14791            }
14792        }
14793        state.end()
14794    }
14795}
14796
14797impl std::fmt::Debug for CreateNetworkPolicyRequest {
14798    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14799        let mut debug_struct = f.debug_struct("CreateNetworkPolicyRequest");
14800        debug_struct.field("parent", &self.parent);
14801        debug_struct.field("network_policy_id", &self.network_policy_id);
14802        debug_struct.field("network_policy", &self.network_policy);
14803        debug_struct.field("request_id", &self.request_id);
14804        if !self._unknown_fields.is_empty() {
14805            debug_struct.field("_unknown_fields", &self._unknown_fields);
14806        }
14807        debug_struct.finish()
14808    }
14809}
14810
14811/// Request message for
14812/// [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]
14813///
14814/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy]: crate::client::VmwareEngine::delete_network_policy
14815#[derive(Clone, Default, PartialEq)]
14816#[non_exhaustive]
14817pub struct DeleteNetworkPolicyRequest {
14818    /// Required. The resource name of the network policy to delete.
14819    /// Resource names are schemeless URIs that follow the conventions in
14820    /// <https://cloud.google.com/apis/design/resource_names>.
14821    /// For example:
14822    /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
14823    pub name: std::string::String,
14824
14825    /// Optional. A request ID to identify requests. Specify a unique request ID
14826    /// so that if you must retry your request, the server will know to ignore
14827    /// the request if it has already been completed. The server guarantees that a
14828    /// request doesn't result in creation of duplicate commitments for at least 60
14829    /// minutes.
14830    ///
14831    /// For example, consider a situation where you make an initial request and the
14832    /// request times out. If you make the request again with the same request
14833    /// ID, the server can check if original operation with the same request ID
14834    /// was received, and if so, will ignore the second request. This prevents
14835    /// clients from accidentally creating duplicate commitments.
14836    ///
14837    /// The request ID must be a valid UUID with the exception that zero UUID is
14838    /// not supported (00000000-0000-0000-0000-000000000000).
14839    pub request_id: std::string::String,
14840
14841    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14842}
14843
14844impl DeleteNetworkPolicyRequest {
14845    pub fn new() -> Self {
14846        std::default::Default::default()
14847    }
14848
14849    /// Sets the value of [name][crate::model::DeleteNetworkPolicyRequest::name].
14850    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14851        self.name = v.into();
14852        self
14853    }
14854
14855    /// Sets the value of [request_id][crate::model::DeleteNetworkPolicyRequest::request_id].
14856    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14857        self.request_id = v.into();
14858        self
14859    }
14860}
14861
14862impl wkt::message::Message for DeleteNetworkPolicyRequest {
14863    fn typename() -> &'static str {
14864        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"
14865    }
14866}
14867
14868#[doc(hidden)]
14869impl<'de> serde::de::Deserialize<'de> for DeleteNetworkPolicyRequest {
14870    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14871    where
14872        D: serde::Deserializer<'de>,
14873    {
14874        #[allow(non_camel_case_types)]
14875        #[doc(hidden)]
14876        #[derive(PartialEq, Eq, Hash)]
14877        enum __FieldTag {
14878            __name,
14879            __request_id,
14880            Unknown(std::string::String),
14881        }
14882        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14883            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14884            where
14885                D: serde::Deserializer<'de>,
14886            {
14887                struct Visitor;
14888                impl<'de> serde::de::Visitor<'de> for Visitor {
14889                    type Value = __FieldTag;
14890                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14891                        formatter.write_str("a field name for DeleteNetworkPolicyRequest")
14892                    }
14893                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14894                    where
14895                        E: serde::de::Error,
14896                    {
14897                        use std::result::Result::Ok;
14898                        use std::string::ToString;
14899                        match value {
14900                            "name" => Ok(__FieldTag::__name),
14901                            "requestId" => Ok(__FieldTag::__request_id),
14902                            "request_id" => Ok(__FieldTag::__request_id),
14903                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14904                        }
14905                    }
14906                }
14907                deserializer.deserialize_identifier(Visitor)
14908            }
14909        }
14910        struct Visitor;
14911        impl<'de> serde::de::Visitor<'de> for Visitor {
14912            type Value = DeleteNetworkPolicyRequest;
14913            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14914                formatter.write_str("struct DeleteNetworkPolicyRequest")
14915            }
14916            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14917            where
14918                A: serde::de::MapAccess<'de>,
14919            {
14920                #[allow(unused_imports)]
14921                use serde::de::Error;
14922                use std::option::Option::Some;
14923                let mut fields = std::collections::HashSet::new();
14924                let mut result = Self::Value::new();
14925                while let Some(tag) = map.next_key::<__FieldTag>()? {
14926                    #[allow(clippy::match_single_binding)]
14927                    match tag {
14928                        __FieldTag::__name => {
14929                            if !fields.insert(__FieldTag::__name) {
14930                                return std::result::Result::Err(A::Error::duplicate_field(
14931                                    "multiple values for name",
14932                                ));
14933                            }
14934                            result.name = map
14935                                .next_value::<std::option::Option<std::string::String>>()?
14936                                .unwrap_or_default();
14937                        }
14938                        __FieldTag::__request_id => {
14939                            if !fields.insert(__FieldTag::__request_id) {
14940                                return std::result::Result::Err(A::Error::duplicate_field(
14941                                    "multiple values for request_id",
14942                                ));
14943                            }
14944                            result.request_id = map
14945                                .next_value::<std::option::Option<std::string::String>>()?
14946                                .unwrap_or_default();
14947                        }
14948                        __FieldTag::Unknown(key) => {
14949                            let value = map.next_value::<serde_json::Value>()?;
14950                            result._unknown_fields.insert(key, value);
14951                        }
14952                    }
14953                }
14954                std::result::Result::Ok(result)
14955            }
14956        }
14957        deserializer.deserialize_any(Visitor)
14958    }
14959}
14960
14961#[doc(hidden)]
14962impl serde::ser::Serialize for DeleteNetworkPolicyRequest {
14963    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14964    where
14965        S: serde::ser::Serializer,
14966    {
14967        use serde::ser::SerializeMap;
14968        #[allow(unused_imports)]
14969        use std::option::Option::Some;
14970        let mut state = serializer.serialize_map(std::option::Option::None)?;
14971        if !self.name.is_empty() {
14972            state.serialize_entry("name", &self.name)?;
14973        }
14974        if !self.request_id.is_empty() {
14975            state.serialize_entry("requestId", &self.request_id)?;
14976        }
14977        if !self._unknown_fields.is_empty() {
14978            for (key, value) in self._unknown_fields.iter() {
14979                state.serialize_entry(key, &value)?;
14980            }
14981        }
14982        state.end()
14983    }
14984}
14985
14986impl std::fmt::Debug for DeleteNetworkPolicyRequest {
14987    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14988        let mut debug_struct = f.debug_struct("DeleteNetworkPolicyRequest");
14989        debug_struct.field("name", &self.name);
14990        debug_struct.field("request_id", &self.request_id);
14991        if !self._unknown_fields.is_empty() {
14992            debug_struct.field("_unknown_fields", &self._unknown_fields);
14993        }
14994        debug_struct.finish()
14995    }
14996}
14997
14998/// Request message for
14999/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
15000///
15001/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
15002#[derive(Clone, Default, PartialEq)]
15003#[non_exhaustive]
15004pub struct ListManagementDnsZoneBindingsRequest {
15005    /// Required. The resource name of the private cloud to be queried for
15006    /// management DNS zone bindings.
15007    /// Resource names are schemeless URIs that follow the conventions in
15008    /// <https://cloud.google.com/apis/design/resource_names>.
15009    /// For example:
15010    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
15011    pub parent: std::string::String,
15012
15013    /// The maximum number of management DNS zone bindings to return in one page.
15014    /// The service may return fewer than this value.
15015    /// The maximum value is coerced to 1000.
15016    /// The default value of this field is 500.
15017    pub page_size: i32,
15018
15019    /// A page token, received from a previous `ListManagementDnsZoneBindings`
15020    /// call. Provide this to retrieve the subsequent page.
15021    ///
15022    /// When paginating, all other parameters provided to
15023    /// `ListManagementDnsZoneBindings` must match the call that provided the page
15024    /// token.
15025    pub page_token: std::string::String,
15026
15027    /// A filter expression that matches resources returned in the response.
15028    /// The expression must specify the field name, a comparison
15029    /// operator, and the value that you want to use for filtering. The value
15030    /// must be a string, a number, or a boolean. The comparison operator
15031    /// must be `=`, `!=`, `>`, or `<`.
15032    ///
15033    /// For example, if you are filtering a list of Management DNS Zone Bindings,
15034    /// you can exclude the ones named `example-management-dns-zone-binding` by
15035    /// specifying `name != "example-management-dns-zone-binding"`.
15036    ///
15037    /// To filter on multiple expressions, provide each separate expression within
15038    /// parentheses. For example:
15039    ///
15040    /// ```norust
15041    /// (name = "example-management-dns-zone-binding")
15042    /// (createTime > "2021-04-12T08:15:10.40Z")
15043    /// ```
15044    ///
15045    /// By default, each expression is an `AND` expression. However, you
15046    /// can include `AND` and `OR` expressions explicitly.
15047    /// For example:
15048    ///
15049    /// ```norust
15050    /// (name = "example-management-dns-zone-binding-1") AND
15051    /// (createTime > "2021-04-12T08:15:10.40Z") OR
15052    /// (name = "example-management-dns-zone-binding-2")
15053    /// ```
15054    pub filter: std::string::String,
15055
15056    /// Sorts list results by a certain order. By default, returned results
15057    /// are ordered by `name` in ascending order.
15058    /// You can also sort results in descending order based on the `name` value
15059    /// using `orderBy="name desc"`.
15060    /// Currently, only ordering by `name` is supported.
15061    pub order_by: std::string::String,
15062
15063    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15064}
15065
15066impl ListManagementDnsZoneBindingsRequest {
15067    pub fn new() -> Self {
15068        std::default::Default::default()
15069    }
15070
15071    /// Sets the value of [parent][crate::model::ListManagementDnsZoneBindingsRequest::parent].
15072    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15073        self.parent = v.into();
15074        self
15075    }
15076
15077    /// Sets the value of [page_size][crate::model::ListManagementDnsZoneBindingsRequest::page_size].
15078    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15079        self.page_size = v.into();
15080        self
15081    }
15082
15083    /// Sets the value of [page_token][crate::model::ListManagementDnsZoneBindingsRequest::page_token].
15084    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15085        self.page_token = v.into();
15086        self
15087    }
15088
15089    /// Sets the value of [filter][crate::model::ListManagementDnsZoneBindingsRequest::filter].
15090    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15091        self.filter = v.into();
15092        self
15093    }
15094
15095    /// Sets the value of [order_by][crate::model::ListManagementDnsZoneBindingsRequest::order_by].
15096    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15097        self.order_by = v.into();
15098        self
15099    }
15100}
15101
15102impl wkt::message::Message for ListManagementDnsZoneBindingsRequest {
15103    fn typename() -> &'static str {
15104        "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest"
15105    }
15106}
15107
15108#[doc(hidden)]
15109impl<'de> serde::de::Deserialize<'de> for ListManagementDnsZoneBindingsRequest {
15110    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15111    where
15112        D: serde::Deserializer<'de>,
15113    {
15114        #[allow(non_camel_case_types)]
15115        #[doc(hidden)]
15116        #[derive(PartialEq, Eq, Hash)]
15117        enum __FieldTag {
15118            __parent,
15119            __page_size,
15120            __page_token,
15121            __filter,
15122            __order_by,
15123            Unknown(std::string::String),
15124        }
15125        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15126            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15127            where
15128                D: serde::Deserializer<'de>,
15129            {
15130                struct Visitor;
15131                impl<'de> serde::de::Visitor<'de> for Visitor {
15132                    type Value = __FieldTag;
15133                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15134                        formatter.write_str("a field name for ListManagementDnsZoneBindingsRequest")
15135                    }
15136                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15137                    where
15138                        E: serde::de::Error,
15139                    {
15140                        use std::result::Result::Ok;
15141                        use std::string::ToString;
15142                        match value {
15143                            "parent" => Ok(__FieldTag::__parent),
15144                            "pageSize" => Ok(__FieldTag::__page_size),
15145                            "page_size" => Ok(__FieldTag::__page_size),
15146                            "pageToken" => Ok(__FieldTag::__page_token),
15147                            "page_token" => Ok(__FieldTag::__page_token),
15148                            "filter" => Ok(__FieldTag::__filter),
15149                            "orderBy" => Ok(__FieldTag::__order_by),
15150                            "order_by" => Ok(__FieldTag::__order_by),
15151                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15152                        }
15153                    }
15154                }
15155                deserializer.deserialize_identifier(Visitor)
15156            }
15157        }
15158        struct Visitor;
15159        impl<'de> serde::de::Visitor<'de> for Visitor {
15160            type Value = ListManagementDnsZoneBindingsRequest;
15161            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15162                formatter.write_str("struct ListManagementDnsZoneBindingsRequest")
15163            }
15164            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15165            where
15166                A: serde::de::MapAccess<'de>,
15167            {
15168                #[allow(unused_imports)]
15169                use serde::de::Error;
15170                use std::option::Option::Some;
15171                let mut fields = std::collections::HashSet::new();
15172                let mut result = Self::Value::new();
15173                while let Some(tag) = map.next_key::<__FieldTag>()? {
15174                    #[allow(clippy::match_single_binding)]
15175                    match tag {
15176                        __FieldTag::__parent => {
15177                            if !fields.insert(__FieldTag::__parent) {
15178                                return std::result::Result::Err(A::Error::duplicate_field(
15179                                    "multiple values for parent",
15180                                ));
15181                            }
15182                            result.parent = map
15183                                .next_value::<std::option::Option<std::string::String>>()?
15184                                .unwrap_or_default();
15185                        }
15186                        __FieldTag::__page_size => {
15187                            if !fields.insert(__FieldTag::__page_size) {
15188                                return std::result::Result::Err(A::Error::duplicate_field(
15189                                    "multiple values for page_size",
15190                                ));
15191                            }
15192                            struct __With(std::option::Option<i32>);
15193                            impl<'de> serde::de::Deserialize<'de> for __With {
15194                                fn deserialize<D>(
15195                                    deserializer: D,
15196                                ) -> std::result::Result<Self, D::Error>
15197                                where
15198                                    D: serde::de::Deserializer<'de>,
15199                                {
15200                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15201                                }
15202                            }
15203                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
15204                        }
15205                        __FieldTag::__page_token => {
15206                            if !fields.insert(__FieldTag::__page_token) {
15207                                return std::result::Result::Err(A::Error::duplicate_field(
15208                                    "multiple values for page_token",
15209                                ));
15210                            }
15211                            result.page_token = map
15212                                .next_value::<std::option::Option<std::string::String>>()?
15213                                .unwrap_or_default();
15214                        }
15215                        __FieldTag::__filter => {
15216                            if !fields.insert(__FieldTag::__filter) {
15217                                return std::result::Result::Err(A::Error::duplicate_field(
15218                                    "multiple values for filter",
15219                                ));
15220                            }
15221                            result.filter = map
15222                                .next_value::<std::option::Option<std::string::String>>()?
15223                                .unwrap_or_default();
15224                        }
15225                        __FieldTag::__order_by => {
15226                            if !fields.insert(__FieldTag::__order_by) {
15227                                return std::result::Result::Err(A::Error::duplicate_field(
15228                                    "multiple values for order_by",
15229                                ));
15230                            }
15231                            result.order_by = map
15232                                .next_value::<std::option::Option<std::string::String>>()?
15233                                .unwrap_or_default();
15234                        }
15235                        __FieldTag::Unknown(key) => {
15236                            let value = map.next_value::<serde_json::Value>()?;
15237                            result._unknown_fields.insert(key, value);
15238                        }
15239                    }
15240                }
15241                std::result::Result::Ok(result)
15242            }
15243        }
15244        deserializer.deserialize_any(Visitor)
15245    }
15246}
15247
15248#[doc(hidden)]
15249impl serde::ser::Serialize for ListManagementDnsZoneBindingsRequest {
15250    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15251    where
15252        S: serde::ser::Serializer,
15253    {
15254        use serde::ser::SerializeMap;
15255        #[allow(unused_imports)]
15256        use std::option::Option::Some;
15257        let mut state = serializer.serialize_map(std::option::Option::None)?;
15258        if !self.parent.is_empty() {
15259            state.serialize_entry("parent", &self.parent)?;
15260        }
15261        if !wkt::internal::is_default(&self.page_size) {
15262            struct __With<'a>(&'a i32);
15263            impl<'a> serde::ser::Serialize for __With<'a> {
15264                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15265                where
15266                    S: serde::ser::Serializer,
15267                {
15268                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15269                }
15270            }
15271            state.serialize_entry("pageSize", &__With(&self.page_size))?;
15272        }
15273        if !self.page_token.is_empty() {
15274            state.serialize_entry("pageToken", &self.page_token)?;
15275        }
15276        if !self.filter.is_empty() {
15277            state.serialize_entry("filter", &self.filter)?;
15278        }
15279        if !self.order_by.is_empty() {
15280            state.serialize_entry("orderBy", &self.order_by)?;
15281        }
15282        if !self._unknown_fields.is_empty() {
15283            for (key, value) in self._unknown_fields.iter() {
15284                state.serialize_entry(key, &value)?;
15285            }
15286        }
15287        state.end()
15288    }
15289}
15290
15291impl std::fmt::Debug for ListManagementDnsZoneBindingsRequest {
15292    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15293        let mut debug_struct = f.debug_struct("ListManagementDnsZoneBindingsRequest");
15294        debug_struct.field("parent", &self.parent);
15295        debug_struct.field("page_size", &self.page_size);
15296        debug_struct.field("page_token", &self.page_token);
15297        debug_struct.field("filter", &self.filter);
15298        debug_struct.field("order_by", &self.order_by);
15299        if !self._unknown_fields.is_empty() {
15300            debug_struct.field("_unknown_fields", &self._unknown_fields);
15301        }
15302        debug_struct.finish()
15303    }
15304}
15305
15306/// Response message for
15307/// [VmwareEngine.ListManagementDnsZoneBindings][google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]
15308///
15309/// [google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings]: crate::client::VmwareEngine::list_management_dns_zone_bindings
15310#[derive(Clone, Default, PartialEq)]
15311#[non_exhaustive]
15312pub struct ListManagementDnsZoneBindingsResponse {
15313    /// A list of management DNS zone bindings.
15314    pub management_dns_zone_bindings: std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
15315
15316    /// A token, which can be sent as `page_token` to retrieve the next page.
15317    /// If this field is omitted, there are no subsequent pages.
15318    pub next_page_token: std::string::String,
15319
15320    /// Locations that could not be reached when making an aggregated query using
15321    /// wildcards.
15322    pub unreachable: std::vec::Vec<std::string::String>,
15323
15324    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15325}
15326
15327impl ListManagementDnsZoneBindingsResponse {
15328    pub fn new() -> Self {
15329        std::default::Default::default()
15330    }
15331
15332    /// Sets the value of [management_dns_zone_bindings][crate::model::ListManagementDnsZoneBindingsResponse::management_dns_zone_bindings].
15333    pub fn set_management_dns_zone_bindings<T, V>(mut self, v: T) -> Self
15334    where
15335        T: std::iter::IntoIterator<Item = V>,
15336        V: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
15337    {
15338        use std::iter::Iterator;
15339        self.management_dns_zone_bindings = v.into_iter().map(|i| i.into()).collect();
15340        self
15341    }
15342
15343    /// Sets the value of [next_page_token][crate::model::ListManagementDnsZoneBindingsResponse::next_page_token].
15344    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15345        self.next_page_token = v.into();
15346        self
15347    }
15348
15349    /// Sets the value of [unreachable][crate::model::ListManagementDnsZoneBindingsResponse::unreachable].
15350    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15351    where
15352        T: std::iter::IntoIterator<Item = V>,
15353        V: std::convert::Into<std::string::String>,
15354    {
15355        use std::iter::Iterator;
15356        self.unreachable = v.into_iter().map(|i| i.into()).collect();
15357        self
15358    }
15359}
15360
15361impl wkt::message::Message for ListManagementDnsZoneBindingsResponse {
15362    fn typename() -> &'static str {
15363        "type.googleapis.com/google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse"
15364    }
15365}
15366
15367#[doc(hidden)]
15368impl gax::paginator::internal::PageableResponse for ListManagementDnsZoneBindingsResponse {
15369    type PageItem = crate::model::ManagementDnsZoneBinding;
15370
15371    fn items(self) -> std::vec::Vec<Self::PageItem> {
15372        self.management_dns_zone_bindings
15373    }
15374
15375    fn next_page_token(&self) -> std::string::String {
15376        use std::clone::Clone;
15377        self.next_page_token.clone()
15378    }
15379}
15380
15381#[doc(hidden)]
15382impl<'de> serde::de::Deserialize<'de> for ListManagementDnsZoneBindingsResponse {
15383    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15384    where
15385        D: serde::Deserializer<'de>,
15386    {
15387        #[allow(non_camel_case_types)]
15388        #[doc(hidden)]
15389        #[derive(PartialEq, Eq, Hash)]
15390        enum __FieldTag {
15391            __management_dns_zone_bindings,
15392            __next_page_token,
15393            __unreachable,
15394            Unknown(std::string::String),
15395        }
15396        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15397            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15398            where
15399                D: serde::Deserializer<'de>,
15400            {
15401                struct Visitor;
15402                impl<'de> serde::de::Visitor<'de> for Visitor {
15403                    type Value = __FieldTag;
15404                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15405                        formatter
15406                            .write_str("a field name for ListManagementDnsZoneBindingsResponse")
15407                    }
15408                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15409                    where
15410                        E: serde::de::Error,
15411                    {
15412                        use std::result::Result::Ok;
15413                        use std::string::ToString;
15414                        match value {
15415                            "managementDnsZoneBindings" => {
15416                                Ok(__FieldTag::__management_dns_zone_bindings)
15417                            }
15418                            "management_dns_zone_bindings" => {
15419                                Ok(__FieldTag::__management_dns_zone_bindings)
15420                            }
15421                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
15422                            "next_page_token" => Ok(__FieldTag::__next_page_token),
15423                            "unreachable" => Ok(__FieldTag::__unreachable),
15424                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15425                        }
15426                    }
15427                }
15428                deserializer.deserialize_identifier(Visitor)
15429            }
15430        }
15431        struct Visitor;
15432        impl<'de> serde::de::Visitor<'de> for Visitor {
15433            type Value = ListManagementDnsZoneBindingsResponse;
15434            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15435                formatter.write_str("struct ListManagementDnsZoneBindingsResponse")
15436            }
15437            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15438            where
15439                A: serde::de::MapAccess<'de>,
15440            {
15441                #[allow(unused_imports)]
15442                use serde::de::Error;
15443                use std::option::Option::Some;
15444                let mut fields = std::collections::HashSet::new();
15445                let mut result = Self::Value::new();
15446                while let Some(tag) = map.next_key::<__FieldTag>()? {
15447                    #[allow(clippy::match_single_binding)]
15448                    match tag {
15449                        __FieldTag::__management_dns_zone_bindings => {
15450                            if !fields.insert(__FieldTag::__management_dns_zone_bindings) {
15451                                return std::result::Result::Err(A::Error::duplicate_field(
15452                                    "multiple values for management_dns_zone_bindings",
15453                                ));
15454                            }
15455                            result.management_dns_zone_bindings = map
15456                                .next_value::<std::option::Option<
15457                                    std::vec::Vec<crate::model::ManagementDnsZoneBinding>,
15458                                >>()?
15459                                .unwrap_or_default();
15460                        }
15461                        __FieldTag::__next_page_token => {
15462                            if !fields.insert(__FieldTag::__next_page_token) {
15463                                return std::result::Result::Err(A::Error::duplicate_field(
15464                                    "multiple values for next_page_token",
15465                                ));
15466                            }
15467                            result.next_page_token = map
15468                                .next_value::<std::option::Option<std::string::String>>()?
15469                                .unwrap_or_default();
15470                        }
15471                        __FieldTag::__unreachable => {
15472                            if !fields.insert(__FieldTag::__unreachable) {
15473                                return std::result::Result::Err(A::Error::duplicate_field(
15474                                    "multiple values for unreachable",
15475                                ));
15476                            }
15477                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
15478                        }
15479                        __FieldTag::Unknown(key) => {
15480                            let value = map.next_value::<serde_json::Value>()?;
15481                            result._unknown_fields.insert(key, value);
15482                        }
15483                    }
15484                }
15485                std::result::Result::Ok(result)
15486            }
15487        }
15488        deserializer.deserialize_any(Visitor)
15489    }
15490}
15491
15492#[doc(hidden)]
15493impl serde::ser::Serialize for ListManagementDnsZoneBindingsResponse {
15494    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15495    where
15496        S: serde::ser::Serializer,
15497    {
15498        use serde::ser::SerializeMap;
15499        #[allow(unused_imports)]
15500        use std::option::Option::Some;
15501        let mut state = serializer.serialize_map(std::option::Option::None)?;
15502        if !self.management_dns_zone_bindings.is_empty() {
15503            state.serialize_entry(
15504                "managementDnsZoneBindings",
15505                &self.management_dns_zone_bindings,
15506            )?;
15507        }
15508        if !self.next_page_token.is_empty() {
15509            state.serialize_entry("nextPageToken", &self.next_page_token)?;
15510        }
15511        if !self.unreachable.is_empty() {
15512            state.serialize_entry("unreachable", &self.unreachable)?;
15513        }
15514        if !self._unknown_fields.is_empty() {
15515            for (key, value) in self._unknown_fields.iter() {
15516                state.serialize_entry(key, &value)?;
15517            }
15518        }
15519        state.end()
15520    }
15521}
15522
15523impl std::fmt::Debug for ListManagementDnsZoneBindingsResponse {
15524    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15525        let mut debug_struct = f.debug_struct("ListManagementDnsZoneBindingsResponse");
15526        debug_struct.field(
15527            "management_dns_zone_bindings",
15528            &self.management_dns_zone_bindings,
15529        );
15530        debug_struct.field("next_page_token", &self.next_page_token);
15531        debug_struct.field("unreachable", &self.unreachable);
15532        if !self._unknown_fields.is_empty() {
15533            debug_struct.field("_unknown_fields", &self._unknown_fields);
15534        }
15535        debug_struct.finish()
15536    }
15537}
15538
15539/// Request message for
15540/// [VmwareEngine.GetManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]
15541///
15542/// [google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding]: crate::client::VmwareEngine::get_management_dns_zone_binding
15543#[derive(Clone, Default, PartialEq)]
15544#[non_exhaustive]
15545pub struct GetManagementDnsZoneBindingRequest {
15546    /// Required. The resource name of the management DNS zone binding to
15547    /// retrieve. Resource names are schemeless URIs that follow the conventions in
15548    /// <https://cloud.google.com/apis/design/resource_names>.
15549    /// For example:
15550    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
15551    pub name: std::string::String,
15552
15553    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15554}
15555
15556impl GetManagementDnsZoneBindingRequest {
15557    pub fn new() -> Self {
15558        std::default::Default::default()
15559    }
15560
15561    /// Sets the value of [name][crate::model::GetManagementDnsZoneBindingRequest::name].
15562    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15563        self.name = v.into();
15564        self
15565    }
15566}
15567
15568impl wkt::message::Message for GetManagementDnsZoneBindingRequest {
15569    fn typename() -> &'static str {
15570        "type.googleapis.com/google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest"
15571    }
15572}
15573
15574#[doc(hidden)]
15575impl<'de> serde::de::Deserialize<'de> for GetManagementDnsZoneBindingRequest {
15576    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15577    where
15578        D: serde::Deserializer<'de>,
15579    {
15580        #[allow(non_camel_case_types)]
15581        #[doc(hidden)]
15582        #[derive(PartialEq, Eq, Hash)]
15583        enum __FieldTag {
15584            __name,
15585            Unknown(std::string::String),
15586        }
15587        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15588            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15589            where
15590                D: serde::Deserializer<'de>,
15591            {
15592                struct Visitor;
15593                impl<'de> serde::de::Visitor<'de> for Visitor {
15594                    type Value = __FieldTag;
15595                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15596                        formatter.write_str("a field name for GetManagementDnsZoneBindingRequest")
15597                    }
15598                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15599                    where
15600                        E: serde::de::Error,
15601                    {
15602                        use std::result::Result::Ok;
15603                        use std::string::ToString;
15604                        match value {
15605                            "name" => Ok(__FieldTag::__name),
15606                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15607                        }
15608                    }
15609                }
15610                deserializer.deserialize_identifier(Visitor)
15611            }
15612        }
15613        struct Visitor;
15614        impl<'de> serde::de::Visitor<'de> for Visitor {
15615            type Value = GetManagementDnsZoneBindingRequest;
15616            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15617                formatter.write_str("struct GetManagementDnsZoneBindingRequest")
15618            }
15619            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15620            where
15621                A: serde::de::MapAccess<'de>,
15622            {
15623                #[allow(unused_imports)]
15624                use serde::de::Error;
15625                use std::option::Option::Some;
15626                let mut fields = std::collections::HashSet::new();
15627                let mut result = Self::Value::new();
15628                while let Some(tag) = map.next_key::<__FieldTag>()? {
15629                    #[allow(clippy::match_single_binding)]
15630                    match tag {
15631                        __FieldTag::__name => {
15632                            if !fields.insert(__FieldTag::__name) {
15633                                return std::result::Result::Err(A::Error::duplicate_field(
15634                                    "multiple values for name",
15635                                ));
15636                            }
15637                            result.name = map
15638                                .next_value::<std::option::Option<std::string::String>>()?
15639                                .unwrap_or_default();
15640                        }
15641                        __FieldTag::Unknown(key) => {
15642                            let value = map.next_value::<serde_json::Value>()?;
15643                            result._unknown_fields.insert(key, value);
15644                        }
15645                    }
15646                }
15647                std::result::Result::Ok(result)
15648            }
15649        }
15650        deserializer.deserialize_any(Visitor)
15651    }
15652}
15653
15654#[doc(hidden)]
15655impl serde::ser::Serialize for GetManagementDnsZoneBindingRequest {
15656    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15657    where
15658        S: serde::ser::Serializer,
15659    {
15660        use serde::ser::SerializeMap;
15661        #[allow(unused_imports)]
15662        use std::option::Option::Some;
15663        let mut state = serializer.serialize_map(std::option::Option::None)?;
15664        if !self.name.is_empty() {
15665            state.serialize_entry("name", &self.name)?;
15666        }
15667        if !self._unknown_fields.is_empty() {
15668            for (key, value) in self._unknown_fields.iter() {
15669                state.serialize_entry(key, &value)?;
15670            }
15671        }
15672        state.end()
15673    }
15674}
15675
15676impl std::fmt::Debug for GetManagementDnsZoneBindingRequest {
15677    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15678        let mut debug_struct = f.debug_struct("GetManagementDnsZoneBindingRequest");
15679        debug_struct.field("name", &self.name);
15680        if !self._unknown_fields.is_empty() {
15681            debug_struct.field("_unknown_fields", &self._unknown_fields);
15682        }
15683        debug_struct.finish()
15684    }
15685}
15686
15687/// Request message for [VmwareEngine.CreateManagementDnsZoneBindings][]
15688#[derive(Clone, Default, PartialEq)]
15689#[non_exhaustive]
15690pub struct CreateManagementDnsZoneBindingRequest {
15691    /// Required. The resource name of the private cloud
15692    /// to create a new management DNS zone binding for.
15693    /// Resource names are schemeless URIs that follow the conventions in
15694    /// <https://cloud.google.com/apis/design/resource_names>.
15695    /// For example:
15696    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
15697    pub parent: std::string::String,
15698
15699    /// Required. The initial values for a new management DNS zone binding.
15700    pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
15701
15702    /// Required. The user-provided identifier of the `ManagementDnsZoneBinding`
15703    /// resource to be created. This identifier must be unique among
15704    /// `ManagementDnsZoneBinding` resources within the parent and becomes the
15705    /// final token in the name URI. The identifier must meet the following
15706    /// requirements:
15707    ///
15708    /// * Only contains 1-63 alphanumeric characters and hyphens
15709    /// * Begins with an alphabetical character
15710    /// * Ends with a non-hyphen character
15711    /// * Not formatted as a UUID
15712    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
15713    ///   (section 3.5)
15714    pub management_dns_zone_binding_id: std::string::String,
15715
15716    /// Optional. A request ID to identify requests. Specify a unique request ID
15717    /// so that if you must retry your request, the server will know to ignore
15718    /// the request if it has already been completed. The server guarantees that a
15719    /// request doesn't result in creation of duplicate commitments for at least 60
15720    /// minutes.
15721    ///
15722    /// For example, consider a situation where you make an initial request and the
15723    /// request times out. If you make the request again with the same request ID,
15724    /// the server can check if the original operation with the same request ID was
15725    /// received, and if so, will ignore the second request. This prevents clients
15726    /// from accidentally creating duplicate commitments.
15727    ///
15728    /// The request ID must be a valid UUID with the exception that zero UUID is
15729    /// not supported (00000000-0000-0000-0000-000000000000).
15730    pub request_id: std::string::String,
15731
15732    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15733}
15734
15735impl CreateManagementDnsZoneBindingRequest {
15736    pub fn new() -> Self {
15737        std::default::Default::default()
15738    }
15739
15740    /// Sets the value of [parent][crate::model::CreateManagementDnsZoneBindingRequest::parent].
15741    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15742        self.parent = v.into();
15743        self
15744    }
15745
15746    /// Sets the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
15747    pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
15748    where
15749        T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
15750    {
15751        self.management_dns_zone_binding = std::option::Option::Some(v.into());
15752        self
15753    }
15754
15755    /// Sets or clears the value of [management_dns_zone_binding][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding].
15756    pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
15757    where
15758        T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
15759    {
15760        self.management_dns_zone_binding = v.map(|x| x.into());
15761        self
15762    }
15763
15764    /// Sets the value of [management_dns_zone_binding_id][crate::model::CreateManagementDnsZoneBindingRequest::management_dns_zone_binding_id].
15765    pub fn set_management_dns_zone_binding_id<T: std::convert::Into<std::string::String>>(
15766        mut self,
15767        v: T,
15768    ) -> Self {
15769        self.management_dns_zone_binding_id = v.into();
15770        self
15771    }
15772
15773    /// Sets the value of [request_id][crate::model::CreateManagementDnsZoneBindingRequest::request_id].
15774    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15775        self.request_id = v.into();
15776        self
15777    }
15778}
15779
15780impl wkt::message::Message for CreateManagementDnsZoneBindingRequest {
15781    fn typename() -> &'static str {
15782        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest"
15783    }
15784}
15785
15786#[doc(hidden)]
15787impl<'de> serde::de::Deserialize<'de> for CreateManagementDnsZoneBindingRequest {
15788    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15789    where
15790        D: serde::Deserializer<'de>,
15791    {
15792        #[allow(non_camel_case_types)]
15793        #[doc(hidden)]
15794        #[derive(PartialEq, Eq, Hash)]
15795        enum __FieldTag {
15796            __parent,
15797            __management_dns_zone_binding,
15798            __management_dns_zone_binding_id,
15799            __request_id,
15800            Unknown(std::string::String),
15801        }
15802        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15803            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15804            where
15805                D: serde::Deserializer<'de>,
15806            {
15807                struct Visitor;
15808                impl<'de> serde::de::Visitor<'de> for Visitor {
15809                    type Value = __FieldTag;
15810                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15811                        formatter
15812                            .write_str("a field name for CreateManagementDnsZoneBindingRequest")
15813                    }
15814                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15815                    where
15816                        E: serde::de::Error,
15817                    {
15818                        use std::result::Result::Ok;
15819                        use std::string::ToString;
15820                        match value {
15821                            "parent" => Ok(__FieldTag::__parent),
15822                            "managementDnsZoneBinding" => {
15823                                Ok(__FieldTag::__management_dns_zone_binding)
15824                            }
15825                            "management_dns_zone_binding" => {
15826                                Ok(__FieldTag::__management_dns_zone_binding)
15827                            }
15828                            "managementDnsZoneBindingId" => {
15829                                Ok(__FieldTag::__management_dns_zone_binding_id)
15830                            }
15831                            "management_dns_zone_binding_id" => {
15832                                Ok(__FieldTag::__management_dns_zone_binding_id)
15833                            }
15834                            "requestId" => Ok(__FieldTag::__request_id),
15835                            "request_id" => Ok(__FieldTag::__request_id),
15836                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15837                        }
15838                    }
15839                }
15840                deserializer.deserialize_identifier(Visitor)
15841            }
15842        }
15843        struct Visitor;
15844        impl<'de> serde::de::Visitor<'de> for Visitor {
15845            type Value = CreateManagementDnsZoneBindingRequest;
15846            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15847                formatter.write_str("struct CreateManagementDnsZoneBindingRequest")
15848            }
15849            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15850            where
15851                A: serde::de::MapAccess<'de>,
15852            {
15853                #[allow(unused_imports)]
15854                use serde::de::Error;
15855                use std::option::Option::Some;
15856                let mut fields = std::collections::HashSet::new();
15857                let mut result = Self::Value::new();
15858                while let Some(tag) = map.next_key::<__FieldTag>()? {
15859                    #[allow(clippy::match_single_binding)]
15860                    match tag {
15861                        __FieldTag::__parent => {
15862                            if !fields.insert(__FieldTag::__parent) {
15863                                return std::result::Result::Err(A::Error::duplicate_field(
15864                                    "multiple values for parent",
15865                                ));
15866                            }
15867                            result.parent = map
15868                                .next_value::<std::option::Option<std::string::String>>()?
15869                                .unwrap_or_default();
15870                        }
15871                        __FieldTag::__management_dns_zone_binding => {
15872                            if !fields.insert(__FieldTag::__management_dns_zone_binding) {
15873                                return std::result::Result::Err(A::Error::duplicate_field(
15874                                    "multiple values for management_dns_zone_binding",
15875                                ));
15876                            }
15877                            result.management_dns_zone_binding = map.next_value::<std::option::Option<crate::model::ManagementDnsZoneBinding>>()?
15878                                ;
15879                        }
15880                        __FieldTag::__management_dns_zone_binding_id => {
15881                            if !fields.insert(__FieldTag::__management_dns_zone_binding_id) {
15882                                return std::result::Result::Err(A::Error::duplicate_field(
15883                                    "multiple values for management_dns_zone_binding_id",
15884                                ));
15885                            }
15886                            result.management_dns_zone_binding_id = map
15887                                .next_value::<std::option::Option<std::string::String>>()?
15888                                .unwrap_or_default();
15889                        }
15890                        __FieldTag::__request_id => {
15891                            if !fields.insert(__FieldTag::__request_id) {
15892                                return std::result::Result::Err(A::Error::duplicate_field(
15893                                    "multiple values for request_id",
15894                                ));
15895                            }
15896                            result.request_id = map
15897                                .next_value::<std::option::Option<std::string::String>>()?
15898                                .unwrap_or_default();
15899                        }
15900                        __FieldTag::Unknown(key) => {
15901                            let value = map.next_value::<serde_json::Value>()?;
15902                            result._unknown_fields.insert(key, value);
15903                        }
15904                    }
15905                }
15906                std::result::Result::Ok(result)
15907            }
15908        }
15909        deserializer.deserialize_any(Visitor)
15910    }
15911}
15912
15913#[doc(hidden)]
15914impl serde::ser::Serialize for CreateManagementDnsZoneBindingRequest {
15915    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15916    where
15917        S: serde::ser::Serializer,
15918    {
15919        use serde::ser::SerializeMap;
15920        #[allow(unused_imports)]
15921        use std::option::Option::Some;
15922        let mut state = serializer.serialize_map(std::option::Option::None)?;
15923        if !self.parent.is_empty() {
15924            state.serialize_entry("parent", &self.parent)?;
15925        }
15926        if self.management_dns_zone_binding.is_some() {
15927            state.serialize_entry(
15928                "managementDnsZoneBinding",
15929                &self.management_dns_zone_binding,
15930            )?;
15931        }
15932        if !self.management_dns_zone_binding_id.is_empty() {
15933            state.serialize_entry(
15934                "managementDnsZoneBindingId",
15935                &self.management_dns_zone_binding_id,
15936            )?;
15937        }
15938        if !self.request_id.is_empty() {
15939            state.serialize_entry("requestId", &self.request_id)?;
15940        }
15941        if !self._unknown_fields.is_empty() {
15942            for (key, value) in self._unknown_fields.iter() {
15943                state.serialize_entry(key, &value)?;
15944            }
15945        }
15946        state.end()
15947    }
15948}
15949
15950impl std::fmt::Debug for CreateManagementDnsZoneBindingRequest {
15951    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15952        let mut debug_struct = f.debug_struct("CreateManagementDnsZoneBindingRequest");
15953        debug_struct.field("parent", &self.parent);
15954        debug_struct.field(
15955            "management_dns_zone_binding",
15956            &self.management_dns_zone_binding,
15957        );
15958        debug_struct.field(
15959            "management_dns_zone_binding_id",
15960            &self.management_dns_zone_binding_id,
15961        );
15962        debug_struct.field("request_id", &self.request_id);
15963        if !self._unknown_fields.is_empty() {
15964            debug_struct.field("_unknown_fields", &self._unknown_fields);
15965        }
15966        debug_struct.finish()
15967    }
15968}
15969
15970/// Request message for
15971/// [VmwareEngine.UpdateManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]
15972///
15973/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding]: crate::client::VmwareEngine::update_management_dns_zone_binding
15974#[derive(Clone, Default, PartialEq)]
15975#[non_exhaustive]
15976pub struct UpdateManagementDnsZoneBindingRequest {
15977    /// Required. Field mask is used to specify the fields to be overwritten in the
15978    /// `ManagementDnsZoneBinding` resource by the update.
15979    /// The fields specified in the `update_mask` are relative to the resource, not
15980    /// the full request. A field will be overwritten if it is in the mask. If the
15981    /// user does not provide a mask then all fields will be overwritten.
15982    pub update_mask: std::option::Option<wkt::FieldMask>,
15983
15984    /// Required. New values to update the management DNS zone binding with.
15985    pub management_dns_zone_binding: std::option::Option<crate::model::ManagementDnsZoneBinding>,
15986
15987    /// Optional. A request ID to identify requests. Specify a unique request ID
15988    /// so that if you must retry your request, the server will know to ignore
15989    /// the request if it has already been completed. The server guarantees that a
15990    /// request doesn't result in creation of duplicate commitments for at least 60
15991    /// minutes.
15992    ///
15993    /// For example, consider a situation where you make an initial request and the
15994    /// request times out. If you make the request again with the same request ID,
15995    /// the server can check if the original operation with the same request ID was
15996    /// received, and if so, will ignore the second request. This prevents clients
15997    /// from accidentally creating duplicate commitments.
15998    ///
15999    /// The request ID must be a valid UUID with the exception that zero UUID is
16000    /// not supported (00000000-0000-0000-0000-000000000000).
16001    pub request_id: std::string::String,
16002
16003    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16004}
16005
16006impl UpdateManagementDnsZoneBindingRequest {
16007    pub fn new() -> Self {
16008        std::default::Default::default()
16009    }
16010
16011    /// Sets the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
16012    pub fn set_update_mask<T>(mut self, v: T) -> Self
16013    where
16014        T: std::convert::Into<wkt::FieldMask>,
16015    {
16016        self.update_mask = std::option::Option::Some(v.into());
16017        self
16018    }
16019
16020    /// Sets or clears the value of [update_mask][crate::model::UpdateManagementDnsZoneBindingRequest::update_mask].
16021    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16022    where
16023        T: std::convert::Into<wkt::FieldMask>,
16024    {
16025        self.update_mask = v.map(|x| x.into());
16026        self
16027    }
16028
16029    /// Sets the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
16030    pub fn set_management_dns_zone_binding<T>(mut self, v: T) -> Self
16031    where
16032        T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
16033    {
16034        self.management_dns_zone_binding = std::option::Option::Some(v.into());
16035        self
16036    }
16037
16038    /// Sets or clears the value of [management_dns_zone_binding][crate::model::UpdateManagementDnsZoneBindingRequest::management_dns_zone_binding].
16039    pub fn set_or_clear_management_dns_zone_binding<T>(mut self, v: std::option::Option<T>) -> Self
16040    where
16041        T: std::convert::Into<crate::model::ManagementDnsZoneBinding>,
16042    {
16043        self.management_dns_zone_binding = v.map(|x| x.into());
16044        self
16045    }
16046
16047    /// Sets the value of [request_id][crate::model::UpdateManagementDnsZoneBindingRequest::request_id].
16048    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16049        self.request_id = v.into();
16050        self
16051    }
16052}
16053
16054impl wkt::message::Message for UpdateManagementDnsZoneBindingRequest {
16055    fn typename() -> &'static str {
16056        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest"
16057    }
16058}
16059
16060#[doc(hidden)]
16061impl<'de> serde::de::Deserialize<'de> for UpdateManagementDnsZoneBindingRequest {
16062    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16063    where
16064        D: serde::Deserializer<'de>,
16065    {
16066        #[allow(non_camel_case_types)]
16067        #[doc(hidden)]
16068        #[derive(PartialEq, Eq, Hash)]
16069        enum __FieldTag {
16070            __update_mask,
16071            __management_dns_zone_binding,
16072            __request_id,
16073            Unknown(std::string::String),
16074        }
16075        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16076            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16077            where
16078                D: serde::Deserializer<'de>,
16079            {
16080                struct Visitor;
16081                impl<'de> serde::de::Visitor<'de> for Visitor {
16082                    type Value = __FieldTag;
16083                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16084                        formatter
16085                            .write_str("a field name for UpdateManagementDnsZoneBindingRequest")
16086                    }
16087                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16088                    where
16089                        E: serde::de::Error,
16090                    {
16091                        use std::result::Result::Ok;
16092                        use std::string::ToString;
16093                        match value {
16094                            "updateMask" => Ok(__FieldTag::__update_mask),
16095                            "update_mask" => Ok(__FieldTag::__update_mask),
16096                            "managementDnsZoneBinding" => {
16097                                Ok(__FieldTag::__management_dns_zone_binding)
16098                            }
16099                            "management_dns_zone_binding" => {
16100                                Ok(__FieldTag::__management_dns_zone_binding)
16101                            }
16102                            "requestId" => Ok(__FieldTag::__request_id),
16103                            "request_id" => Ok(__FieldTag::__request_id),
16104                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16105                        }
16106                    }
16107                }
16108                deserializer.deserialize_identifier(Visitor)
16109            }
16110        }
16111        struct Visitor;
16112        impl<'de> serde::de::Visitor<'de> for Visitor {
16113            type Value = UpdateManagementDnsZoneBindingRequest;
16114            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16115                formatter.write_str("struct UpdateManagementDnsZoneBindingRequest")
16116            }
16117            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16118            where
16119                A: serde::de::MapAccess<'de>,
16120            {
16121                #[allow(unused_imports)]
16122                use serde::de::Error;
16123                use std::option::Option::Some;
16124                let mut fields = std::collections::HashSet::new();
16125                let mut result = Self::Value::new();
16126                while let Some(tag) = map.next_key::<__FieldTag>()? {
16127                    #[allow(clippy::match_single_binding)]
16128                    match tag {
16129                        __FieldTag::__update_mask => {
16130                            if !fields.insert(__FieldTag::__update_mask) {
16131                                return std::result::Result::Err(A::Error::duplicate_field(
16132                                    "multiple values for update_mask",
16133                                ));
16134                            }
16135                            result.update_mask =
16136                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
16137                        }
16138                        __FieldTag::__management_dns_zone_binding => {
16139                            if !fields.insert(__FieldTag::__management_dns_zone_binding) {
16140                                return std::result::Result::Err(A::Error::duplicate_field(
16141                                    "multiple values for management_dns_zone_binding",
16142                                ));
16143                            }
16144                            result.management_dns_zone_binding = map.next_value::<std::option::Option<crate::model::ManagementDnsZoneBinding>>()?
16145                                ;
16146                        }
16147                        __FieldTag::__request_id => {
16148                            if !fields.insert(__FieldTag::__request_id) {
16149                                return std::result::Result::Err(A::Error::duplicate_field(
16150                                    "multiple values for request_id",
16151                                ));
16152                            }
16153                            result.request_id = map
16154                                .next_value::<std::option::Option<std::string::String>>()?
16155                                .unwrap_or_default();
16156                        }
16157                        __FieldTag::Unknown(key) => {
16158                            let value = map.next_value::<serde_json::Value>()?;
16159                            result._unknown_fields.insert(key, value);
16160                        }
16161                    }
16162                }
16163                std::result::Result::Ok(result)
16164            }
16165        }
16166        deserializer.deserialize_any(Visitor)
16167    }
16168}
16169
16170#[doc(hidden)]
16171impl serde::ser::Serialize for UpdateManagementDnsZoneBindingRequest {
16172    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16173    where
16174        S: serde::ser::Serializer,
16175    {
16176        use serde::ser::SerializeMap;
16177        #[allow(unused_imports)]
16178        use std::option::Option::Some;
16179        let mut state = serializer.serialize_map(std::option::Option::None)?;
16180        if self.update_mask.is_some() {
16181            state.serialize_entry("updateMask", &self.update_mask)?;
16182        }
16183        if self.management_dns_zone_binding.is_some() {
16184            state.serialize_entry(
16185                "managementDnsZoneBinding",
16186                &self.management_dns_zone_binding,
16187            )?;
16188        }
16189        if !self.request_id.is_empty() {
16190            state.serialize_entry("requestId", &self.request_id)?;
16191        }
16192        if !self._unknown_fields.is_empty() {
16193            for (key, value) in self._unknown_fields.iter() {
16194                state.serialize_entry(key, &value)?;
16195            }
16196        }
16197        state.end()
16198    }
16199}
16200
16201impl std::fmt::Debug for UpdateManagementDnsZoneBindingRequest {
16202    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16203        let mut debug_struct = f.debug_struct("UpdateManagementDnsZoneBindingRequest");
16204        debug_struct.field("update_mask", &self.update_mask);
16205        debug_struct.field(
16206            "management_dns_zone_binding",
16207            &self.management_dns_zone_binding,
16208        );
16209        debug_struct.field("request_id", &self.request_id);
16210        if !self._unknown_fields.is_empty() {
16211            debug_struct.field("_unknown_fields", &self._unknown_fields);
16212        }
16213        debug_struct.finish()
16214    }
16215}
16216
16217/// Request message for
16218/// [VmwareEngine.DeleteManagementDnsZoneBinding][google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]
16219///
16220/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding]: crate::client::VmwareEngine::delete_management_dns_zone_binding
16221#[derive(Clone, Default, PartialEq)]
16222#[non_exhaustive]
16223pub struct DeleteManagementDnsZoneBindingRequest {
16224    /// Required. The resource name of the management DNS zone binding to delete.
16225    /// Resource names are schemeless URIs that follow the conventions in
16226    /// <https://cloud.google.com/apis/design/resource_names>.
16227    /// For example:
16228    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16229    pub name: std::string::String,
16230
16231    /// Optional. A request ID to identify requests. Specify a unique request ID
16232    /// so that if you must retry your request, the server will know to ignore
16233    /// the request if it has already been completed. The server guarantees that a
16234    /// request doesn't result in creation of duplicate commitments for at least 60
16235    /// minutes.
16236    ///
16237    /// For example, consider a situation where you make an initial request and the
16238    /// request times out. If you make the request again with the same request
16239    /// ID, the server can check if the original operation with the same request ID
16240    /// was received, and if so, will ignore the second request. This prevents
16241    /// clients from accidentally creating duplicate commitments.
16242    ///
16243    /// The request ID must be a valid UUID with the exception that zero UUID is
16244    /// not supported (00000000-0000-0000-0000-000000000000).
16245    pub request_id: std::string::String,
16246
16247    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16248}
16249
16250impl DeleteManagementDnsZoneBindingRequest {
16251    pub fn new() -> Self {
16252        std::default::Default::default()
16253    }
16254
16255    /// Sets the value of [name][crate::model::DeleteManagementDnsZoneBindingRequest::name].
16256    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16257        self.name = v.into();
16258        self
16259    }
16260
16261    /// Sets the value of [request_id][crate::model::DeleteManagementDnsZoneBindingRequest::request_id].
16262    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16263        self.request_id = v.into();
16264        self
16265    }
16266}
16267
16268impl wkt::message::Message for DeleteManagementDnsZoneBindingRequest {
16269    fn typename() -> &'static str {
16270        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest"
16271    }
16272}
16273
16274#[doc(hidden)]
16275impl<'de> serde::de::Deserialize<'de> for DeleteManagementDnsZoneBindingRequest {
16276    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16277    where
16278        D: serde::Deserializer<'de>,
16279    {
16280        #[allow(non_camel_case_types)]
16281        #[doc(hidden)]
16282        #[derive(PartialEq, Eq, Hash)]
16283        enum __FieldTag {
16284            __name,
16285            __request_id,
16286            Unknown(std::string::String),
16287        }
16288        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16289            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16290            where
16291                D: serde::Deserializer<'de>,
16292            {
16293                struct Visitor;
16294                impl<'de> serde::de::Visitor<'de> for Visitor {
16295                    type Value = __FieldTag;
16296                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16297                        formatter
16298                            .write_str("a field name for DeleteManagementDnsZoneBindingRequest")
16299                    }
16300                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16301                    where
16302                        E: serde::de::Error,
16303                    {
16304                        use std::result::Result::Ok;
16305                        use std::string::ToString;
16306                        match value {
16307                            "name" => Ok(__FieldTag::__name),
16308                            "requestId" => Ok(__FieldTag::__request_id),
16309                            "request_id" => Ok(__FieldTag::__request_id),
16310                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16311                        }
16312                    }
16313                }
16314                deserializer.deserialize_identifier(Visitor)
16315            }
16316        }
16317        struct Visitor;
16318        impl<'de> serde::de::Visitor<'de> for Visitor {
16319            type Value = DeleteManagementDnsZoneBindingRequest;
16320            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16321                formatter.write_str("struct DeleteManagementDnsZoneBindingRequest")
16322            }
16323            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16324            where
16325                A: serde::de::MapAccess<'de>,
16326            {
16327                #[allow(unused_imports)]
16328                use serde::de::Error;
16329                use std::option::Option::Some;
16330                let mut fields = std::collections::HashSet::new();
16331                let mut result = Self::Value::new();
16332                while let Some(tag) = map.next_key::<__FieldTag>()? {
16333                    #[allow(clippy::match_single_binding)]
16334                    match tag {
16335                        __FieldTag::__name => {
16336                            if !fields.insert(__FieldTag::__name) {
16337                                return std::result::Result::Err(A::Error::duplicate_field(
16338                                    "multiple values for name",
16339                                ));
16340                            }
16341                            result.name = map
16342                                .next_value::<std::option::Option<std::string::String>>()?
16343                                .unwrap_or_default();
16344                        }
16345                        __FieldTag::__request_id => {
16346                            if !fields.insert(__FieldTag::__request_id) {
16347                                return std::result::Result::Err(A::Error::duplicate_field(
16348                                    "multiple values for request_id",
16349                                ));
16350                            }
16351                            result.request_id = map
16352                                .next_value::<std::option::Option<std::string::String>>()?
16353                                .unwrap_or_default();
16354                        }
16355                        __FieldTag::Unknown(key) => {
16356                            let value = map.next_value::<serde_json::Value>()?;
16357                            result._unknown_fields.insert(key, value);
16358                        }
16359                    }
16360                }
16361                std::result::Result::Ok(result)
16362            }
16363        }
16364        deserializer.deserialize_any(Visitor)
16365    }
16366}
16367
16368#[doc(hidden)]
16369impl serde::ser::Serialize for DeleteManagementDnsZoneBindingRequest {
16370    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16371    where
16372        S: serde::ser::Serializer,
16373    {
16374        use serde::ser::SerializeMap;
16375        #[allow(unused_imports)]
16376        use std::option::Option::Some;
16377        let mut state = serializer.serialize_map(std::option::Option::None)?;
16378        if !self.name.is_empty() {
16379            state.serialize_entry("name", &self.name)?;
16380        }
16381        if !self.request_id.is_empty() {
16382            state.serialize_entry("requestId", &self.request_id)?;
16383        }
16384        if !self._unknown_fields.is_empty() {
16385            for (key, value) in self._unknown_fields.iter() {
16386                state.serialize_entry(key, &value)?;
16387            }
16388        }
16389        state.end()
16390    }
16391}
16392
16393impl std::fmt::Debug for DeleteManagementDnsZoneBindingRequest {
16394    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16395        let mut debug_struct = f.debug_struct("DeleteManagementDnsZoneBindingRequest");
16396        debug_struct.field("name", &self.name);
16397        debug_struct.field("request_id", &self.request_id);
16398        if !self._unknown_fields.is_empty() {
16399            debug_struct.field("_unknown_fields", &self._unknown_fields);
16400        }
16401        debug_struct.finish()
16402    }
16403}
16404
16405/// Request message for [VmwareEngine.RepairManagementDnsZoneBindings][]
16406#[derive(Clone, Default, PartialEq)]
16407#[non_exhaustive]
16408pub struct RepairManagementDnsZoneBindingRequest {
16409    /// Required. The resource name of the management DNS zone binding to repair.
16410    /// Resource names are schemeless URIs that follow the conventions in
16411    /// <https://cloud.google.com/apis/design/resource_names>.
16412    /// For example:
16413    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
16414    pub name: std::string::String,
16415
16416    /// Optional. A request ID to identify requests. Specify a unique request ID
16417    /// so that if you must retry your request, the server will know to ignore
16418    /// the request if it has already been completed. The server guarantees that a
16419    /// request doesn't result in creation of duplicate commitments for at least 60
16420    /// minutes.
16421    ///
16422    /// For example, consider a situation where you make an initial request and the
16423    /// request times out. If you make the request again with the same request ID,
16424    /// the server can check if the original operation with the same request ID was
16425    /// received, and if so, will ignore the second request. This prevents clients
16426    /// from accidentally creating duplicate commitments.
16427    ///
16428    /// The request ID must be a valid UUID with the exception that zero UUID is
16429    /// not supported (00000000-0000-0000-0000-000000000000).
16430    pub request_id: std::string::String,
16431
16432    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16433}
16434
16435impl RepairManagementDnsZoneBindingRequest {
16436    pub fn new() -> Self {
16437        std::default::Default::default()
16438    }
16439
16440    /// Sets the value of [name][crate::model::RepairManagementDnsZoneBindingRequest::name].
16441    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16442        self.name = v.into();
16443        self
16444    }
16445
16446    /// Sets the value of [request_id][crate::model::RepairManagementDnsZoneBindingRequest::request_id].
16447    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16448        self.request_id = v.into();
16449        self
16450    }
16451}
16452
16453impl wkt::message::Message for RepairManagementDnsZoneBindingRequest {
16454    fn typename() -> &'static str {
16455        "type.googleapis.com/google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest"
16456    }
16457}
16458
16459#[doc(hidden)]
16460impl<'de> serde::de::Deserialize<'de> for RepairManagementDnsZoneBindingRequest {
16461    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16462    where
16463        D: serde::Deserializer<'de>,
16464    {
16465        #[allow(non_camel_case_types)]
16466        #[doc(hidden)]
16467        #[derive(PartialEq, Eq, Hash)]
16468        enum __FieldTag {
16469            __name,
16470            __request_id,
16471            Unknown(std::string::String),
16472        }
16473        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16474            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16475            where
16476                D: serde::Deserializer<'de>,
16477            {
16478                struct Visitor;
16479                impl<'de> serde::de::Visitor<'de> for Visitor {
16480                    type Value = __FieldTag;
16481                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16482                        formatter
16483                            .write_str("a field name for RepairManagementDnsZoneBindingRequest")
16484                    }
16485                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16486                    where
16487                        E: serde::de::Error,
16488                    {
16489                        use std::result::Result::Ok;
16490                        use std::string::ToString;
16491                        match value {
16492                            "name" => Ok(__FieldTag::__name),
16493                            "requestId" => Ok(__FieldTag::__request_id),
16494                            "request_id" => Ok(__FieldTag::__request_id),
16495                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16496                        }
16497                    }
16498                }
16499                deserializer.deserialize_identifier(Visitor)
16500            }
16501        }
16502        struct Visitor;
16503        impl<'de> serde::de::Visitor<'de> for Visitor {
16504            type Value = RepairManagementDnsZoneBindingRequest;
16505            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16506                formatter.write_str("struct RepairManagementDnsZoneBindingRequest")
16507            }
16508            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16509            where
16510                A: serde::de::MapAccess<'de>,
16511            {
16512                #[allow(unused_imports)]
16513                use serde::de::Error;
16514                use std::option::Option::Some;
16515                let mut fields = std::collections::HashSet::new();
16516                let mut result = Self::Value::new();
16517                while let Some(tag) = map.next_key::<__FieldTag>()? {
16518                    #[allow(clippy::match_single_binding)]
16519                    match tag {
16520                        __FieldTag::__name => {
16521                            if !fields.insert(__FieldTag::__name) {
16522                                return std::result::Result::Err(A::Error::duplicate_field(
16523                                    "multiple values for name",
16524                                ));
16525                            }
16526                            result.name = map
16527                                .next_value::<std::option::Option<std::string::String>>()?
16528                                .unwrap_or_default();
16529                        }
16530                        __FieldTag::__request_id => {
16531                            if !fields.insert(__FieldTag::__request_id) {
16532                                return std::result::Result::Err(A::Error::duplicate_field(
16533                                    "multiple values for request_id",
16534                                ));
16535                            }
16536                            result.request_id = map
16537                                .next_value::<std::option::Option<std::string::String>>()?
16538                                .unwrap_or_default();
16539                        }
16540                        __FieldTag::Unknown(key) => {
16541                            let value = map.next_value::<serde_json::Value>()?;
16542                            result._unknown_fields.insert(key, value);
16543                        }
16544                    }
16545                }
16546                std::result::Result::Ok(result)
16547            }
16548        }
16549        deserializer.deserialize_any(Visitor)
16550    }
16551}
16552
16553#[doc(hidden)]
16554impl serde::ser::Serialize for RepairManagementDnsZoneBindingRequest {
16555    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16556    where
16557        S: serde::ser::Serializer,
16558    {
16559        use serde::ser::SerializeMap;
16560        #[allow(unused_imports)]
16561        use std::option::Option::Some;
16562        let mut state = serializer.serialize_map(std::option::Option::None)?;
16563        if !self.name.is_empty() {
16564            state.serialize_entry("name", &self.name)?;
16565        }
16566        if !self.request_id.is_empty() {
16567            state.serialize_entry("requestId", &self.request_id)?;
16568        }
16569        if !self._unknown_fields.is_empty() {
16570            for (key, value) in self._unknown_fields.iter() {
16571                state.serialize_entry(key, &value)?;
16572            }
16573        }
16574        state.end()
16575    }
16576}
16577
16578impl std::fmt::Debug for RepairManagementDnsZoneBindingRequest {
16579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16580        let mut debug_struct = f.debug_struct("RepairManagementDnsZoneBindingRequest");
16581        debug_struct.field("name", &self.name);
16582        debug_struct.field("request_id", &self.request_id);
16583        if !self._unknown_fields.is_empty() {
16584            debug_struct.field("_unknown_fields", &self._unknown_fields);
16585        }
16586        debug_struct.finish()
16587    }
16588}
16589
16590/// Request message for
16591/// [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]
16592///
16593/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork]: crate::client::VmwareEngine::create_vmware_engine_network
16594#[derive(Clone, Default, PartialEq)]
16595#[non_exhaustive]
16596pub struct CreateVmwareEngineNetworkRequest {
16597    /// Required. The resource name of the location to create the new VMware Engine
16598    /// network in. A VMware Engine network of type
16599    /// `LEGACY` is a regional resource, and a VMware
16600    /// Engine network of type `STANDARD` is a global resource.
16601    /// Resource names are schemeless URIs that follow the conventions in
16602    /// <https://cloud.google.com/apis/design/resource_names>. For example:
16603    /// `projects/my-project/locations/global`
16604    pub parent: std::string::String,
16605
16606    /// Required. The user-provided identifier of the new VMware Engine network.
16607    /// This identifier must be unique among VMware Engine network resources
16608    /// within the parent and becomes the final token in the name URI. The
16609    /// identifier must meet the following requirements:
16610    ///
16611    /// * For networks of type LEGACY, adheres to the format:
16612    ///   `{region-id}-default`. Replace `{region-id}` with the region where you want
16613    ///   to create the VMware Engine network. For example, "us-central1-default".
16614    /// * Only contains 1-63 alphanumeric characters and hyphens
16615    /// * Begins with an alphabetical character
16616    /// * Ends with a non-hyphen character
16617    /// * Not formatted as a UUID
16618    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
16619    ///   (section 3.5)
16620    pub vmware_engine_network_id: std::string::String,
16621
16622    /// Required. The initial description of the new VMware Engine network.
16623    pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
16624
16625    /// Optional. A request ID to identify requests. Specify a unique request ID
16626    /// so that if you must retry your request, the server will know to ignore
16627    /// the request if it has already been completed. The server guarantees that a
16628    /// request doesn't result in creation of duplicate commitments for at least 60
16629    /// minutes.
16630    ///
16631    /// For example, consider a situation where you make an initial request and the
16632    /// request times out. If you make the request again with the same request
16633    /// ID, the server can check if original operation with the same request ID
16634    /// was received, and if so, will ignore the second request. This prevents
16635    /// clients from accidentally creating duplicate commitments.
16636    ///
16637    /// The request ID must be a valid UUID with the exception that zero UUID is
16638    /// not supported (00000000-0000-0000-0000-000000000000).
16639    pub request_id: std::string::String,
16640
16641    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16642}
16643
16644impl CreateVmwareEngineNetworkRequest {
16645    pub fn new() -> Self {
16646        std::default::Default::default()
16647    }
16648
16649    /// Sets the value of [parent][crate::model::CreateVmwareEngineNetworkRequest::parent].
16650    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16651        self.parent = v.into();
16652        self
16653    }
16654
16655    /// Sets the value of [vmware_engine_network_id][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network_id].
16656    pub fn set_vmware_engine_network_id<T: std::convert::Into<std::string::String>>(
16657        mut self,
16658        v: T,
16659    ) -> Self {
16660        self.vmware_engine_network_id = v.into();
16661        self
16662    }
16663
16664    /// Sets the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
16665    pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
16666    where
16667        T: std::convert::Into<crate::model::VmwareEngineNetwork>,
16668    {
16669        self.vmware_engine_network = std::option::Option::Some(v.into());
16670        self
16671    }
16672
16673    /// Sets or clears the value of [vmware_engine_network][crate::model::CreateVmwareEngineNetworkRequest::vmware_engine_network].
16674    pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
16675    where
16676        T: std::convert::Into<crate::model::VmwareEngineNetwork>,
16677    {
16678        self.vmware_engine_network = v.map(|x| x.into());
16679        self
16680    }
16681
16682    /// Sets the value of [request_id][crate::model::CreateVmwareEngineNetworkRequest::request_id].
16683    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16684        self.request_id = v.into();
16685        self
16686    }
16687}
16688
16689impl wkt::message::Message for CreateVmwareEngineNetworkRequest {
16690    fn typename() -> &'static str {
16691        "type.googleapis.com/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"
16692    }
16693}
16694
16695#[doc(hidden)]
16696impl<'de> serde::de::Deserialize<'de> for CreateVmwareEngineNetworkRequest {
16697    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16698    where
16699        D: serde::Deserializer<'de>,
16700    {
16701        #[allow(non_camel_case_types)]
16702        #[doc(hidden)]
16703        #[derive(PartialEq, Eq, Hash)]
16704        enum __FieldTag {
16705            __parent,
16706            __vmware_engine_network_id,
16707            __vmware_engine_network,
16708            __request_id,
16709            Unknown(std::string::String),
16710        }
16711        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16712            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16713            where
16714                D: serde::Deserializer<'de>,
16715            {
16716                struct Visitor;
16717                impl<'de> serde::de::Visitor<'de> for Visitor {
16718                    type Value = __FieldTag;
16719                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16720                        formatter.write_str("a field name for CreateVmwareEngineNetworkRequest")
16721                    }
16722                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16723                    where
16724                        E: serde::de::Error,
16725                    {
16726                        use std::result::Result::Ok;
16727                        use std::string::ToString;
16728                        match value {
16729                            "parent" => Ok(__FieldTag::__parent),
16730                            "vmwareEngineNetworkId" => Ok(__FieldTag::__vmware_engine_network_id),
16731                            "vmware_engine_network_id" => {
16732                                Ok(__FieldTag::__vmware_engine_network_id)
16733                            }
16734                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
16735                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
16736                            "requestId" => Ok(__FieldTag::__request_id),
16737                            "request_id" => Ok(__FieldTag::__request_id),
16738                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16739                        }
16740                    }
16741                }
16742                deserializer.deserialize_identifier(Visitor)
16743            }
16744        }
16745        struct Visitor;
16746        impl<'de> serde::de::Visitor<'de> for Visitor {
16747            type Value = CreateVmwareEngineNetworkRequest;
16748            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16749                formatter.write_str("struct CreateVmwareEngineNetworkRequest")
16750            }
16751            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16752            where
16753                A: serde::de::MapAccess<'de>,
16754            {
16755                #[allow(unused_imports)]
16756                use serde::de::Error;
16757                use std::option::Option::Some;
16758                let mut fields = std::collections::HashSet::new();
16759                let mut result = Self::Value::new();
16760                while let Some(tag) = map.next_key::<__FieldTag>()? {
16761                    #[allow(clippy::match_single_binding)]
16762                    match tag {
16763                        __FieldTag::__parent => {
16764                            if !fields.insert(__FieldTag::__parent) {
16765                                return std::result::Result::Err(A::Error::duplicate_field(
16766                                    "multiple values for parent",
16767                                ));
16768                            }
16769                            result.parent = map
16770                                .next_value::<std::option::Option<std::string::String>>()?
16771                                .unwrap_or_default();
16772                        }
16773                        __FieldTag::__vmware_engine_network_id => {
16774                            if !fields.insert(__FieldTag::__vmware_engine_network_id) {
16775                                return std::result::Result::Err(A::Error::duplicate_field(
16776                                    "multiple values for vmware_engine_network_id",
16777                                ));
16778                            }
16779                            result.vmware_engine_network_id = map
16780                                .next_value::<std::option::Option<std::string::String>>()?
16781                                .unwrap_or_default();
16782                        }
16783                        __FieldTag::__vmware_engine_network => {
16784                            if !fields.insert(__FieldTag::__vmware_engine_network) {
16785                                return std::result::Result::Err(A::Error::duplicate_field(
16786                                    "multiple values for vmware_engine_network",
16787                                ));
16788                            }
16789                            result.vmware_engine_network = map.next_value::<std::option::Option<crate::model::VmwareEngineNetwork>>()?
16790                                ;
16791                        }
16792                        __FieldTag::__request_id => {
16793                            if !fields.insert(__FieldTag::__request_id) {
16794                                return std::result::Result::Err(A::Error::duplicate_field(
16795                                    "multiple values for request_id",
16796                                ));
16797                            }
16798                            result.request_id = map
16799                                .next_value::<std::option::Option<std::string::String>>()?
16800                                .unwrap_or_default();
16801                        }
16802                        __FieldTag::Unknown(key) => {
16803                            let value = map.next_value::<serde_json::Value>()?;
16804                            result._unknown_fields.insert(key, value);
16805                        }
16806                    }
16807                }
16808                std::result::Result::Ok(result)
16809            }
16810        }
16811        deserializer.deserialize_any(Visitor)
16812    }
16813}
16814
16815#[doc(hidden)]
16816impl serde::ser::Serialize for CreateVmwareEngineNetworkRequest {
16817    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16818    where
16819        S: serde::ser::Serializer,
16820    {
16821        use serde::ser::SerializeMap;
16822        #[allow(unused_imports)]
16823        use std::option::Option::Some;
16824        let mut state = serializer.serialize_map(std::option::Option::None)?;
16825        if !self.parent.is_empty() {
16826            state.serialize_entry("parent", &self.parent)?;
16827        }
16828        if !self.vmware_engine_network_id.is_empty() {
16829            state.serialize_entry("vmwareEngineNetworkId", &self.vmware_engine_network_id)?;
16830        }
16831        if self.vmware_engine_network.is_some() {
16832            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
16833        }
16834        if !self.request_id.is_empty() {
16835            state.serialize_entry("requestId", &self.request_id)?;
16836        }
16837        if !self._unknown_fields.is_empty() {
16838            for (key, value) in self._unknown_fields.iter() {
16839                state.serialize_entry(key, &value)?;
16840            }
16841        }
16842        state.end()
16843    }
16844}
16845
16846impl std::fmt::Debug for CreateVmwareEngineNetworkRequest {
16847    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16848        let mut debug_struct = f.debug_struct("CreateVmwareEngineNetworkRequest");
16849        debug_struct.field("parent", &self.parent);
16850        debug_struct.field("vmware_engine_network_id", &self.vmware_engine_network_id);
16851        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
16852        debug_struct.field("request_id", &self.request_id);
16853        if !self._unknown_fields.is_empty() {
16854            debug_struct.field("_unknown_fields", &self._unknown_fields);
16855        }
16856        debug_struct.finish()
16857    }
16858}
16859
16860/// Request message for
16861/// [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]
16862///
16863/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork]: crate::client::VmwareEngine::update_vmware_engine_network
16864#[derive(Clone, Default, PartialEq)]
16865#[non_exhaustive]
16866pub struct UpdateVmwareEngineNetworkRequest {
16867    /// Required. VMware Engine network description.
16868    pub vmware_engine_network: std::option::Option<crate::model::VmwareEngineNetwork>,
16869
16870    /// Required. Field mask is used to specify the fields to be overwritten in the
16871    /// VMware Engine network resource by the update.
16872    /// The fields specified in the `update_mask` are relative to the resource, not
16873    /// the full request. A field will be overwritten if it is in the mask. If the
16874    /// user does not provide a mask then all fields will be overwritten. Only the
16875    /// following fields can be updated: `description`.
16876    pub update_mask: std::option::Option<wkt::FieldMask>,
16877
16878    /// Optional. A request ID to identify requests. Specify a unique request ID
16879    /// so that if you must retry your request, the server will know to ignore
16880    /// the request if it has already been completed. The server guarantees that a
16881    /// request doesn't result in creation of duplicate commitments for at least 60
16882    /// minutes.
16883    ///
16884    /// For example, consider a situation where you make an initial request and the
16885    /// request times out. If you make the request again with the same request
16886    /// ID, the server can check if original operation with the same request ID
16887    /// was received, and if so, will ignore the second request. This prevents
16888    /// clients from accidentally creating duplicate commitments.
16889    ///
16890    /// The request ID must be a valid UUID with the exception that zero UUID is
16891    /// not supported (00000000-0000-0000-0000-000000000000).
16892    pub request_id: std::string::String,
16893
16894    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16895}
16896
16897impl UpdateVmwareEngineNetworkRequest {
16898    pub fn new() -> Self {
16899        std::default::Default::default()
16900    }
16901
16902    /// Sets the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
16903    pub fn set_vmware_engine_network<T>(mut self, v: T) -> Self
16904    where
16905        T: std::convert::Into<crate::model::VmwareEngineNetwork>,
16906    {
16907        self.vmware_engine_network = std::option::Option::Some(v.into());
16908        self
16909    }
16910
16911    /// Sets or clears the value of [vmware_engine_network][crate::model::UpdateVmwareEngineNetworkRequest::vmware_engine_network].
16912    pub fn set_or_clear_vmware_engine_network<T>(mut self, v: std::option::Option<T>) -> Self
16913    where
16914        T: std::convert::Into<crate::model::VmwareEngineNetwork>,
16915    {
16916        self.vmware_engine_network = v.map(|x| x.into());
16917        self
16918    }
16919
16920    /// Sets the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
16921    pub fn set_update_mask<T>(mut self, v: T) -> Self
16922    where
16923        T: std::convert::Into<wkt::FieldMask>,
16924    {
16925        self.update_mask = std::option::Option::Some(v.into());
16926        self
16927    }
16928
16929    /// Sets or clears the value of [update_mask][crate::model::UpdateVmwareEngineNetworkRequest::update_mask].
16930    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16931    where
16932        T: std::convert::Into<wkt::FieldMask>,
16933    {
16934        self.update_mask = v.map(|x| x.into());
16935        self
16936    }
16937
16938    /// Sets the value of [request_id][crate::model::UpdateVmwareEngineNetworkRequest::request_id].
16939    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16940        self.request_id = v.into();
16941        self
16942    }
16943}
16944
16945impl wkt::message::Message for UpdateVmwareEngineNetworkRequest {
16946    fn typename() -> &'static str {
16947        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"
16948    }
16949}
16950
16951#[doc(hidden)]
16952impl<'de> serde::de::Deserialize<'de> for UpdateVmwareEngineNetworkRequest {
16953    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16954    where
16955        D: serde::Deserializer<'de>,
16956    {
16957        #[allow(non_camel_case_types)]
16958        #[doc(hidden)]
16959        #[derive(PartialEq, Eq, Hash)]
16960        enum __FieldTag {
16961            __vmware_engine_network,
16962            __update_mask,
16963            __request_id,
16964            Unknown(std::string::String),
16965        }
16966        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16967            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16968            where
16969                D: serde::Deserializer<'de>,
16970            {
16971                struct Visitor;
16972                impl<'de> serde::de::Visitor<'de> for Visitor {
16973                    type Value = __FieldTag;
16974                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16975                        formatter.write_str("a field name for UpdateVmwareEngineNetworkRequest")
16976                    }
16977                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16978                    where
16979                        E: serde::de::Error,
16980                    {
16981                        use std::result::Result::Ok;
16982                        use std::string::ToString;
16983                        match value {
16984                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
16985                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
16986                            "updateMask" => Ok(__FieldTag::__update_mask),
16987                            "update_mask" => Ok(__FieldTag::__update_mask),
16988                            "requestId" => Ok(__FieldTag::__request_id),
16989                            "request_id" => Ok(__FieldTag::__request_id),
16990                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16991                        }
16992                    }
16993                }
16994                deserializer.deserialize_identifier(Visitor)
16995            }
16996        }
16997        struct Visitor;
16998        impl<'de> serde::de::Visitor<'de> for Visitor {
16999            type Value = UpdateVmwareEngineNetworkRequest;
17000            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17001                formatter.write_str("struct UpdateVmwareEngineNetworkRequest")
17002            }
17003            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17004            where
17005                A: serde::de::MapAccess<'de>,
17006            {
17007                #[allow(unused_imports)]
17008                use serde::de::Error;
17009                use std::option::Option::Some;
17010                let mut fields = std::collections::HashSet::new();
17011                let mut result = Self::Value::new();
17012                while let Some(tag) = map.next_key::<__FieldTag>()? {
17013                    #[allow(clippy::match_single_binding)]
17014                    match tag {
17015                        __FieldTag::__vmware_engine_network => {
17016                            if !fields.insert(__FieldTag::__vmware_engine_network) {
17017                                return std::result::Result::Err(A::Error::duplicate_field(
17018                                    "multiple values for vmware_engine_network",
17019                                ));
17020                            }
17021                            result.vmware_engine_network = map.next_value::<std::option::Option<crate::model::VmwareEngineNetwork>>()?
17022                                ;
17023                        }
17024                        __FieldTag::__update_mask => {
17025                            if !fields.insert(__FieldTag::__update_mask) {
17026                                return std::result::Result::Err(A::Error::duplicate_field(
17027                                    "multiple values for update_mask",
17028                                ));
17029                            }
17030                            result.update_mask =
17031                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
17032                        }
17033                        __FieldTag::__request_id => {
17034                            if !fields.insert(__FieldTag::__request_id) {
17035                                return std::result::Result::Err(A::Error::duplicate_field(
17036                                    "multiple values for request_id",
17037                                ));
17038                            }
17039                            result.request_id = map
17040                                .next_value::<std::option::Option<std::string::String>>()?
17041                                .unwrap_or_default();
17042                        }
17043                        __FieldTag::Unknown(key) => {
17044                            let value = map.next_value::<serde_json::Value>()?;
17045                            result._unknown_fields.insert(key, value);
17046                        }
17047                    }
17048                }
17049                std::result::Result::Ok(result)
17050            }
17051        }
17052        deserializer.deserialize_any(Visitor)
17053    }
17054}
17055
17056#[doc(hidden)]
17057impl serde::ser::Serialize for UpdateVmwareEngineNetworkRequest {
17058    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17059    where
17060        S: serde::ser::Serializer,
17061    {
17062        use serde::ser::SerializeMap;
17063        #[allow(unused_imports)]
17064        use std::option::Option::Some;
17065        let mut state = serializer.serialize_map(std::option::Option::None)?;
17066        if self.vmware_engine_network.is_some() {
17067            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
17068        }
17069        if self.update_mask.is_some() {
17070            state.serialize_entry("updateMask", &self.update_mask)?;
17071        }
17072        if !self.request_id.is_empty() {
17073            state.serialize_entry("requestId", &self.request_id)?;
17074        }
17075        if !self._unknown_fields.is_empty() {
17076            for (key, value) in self._unknown_fields.iter() {
17077                state.serialize_entry(key, &value)?;
17078            }
17079        }
17080        state.end()
17081    }
17082}
17083
17084impl std::fmt::Debug for UpdateVmwareEngineNetworkRequest {
17085    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17086        let mut debug_struct = f.debug_struct("UpdateVmwareEngineNetworkRequest");
17087        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
17088        debug_struct.field("update_mask", &self.update_mask);
17089        debug_struct.field("request_id", &self.request_id);
17090        if !self._unknown_fields.is_empty() {
17091            debug_struct.field("_unknown_fields", &self._unknown_fields);
17092        }
17093        debug_struct.finish()
17094    }
17095}
17096
17097/// Request message for
17098/// [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]
17099///
17100/// [google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork]: crate::client::VmwareEngine::delete_vmware_engine_network
17101#[derive(Clone, Default, PartialEq)]
17102#[non_exhaustive]
17103pub struct DeleteVmwareEngineNetworkRequest {
17104    /// Required. The resource name of the VMware Engine network to be deleted.
17105    /// Resource names are schemeless URIs that follow the conventions in
17106    /// <https://cloud.google.com/apis/design/resource_names>.
17107    /// For example:
17108    /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
17109    pub name: std::string::String,
17110
17111    /// Optional. A request ID to identify requests. Specify a unique request ID
17112    /// so that if you must retry your request, the server will know to ignore
17113    /// the request if it has already been completed. The server guarantees that a
17114    /// request doesn't result in creation of duplicate commitments for at least 60
17115    /// minutes.
17116    ///
17117    /// For example, consider a situation where you make an initial request and the
17118    /// request times out. If you make the request again with the same request
17119    /// ID, the server can check if original operation with the same request ID
17120    /// was received, and if so, will ignore the second request. This prevents
17121    /// clients from accidentally creating duplicate commitments.
17122    ///
17123    /// The request ID must be a valid UUID with the exception that zero UUID is
17124    /// not supported (00000000-0000-0000-0000-000000000000).
17125    pub request_id: std::string::String,
17126
17127    /// Optional. Checksum used to ensure that the user-provided value is up to
17128    /// date before the server processes the request. The server compares provided
17129    /// checksum with the current checksum of the resource. If the user-provided
17130    /// value is out of date, this request returns an `ABORTED` error.
17131    pub etag: std::string::String,
17132
17133    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17134}
17135
17136impl DeleteVmwareEngineNetworkRequest {
17137    pub fn new() -> Self {
17138        std::default::Default::default()
17139    }
17140
17141    /// Sets the value of [name][crate::model::DeleteVmwareEngineNetworkRequest::name].
17142    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17143        self.name = v.into();
17144        self
17145    }
17146
17147    /// Sets the value of [request_id][crate::model::DeleteVmwareEngineNetworkRequest::request_id].
17148    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17149        self.request_id = v.into();
17150        self
17151    }
17152
17153    /// Sets the value of [etag][crate::model::DeleteVmwareEngineNetworkRequest::etag].
17154    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17155        self.etag = v.into();
17156        self
17157    }
17158}
17159
17160impl wkt::message::Message for DeleteVmwareEngineNetworkRequest {
17161    fn typename() -> &'static str {
17162        "type.googleapis.com/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"
17163    }
17164}
17165
17166#[doc(hidden)]
17167impl<'de> serde::de::Deserialize<'de> for DeleteVmwareEngineNetworkRequest {
17168    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17169    where
17170        D: serde::Deserializer<'de>,
17171    {
17172        #[allow(non_camel_case_types)]
17173        #[doc(hidden)]
17174        #[derive(PartialEq, Eq, Hash)]
17175        enum __FieldTag {
17176            __name,
17177            __request_id,
17178            __etag,
17179            Unknown(std::string::String),
17180        }
17181        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17182            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17183            where
17184                D: serde::Deserializer<'de>,
17185            {
17186                struct Visitor;
17187                impl<'de> serde::de::Visitor<'de> for Visitor {
17188                    type Value = __FieldTag;
17189                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17190                        formatter.write_str("a field name for DeleteVmwareEngineNetworkRequest")
17191                    }
17192                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17193                    where
17194                        E: serde::de::Error,
17195                    {
17196                        use std::result::Result::Ok;
17197                        use std::string::ToString;
17198                        match value {
17199                            "name" => Ok(__FieldTag::__name),
17200                            "requestId" => Ok(__FieldTag::__request_id),
17201                            "request_id" => Ok(__FieldTag::__request_id),
17202                            "etag" => Ok(__FieldTag::__etag),
17203                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17204                        }
17205                    }
17206                }
17207                deserializer.deserialize_identifier(Visitor)
17208            }
17209        }
17210        struct Visitor;
17211        impl<'de> serde::de::Visitor<'de> for Visitor {
17212            type Value = DeleteVmwareEngineNetworkRequest;
17213            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17214                formatter.write_str("struct DeleteVmwareEngineNetworkRequest")
17215            }
17216            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17217            where
17218                A: serde::de::MapAccess<'de>,
17219            {
17220                #[allow(unused_imports)]
17221                use serde::de::Error;
17222                use std::option::Option::Some;
17223                let mut fields = std::collections::HashSet::new();
17224                let mut result = Self::Value::new();
17225                while let Some(tag) = map.next_key::<__FieldTag>()? {
17226                    #[allow(clippy::match_single_binding)]
17227                    match tag {
17228                        __FieldTag::__name => {
17229                            if !fields.insert(__FieldTag::__name) {
17230                                return std::result::Result::Err(A::Error::duplicate_field(
17231                                    "multiple values for name",
17232                                ));
17233                            }
17234                            result.name = map
17235                                .next_value::<std::option::Option<std::string::String>>()?
17236                                .unwrap_or_default();
17237                        }
17238                        __FieldTag::__request_id => {
17239                            if !fields.insert(__FieldTag::__request_id) {
17240                                return std::result::Result::Err(A::Error::duplicate_field(
17241                                    "multiple values for request_id",
17242                                ));
17243                            }
17244                            result.request_id = map
17245                                .next_value::<std::option::Option<std::string::String>>()?
17246                                .unwrap_or_default();
17247                        }
17248                        __FieldTag::__etag => {
17249                            if !fields.insert(__FieldTag::__etag) {
17250                                return std::result::Result::Err(A::Error::duplicate_field(
17251                                    "multiple values for etag",
17252                                ));
17253                            }
17254                            result.etag = map
17255                                .next_value::<std::option::Option<std::string::String>>()?
17256                                .unwrap_or_default();
17257                        }
17258                        __FieldTag::Unknown(key) => {
17259                            let value = map.next_value::<serde_json::Value>()?;
17260                            result._unknown_fields.insert(key, value);
17261                        }
17262                    }
17263                }
17264                std::result::Result::Ok(result)
17265            }
17266        }
17267        deserializer.deserialize_any(Visitor)
17268    }
17269}
17270
17271#[doc(hidden)]
17272impl serde::ser::Serialize for DeleteVmwareEngineNetworkRequest {
17273    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17274    where
17275        S: serde::ser::Serializer,
17276    {
17277        use serde::ser::SerializeMap;
17278        #[allow(unused_imports)]
17279        use std::option::Option::Some;
17280        let mut state = serializer.serialize_map(std::option::Option::None)?;
17281        if !self.name.is_empty() {
17282            state.serialize_entry("name", &self.name)?;
17283        }
17284        if !self.request_id.is_empty() {
17285            state.serialize_entry("requestId", &self.request_id)?;
17286        }
17287        if !self.etag.is_empty() {
17288            state.serialize_entry("etag", &self.etag)?;
17289        }
17290        if !self._unknown_fields.is_empty() {
17291            for (key, value) in self._unknown_fields.iter() {
17292                state.serialize_entry(key, &value)?;
17293            }
17294        }
17295        state.end()
17296    }
17297}
17298
17299impl std::fmt::Debug for DeleteVmwareEngineNetworkRequest {
17300    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17301        let mut debug_struct = f.debug_struct("DeleteVmwareEngineNetworkRequest");
17302        debug_struct.field("name", &self.name);
17303        debug_struct.field("request_id", &self.request_id);
17304        debug_struct.field("etag", &self.etag);
17305        if !self._unknown_fields.is_empty() {
17306            debug_struct.field("_unknown_fields", &self._unknown_fields);
17307        }
17308        debug_struct.finish()
17309    }
17310}
17311
17312/// Request message for
17313/// [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]
17314///
17315/// [google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork]: crate::client::VmwareEngine::get_vmware_engine_network
17316#[derive(Clone, Default, PartialEq)]
17317#[non_exhaustive]
17318pub struct GetVmwareEngineNetworkRequest {
17319    /// Required. The resource name of the VMware Engine network to retrieve.
17320    /// Resource names are schemeless URIs that follow the conventions in
17321    /// <https://cloud.google.com/apis/design/resource_names>.
17322    /// For example:
17323    /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
17324    pub name: std::string::String,
17325
17326    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17327}
17328
17329impl GetVmwareEngineNetworkRequest {
17330    pub fn new() -> Self {
17331        std::default::Default::default()
17332    }
17333
17334    /// Sets the value of [name][crate::model::GetVmwareEngineNetworkRequest::name].
17335    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17336        self.name = v.into();
17337        self
17338    }
17339}
17340
17341impl wkt::message::Message for GetVmwareEngineNetworkRequest {
17342    fn typename() -> &'static str {
17343        "type.googleapis.com/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"
17344    }
17345}
17346
17347#[doc(hidden)]
17348impl<'de> serde::de::Deserialize<'de> for GetVmwareEngineNetworkRequest {
17349    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17350    where
17351        D: serde::Deserializer<'de>,
17352    {
17353        #[allow(non_camel_case_types)]
17354        #[doc(hidden)]
17355        #[derive(PartialEq, Eq, Hash)]
17356        enum __FieldTag {
17357            __name,
17358            Unknown(std::string::String),
17359        }
17360        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17361            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17362            where
17363                D: serde::Deserializer<'de>,
17364            {
17365                struct Visitor;
17366                impl<'de> serde::de::Visitor<'de> for Visitor {
17367                    type Value = __FieldTag;
17368                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17369                        formatter.write_str("a field name for GetVmwareEngineNetworkRequest")
17370                    }
17371                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17372                    where
17373                        E: serde::de::Error,
17374                    {
17375                        use std::result::Result::Ok;
17376                        use std::string::ToString;
17377                        match value {
17378                            "name" => Ok(__FieldTag::__name),
17379                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17380                        }
17381                    }
17382                }
17383                deserializer.deserialize_identifier(Visitor)
17384            }
17385        }
17386        struct Visitor;
17387        impl<'de> serde::de::Visitor<'de> for Visitor {
17388            type Value = GetVmwareEngineNetworkRequest;
17389            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17390                formatter.write_str("struct GetVmwareEngineNetworkRequest")
17391            }
17392            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17393            where
17394                A: serde::de::MapAccess<'de>,
17395            {
17396                #[allow(unused_imports)]
17397                use serde::de::Error;
17398                use std::option::Option::Some;
17399                let mut fields = std::collections::HashSet::new();
17400                let mut result = Self::Value::new();
17401                while let Some(tag) = map.next_key::<__FieldTag>()? {
17402                    #[allow(clippy::match_single_binding)]
17403                    match tag {
17404                        __FieldTag::__name => {
17405                            if !fields.insert(__FieldTag::__name) {
17406                                return std::result::Result::Err(A::Error::duplicate_field(
17407                                    "multiple values for name",
17408                                ));
17409                            }
17410                            result.name = map
17411                                .next_value::<std::option::Option<std::string::String>>()?
17412                                .unwrap_or_default();
17413                        }
17414                        __FieldTag::Unknown(key) => {
17415                            let value = map.next_value::<serde_json::Value>()?;
17416                            result._unknown_fields.insert(key, value);
17417                        }
17418                    }
17419                }
17420                std::result::Result::Ok(result)
17421            }
17422        }
17423        deserializer.deserialize_any(Visitor)
17424    }
17425}
17426
17427#[doc(hidden)]
17428impl serde::ser::Serialize for GetVmwareEngineNetworkRequest {
17429    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17430    where
17431        S: serde::ser::Serializer,
17432    {
17433        use serde::ser::SerializeMap;
17434        #[allow(unused_imports)]
17435        use std::option::Option::Some;
17436        let mut state = serializer.serialize_map(std::option::Option::None)?;
17437        if !self.name.is_empty() {
17438            state.serialize_entry("name", &self.name)?;
17439        }
17440        if !self._unknown_fields.is_empty() {
17441            for (key, value) in self._unknown_fields.iter() {
17442                state.serialize_entry(key, &value)?;
17443            }
17444        }
17445        state.end()
17446    }
17447}
17448
17449impl std::fmt::Debug for GetVmwareEngineNetworkRequest {
17450    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17451        let mut debug_struct = f.debug_struct("GetVmwareEngineNetworkRequest");
17452        debug_struct.field("name", &self.name);
17453        if !self._unknown_fields.is_empty() {
17454            debug_struct.field("_unknown_fields", &self._unknown_fields);
17455        }
17456        debug_struct.finish()
17457    }
17458}
17459
17460/// Request message for
17461/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
17462///
17463/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
17464#[derive(Clone, Default, PartialEq)]
17465#[non_exhaustive]
17466pub struct ListVmwareEngineNetworksRequest {
17467    /// Required. The resource name of the location to query for
17468    /// VMware Engine networks. Resource names are schemeless URIs that follow the
17469    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
17470    /// example: `projects/my-project/locations/global`
17471    pub parent: std::string::String,
17472
17473    /// The maximum number of results to return in one page.
17474    /// The maximum value is coerced to 1000.
17475    /// The default value of this field is 500.
17476    pub page_size: i32,
17477
17478    /// A page token, received from a previous `ListVmwareEngineNetworks` call.
17479    /// Provide this to retrieve the subsequent page.
17480    ///
17481    /// When paginating, all other parameters provided to
17482    /// `ListVmwareEngineNetworks` must match the call that provided the page
17483    /// token.
17484    pub page_token: std::string::String,
17485
17486    /// A filter expression that matches resources returned in the response.
17487    /// The expression must specify the field name, a comparison
17488    /// operator, and the value that you want to use for filtering. The value
17489    /// must be a string, a number, or a boolean. The comparison operator
17490    /// must be `=`, `!=`, `>`, or `<`.
17491    ///
17492    /// For example, if you are filtering a list of network peerings, you can
17493    /// exclude the ones named `example-network` by specifying
17494    /// `name != "example-network"`.
17495    ///
17496    /// To filter on multiple expressions, provide each separate expression within
17497    /// parentheses. For example:
17498    ///
17499    /// ```norust
17500    /// (name = "example-network")
17501    /// (createTime > "2021-04-12T08:15:10.40Z")
17502    /// ```
17503    ///
17504    /// By default, each expression is an `AND` expression. However, you
17505    /// can include `AND` and `OR` expressions explicitly.
17506    /// For example:
17507    ///
17508    /// ```norust
17509    /// (name = "example-network-1") AND
17510    /// (createTime > "2021-04-12T08:15:10.40Z") OR
17511    /// (name = "example-network-2")
17512    /// ```
17513    pub filter: std::string::String,
17514
17515    /// Sorts list results by a certain order. By default, returned results
17516    /// are ordered by `name` in ascending order.
17517    /// You can also sort results in descending order based on the `name` value
17518    /// using `orderBy="name desc"`.
17519    /// Currently, only ordering by `name` is supported.
17520    pub order_by: std::string::String,
17521
17522    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17523}
17524
17525impl ListVmwareEngineNetworksRequest {
17526    pub fn new() -> Self {
17527        std::default::Default::default()
17528    }
17529
17530    /// Sets the value of [parent][crate::model::ListVmwareEngineNetworksRequest::parent].
17531    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17532        self.parent = v.into();
17533        self
17534    }
17535
17536    /// Sets the value of [page_size][crate::model::ListVmwareEngineNetworksRequest::page_size].
17537    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17538        self.page_size = v.into();
17539        self
17540    }
17541
17542    /// Sets the value of [page_token][crate::model::ListVmwareEngineNetworksRequest::page_token].
17543    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17544        self.page_token = v.into();
17545        self
17546    }
17547
17548    /// Sets the value of [filter][crate::model::ListVmwareEngineNetworksRequest::filter].
17549    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17550        self.filter = v.into();
17551        self
17552    }
17553
17554    /// Sets the value of [order_by][crate::model::ListVmwareEngineNetworksRequest::order_by].
17555    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17556        self.order_by = v.into();
17557        self
17558    }
17559}
17560
17561impl wkt::message::Message for ListVmwareEngineNetworksRequest {
17562    fn typename() -> &'static str {
17563        "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"
17564    }
17565}
17566
17567#[doc(hidden)]
17568impl<'de> serde::de::Deserialize<'de> for ListVmwareEngineNetworksRequest {
17569    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17570    where
17571        D: serde::Deserializer<'de>,
17572    {
17573        #[allow(non_camel_case_types)]
17574        #[doc(hidden)]
17575        #[derive(PartialEq, Eq, Hash)]
17576        enum __FieldTag {
17577            __parent,
17578            __page_size,
17579            __page_token,
17580            __filter,
17581            __order_by,
17582            Unknown(std::string::String),
17583        }
17584        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17585            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17586            where
17587                D: serde::Deserializer<'de>,
17588            {
17589                struct Visitor;
17590                impl<'de> serde::de::Visitor<'de> for Visitor {
17591                    type Value = __FieldTag;
17592                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17593                        formatter.write_str("a field name for ListVmwareEngineNetworksRequest")
17594                    }
17595                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17596                    where
17597                        E: serde::de::Error,
17598                    {
17599                        use std::result::Result::Ok;
17600                        use std::string::ToString;
17601                        match value {
17602                            "parent" => Ok(__FieldTag::__parent),
17603                            "pageSize" => Ok(__FieldTag::__page_size),
17604                            "page_size" => Ok(__FieldTag::__page_size),
17605                            "pageToken" => Ok(__FieldTag::__page_token),
17606                            "page_token" => Ok(__FieldTag::__page_token),
17607                            "filter" => Ok(__FieldTag::__filter),
17608                            "orderBy" => Ok(__FieldTag::__order_by),
17609                            "order_by" => Ok(__FieldTag::__order_by),
17610                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17611                        }
17612                    }
17613                }
17614                deserializer.deserialize_identifier(Visitor)
17615            }
17616        }
17617        struct Visitor;
17618        impl<'de> serde::de::Visitor<'de> for Visitor {
17619            type Value = ListVmwareEngineNetworksRequest;
17620            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17621                formatter.write_str("struct ListVmwareEngineNetworksRequest")
17622            }
17623            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17624            where
17625                A: serde::de::MapAccess<'de>,
17626            {
17627                #[allow(unused_imports)]
17628                use serde::de::Error;
17629                use std::option::Option::Some;
17630                let mut fields = std::collections::HashSet::new();
17631                let mut result = Self::Value::new();
17632                while let Some(tag) = map.next_key::<__FieldTag>()? {
17633                    #[allow(clippy::match_single_binding)]
17634                    match tag {
17635                        __FieldTag::__parent => {
17636                            if !fields.insert(__FieldTag::__parent) {
17637                                return std::result::Result::Err(A::Error::duplicate_field(
17638                                    "multiple values for parent",
17639                                ));
17640                            }
17641                            result.parent = map
17642                                .next_value::<std::option::Option<std::string::String>>()?
17643                                .unwrap_or_default();
17644                        }
17645                        __FieldTag::__page_size => {
17646                            if !fields.insert(__FieldTag::__page_size) {
17647                                return std::result::Result::Err(A::Error::duplicate_field(
17648                                    "multiple values for page_size",
17649                                ));
17650                            }
17651                            struct __With(std::option::Option<i32>);
17652                            impl<'de> serde::de::Deserialize<'de> for __With {
17653                                fn deserialize<D>(
17654                                    deserializer: D,
17655                                ) -> std::result::Result<Self, D::Error>
17656                                where
17657                                    D: serde::de::Deserializer<'de>,
17658                                {
17659                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17660                                }
17661                            }
17662                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
17663                        }
17664                        __FieldTag::__page_token => {
17665                            if !fields.insert(__FieldTag::__page_token) {
17666                                return std::result::Result::Err(A::Error::duplicate_field(
17667                                    "multiple values for page_token",
17668                                ));
17669                            }
17670                            result.page_token = map
17671                                .next_value::<std::option::Option<std::string::String>>()?
17672                                .unwrap_or_default();
17673                        }
17674                        __FieldTag::__filter => {
17675                            if !fields.insert(__FieldTag::__filter) {
17676                                return std::result::Result::Err(A::Error::duplicate_field(
17677                                    "multiple values for filter",
17678                                ));
17679                            }
17680                            result.filter = map
17681                                .next_value::<std::option::Option<std::string::String>>()?
17682                                .unwrap_or_default();
17683                        }
17684                        __FieldTag::__order_by => {
17685                            if !fields.insert(__FieldTag::__order_by) {
17686                                return std::result::Result::Err(A::Error::duplicate_field(
17687                                    "multiple values for order_by",
17688                                ));
17689                            }
17690                            result.order_by = map
17691                                .next_value::<std::option::Option<std::string::String>>()?
17692                                .unwrap_or_default();
17693                        }
17694                        __FieldTag::Unknown(key) => {
17695                            let value = map.next_value::<serde_json::Value>()?;
17696                            result._unknown_fields.insert(key, value);
17697                        }
17698                    }
17699                }
17700                std::result::Result::Ok(result)
17701            }
17702        }
17703        deserializer.deserialize_any(Visitor)
17704    }
17705}
17706
17707#[doc(hidden)]
17708impl serde::ser::Serialize for ListVmwareEngineNetworksRequest {
17709    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17710    where
17711        S: serde::ser::Serializer,
17712    {
17713        use serde::ser::SerializeMap;
17714        #[allow(unused_imports)]
17715        use std::option::Option::Some;
17716        let mut state = serializer.serialize_map(std::option::Option::None)?;
17717        if !self.parent.is_empty() {
17718            state.serialize_entry("parent", &self.parent)?;
17719        }
17720        if !wkt::internal::is_default(&self.page_size) {
17721            struct __With<'a>(&'a i32);
17722            impl<'a> serde::ser::Serialize for __With<'a> {
17723                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17724                where
17725                    S: serde::ser::Serializer,
17726                {
17727                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17728                }
17729            }
17730            state.serialize_entry("pageSize", &__With(&self.page_size))?;
17731        }
17732        if !self.page_token.is_empty() {
17733            state.serialize_entry("pageToken", &self.page_token)?;
17734        }
17735        if !self.filter.is_empty() {
17736            state.serialize_entry("filter", &self.filter)?;
17737        }
17738        if !self.order_by.is_empty() {
17739            state.serialize_entry("orderBy", &self.order_by)?;
17740        }
17741        if !self._unknown_fields.is_empty() {
17742            for (key, value) in self._unknown_fields.iter() {
17743                state.serialize_entry(key, &value)?;
17744            }
17745        }
17746        state.end()
17747    }
17748}
17749
17750impl std::fmt::Debug for ListVmwareEngineNetworksRequest {
17751    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17752        let mut debug_struct = f.debug_struct("ListVmwareEngineNetworksRequest");
17753        debug_struct.field("parent", &self.parent);
17754        debug_struct.field("page_size", &self.page_size);
17755        debug_struct.field("page_token", &self.page_token);
17756        debug_struct.field("filter", &self.filter);
17757        debug_struct.field("order_by", &self.order_by);
17758        if !self._unknown_fields.is_empty() {
17759            debug_struct.field("_unknown_fields", &self._unknown_fields);
17760        }
17761        debug_struct.finish()
17762    }
17763}
17764
17765/// Response message for
17766/// [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]
17767///
17768/// [google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks]: crate::client::VmwareEngine::list_vmware_engine_networks
17769#[derive(Clone, Default, PartialEq)]
17770#[non_exhaustive]
17771pub struct ListVmwareEngineNetworksResponse {
17772    /// A list of VMware Engine networks.
17773    pub vmware_engine_networks: std::vec::Vec<crate::model::VmwareEngineNetwork>,
17774
17775    /// A token, which can be sent as `page_token` to retrieve the next page.
17776    /// If this field is omitted, there are no subsequent pages.
17777    pub next_page_token: std::string::String,
17778
17779    /// Unreachable resources.
17780    pub unreachable: std::vec::Vec<std::string::String>,
17781
17782    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17783}
17784
17785impl ListVmwareEngineNetworksResponse {
17786    pub fn new() -> Self {
17787        std::default::Default::default()
17788    }
17789
17790    /// Sets the value of [vmware_engine_networks][crate::model::ListVmwareEngineNetworksResponse::vmware_engine_networks].
17791    pub fn set_vmware_engine_networks<T, V>(mut self, v: T) -> Self
17792    where
17793        T: std::iter::IntoIterator<Item = V>,
17794        V: std::convert::Into<crate::model::VmwareEngineNetwork>,
17795    {
17796        use std::iter::Iterator;
17797        self.vmware_engine_networks = v.into_iter().map(|i| i.into()).collect();
17798        self
17799    }
17800
17801    /// Sets the value of [next_page_token][crate::model::ListVmwareEngineNetworksResponse::next_page_token].
17802    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17803        self.next_page_token = v.into();
17804        self
17805    }
17806
17807    /// Sets the value of [unreachable][crate::model::ListVmwareEngineNetworksResponse::unreachable].
17808    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17809    where
17810        T: std::iter::IntoIterator<Item = V>,
17811        V: std::convert::Into<std::string::String>,
17812    {
17813        use std::iter::Iterator;
17814        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17815        self
17816    }
17817}
17818
17819impl wkt::message::Message for ListVmwareEngineNetworksResponse {
17820    fn typename() -> &'static str {
17821        "type.googleapis.com/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"
17822    }
17823}
17824
17825#[doc(hidden)]
17826impl gax::paginator::internal::PageableResponse for ListVmwareEngineNetworksResponse {
17827    type PageItem = crate::model::VmwareEngineNetwork;
17828
17829    fn items(self) -> std::vec::Vec<Self::PageItem> {
17830        self.vmware_engine_networks
17831    }
17832
17833    fn next_page_token(&self) -> std::string::String {
17834        use std::clone::Clone;
17835        self.next_page_token.clone()
17836    }
17837}
17838
17839#[doc(hidden)]
17840impl<'de> serde::de::Deserialize<'de> for ListVmwareEngineNetworksResponse {
17841    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17842    where
17843        D: serde::Deserializer<'de>,
17844    {
17845        #[allow(non_camel_case_types)]
17846        #[doc(hidden)]
17847        #[derive(PartialEq, Eq, Hash)]
17848        enum __FieldTag {
17849            __vmware_engine_networks,
17850            __next_page_token,
17851            __unreachable,
17852            Unknown(std::string::String),
17853        }
17854        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17855            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17856            where
17857                D: serde::Deserializer<'de>,
17858            {
17859                struct Visitor;
17860                impl<'de> serde::de::Visitor<'de> for Visitor {
17861                    type Value = __FieldTag;
17862                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17863                        formatter.write_str("a field name for ListVmwareEngineNetworksResponse")
17864                    }
17865                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17866                    where
17867                        E: serde::de::Error,
17868                    {
17869                        use std::result::Result::Ok;
17870                        use std::string::ToString;
17871                        match value {
17872                            "vmwareEngineNetworks" => Ok(__FieldTag::__vmware_engine_networks),
17873                            "vmware_engine_networks" => Ok(__FieldTag::__vmware_engine_networks),
17874                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
17875                            "next_page_token" => Ok(__FieldTag::__next_page_token),
17876                            "unreachable" => Ok(__FieldTag::__unreachable),
17877                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17878                        }
17879                    }
17880                }
17881                deserializer.deserialize_identifier(Visitor)
17882            }
17883        }
17884        struct Visitor;
17885        impl<'de> serde::de::Visitor<'de> for Visitor {
17886            type Value = ListVmwareEngineNetworksResponse;
17887            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17888                formatter.write_str("struct ListVmwareEngineNetworksResponse")
17889            }
17890            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17891            where
17892                A: serde::de::MapAccess<'de>,
17893            {
17894                #[allow(unused_imports)]
17895                use serde::de::Error;
17896                use std::option::Option::Some;
17897                let mut fields = std::collections::HashSet::new();
17898                let mut result = Self::Value::new();
17899                while let Some(tag) = map.next_key::<__FieldTag>()? {
17900                    #[allow(clippy::match_single_binding)]
17901                    match tag {
17902                        __FieldTag::__vmware_engine_networks => {
17903                            if !fields.insert(__FieldTag::__vmware_engine_networks) {
17904                                return std::result::Result::Err(A::Error::duplicate_field(
17905                                    "multiple values for vmware_engine_networks",
17906                                ));
17907                            }
17908                            result.vmware_engine_networks = map
17909                                .next_value::<std::option::Option<
17910                                    std::vec::Vec<crate::model::VmwareEngineNetwork>,
17911                                >>()?
17912                                .unwrap_or_default();
17913                        }
17914                        __FieldTag::__next_page_token => {
17915                            if !fields.insert(__FieldTag::__next_page_token) {
17916                                return std::result::Result::Err(A::Error::duplicate_field(
17917                                    "multiple values for next_page_token",
17918                                ));
17919                            }
17920                            result.next_page_token = map
17921                                .next_value::<std::option::Option<std::string::String>>()?
17922                                .unwrap_or_default();
17923                        }
17924                        __FieldTag::__unreachable => {
17925                            if !fields.insert(__FieldTag::__unreachable) {
17926                                return std::result::Result::Err(A::Error::duplicate_field(
17927                                    "multiple values for unreachable",
17928                                ));
17929                            }
17930                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
17931                        }
17932                        __FieldTag::Unknown(key) => {
17933                            let value = map.next_value::<serde_json::Value>()?;
17934                            result._unknown_fields.insert(key, value);
17935                        }
17936                    }
17937                }
17938                std::result::Result::Ok(result)
17939            }
17940        }
17941        deserializer.deserialize_any(Visitor)
17942    }
17943}
17944
17945#[doc(hidden)]
17946impl serde::ser::Serialize for ListVmwareEngineNetworksResponse {
17947    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17948    where
17949        S: serde::ser::Serializer,
17950    {
17951        use serde::ser::SerializeMap;
17952        #[allow(unused_imports)]
17953        use std::option::Option::Some;
17954        let mut state = serializer.serialize_map(std::option::Option::None)?;
17955        if !self.vmware_engine_networks.is_empty() {
17956            state.serialize_entry("vmwareEngineNetworks", &self.vmware_engine_networks)?;
17957        }
17958        if !self.next_page_token.is_empty() {
17959            state.serialize_entry("nextPageToken", &self.next_page_token)?;
17960        }
17961        if !self.unreachable.is_empty() {
17962            state.serialize_entry("unreachable", &self.unreachable)?;
17963        }
17964        if !self._unknown_fields.is_empty() {
17965            for (key, value) in self._unknown_fields.iter() {
17966                state.serialize_entry(key, &value)?;
17967            }
17968        }
17969        state.end()
17970    }
17971}
17972
17973impl std::fmt::Debug for ListVmwareEngineNetworksResponse {
17974    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17975        let mut debug_struct = f.debug_struct("ListVmwareEngineNetworksResponse");
17976        debug_struct.field("vmware_engine_networks", &self.vmware_engine_networks);
17977        debug_struct.field("next_page_token", &self.next_page_token);
17978        debug_struct.field("unreachable", &self.unreachable);
17979        if !self._unknown_fields.is_empty() {
17980            debug_struct.field("_unknown_fields", &self._unknown_fields);
17981        }
17982        debug_struct.finish()
17983    }
17984}
17985
17986/// Request message for
17987/// [VmwareEngine.CreatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]
17988///
17989/// [google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection]: crate::client::VmwareEngine::create_private_connection
17990#[derive(Clone, Default, PartialEq)]
17991#[non_exhaustive]
17992pub struct CreatePrivateConnectionRequest {
17993    /// Required. The resource name of the location to create the new private
17994    /// connection in. Private connection is a regional resource.
17995    /// Resource names are schemeless URIs that follow the conventions in
17996    /// <https://cloud.google.com/apis/design/resource_names>. For example:
17997    /// `projects/my-project/locations/us-central1`
17998    pub parent: std::string::String,
17999
18000    /// Required. The user-provided identifier of the new private connection.
18001    /// This identifier must be unique among private connection resources
18002    /// within the parent and becomes the final token in the name URI. The
18003    /// identifier must meet the following requirements:
18004    ///
18005    /// * Only contains 1-63 alphanumeric characters and hyphens
18006    /// * Begins with an alphabetical character
18007    /// * Ends with a non-hyphen character
18008    /// * Not formatted as a UUID
18009    /// * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)
18010    ///   (section 3.5)
18011    pub private_connection_id: std::string::String,
18012
18013    /// Required. The initial description of the new private connection.
18014    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
18015
18016    /// Optional. A request ID to identify requests. Specify a unique request ID
18017    /// so that if you must retry your request, the server will know to ignore
18018    /// the request if it has already been completed. The server guarantees that a
18019    /// request doesn't result in creation of duplicate commitments for at least 60
18020    /// minutes.
18021    ///
18022    /// For example, consider a situation where you make an initial request and the
18023    /// request times out. If you make the request again with the same request
18024    /// ID, the server can check if original operation with the same request ID
18025    /// was received, and if so, will ignore the second request. This prevents
18026    /// clients from accidentally creating duplicate commitments.
18027    ///
18028    /// The request ID must be a valid UUID with the exception that zero UUID is
18029    /// not supported (00000000-0000-0000-0000-000000000000).
18030    pub request_id: std::string::String,
18031
18032    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18033}
18034
18035impl CreatePrivateConnectionRequest {
18036    pub fn new() -> Self {
18037        std::default::Default::default()
18038    }
18039
18040    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
18041    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18042        self.parent = v.into();
18043        self
18044    }
18045
18046    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
18047    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
18048        mut self,
18049        v: T,
18050    ) -> Self {
18051        self.private_connection_id = v.into();
18052        self
18053    }
18054
18055    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
18056    pub fn set_private_connection<T>(mut self, v: T) -> Self
18057    where
18058        T: std::convert::Into<crate::model::PrivateConnection>,
18059    {
18060        self.private_connection = std::option::Option::Some(v.into());
18061        self
18062    }
18063
18064    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
18065    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
18066    where
18067        T: std::convert::Into<crate::model::PrivateConnection>,
18068    {
18069        self.private_connection = v.map(|x| x.into());
18070        self
18071    }
18072
18073    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
18074    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18075        self.request_id = v.into();
18076        self
18077    }
18078}
18079
18080impl wkt::message::Message for CreatePrivateConnectionRequest {
18081    fn typename() -> &'static str {
18082        "type.googleapis.com/google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest"
18083    }
18084}
18085
18086#[doc(hidden)]
18087impl<'de> serde::de::Deserialize<'de> for CreatePrivateConnectionRequest {
18088    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18089    where
18090        D: serde::Deserializer<'de>,
18091    {
18092        #[allow(non_camel_case_types)]
18093        #[doc(hidden)]
18094        #[derive(PartialEq, Eq, Hash)]
18095        enum __FieldTag {
18096            __parent,
18097            __private_connection_id,
18098            __private_connection,
18099            __request_id,
18100            Unknown(std::string::String),
18101        }
18102        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18103            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18104            where
18105                D: serde::Deserializer<'de>,
18106            {
18107                struct Visitor;
18108                impl<'de> serde::de::Visitor<'de> for Visitor {
18109                    type Value = __FieldTag;
18110                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18111                        formatter.write_str("a field name for CreatePrivateConnectionRequest")
18112                    }
18113                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18114                    where
18115                        E: serde::de::Error,
18116                    {
18117                        use std::result::Result::Ok;
18118                        use std::string::ToString;
18119                        match value {
18120                            "parent" => Ok(__FieldTag::__parent),
18121                            "privateConnectionId" => Ok(__FieldTag::__private_connection_id),
18122                            "private_connection_id" => Ok(__FieldTag::__private_connection_id),
18123                            "privateConnection" => Ok(__FieldTag::__private_connection),
18124                            "private_connection" => Ok(__FieldTag::__private_connection),
18125                            "requestId" => Ok(__FieldTag::__request_id),
18126                            "request_id" => Ok(__FieldTag::__request_id),
18127                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18128                        }
18129                    }
18130                }
18131                deserializer.deserialize_identifier(Visitor)
18132            }
18133        }
18134        struct Visitor;
18135        impl<'de> serde::de::Visitor<'de> for Visitor {
18136            type Value = CreatePrivateConnectionRequest;
18137            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18138                formatter.write_str("struct CreatePrivateConnectionRequest")
18139            }
18140            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18141            where
18142                A: serde::de::MapAccess<'de>,
18143            {
18144                #[allow(unused_imports)]
18145                use serde::de::Error;
18146                use std::option::Option::Some;
18147                let mut fields = std::collections::HashSet::new();
18148                let mut result = Self::Value::new();
18149                while let Some(tag) = map.next_key::<__FieldTag>()? {
18150                    #[allow(clippy::match_single_binding)]
18151                    match tag {
18152                        __FieldTag::__parent => {
18153                            if !fields.insert(__FieldTag::__parent) {
18154                                return std::result::Result::Err(A::Error::duplicate_field(
18155                                    "multiple values for parent",
18156                                ));
18157                            }
18158                            result.parent = map
18159                                .next_value::<std::option::Option<std::string::String>>()?
18160                                .unwrap_or_default();
18161                        }
18162                        __FieldTag::__private_connection_id => {
18163                            if !fields.insert(__FieldTag::__private_connection_id) {
18164                                return std::result::Result::Err(A::Error::duplicate_field(
18165                                    "multiple values for private_connection_id",
18166                                ));
18167                            }
18168                            result.private_connection_id = map
18169                                .next_value::<std::option::Option<std::string::String>>()?
18170                                .unwrap_or_default();
18171                        }
18172                        __FieldTag::__private_connection => {
18173                            if !fields.insert(__FieldTag::__private_connection) {
18174                                return std::result::Result::Err(A::Error::duplicate_field(
18175                                    "multiple values for private_connection",
18176                                ));
18177                            }
18178                            result.private_connection = map
18179                                .next_value::<std::option::Option<crate::model::PrivateConnection>>(
18180                                )?;
18181                        }
18182                        __FieldTag::__request_id => {
18183                            if !fields.insert(__FieldTag::__request_id) {
18184                                return std::result::Result::Err(A::Error::duplicate_field(
18185                                    "multiple values for request_id",
18186                                ));
18187                            }
18188                            result.request_id = map
18189                                .next_value::<std::option::Option<std::string::String>>()?
18190                                .unwrap_or_default();
18191                        }
18192                        __FieldTag::Unknown(key) => {
18193                            let value = map.next_value::<serde_json::Value>()?;
18194                            result._unknown_fields.insert(key, value);
18195                        }
18196                    }
18197                }
18198                std::result::Result::Ok(result)
18199            }
18200        }
18201        deserializer.deserialize_any(Visitor)
18202    }
18203}
18204
18205#[doc(hidden)]
18206impl serde::ser::Serialize for CreatePrivateConnectionRequest {
18207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18208    where
18209        S: serde::ser::Serializer,
18210    {
18211        use serde::ser::SerializeMap;
18212        #[allow(unused_imports)]
18213        use std::option::Option::Some;
18214        let mut state = serializer.serialize_map(std::option::Option::None)?;
18215        if !self.parent.is_empty() {
18216            state.serialize_entry("parent", &self.parent)?;
18217        }
18218        if !self.private_connection_id.is_empty() {
18219            state.serialize_entry("privateConnectionId", &self.private_connection_id)?;
18220        }
18221        if self.private_connection.is_some() {
18222            state.serialize_entry("privateConnection", &self.private_connection)?;
18223        }
18224        if !self.request_id.is_empty() {
18225            state.serialize_entry("requestId", &self.request_id)?;
18226        }
18227        if !self._unknown_fields.is_empty() {
18228            for (key, value) in self._unknown_fields.iter() {
18229                state.serialize_entry(key, &value)?;
18230            }
18231        }
18232        state.end()
18233    }
18234}
18235
18236impl std::fmt::Debug for CreatePrivateConnectionRequest {
18237    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18238        let mut debug_struct = f.debug_struct("CreatePrivateConnectionRequest");
18239        debug_struct.field("parent", &self.parent);
18240        debug_struct.field("private_connection_id", &self.private_connection_id);
18241        debug_struct.field("private_connection", &self.private_connection);
18242        debug_struct.field("request_id", &self.request_id);
18243        if !self._unknown_fields.is_empty() {
18244            debug_struct.field("_unknown_fields", &self._unknown_fields);
18245        }
18246        debug_struct.finish()
18247    }
18248}
18249
18250/// Request message for
18251/// [VmwareEngine.GetPrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]
18252///
18253/// [google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection]: crate::client::VmwareEngine::get_private_connection
18254#[derive(Clone, Default, PartialEq)]
18255#[non_exhaustive]
18256pub struct GetPrivateConnectionRequest {
18257    /// Required. The resource name of the private connection to retrieve.
18258    /// Resource names are schemeless URIs that follow the conventions in
18259    /// <https://cloud.google.com/apis/design/resource_names>.
18260    /// For example:
18261    /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
18262    pub name: std::string::String,
18263
18264    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18265}
18266
18267impl GetPrivateConnectionRequest {
18268    pub fn new() -> Self {
18269        std::default::Default::default()
18270    }
18271
18272    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
18273    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18274        self.name = v.into();
18275        self
18276    }
18277}
18278
18279impl wkt::message::Message for GetPrivateConnectionRequest {
18280    fn typename() -> &'static str {
18281        "type.googleapis.com/google.cloud.vmwareengine.v1.GetPrivateConnectionRequest"
18282    }
18283}
18284
18285#[doc(hidden)]
18286impl<'de> serde::de::Deserialize<'de> for GetPrivateConnectionRequest {
18287    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18288    where
18289        D: serde::Deserializer<'de>,
18290    {
18291        #[allow(non_camel_case_types)]
18292        #[doc(hidden)]
18293        #[derive(PartialEq, Eq, Hash)]
18294        enum __FieldTag {
18295            __name,
18296            Unknown(std::string::String),
18297        }
18298        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18299            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18300            where
18301                D: serde::Deserializer<'de>,
18302            {
18303                struct Visitor;
18304                impl<'de> serde::de::Visitor<'de> for Visitor {
18305                    type Value = __FieldTag;
18306                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18307                        formatter.write_str("a field name for GetPrivateConnectionRequest")
18308                    }
18309                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18310                    where
18311                        E: serde::de::Error,
18312                    {
18313                        use std::result::Result::Ok;
18314                        use std::string::ToString;
18315                        match value {
18316                            "name" => Ok(__FieldTag::__name),
18317                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18318                        }
18319                    }
18320                }
18321                deserializer.deserialize_identifier(Visitor)
18322            }
18323        }
18324        struct Visitor;
18325        impl<'de> serde::de::Visitor<'de> for Visitor {
18326            type Value = GetPrivateConnectionRequest;
18327            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18328                formatter.write_str("struct GetPrivateConnectionRequest")
18329            }
18330            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18331            where
18332                A: serde::de::MapAccess<'de>,
18333            {
18334                #[allow(unused_imports)]
18335                use serde::de::Error;
18336                use std::option::Option::Some;
18337                let mut fields = std::collections::HashSet::new();
18338                let mut result = Self::Value::new();
18339                while let Some(tag) = map.next_key::<__FieldTag>()? {
18340                    #[allow(clippy::match_single_binding)]
18341                    match tag {
18342                        __FieldTag::__name => {
18343                            if !fields.insert(__FieldTag::__name) {
18344                                return std::result::Result::Err(A::Error::duplicate_field(
18345                                    "multiple values for name",
18346                                ));
18347                            }
18348                            result.name = map
18349                                .next_value::<std::option::Option<std::string::String>>()?
18350                                .unwrap_or_default();
18351                        }
18352                        __FieldTag::Unknown(key) => {
18353                            let value = map.next_value::<serde_json::Value>()?;
18354                            result._unknown_fields.insert(key, value);
18355                        }
18356                    }
18357                }
18358                std::result::Result::Ok(result)
18359            }
18360        }
18361        deserializer.deserialize_any(Visitor)
18362    }
18363}
18364
18365#[doc(hidden)]
18366impl serde::ser::Serialize for GetPrivateConnectionRequest {
18367    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18368    where
18369        S: serde::ser::Serializer,
18370    {
18371        use serde::ser::SerializeMap;
18372        #[allow(unused_imports)]
18373        use std::option::Option::Some;
18374        let mut state = serializer.serialize_map(std::option::Option::None)?;
18375        if !self.name.is_empty() {
18376            state.serialize_entry("name", &self.name)?;
18377        }
18378        if !self._unknown_fields.is_empty() {
18379            for (key, value) in self._unknown_fields.iter() {
18380                state.serialize_entry(key, &value)?;
18381            }
18382        }
18383        state.end()
18384    }
18385}
18386
18387impl std::fmt::Debug for GetPrivateConnectionRequest {
18388    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18389        let mut debug_struct = f.debug_struct("GetPrivateConnectionRequest");
18390        debug_struct.field("name", &self.name);
18391        if !self._unknown_fields.is_empty() {
18392            debug_struct.field("_unknown_fields", &self._unknown_fields);
18393        }
18394        debug_struct.finish()
18395    }
18396}
18397
18398/// Request message for
18399/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
18400///
18401/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
18402#[derive(Clone, Default, PartialEq)]
18403#[non_exhaustive]
18404pub struct ListPrivateConnectionsRequest {
18405    /// Required. The resource name of the location to query for
18406    /// private connections. Resource names are schemeless URIs that follow the
18407    /// conventions in <https://cloud.google.com/apis/design/resource_names>. For
18408    /// example: `projects/my-project/locations/us-central1`
18409    pub parent: std::string::String,
18410
18411    /// The maximum number of private connections to return in one page.
18412    /// The maximum value is coerced to 1000.
18413    /// The default value of this field is 500.
18414    pub page_size: i32,
18415
18416    /// A page token, received from a previous `ListPrivateConnections` call.
18417    /// Provide this to retrieve the subsequent page.
18418    ///
18419    /// When paginating, all other parameters provided to
18420    /// `ListPrivateConnections` must match the call that provided the page
18421    /// token.
18422    pub page_token: std::string::String,
18423
18424    /// A filter expression that matches resources returned in the response.
18425    /// The expression must specify the field name, a comparison
18426    /// operator, and the value that you want to use for filtering. The value
18427    /// must be a string, a number, or a boolean. The comparison operator
18428    /// must be `=`, `!=`, `>`, or `<`.
18429    ///
18430    /// For example, if you are filtering a list of private connections, you can
18431    /// exclude the ones named `example-connection` by specifying
18432    /// `name != "example-connection"`.
18433    ///
18434    /// To filter on multiple expressions, provide each separate expression within
18435    /// parentheses. For example:
18436    ///
18437    /// ```norust
18438    /// (name = "example-connection")
18439    /// (createTime > "2022-09-22T08:15:10.40Z")
18440    /// ```
18441    ///
18442    /// By default, each expression is an `AND` expression. However, you
18443    /// can include `AND` and `OR` expressions explicitly.
18444    /// For example:
18445    ///
18446    /// ```norust
18447    /// (name = "example-connection-1") AND
18448    /// (createTime > "2021-04-12T08:15:10.40Z") OR
18449    /// (name = "example-connection-2")
18450    /// ```
18451    pub filter: std::string::String,
18452
18453    /// Sorts list results by a certain order. By default, returned results
18454    /// are ordered by `name` in ascending order.
18455    /// You can also sort results in descending order based on the `name` value
18456    /// using `orderBy="name desc"`.
18457    /// Currently, only ordering by `name` is supported.
18458    pub order_by: std::string::String,
18459
18460    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18461}
18462
18463impl ListPrivateConnectionsRequest {
18464    pub fn new() -> Self {
18465        std::default::Default::default()
18466    }
18467
18468    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
18469    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18470        self.parent = v.into();
18471        self
18472    }
18473
18474    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
18475    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18476        self.page_size = v.into();
18477        self
18478    }
18479
18480    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
18481    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18482        self.page_token = v.into();
18483        self
18484    }
18485
18486    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
18487    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18488        self.filter = v.into();
18489        self
18490    }
18491
18492    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
18493    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18494        self.order_by = v.into();
18495        self
18496    }
18497}
18498
18499impl wkt::message::Message for ListPrivateConnectionsRequest {
18500    fn typename() -> &'static str {
18501        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest"
18502    }
18503}
18504
18505#[doc(hidden)]
18506impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionsRequest {
18507    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18508    where
18509        D: serde::Deserializer<'de>,
18510    {
18511        #[allow(non_camel_case_types)]
18512        #[doc(hidden)]
18513        #[derive(PartialEq, Eq, Hash)]
18514        enum __FieldTag {
18515            __parent,
18516            __page_size,
18517            __page_token,
18518            __filter,
18519            __order_by,
18520            Unknown(std::string::String),
18521        }
18522        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18523            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18524            where
18525                D: serde::Deserializer<'de>,
18526            {
18527                struct Visitor;
18528                impl<'de> serde::de::Visitor<'de> for Visitor {
18529                    type Value = __FieldTag;
18530                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18531                        formatter.write_str("a field name for ListPrivateConnectionsRequest")
18532                    }
18533                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18534                    where
18535                        E: serde::de::Error,
18536                    {
18537                        use std::result::Result::Ok;
18538                        use std::string::ToString;
18539                        match value {
18540                            "parent" => Ok(__FieldTag::__parent),
18541                            "pageSize" => Ok(__FieldTag::__page_size),
18542                            "page_size" => Ok(__FieldTag::__page_size),
18543                            "pageToken" => Ok(__FieldTag::__page_token),
18544                            "page_token" => Ok(__FieldTag::__page_token),
18545                            "filter" => Ok(__FieldTag::__filter),
18546                            "orderBy" => Ok(__FieldTag::__order_by),
18547                            "order_by" => Ok(__FieldTag::__order_by),
18548                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18549                        }
18550                    }
18551                }
18552                deserializer.deserialize_identifier(Visitor)
18553            }
18554        }
18555        struct Visitor;
18556        impl<'de> serde::de::Visitor<'de> for Visitor {
18557            type Value = ListPrivateConnectionsRequest;
18558            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18559                formatter.write_str("struct ListPrivateConnectionsRequest")
18560            }
18561            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18562            where
18563                A: serde::de::MapAccess<'de>,
18564            {
18565                #[allow(unused_imports)]
18566                use serde::de::Error;
18567                use std::option::Option::Some;
18568                let mut fields = std::collections::HashSet::new();
18569                let mut result = Self::Value::new();
18570                while let Some(tag) = map.next_key::<__FieldTag>()? {
18571                    #[allow(clippy::match_single_binding)]
18572                    match tag {
18573                        __FieldTag::__parent => {
18574                            if !fields.insert(__FieldTag::__parent) {
18575                                return std::result::Result::Err(A::Error::duplicate_field(
18576                                    "multiple values for parent",
18577                                ));
18578                            }
18579                            result.parent = map
18580                                .next_value::<std::option::Option<std::string::String>>()?
18581                                .unwrap_or_default();
18582                        }
18583                        __FieldTag::__page_size => {
18584                            if !fields.insert(__FieldTag::__page_size) {
18585                                return std::result::Result::Err(A::Error::duplicate_field(
18586                                    "multiple values for page_size",
18587                                ));
18588                            }
18589                            struct __With(std::option::Option<i32>);
18590                            impl<'de> serde::de::Deserialize<'de> for __With {
18591                                fn deserialize<D>(
18592                                    deserializer: D,
18593                                ) -> std::result::Result<Self, D::Error>
18594                                where
18595                                    D: serde::de::Deserializer<'de>,
18596                                {
18597                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
18598                                }
18599                            }
18600                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
18601                        }
18602                        __FieldTag::__page_token => {
18603                            if !fields.insert(__FieldTag::__page_token) {
18604                                return std::result::Result::Err(A::Error::duplicate_field(
18605                                    "multiple values for page_token",
18606                                ));
18607                            }
18608                            result.page_token = map
18609                                .next_value::<std::option::Option<std::string::String>>()?
18610                                .unwrap_or_default();
18611                        }
18612                        __FieldTag::__filter => {
18613                            if !fields.insert(__FieldTag::__filter) {
18614                                return std::result::Result::Err(A::Error::duplicate_field(
18615                                    "multiple values for filter",
18616                                ));
18617                            }
18618                            result.filter = map
18619                                .next_value::<std::option::Option<std::string::String>>()?
18620                                .unwrap_or_default();
18621                        }
18622                        __FieldTag::__order_by => {
18623                            if !fields.insert(__FieldTag::__order_by) {
18624                                return std::result::Result::Err(A::Error::duplicate_field(
18625                                    "multiple values for order_by",
18626                                ));
18627                            }
18628                            result.order_by = map
18629                                .next_value::<std::option::Option<std::string::String>>()?
18630                                .unwrap_or_default();
18631                        }
18632                        __FieldTag::Unknown(key) => {
18633                            let value = map.next_value::<serde_json::Value>()?;
18634                            result._unknown_fields.insert(key, value);
18635                        }
18636                    }
18637                }
18638                std::result::Result::Ok(result)
18639            }
18640        }
18641        deserializer.deserialize_any(Visitor)
18642    }
18643}
18644
18645#[doc(hidden)]
18646impl serde::ser::Serialize for ListPrivateConnectionsRequest {
18647    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18648    where
18649        S: serde::ser::Serializer,
18650    {
18651        use serde::ser::SerializeMap;
18652        #[allow(unused_imports)]
18653        use std::option::Option::Some;
18654        let mut state = serializer.serialize_map(std::option::Option::None)?;
18655        if !self.parent.is_empty() {
18656            state.serialize_entry("parent", &self.parent)?;
18657        }
18658        if !wkt::internal::is_default(&self.page_size) {
18659            struct __With<'a>(&'a i32);
18660            impl<'a> serde::ser::Serialize for __With<'a> {
18661                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18662                where
18663                    S: serde::ser::Serializer,
18664                {
18665                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
18666                }
18667            }
18668            state.serialize_entry("pageSize", &__With(&self.page_size))?;
18669        }
18670        if !self.page_token.is_empty() {
18671            state.serialize_entry("pageToken", &self.page_token)?;
18672        }
18673        if !self.filter.is_empty() {
18674            state.serialize_entry("filter", &self.filter)?;
18675        }
18676        if !self.order_by.is_empty() {
18677            state.serialize_entry("orderBy", &self.order_by)?;
18678        }
18679        if !self._unknown_fields.is_empty() {
18680            for (key, value) in self._unknown_fields.iter() {
18681                state.serialize_entry(key, &value)?;
18682            }
18683        }
18684        state.end()
18685    }
18686}
18687
18688impl std::fmt::Debug for ListPrivateConnectionsRequest {
18689    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18690        let mut debug_struct = f.debug_struct("ListPrivateConnectionsRequest");
18691        debug_struct.field("parent", &self.parent);
18692        debug_struct.field("page_size", &self.page_size);
18693        debug_struct.field("page_token", &self.page_token);
18694        debug_struct.field("filter", &self.filter);
18695        debug_struct.field("order_by", &self.order_by);
18696        if !self._unknown_fields.is_empty() {
18697            debug_struct.field("_unknown_fields", &self._unknown_fields);
18698        }
18699        debug_struct.finish()
18700    }
18701}
18702
18703/// Response message for
18704/// [VmwareEngine.ListPrivateConnections][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]
18705///
18706/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections]: crate::client::VmwareEngine::list_private_connections
18707#[derive(Clone, Default, PartialEq)]
18708#[non_exhaustive]
18709pub struct ListPrivateConnectionsResponse {
18710    /// A list of private connections.
18711    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
18712
18713    /// A token, which can be sent as `page_token` to retrieve the next page.
18714    /// If this field is omitted, there are no subsequent pages.
18715    pub next_page_token: std::string::String,
18716
18717    /// Unreachable resources.
18718    pub unreachable: std::vec::Vec<std::string::String>,
18719
18720    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18721}
18722
18723impl ListPrivateConnectionsResponse {
18724    pub fn new() -> Self {
18725        std::default::Default::default()
18726    }
18727
18728    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
18729    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
18730    where
18731        T: std::iter::IntoIterator<Item = V>,
18732        V: std::convert::Into<crate::model::PrivateConnection>,
18733    {
18734        use std::iter::Iterator;
18735        self.private_connections = v.into_iter().map(|i| i.into()).collect();
18736        self
18737    }
18738
18739    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
18740    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18741        self.next_page_token = v.into();
18742        self
18743    }
18744
18745    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
18746    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
18747    where
18748        T: std::iter::IntoIterator<Item = V>,
18749        V: std::convert::Into<std::string::String>,
18750    {
18751        use std::iter::Iterator;
18752        self.unreachable = v.into_iter().map(|i| i.into()).collect();
18753        self
18754    }
18755}
18756
18757impl wkt::message::Message for ListPrivateConnectionsResponse {
18758    fn typename() -> &'static str {
18759        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse"
18760    }
18761}
18762
18763#[doc(hidden)]
18764impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
18765    type PageItem = crate::model::PrivateConnection;
18766
18767    fn items(self) -> std::vec::Vec<Self::PageItem> {
18768        self.private_connections
18769    }
18770
18771    fn next_page_token(&self) -> std::string::String {
18772        use std::clone::Clone;
18773        self.next_page_token.clone()
18774    }
18775}
18776
18777#[doc(hidden)]
18778impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionsResponse {
18779    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18780    where
18781        D: serde::Deserializer<'de>,
18782    {
18783        #[allow(non_camel_case_types)]
18784        #[doc(hidden)]
18785        #[derive(PartialEq, Eq, Hash)]
18786        enum __FieldTag {
18787            __private_connections,
18788            __next_page_token,
18789            __unreachable,
18790            Unknown(std::string::String),
18791        }
18792        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18793            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18794            where
18795                D: serde::Deserializer<'de>,
18796            {
18797                struct Visitor;
18798                impl<'de> serde::de::Visitor<'de> for Visitor {
18799                    type Value = __FieldTag;
18800                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18801                        formatter.write_str("a field name for ListPrivateConnectionsResponse")
18802                    }
18803                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18804                    where
18805                        E: serde::de::Error,
18806                    {
18807                        use std::result::Result::Ok;
18808                        use std::string::ToString;
18809                        match value {
18810                            "privateConnections" => Ok(__FieldTag::__private_connections),
18811                            "private_connections" => Ok(__FieldTag::__private_connections),
18812                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
18813                            "next_page_token" => Ok(__FieldTag::__next_page_token),
18814                            "unreachable" => Ok(__FieldTag::__unreachable),
18815                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18816                        }
18817                    }
18818                }
18819                deserializer.deserialize_identifier(Visitor)
18820            }
18821        }
18822        struct Visitor;
18823        impl<'de> serde::de::Visitor<'de> for Visitor {
18824            type Value = ListPrivateConnectionsResponse;
18825            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18826                formatter.write_str("struct ListPrivateConnectionsResponse")
18827            }
18828            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18829            where
18830                A: serde::de::MapAccess<'de>,
18831            {
18832                #[allow(unused_imports)]
18833                use serde::de::Error;
18834                use std::option::Option::Some;
18835                let mut fields = std::collections::HashSet::new();
18836                let mut result = Self::Value::new();
18837                while let Some(tag) = map.next_key::<__FieldTag>()? {
18838                    #[allow(clippy::match_single_binding)]
18839                    match tag {
18840                        __FieldTag::__private_connections => {
18841                            if !fields.insert(__FieldTag::__private_connections) {
18842                                return std::result::Result::Err(A::Error::duplicate_field(
18843                                    "multiple values for private_connections",
18844                                ));
18845                            }
18846                            result.private_connections =
18847                                map.next_value::<std::option::Option<
18848                                    std::vec::Vec<crate::model::PrivateConnection>,
18849                                >>()?
18850                                .unwrap_or_default();
18851                        }
18852                        __FieldTag::__next_page_token => {
18853                            if !fields.insert(__FieldTag::__next_page_token) {
18854                                return std::result::Result::Err(A::Error::duplicate_field(
18855                                    "multiple values for next_page_token",
18856                                ));
18857                            }
18858                            result.next_page_token = map
18859                                .next_value::<std::option::Option<std::string::String>>()?
18860                                .unwrap_or_default();
18861                        }
18862                        __FieldTag::__unreachable => {
18863                            if !fields.insert(__FieldTag::__unreachable) {
18864                                return std::result::Result::Err(A::Error::duplicate_field(
18865                                    "multiple values for unreachable",
18866                                ));
18867                            }
18868                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
18869                        }
18870                        __FieldTag::Unknown(key) => {
18871                            let value = map.next_value::<serde_json::Value>()?;
18872                            result._unknown_fields.insert(key, value);
18873                        }
18874                    }
18875                }
18876                std::result::Result::Ok(result)
18877            }
18878        }
18879        deserializer.deserialize_any(Visitor)
18880    }
18881}
18882
18883#[doc(hidden)]
18884impl serde::ser::Serialize for ListPrivateConnectionsResponse {
18885    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18886    where
18887        S: serde::ser::Serializer,
18888    {
18889        use serde::ser::SerializeMap;
18890        #[allow(unused_imports)]
18891        use std::option::Option::Some;
18892        let mut state = serializer.serialize_map(std::option::Option::None)?;
18893        if !self.private_connections.is_empty() {
18894            state.serialize_entry("privateConnections", &self.private_connections)?;
18895        }
18896        if !self.next_page_token.is_empty() {
18897            state.serialize_entry("nextPageToken", &self.next_page_token)?;
18898        }
18899        if !self.unreachable.is_empty() {
18900            state.serialize_entry("unreachable", &self.unreachable)?;
18901        }
18902        if !self._unknown_fields.is_empty() {
18903            for (key, value) in self._unknown_fields.iter() {
18904                state.serialize_entry(key, &value)?;
18905            }
18906        }
18907        state.end()
18908    }
18909}
18910
18911impl std::fmt::Debug for ListPrivateConnectionsResponse {
18912    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18913        let mut debug_struct = f.debug_struct("ListPrivateConnectionsResponse");
18914        debug_struct.field("private_connections", &self.private_connections);
18915        debug_struct.field("next_page_token", &self.next_page_token);
18916        debug_struct.field("unreachable", &self.unreachable);
18917        if !self._unknown_fields.is_empty() {
18918            debug_struct.field("_unknown_fields", &self._unknown_fields);
18919        }
18920        debug_struct.finish()
18921    }
18922}
18923
18924/// Request message for
18925/// [VmwareEngine.UpdatePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]
18926///
18927/// [google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection]: crate::client::VmwareEngine::update_private_connection
18928#[derive(Clone, Default, PartialEq)]
18929#[non_exhaustive]
18930pub struct UpdatePrivateConnectionRequest {
18931    /// Required. Private connection description.
18932    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
18933
18934    /// Required. Field mask is used to specify the fields to be overwritten in the
18935    /// `PrivateConnection` resource by the update.
18936    /// The fields specified in the `update_mask` are relative to the resource, not
18937    /// the full request. A field will be overwritten if it is in the mask. If the
18938    /// user does not provide a mask then all fields will be overwritten.
18939    pub update_mask: std::option::Option<wkt::FieldMask>,
18940
18941    /// Optional. A request ID to identify requests. Specify a unique request ID
18942    /// so that if you must retry your request, the server will know to ignore
18943    /// the request if it has already been completed. The server guarantees that a
18944    /// request doesn't result in creation of duplicate commitments for at least 60
18945    /// minutes.
18946    ///
18947    /// For example, consider a situation where you make an initial request and the
18948    /// request times out. If you make the request again with the same request
18949    /// ID, the server can check if original operation with the same request ID
18950    /// was received, and if so, will ignore the second request. This prevents
18951    /// clients from accidentally creating duplicate commitments.
18952    ///
18953    /// The request ID must be a valid UUID with the exception that zero UUID is
18954    /// not supported (00000000-0000-0000-0000-000000000000).
18955    pub request_id: std::string::String,
18956
18957    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18958}
18959
18960impl UpdatePrivateConnectionRequest {
18961    pub fn new() -> Self {
18962        std::default::Default::default()
18963    }
18964
18965    /// Sets the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
18966    pub fn set_private_connection<T>(mut self, v: T) -> Self
18967    where
18968        T: std::convert::Into<crate::model::PrivateConnection>,
18969    {
18970        self.private_connection = std::option::Option::Some(v.into());
18971        self
18972    }
18973
18974    /// Sets or clears the value of [private_connection][crate::model::UpdatePrivateConnectionRequest::private_connection].
18975    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
18976    where
18977        T: std::convert::Into<crate::model::PrivateConnection>,
18978    {
18979        self.private_connection = v.map(|x| x.into());
18980        self
18981    }
18982
18983    /// Sets the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
18984    pub fn set_update_mask<T>(mut self, v: T) -> Self
18985    where
18986        T: std::convert::Into<wkt::FieldMask>,
18987    {
18988        self.update_mask = std::option::Option::Some(v.into());
18989        self
18990    }
18991
18992    /// Sets or clears the value of [update_mask][crate::model::UpdatePrivateConnectionRequest::update_mask].
18993    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18994    where
18995        T: std::convert::Into<wkt::FieldMask>,
18996    {
18997        self.update_mask = v.map(|x| x.into());
18998        self
18999    }
19000
19001    /// Sets the value of [request_id][crate::model::UpdatePrivateConnectionRequest::request_id].
19002    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19003        self.request_id = v.into();
19004        self
19005    }
19006}
19007
19008impl wkt::message::Message for UpdatePrivateConnectionRequest {
19009    fn typename() -> &'static str {
19010        "type.googleapis.com/google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest"
19011    }
19012}
19013
19014#[doc(hidden)]
19015impl<'de> serde::de::Deserialize<'de> for UpdatePrivateConnectionRequest {
19016    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19017    where
19018        D: serde::Deserializer<'de>,
19019    {
19020        #[allow(non_camel_case_types)]
19021        #[doc(hidden)]
19022        #[derive(PartialEq, Eq, Hash)]
19023        enum __FieldTag {
19024            __private_connection,
19025            __update_mask,
19026            __request_id,
19027            Unknown(std::string::String),
19028        }
19029        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19030            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19031            where
19032                D: serde::Deserializer<'de>,
19033            {
19034                struct Visitor;
19035                impl<'de> serde::de::Visitor<'de> for Visitor {
19036                    type Value = __FieldTag;
19037                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19038                        formatter.write_str("a field name for UpdatePrivateConnectionRequest")
19039                    }
19040                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19041                    where
19042                        E: serde::de::Error,
19043                    {
19044                        use std::result::Result::Ok;
19045                        use std::string::ToString;
19046                        match value {
19047                            "privateConnection" => Ok(__FieldTag::__private_connection),
19048                            "private_connection" => Ok(__FieldTag::__private_connection),
19049                            "updateMask" => Ok(__FieldTag::__update_mask),
19050                            "update_mask" => Ok(__FieldTag::__update_mask),
19051                            "requestId" => Ok(__FieldTag::__request_id),
19052                            "request_id" => Ok(__FieldTag::__request_id),
19053                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19054                        }
19055                    }
19056                }
19057                deserializer.deserialize_identifier(Visitor)
19058            }
19059        }
19060        struct Visitor;
19061        impl<'de> serde::de::Visitor<'de> for Visitor {
19062            type Value = UpdatePrivateConnectionRequest;
19063            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19064                formatter.write_str("struct UpdatePrivateConnectionRequest")
19065            }
19066            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19067            where
19068                A: serde::de::MapAccess<'de>,
19069            {
19070                #[allow(unused_imports)]
19071                use serde::de::Error;
19072                use std::option::Option::Some;
19073                let mut fields = std::collections::HashSet::new();
19074                let mut result = Self::Value::new();
19075                while let Some(tag) = map.next_key::<__FieldTag>()? {
19076                    #[allow(clippy::match_single_binding)]
19077                    match tag {
19078                        __FieldTag::__private_connection => {
19079                            if !fields.insert(__FieldTag::__private_connection) {
19080                                return std::result::Result::Err(A::Error::duplicate_field(
19081                                    "multiple values for private_connection",
19082                                ));
19083                            }
19084                            result.private_connection = map
19085                                .next_value::<std::option::Option<crate::model::PrivateConnection>>(
19086                                )?;
19087                        }
19088                        __FieldTag::__update_mask => {
19089                            if !fields.insert(__FieldTag::__update_mask) {
19090                                return std::result::Result::Err(A::Error::duplicate_field(
19091                                    "multiple values for update_mask",
19092                                ));
19093                            }
19094                            result.update_mask =
19095                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
19096                        }
19097                        __FieldTag::__request_id => {
19098                            if !fields.insert(__FieldTag::__request_id) {
19099                                return std::result::Result::Err(A::Error::duplicate_field(
19100                                    "multiple values for request_id",
19101                                ));
19102                            }
19103                            result.request_id = map
19104                                .next_value::<std::option::Option<std::string::String>>()?
19105                                .unwrap_or_default();
19106                        }
19107                        __FieldTag::Unknown(key) => {
19108                            let value = map.next_value::<serde_json::Value>()?;
19109                            result._unknown_fields.insert(key, value);
19110                        }
19111                    }
19112                }
19113                std::result::Result::Ok(result)
19114            }
19115        }
19116        deserializer.deserialize_any(Visitor)
19117    }
19118}
19119
19120#[doc(hidden)]
19121impl serde::ser::Serialize for UpdatePrivateConnectionRequest {
19122    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19123    where
19124        S: serde::ser::Serializer,
19125    {
19126        use serde::ser::SerializeMap;
19127        #[allow(unused_imports)]
19128        use std::option::Option::Some;
19129        let mut state = serializer.serialize_map(std::option::Option::None)?;
19130        if self.private_connection.is_some() {
19131            state.serialize_entry("privateConnection", &self.private_connection)?;
19132        }
19133        if self.update_mask.is_some() {
19134            state.serialize_entry("updateMask", &self.update_mask)?;
19135        }
19136        if !self.request_id.is_empty() {
19137            state.serialize_entry("requestId", &self.request_id)?;
19138        }
19139        if !self._unknown_fields.is_empty() {
19140            for (key, value) in self._unknown_fields.iter() {
19141                state.serialize_entry(key, &value)?;
19142            }
19143        }
19144        state.end()
19145    }
19146}
19147
19148impl std::fmt::Debug for UpdatePrivateConnectionRequest {
19149    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19150        let mut debug_struct = f.debug_struct("UpdatePrivateConnectionRequest");
19151        debug_struct.field("private_connection", &self.private_connection);
19152        debug_struct.field("update_mask", &self.update_mask);
19153        debug_struct.field("request_id", &self.request_id);
19154        if !self._unknown_fields.is_empty() {
19155            debug_struct.field("_unknown_fields", &self._unknown_fields);
19156        }
19157        debug_struct.finish()
19158    }
19159}
19160
19161/// Request message for
19162/// [VmwareEngine.DeletePrivateConnection][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]
19163///
19164/// [google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection]: crate::client::VmwareEngine::delete_private_connection
19165#[derive(Clone, Default, PartialEq)]
19166#[non_exhaustive]
19167pub struct DeletePrivateConnectionRequest {
19168    /// Required. The resource name of the private connection to be deleted.
19169    /// Resource names are schemeless URIs that follow the conventions in
19170    /// <https://cloud.google.com/apis/design/resource_names>.
19171    /// For example:
19172    /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
19173    pub name: std::string::String,
19174
19175    /// Optional. A request ID to identify requests. Specify a unique request ID
19176    /// so that if you must retry your request, the server will know to ignore
19177    /// the request if it has already been completed. The server guarantees that a
19178    /// request doesn't result in creation of duplicate commitments for at least 60
19179    /// minutes.
19180    ///
19181    /// For example, consider a situation where you make an initial request and the
19182    /// request times out. If you make the request again with the same request
19183    /// ID, the server can check if original operation with the same request ID
19184    /// was received, and if so, will ignore the second request. This prevents
19185    /// clients from accidentally creating duplicate commitments.
19186    ///
19187    /// The request ID must be a valid UUID with the exception that zero UUID is
19188    /// not supported (00000000-0000-0000-0000-000000000000).
19189    pub request_id: std::string::String,
19190
19191    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19192}
19193
19194impl DeletePrivateConnectionRequest {
19195    pub fn new() -> Self {
19196        std::default::Default::default()
19197    }
19198
19199    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
19200    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19201        self.name = v.into();
19202        self
19203    }
19204
19205    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
19206    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19207        self.request_id = v.into();
19208        self
19209    }
19210}
19211
19212impl wkt::message::Message for DeletePrivateConnectionRequest {
19213    fn typename() -> &'static str {
19214        "type.googleapis.com/google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest"
19215    }
19216}
19217
19218#[doc(hidden)]
19219impl<'de> serde::de::Deserialize<'de> for DeletePrivateConnectionRequest {
19220    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19221    where
19222        D: serde::Deserializer<'de>,
19223    {
19224        #[allow(non_camel_case_types)]
19225        #[doc(hidden)]
19226        #[derive(PartialEq, Eq, Hash)]
19227        enum __FieldTag {
19228            __name,
19229            __request_id,
19230            Unknown(std::string::String),
19231        }
19232        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19233            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19234            where
19235                D: serde::Deserializer<'de>,
19236            {
19237                struct Visitor;
19238                impl<'de> serde::de::Visitor<'de> for Visitor {
19239                    type Value = __FieldTag;
19240                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19241                        formatter.write_str("a field name for DeletePrivateConnectionRequest")
19242                    }
19243                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19244                    where
19245                        E: serde::de::Error,
19246                    {
19247                        use std::result::Result::Ok;
19248                        use std::string::ToString;
19249                        match value {
19250                            "name" => Ok(__FieldTag::__name),
19251                            "requestId" => Ok(__FieldTag::__request_id),
19252                            "request_id" => Ok(__FieldTag::__request_id),
19253                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19254                        }
19255                    }
19256                }
19257                deserializer.deserialize_identifier(Visitor)
19258            }
19259        }
19260        struct Visitor;
19261        impl<'de> serde::de::Visitor<'de> for Visitor {
19262            type Value = DeletePrivateConnectionRequest;
19263            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19264                formatter.write_str("struct DeletePrivateConnectionRequest")
19265            }
19266            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19267            where
19268                A: serde::de::MapAccess<'de>,
19269            {
19270                #[allow(unused_imports)]
19271                use serde::de::Error;
19272                use std::option::Option::Some;
19273                let mut fields = std::collections::HashSet::new();
19274                let mut result = Self::Value::new();
19275                while let Some(tag) = map.next_key::<__FieldTag>()? {
19276                    #[allow(clippy::match_single_binding)]
19277                    match tag {
19278                        __FieldTag::__name => {
19279                            if !fields.insert(__FieldTag::__name) {
19280                                return std::result::Result::Err(A::Error::duplicate_field(
19281                                    "multiple values for name",
19282                                ));
19283                            }
19284                            result.name = map
19285                                .next_value::<std::option::Option<std::string::String>>()?
19286                                .unwrap_or_default();
19287                        }
19288                        __FieldTag::__request_id => {
19289                            if !fields.insert(__FieldTag::__request_id) {
19290                                return std::result::Result::Err(A::Error::duplicate_field(
19291                                    "multiple values for request_id",
19292                                ));
19293                            }
19294                            result.request_id = map
19295                                .next_value::<std::option::Option<std::string::String>>()?
19296                                .unwrap_or_default();
19297                        }
19298                        __FieldTag::Unknown(key) => {
19299                            let value = map.next_value::<serde_json::Value>()?;
19300                            result._unknown_fields.insert(key, value);
19301                        }
19302                    }
19303                }
19304                std::result::Result::Ok(result)
19305            }
19306        }
19307        deserializer.deserialize_any(Visitor)
19308    }
19309}
19310
19311#[doc(hidden)]
19312impl serde::ser::Serialize for DeletePrivateConnectionRequest {
19313    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19314    where
19315        S: serde::ser::Serializer,
19316    {
19317        use serde::ser::SerializeMap;
19318        #[allow(unused_imports)]
19319        use std::option::Option::Some;
19320        let mut state = serializer.serialize_map(std::option::Option::None)?;
19321        if !self.name.is_empty() {
19322            state.serialize_entry("name", &self.name)?;
19323        }
19324        if !self.request_id.is_empty() {
19325            state.serialize_entry("requestId", &self.request_id)?;
19326        }
19327        if !self._unknown_fields.is_empty() {
19328            for (key, value) in self._unknown_fields.iter() {
19329                state.serialize_entry(key, &value)?;
19330            }
19331        }
19332        state.end()
19333    }
19334}
19335
19336impl std::fmt::Debug for DeletePrivateConnectionRequest {
19337    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19338        let mut debug_struct = f.debug_struct("DeletePrivateConnectionRequest");
19339        debug_struct.field("name", &self.name);
19340        debug_struct.field("request_id", &self.request_id);
19341        if !self._unknown_fields.is_empty() {
19342            debug_struct.field("_unknown_fields", &self._unknown_fields);
19343        }
19344        debug_struct.finish()
19345    }
19346}
19347
19348/// Request message for
19349/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
19350///
19351/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
19352#[derive(Clone, Default, PartialEq)]
19353#[non_exhaustive]
19354pub struct ListPrivateConnectionPeeringRoutesRequest {
19355    /// Required. The resource name of the private connection to retrieve peering
19356    /// routes from. Resource names are schemeless URIs that follow the conventions
19357    /// in <https://cloud.google.com/apis/design/resource_names>. For example:
19358    /// `projects/my-project/locations/us-west1/privateConnections/my-connection`
19359    pub parent: std::string::String,
19360
19361    /// The maximum number of peering routes to return in one page.
19362    /// The service may return fewer than this value.
19363    /// The maximum value is coerced to 1000.
19364    /// The default value of this field is 500.
19365    pub page_size: i32,
19366
19367    /// A page token, received from a previous `ListPrivateConnectionPeeringRoutes`
19368    /// call. Provide this to retrieve the subsequent page. When paginating, all
19369    /// other parameters provided to `ListPrivateConnectionPeeringRoutes` must
19370    /// match the call that provided the page token.
19371    pub page_token: std::string::String,
19372
19373    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19374}
19375
19376impl ListPrivateConnectionPeeringRoutesRequest {
19377    pub fn new() -> Self {
19378        std::default::Default::default()
19379    }
19380
19381    /// Sets the value of [parent][crate::model::ListPrivateConnectionPeeringRoutesRequest::parent].
19382    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19383        self.parent = v.into();
19384        self
19385    }
19386
19387    /// Sets the value of [page_size][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_size].
19388    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19389        self.page_size = v.into();
19390        self
19391    }
19392
19393    /// Sets the value of [page_token][crate::model::ListPrivateConnectionPeeringRoutesRequest::page_token].
19394    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19395        self.page_token = v.into();
19396        self
19397    }
19398}
19399
19400impl wkt::message::Message for ListPrivateConnectionPeeringRoutesRequest {
19401    fn typename() -> &'static str {
19402        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest"
19403    }
19404}
19405
19406#[doc(hidden)]
19407impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionPeeringRoutesRequest {
19408    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19409    where
19410        D: serde::Deserializer<'de>,
19411    {
19412        #[allow(non_camel_case_types)]
19413        #[doc(hidden)]
19414        #[derive(PartialEq, Eq, Hash)]
19415        enum __FieldTag {
19416            __parent,
19417            __page_size,
19418            __page_token,
19419            Unknown(std::string::String),
19420        }
19421        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19422            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19423            where
19424                D: serde::Deserializer<'de>,
19425            {
19426                struct Visitor;
19427                impl<'de> serde::de::Visitor<'de> for Visitor {
19428                    type Value = __FieldTag;
19429                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19430                        formatter
19431                            .write_str("a field name for ListPrivateConnectionPeeringRoutesRequest")
19432                    }
19433                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19434                    where
19435                        E: serde::de::Error,
19436                    {
19437                        use std::result::Result::Ok;
19438                        use std::string::ToString;
19439                        match value {
19440                            "parent" => Ok(__FieldTag::__parent),
19441                            "pageSize" => Ok(__FieldTag::__page_size),
19442                            "page_size" => Ok(__FieldTag::__page_size),
19443                            "pageToken" => Ok(__FieldTag::__page_token),
19444                            "page_token" => Ok(__FieldTag::__page_token),
19445                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19446                        }
19447                    }
19448                }
19449                deserializer.deserialize_identifier(Visitor)
19450            }
19451        }
19452        struct Visitor;
19453        impl<'de> serde::de::Visitor<'de> for Visitor {
19454            type Value = ListPrivateConnectionPeeringRoutesRequest;
19455            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19456                formatter.write_str("struct ListPrivateConnectionPeeringRoutesRequest")
19457            }
19458            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19459            where
19460                A: serde::de::MapAccess<'de>,
19461            {
19462                #[allow(unused_imports)]
19463                use serde::de::Error;
19464                use std::option::Option::Some;
19465                let mut fields = std::collections::HashSet::new();
19466                let mut result = Self::Value::new();
19467                while let Some(tag) = map.next_key::<__FieldTag>()? {
19468                    #[allow(clippy::match_single_binding)]
19469                    match tag {
19470                        __FieldTag::__parent => {
19471                            if !fields.insert(__FieldTag::__parent) {
19472                                return std::result::Result::Err(A::Error::duplicate_field(
19473                                    "multiple values for parent",
19474                                ));
19475                            }
19476                            result.parent = map
19477                                .next_value::<std::option::Option<std::string::String>>()?
19478                                .unwrap_or_default();
19479                        }
19480                        __FieldTag::__page_size => {
19481                            if !fields.insert(__FieldTag::__page_size) {
19482                                return std::result::Result::Err(A::Error::duplicate_field(
19483                                    "multiple values for page_size",
19484                                ));
19485                            }
19486                            struct __With(std::option::Option<i32>);
19487                            impl<'de> serde::de::Deserialize<'de> for __With {
19488                                fn deserialize<D>(
19489                                    deserializer: D,
19490                                ) -> std::result::Result<Self, D::Error>
19491                                where
19492                                    D: serde::de::Deserializer<'de>,
19493                                {
19494                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19495                                }
19496                            }
19497                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
19498                        }
19499                        __FieldTag::__page_token => {
19500                            if !fields.insert(__FieldTag::__page_token) {
19501                                return std::result::Result::Err(A::Error::duplicate_field(
19502                                    "multiple values for page_token",
19503                                ));
19504                            }
19505                            result.page_token = map
19506                                .next_value::<std::option::Option<std::string::String>>()?
19507                                .unwrap_or_default();
19508                        }
19509                        __FieldTag::Unknown(key) => {
19510                            let value = map.next_value::<serde_json::Value>()?;
19511                            result._unknown_fields.insert(key, value);
19512                        }
19513                    }
19514                }
19515                std::result::Result::Ok(result)
19516            }
19517        }
19518        deserializer.deserialize_any(Visitor)
19519    }
19520}
19521
19522#[doc(hidden)]
19523impl serde::ser::Serialize for ListPrivateConnectionPeeringRoutesRequest {
19524    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19525    where
19526        S: serde::ser::Serializer,
19527    {
19528        use serde::ser::SerializeMap;
19529        #[allow(unused_imports)]
19530        use std::option::Option::Some;
19531        let mut state = serializer.serialize_map(std::option::Option::None)?;
19532        if !self.parent.is_empty() {
19533            state.serialize_entry("parent", &self.parent)?;
19534        }
19535        if !wkt::internal::is_default(&self.page_size) {
19536            struct __With<'a>(&'a i32);
19537            impl<'a> serde::ser::Serialize for __With<'a> {
19538                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19539                where
19540                    S: serde::ser::Serializer,
19541                {
19542                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19543                }
19544            }
19545            state.serialize_entry("pageSize", &__With(&self.page_size))?;
19546        }
19547        if !self.page_token.is_empty() {
19548            state.serialize_entry("pageToken", &self.page_token)?;
19549        }
19550        if !self._unknown_fields.is_empty() {
19551            for (key, value) in self._unknown_fields.iter() {
19552                state.serialize_entry(key, &value)?;
19553            }
19554        }
19555        state.end()
19556    }
19557}
19558
19559impl std::fmt::Debug for ListPrivateConnectionPeeringRoutesRequest {
19560    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19561        let mut debug_struct = f.debug_struct("ListPrivateConnectionPeeringRoutesRequest");
19562        debug_struct.field("parent", &self.parent);
19563        debug_struct.field("page_size", &self.page_size);
19564        debug_struct.field("page_token", &self.page_token);
19565        if !self._unknown_fields.is_empty() {
19566            debug_struct.field("_unknown_fields", &self._unknown_fields);
19567        }
19568        debug_struct.finish()
19569    }
19570}
19571
19572/// Response message for
19573/// [VmwareEngine.ListPrivateConnectionPeeringRoutes][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]
19574///
19575/// [google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes]: crate::client::VmwareEngine::list_private_connection_peering_routes
19576#[derive(Clone, Default, PartialEq)]
19577#[non_exhaustive]
19578pub struct ListPrivateConnectionPeeringRoutesResponse {
19579    /// A list of peering routes.
19580    pub peering_routes: std::vec::Vec<crate::model::PeeringRoute>,
19581
19582    /// A token, which can be sent as `page_token` to retrieve the next page.
19583    /// If this field is omitted, there are no subsequent pages.
19584    pub next_page_token: std::string::String,
19585
19586    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19587}
19588
19589impl ListPrivateConnectionPeeringRoutesResponse {
19590    pub fn new() -> Self {
19591        std::default::Default::default()
19592    }
19593
19594    /// Sets the value of [peering_routes][crate::model::ListPrivateConnectionPeeringRoutesResponse::peering_routes].
19595    pub fn set_peering_routes<T, V>(mut self, v: T) -> Self
19596    where
19597        T: std::iter::IntoIterator<Item = V>,
19598        V: std::convert::Into<crate::model::PeeringRoute>,
19599    {
19600        use std::iter::Iterator;
19601        self.peering_routes = v.into_iter().map(|i| i.into()).collect();
19602        self
19603    }
19604
19605    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionPeeringRoutesResponse::next_page_token].
19606    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19607        self.next_page_token = v.into();
19608        self
19609    }
19610}
19611
19612impl wkt::message::Message for ListPrivateConnectionPeeringRoutesResponse {
19613    fn typename() -> &'static str {
19614        "type.googleapis.com/google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse"
19615    }
19616}
19617
19618#[doc(hidden)]
19619impl gax::paginator::internal::PageableResponse for ListPrivateConnectionPeeringRoutesResponse {
19620    type PageItem = crate::model::PeeringRoute;
19621
19622    fn items(self) -> std::vec::Vec<Self::PageItem> {
19623        self.peering_routes
19624    }
19625
19626    fn next_page_token(&self) -> std::string::String {
19627        use std::clone::Clone;
19628        self.next_page_token.clone()
19629    }
19630}
19631
19632#[doc(hidden)]
19633impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionPeeringRoutesResponse {
19634    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19635    where
19636        D: serde::Deserializer<'de>,
19637    {
19638        #[allow(non_camel_case_types)]
19639        #[doc(hidden)]
19640        #[derive(PartialEq, Eq, Hash)]
19641        enum __FieldTag {
19642            __peering_routes,
19643            __next_page_token,
19644            Unknown(std::string::String),
19645        }
19646        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19647            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19648            where
19649                D: serde::Deserializer<'de>,
19650            {
19651                struct Visitor;
19652                impl<'de> serde::de::Visitor<'de> for Visitor {
19653                    type Value = __FieldTag;
19654                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19655                        formatter.write_str(
19656                            "a field name for ListPrivateConnectionPeeringRoutesResponse",
19657                        )
19658                    }
19659                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19660                    where
19661                        E: serde::de::Error,
19662                    {
19663                        use std::result::Result::Ok;
19664                        use std::string::ToString;
19665                        match value {
19666                            "peeringRoutes" => Ok(__FieldTag::__peering_routes),
19667                            "peering_routes" => Ok(__FieldTag::__peering_routes),
19668                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
19669                            "next_page_token" => Ok(__FieldTag::__next_page_token),
19670                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19671                        }
19672                    }
19673                }
19674                deserializer.deserialize_identifier(Visitor)
19675            }
19676        }
19677        struct Visitor;
19678        impl<'de> serde::de::Visitor<'de> for Visitor {
19679            type Value = ListPrivateConnectionPeeringRoutesResponse;
19680            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19681                formatter.write_str("struct ListPrivateConnectionPeeringRoutesResponse")
19682            }
19683            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19684            where
19685                A: serde::de::MapAccess<'de>,
19686            {
19687                #[allow(unused_imports)]
19688                use serde::de::Error;
19689                use std::option::Option::Some;
19690                let mut fields = std::collections::HashSet::new();
19691                let mut result = Self::Value::new();
19692                while let Some(tag) = map.next_key::<__FieldTag>()? {
19693                    #[allow(clippy::match_single_binding)]
19694                    match tag {
19695                        __FieldTag::__peering_routes => {
19696                            if !fields.insert(__FieldTag::__peering_routes) {
19697                                return std::result::Result::Err(A::Error::duplicate_field(
19698                                    "multiple values for peering_routes",
19699                                ));
19700                            }
19701                            result.peering_routes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PeeringRoute>>>()?.unwrap_or_default();
19702                        }
19703                        __FieldTag::__next_page_token => {
19704                            if !fields.insert(__FieldTag::__next_page_token) {
19705                                return std::result::Result::Err(A::Error::duplicate_field(
19706                                    "multiple values for next_page_token",
19707                                ));
19708                            }
19709                            result.next_page_token = map
19710                                .next_value::<std::option::Option<std::string::String>>()?
19711                                .unwrap_or_default();
19712                        }
19713                        __FieldTag::Unknown(key) => {
19714                            let value = map.next_value::<serde_json::Value>()?;
19715                            result._unknown_fields.insert(key, value);
19716                        }
19717                    }
19718                }
19719                std::result::Result::Ok(result)
19720            }
19721        }
19722        deserializer.deserialize_any(Visitor)
19723    }
19724}
19725
19726#[doc(hidden)]
19727impl serde::ser::Serialize for ListPrivateConnectionPeeringRoutesResponse {
19728    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19729    where
19730        S: serde::ser::Serializer,
19731    {
19732        use serde::ser::SerializeMap;
19733        #[allow(unused_imports)]
19734        use std::option::Option::Some;
19735        let mut state = serializer.serialize_map(std::option::Option::None)?;
19736        if !self.peering_routes.is_empty() {
19737            state.serialize_entry("peeringRoutes", &self.peering_routes)?;
19738        }
19739        if !self.next_page_token.is_empty() {
19740            state.serialize_entry("nextPageToken", &self.next_page_token)?;
19741        }
19742        if !self._unknown_fields.is_empty() {
19743            for (key, value) in self._unknown_fields.iter() {
19744                state.serialize_entry(key, &value)?;
19745            }
19746        }
19747        state.end()
19748    }
19749}
19750
19751impl std::fmt::Debug for ListPrivateConnectionPeeringRoutesResponse {
19752    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19753        let mut debug_struct = f.debug_struct("ListPrivateConnectionPeeringRoutesResponse");
19754        debug_struct.field("peering_routes", &self.peering_routes);
19755        debug_struct.field("next_page_token", &self.next_page_token);
19756        if !self._unknown_fields.is_empty() {
19757            debug_struct.field("_unknown_fields", &self._unknown_fields);
19758        }
19759        debug_struct.finish()
19760    }
19761}
19762
19763/// Request message for
19764/// [VmwareEngine.GrantDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]
19765///
19766/// [google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission]: crate::client::VmwareEngine::grant_dns_bind_permission
19767#[derive(Clone, Default, PartialEq)]
19768#[non_exhaustive]
19769pub struct GrantDnsBindPermissionRequest {
19770    /// Required. The name of the resource which stores the users/service accounts
19771    /// having the permission to bind to the corresponding intranet VPC of the
19772    /// consumer project. DnsBindPermission is a global resource. Resource names
19773    /// are schemeless URIs that follow the conventions in
19774    /// <https://cloud.google.com/apis/design/resource_names>. For example:
19775    /// `projects/my-project/locations/global/dnsBindPermission`
19776    pub name: std::string::String,
19777
19778    /// Required. The consumer provided user/service account which needs to be
19779    /// granted permission to bind with the intranet VPC corresponding to the
19780    /// consumer project.
19781    pub principal: std::option::Option<crate::model::Principal>,
19782
19783    /// Optional. A request ID to identify requests. Specify a unique request ID
19784    /// so that if you must retry your request, the server will know to ignore
19785    /// the request if it has already been completed. The server guarantees that a
19786    /// request doesn't result in creation of duplicate commitments for at least 60
19787    /// minutes.
19788    ///
19789    /// For example, consider a situation where you make an initial request and the
19790    /// request times out. If you make the request again with the same request
19791    /// ID, the server can check if original operation with the same request ID
19792    /// was received, and if so, will ignore the second request. This prevents
19793    /// clients from accidentally creating duplicate commitments.
19794    ///
19795    /// The request ID must be a valid UUID with the exception that zero UUID is
19796    /// not supported (00000000-0000-0000-0000-000000000000).
19797    pub request_id: std::string::String,
19798
19799    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19800}
19801
19802impl GrantDnsBindPermissionRequest {
19803    pub fn new() -> Self {
19804        std::default::Default::default()
19805    }
19806
19807    /// Sets the value of [name][crate::model::GrantDnsBindPermissionRequest::name].
19808    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19809        self.name = v.into();
19810        self
19811    }
19812
19813    /// Sets the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
19814    pub fn set_principal<T>(mut self, v: T) -> Self
19815    where
19816        T: std::convert::Into<crate::model::Principal>,
19817    {
19818        self.principal = std::option::Option::Some(v.into());
19819        self
19820    }
19821
19822    /// Sets or clears the value of [principal][crate::model::GrantDnsBindPermissionRequest::principal].
19823    pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
19824    where
19825        T: std::convert::Into<crate::model::Principal>,
19826    {
19827        self.principal = v.map(|x| x.into());
19828        self
19829    }
19830
19831    /// Sets the value of [request_id][crate::model::GrantDnsBindPermissionRequest::request_id].
19832    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19833        self.request_id = v.into();
19834        self
19835    }
19836}
19837
19838impl wkt::message::Message for GrantDnsBindPermissionRequest {
19839    fn typename() -> &'static str {
19840        "type.googleapis.com/google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest"
19841    }
19842}
19843
19844#[doc(hidden)]
19845impl<'de> serde::de::Deserialize<'de> for GrantDnsBindPermissionRequest {
19846    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19847    where
19848        D: serde::Deserializer<'de>,
19849    {
19850        #[allow(non_camel_case_types)]
19851        #[doc(hidden)]
19852        #[derive(PartialEq, Eq, Hash)]
19853        enum __FieldTag {
19854            __name,
19855            __principal,
19856            __request_id,
19857            Unknown(std::string::String),
19858        }
19859        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19860            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19861            where
19862                D: serde::Deserializer<'de>,
19863            {
19864                struct Visitor;
19865                impl<'de> serde::de::Visitor<'de> for Visitor {
19866                    type Value = __FieldTag;
19867                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19868                        formatter.write_str("a field name for GrantDnsBindPermissionRequest")
19869                    }
19870                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19871                    where
19872                        E: serde::de::Error,
19873                    {
19874                        use std::result::Result::Ok;
19875                        use std::string::ToString;
19876                        match value {
19877                            "name" => Ok(__FieldTag::__name),
19878                            "principal" => Ok(__FieldTag::__principal),
19879                            "requestId" => Ok(__FieldTag::__request_id),
19880                            "request_id" => Ok(__FieldTag::__request_id),
19881                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19882                        }
19883                    }
19884                }
19885                deserializer.deserialize_identifier(Visitor)
19886            }
19887        }
19888        struct Visitor;
19889        impl<'de> serde::de::Visitor<'de> for Visitor {
19890            type Value = GrantDnsBindPermissionRequest;
19891            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19892                formatter.write_str("struct GrantDnsBindPermissionRequest")
19893            }
19894            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19895            where
19896                A: serde::de::MapAccess<'de>,
19897            {
19898                #[allow(unused_imports)]
19899                use serde::de::Error;
19900                use std::option::Option::Some;
19901                let mut fields = std::collections::HashSet::new();
19902                let mut result = Self::Value::new();
19903                while let Some(tag) = map.next_key::<__FieldTag>()? {
19904                    #[allow(clippy::match_single_binding)]
19905                    match tag {
19906                        __FieldTag::__name => {
19907                            if !fields.insert(__FieldTag::__name) {
19908                                return std::result::Result::Err(A::Error::duplicate_field(
19909                                    "multiple values for name",
19910                                ));
19911                            }
19912                            result.name = map
19913                                .next_value::<std::option::Option<std::string::String>>()?
19914                                .unwrap_or_default();
19915                        }
19916                        __FieldTag::__principal => {
19917                            if !fields.insert(__FieldTag::__principal) {
19918                                return std::result::Result::Err(A::Error::duplicate_field(
19919                                    "multiple values for principal",
19920                                ));
19921                            }
19922                            result.principal =
19923                                map.next_value::<std::option::Option<crate::model::Principal>>()?;
19924                        }
19925                        __FieldTag::__request_id => {
19926                            if !fields.insert(__FieldTag::__request_id) {
19927                                return std::result::Result::Err(A::Error::duplicate_field(
19928                                    "multiple values for request_id",
19929                                ));
19930                            }
19931                            result.request_id = map
19932                                .next_value::<std::option::Option<std::string::String>>()?
19933                                .unwrap_or_default();
19934                        }
19935                        __FieldTag::Unknown(key) => {
19936                            let value = map.next_value::<serde_json::Value>()?;
19937                            result._unknown_fields.insert(key, value);
19938                        }
19939                    }
19940                }
19941                std::result::Result::Ok(result)
19942            }
19943        }
19944        deserializer.deserialize_any(Visitor)
19945    }
19946}
19947
19948#[doc(hidden)]
19949impl serde::ser::Serialize for GrantDnsBindPermissionRequest {
19950    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19951    where
19952        S: serde::ser::Serializer,
19953    {
19954        use serde::ser::SerializeMap;
19955        #[allow(unused_imports)]
19956        use std::option::Option::Some;
19957        let mut state = serializer.serialize_map(std::option::Option::None)?;
19958        if !self.name.is_empty() {
19959            state.serialize_entry("name", &self.name)?;
19960        }
19961        if self.principal.is_some() {
19962            state.serialize_entry("principal", &self.principal)?;
19963        }
19964        if !self.request_id.is_empty() {
19965            state.serialize_entry("requestId", &self.request_id)?;
19966        }
19967        if !self._unknown_fields.is_empty() {
19968            for (key, value) in self._unknown_fields.iter() {
19969                state.serialize_entry(key, &value)?;
19970            }
19971        }
19972        state.end()
19973    }
19974}
19975
19976impl std::fmt::Debug for GrantDnsBindPermissionRequest {
19977    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19978        let mut debug_struct = f.debug_struct("GrantDnsBindPermissionRequest");
19979        debug_struct.field("name", &self.name);
19980        debug_struct.field("principal", &self.principal);
19981        debug_struct.field("request_id", &self.request_id);
19982        if !self._unknown_fields.is_empty() {
19983            debug_struct.field("_unknown_fields", &self._unknown_fields);
19984        }
19985        debug_struct.finish()
19986    }
19987}
19988
19989/// Request message for
19990/// [VmwareEngine.RevokeDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]
19991///
19992/// [google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission]: crate::client::VmwareEngine::revoke_dns_bind_permission
19993#[derive(Clone, Default, PartialEq)]
19994#[non_exhaustive]
19995pub struct RevokeDnsBindPermissionRequest {
19996    /// Required. The name of the resource which stores the users/service accounts
19997    /// having the permission to bind to the corresponding intranet VPC of the
19998    /// consumer project. DnsBindPermission is a global resource. Resource names
19999    /// are schemeless URIs that follow the conventions in
20000    /// <https://cloud.google.com/apis/design/resource_names>. For example:
20001    /// `projects/my-project/locations/global/dnsBindPermission`
20002    pub name: std::string::String,
20003
20004    /// Required. The consumer provided user/service account which needs to be
20005    /// granted permission to bind with the intranet VPC corresponding to the
20006    /// consumer project.
20007    pub principal: std::option::Option<crate::model::Principal>,
20008
20009    /// Optional. A request ID to identify requests. Specify a unique request ID
20010    /// so that if you must retry your request, the server will know to ignore
20011    /// the request if it has already been completed. The server guarantees that a
20012    /// request doesn't result in creation of duplicate commitments for at least 60
20013    /// minutes.
20014    ///
20015    /// For example, consider a situation where you make an initial request and the
20016    /// request times out. If you make the request again with the same request
20017    /// ID, the server can check if original operation with the same request ID
20018    /// was received, and if so, will ignore the second request. This prevents
20019    /// clients from accidentally creating duplicate commitments.
20020    ///
20021    /// The request ID must be a valid UUID with the exception that zero UUID is
20022    /// not supported (00000000-0000-0000-0000-000000000000).
20023    pub request_id: std::string::String,
20024
20025    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20026}
20027
20028impl RevokeDnsBindPermissionRequest {
20029    pub fn new() -> Self {
20030        std::default::Default::default()
20031    }
20032
20033    /// Sets the value of [name][crate::model::RevokeDnsBindPermissionRequest::name].
20034    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20035        self.name = v.into();
20036        self
20037    }
20038
20039    /// Sets the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
20040    pub fn set_principal<T>(mut self, v: T) -> Self
20041    where
20042        T: std::convert::Into<crate::model::Principal>,
20043    {
20044        self.principal = std::option::Option::Some(v.into());
20045        self
20046    }
20047
20048    /// Sets or clears the value of [principal][crate::model::RevokeDnsBindPermissionRequest::principal].
20049    pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
20050    where
20051        T: std::convert::Into<crate::model::Principal>,
20052    {
20053        self.principal = v.map(|x| x.into());
20054        self
20055    }
20056
20057    /// Sets the value of [request_id][crate::model::RevokeDnsBindPermissionRequest::request_id].
20058    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20059        self.request_id = v.into();
20060        self
20061    }
20062}
20063
20064impl wkt::message::Message for RevokeDnsBindPermissionRequest {
20065    fn typename() -> &'static str {
20066        "type.googleapis.com/google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest"
20067    }
20068}
20069
20070#[doc(hidden)]
20071impl<'de> serde::de::Deserialize<'de> for RevokeDnsBindPermissionRequest {
20072    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20073    where
20074        D: serde::Deserializer<'de>,
20075    {
20076        #[allow(non_camel_case_types)]
20077        #[doc(hidden)]
20078        #[derive(PartialEq, Eq, Hash)]
20079        enum __FieldTag {
20080            __name,
20081            __principal,
20082            __request_id,
20083            Unknown(std::string::String),
20084        }
20085        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20086            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20087            where
20088                D: serde::Deserializer<'de>,
20089            {
20090                struct Visitor;
20091                impl<'de> serde::de::Visitor<'de> for Visitor {
20092                    type Value = __FieldTag;
20093                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20094                        formatter.write_str("a field name for RevokeDnsBindPermissionRequest")
20095                    }
20096                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20097                    where
20098                        E: serde::de::Error,
20099                    {
20100                        use std::result::Result::Ok;
20101                        use std::string::ToString;
20102                        match value {
20103                            "name" => Ok(__FieldTag::__name),
20104                            "principal" => Ok(__FieldTag::__principal),
20105                            "requestId" => Ok(__FieldTag::__request_id),
20106                            "request_id" => Ok(__FieldTag::__request_id),
20107                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20108                        }
20109                    }
20110                }
20111                deserializer.deserialize_identifier(Visitor)
20112            }
20113        }
20114        struct Visitor;
20115        impl<'de> serde::de::Visitor<'de> for Visitor {
20116            type Value = RevokeDnsBindPermissionRequest;
20117            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20118                formatter.write_str("struct RevokeDnsBindPermissionRequest")
20119            }
20120            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20121            where
20122                A: serde::de::MapAccess<'de>,
20123            {
20124                #[allow(unused_imports)]
20125                use serde::de::Error;
20126                use std::option::Option::Some;
20127                let mut fields = std::collections::HashSet::new();
20128                let mut result = Self::Value::new();
20129                while let Some(tag) = map.next_key::<__FieldTag>()? {
20130                    #[allow(clippy::match_single_binding)]
20131                    match tag {
20132                        __FieldTag::__name => {
20133                            if !fields.insert(__FieldTag::__name) {
20134                                return std::result::Result::Err(A::Error::duplicate_field(
20135                                    "multiple values for name",
20136                                ));
20137                            }
20138                            result.name = map
20139                                .next_value::<std::option::Option<std::string::String>>()?
20140                                .unwrap_or_default();
20141                        }
20142                        __FieldTag::__principal => {
20143                            if !fields.insert(__FieldTag::__principal) {
20144                                return std::result::Result::Err(A::Error::duplicate_field(
20145                                    "multiple values for principal",
20146                                ));
20147                            }
20148                            result.principal =
20149                                map.next_value::<std::option::Option<crate::model::Principal>>()?;
20150                        }
20151                        __FieldTag::__request_id => {
20152                            if !fields.insert(__FieldTag::__request_id) {
20153                                return std::result::Result::Err(A::Error::duplicate_field(
20154                                    "multiple values for request_id",
20155                                ));
20156                            }
20157                            result.request_id = map
20158                                .next_value::<std::option::Option<std::string::String>>()?
20159                                .unwrap_or_default();
20160                        }
20161                        __FieldTag::Unknown(key) => {
20162                            let value = map.next_value::<serde_json::Value>()?;
20163                            result._unknown_fields.insert(key, value);
20164                        }
20165                    }
20166                }
20167                std::result::Result::Ok(result)
20168            }
20169        }
20170        deserializer.deserialize_any(Visitor)
20171    }
20172}
20173
20174#[doc(hidden)]
20175impl serde::ser::Serialize for RevokeDnsBindPermissionRequest {
20176    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20177    where
20178        S: serde::ser::Serializer,
20179    {
20180        use serde::ser::SerializeMap;
20181        #[allow(unused_imports)]
20182        use std::option::Option::Some;
20183        let mut state = serializer.serialize_map(std::option::Option::None)?;
20184        if !self.name.is_empty() {
20185            state.serialize_entry("name", &self.name)?;
20186        }
20187        if self.principal.is_some() {
20188            state.serialize_entry("principal", &self.principal)?;
20189        }
20190        if !self.request_id.is_empty() {
20191            state.serialize_entry("requestId", &self.request_id)?;
20192        }
20193        if !self._unknown_fields.is_empty() {
20194            for (key, value) in self._unknown_fields.iter() {
20195                state.serialize_entry(key, &value)?;
20196            }
20197        }
20198        state.end()
20199    }
20200}
20201
20202impl std::fmt::Debug for RevokeDnsBindPermissionRequest {
20203    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20204        let mut debug_struct = f.debug_struct("RevokeDnsBindPermissionRequest");
20205        debug_struct.field("name", &self.name);
20206        debug_struct.field("principal", &self.principal);
20207        debug_struct.field("request_id", &self.request_id);
20208        if !self._unknown_fields.is_empty() {
20209            debug_struct.field("_unknown_fields", &self._unknown_fields);
20210        }
20211        debug_struct.finish()
20212    }
20213}
20214
20215/// Request message for
20216/// [VmwareEngine.GetDnsBindPermission][google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]
20217///
20218/// [google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission]: crate::client::VmwareEngine::get_dns_bind_permission
20219#[derive(Clone, Default, PartialEq)]
20220#[non_exhaustive]
20221pub struct GetDnsBindPermissionRequest {
20222    /// Required. The name of the resource which stores the users/service accounts
20223    /// having the permission to bind to the corresponding intranet VPC of the
20224    /// consumer project. DnsBindPermission is a global resource. Resource names
20225    /// are schemeless URIs that follow the conventions in
20226    /// <https://cloud.google.com/apis/design/resource_names>. For example:
20227    /// `projects/my-project/locations/global/dnsBindPermission`
20228    pub name: std::string::String,
20229
20230    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20231}
20232
20233impl GetDnsBindPermissionRequest {
20234    pub fn new() -> Self {
20235        std::default::Default::default()
20236    }
20237
20238    /// Sets the value of [name][crate::model::GetDnsBindPermissionRequest::name].
20239    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20240        self.name = v.into();
20241        self
20242    }
20243}
20244
20245impl wkt::message::Message for GetDnsBindPermissionRequest {
20246    fn typename() -> &'static str {
20247        "type.googleapis.com/google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest"
20248    }
20249}
20250
20251#[doc(hidden)]
20252impl<'de> serde::de::Deserialize<'de> for GetDnsBindPermissionRequest {
20253    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20254    where
20255        D: serde::Deserializer<'de>,
20256    {
20257        #[allow(non_camel_case_types)]
20258        #[doc(hidden)]
20259        #[derive(PartialEq, Eq, Hash)]
20260        enum __FieldTag {
20261            __name,
20262            Unknown(std::string::String),
20263        }
20264        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20265            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20266            where
20267                D: serde::Deserializer<'de>,
20268            {
20269                struct Visitor;
20270                impl<'de> serde::de::Visitor<'de> for Visitor {
20271                    type Value = __FieldTag;
20272                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20273                        formatter.write_str("a field name for GetDnsBindPermissionRequest")
20274                    }
20275                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20276                    where
20277                        E: serde::de::Error,
20278                    {
20279                        use std::result::Result::Ok;
20280                        use std::string::ToString;
20281                        match value {
20282                            "name" => Ok(__FieldTag::__name),
20283                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20284                        }
20285                    }
20286                }
20287                deserializer.deserialize_identifier(Visitor)
20288            }
20289        }
20290        struct Visitor;
20291        impl<'de> serde::de::Visitor<'de> for Visitor {
20292            type Value = GetDnsBindPermissionRequest;
20293            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20294                formatter.write_str("struct GetDnsBindPermissionRequest")
20295            }
20296            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20297            where
20298                A: serde::de::MapAccess<'de>,
20299            {
20300                #[allow(unused_imports)]
20301                use serde::de::Error;
20302                use std::option::Option::Some;
20303                let mut fields = std::collections::HashSet::new();
20304                let mut result = Self::Value::new();
20305                while let Some(tag) = map.next_key::<__FieldTag>()? {
20306                    #[allow(clippy::match_single_binding)]
20307                    match tag {
20308                        __FieldTag::__name => {
20309                            if !fields.insert(__FieldTag::__name) {
20310                                return std::result::Result::Err(A::Error::duplicate_field(
20311                                    "multiple values for name",
20312                                ));
20313                            }
20314                            result.name = map
20315                                .next_value::<std::option::Option<std::string::String>>()?
20316                                .unwrap_or_default();
20317                        }
20318                        __FieldTag::Unknown(key) => {
20319                            let value = map.next_value::<serde_json::Value>()?;
20320                            result._unknown_fields.insert(key, value);
20321                        }
20322                    }
20323                }
20324                std::result::Result::Ok(result)
20325            }
20326        }
20327        deserializer.deserialize_any(Visitor)
20328    }
20329}
20330
20331#[doc(hidden)]
20332impl serde::ser::Serialize for GetDnsBindPermissionRequest {
20333    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20334    where
20335        S: serde::ser::Serializer,
20336    {
20337        use serde::ser::SerializeMap;
20338        #[allow(unused_imports)]
20339        use std::option::Option::Some;
20340        let mut state = serializer.serialize_map(std::option::Option::None)?;
20341        if !self.name.is_empty() {
20342            state.serialize_entry("name", &self.name)?;
20343        }
20344        if !self._unknown_fields.is_empty() {
20345            for (key, value) in self._unknown_fields.iter() {
20346                state.serialize_entry(key, &value)?;
20347            }
20348        }
20349        state.end()
20350    }
20351}
20352
20353impl std::fmt::Debug for GetDnsBindPermissionRequest {
20354    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20355        let mut debug_struct = f.debug_struct("GetDnsBindPermissionRequest");
20356        debug_struct.field("name", &self.name);
20357        if !self._unknown_fields.is_empty() {
20358            debug_struct.field("_unknown_fields", &self._unknown_fields);
20359        }
20360        debug_struct.finish()
20361    }
20362}
20363
20364/// Network configuration in the consumer project
20365/// with which the peering has to be done.
20366#[derive(Clone, Default, PartialEq)]
20367#[non_exhaustive]
20368pub struct NetworkConfig {
20369    /// Required. Management CIDR used by VMware management appliances.
20370    pub management_cidr: std::string::String,
20371
20372    /// Optional. The relative resource name of the VMware Engine network attached
20373    /// to the private cloud. Specify the name in the following form:
20374    /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
20375    /// where `{project}` can either be a project number or a project ID.
20376    pub vmware_engine_network: std::string::String,
20377
20378    /// Output only. The canonical name of the VMware Engine network in the form:
20379    /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
20380    pub vmware_engine_network_canonical: std::string::String,
20381
20382    /// Output only. The IP address layout version of the management IP address
20383    /// range. Possible versions include:
20384    ///
20385    /// * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address
20386    ///   layout used by some existing private clouds. This is no longer supported
20387    ///   for new private clouds as it does not support all features.
20388    /// * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address
20389    ///   layout used by all newly created private clouds. This version supports all
20390    ///   current features.
20391    pub management_ip_address_layout_version: i32,
20392
20393    /// Output only. DNS Server IP of the Private Cloud.
20394    /// All DNS queries can be forwarded to this address for name resolution of
20395    /// Private Cloud's management entities like vCenter, NSX-T Manager and
20396    /// ESXi hosts.
20397    pub dns_server_ip: std::string::String,
20398
20399    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20400}
20401
20402impl NetworkConfig {
20403    pub fn new() -> Self {
20404        std::default::Default::default()
20405    }
20406
20407    /// Sets the value of [management_cidr][crate::model::NetworkConfig::management_cidr].
20408    pub fn set_management_cidr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20409        self.management_cidr = v.into();
20410        self
20411    }
20412
20413    /// Sets the value of [vmware_engine_network][crate::model::NetworkConfig::vmware_engine_network].
20414    pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
20415        mut self,
20416        v: T,
20417    ) -> Self {
20418        self.vmware_engine_network = v.into();
20419        self
20420    }
20421
20422    /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkConfig::vmware_engine_network_canonical].
20423    pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
20424        mut self,
20425        v: T,
20426    ) -> Self {
20427        self.vmware_engine_network_canonical = v.into();
20428        self
20429    }
20430
20431    /// Sets the value of [management_ip_address_layout_version][crate::model::NetworkConfig::management_ip_address_layout_version].
20432    pub fn set_management_ip_address_layout_version<T: std::convert::Into<i32>>(
20433        mut self,
20434        v: T,
20435    ) -> Self {
20436        self.management_ip_address_layout_version = v.into();
20437        self
20438    }
20439
20440    /// Sets the value of [dns_server_ip][crate::model::NetworkConfig::dns_server_ip].
20441    pub fn set_dns_server_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20442        self.dns_server_ip = v.into();
20443        self
20444    }
20445}
20446
20447impl wkt::message::Message for NetworkConfig {
20448    fn typename() -> &'static str {
20449        "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkConfig"
20450    }
20451}
20452
20453#[doc(hidden)]
20454impl<'de> serde::de::Deserialize<'de> for NetworkConfig {
20455    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20456    where
20457        D: serde::Deserializer<'de>,
20458    {
20459        #[allow(non_camel_case_types)]
20460        #[doc(hidden)]
20461        #[derive(PartialEq, Eq, Hash)]
20462        enum __FieldTag {
20463            __management_cidr,
20464            __vmware_engine_network,
20465            __vmware_engine_network_canonical,
20466            __management_ip_address_layout_version,
20467            __dns_server_ip,
20468            Unknown(std::string::String),
20469        }
20470        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20471            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20472            where
20473                D: serde::Deserializer<'de>,
20474            {
20475                struct Visitor;
20476                impl<'de> serde::de::Visitor<'de> for Visitor {
20477                    type Value = __FieldTag;
20478                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20479                        formatter.write_str("a field name for NetworkConfig")
20480                    }
20481                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20482                    where
20483                        E: serde::de::Error,
20484                    {
20485                        use std::result::Result::Ok;
20486                        use std::string::ToString;
20487                        match value {
20488                            "managementCidr" => Ok(__FieldTag::__management_cidr),
20489                            "management_cidr" => Ok(__FieldTag::__management_cidr),
20490                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
20491                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
20492                            "vmwareEngineNetworkCanonical" => {
20493                                Ok(__FieldTag::__vmware_engine_network_canonical)
20494                            }
20495                            "vmware_engine_network_canonical" => {
20496                                Ok(__FieldTag::__vmware_engine_network_canonical)
20497                            }
20498                            "managementIpAddressLayoutVersion" => {
20499                                Ok(__FieldTag::__management_ip_address_layout_version)
20500                            }
20501                            "management_ip_address_layout_version" => {
20502                                Ok(__FieldTag::__management_ip_address_layout_version)
20503                            }
20504                            "dnsServerIp" => Ok(__FieldTag::__dns_server_ip),
20505                            "dns_server_ip" => Ok(__FieldTag::__dns_server_ip),
20506                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20507                        }
20508                    }
20509                }
20510                deserializer.deserialize_identifier(Visitor)
20511            }
20512        }
20513        struct Visitor;
20514        impl<'de> serde::de::Visitor<'de> for Visitor {
20515            type Value = NetworkConfig;
20516            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20517                formatter.write_str("struct NetworkConfig")
20518            }
20519            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20520            where
20521                A: serde::de::MapAccess<'de>,
20522            {
20523                #[allow(unused_imports)]
20524                use serde::de::Error;
20525                use std::option::Option::Some;
20526                let mut fields = std::collections::HashSet::new();
20527                let mut result = Self::Value::new();
20528                while let Some(tag) = map.next_key::<__FieldTag>()? {
20529                    #[allow(clippy::match_single_binding)]
20530                    match tag {
20531                        __FieldTag::__management_cidr => {
20532                            if !fields.insert(__FieldTag::__management_cidr) {
20533                                return std::result::Result::Err(A::Error::duplicate_field(
20534                                    "multiple values for management_cidr",
20535                                ));
20536                            }
20537                            result.management_cidr = map
20538                                .next_value::<std::option::Option<std::string::String>>()?
20539                                .unwrap_or_default();
20540                        }
20541                        __FieldTag::__vmware_engine_network => {
20542                            if !fields.insert(__FieldTag::__vmware_engine_network) {
20543                                return std::result::Result::Err(A::Error::duplicate_field(
20544                                    "multiple values for vmware_engine_network",
20545                                ));
20546                            }
20547                            result.vmware_engine_network = map
20548                                .next_value::<std::option::Option<std::string::String>>()?
20549                                .unwrap_or_default();
20550                        }
20551                        __FieldTag::__vmware_engine_network_canonical => {
20552                            if !fields.insert(__FieldTag::__vmware_engine_network_canonical) {
20553                                return std::result::Result::Err(A::Error::duplicate_field(
20554                                    "multiple values for vmware_engine_network_canonical",
20555                                ));
20556                            }
20557                            result.vmware_engine_network_canonical = map
20558                                .next_value::<std::option::Option<std::string::String>>()?
20559                                .unwrap_or_default();
20560                        }
20561                        __FieldTag::__management_ip_address_layout_version => {
20562                            if !fields.insert(__FieldTag::__management_ip_address_layout_version) {
20563                                return std::result::Result::Err(A::Error::duplicate_field(
20564                                    "multiple values for management_ip_address_layout_version",
20565                                ));
20566                            }
20567                            struct __With(std::option::Option<i32>);
20568                            impl<'de> serde::de::Deserialize<'de> for __With {
20569                                fn deserialize<D>(
20570                                    deserializer: D,
20571                                ) -> std::result::Result<Self, D::Error>
20572                                where
20573                                    D: serde::de::Deserializer<'de>,
20574                                {
20575                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20576                                }
20577                            }
20578                            result.management_ip_address_layout_version =
20579                                map.next_value::<__With>()?.0.unwrap_or_default();
20580                        }
20581                        __FieldTag::__dns_server_ip => {
20582                            if !fields.insert(__FieldTag::__dns_server_ip) {
20583                                return std::result::Result::Err(A::Error::duplicate_field(
20584                                    "multiple values for dns_server_ip",
20585                                ));
20586                            }
20587                            result.dns_server_ip = map
20588                                .next_value::<std::option::Option<std::string::String>>()?
20589                                .unwrap_or_default();
20590                        }
20591                        __FieldTag::Unknown(key) => {
20592                            let value = map.next_value::<serde_json::Value>()?;
20593                            result._unknown_fields.insert(key, value);
20594                        }
20595                    }
20596                }
20597                std::result::Result::Ok(result)
20598            }
20599        }
20600        deserializer.deserialize_any(Visitor)
20601    }
20602}
20603
20604#[doc(hidden)]
20605impl serde::ser::Serialize for NetworkConfig {
20606    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20607    where
20608        S: serde::ser::Serializer,
20609    {
20610        use serde::ser::SerializeMap;
20611        #[allow(unused_imports)]
20612        use std::option::Option::Some;
20613        let mut state = serializer.serialize_map(std::option::Option::None)?;
20614        if !self.management_cidr.is_empty() {
20615            state.serialize_entry("managementCidr", &self.management_cidr)?;
20616        }
20617        if !self.vmware_engine_network.is_empty() {
20618            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
20619        }
20620        if !self.vmware_engine_network_canonical.is_empty() {
20621            state.serialize_entry(
20622                "vmwareEngineNetworkCanonical",
20623                &self.vmware_engine_network_canonical,
20624            )?;
20625        }
20626        if !wkt::internal::is_default(&self.management_ip_address_layout_version) {
20627            struct __With<'a>(&'a i32);
20628            impl<'a> serde::ser::Serialize for __With<'a> {
20629                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20630                where
20631                    S: serde::ser::Serializer,
20632                {
20633                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20634                }
20635            }
20636            state.serialize_entry(
20637                "managementIpAddressLayoutVersion",
20638                &__With(&self.management_ip_address_layout_version),
20639            )?;
20640        }
20641        if !self.dns_server_ip.is_empty() {
20642            state.serialize_entry("dnsServerIp", &self.dns_server_ip)?;
20643        }
20644        if !self._unknown_fields.is_empty() {
20645            for (key, value) in self._unknown_fields.iter() {
20646                state.serialize_entry(key, &value)?;
20647            }
20648        }
20649        state.end()
20650    }
20651}
20652
20653impl std::fmt::Debug for NetworkConfig {
20654    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20655        let mut debug_struct = f.debug_struct("NetworkConfig");
20656        debug_struct.field("management_cidr", &self.management_cidr);
20657        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
20658        debug_struct.field(
20659            "vmware_engine_network_canonical",
20660            &self.vmware_engine_network_canonical,
20661        );
20662        debug_struct.field(
20663            "management_ip_address_layout_version",
20664            &self.management_ip_address_layout_version,
20665        );
20666        debug_struct.field("dns_server_ip", &self.dns_server_ip);
20667        if !self._unknown_fields.is_empty() {
20668            debug_struct.field("_unknown_fields", &self._unknown_fields);
20669        }
20670        debug_struct.finish()
20671    }
20672}
20673
20674/// Information about the type and number of nodes associated with the cluster.
20675#[derive(Clone, Default, PartialEq)]
20676#[non_exhaustive]
20677pub struct NodeTypeConfig {
20678    /// Required. The number of nodes of this type in the cluster
20679    pub node_count: i32,
20680
20681    /// Optional. Customized number of cores available to each node of the type.
20682    /// This number must always be one of `nodeType.availableCustomCoreCounts`.
20683    /// If zero is provided max value from `nodeType.availableCustomCoreCounts`
20684    /// will be used.
20685    pub custom_core_count: i32,
20686
20687    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20688}
20689
20690impl NodeTypeConfig {
20691    pub fn new() -> Self {
20692        std::default::Default::default()
20693    }
20694
20695    /// Sets the value of [node_count][crate::model::NodeTypeConfig::node_count].
20696    pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20697        self.node_count = v.into();
20698        self
20699    }
20700
20701    /// Sets the value of [custom_core_count][crate::model::NodeTypeConfig::custom_core_count].
20702    pub fn set_custom_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20703        self.custom_core_count = v.into();
20704        self
20705    }
20706}
20707
20708impl wkt::message::Message for NodeTypeConfig {
20709    fn typename() -> &'static str {
20710        "type.googleapis.com/google.cloud.vmwareengine.v1.NodeTypeConfig"
20711    }
20712}
20713
20714#[doc(hidden)]
20715impl<'de> serde::de::Deserialize<'de> for NodeTypeConfig {
20716    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20717    where
20718        D: serde::Deserializer<'de>,
20719    {
20720        #[allow(non_camel_case_types)]
20721        #[doc(hidden)]
20722        #[derive(PartialEq, Eq, Hash)]
20723        enum __FieldTag {
20724            __node_count,
20725            __custom_core_count,
20726            Unknown(std::string::String),
20727        }
20728        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20729            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20730            where
20731                D: serde::Deserializer<'de>,
20732            {
20733                struct Visitor;
20734                impl<'de> serde::de::Visitor<'de> for Visitor {
20735                    type Value = __FieldTag;
20736                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20737                        formatter.write_str("a field name for NodeTypeConfig")
20738                    }
20739                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20740                    where
20741                        E: serde::de::Error,
20742                    {
20743                        use std::result::Result::Ok;
20744                        use std::string::ToString;
20745                        match value {
20746                            "nodeCount" => Ok(__FieldTag::__node_count),
20747                            "node_count" => Ok(__FieldTag::__node_count),
20748                            "customCoreCount" => Ok(__FieldTag::__custom_core_count),
20749                            "custom_core_count" => Ok(__FieldTag::__custom_core_count),
20750                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20751                        }
20752                    }
20753                }
20754                deserializer.deserialize_identifier(Visitor)
20755            }
20756        }
20757        struct Visitor;
20758        impl<'de> serde::de::Visitor<'de> for Visitor {
20759            type Value = NodeTypeConfig;
20760            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20761                formatter.write_str("struct NodeTypeConfig")
20762            }
20763            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20764            where
20765                A: serde::de::MapAccess<'de>,
20766            {
20767                #[allow(unused_imports)]
20768                use serde::de::Error;
20769                use std::option::Option::Some;
20770                let mut fields = std::collections::HashSet::new();
20771                let mut result = Self::Value::new();
20772                while let Some(tag) = map.next_key::<__FieldTag>()? {
20773                    #[allow(clippy::match_single_binding)]
20774                    match tag {
20775                        __FieldTag::__node_count => {
20776                            if !fields.insert(__FieldTag::__node_count) {
20777                                return std::result::Result::Err(A::Error::duplicate_field(
20778                                    "multiple values for node_count",
20779                                ));
20780                            }
20781                            struct __With(std::option::Option<i32>);
20782                            impl<'de> serde::de::Deserialize<'de> for __With {
20783                                fn deserialize<D>(
20784                                    deserializer: D,
20785                                ) -> std::result::Result<Self, D::Error>
20786                                where
20787                                    D: serde::de::Deserializer<'de>,
20788                                {
20789                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20790                                }
20791                            }
20792                            result.node_count = map.next_value::<__With>()?.0.unwrap_or_default();
20793                        }
20794                        __FieldTag::__custom_core_count => {
20795                            if !fields.insert(__FieldTag::__custom_core_count) {
20796                                return std::result::Result::Err(A::Error::duplicate_field(
20797                                    "multiple values for custom_core_count",
20798                                ));
20799                            }
20800                            struct __With(std::option::Option<i32>);
20801                            impl<'de> serde::de::Deserialize<'de> for __With {
20802                                fn deserialize<D>(
20803                                    deserializer: D,
20804                                ) -> std::result::Result<Self, D::Error>
20805                                where
20806                                    D: serde::de::Deserializer<'de>,
20807                                {
20808                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20809                                }
20810                            }
20811                            result.custom_core_count =
20812                                map.next_value::<__With>()?.0.unwrap_or_default();
20813                        }
20814                        __FieldTag::Unknown(key) => {
20815                            let value = map.next_value::<serde_json::Value>()?;
20816                            result._unknown_fields.insert(key, value);
20817                        }
20818                    }
20819                }
20820                std::result::Result::Ok(result)
20821            }
20822        }
20823        deserializer.deserialize_any(Visitor)
20824    }
20825}
20826
20827#[doc(hidden)]
20828impl serde::ser::Serialize for NodeTypeConfig {
20829    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20830    where
20831        S: serde::ser::Serializer,
20832    {
20833        use serde::ser::SerializeMap;
20834        #[allow(unused_imports)]
20835        use std::option::Option::Some;
20836        let mut state = serializer.serialize_map(std::option::Option::None)?;
20837        if !wkt::internal::is_default(&self.node_count) {
20838            struct __With<'a>(&'a i32);
20839            impl<'a> serde::ser::Serialize for __With<'a> {
20840                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20841                where
20842                    S: serde::ser::Serializer,
20843                {
20844                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20845                }
20846            }
20847            state.serialize_entry("nodeCount", &__With(&self.node_count))?;
20848        }
20849        if !wkt::internal::is_default(&self.custom_core_count) {
20850            struct __With<'a>(&'a i32);
20851            impl<'a> serde::ser::Serialize for __With<'a> {
20852                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20853                where
20854                    S: serde::ser::Serializer,
20855                {
20856                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20857                }
20858            }
20859            state.serialize_entry("customCoreCount", &__With(&self.custom_core_count))?;
20860        }
20861        if !self._unknown_fields.is_empty() {
20862            for (key, value) in self._unknown_fields.iter() {
20863                state.serialize_entry(key, &value)?;
20864            }
20865        }
20866        state.end()
20867    }
20868}
20869
20870impl std::fmt::Debug for NodeTypeConfig {
20871    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20872        let mut debug_struct = f.debug_struct("NodeTypeConfig");
20873        debug_struct.field("node_count", &self.node_count);
20874        debug_struct.field("custom_core_count", &self.custom_core_count);
20875        if !self._unknown_fields.is_empty() {
20876            debug_struct.field("_unknown_fields", &self._unknown_fields);
20877        }
20878        debug_struct.finish()
20879    }
20880}
20881
20882/// Configuration of a stretched cluster.
20883#[derive(Clone, Default, PartialEq)]
20884#[non_exhaustive]
20885pub struct StretchedClusterConfig {
20886    /// Required. Zone that will remain operational when connection between the two
20887    /// zones is lost. Specify the resource name of a zone that belongs to the
20888    /// region of the private cloud. For example:
20889    /// `projects/{project}/locations/europe-west3-a` where `{project}` can either
20890    /// be a project number or a project ID.
20891    pub preferred_location: std::string::String,
20892
20893    /// Required. Additional zone for a higher level of availability and load
20894    /// balancing. Specify the resource name of a zone that belongs to the region
20895    /// of the private cloud. For example:
20896    /// `projects/{project}/locations/europe-west3-b` where `{project}` can either
20897    /// be a project number or a project ID.
20898    pub secondary_location: std::string::String,
20899
20900    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20901}
20902
20903impl StretchedClusterConfig {
20904    pub fn new() -> Self {
20905        std::default::Default::default()
20906    }
20907
20908    /// Sets the value of [preferred_location][crate::model::StretchedClusterConfig::preferred_location].
20909    pub fn set_preferred_location<T: std::convert::Into<std::string::String>>(
20910        mut self,
20911        v: T,
20912    ) -> Self {
20913        self.preferred_location = v.into();
20914        self
20915    }
20916
20917    /// Sets the value of [secondary_location][crate::model::StretchedClusterConfig::secondary_location].
20918    pub fn set_secondary_location<T: std::convert::Into<std::string::String>>(
20919        mut self,
20920        v: T,
20921    ) -> Self {
20922        self.secondary_location = v.into();
20923        self
20924    }
20925}
20926
20927impl wkt::message::Message for StretchedClusterConfig {
20928    fn typename() -> &'static str {
20929        "type.googleapis.com/google.cloud.vmwareengine.v1.StretchedClusterConfig"
20930    }
20931}
20932
20933#[doc(hidden)]
20934impl<'de> serde::de::Deserialize<'de> for StretchedClusterConfig {
20935    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20936    where
20937        D: serde::Deserializer<'de>,
20938    {
20939        #[allow(non_camel_case_types)]
20940        #[doc(hidden)]
20941        #[derive(PartialEq, Eq, Hash)]
20942        enum __FieldTag {
20943            __preferred_location,
20944            __secondary_location,
20945            Unknown(std::string::String),
20946        }
20947        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20948            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20949            where
20950                D: serde::Deserializer<'de>,
20951            {
20952                struct Visitor;
20953                impl<'de> serde::de::Visitor<'de> for Visitor {
20954                    type Value = __FieldTag;
20955                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20956                        formatter.write_str("a field name for StretchedClusterConfig")
20957                    }
20958                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20959                    where
20960                        E: serde::de::Error,
20961                    {
20962                        use std::result::Result::Ok;
20963                        use std::string::ToString;
20964                        match value {
20965                            "preferredLocation" => Ok(__FieldTag::__preferred_location),
20966                            "preferred_location" => Ok(__FieldTag::__preferred_location),
20967                            "secondaryLocation" => Ok(__FieldTag::__secondary_location),
20968                            "secondary_location" => Ok(__FieldTag::__secondary_location),
20969                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20970                        }
20971                    }
20972                }
20973                deserializer.deserialize_identifier(Visitor)
20974            }
20975        }
20976        struct Visitor;
20977        impl<'de> serde::de::Visitor<'de> for Visitor {
20978            type Value = StretchedClusterConfig;
20979            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20980                formatter.write_str("struct StretchedClusterConfig")
20981            }
20982            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20983            where
20984                A: serde::de::MapAccess<'de>,
20985            {
20986                #[allow(unused_imports)]
20987                use serde::de::Error;
20988                use std::option::Option::Some;
20989                let mut fields = std::collections::HashSet::new();
20990                let mut result = Self::Value::new();
20991                while let Some(tag) = map.next_key::<__FieldTag>()? {
20992                    #[allow(clippy::match_single_binding)]
20993                    match tag {
20994                        __FieldTag::__preferred_location => {
20995                            if !fields.insert(__FieldTag::__preferred_location) {
20996                                return std::result::Result::Err(A::Error::duplicate_field(
20997                                    "multiple values for preferred_location",
20998                                ));
20999                            }
21000                            result.preferred_location = map
21001                                .next_value::<std::option::Option<std::string::String>>()?
21002                                .unwrap_or_default();
21003                        }
21004                        __FieldTag::__secondary_location => {
21005                            if !fields.insert(__FieldTag::__secondary_location) {
21006                                return std::result::Result::Err(A::Error::duplicate_field(
21007                                    "multiple values for secondary_location",
21008                                ));
21009                            }
21010                            result.secondary_location = map
21011                                .next_value::<std::option::Option<std::string::String>>()?
21012                                .unwrap_or_default();
21013                        }
21014                        __FieldTag::Unknown(key) => {
21015                            let value = map.next_value::<serde_json::Value>()?;
21016                            result._unknown_fields.insert(key, value);
21017                        }
21018                    }
21019                }
21020                std::result::Result::Ok(result)
21021            }
21022        }
21023        deserializer.deserialize_any(Visitor)
21024    }
21025}
21026
21027#[doc(hidden)]
21028impl serde::ser::Serialize for StretchedClusterConfig {
21029    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21030    where
21031        S: serde::ser::Serializer,
21032    {
21033        use serde::ser::SerializeMap;
21034        #[allow(unused_imports)]
21035        use std::option::Option::Some;
21036        let mut state = serializer.serialize_map(std::option::Option::None)?;
21037        if !self.preferred_location.is_empty() {
21038            state.serialize_entry("preferredLocation", &self.preferred_location)?;
21039        }
21040        if !self.secondary_location.is_empty() {
21041            state.serialize_entry("secondaryLocation", &self.secondary_location)?;
21042        }
21043        if !self._unknown_fields.is_empty() {
21044            for (key, value) in self._unknown_fields.iter() {
21045                state.serialize_entry(key, &value)?;
21046            }
21047        }
21048        state.end()
21049    }
21050}
21051
21052impl std::fmt::Debug for StretchedClusterConfig {
21053    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21054        let mut debug_struct = f.debug_struct("StretchedClusterConfig");
21055        debug_struct.field("preferred_location", &self.preferred_location);
21056        debug_struct.field("secondary_location", &self.secondary_location);
21057        if !self._unknown_fields.is_empty() {
21058            debug_struct.field("_unknown_fields", &self._unknown_fields);
21059        }
21060        debug_struct.finish()
21061    }
21062}
21063
21064/// Represents a private cloud resource. Private clouds of type `STANDARD` and
21065/// `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are
21066/// regional.
21067#[derive(Clone, Default, PartialEq)]
21068#[non_exhaustive]
21069pub struct PrivateCloud {
21070    /// Output only. The resource name of this private cloud.
21071    /// Resource names are schemeless URIs that follow the conventions in
21072    /// <https://cloud.google.com/apis/design/resource_names>.
21073    /// For example:
21074    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
21075    pub name: std::string::String,
21076
21077    /// Output only. Creation time of this resource.
21078    pub create_time: std::option::Option<wkt::Timestamp>,
21079
21080    /// Output only. Last update time of this resource.
21081    pub update_time: std::option::Option<wkt::Timestamp>,
21082
21083    /// Output only. Time when the resource was scheduled for deletion.
21084    pub delete_time: std::option::Option<wkt::Timestamp>,
21085
21086    /// Output only. Time when the resource will be irreversibly deleted.
21087    pub expire_time: std::option::Option<wkt::Timestamp>,
21088
21089    /// Output only. State of the resource. New values may be added to this enum
21090    /// when appropriate.
21091    pub state: crate::model::private_cloud::State,
21092
21093    /// Required. Network configuration of the private cloud.
21094    pub network_config: std::option::Option<crate::model::NetworkConfig>,
21095
21096    /// Required. Input only. The management cluster for this private cloud.
21097    /// This field is required during creation of the private cloud to provide
21098    /// details for the default cluster.
21099    ///
21100    /// The following fields can't be changed after private cloud creation:
21101    /// `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.
21102    pub management_cluster: std::option::Option<crate::model::private_cloud::ManagementCluster>,
21103
21104    /// User-provided description for this private cloud.
21105    pub description: std::string::String,
21106
21107    /// Output only. HCX appliance.
21108    pub hcx: std::option::Option<crate::model::Hcx>,
21109
21110    /// Output only. NSX appliance.
21111    pub nsx: std::option::Option<crate::model::Nsx>,
21112
21113    /// Output only. Vcenter appliance.
21114    pub vcenter: std::option::Option<crate::model::Vcenter>,
21115
21116    /// Output only. System-generated unique identifier for the resource.
21117    pub uid: std::string::String,
21118
21119    /// Optional. Type of the private cloud. Defaults to STANDARD.
21120    pub r#type: crate::model::private_cloud::Type,
21121
21122    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21123}
21124
21125impl PrivateCloud {
21126    pub fn new() -> Self {
21127        std::default::Default::default()
21128    }
21129
21130    /// Sets the value of [name][crate::model::PrivateCloud::name].
21131    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21132        self.name = v.into();
21133        self
21134    }
21135
21136    /// Sets the value of [create_time][crate::model::PrivateCloud::create_time].
21137    pub fn set_create_time<T>(mut self, v: T) -> Self
21138    where
21139        T: std::convert::Into<wkt::Timestamp>,
21140    {
21141        self.create_time = std::option::Option::Some(v.into());
21142        self
21143    }
21144
21145    /// Sets or clears the value of [create_time][crate::model::PrivateCloud::create_time].
21146    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21147    where
21148        T: std::convert::Into<wkt::Timestamp>,
21149    {
21150        self.create_time = v.map(|x| x.into());
21151        self
21152    }
21153
21154    /// Sets the value of [update_time][crate::model::PrivateCloud::update_time].
21155    pub fn set_update_time<T>(mut self, v: T) -> Self
21156    where
21157        T: std::convert::Into<wkt::Timestamp>,
21158    {
21159        self.update_time = std::option::Option::Some(v.into());
21160        self
21161    }
21162
21163    /// Sets or clears the value of [update_time][crate::model::PrivateCloud::update_time].
21164    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
21165    where
21166        T: std::convert::Into<wkt::Timestamp>,
21167    {
21168        self.update_time = v.map(|x| x.into());
21169        self
21170    }
21171
21172    /// Sets the value of [delete_time][crate::model::PrivateCloud::delete_time].
21173    pub fn set_delete_time<T>(mut self, v: T) -> Self
21174    where
21175        T: std::convert::Into<wkt::Timestamp>,
21176    {
21177        self.delete_time = std::option::Option::Some(v.into());
21178        self
21179    }
21180
21181    /// Sets or clears the value of [delete_time][crate::model::PrivateCloud::delete_time].
21182    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
21183    where
21184        T: std::convert::Into<wkt::Timestamp>,
21185    {
21186        self.delete_time = v.map(|x| x.into());
21187        self
21188    }
21189
21190    /// Sets the value of [expire_time][crate::model::PrivateCloud::expire_time].
21191    pub fn set_expire_time<T>(mut self, v: T) -> Self
21192    where
21193        T: std::convert::Into<wkt::Timestamp>,
21194    {
21195        self.expire_time = std::option::Option::Some(v.into());
21196        self
21197    }
21198
21199    /// Sets or clears the value of [expire_time][crate::model::PrivateCloud::expire_time].
21200    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
21201    where
21202        T: std::convert::Into<wkt::Timestamp>,
21203    {
21204        self.expire_time = v.map(|x| x.into());
21205        self
21206    }
21207
21208    /// Sets the value of [state][crate::model::PrivateCloud::state].
21209    pub fn set_state<T: std::convert::Into<crate::model::private_cloud::State>>(
21210        mut self,
21211        v: T,
21212    ) -> Self {
21213        self.state = v.into();
21214        self
21215    }
21216
21217    /// Sets the value of [network_config][crate::model::PrivateCloud::network_config].
21218    pub fn set_network_config<T>(mut self, v: T) -> Self
21219    where
21220        T: std::convert::Into<crate::model::NetworkConfig>,
21221    {
21222        self.network_config = std::option::Option::Some(v.into());
21223        self
21224    }
21225
21226    /// Sets or clears the value of [network_config][crate::model::PrivateCloud::network_config].
21227    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
21228    where
21229        T: std::convert::Into<crate::model::NetworkConfig>,
21230    {
21231        self.network_config = v.map(|x| x.into());
21232        self
21233    }
21234
21235    /// Sets the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
21236    pub fn set_management_cluster<T>(mut self, v: T) -> Self
21237    where
21238        T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
21239    {
21240        self.management_cluster = std::option::Option::Some(v.into());
21241        self
21242    }
21243
21244    /// Sets or clears the value of [management_cluster][crate::model::PrivateCloud::management_cluster].
21245    pub fn set_or_clear_management_cluster<T>(mut self, v: std::option::Option<T>) -> Self
21246    where
21247        T: std::convert::Into<crate::model::private_cloud::ManagementCluster>,
21248    {
21249        self.management_cluster = v.map(|x| x.into());
21250        self
21251    }
21252
21253    /// Sets the value of [description][crate::model::PrivateCloud::description].
21254    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21255        self.description = v.into();
21256        self
21257    }
21258
21259    /// Sets the value of [hcx][crate::model::PrivateCloud::hcx].
21260    pub fn set_hcx<T>(mut self, v: T) -> Self
21261    where
21262        T: std::convert::Into<crate::model::Hcx>,
21263    {
21264        self.hcx = std::option::Option::Some(v.into());
21265        self
21266    }
21267
21268    /// Sets or clears the value of [hcx][crate::model::PrivateCloud::hcx].
21269    pub fn set_or_clear_hcx<T>(mut self, v: std::option::Option<T>) -> Self
21270    where
21271        T: std::convert::Into<crate::model::Hcx>,
21272    {
21273        self.hcx = v.map(|x| x.into());
21274        self
21275    }
21276
21277    /// Sets the value of [nsx][crate::model::PrivateCloud::nsx].
21278    pub fn set_nsx<T>(mut self, v: T) -> Self
21279    where
21280        T: std::convert::Into<crate::model::Nsx>,
21281    {
21282        self.nsx = std::option::Option::Some(v.into());
21283        self
21284    }
21285
21286    /// Sets or clears the value of [nsx][crate::model::PrivateCloud::nsx].
21287    pub fn set_or_clear_nsx<T>(mut self, v: std::option::Option<T>) -> Self
21288    where
21289        T: std::convert::Into<crate::model::Nsx>,
21290    {
21291        self.nsx = v.map(|x| x.into());
21292        self
21293    }
21294
21295    /// Sets the value of [vcenter][crate::model::PrivateCloud::vcenter].
21296    pub fn set_vcenter<T>(mut self, v: T) -> Self
21297    where
21298        T: std::convert::Into<crate::model::Vcenter>,
21299    {
21300        self.vcenter = std::option::Option::Some(v.into());
21301        self
21302    }
21303
21304    /// Sets or clears the value of [vcenter][crate::model::PrivateCloud::vcenter].
21305    pub fn set_or_clear_vcenter<T>(mut self, v: std::option::Option<T>) -> Self
21306    where
21307        T: std::convert::Into<crate::model::Vcenter>,
21308    {
21309        self.vcenter = v.map(|x| x.into());
21310        self
21311    }
21312
21313    /// Sets the value of [uid][crate::model::PrivateCloud::uid].
21314    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21315        self.uid = v.into();
21316        self
21317    }
21318
21319    /// Sets the value of [r#type][crate::model::PrivateCloud::type].
21320    pub fn set_type<T: std::convert::Into<crate::model::private_cloud::Type>>(
21321        mut self,
21322        v: T,
21323    ) -> Self {
21324        self.r#type = v.into();
21325        self
21326    }
21327}
21328
21329impl wkt::message::Message for PrivateCloud {
21330    fn typename() -> &'static str {
21331        "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud"
21332    }
21333}
21334
21335#[doc(hidden)]
21336impl<'de> serde::de::Deserialize<'de> for PrivateCloud {
21337    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21338    where
21339        D: serde::Deserializer<'de>,
21340    {
21341        #[allow(non_camel_case_types)]
21342        #[doc(hidden)]
21343        #[derive(PartialEq, Eq, Hash)]
21344        enum __FieldTag {
21345            __name,
21346            __create_time,
21347            __update_time,
21348            __delete_time,
21349            __expire_time,
21350            __state,
21351            __network_config,
21352            __management_cluster,
21353            __description,
21354            __hcx,
21355            __nsx,
21356            __vcenter,
21357            __uid,
21358            __type,
21359            Unknown(std::string::String),
21360        }
21361        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21362            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21363            where
21364                D: serde::Deserializer<'de>,
21365            {
21366                struct Visitor;
21367                impl<'de> serde::de::Visitor<'de> for Visitor {
21368                    type Value = __FieldTag;
21369                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21370                        formatter.write_str("a field name for PrivateCloud")
21371                    }
21372                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21373                    where
21374                        E: serde::de::Error,
21375                    {
21376                        use std::result::Result::Ok;
21377                        use std::string::ToString;
21378                        match value {
21379                            "name" => Ok(__FieldTag::__name),
21380                            "createTime" => Ok(__FieldTag::__create_time),
21381                            "create_time" => Ok(__FieldTag::__create_time),
21382                            "updateTime" => Ok(__FieldTag::__update_time),
21383                            "update_time" => Ok(__FieldTag::__update_time),
21384                            "deleteTime" => Ok(__FieldTag::__delete_time),
21385                            "delete_time" => Ok(__FieldTag::__delete_time),
21386                            "expireTime" => Ok(__FieldTag::__expire_time),
21387                            "expire_time" => Ok(__FieldTag::__expire_time),
21388                            "state" => Ok(__FieldTag::__state),
21389                            "networkConfig" => Ok(__FieldTag::__network_config),
21390                            "network_config" => Ok(__FieldTag::__network_config),
21391                            "managementCluster" => Ok(__FieldTag::__management_cluster),
21392                            "management_cluster" => Ok(__FieldTag::__management_cluster),
21393                            "description" => Ok(__FieldTag::__description),
21394                            "hcx" => Ok(__FieldTag::__hcx),
21395                            "nsx" => Ok(__FieldTag::__nsx),
21396                            "vcenter" => Ok(__FieldTag::__vcenter),
21397                            "uid" => Ok(__FieldTag::__uid),
21398                            "type" => Ok(__FieldTag::__type),
21399                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21400                        }
21401                    }
21402                }
21403                deserializer.deserialize_identifier(Visitor)
21404            }
21405        }
21406        struct Visitor;
21407        impl<'de> serde::de::Visitor<'de> for Visitor {
21408            type Value = PrivateCloud;
21409            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21410                formatter.write_str("struct PrivateCloud")
21411            }
21412            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21413            where
21414                A: serde::de::MapAccess<'de>,
21415            {
21416                #[allow(unused_imports)]
21417                use serde::de::Error;
21418                use std::option::Option::Some;
21419                let mut fields = std::collections::HashSet::new();
21420                let mut result = Self::Value::new();
21421                while let Some(tag) = map.next_key::<__FieldTag>()? {
21422                    #[allow(clippy::match_single_binding)]
21423                    match tag {
21424                        __FieldTag::__name => {
21425                            if !fields.insert(__FieldTag::__name) {
21426                                return std::result::Result::Err(A::Error::duplicate_field(
21427                                    "multiple values for name",
21428                                ));
21429                            }
21430                            result.name = map
21431                                .next_value::<std::option::Option<std::string::String>>()?
21432                                .unwrap_or_default();
21433                        }
21434                        __FieldTag::__create_time => {
21435                            if !fields.insert(__FieldTag::__create_time) {
21436                                return std::result::Result::Err(A::Error::duplicate_field(
21437                                    "multiple values for create_time",
21438                                ));
21439                            }
21440                            result.create_time =
21441                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
21442                        }
21443                        __FieldTag::__update_time => {
21444                            if !fields.insert(__FieldTag::__update_time) {
21445                                return std::result::Result::Err(A::Error::duplicate_field(
21446                                    "multiple values for update_time",
21447                                ));
21448                            }
21449                            result.update_time =
21450                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
21451                        }
21452                        __FieldTag::__delete_time => {
21453                            if !fields.insert(__FieldTag::__delete_time) {
21454                                return std::result::Result::Err(A::Error::duplicate_field(
21455                                    "multiple values for delete_time",
21456                                ));
21457                            }
21458                            result.delete_time =
21459                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
21460                        }
21461                        __FieldTag::__expire_time => {
21462                            if !fields.insert(__FieldTag::__expire_time) {
21463                                return std::result::Result::Err(A::Error::duplicate_field(
21464                                    "multiple values for expire_time",
21465                                ));
21466                            }
21467                            result.expire_time =
21468                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
21469                        }
21470                        __FieldTag::__state => {
21471                            if !fields.insert(__FieldTag::__state) {
21472                                return std::result::Result::Err(A::Error::duplicate_field(
21473                                    "multiple values for state",
21474                                ));
21475                            }
21476                            result.state = map.next_value::<std::option::Option<crate::model::private_cloud::State>>()?.unwrap_or_default();
21477                        }
21478                        __FieldTag::__network_config => {
21479                            if !fields.insert(__FieldTag::__network_config) {
21480                                return std::result::Result::Err(A::Error::duplicate_field(
21481                                    "multiple values for network_config",
21482                                ));
21483                            }
21484                            result.network_config = map
21485                                .next_value::<std::option::Option<crate::model::NetworkConfig>>()?;
21486                        }
21487                        __FieldTag::__management_cluster => {
21488                            if !fields.insert(__FieldTag::__management_cluster) {
21489                                return std::result::Result::Err(A::Error::duplicate_field(
21490                                    "multiple values for management_cluster",
21491                                ));
21492                            }
21493                            result.management_cluster = map.next_value::<std::option::Option<
21494                                crate::model::private_cloud::ManagementCluster,
21495                            >>()?;
21496                        }
21497                        __FieldTag::__description => {
21498                            if !fields.insert(__FieldTag::__description) {
21499                                return std::result::Result::Err(A::Error::duplicate_field(
21500                                    "multiple values for description",
21501                                ));
21502                            }
21503                            result.description = map
21504                                .next_value::<std::option::Option<std::string::String>>()?
21505                                .unwrap_or_default();
21506                        }
21507                        __FieldTag::__hcx => {
21508                            if !fields.insert(__FieldTag::__hcx) {
21509                                return std::result::Result::Err(A::Error::duplicate_field(
21510                                    "multiple values for hcx",
21511                                ));
21512                            }
21513                            result.hcx =
21514                                map.next_value::<std::option::Option<crate::model::Hcx>>()?;
21515                        }
21516                        __FieldTag::__nsx => {
21517                            if !fields.insert(__FieldTag::__nsx) {
21518                                return std::result::Result::Err(A::Error::duplicate_field(
21519                                    "multiple values for nsx",
21520                                ));
21521                            }
21522                            result.nsx =
21523                                map.next_value::<std::option::Option<crate::model::Nsx>>()?;
21524                        }
21525                        __FieldTag::__vcenter => {
21526                            if !fields.insert(__FieldTag::__vcenter) {
21527                                return std::result::Result::Err(A::Error::duplicate_field(
21528                                    "multiple values for vcenter",
21529                                ));
21530                            }
21531                            result.vcenter =
21532                                map.next_value::<std::option::Option<crate::model::Vcenter>>()?;
21533                        }
21534                        __FieldTag::__uid => {
21535                            if !fields.insert(__FieldTag::__uid) {
21536                                return std::result::Result::Err(A::Error::duplicate_field(
21537                                    "multiple values for uid",
21538                                ));
21539                            }
21540                            result.uid = map
21541                                .next_value::<std::option::Option<std::string::String>>()?
21542                                .unwrap_or_default();
21543                        }
21544                        __FieldTag::__type => {
21545                            if !fields.insert(__FieldTag::__type) {
21546                                return std::result::Result::Err(A::Error::duplicate_field(
21547                                    "multiple values for type",
21548                                ));
21549                            }
21550                            result.r#type = map.next_value::<std::option::Option<crate::model::private_cloud::Type>>()?.unwrap_or_default();
21551                        }
21552                        __FieldTag::Unknown(key) => {
21553                            let value = map.next_value::<serde_json::Value>()?;
21554                            result._unknown_fields.insert(key, value);
21555                        }
21556                    }
21557                }
21558                std::result::Result::Ok(result)
21559            }
21560        }
21561        deserializer.deserialize_any(Visitor)
21562    }
21563}
21564
21565#[doc(hidden)]
21566impl serde::ser::Serialize for PrivateCloud {
21567    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21568    where
21569        S: serde::ser::Serializer,
21570    {
21571        use serde::ser::SerializeMap;
21572        #[allow(unused_imports)]
21573        use std::option::Option::Some;
21574        let mut state = serializer.serialize_map(std::option::Option::None)?;
21575        if !self.name.is_empty() {
21576            state.serialize_entry("name", &self.name)?;
21577        }
21578        if self.create_time.is_some() {
21579            state.serialize_entry("createTime", &self.create_time)?;
21580        }
21581        if self.update_time.is_some() {
21582            state.serialize_entry("updateTime", &self.update_time)?;
21583        }
21584        if self.delete_time.is_some() {
21585            state.serialize_entry("deleteTime", &self.delete_time)?;
21586        }
21587        if self.expire_time.is_some() {
21588            state.serialize_entry("expireTime", &self.expire_time)?;
21589        }
21590        if !wkt::internal::is_default(&self.state) {
21591            state.serialize_entry("state", &self.state)?;
21592        }
21593        if self.network_config.is_some() {
21594            state.serialize_entry("networkConfig", &self.network_config)?;
21595        }
21596        if self.management_cluster.is_some() {
21597            state.serialize_entry("managementCluster", &self.management_cluster)?;
21598        }
21599        if !self.description.is_empty() {
21600            state.serialize_entry("description", &self.description)?;
21601        }
21602        if self.hcx.is_some() {
21603            state.serialize_entry("hcx", &self.hcx)?;
21604        }
21605        if self.nsx.is_some() {
21606            state.serialize_entry("nsx", &self.nsx)?;
21607        }
21608        if self.vcenter.is_some() {
21609            state.serialize_entry("vcenter", &self.vcenter)?;
21610        }
21611        if !self.uid.is_empty() {
21612            state.serialize_entry("uid", &self.uid)?;
21613        }
21614        if !wkt::internal::is_default(&self.r#type) {
21615            state.serialize_entry("type", &self.r#type)?;
21616        }
21617        if !self._unknown_fields.is_empty() {
21618            for (key, value) in self._unknown_fields.iter() {
21619                state.serialize_entry(key, &value)?;
21620            }
21621        }
21622        state.end()
21623    }
21624}
21625
21626impl std::fmt::Debug for PrivateCloud {
21627    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21628        let mut debug_struct = f.debug_struct("PrivateCloud");
21629        debug_struct.field("name", &self.name);
21630        debug_struct.field("create_time", &self.create_time);
21631        debug_struct.field("update_time", &self.update_time);
21632        debug_struct.field("delete_time", &self.delete_time);
21633        debug_struct.field("expire_time", &self.expire_time);
21634        debug_struct.field("state", &self.state);
21635        debug_struct.field("network_config", &self.network_config);
21636        debug_struct.field("management_cluster", &self.management_cluster);
21637        debug_struct.field("description", &self.description);
21638        debug_struct.field("hcx", &self.hcx);
21639        debug_struct.field("nsx", &self.nsx);
21640        debug_struct.field("vcenter", &self.vcenter);
21641        debug_struct.field("uid", &self.uid);
21642        debug_struct.field("r#type", &self.r#type);
21643        if !self._unknown_fields.is_empty() {
21644            debug_struct.field("_unknown_fields", &self._unknown_fields);
21645        }
21646        debug_struct.finish()
21647    }
21648}
21649
21650/// Defines additional types related to [PrivateCloud].
21651pub mod private_cloud {
21652    #[allow(unused_imports)]
21653    use super::*;
21654
21655    /// Management cluster configuration.
21656    #[derive(Clone, Default, PartialEq)]
21657    #[non_exhaustive]
21658    pub struct ManagementCluster {
21659        /// Required. The user-provided identifier of the new `Cluster`.
21660        /// The identifier must meet the following requirements:
21661        ///
21662        /// * Only contains 1-63 alphanumeric characters and hyphens
21663        /// * Begins with an alphabetical character
21664        /// * Ends with a non-hyphen character
21665        /// * Not formatted as a UUID
21666        /// * Complies with [RFC
21667        ///   1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
21668        pub cluster_id: std::string::String,
21669
21670        /// Required. The map of cluster node types in this cluster, where the key is
21671        /// canonical identifier of the node type (corresponds to the `NodeType`).
21672        pub node_type_configs:
21673            std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
21674
21675        /// Optional. Configuration of a stretched cluster. Required for STRETCHED
21676        /// private clouds.
21677        pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
21678
21679        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21680    }
21681
21682    impl ManagementCluster {
21683        pub fn new() -> Self {
21684            std::default::Default::default()
21685        }
21686
21687        /// Sets the value of [cluster_id][crate::model::private_cloud::ManagementCluster::cluster_id].
21688        pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21689            self.cluster_id = v.into();
21690            self
21691        }
21692
21693        /// Sets the value of [node_type_configs][crate::model::private_cloud::ManagementCluster::node_type_configs].
21694        pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
21695        where
21696            T: std::iter::IntoIterator<Item = (K, V)>,
21697            K: std::convert::Into<std::string::String>,
21698            V: std::convert::Into<crate::model::NodeTypeConfig>,
21699        {
21700            use std::iter::Iterator;
21701            self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
21702            self
21703        }
21704
21705        /// Sets the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
21706        pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
21707        where
21708            T: std::convert::Into<crate::model::StretchedClusterConfig>,
21709        {
21710            self.stretched_cluster_config = std::option::Option::Some(v.into());
21711            self
21712        }
21713
21714        /// Sets or clears the value of [stretched_cluster_config][crate::model::private_cloud::ManagementCluster::stretched_cluster_config].
21715        pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
21716        where
21717            T: std::convert::Into<crate::model::StretchedClusterConfig>,
21718        {
21719            self.stretched_cluster_config = v.map(|x| x.into());
21720            self
21721        }
21722    }
21723
21724    impl wkt::message::Message for ManagementCluster {
21725        fn typename() -> &'static str {
21726            "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"
21727        }
21728    }
21729
21730    #[doc(hidden)]
21731    impl<'de> serde::de::Deserialize<'de> for ManagementCluster {
21732        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21733        where
21734            D: serde::Deserializer<'de>,
21735        {
21736            #[allow(non_camel_case_types)]
21737            #[doc(hidden)]
21738            #[derive(PartialEq, Eq, Hash)]
21739            enum __FieldTag {
21740                __cluster_id,
21741                __node_type_configs,
21742                __stretched_cluster_config,
21743                Unknown(std::string::String),
21744            }
21745            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21746                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21747                where
21748                    D: serde::Deserializer<'de>,
21749                {
21750                    struct Visitor;
21751                    impl<'de> serde::de::Visitor<'de> for Visitor {
21752                        type Value = __FieldTag;
21753                        fn expecting(
21754                            &self,
21755                            formatter: &mut std::fmt::Formatter,
21756                        ) -> std::fmt::Result {
21757                            formatter.write_str("a field name for ManagementCluster")
21758                        }
21759                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21760                        where
21761                            E: serde::de::Error,
21762                        {
21763                            use std::result::Result::Ok;
21764                            use std::string::ToString;
21765                            match value {
21766                                "clusterId" => Ok(__FieldTag::__cluster_id),
21767                                "cluster_id" => Ok(__FieldTag::__cluster_id),
21768                                "nodeTypeConfigs" => Ok(__FieldTag::__node_type_configs),
21769                                "node_type_configs" => Ok(__FieldTag::__node_type_configs),
21770                                "stretchedClusterConfig" => {
21771                                    Ok(__FieldTag::__stretched_cluster_config)
21772                                }
21773                                "stretched_cluster_config" => {
21774                                    Ok(__FieldTag::__stretched_cluster_config)
21775                                }
21776                                _ => Ok(__FieldTag::Unknown(value.to_string())),
21777                            }
21778                        }
21779                    }
21780                    deserializer.deserialize_identifier(Visitor)
21781                }
21782            }
21783            struct Visitor;
21784            impl<'de> serde::de::Visitor<'de> for Visitor {
21785                type Value = ManagementCluster;
21786                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21787                    formatter.write_str("struct ManagementCluster")
21788                }
21789                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21790                where
21791                    A: serde::de::MapAccess<'de>,
21792                {
21793                    #[allow(unused_imports)]
21794                    use serde::de::Error;
21795                    use std::option::Option::Some;
21796                    let mut fields = std::collections::HashSet::new();
21797                    let mut result = Self::Value::new();
21798                    while let Some(tag) = map.next_key::<__FieldTag>()? {
21799                        #[allow(clippy::match_single_binding)]
21800                        match tag {
21801                            __FieldTag::__cluster_id => {
21802                                if !fields.insert(__FieldTag::__cluster_id) {
21803                                    return std::result::Result::Err(A::Error::duplicate_field(
21804                                        "multiple values for cluster_id",
21805                                    ));
21806                                }
21807                                result.cluster_id = map
21808                                    .next_value::<std::option::Option<std::string::String>>()?
21809                                    .unwrap_or_default();
21810                            }
21811                            __FieldTag::__node_type_configs => {
21812                                if !fields.insert(__FieldTag::__node_type_configs) {
21813                                    return std::result::Result::Err(A::Error::duplicate_field(
21814                                        "multiple values for node_type_configs",
21815                                    ));
21816                                }
21817                                result.node_type_configs = map
21818                                    .next_value::<std::option::Option<
21819                                        std::collections::HashMap<
21820                                            std::string::String,
21821                                            crate::model::NodeTypeConfig,
21822                                        >,
21823                                    >>()?
21824                                    .unwrap_or_default();
21825                            }
21826                            __FieldTag::__stretched_cluster_config => {
21827                                if !fields.insert(__FieldTag::__stretched_cluster_config) {
21828                                    return std::result::Result::Err(A::Error::duplicate_field(
21829                                        "multiple values for stretched_cluster_config",
21830                                    ));
21831                                }
21832                                result.stretched_cluster_config = map.next_value::<std::option::Option<crate::model::StretchedClusterConfig>>()?
21833                                    ;
21834                            }
21835                            __FieldTag::Unknown(key) => {
21836                                let value = map.next_value::<serde_json::Value>()?;
21837                                result._unknown_fields.insert(key, value);
21838                            }
21839                        }
21840                    }
21841                    std::result::Result::Ok(result)
21842                }
21843            }
21844            deserializer.deserialize_any(Visitor)
21845        }
21846    }
21847
21848    #[doc(hidden)]
21849    impl serde::ser::Serialize for ManagementCluster {
21850        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21851        where
21852            S: serde::ser::Serializer,
21853        {
21854            use serde::ser::SerializeMap;
21855            #[allow(unused_imports)]
21856            use std::option::Option::Some;
21857            let mut state = serializer.serialize_map(std::option::Option::None)?;
21858            if !self.cluster_id.is_empty() {
21859                state.serialize_entry("clusterId", &self.cluster_id)?;
21860            }
21861            if !self.node_type_configs.is_empty() {
21862                state.serialize_entry("nodeTypeConfigs", &self.node_type_configs)?;
21863            }
21864            if self.stretched_cluster_config.is_some() {
21865                state.serialize_entry("stretchedClusterConfig", &self.stretched_cluster_config)?;
21866            }
21867            if !self._unknown_fields.is_empty() {
21868                for (key, value) in self._unknown_fields.iter() {
21869                    state.serialize_entry(key, &value)?;
21870                }
21871            }
21872            state.end()
21873        }
21874    }
21875
21876    impl std::fmt::Debug for ManagementCluster {
21877        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21878            let mut debug_struct = f.debug_struct("ManagementCluster");
21879            debug_struct.field("cluster_id", &self.cluster_id);
21880            debug_struct.field("node_type_configs", &self.node_type_configs);
21881            debug_struct.field("stretched_cluster_config", &self.stretched_cluster_config);
21882            if !self._unknown_fields.is_empty() {
21883                debug_struct.field("_unknown_fields", &self._unknown_fields);
21884            }
21885            debug_struct.finish()
21886        }
21887    }
21888
21889    /// Enum State defines possible states of private clouds.
21890    ///
21891    /// # Working with unknown values
21892    ///
21893    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21894    /// additional enum variants at any time. Adding new variants is not considered
21895    /// a breaking change. Applications should write their code in anticipation of:
21896    ///
21897    /// - New values appearing in future releases of the client library, **and**
21898    /// - New values received dynamically, without application changes.
21899    ///
21900    /// Please consult the [Working with enums] section in the user guide for some
21901    /// guidelines.
21902    ///
21903    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21904    #[derive(Clone, Debug, PartialEq)]
21905    #[non_exhaustive]
21906    pub enum State {
21907        /// The default value. This value should never be used.
21908        Unspecified,
21909        /// The private cloud is ready.
21910        Active,
21911        /// The private cloud is being created.
21912        Creating,
21913        /// The private cloud is being updated.
21914        Updating,
21915        /// The private cloud is in failed state.
21916        Failed,
21917        /// The private cloud is scheduled for deletion. The deletion process can be
21918        /// cancelled by using the corresponding undelete method.
21919        Deleted,
21920        /// The private cloud is irreversibly deleted and is being removed from the
21921        /// system.
21922        Purging,
21923        /// If set, the enum was initialized with an unknown value.
21924        ///
21925        /// Applications can examine the value using [State::value] or
21926        /// [State::name].
21927        UnknownValue(state::UnknownValue),
21928    }
21929
21930    #[doc(hidden)]
21931    pub mod state {
21932        #[allow(unused_imports)]
21933        use super::*;
21934        #[derive(Clone, Debug, PartialEq)]
21935        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21936    }
21937
21938    impl State {
21939        /// Gets the enum value.
21940        ///
21941        /// Returns `None` if the enum contains an unknown value deserialized from
21942        /// the string representation of enums.
21943        pub fn value(&self) -> std::option::Option<i32> {
21944            match self {
21945                Self::Unspecified => std::option::Option::Some(0),
21946                Self::Active => std::option::Option::Some(1),
21947                Self::Creating => std::option::Option::Some(2),
21948                Self::Updating => std::option::Option::Some(3),
21949                Self::Failed => std::option::Option::Some(5),
21950                Self::Deleted => std::option::Option::Some(6),
21951                Self::Purging => std::option::Option::Some(7),
21952                Self::UnknownValue(u) => u.0.value(),
21953            }
21954        }
21955
21956        /// Gets the enum value as a string.
21957        ///
21958        /// Returns `None` if the enum contains an unknown value deserialized from
21959        /// the integer representation of enums.
21960        pub fn name(&self) -> std::option::Option<&str> {
21961            match self {
21962                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21963                Self::Active => std::option::Option::Some("ACTIVE"),
21964                Self::Creating => std::option::Option::Some("CREATING"),
21965                Self::Updating => std::option::Option::Some("UPDATING"),
21966                Self::Failed => std::option::Option::Some("FAILED"),
21967                Self::Deleted => std::option::Option::Some("DELETED"),
21968                Self::Purging => std::option::Option::Some("PURGING"),
21969                Self::UnknownValue(u) => u.0.name(),
21970            }
21971        }
21972    }
21973
21974    impl std::default::Default for State {
21975        fn default() -> Self {
21976            use std::convert::From;
21977            Self::from(0)
21978        }
21979    }
21980
21981    impl std::fmt::Display for State {
21982        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21983            wkt::internal::display_enum(f, self.name(), self.value())
21984        }
21985    }
21986
21987    impl std::convert::From<i32> for State {
21988        fn from(value: i32) -> Self {
21989            match value {
21990                0 => Self::Unspecified,
21991                1 => Self::Active,
21992                2 => Self::Creating,
21993                3 => Self::Updating,
21994                5 => Self::Failed,
21995                6 => Self::Deleted,
21996                7 => Self::Purging,
21997                _ => Self::UnknownValue(state::UnknownValue(
21998                    wkt::internal::UnknownEnumValue::Integer(value),
21999                )),
22000            }
22001        }
22002    }
22003
22004    impl std::convert::From<&str> for State {
22005        fn from(value: &str) -> Self {
22006            use std::string::ToString;
22007            match value {
22008                "STATE_UNSPECIFIED" => Self::Unspecified,
22009                "ACTIVE" => Self::Active,
22010                "CREATING" => Self::Creating,
22011                "UPDATING" => Self::Updating,
22012                "FAILED" => Self::Failed,
22013                "DELETED" => Self::Deleted,
22014                "PURGING" => Self::Purging,
22015                _ => Self::UnknownValue(state::UnknownValue(
22016                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22017                )),
22018            }
22019        }
22020    }
22021
22022    impl serde::ser::Serialize for State {
22023        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22024        where
22025            S: serde::Serializer,
22026        {
22027            match self {
22028                Self::Unspecified => serializer.serialize_i32(0),
22029                Self::Active => serializer.serialize_i32(1),
22030                Self::Creating => serializer.serialize_i32(2),
22031                Self::Updating => serializer.serialize_i32(3),
22032                Self::Failed => serializer.serialize_i32(5),
22033                Self::Deleted => serializer.serialize_i32(6),
22034                Self::Purging => serializer.serialize_i32(7),
22035                Self::UnknownValue(u) => u.0.serialize(serializer),
22036            }
22037        }
22038    }
22039
22040    impl<'de> serde::de::Deserialize<'de> for State {
22041        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22042        where
22043            D: serde::Deserializer<'de>,
22044        {
22045            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
22046                ".google.cloud.vmwareengine.v1.PrivateCloud.State",
22047            ))
22048        }
22049    }
22050
22051    /// Enum Type defines private cloud type.
22052    ///
22053    /// # Working with unknown values
22054    ///
22055    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22056    /// additional enum variants at any time. Adding new variants is not considered
22057    /// a breaking change. Applications should write their code in anticipation of:
22058    ///
22059    /// - New values appearing in future releases of the client library, **and**
22060    /// - New values received dynamically, without application changes.
22061    ///
22062    /// Please consult the [Working with enums] section in the user guide for some
22063    /// guidelines.
22064    ///
22065    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22066    #[derive(Clone, Debug, PartialEq)]
22067    #[non_exhaustive]
22068    pub enum Type {
22069        /// Standard private is a zonal resource, with 3+ nodes. Default type.
22070        Standard,
22071        /// Time limited private cloud is a zonal resource, can have only 1 node and
22072        /// has limited life span. Will be deleted after defined period of time,
22073        /// can be converted into standard private cloud by expanding it up to 3
22074        /// or more nodes.
22075        TimeLimited,
22076        /// Stretched private cloud is a regional resource with redundancy,
22077        /// with a minimum of 6 nodes, nodes count has to be even.
22078        Stretched,
22079        /// If set, the enum was initialized with an unknown value.
22080        ///
22081        /// Applications can examine the value using [Type::value] or
22082        /// [Type::name].
22083        UnknownValue(r#type::UnknownValue),
22084    }
22085
22086    #[doc(hidden)]
22087    pub mod r#type {
22088        #[allow(unused_imports)]
22089        use super::*;
22090        #[derive(Clone, Debug, PartialEq)]
22091        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22092    }
22093
22094    impl Type {
22095        /// Gets the enum value.
22096        ///
22097        /// Returns `None` if the enum contains an unknown value deserialized from
22098        /// the string representation of enums.
22099        pub fn value(&self) -> std::option::Option<i32> {
22100            match self {
22101                Self::Standard => std::option::Option::Some(0),
22102                Self::TimeLimited => std::option::Option::Some(1),
22103                Self::Stretched => std::option::Option::Some(2),
22104                Self::UnknownValue(u) => u.0.value(),
22105            }
22106        }
22107
22108        /// Gets the enum value as a string.
22109        ///
22110        /// Returns `None` if the enum contains an unknown value deserialized from
22111        /// the integer representation of enums.
22112        pub fn name(&self) -> std::option::Option<&str> {
22113            match self {
22114                Self::Standard => std::option::Option::Some("STANDARD"),
22115                Self::TimeLimited => std::option::Option::Some("TIME_LIMITED"),
22116                Self::Stretched => std::option::Option::Some("STRETCHED"),
22117                Self::UnknownValue(u) => u.0.name(),
22118            }
22119        }
22120    }
22121
22122    impl std::default::Default for Type {
22123        fn default() -> Self {
22124            use std::convert::From;
22125            Self::from(0)
22126        }
22127    }
22128
22129    impl std::fmt::Display for Type {
22130        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22131            wkt::internal::display_enum(f, self.name(), self.value())
22132        }
22133    }
22134
22135    impl std::convert::From<i32> for Type {
22136        fn from(value: i32) -> Self {
22137            match value {
22138                0 => Self::Standard,
22139                1 => Self::TimeLimited,
22140                2 => Self::Stretched,
22141                _ => Self::UnknownValue(r#type::UnknownValue(
22142                    wkt::internal::UnknownEnumValue::Integer(value),
22143                )),
22144            }
22145        }
22146    }
22147
22148    impl std::convert::From<&str> for Type {
22149        fn from(value: &str) -> Self {
22150            use std::string::ToString;
22151            match value {
22152                "STANDARD" => Self::Standard,
22153                "TIME_LIMITED" => Self::TimeLimited,
22154                "STRETCHED" => Self::Stretched,
22155                _ => Self::UnknownValue(r#type::UnknownValue(
22156                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22157                )),
22158            }
22159        }
22160    }
22161
22162    impl serde::ser::Serialize for Type {
22163        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22164        where
22165            S: serde::Serializer,
22166        {
22167            match self {
22168                Self::Standard => serializer.serialize_i32(0),
22169                Self::TimeLimited => serializer.serialize_i32(1),
22170                Self::Stretched => serializer.serialize_i32(2),
22171                Self::UnknownValue(u) => u.0.serialize(serializer),
22172            }
22173        }
22174    }
22175
22176    impl<'de> serde::de::Deserialize<'de> for Type {
22177        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22178        where
22179            D: serde::Deserializer<'de>,
22180        {
22181            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
22182                ".google.cloud.vmwareengine.v1.PrivateCloud.Type",
22183            ))
22184        }
22185    }
22186}
22187
22188/// A cluster in a private cloud.
22189#[derive(Clone, Default, PartialEq)]
22190#[non_exhaustive]
22191pub struct Cluster {
22192    /// Output only. The resource name of this cluster.
22193    /// Resource names are schemeless URIs that follow the conventions in
22194    /// <https://cloud.google.com/apis/design/resource_names>.
22195    /// For example:
22196    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
22197    pub name: std::string::String,
22198
22199    /// Output only. Creation time of this resource.
22200    pub create_time: std::option::Option<wkt::Timestamp>,
22201
22202    /// Output only. Last update time of this resource.
22203    pub update_time: std::option::Option<wkt::Timestamp>,
22204
22205    /// Output only. State of the resource.
22206    pub state: crate::model::cluster::State,
22207
22208    /// Output only. True if the cluster is a management cluster; false otherwise.
22209    /// There can only be one management cluster in a private cloud
22210    /// and it has to be the first one.
22211    pub management: bool,
22212
22213    /// Optional. Configuration of the autoscaling applied to this cluster.
22214    pub autoscaling_settings: std::option::Option<crate::model::AutoscalingSettings>,
22215
22216    /// Output only. System-generated unique identifier for the resource.
22217    pub uid: std::string::String,
22218
22219    /// Required. The map of cluster node types in this cluster, where the key is
22220    /// canonical identifier of the node type (corresponds to the `NodeType`).
22221    pub node_type_configs:
22222        std::collections::HashMap<std::string::String, crate::model::NodeTypeConfig>,
22223
22224    /// Optional. Configuration of a stretched cluster. Required for clusters that
22225    /// belong to a STRETCHED private cloud.
22226    pub stretched_cluster_config: std::option::Option<crate::model::StretchedClusterConfig>,
22227
22228    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22229}
22230
22231impl Cluster {
22232    pub fn new() -> Self {
22233        std::default::Default::default()
22234    }
22235
22236    /// Sets the value of [name][crate::model::Cluster::name].
22237    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22238        self.name = v.into();
22239        self
22240    }
22241
22242    /// Sets the value of [create_time][crate::model::Cluster::create_time].
22243    pub fn set_create_time<T>(mut self, v: T) -> Self
22244    where
22245        T: std::convert::Into<wkt::Timestamp>,
22246    {
22247        self.create_time = std::option::Option::Some(v.into());
22248        self
22249    }
22250
22251    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
22252    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
22253    where
22254        T: std::convert::Into<wkt::Timestamp>,
22255    {
22256        self.create_time = v.map(|x| x.into());
22257        self
22258    }
22259
22260    /// Sets the value of [update_time][crate::model::Cluster::update_time].
22261    pub fn set_update_time<T>(mut self, v: T) -> Self
22262    where
22263        T: std::convert::Into<wkt::Timestamp>,
22264    {
22265        self.update_time = std::option::Option::Some(v.into());
22266        self
22267    }
22268
22269    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
22270    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
22271    where
22272        T: std::convert::Into<wkt::Timestamp>,
22273    {
22274        self.update_time = v.map(|x| x.into());
22275        self
22276    }
22277
22278    /// Sets the value of [state][crate::model::Cluster::state].
22279    pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
22280        self.state = v.into();
22281        self
22282    }
22283
22284    /// Sets the value of [management][crate::model::Cluster::management].
22285    pub fn set_management<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22286        self.management = v.into();
22287        self
22288    }
22289
22290    /// Sets the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
22291    pub fn set_autoscaling_settings<T>(mut self, v: T) -> Self
22292    where
22293        T: std::convert::Into<crate::model::AutoscalingSettings>,
22294    {
22295        self.autoscaling_settings = std::option::Option::Some(v.into());
22296        self
22297    }
22298
22299    /// Sets or clears the value of [autoscaling_settings][crate::model::Cluster::autoscaling_settings].
22300    pub fn set_or_clear_autoscaling_settings<T>(mut self, v: std::option::Option<T>) -> Self
22301    where
22302        T: std::convert::Into<crate::model::AutoscalingSettings>,
22303    {
22304        self.autoscaling_settings = v.map(|x| x.into());
22305        self
22306    }
22307
22308    /// Sets the value of [uid][crate::model::Cluster::uid].
22309    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22310        self.uid = v.into();
22311        self
22312    }
22313
22314    /// Sets the value of [node_type_configs][crate::model::Cluster::node_type_configs].
22315    pub fn set_node_type_configs<T, K, V>(mut self, v: T) -> Self
22316    where
22317        T: std::iter::IntoIterator<Item = (K, V)>,
22318        K: std::convert::Into<std::string::String>,
22319        V: std::convert::Into<crate::model::NodeTypeConfig>,
22320    {
22321        use std::iter::Iterator;
22322        self.node_type_configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
22323        self
22324    }
22325
22326    /// Sets the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
22327    pub fn set_stretched_cluster_config<T>(mut self, v: T) -> Self
22328    where
22329        T: std::convert::Into<crate::model::StretchedClusterConfig>,
22330    {
22331        self.stretched_cluster_config = std::option::Option::Some(v.into());
22332        self
22333    }
22334
22335    /// Sets or clears the value of [stretched_cluster_config][crate::model::Cluster::stretched_cluster_config].
22336    pub fn set_or_clear_stretched_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
22337    where
22338        T: std::convert::Into<crate::model::StretchedClusterConfig>,
22339    {
22340        self.stretched_cluster_config = v.map(|x| x.into());
22341        self
22342    }
22343}
22344
22345impl wkt::message::Message for Cluster {
22346    fn typename() -> &'static str {
22347        "type.googleapis.com/google.cloud.vmwareengine.v1.Cluster"
22348    }
22349}
22350
22351#[doc(hidden)]
22352impl<'de> serde::de::Deserialize<'de> for Cluster {
22353    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22354    where
22355        D: serde::Deserializer<'de>,
22356    {
22357        #[allow(non_camel_case_types)]
22358        #[doc(hidden)]
22359        #[derive(PartialEq, Eq, Hash)]
22360        enum __FieldTag {
22361            __name,
22362            __create_time,
22363            __update_time,
22364            __state,
22365            __management,
22366            __autoscaling_settings,
22367            __uid,
22368            __node_type_configs,
22369            __stretched_cluster_config,
22370            Unknown(std::string::String),
22371        }
22372        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22373            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22374            where
22375                D: serde::Deserializer<'de>,
22376            {
22377                struct Visitor;
22378                impl<'de> serde::de::Visitor<'de> for Visitor {
22379                    type Value = __FieldTag;
22380                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22381                        formatter.write_str("a field name for Cluster")
22382                    }
22383                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22384                    where
22385                        E: serde::de::Error,
22386                    {
22387                        use std::result::Result::Ok;
22388                        use std::string::ToString;
22389                        match value {
22390                            "name" => Ok(__FieldTag::__name),
22391                            "createTime" => Ok(__FieldTag::__create_time),
22392                            "create_time" => Ok(__FieldTag::__create_time),
22393                            "updateTime" => Ok(__FieldTag::__update_time),
22394                            "update_time" => Ok(__FieldTag::__update_time),
22395                            "state" => Ok(__FieldTag::__state),
22396                            "management" => Ok(__FieldTag::__management),
22397                            "autoscalingSettings" => Ok(__FieldTag::__autoscaling_settings),
22398                            "autoscaling_settings" => Ok(__FieldTag::__autoscaling_settings),
22399                            "uid" => Ok(__FieldTag::__uid),
22400                            "nodeTypeConfigs" => Ok(__FieldTag::__node_type_configs),
22401                            "node_type_configs" => Ok(__FieldTag::__node_type_configs),
22402                            "stretchedClusterConfig" => Ok(__FieldTag::__stretched_cluster_config),
22403                            "stretched_cluster_config" => {
22404                                Ok(__FieldTag::__stretched_cluster_config)
22405                            }
22406                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22407                        }
22408                    }
22409                }
22410                deserializer.deserialize_identifier(Visitor)
22411            }
22412        }
22413        struct Visitor;
22414        impl<'de> serde::de::Visitor<'de> for Visitor {
22415            type Value = Cluster;
22416            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22417                formatter.write_str("struct Cluster")
22418            }
22419            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22420            where
22421                A: serde::de::MapAccess<'de>,
22422            {
22423                #[allow(unused_imports)]
22424                use serde::de::Error;
22425                use std::option::Option::Some;
22426                let mut fields = std::collections::HashSet::new();
22427                let mut result = Self::Value::new();
22428                while let Some(tag) = map.next_key::<__FieldTag>()? {
22429                    #[allow(clippy::match_single_binding)]
22430                    match tag {
22431                        __FieldTag::__name => {
22432                            if !fields.insert(__FieldTag::__name) {
22433                                return std::result::Result::Err(A::Error::duplicate_field(
22434                                    "multiple values for name",
22435                                ));
22436                            }
22437                            result.name = map
22438                                .next_value::<std::option::Option<std::string::String>>()?
22439                                .unwrap_or_default();
22440                        }
22441                        __FieldTag::__create_time => {
22442                            if !fields.insert(__FieldTag::__create_time) {
22443                                return std::result::Result::Err(A::Error::duplicate_field(
22444                                    "multiple values for create_time",
22445                                ));
22446                            }
22447                            result.create_time =
22448                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
22449                        }
22450                        __FieldTag::__update_time => {
22451                            if !fields.insert(__FieldTag::__update_time) {
22452                                return std::result::Result::Err(A::Error::duplicate_field(
22453                                    "multiple values for update_time",
22454                                ));
22455                            }
22456                            result.update_time =
22457                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
22458                        }
22459                        __FieldTag::__state => {
22460                            if !fields.insert(__FieldTag::__state) {
22461                                return std::result::Result::Err(A::Error::duplicate_field(
22462                                    "multiple values for state",
22463                                ));
22464                            }
22465                            result.state = map
22466                                .next_value::<std::option::Option<crate::model::cluster::State>>()?
22467                                .unwrap_or_default();
22468                        }
22469                        __FieldTag::__management => {
22470                            if !fields.insert(__FieldTag::__management) {
22471                                return std::result::Result::Err(A::Error::duplicate_field(
22472                                    "multiple values for management",
22473                                ));
22474                            }
22475                            result.management = map
22476                                .next_value::<std::option::Option<bool>>()?
22477                                .unwrap_or_default();
22478                        }
22479                        __FieldTag::__autoscaling_settings => {
22480                            if !fields.insert(__FieldTag::__autoscaling_settings) {
22481                                return std::result::Result::Err(A::Error::duplicate_field(
22482                                    "multiple values for autoscaling_settings",
22483                                ));
22484                            }
22485                            result.autoscaling_settings = map.next_value::<std::option::Option<crate::model::AutoscalingSettings>>()?
22486                                ;
22487                        }
22488                        __FieldTag::__uid => {
22489                            if !fields.insert(__FieldTag::__uid) {
22490                                return std::result::Result::Err(A::Error::duplicate_field(
22491                                    "multiple values for uid",
22492                                ));
22493                            }
22494                            result.uid = map
22495                                .next_value::<std::option::Option<std::string::String>>()?
22496                                .unwrap_or_default();
22497                        }
22498                        __FieldTag::__node_type_configs => {
22499                            if !fields.insert(__FieldTag::__node_type_configs) {
22500                                return std::result::Result::Err(A::Error::duplicate_field(
22501                                    "multiple values for node_type_configs",
22502                                ));
22503                            }
22504                            result.node_type_configs = map
22505                                .next_value::<std::option::Option<
22506                                    std::collections::HashMap<
22507                                        std::string::String,
22508                                        crate::model::NodeTypeConfig,
22509                                    >,
22510                                >>()?
22511                                .unwrap_or_default();
22512                        }
22513                        __FieldTag::__stretched_cluster_config => {
22514                            if !fields.insert(__FieldTag::__stretched_cluster_config) {
22515                                return std::result::Result::Err(A::Error::duplicate_field(
22516                                    "multiple values for stretched_cluster_config",
22517                                ));
22518                            }
22519                            result.stretched_cluster_config = map.next_value::<std::option::Option<crate::model::StretchedClusterConfig>>()?
22520                                ;
22521                        }
22522                        __FieldTag::Unknown(key) => {
22523                            let value = map.next_value::<serde_json::Value>()?;
22524                            result._unknown_fields.insert(key, value);
22525                        }
22526                    }
22527                }
22528                std::result::Result::Ok(result)
22529            }
22530        }
22531        deserializer.deserialize_any(Visitor)
22532    }
22533}
22534
22535#[doc(hidden)]
22536impl serde::ser::Serialize for Cluster {
22537    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22538    where
22539        S: serde::ser::Serializer,
22540    {
22541        use serde::ser::SerializeMap;
22542        #[allow(unused_imports)]
22543        use std::option::Option::Some;
22544        let mut state = serializer.serialize_map(std::option::Option::None)?;
22545        if !self.name.is_empty() {
22546            state.serialize_entry("name", &self.name)?;
22547        }
22548        if self.create_time.is_some() {
22549            state.serialize_entry("createTime", &self.create_time)?;
22550        }
22551        if self.update_time.is_some() {
22552            state.serialize_entry("updateTime", &self.update_time)?;
22553        }
22554        if !wkt::internal::is_default(&self.state) {
22555            state.serialize_entry("state", &self.state)?;
22556        }
22557        if !wkt::internal::is_default(&self.management) {
22558            state.serialize_entry("management", &self.management)?;
22559        }
22560        if self.autoscaling_settings.is_some() {
22561            state.serialize_entry("autoscalingSettings", &self.autoscaling_settings)?;
22562        }
22563        if !self.uid.is_empty() {
22564            state.serialize_entry("uid", &self.uid)?;
22565        }
22566        if !self.node_type_configs.is_empty() {
22567            state.serialize_entry("nodeTypeConfigs", &self.node_type_configs)?;
22568        }
22569        if self.stretched_cluster_config.is_some() {
22570            state.serialize_entry("stretchedClusterConfig", &self.stretched_cluster_config)?;
22571        }
22572        if !self._unknown_fields.is_empty() {
22573            for (key, value) in self._unknown_fields.iter() {
22574                state.serialize_entry(key, &value)?;
22575            }
22576        }
22577        state.end()
22578    }
22579}
22580
22581impl std::fmt::Debug for Cluster {
22582    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22583        let mut debug_struct = f.debug_struct("Cluster");
22584        debug_struct.field("name", &self.name);
22585        debug_struct.field("create_time", &self.create_time);
22586        debug_struct.field("update_time", &self.update_time);
22587        debug_struct.field("state", &self.state);
22588        debug_struct.field("management", &self.management);
22589        debug_struct.field("autoscaling_settings", &self.autoscaling_settings);
22590        debug_struct.field("uid", &self.uid);
22591        debug_struct.field("node_type_configs", &self.node_type_configs);
22592        debug_struct.field("stretched_cluster_config", &self.stretched_cluster_config);
22593        if !self._unknown_fields.is_empty() {
22594            debug_struct.field("_unknown_fields", &self._unknown_fields);
22595        }
22596        debug_struct.finish()
22597    }
22598}
22599
22600/// Defines additional types related to [Cluster].
22601pub mod cluster {
22602    #[allow(unused_imports)]
22603    use super::*;
22604
22605    /// Enum State defines possible states of private cloud clusters.
22606    ///
22607    /// # Working with unknown values
22608    ///
22609    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22610    /// additional enum variants at any time. Adding new variants is not considered
22611    /// a breaking change. Applications should write their code in anticipation of:
22612    ///
22613    /// - New values appearing in future releases of the client library, **and**
22614    /// - New values received dynamically, without application changes.
22615    ///
22616    /// Please consult the [Working with enums] section in the user guide for some
22617    /// guidelines.
22618    ///
22619    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22620    #[derive(Clone, Debug, PartialEq)]
22621    #[non_exhaustive]
22622    pub enum State {
22623        /// The default value. This value should never be used.
22624        Unspecified,
22625        /// The Cluster is operational and can be used by the user.
22626        Active,
22627        /// The Cluster is being deployed.
22628        Creating,
22629        /// Adding or removing of a node to the cluster, any other cluster specific
22630        /// updates.
22631        Updating,
22632        /// The Cluster is being deleted.
22633        Deleting,
22634        /// The Cluster is undergoing maintenance, for example: a failed node is
22635        /// getting replaced.
22636        Repairing,
22637        /// If set, the enum was initialized with an unknown value.
22638        ///
22639        /// Applications can examine the value using [State::value] or
22640        /// [State::name].
22641        UnknownValue(state::UnknownValue),
22642    }
22643
22644    #[doc(hidden)]
22645    pub mod state {
22646        #[allow(unused_imports)]
22647        use super::*;
22648        #[derive(Clone, Debug, PartialEq)]
22649        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22650    }
22651
22652    impl State {
22653        /// Gets the enum value.
22654        ///
22655        /// Returns `None` if the enum contains an unknown value deserialized from
22656        /// the string representation of enums.
22657        pub fn value(&self) -> std::option::Option<i32> {
22658            match self {
22659                Self::Unspecified => std::option::Option::Some(0),
22660                Self::Active => std::option::Option::Some(1),
22661                Self::Creating => std::option::Option::Some(2),
22662                Self::Updating => std::option::Option::Some(3),
22663                Self::Deleting => std::option::Option::Some(4),
22664                Self::Repairing => std::option::Option::Some(5),
22665                Self::UnknownValue(u) => u.0.value(),
22666            }
22667        }
22668
22669        /// Gets the enum value as a string.
22670        ///
22671        /// Returns `None` if the enum contains an unknown value deserialized from
22672        /// the integer representation of enums.
22673        pub fn name(&self) -> std::option::Option<&str> {
22674            match self {
22675                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
22676                Self::Active => std::option::Option::Some("ACTIVE"),
22677                Self::Creating => std::option::Option::Some("CREATING"),
22678                Self::Updating => std::option::Option::Some("UPDATING"),
22679                Self::Deleting => std::option::Option::Some("DELETING"),
22680                Self::Repairing => std::option::Option::Some("REPAIRING"),
22681                Self::UnknownValue(u) => u.0.name(),
22682            }
22683        }
22684    }
22685
22686    impl std::default::Default for State {
22687        fn default() -> Self {
22688            use std::convert::From;
22689            Self::from(0)
22690        }
22691    }
22692
22693    impl std::fmt::Display for State {
22694        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22695            wkt::internal::display_enum(f, self.name(), self.value())
22696        }
22697    }
22698
22699    impl std::convert::From<i32> for State {
22700        fn from(value: i32) -> Self {
22701            match value {
22702                0 => Self::Unspecified,
22703                1 => Self::Active,
22704                2 => Self::Creating,
22705                3 => Self::Updating,
22706                4 => Self::Deleting,
22707                5 => Self::Repairing,
22708                _ => Self::UnknownValue(state::UnknownValue(
22709                    wkt::internal::UnknownEnumValue::Integer(value),
22710                )),
22711            }
22712        }
22713    }
22714
22715    impl std::convert::From<&str> for State {
22716        fn from(value: &str) -> Self {
22717            use std::string::ToString;
22718            match value {
22719                "STATE_UNSPECIFIED" => Self::Unspecified,
22720                "ACTIVE" => Self::Active,
22721                "CREATING" => Self::Creating,
22722                "UPDATING" => Self::Updating,
22723                "DELETING" => Self::Deleting,
22724                "REPAIRING" => Self::Repairing,
22725                _ => Self::UnknownValue(state::UnknownValue(
22726                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22727                )),
22728            }
22729        }
22730    }
22731
22732    impl serde::ser::Serialize for State {
22733        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22734        where
22735            S: serde::Serializer,
22736        {
22737            match self {
22738                Self::Unspecified => serializer.serialize_i32(0),
22739                Self::Active => serializer.serialize_i32(1),
22740                Self::Creating => serializer.serialize_i32(2),
22741                Self::Updating => serializer.serialize_i32(3),
22742                Self::Deleting => serializer.serialize_i32(4),
22743                Self::Repairing => serializer.serialize_i32(5),
22744                Self::UnknownValue(u) => u.0.serialize(serializer),
22745            }
22746        }
22747    }
22748
22749    impl<'de> serde::de::Deserialize<'de> for State {
22750        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22751        where
22752            D: serde::Deserializer<'de>,
22753        {
22754            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
22755                ".google.cloud.vmwareengine.v1.Cluster.State",
22756            ))
22757        }
22758    }
22759}
22760
22761/// Node in a cluster.
22762#[derive(Clone, Default, PartialEq)]
22763#[non_exhaustive]
22764pub struct Node {
22765    /// Output only. The resource name of this node.
22766    /// Resource names are schemeless URIs that follow the conventions in
22767    /// <https://cloud.google.com/apis/design/resource_names>.
22768    /// For example:
22769    /// projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node
22770    pub name: std::string::String,
22771
22772    /// Output only. Fully qualified domain name of the node.
22773    pub fqdn: std::string::String,
22774
22775    /// Output only. Internal IP address of the node.
22776    pub internal_ip: std::string::String,
22777
22778    /// Output only. The canonical identifier of the node type (corresponds to the
22779    /// `NodeType`).
22780    /// For example: standard-72.
22781    pub node_type_id: std::string::String,
22782
22783    /// Output only. The version number of the VMware ESXi
22784    /// management component in this cluster.
22785    pub version: std::string::String,
22786
22787    /// Output only. Customized number of cores
22788    pub custom_core_count: i64,
22789
22790    /// Output only. The state of the appliance.
22791    pub state: crate::model::node::State,
22792
22793    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22794}
22795
22796impl Node {
22797    pub fn new() -> Self {
22798        std::default::Default::default()
22799    }
22800
22801    /// Sets the value of [name][crate::model::Node::name].
22802    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22803        self.name = v.into();
22804        self
22805    }
22806
22807    /// Sets the value of [fqdn][crate::model::Node::fqdn].
22808    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22809        self.fqdn = v.into();
22810        self
22811    }
22812
22813    /// Sets the value of [internal_ip][crate::model::Node::internal_ip].
22814    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22815        self.internal_ip = v.into();
22816        self
22817    }
22818
22819    /// Sets the value of [node_type_id][crate::model::Node::node_type_id].
22820    pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22821        self.node_type_id = v.into();
22822        self
22823    }
22824
22825    /// Sets the value of [version][crate::model::Node::version].
22826    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22827        self.version = v.into();
22828        self
22829    }
22830
22831    /// Sets the value of [custom_core_count][crate::model::Node::custom_core_count].
22832    pub fn set_custom_core_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22833        self.custom_core_count = v.into();
22834        self
22835    }
22836
22837    /// Sets the value of [state][crate::model::Node::state].
22838    pub fn set_state<T: std::convert::Into<crate::model::node::State>>(mut self, v: T) -> Self {
22839        self.state = v.into();
22840        self
22841    }
22842}
22843
22844impl wkt::message::Message for Node {
22845    fn typename() -> &'static str {
22846        "type.googleapis.com/google.cloud.vmwareengine.v1.Node"
22847    }
22848}
22849
22850#[doc(hidden)]
22851impl<'de> serde::de::Deserialize<'de> for Node {
22852    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22853    where
22854        D: serde::Deserializer<'de>,
22855    {
22856        #[allow(non_camel_case_types)]
22857        #[doc(hidden)]
22858        #[derive(PartialEq, Eq, Hash)]
22859        enum __FieldTag {
22860            __name,
22861            __fqdn,
22862            __internal_ip,
22863            __node_type_id,
22864            __version,
22865            __custom_core_count,
22866            __state,
22867            Unknown(std::string::String),
22868        }
22869        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22870            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22871            where
22872                D: serde::Deserializer<'de>,
22873            {
22874                struct Visitor;
22875                impl<'de> serde::de::Visitor<'de> for Visitor {
22876                    type Value = __FieldTag;
22877                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22878                        formatter.write_str("a field name for Node")
22879                    }
22880                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22881                    where
22882                        E: serde::de::Error,
22883                    {
22884                        use std::result::Result::Ok;
22885                        use std::string::ToString;
22886                        match value {
22887                            "name" => Ok(__FieldTag::__name),
22888                            "fqdn" => Ok(__FieldTag::__fqdn),
22889                            "internalIp" => Ok(__FieldTag::__internal_ip),
22890                            "internal_ip" => Ok(__FieldTag::__internal_ip),
22891                            "nodeTypeId" => Ok(__FieldTag::__node_type_id),
22892                            "node_type_id" => Ok(__FieldTag::__node_type_id),
22893                            "version" => Ok(__FieldTag::__version),
22894                            "customCoreCount" => Ok(__FieldTag::__custom_core_count),
22895                            "custom_core_count" => Ok(__FieldTag::__custom_core_count),
22896                            "state" => Ok(__FieldTag::__state),
22897                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22898                        }
22899                    }
22900                }
22901                deserializer.deserialize_identifier(Visitor)
22902            }
22903        }
22904        struct Visitor;
22905        impl<'de> serde::de::Visitor<'de> for Visitor {
22906            type Value = Node;
22907            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22908                formatter.write_str("struct Node")
22909            }
22910            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22911            where
22912                A: serde::de::MapAccess<'de>,
22913            {
22914                #[allow(unused_imports)]
22915                use serde::de::Error;
22916                use std::option::Option::Some;
22917                let mut fields = std::collections::HashSet::new();
22918                let mut result = Self::Value::new();
22919                while let Some(tag) = map.next_key::<__FieldTag>()? {
22920                    #[allow(clippy::match_single_binding)]
22921                    match tag {
22922                        __FieldTag::__name => {
22923                            if !fields.insert(__FieldTag::__name) {
22924                                return std::result::Result::Err(A::Error::duplicate_field(
22925                                    "multiple values for name",
22926                                ));
22927                            }
22928                            result.name = map
22929                                .next_value::<std::option::Option<std::string::String>>()?
22930                                .unwrap_or_default();
22931                        }
22932                        __FieldTag::__fqdn => {
22933                            if !fields.insert(__FieldTag::__fqdn) {
22934                                return std::result::Result::Err(A::Error::duplicate_field(
22935                                    "multiple values for fqdn",
22936                                ));
22937                            }
22938                            result.fqdn = map
22939                                .next_value::<std::option::Option<std::string::String>>()?
22940                                .unwrap_or_default();
22941                        }
22942                        __FieldTag::__internal_ip => {
22943                            if !fields.insert(__FieldTag::__internal_ip) {
22944                                return std::result::Result::Err(A::Error::duplicate_field(
22945                                    "multiple values for internal_ip",
22946                                ));
22947                            }
22948                            result.internal_ip = map
22949                                .next_value::<std::option::Option<std::string::String>>()?
22950                                .unwrap_or_default();
22951                        }
22952                        __FieldTag::__node_type_id => {
22953                            if !fields.insert(__FieldTag::__node_type_id) {
22954                                return std::result::Result::Err(A::Error::duplicate_field(
22955                                    "multiple values for node_type_id",
22956                                ));
22957                            }
22958                            result.node_type_id = map
22959                                .next_value::<std::option::Option<std::string::String>>()?
22960                                .unwrap_or_default();
22961                        }
22962                        __FieldTag::__version => {
22963                            if !fields.insert(__FieldTag::__version) {
22964                                return std::result::Result::Err(A::Error::duplicate_field(
22965                                    "multiple values for version",
22966                                ));
22967                            }
22968                            result.version = map
22969                                .next_value::<std::option::Option<std::string::String>>()?
22970                                .unwrap_or_default();
22971                        }
22972                        __FieldTag::__custom_core_count => {
22973                            if !fields.insert(__FieldTag::__custom_core_count) {
22974                                return std::result::Result::Err(A::Error::duplicate_field(
22975                                    "multiple values for custom_core_count",
22976                                ));
22977                            }
22978                            struct __With(std::option::Option<i64>);
22979                            impl<'de> serde::de::Deserialize<'de> for __With {
22980                                fn deserialize<D>(
22981                                    deserializer: D,
22982                                ) -> std::result::Result<Self, D::Error>
22983                                where
22984                                    D: serde::de::Deserializer<'de>,
22985                                {
22986                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
22987                                }
22988                            }
22989                            result.custom_core_count =
22990                                map.next_value::<__With>()?.0.unwrap_or_default();
22991                        }
22992                        __FieldTag::__state => {
22993                            if !fields.insert(__FieldTag::__state) {
22994                                return std::result::Result::Err(A::Error::duplicate_field(
22995                                    "multiple values for state",
22996                                ));
22997                            }
22998                            result.state = map
22999                                .next_value::<std::option::Option<crate::model::node::State>>()?
23000                                .unwrap_or_default();
23001                        }
23002                        __FieldTag::Unknown(key) => {
23003                            let value = map.next_value::<serde_json::Value>()?;
23004                            result._unknown_fields.insert(key, value);
23005                        }
23006                    }
23007                }
23008                std::result::Result::Ok(result)
23009            }
23010        }
23011        deserializer.deserialize_any(Visitor)
23012    }
23013}
23014
23015#[doc(hidden)]
23016impl serde::ser::Serialize for Node {
23017    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23018    where
23019        S: serde::ser::Serializer,
23020    {
23021        use serde::ser::SerializeMap;
23022        #[allow(unused_imports)]
23023        use std::option::Option::Some;
23024        let mut state = serializer.serialize_map(std::option::Option::None)?;
23025        if !self.name.is_empty() {
23026            state.serialize_entry("name", &self.name)?;
23027        }
23028        if !self.fqdn.is_empty() {
23029            state.serialize_entry("fqdn", &self.fqdn)?;
23030        }
23031        if !self.internal_ip.is_empty() {
23032            state.serialize_entry("internalIp", &self.internal_ip)?;
23033        }
23034        if !self.node_type_id.is_empty() {
23035            state.serialize_entry("nodeTypeId", &self.node_type_id)?;
23036        }
23037        if !self.version.is_empty() {
23038            state.serialize_entry("version", &self.version)?;
23039        }
23040        if !wkt::internal::is_default(&self.custom_core_count) {
23041            struct __With<'a>(&'a i64);
23042            impl<'a> serde::ser::Serialize for __With<'a> {
23043                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23044                where
23045                    S: serde::ser::Serializer,
23046                {
23047                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
23048                }
23049            }
23050            state.serialize_entry("customCoreCount", &__With(&self.custom_core_count))?;
23051        }
23052        if !wkt::internal::is_default(&self.state) {
23053            state.serialize_entry("state", &self.state)?;
23054        }
23055        if !self._unknown_fields.is_empty() {
23056            for (key, value) in self._unknown_fields.iter() {
23057                state.serialize_entry(key, &value)?;
23058            }
23059        }
23060        state.end()
23061    }
23062}
23063
23064impl std::fmt::Debug for Node {
23065    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23066        let mut debug_struct = f.debug_struct("Node");
23067        debug_struct.field("name", &self.name);
23068        debug_struct.field("fqdn", &self.fqdn);
23069        debug_struct.field("internal_ip", &self.internal_ip);
23070        debug_struct.field("node_type_id", &self.node_type_id);
23071        debug_struct.field("version", &self.version);
23072        debug_struct.field("custom_core_count", &self.custom_core_count);
23073        debug_struct.field("state", &self.state);
23074        if !self._unknown_fields.is_empty() {
23075            debug_struct.field("_unknown_fields", &self._unknown_fields);
23076        }
23077        debug_struct.finish()
23078    }
23079}
23080
23081/// Defines additional types related to [Node].
23082pub mod node {
23083    #[allow(unused_imports)]
23084    use super::*;
23085
23086    /// Enum State defines possible states of a node in a cluster.
23087    ///
23088    /// # Working with unknown values
23089    ///
23090    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23091    /// additional enum variants at any time. Adding new variants is not considered
23092    /// a breaking change. Applications should write their code in anticipation of:
23093    ///
23094    /// - New values appearing in future releases of the client library, **and**
23095    /// - New values received dynamically, without application changes.
23096    ///
23097    /// Please consult the [Working with enums] section in the user guide for some
23098    /// guidelines.
23099    ///
23100    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23101    #[derive(Clone, Debug, PartialEq)]
23102    #[non_exhaustive]
23103    pub enum State {
23104        /// The default value. This value should never be used.
23105        Unspecified,
23106        /// Node is operational and can be used by the user.
23107        Active,
23108        /// Node is being provisioned.
23109        Creating,
23110        /// Node is in a failed state.
23111        Failed,
23112        /// Node is undergoing maintenance, e.g.: during private cloud upgrade.
23113        Upgrading,
23114        /// If set, the enum was initialized with an unknown value.
23115        ///
23116        /// Applications can examine the value using [State::value] or
23117        /// [State::name].
23118        UnknownValue(state::UnknownValue),
23119    }
23120
23121    #[doc(hidden)]
23122    pub mod state {
23123        #[allow(unused_imports)]
23124        use super::*;
23125        #[derive(Clone, Debug, PartialEq)]
23126        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23127    }
23128
23129    impl State {
23130        /// Gets the enum value.
23131        ///
23132        /// Returns `None` if the enum contains an unknown value deserialized from
23133        /// the string representation of enums.
23134        pub fn value(&self) -> std::option::Option<i32> {
23135            match self {
23136                Self::Unspecified => std::option::Option::Some(0),
23137                Self::Active => std::option::Option::Some(1),
23138                Self::Creating => std::option::Option::Some(2),
23139                Self::Failed => std::option::Option::Some(3),
23140                Self::Upgrading => std::option::Option::Some(4),
23141                Self::UnknownValue(u) => u.0.value(),
23142            }
23143        }
23144
23145        /// Gets the enum value as a string.
23146        ///
23147        /// Returns `None` if the enum contains an unknown value deserialized from
23148        /// the integer representation of enums.
23149        pub fn name(&self) -> std::option::Option<&str> {
23150            match self {
23151                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
23152                Self::Active => std::option::Option::Some("ACTIVE"),
23153                Self::Creating => std::option::Option::Some("CREATING"),
23154                Self::Failed => std::option::Option::Some("FAILED"),
23155                Self::Upgrading => std::option::Option::Some("UPGRADING"),
23156                Self::UnknownValue(u) => u.0.name(),
23157            }
23158        }
23159    }
23160
23161    impl std::default::Default for State {
23162        fn default() -> Self {
23163            use std::convert::From;
23164            Self::from(0)
23165        }
23166    }
23167
23168    impl std::fmt::Display for State {
23169        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23170            wkt::internal::display_enum(f, self.name(), self.value())
23171        }
23172    }
23173
23174    impl std::convert::From<i32> for State {
23175        fn from(value: i32) -> Self {
23176            match value {
23177                0 => Self::Unspecified,
23178                1 => Self::Active,
23179                2 => Self::Creating,
23180                3 => Self::Failed,
23181                4 => Self::Upgrading,
23182                _ => Self::UnknownValue(state::UnknownValue(
23183                    wkt::internal::UnknownEnumValue::Integer(value),
23184                )),
23185            }
23186        }
23187    }
23188
23189    impl std::convert::From<&str> for State {
23190        fn from(value: &str) -> Self {
23191            use std::string::ToString;
23192            match value {
23193                "STATE_UNSPECIFIED" => Self::Unspecified,
23194                "ACTIVE" => Self::Active,
23195                "CREATING" => Self::Creating,
23196                "FAILED" => Self::Failed,
23197                "UPGRADING" => Self::Upgrading,
23198                _ => Self::UnknownValue(state::UnknownValue(
23199                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23200                )),
23201            }
23202        }
23203    }
23204
23205    impl serde::ser::Serialize for State {
23206        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23207        where
23208            S: serde::Serializer,
23209        {
23210            match self {
23211                Self::Unspecified => serializer.serialize_i32(0),
23212                Self::Active => serializer.serialize_i32(1),
23213                Self::Creating => serializer.serialize_i32(2),
23214                Self::Failed => serializer.serialize_i32(3),
23215                Self::Upgrading => serializer.serialize_i32(4),
23216                Self::UnknownValue(u) => u.0.serialize(serializer),
23217            }
23218        }
23219    }
23220
23221    impl<'de> serde::de::Deserialize<'de> for State {
23222        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23223        where
23224            D: serde::Deserializer<'de>,
23225        {
23226            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
23227                ".google.cloud.vmwareengine.v1.Node.State",
23228            ))
23229        }
23230    }
23231}
23232
23233/// Represents an allocated external IP address and its corresponding internal IP
23234/// address in a private cloud.
23235#[derive(Clone, Default, PartialEq)]
23236#[non_exhaustive]
23237pub struct ExternalAddress {
23238    /// Output only. The resource name of this external IP address.
23239    /// Resource names are schemeless URIs that follow the conventions in
23240    /// <https://cloud.google.com/apis/design/resource_names>.
23241    /// For example:
23242    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`
23243    pub name: std::string::String,
23244
23245    /// Output only. Creation time of this resource.
23246    pub create_time: std::option::Option<wkt::Timestamp>,
23247
23248    /// Output only. Last update time of this resource.
23249    pub update_time: std::option::Option<wkt::Timestamp>,
23250
23251    /// The internal IP address of a workload VM.
23252    pub internal_ip: std::string::String,
23253
23254    /// Output only. The external IP address of a workload VM.
23255    pub external_ip: std::string::String,
23256
23257    /// Output only. The state of the resource.
23258    pub state: crate::model::external_address::State,
23259
23260    /// Output only. System-generated unique identifier for the resource.
23261    pub uid: std::string::String,
23262
23263    /// User-provided description for this resource.
23264    pub description: std::string::String,
23265
23266    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23267}
23268
23269impl ExternalAddress {
23270    pub fn new() -> Self {
23271        std::default::Default::default()
23272    }
23273
23274    /// Sets the value of [name][crate::model::ExternalAddress::name].
23275    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23276        self.name = v.into();
23277        self
23278    }
23279
23280    /// Sets the value of [create_time][crate::model::ExternalAddress::create_time].
23281    pub fn set_create_time<T>(mut self, v: T) -> Self
23282    where
23283        T: std::convert::Into<wkt::Timestamp>,
23284    {
23285        self.create_time = std::option::Option::Some(v.into());
23286        self
23287    }
23288
23289    /// Sets or clears the value of [create_time][crate::model::ExternalAddress::create_time].
23290    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
23291    where
23292        T: std::convert::Into<wkt::Timestamp>,
23293    {
23294        self.create_time = v.map(|x| x.into());
23295        self
23296    }
23297
23298    /// Sets the value of [update_time][crate::model::ExternalAddress::update_time].
23299    pub fn set_update_time<T>(mut self, v: T) -> Self
23300    where
23301        T: std::convert::Into<wkt::Timestamp>,
23302    {
23303        self.update_time = std::option::Option::Some(v.into());
23304        self
23305    }
23306
23307    /// Sets or clears the value of [update_time][crate::model::ExternalAddress::update_time].
23308    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
23309    where
23310        T: std::convert::Into<wkt::Timestamp>,
23311    {
23312        self.update_time = v.map(|x| x.into());
23313        self
23314    }
23315
23316    /// Sets the value of [internal_ip][crate::model::ExternalAddress::internal_ip].
23317    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23318        self.internal_ip = v.into();
23319        self
23320    }
23321
23322    /// Sets the value of [external_ip][crate::model::ExternalAddress::external_ip].
23323    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23324        self.external_ip = v.into();
23325        self
23326    }
23327
23328    /// Sets the value of [state][crate::model::ExternalAddress::state].
23329    pub fn set_state<T: std::convert::Into<crate::model::external_address::State>>(
23330        mut self,
23331        v: T,
23332    ) -> Self {
23333        self.state = v.into();
23334        self
23335    }
23336
23337    /// Sets the value of [uid][crate::model::ExternalAddress::uid].
23338    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23339        self.uid = v.into();
23340        self
23341    }
23342
23343    /// Sets the value of [description][crate::model::ExternalAddress::description].
23344    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23345        self.description = v.into();
23346        self
23347    }
23348}
23349
23350impl wkt::message::Message for ExternalAddress {
23351    fn typename() -> &'static str {
23352        "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAddress"
23353    }
23354}
23355
23356#[doc(hidden)]
23357impl<'de> serde::de::Deserialize<'de> for ExternalAddress {
23358    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23359    where
23360        D: serde::Deserializer<'de>,
23361    {
23362        #[allow(non_camel_case_types)]
23363        #[doc(hidden)]
23364        #[derive(PartialEq, Eq, Hash)]
23365        enum __FieldTag {
23366            __name,
23367            __create_time,
23368            __update_time,
23369            __internal_ip,
23370            __external_ip,
23371            __state,
23372            __uid,
23373            __description,
23374            Unknown(std::string::String),
23375        }
23376        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23377            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23378            where
23379                D: serde::Deserializer<'de>,
23380            {
23381                struct Visitor;
23382                impl<'de> serde::de::Visitor<'de> for Visitor {
23383                    type Value = __FieldTag;
23384                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23385                        formatter.write_str("a field name for ExternalAddress")
23386                    }
23387                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23388                    where
23389                        E: serde::de::Error,
23390                    {
23391                        use std::result::Result::Ok;
23392                        use std::string::ToString;
23393                        match value {
23394                            "name" => Ok(__FieldTag::__name),
23395                            "createTime" => Ok(__FieldTag::__create_time),
23396                            "create_time" => Ok(__FieldTag::__create_time),
23397                            "updateTime" => Ok(__FieldTag::__update_time),
23398                            "update_time" => Ok(__FieldTag::__update_time),
23399                            "internalIp" => Ok(__FieldTag::__internal_ip),
23400                            "internal_ip" => Ok(__FieldTag::__internal_ip),
23401                            "externalIp" => Ok(__FieldTag::__external_ip),
23402                            "external_ip" => Ok(__FieldTag::__external_ip),
23403                            "state" => Ok(__FieldTag::__state),
23404                            "uid" => Ok(__FieldTag::__uid),
23405                            "description" => Ok(__FieldTag::__description),
23406                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23407                        }
23408                    }
23409                }
23410                deserializer.deserialize_identifier(Visitor)
23411            }
23412        }
23413        struct Visitor;
23414        impl<'de> serde::de::Visitor<'de> for Visitor {
23415            type Value = ExternalAddress;
23416            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23417                formatter.write_str("struct ExternalAddress")
23418            }
23419            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23420            where
23421                A: serde::de::MapAccess<'de>,
23422            {
23423                #[allow(unused_imports)]
23424                use serde::de::Error;
23425                use std::option::Option::Some;
23426                let mut fields = std::collections::HashSet::new();
23427                let mut result = Self::Value::new();
23428                while let Some(tag) = map.next_key::<__FieldTag>()? {
23429                    #[allow(clippy::match_single_binding)]
23430                    match tag {
23431                        __FieldTag::__name => {
23432                            if !fields.insert(__FieldTag::__name) {
23433                                return std::result::Result::Err(A::Error::duplicate_field(
23434                                    "multiple values for name",
23435                                ));
23436                            }
23437                            result.name = map
23438                                .next_value::<std::option::Option<std::string::String>>()?
23439                                .unwrap_or_default();
23440                        }
23441                        __FieldTag::__create_time => {
23442                            if !fields.insert(__FieldTag::__create_time) {
23443                                return std::result::Result::Err(A::Error::duplicate_field(
23444                                    "multiple values for create_time",
23445                                ));
23446                            }
23447                            result.create_time =
23448                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
23449                        }
23450                        __FieldTag::__update_time => {
23451                            if !fields.insert(__FieldTag::__update_time) {
23452                                return std::result::Result::Err(A::Error::duplicate_field(
23453                                    "multiple values for update_time",
23454                                ));
23455                            }
23456                            result.update_time =
23457                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
23458                        }
23459                        __FieldTag::__internal_ip => {
23460                            if !fields.insert(__FieldTag::__internal_ip) {
23461                                return std::result::Result::Err(A::Error::duplicate_field(
23462                                    "multiple values for internal_ip",
23463                                ));
23464                            }
23465                            result.internal_ip = map
23466                                .next_value::<std::option::Option<std::string::String>>()?
23467                                .unwrap_or_default();
23468                        }
23469                        __FieldTag::__external_ip => {
23470                            if !fields.insert(__FieldTag::__external_ip) {
23471                                return std::result::Result::Err(A::Error::duplicate_field(
23472                                    "multiple values for external_ip",
23473                                ));
23474                            }
23475                            result.external_ip = map
23476                                .next_value::<std::option::Option<std::string::String>>()?
23477                                .unwrap_or_default();
23478                        }
23479                        __FieldTag::__state => {
23480                            if !fields.insert(__FieldTag::__state) {
23481                                return std::result::Result::Err(A::Error::duplicate_field(
23482                                    "multiple values for state",
23483                                ));
23484                            }
23485                            result.state = map.next_value::<std::option::Option<crate::model::external_address::State>>()?.unwrap_or_default();
23486                        }
23487                        __FieldTag::__uid => {
23488                            if !fields.insert(__FieldTag::__uid) {
23489                                return std::result::Result::Err(A::Error::duplicate_field(
23490                                    "multiple values for uid",
23491                                ));
23492                            }
23493                            result.uid = map
23494                                .next_value::<std::option::Option<std::string::String>>()?
23495                                .unwrap_or_default();
23496                        }
23497                        __FieldTag::__description => {
23498                            if !fields.insert(__FieldTag::__description) {
23499                                return std::result::Result::Err(A::Error::duplicate_field(
23500                                    "multiple values for description",
23501                                ));
23502                            }
23503                            result.description = map
23504                                .next_value::<std::option::Option<std::string::String>>()?
23505                                .unwrap_or_default();
23506                        }
23507                        __FieldTag::Unknown(key) => {
23508                            let value = map.next_value::<serde_json::Value>()?;
23509                            result._unknown_fields.insert(key, value);
23510                        }
23511                    }
23512                }
23513                std::result::Result::Ok(result)
23514            }
23515        }
23516        deserializer.deserialize_any(Visitor)
23517    }
23518}
23519
23520#[doc(hidden)]
23521impl serde::ser::Serialize for ExternalAddress {
23522    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23523    where
23524        S: serde::ser::Serializer,
23525    {
23526        use serde::ser::SerializeMap;
23527        #[allow(unused_imports)]
23528        use std::option::Option::Some;
23529        let mut state = serializer.serialize_map(std::option::Option::None)?;
23530        if !self.name.is_empty() {
23531            state.serialize_entry("name", &self.name)?;
23532        }
23533        if self.create_time.is_some() {
23534            state.serialize_entry("createTime", &self.create_time)?;
23535        }
23536        if self.update_time.is_some() {
23537            state.serialize_entry("updateTime", &self.update_time)?;
23538        }
23539        if !self.internal_ip.is_empty() {
23540            state.serialize_entry("internalIp", &self.internal_ip)?;
23541        }
23542        if !self.external_ip.is_empty() {
23543            state.serialize_entry("externalIp", &self.external_ip)?;
23544        }
23545        if !wkt::internal::is_default(&self.state) {
23546            state.serialize_entry("state", &self.state)?;
23547        }
23548        if !self.uid.is_empty() {
23549            state.serialize_entry("uid", &self.uid)?;
23550        }
23551        if !self.description.is_empty() {
23552            state.serialize_entry("description", &self.description)?;
23553        }
23554        if !self._unknown_fields.is_empty() {
23555            for (key, value) in self._unknown_fields.iter() {
23556                state.serialize_entry(key, &value)?;
23557            }
23558        }
23559        state.end()
23560    }
23561}
23562
23563impl std::fmt::Debug for ExternalAddress {
23564    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23565        let mut debug_struct = f.debug_struct("ExternalAddress");
23566        debug_struct.field("name", &self.name);
23567        debug_struct.field("create_time", &self.create_time);
23568        debug_struct.field("update_time", &self.update_time);
23569        debug_struct.field("internal_ip", &self.internal_ip);
23570        debug_struct.field("external_ip", &self.external_ip);
23571        debug_struct.field("state", &self.state);
23572        debug_struct.field("uid", &self.uid);
23573        debug_struct.field("description", &self.description);
23574        if !self._unknown_fields.is_empty() {
23575            debug_struct.field("_unknown_fields", &self._unknown_fields);
23576        }
23577        debug_struct.finish()
23578    }
23579}
23580
23581/// Defines additional types related to [ExternalAddress].
23582pub mod external_address {
23583    #[allow(unused_imports)]
23584    use super::*;
23585
23586    /// Enum State defines possible states of external addresses.
23587    ///
23588    /// # Working with unknown values
23589    ///
23590    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23591    /// additional enum variants at any time. Adding new variants is not considered
23592    /// a breaking change. Applications should write their code in anticipation of:
23593    ///
23594    /// - New values appearing in future releases of the client library, **and**
23595    /// - New values received dynamically, without application changes.
23596    ///
23597    /// Please consult the [Working with enums] section in the user guide for some
23598    /// guidelines.
23599    ///
23600    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23601    #[derive(Clone, Debug, PartialEq)]
23602    #[non_exhaustive]
23603    pub enum State {
23604        /// The default value. This value should never be used.
23605        Unspecified,
23606        /// The address is ready.
23607        Active,
23608        /// The address is being created.
23609        Creating,
23610        /// The address is being updated.
23611        Updating,
23612        /// The address is being deleted.
23613        Deleting,
23614        /// If set, the enum was initialized with an unknown value.
23615        ///
23616        /// Applications can examine the value using [State::value] or
23617        /// [State::name].
23618        UnknownValue(state::UnknownValue),
23619    }
23620
23621    #[doc(hidden)]
23622    pub mod state {
23623        #[allow(unused_imports)]
23624        use super::*;
23625        #[derive(Clone, Debug, PartialEq)]
23626        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23627    }
23628
23629    impl State {
23630        /// Gets the enum value.
23631        ///
23632        /// Returns `None` if the enum contains an unknown value deserialized from
23633        /// the string representation of enums.
23634        pub fn value(&self) -> std::option::Option<i32> {
23635            match self {
23636                Self::Unspecified => std::option::Option::Some(0),
23637                Self::Active => std::option::Option::Some(1),
23638                Self::Creating => std::option::Option::Some(2),
23639                Self::Updating => std::option::Option::Some(3),
23640                Self::Deleting => std::option::Option::Some(4),
23641                Self::UnknownValue(u) => u.0.value(),
23642            }
23643        }
23644
23645        /// Gets the enum value as a string.
23646        ///
23647        /// Returns `None` if the enum contains an unknown value deserialized from
23648        /// the integer representation of enums.
23649        pub fn name(&self) -> std::option::Option<&str> {
23650            match self {
23651                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
23652                Self::Active => std::option::Option::Some("ACTIVE"),
23653                Self::Creating => std::option::Option::Some("CREATING"),
23654                Self::Updating => std::option::Option::Some("UPDATING"),
23655                Self::Deleting => std::option::Option::Some("DELETING"),
23656                Self::UnknownValue(u) => u.0.name(),
23657            }
23658        }
23659    }
23660
23661    impl std::default::Default for State {
23662        fn default() -> Self {
23663            use std::convert::From;
23664            Self::from(0)
23665        }
23666    }
23667
23668    impl std::fmt::Display for State {
23669        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23670            wkt::internal::display_enum(f, self.name(), self.value())
23671        }
23672    }
23673
23674    impl std::convert::From<i32> for State {
23675        fn from(value: i32) -> Self {
23676            match value {
23677                0 => Self::Unspecified,
23678                1 => Self::Active,
23679                2 => Self::Creating,
23680                3 => Self::Updating,
23681                4 => Self::Deleting,
23682                _ => Self::UnknownValue(state::UnknownValue(
23683                    wkt::internal::UnknownEnumValue::Integer(value),
23684                )),
23685            }
23686        }
23687    }
23688
23689    impl std::convert::From<&str> for State {
23690        fn from(value: &str) -> Self {
23691            use std::string::ToString;
23692            match value {
23693                "STATE_UNSPECIFIED" => Self::Unspecified,
23694                "ACTIVE" => Self::Active,
23695                "CREATING" => Self::Creating,
23696                "UPDATING" => Self::Updating,
23697                "DELETING" => Self::Deleting,
23698                _ => Self::UnknownValue(state::UnknownValue(
23699                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23700                )),
23701            }
23702        }
23703    }
23704
23705    impl serde::ser::Serialize for State {
23706        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23707        where
23708            S: serde::Serializer,
23709        {
23710            match self {
23711                Self::Unspecified => serializer.serialize_i32(0),
23712                Self::Active => serializer.serialize_i32(1),
23713                Self::Creating => serializer.serialize_i32(2),
23714                Self::Updating => serializer.serialize_i32(3),
23715                Self::Deleting => serializer.serialize_i32(4),
23716                Self::UnknownValue(u) => u.0.serialize(serializer),
23717            }
23718        }
23719    }
23720
23721    impl<'de> serde::de::Deserialize<'de> for State {
23722        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23723        where
23724            D: serde::Deserializer<'de>,
23725        {
23726            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
23727                ".google.cloud.vmwareengine.v1.ExternalAddress.State",
23728            ))
23729        }
23730    }
23731}
23732
23733/// Subnet in a private cloud. Either `management` subnets (such as vMotion) that
23734/// are read-only, or `userDefined`, which can also be updated.
23735#[derive(Clone, Default, PartialEq)]
23736#[non_exhaustive]
23737pub struct Subnet {
23738    /// Output only. The resource name of this subnet.
23739    /// Resource names are schemeless URIs that follow the conventions in
23740    /// <https://cloud.google.com/apis/design/resource_names>.
23741    /// For example:
23742    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
23743    pub name: std::string::String,
23744
23745    /// The IP address range of the subnet in CIDR format '10.0.0.0/24'.
23746    pub ip_cidr_range: std::string::String,
23747
23748    /// The IP address of the gateway of this subnet.
23749    /// Must fall within the IP prefix defined above.
23750    pub gateway_ip: std::string::String,
23751
23752    /// Output only. The type of the subnet. For example "management" or
23753    /// "userDefined".
23754    pub r#type: std::string::String,
23755
23756    /// Output only. The state of the resource.
23757    pub state: crate::model::subnet::State,
23758
23759    /// Output only. VLAN ID of the VLAN on which the subnet is configured
23760    pub vlan_id: i32,
23761
23762    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23763}
23764
23765impl Subnet {
23766    pub fn new() -> Self {
23767        std::default::Default::default()
23768    }
23769
23770    /// Sets the value of [name][crate::model::Subnet::name].
23771    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23772        self.name = v.into();
23773        self
23774    }
23775
23776    /// Sets the value of [ip_cidr_range][crate::model::Subnet::ip_cidr_range].
23777    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23778        self.ip_cidr_range = v.into();
23779        self
23780    }
23781
23782    /// Sets the value of [gateway_ip][crate::model::Subnet::gateway_ip].
23783    pub fn set_gateway_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23784        self.gateway_ip = v.into();
23785        self
23786    }
23787
23788    /// Sets the value of [r#type][crate::model::Subnet::type].
23789    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23790        self.r#type = v.into();
23791        self
23792    }
23793
23794    /// Sets the value of [state][crate::model::Subnet::state].
23795    pub fn set_state<T: std::convert::Into<crate::model::subnet::State>>(mut self, v: T) -> Self {
23796        self.state = v.into();
23797        self
23798    }
23799
23800    /// Sets the value of [vlan_id][crate::model::Subnet::vlan_id].
23801    pub fn set_vlan_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23802        self.vlan_id = v.into();
23803        self
23804    }
23805}
23806
23807impl wkt::message::Message for Subnet {
23808    fn typename() -> &'static str {
23809        "type.googleapis.com/google.cloud.vmwareengine.v1.Subnet"
23810    }
23811}
23812
23813#[doc(hidden)]
23814impl<'de> serde::de::Deserialize<'de> for Subnet {
23815    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23816    where
23817        D: serde::Deserializer<'de>,
23818    {
23819        #[allow(non_camel_case_types)]
23820        #[doc(hidden)]
23821        #[derive(PartialEq, Eq, Hash)]
23822        enum __FieldTag {
23823            __name,
23824            __ip_cidr_range,
23825            __gateway_ip,
23826            __type,
23827            __state,
23828            __vlan_id,
23829            Unknown(std::string::String),
23830        }
23831        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23832            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23833            where
23834                D: serde::Deserializer<'de>,
23835            {
23836                struct Visitor;
23837                impl<'de> serde::de::Visitor<'de> for Visitor {
23838                    type Value = __FieldTag;
23839                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23840                        formatter.write_str("a field name for Subnet")
23841                    }
23842                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23843                    where
23844                        E: serde::de::Error,
23845                    {
23846                        use std::result::Result::Ok;
23847                        use std::string::ToString;
23848                        match value {
23849                            "name" => Ok(__FieldTag::__name),
23850                            "ipCidrRange" => Ok(__FieldTag::__ip_cidr_range),
23851                            "ip_cidr_range" => Ok(__FieldTag::__ip_cidr_range),
23852                            "gatewayIp" => Ok(__FieldTag::__gateway_ip),
23853                            "gateway_ip" => Ok(__FieldTag::__gateway_ip),
23854                            "type" => Ok(__FieldTag::__type),
23855                            "state" => Ok(__FieldTag::__state),
23856                            "vlanId" => Ok(__FieldTag::__vlan_id),
23857                            "vlan_id" => Ok(__FieldTag::__vlan_id),
23858                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23859                        }
23860                    }
23861                }
23862                deserializer.deserialize_identifier(Visitor)
23863            }
23864        }
23865        struct Visitor;
23866        impl<'de> serde::de::Visitor<'de> for Visitor {
23867            type Value = Subnet;
23868            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23869                formatter.write_str("struct Subnet")
23870            }
23871            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23872            where
23873                A: serde::de::MapAccess<'de>,
23874            {
23875                #[allow(unused_imports)]
23876                use serde::de::Error;
23877                use std::option::Option::Some;
23878                let mut fields = std::collections::HashSet::new();
23879                let mut result = Self::Value::new();
23880                while let Some(tag) = map.next_key::<__FieldTag>()? {
23881                    #[allow(clippy::match_single_binding)]
23882                    match tag {
23883                        __FieldTag::__name => {
23884                            if !fields.insert(__FieldTag::__name) {
23885                                return std::result::Result::Err(A::Error::duplicate_field(
23886                                    "multiple values for name",
23887                                ));
23888                            }
23889                            result.name = map
23890                                .next_value::<std::option::Option<std::string::String>>()?
23891                                .unwrap_or_default();
23892                        }
23893                        __FieldTag::__ip_cidr_range => {
23894                            if !fields.insert(__FieldTag::__ip_cidr_range) {
23895                                return std::result::Result::Err(A::Error::duplicate_field(
23896                                    "multiple values for ip_cidr_range",
23897                                ));
23898                            }
23899                            result.ip_cidr_range = map
23900                                .next_value::<std::option::Option<std::string::String>>()?
23901                                .unwrap_or_default();
23902                        }
23903                        __FieldTag::__gateway_ip => {
23904                            if !fields.insert(__FieldTag::__gateway_ip) {
23905                                return std::result::Result::Err(A::Error::duplicate_field(
23906                                    "multiple values for gateway_ip",
23907                                ));
23908                            }
23909                            result.gateway_ip = map
23910                                .next_value::<std::option::Option<std::string::String>>()?
23911                                .unwrap_or_default();
23912                        }
23913                        __FieldTag::__type => {
23914                            if !fields.insert(__FieldTag::__type) {
23915                                return std::result::Result::Err(A::Error::duplicate_field(
23916                                    "multiple values for type",
23917                                ));
23918                            }
23919                            result.r#type = map
23920                                .next_value::<std::option::Option<std::string::String>>()?
23921                                .unwrap_or_default();
23922                        }
23923                        __FieldTag::__state => {
23924                            if !fields.insert(__FieldTag::__state) {
23925                                return std::result::Result::Err(A::Error::duplicate_field(
23926                                    "multiple values for state",
23927                                ));
23928                            }
23929                            result.state = map
23930                                .next_value::<std::option::Option<crate::model::subnet::State>>()?
23931                                .unwrap_or_default();
23932                        }
23933                        __FieldTag::__vlan_id => {
23934                            if !fields.insert(__FieldTag::__vlan_id) {
23935                                return std::result::Result::Err(A::Error::duplicate_field(
23936                                    "multiple values for vlan_id",
23937                                ));
23938                            }
23939                            struct __With(std::option::Option<i32>);
23940                            impl<'de> serde::de::Deserialize<'de> for __With {
23941                                fn deserialize<D>(
23942                                    deserializer: D,
23943                                ) -> std::result::Result<Self, D::Error>
23944                                where
23945                                    D: serde::de::Deserializer<'de>,
23946                                {
23947                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23948                                }
23949                            }
23950                            result.vlan_id = map.next_value::<__With>()?.0.unwrap_or_default();
23951                        }
23952                        __FieldTag::Unknown(key) => {
23953                            let value = map.next_value::<serde_json::Value>()?;
23954                            result._unknown_fields.insert(key, value);
23955                        }
23956                    }
23957                }
23958                std::result::Result::Ok(result)
23959            }
23960        }
23961        deserializer.deserialize_any(Visitor)
23962    }
23963}
23964
23965#[doc(hidden)]
23966impl serde::ser::Serialize for Subnet {
23967    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23968    where
23969        S: serde::ser::Serializer,
23970    {
23971        use serde::ser::SerializeMap;
23972        #[allow(unused_imports)]
23973        use std::option::Option::Some;
23974        let mut state = serializer.serialize_map(std::option::Option::None)?;
23975        if !self.name.is_empty() {
23976            state.serialize_entry("name", &self.name)?;
23977        }
23978        if !self.ip_cidr_range.is_empty() {
23979            state.serialize_entry("ipCidrRange", &self.ip_cidr_range)?;
23980        }
23981        if !self.gateway_ip.is_empty() {
23982            state.serialize_entry("gatewayIp", &self.gateway_ip)?;
23983        }
23984        if !self.r#type.is_empty() {
23985            state.serialize_entry("type", &self.r#type)?;
23986        }
23987        if !wkt::internal::is_default(&self.state) {
23988            state.serialize_entry("state", &self.state)?;
23989        }
23990        if !wkt::internal::is_default(&self.vlan_id) {
23991            struct __With<'a>(&'a i32);
23992            impl<'a> serde::ser::Serialize for __With<'a> {
23993                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23994                where
23995                    S: serde::ser::Serializer,
23996                {
23997                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
23998                }
23999            }
24000            state.serialize_entry("vlanId", &__With(&self.vlan_id))?;
24001        }
24002        if !self._unknown_fields.is_empty() {
24003            for (key, value) in self._unknown_fields.iter() {
24004                state.serialize_entry(key, &value)?;
24005            }
24006        }
24007        state.end()
24008    }
24009}
24010
24011impl std::fmt::Debug for Subnet {
24012    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24013        let mut debug_struct = f.debug_struct("Subnet");
24014        debug_struct.field("name", &self.name);
24015        debug_struct.field("ip_cidr_range", &self.ip_cidr_range);
24016        debug_struct.field("gateway_ip", &self.gateway_ip);
24017        debug_struct.field("r#type", &self.r#type);
24018        debug_struct.field("state", &self.state);
24019        debug_struct.field("vlan_id", &self.vlan_id);
24020        if !self._unknown_fields.is_empty() {
24021            debug_struct.field("_unknown_fields", &self._unknown_fields);
24022        }
24023        debug_struct.finish()
24024    }
24025}
24026
24027/// Defines additional types related to [Subnet].
24028pub mod subnet {
24029    #[allow(unused_imports)]
24030    use super::*;
24031
24032    /// Defines possible states of subnets.
24033    ///
24034    /// # Working with unknown values
24035    ///
24036    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24037    /// additional enum variants at any time. Adding new variants is not considered
24038    /// a breaking change. Applications should write their code in anticipation of:
24039    ///
24040    /// - New values appearing in future releases of the client library, **and**
24041    /// - New values received dynamically, without application changes.
24042    ///
24043    /// Please consult the [Working with enums] section in the user guide for some
24044    /// guidelines.
24045    ///
24046    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24047    #[derive(Clone, Debug, PartialEq)]
24048    #[non_exhaustive]
24049    pub enum State {
24050        /// The default value. This value should never be used.
24051        Unspecified,
24052        /// The subnet is ready.
24053        Active,
24054        /// The subnet is being created.
24055        Creating,
24056        /// The subnet is being updated.
24057        Updating,
24058        /// The subnet is being deleted.
24059        Deleting,
24060        /// Changes requested in the last operation are being propagated.
24061        Reconciling,
24062        /// Last operation on the subnet did not succeed. Subnet's payload is
24063        /// reverted back to its most recent working state.
24064        Failed,
24065        /// If set, the enum was initialized with an unknown value.
24066        ///
24067        /// Applications can examine the value using [State::value] or
24068        /// [State::name].
24069        UnknownValue(state::UnknownValue),
24070    }
24071
24072    #[doc(hidden)]
24073    pub mod state {
24074        #[allow(unused_imports)]
24075        use super::*;
24076        #[derive(Clone, Debug, PartialEq)]
24077        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24078    }
24079
24080    impl State {
24081        /// Gets the enum value.
24082        ///
24083        /// Returns `None` if the enum contains an unknown value deserialized from
24084        /// the string representation of enums.
24085        pub fn value(&self) -> std::option::Option<i32> {
24086            match self {
24087                Self::Unspecified => std::option::Option::Some(0),
24088                Self::Active => std::option::Option::Some(1),
24089                Self::Creating => std::option::Option::Some(2),
24090                Self::Updating => std::option::Option::Some(3),
24091                Self::Deleting => std::option::Option::Some(4),
24092                Self::Reconciling => std::option::Option::Some(5),
24093                Self::Failed => std::option::Option::Some(6),
24094                Self::UnknownValue(u) => u.0.value(),
24095            }
24096        }
24097
24098        /// Gets the enum value as a string.
24099        ///
24100        /// Returns `None` if the enum contains an unknown value deserialized from
24101        /// the integer representation of enums.
24102        pub fn name(&self) -> std::option::Option<&str> {
24103            match self {
24104                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
24105                Self::Active => std::option::Option::Some("ACTIVE"),
24106                Self::Creating => std::option::Option::Some("CREATING"),
24107                Self::Updating => std::option::Option::Some("UPDATING"),
24108                Self::Deleting => std::option::Option::Some("DELETING"),
24109                Self::Reconciling => std::option::Option::Some("RECONCILING"),
24110                Self::Failed => std::option::Option::Some("FAILED"),
24111                Self::UnknownValue(u) => u.0.name(),
24112            }
24113        }
24114    }
24115
24116    impl std::default::Default for State {
24117        fn default() -> Self {
24118            use std::convert::From;
24119            Self::from(0)
24120        }
24121    }
24122
24123    impl std::fmt::Display for State {
24124        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24125            wkt::internal::display_enum(f, self.name(), self.value())
24126        }
24127    }
24128
24129    impl std::convert::From<i32> for State {
24130        fn from(value: i32) -> Self {
24131            match value {
24132                0 => Self::Unspecified,
24133                1 => Self::Active,
24134                2 => Self::Creating,
24135                3 => Self::Updating,
24136                4 => Self::Deleting,
24137                5 => Self::Reconciling,
24138                6 => Self::Failed,
24139                _ => Self::UnknownValue(state::UnknownValue(
24140                    wkt::internal::UnknownEnumValue::Integer(value),
24141                )),
24142            }
24143        }
24144    }
24145
24146    impl std::convert::From<&str> for State {
24147        fn from(value: &str) -> Self {
24148            use std::string::ToString;
24149            match value {
24150                "STATE_UNSPECIFIED" => Self::Unspecified,
24151                "ACTIVE" => Self::Active,
24152                "CREATING" => Self::Creating,
24153                "UPDATING" => Self::Updating,
24154                "DELETING" => Self::Deleting,
24155                "RECONCILING" => Self::Reconciling,
24156                "FAILED" => Self::Failed,
24157                _ => Self::UnknownValue(state::UnknownValue(
24158                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24159                )),
24160            }
24161        }
24162    }
24163
24164    impl serde::ser::Serialize for State {
24165        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24166        where
24167            S: serde::Serializer,
24168        {
24169            match self {
24170                Self::Unspecified => serializer.serialize_i32(0),
24171                Self::Active => serializer.serialize_i32(1),
24172                Self::Creating => serializer.serialize_i32(2),
24173                Self::Updating => serializer.serialize_i32(3),
24174                Self::Deleting => serializer.serialize_i32(4),
24175                Self::Reconciling => serializer.serialize_i32(5),
24176                Self::Failed => serializer.serialize_i32(6),
24177                Self::UnknownValue(u) => u.0.serialize(serializer),
24178            }
24179        }
24180    }
24181
24182    impl<'de> serde::de::Deserialize<'de> for State {
24183        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24184        where
24185            D: serde::Deserializer<'de>,
24186        {
24187            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
24188                ".google.cloud.vmwareengine.v1.Subnet.State",
24189            ))
24190        }
24191    }
24192}
24193
24194/// External access firewall rules for filtering incoming traffic destined to
24195/// `ExternalAddress` resources.
24196#[derive(Clone, Default, PartialEq)]
24197#[non_exhaustive]
24198pub struct ExternalAccessRule {
24199    /// Output only. The resource name of this external access rule.
24200    /// Resource names are schemeless URIs that follow the conventions in
24201    /// <https://cloud.google.com/apis/design/resource_names>.
24202    /// For example:
24203    /// `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`
24204    pub name: std::string::String,
24205
24206    /// Output only. Creation time of this resource.
24207    pub create_time: std::option::Option<wkt::Timestamp>,
24208
24209    /// Output only. Last update time of this resource.
24210    pub update_time: std::option::Option<wkt::Timestamp>,
24211
24212    /// User-provided description for this external access rule.
24213    pub description: std::string::String,
24214
24215    /// External access rule priority, which determines the external access rule to
24216    /// use when multiple rules apply. If multiple rules have the same priority,
24217    /// their ordering is non-deterministic. If specific ordering is required,
24218    /// assign unique priorities to enforce such ordering. The external access rule
24219    /// priority is an integer from 100 to 4096, both inclusive. Lower integers
24220    /// indicate higher precedence. For example, a rule with priority `100` has
24221    /// higher precedence than a rule with priority `101`.
24222    pub priority: i32,
24223
24224    /// The action that the external access rule performs.
24225    pub action: crate::model::external_access_rule::Action,
24226
24227    /// The IP protocol to which the external access rule applies. This value can
24228    /// be one of the following three protocol strings (not case-sensitive):
24229    /// `tcp`, `udp`, or `icmp`.
24230    pub ip_protocol: std::string::String,
24231
24232    /// If source ranges are specified, the external access rule applies only to
24233    /// traffic that has a source IP address in these ranges. These ranges can
24234    /// either be expressed in the CIDR format or as an IP address. As only inbound
24235    /// rules are supported, `ExternalAddress` resources cannot be the source IP
24236    /// addresses of an external access rule. To match all source addresses,
24237    /// specify `0.0.0.0/0`.
24238    pub source_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
24239
24240    /// A list of source ports to which the external access rule applies. This
24241    /// field is only applicable for the UDP or TCP protocol.
24242    /// Each entry must be either an integer or a range. For example: `["22"]`,
24243    /// `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
24244    /// `["0-65535"]`.
24245    pub source_ports: std::vec::Vec<std::string::String>,
24246
24247    /// If destination ranges are specified, the external access rule applies only
24248    /// to the traffic that has a destination IP address in these ranges. The
24249    /// specified IP addresses must have reserved external IP addresses in the
24250    /// scope of the parent network policy. To match all external IP addresses in
24251    /// the scope of the parent network policy, specify `0.0.0.0/0`. To match a
24252    /// specific external IP address, specify it using the
24253    /// `IpRange.external_address` property.
24254    pub destination_ip_ranges: std::vec::Vec<crate::model::external_access_rule::IpRange>,
24255
24256    /// A list of destination ports to which the external access rule applies. This
24257    /// field is only applicable for the UDP or TCP protocol.
24258    /// Each entry must be either an integer or a range. For example: `["22"]`,
24259    /// `["80","443"]`, or `["12345-12349"]`. To match all destination ports,
24260    /// specify `["0-65535"]`.
24261    pub destination_ports: std::vec::Vec<std::string::String>,
24262
24263    /// Output only. The state of the resource.
24264    pub state: crate::model::external_access_rule::State,
24265
24266    /// Output only. System-generated unique identifier for the resource.
24267    pub uid: std::string::String,
24268
24269    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24270}
24271
24272impl ExternalAccessRule {
24273    pub fn new() -> Self {
24274        std::default::Default::default()
24275    }
24276
24277    /// Sets the value of [name][crate::model::ExternalAccessRule::name].
24278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24279        self.name = v.into();
24280        self
24281    }
24282
24283    /// Sets the value of [create_time][crate::model::ExternalAccessRule::create_time].
24284    pub fn set_create_time<T>(mut self, v: T) -> Self
24285    where
24286        T: std::convert::Into<wkt::Timestamp>,
24287    {
24288        self.create_time = std::option::Option::Some(v.into());
24289        self
24290    }
24291
24292    /// Sets or clears the value of [create_time][crate::model::ExternalAccessRule::create_time].
24293    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24294    where
24295        T: std::convert::Into<wkt::Timestamp>,
24296    {
24297        self.create_time = v.map(|x| x.into());
24298        self
24299    }
24300
24301    /// Sets the value of [update_time][crate::model::ExternalAccessRule::update_time].
24302    pub fn set_update_time<T>(mut self, v: T) -> Self
24303    where
24304        T: std::convert::Into<wkt::Timestamp>,
24305    {
24306        self.update_time = std::option::Option::Some(v.into());
24307        self
24308    }
24309
24310    /// Sets or clears the value of [update_time][crate::model::ExternalAccessRule::update_time].
24311    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24312    where
24313        T: std::convert::Into<wkt::Timestamp>,
24314    {
24315        self.update_time = v.map(|x| x.into());
24316        self
24317    }
24318
24319    /// Sets the value of [description][crate::model::ExternalAccessRule::description].
24320    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24321        self.description = v.into();
24322        self
24323    }
24324
24325    /// Sets the value of [priority][crate::model::ExternalAccessRule::priority].
24326    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24327        self.priority = v.into();
24328        self
24329    }
24330
24331    /// Sets the value of [action][crate::model::ExternalAccessRule::action].
24332    pub fn set_action<T: std::convert::Into<crate::model::external_access_rule::Action>>(
24333        mut self,
24334        v: T,
24335    ) -> Self {
24336        self.action = v.into();
24337        self
24338    }
24339
24340    /// Sets the value of [ip_protocol][crate::model::ExternalAccessRule::ip_protocol].
24341    pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24342        self.ip_protocol = v.into();
24343        self
24344    }
24345
24346    /// Sets the value of [source_ip_ranges][crate::model::ExternalAccessRule::source_ip_ranges].
24347    pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
24348    where
24349        T: std::iter::IntoIterator<Item = V>,
24350        V: std::convert::Into<crate::model::external_access_rule::IpRange>,
24351    {
24352        use std::iter::Iterator;
24353        self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
24354        self
24355    }
24356
24357    /// Sets the value of [source_ports][crate::model::ExternalAccessRule::source_ports].
24358    pub fn set_source_ports<T, V>(mut self, v: T) -> Self
24359    where
24360        T: std::iter::IntoIterator<Item = V>,
24361        V: std::convert::Into<std::string::String>,
24362    {
24363        use std::iter::Iterator;
24364        self.source_ports = v.into_iter().map(|i| i.into()).collect();
24365        self
24366    }
24367
24368    /// Sets the value of [destination_ip_ranges][crate::model::ExternalAccessRule::destination_ip_ranges].
24369    pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
24370    where
24371        T: std::iter::IntoIterator<Item = V>,
24372        V: std::convert::Into<crate::model::external_access_rule::IpRange>,
24373    {
24374        use std::iter::Iterator;
24375        self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
24376        self
24377    }
24378
24379    /// Sets the value of [destination_ports][crate::model::ExternalAccessRule::destination_ports].
24380    pub fn set_destination_ports<T, V>(mut self, v: T) -> Self
24381    where
24382        T: std::iter::IntoIterator<Item = V>,
24383        V: std::convert::Into<std::string::String>,
24384    {
24385        use std::iter::Iterator;
24386        self.destination_ports = v.into_iter().map(|i| i.into()).collect();
24387        self
24388    }
24389
24390    /// Sets the value of [state][crate::model::ExternalAccessRule::state].
24391    pub fn set_state<T: std::convert::Into<crate::model::external_access_rule::State>>(
24392        mut self,
24393        v: T,
24394    ) -> Self {
24395        self.state = v.into();
24396        self
24397    }
24398
24399    /// Sets the value of [uid][crate::model::ExternalAccessRule::uid].
24400    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24401        self.uid = v.into();
24402        self
24403    }
24404}
24405
24406impl wkt::message::Message for ExternalAccessRule {
24407    fn typename() -> &'static str {
24408        "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule"
24409    }
24410}
24411
24412#[doc(hidden)]
24413impl<'de> serde::de::Deserialize<'de> for ExternalAccessRule {
24414    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24415    where
24416        D: serde::Deserializer<'de>,
24417    {
24418        #[allow(non_camel_case_types)]
24419        #[doc(hidden)]
24420        #[derive(PartialEq, Eq, Hash)]
24421        enum __FieldTag {
24422            __name,
24423            __create_time,
24424            __update_time,
24425            __description,
24426            __priority,
24427            __action,
24428            __ip_protocol,
24429            __source_ip_ranges,
24430            __source_ports,
24431            __destination_ip_ranges,
24432            __destination_ports,
24433            __state,
24434            __uid,
24435            Unknown(std::string::String),
24436        }
24437        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24438            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24439            where
24440                D: serde::Deserializer<'de>,
24441            {
24442                struct Visitor;
24443                impl<'de> serde::de::Visitor<'de> for Visitor {
24444                    type Value = __FieldTag;
24445                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24446                        formatter.write_str("a field name for ExternalAccessRule")
24447                    }
24448                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24449                    where
24450                        E: serde::de::Error,
24451                    {
24452                        use std::result::Result::Ok;
24453                        use std::string::ToString;
24454                        match value {
24455                            "name" => Ok(__FieldTag::__name),
24456                            "createTime" => Ok(__FieldTag::__create_time),
24457                            "create_time" => Ok(__FieldTag::__create_time),
24458                            "updateTime" => Ok(__FieldTag::__update_time),
24459                            "update_time" => Ok(__FieldTag::__update_time),
24460                            "description" => Ok(__FieldTag::__description),
24461                            "priority" => Ok(__FieldTag::__priority),
24462                            "action" => Ok(__FieldTag::__action),
24463                            "ipProtocol" => Ok(__FieldTag::__ip_protocol),
24464                            "ip_protocol" => Ok(__FieldTag::__ip_protocol),
24465                            "sourceIpRanges" => Ok(__FieldTag::__source_ip_ranges),
24466                            "source_ip_ranges" => Ok(__FieldTag::__source_ip_ranges),
24467                            "sourcePorts" => Ok(__FieldTag::__source_ports),
24468                            "source_ports" => Ok(__FieldTag::__source_ports),
24469                            "destinationIpRanges" => Ok(__FieldTag::__destination_ip_ranges),
24470                            "destination_ip_ranges" => Ok(__FieldTag::__destination_ip_ranges),
24471                            "destinationPorts" => Ok(__FieldTag::__destination_ports),
24472                            "destination_ports" => Ok(__FieldTag::__destination_ports),
24473                            "state" => Ok(__FieldTag::__state),
24474                            "uid" => Ok(__FieldTag::__uid),
24475                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24476                        }
24477                    }
24478                }
24479                deserializer.deserialize_identifier(Visitor)
24480            }
24481        }
24482        struct Visitor;
24483        impl<'de> serde::de::Visitor<'de> for Visitor {
24484            type Value = ExternalAccessRule;
24485            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24486                formatter.write_str("struct ExternalAccessRule")
24487            }
24488            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24489            where
24490                A: serde::de::MapAccess<'de>,
24491            {
24492                #[allow(unused_imports)]
24493                use serde::de::Error;
24494                use std::option::Option::Some;
24495                let mut fields = std::collections::HashSet::new();
24496                let mut result = Self::Value::new();
24497                while let Some(tag) = map.next_key::<__FieldTag>()? {
24498                    #[allow(clippy::match_single_binding)]
24499                    match tag {
24500                        __FieldTag::__name => {
24501                            if !fields.insert(__FieldTag::__name) {
24502                                return std::result::Result::Err(A::Error::duplicate_field(
24503                                    "multiple values for name",
24504                                ));
24505                            }
24506                            result.name = map
24507                                .next_value::<std::option::Option<std::string::String>>()?
24508                                .unwrap_or_default();
24509                        }
24510                        __FieldTag::__create_time => {
24511                            if !fields.insert(__FieldTag::__create_time) {
24512                                return std::result::Result::Err(A::Error::duplicate_field(
24513                                    "multiple values for create_time",
24514                                ));
24515                            }
24516                            result.create_time =
24517                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
24518                        }
24519                        __FieldTag::__update_time => {
24520                            if !fields.insert(__FieldTag::__update_time) {
24521                                return std::result::Result::Err(A::Error::duplicate_field(
24522                                    "multiple values for update_time",
24523                                ));
24524                            }
24525                            result.update_time =
24526                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
24527                        }
24528                        __FieldTag::__description => {
24529                            if !fields.insert(__FieldTag::__description) {
24530                                return std::result::Result::Err(A::Error::duplicate_field(
24531                                    "multiple values for description",
24532                                ));
24533                            }
24534                            result.description = map
24535                                .next_value::<std::option::Option<std::string::String>>()?
24536                                .unwrap_or_default();
24537                        }
24538                        __FieldTag::__priority => {
24539                            if !fields.insert(__FieldTag::__priority) {
24540                                return std::result::Result::Err(A::Error::duplicate_field(
24541                                    "multiple values for priority",
24542                                ));
24543                            }
24544                            struct __With(std::option::Option<i32>);
24545                            impl<'de> serde::de::Deserialize<'de> for __With {
24546                                fn deserialize<D>(
24547                                    deserializer: D,
24548                                ) -> std::result::Result<Self, D::Error>
24549                                where
24550                                    D: serde::de::Deserializer<'de>,
24551                                {
24552                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
24553                                }
24554                            }
24555                            result.priority = map.next_value::<__With>()?.0.unwrap_or_default();
24556                        }
24557                        __FieldTag::__action => {
24558                            if !fields.insert(__FieldTag::__action) {
24559                                return std::result::Result::Err(A::Error::duplicate_field(
24560                                    "multiple values for action",
24561                                ));
24562                            }
24563                            result.action = map.next_value::<std::option::Option<crate::model::external_access_rule::Action>>()?.unwrap_or_default();
24564                        }
24565                        __FieldTag::__ip_protocol => {
24566                            if !fields.insert(__FieldTag::__ip_protocol) {
24567                                return std::result::Result::Err(A::Error::duplicate_field(
24568                                    "multiple values for ip_protocol",
24569                                ));
24570                            }
24571                            result.ip_protocol = map
24572                                .next_value::<std::option::Option<std::string::String>>()?
24573                                .unwrap_or_default();
24574                        }
24575                        __FieldTag::__source_ip_ranges => {
24576                            if !fields.insert(__FieldTag::__source_ip_ranges) {
24577                                return std::result::Result::Err(A::Error::duplicate_field(
24578                                    "multiple values for source_ip_ranges",
24579                                ));
24580                            }
24581                            result.source_ip_ranges = map
24582                                .next_value::<std::option::Option<
24583                                    std::vec::Vec<crate::model::external_access_rule::IpRange>,
24584                                >>()?
24585                                .unwrap_or_default();
24586                        }
24587                        __FieldTag::__source_ports => {
24588                            if !fields.insert(__FieldTag::__source_ports) {
24589                                return std::result::Result::Err(A::Error::duplicate_field(
24590                                    "multiple values for source_ports",
24591                                ));
24592                            }
24593                            result.source_ports = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
24594                        }
24595                        __FieldTag::__destination_ip_ranges => {
24596                            if !fields.insert(__FieldTag::__destination_ip_ranges) {
24597                                return std::result::Result::Err(A::Error::duplicate_field(
24598                                    "multiple values for destination_ip_ranges",
24599                                ));
24600                            }
24601                            result.destination_ip_ranges = map
24602                                .next_value::<std::option::Option<
24603                                    std::vec::Vec<crate::model::external_access_rule::IpRange>,
24604                                >>()?
24605                                .unwrap_or_default();
24606                        }
24607                        __FieldTag::__destination_ports => {
24608                            if !fields.insert(__FieldTag::__destination_ports) {
24609                                return std::result::Result::Err(A::Error::duplicate_field(
24610                                    "multiple values for destination_ports",
24611                                ));
24612                            }
24613                            result.destination_ports = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
24614                        }
24615                        __FieldTag::__state => {
24616                            if !fields.insert(__FieldTag::__state) {
24617                                return std::result::Result::Err(A::Error::duplicate_field(
24618                                    "multiple values for state",
24619                                ));
24620                            }
24621                            result.state = map.next_value::<std::option::Option<crate::model::external_access_rule::State>>()?.unwrap_or_default();
24622                        }
24623                        __FieldTag::__uid => {
24624                            if !fields.insert(__FieldTag::__uid) {
24625                                return std::result::Result::Err(A::Error::duplicate_field(
24626                                    "multiple values for uid",
24627                                ));
24628                            }
24629                            result.uid = map
24630                                .next_value::<std::option::Option<std::string::String>>()?
24631                                .unwrap_or_default();
24632                        }
24633                        __FieldTag::Unknown(key) => {
24634                            let value = map.next_value::<serde_json::Value>()?;
24635                            result._unknown_fields.insert(key, value);
24636                        }
24637                    }
24638                }
24639                std::result::Result::Ok(result)
24640            }
24641        }
24642        deserializer.deserialize_any(Visitor)
24643    }
24644}
24645
24646#[doc(hidden)]
24647impl serde::ser::Serialize for ExternalAccessRule {
24648    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24649    where
24650        S: serde::ser::Serializer,
24651    {
24652        use serde::ser::SerializeMap;
24653        #[allow(unused_imports)]
24654        use std::option::Option::Some;
24655        let mut state = serializer.serialize_map(std::option::Option::None)?;
24656        if !self.name.is_empty() {
24657            state.serialize_entry("name", &self.name)?;
24658        }
24659        if self.create_time.is_some() {
24660            state.serialize_entry("createTime", &self.create_time)?;
24661        }
24662        if self.update_time.is_some() {
24663            state.serialize_entry("updateTime", &self.update_time)?;
24664        }
24665        if !self.description.is_empty() {
24666            state.serialize_entry("description", &self.description)?;
24667        }
24668        if !wkt::internal::is_default(&self.priority) {
24669            struct __With<'a>(&'a i32);
24670            impl<'a> serde::ser::Serialize for __With<'a> {
24671                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24672                where
24673                    S: serde::ser::Serializer,
24674                {
24675                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
24676                }
24677            }
24678            state.serialize_entry("priority", &__With(&self.priority))?;
24679        }
24680        if !wkt::internal::is_default(&self.action) {
24681            state.serialize_entry("action", &self.action)?;
24682        }
24683        if !self.ip_protocol.is_empty() {
24684            state.serialize_entry("ipProtocol", &self.ip_protocol)?;
24685        }
24686        if !self.source_ip_ranges.is_empty() {
24687            state.serialize_entry("sourceIpRanges", &self.source_ip_ranges)?;
24688        }
24689        if !self.source_ports.is_empty() {
24690            state.serialize_entry("sourcePorts", &self.source_ports)?;
24691        }
24692        if !self.destination_ip_ranges.is_empty() {
24693            state.serialize_entry("destinationIpRanges", &self.destination_ip_ranges)?;
24694        }
24695        if !self.destination_ports.is_empty() {
24696            state.serialize_entry("destinationPorts", &self.destination_ports)?;
24697        }
24698        if !wkt::internal::is_default(&self.state) {
24699            state.serialize_entry("state", &self.state)?;
24700        }
24701        if !self.uid.is_empty() {
24702            state.serialize_entry("uid", &self.uid)?;
24703        }
24704        if !self._unknown_fields.is_empty() {
24705            for (key, value) in self._unknown_fields.iter() {
24706                state.serialize_entry(key, &value)?;
24707            }
24708        }
24709        state.end()
24710    }
24711}
24712
24713impl std::fmt::Debug for ExternalAccessRule {
24714    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24715        let mut debug_struct = f.debug_struct("ExternalAccessRule");
24716        debug_struct.field("name", &self.name);
24717        debug_struct.field("create_time", &self.create_time);
24718        debug_struct.field("update_time", &self.update_time);
24719        debug_struct.field("description", &self.description);
24720        debug_struct.field("priority", &self.priority);
24721        debug_struct.field("action", &self.action);
24722        debug_struct.field("ip_protocol", &self.ip_protocol);
24723        debug_struct.field("source_ip_ranges", &self.source_ip_ranges);
24724        debug_struct.field("source_ports", &self.source_ports);
24725        debug_struct.field("destination_ip_ranges", &self.destination_ip_ranges);
24726        debug_struct.field("destination_ports", &self.destination_ports);
24727        debug_struct.field("state", &self.state);
24728        debug_struct.field("uid", &self.uid);
24729        if !self._unknown_fields.is_empty() {
24730            debug_struct.field("_unknown_fields", &self._unknown_fields);
24731        }
24732        debug_struct.finish()
24733    }
24734}
24735
24736/// Defines additional types related to [ExternalAccessRule].
24737pub mod external_access_rule {
24738    #[allow(unused_imports)]
24739    use super::*;
24740
24741    /// An IP range provided in any one of the supported formats.
24742    #[derive(Clone, Default, PartialEq)]
24743    #[non_exhaustive]
24744    pub struct IpRange {
24745        pub ip_range: std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
24746
24747        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24748    }
24749
24750    impl IpRange {
24751        pub fn new() -> Self {
24752            std::default::Default::default()
24753        }
24754
24755        /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range].
24756        ///
24757        /// Note that all the setters affecting `ip_range` are mutually
24758        /// exclusive.
24759        pub fn set_ip_range<
24760            T: std::convert::Into<
24761                    std::option::Option<crate::model::external_access_rule::ip_range::IpRange>,
24762                >,
24763        >(
24764            mut self,
24765            v: T,
24766        ) -> Self {
24767            self.ip_range = v.into();
24768            self
24769        }
24770
24771        /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24772        /// if it holds a `IpAddress`, `None` if the field is not set or
24773        /// holds a different branch.
24774        pub fn ip_address(&self) -> std::option::Option<&std::string::String> {
24775            #[allow(unreachable_patterns)]
24776            self.ip_range.as_ref().and_then(|v| match v {
24777                crate::model::external_access_rule::ip_range::IpRange::IpAddress(v) => {
24778                    std::option::Option::Some(v)
24779                }
24780                _ => std::option::Option::None,
24781            })
24782        }
24783
24784        /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24785        /// to hold a `IpAddress`.
24786        ///
24787        /// Note that all the setters affecting `ip_range` are
24788        /// mutually exclusive.
24789        pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24790            self.ip_range = std::option::Option::Some(
24791                crate::model::external_access_rule::ip_range::IpRange::IpAddress(v.into()),
24792            );
24793            self
24794        }
24795
24796        /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24797        /// if it holds a `IpAddressRange`, `None` if the field is not set or
24798        /// holds a different branch.
24799        pub fn ip_address_range(&self) -> std::option::Option<&std::string::String> {
24800            #[allow(unreachable_patterns)]
24801            self.ip_range.as_ref().and_then(|v| match v {
24802                crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v) => {
24803                    std::option::Option::Some(v)
24804                }
24805                _ => std::option::Option::None,
24806            })
24807        }
24808
24809        /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24810        /// to hold a `IpAddressRange`.
24811        ///
24812        /// Note that all the setters affecting `ip_range` are
24813        /// mutually exclusive.
24814        pub fn set_ip_address_range<T: std::convert::Into<std::string::String>>(
24815            mut self,
24816            v: T,
24817        ) -> Self {
24818            self.ip_range = std::option::Option::Some(
24819                crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(v.into()),
24820            );
24821            self
24822        }
24823
24824        /// The value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24825        /// if it holds a `ExternalAddress`, `None` if the field is not set or
24826        /// holds a different branch.
24827        pub fn external_address(&self) -> std::option::Option<&std::string::String> {
24828            #[allow(unreachable_patterns)]
24829            self.ip_range.as_ref().and_then(|v| match v {
24830                crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v) => {
24831                    std::option::Option::Some(v)
24832                }
24833                _ => std::option::Option::None,
24834            })
24835        }
24836
24837        /// Sets the value of [ip_range][crate::model::external_access_rule::IpRange::ip_range]
24838        /// to hold a `ExternalAddress`.
24839        ///
24840        /// Note that all the setters affecting `ip_range` are
24841        /// mutually exclusive.
24842        pub fn set_external_address<T: std::convert::Into<std::string::String>>(
24843            mut self,
24844            v: T,
24845        ) -> Self {
24846            self.ip_range = std::option::Option::Some(
24847                crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(v.into()),
24848            );
24849            self
24850        }
24851    }
24852
24853    impl wkt::message::Message for IpRange {
24854        fn typename() -> &'static str {
24855            "type.googleapis.com/google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange"
24856        }
24857    }
24858
24859    #[doc(hidden)]
24860    impl<'de> serde::de::Deserialize<'de> for IpRange {
24861        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24862        where
24863            D: serde::Deserializer<'de>,
24864        {
24865            #[allow(non_camel_case_types)]
24866            #[doc(hidden)]
24867            #[derive(PartialEq, Eq, Hash)]
24868            enum __FieldTag {
24869                __ip_address,
24870                __ip_address_range,
24871                __external_address,
24872                Unknown(std::string::String),
24873            }
24874            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24875                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24876                where
24877                    D: serde::Deserializer<'de>,
24878                {
24879                    struct Visitor;
24880                    impl<'de> serde::de::Visitor<'de> for Visitor {
24881                        type Value = __FieldTag;
24882                        fn expecting(
24883                            &self,
24884                            formatter: &mut std::fmt::Formatter,
24885                        ) -> std::fmt::Result {
24886                            formatter.write_str("a field name for IpRange")
24887                        }
24888                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24889                        where
24890                            E: serde::de::Error,
24891                        {
24892                            use std::result::Result::Ok;
24893                            use std::string::ToString;
24894                            match value {
24895                                "ipAddress" => Ok(__FieldTag::__ip_address),
24896                                "ip_address" => Ok(__FieldTag::__ip_address),
24897                                "ipAddressRange" => Ok(__FieldTag::__ip_address_range),
24898                                "ip_address_range" => Ok(__FieldTag::__ip_address_range),
24899                                "externalAddress" => Ok(__FieldTag::__external_address),
24900                                "external_address" => Ok(__FieldTag::__external_address),
24901                                _ => Ok(__FieldTag::Unknown(value.to_string())),
24902                            }
24903                        }
24904                    }
24905                    deserializer.deserialize_identifier(Visitor)
24906                }
24907            }
24908            struct Visitor;
24909            impl<'de> serde::de::Visitor<'de> for Visitor {
24910                type Value = IpRange;
24911                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24912                    formatter.write_str("struct IpRange")
24913                }
24914                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24915                where
24916                    A: serde::de::MapAccess<'de>,
24917                {
24918                    #[allow(unused_imports)]
24919                    use serde::de::Error;
24920                    use std::option::Option::Some;
24921                    let mut fields = std::collections::HashSet::new();
24922                    let mut result = Self::Value::new();
24923                    while let Some(tag) = map.next_key::<__FieldTag>()? {
24924                        #[allow(clippy::match_single_binding)]
24925                        match tag {
24926                            __FieldTag::__ip_address => {
24927                                if !fields.insert(__FieldTag::__ip_address) {
24928                                    return std::result::Result::Err(A::Error::duplicate_field(
24929                                        "multiple values for ip_address",
24930                                    ));
24931                                }
24932                                if result.ip_range.is_some() {
24933                                    return std::result::Result::Err(A::Error::duplicate_field(
24934                                        "multiple values for `ip_range`, a oneof with full ID .google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange.ip_address, latest field was ipAddress",
24935                                    ));
24936                                }
24937                                result.ip_range = std::option::Option::Some(
24938                                    crate::model::external_access_rule::ip_range::IpRange::IpAddress(
24939                                        map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
24940                                    ),
24941                                );
24942                            }
24943                            __FieldTag::__ip_address_range => {
24944                                if !fields.insert(__FieldTag::__ip_address_range) {
24945                                    return std::result::Result::Err(A::Error::duplicate_field(
24946                                        "multiple values for ip_address_range",
24947                                    ));
24948                                }
24949                                if result.ip_range.is_some() {
24950                                    return std::result::Result::Err(A::Error::duplicate_field(
24951                                        "multiple values for `ip_range`, a oneof with full ID .google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange.ip_address_range, latest field was ipAddressRange",
24952                                    ));
24953                                }
24954                                result.ip_range = std::option::Option::Some(
24955                                    crate::model::external_access_rule::ip_range::IpRange::IpAddressRange(
24956                                        map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
24957                                    ),
24958                                );
24959                            }
24960                            __FieldTag::__external_address => {
24961                                if !fields.insert(__FieldTag::__external_address) {
24962                                    return std::result::Result::Err(A::Error::duplicate_field(
24963                                        "multiple values for external_address",
24964                                    ));
24965                                }
24966                                if result.ip_range.is_some() {
24967                                    return std::result::Result::Err(A::Error::duplicate_field(
24968                                        "multiple values for `ip_range`, a oneof with full ID .google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange.external_address, latest field was externalAddress",
24969                                    ));
24970                                }
24971                                result.ip_range = std::option::Option::Some(
24972                                    crate::model::external_access_rule::ip_range::IpRange::ExternalAddress(
24973                                        map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
24974                                    ),
24975                                );
24976                            }
24977                            __FieldTag::Unknown(key) => {
24978                                let value = map.next_value::<serde_json::Value>()?;
24979                                result._unknown_fields.insert(key, value);
24980                            }
24981                        }
24982                    }
24983                    std::result::Result::Ok(result)
24984                }
24985            }
24986            deserializer.deserialize_any(Visitor)
24987        }
24988    }
24989
24990    #[doc(hidden)]
24991    impl serde::ser::Serialize for IpRange {
24992        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24993        where
24994            S: serde::ser::Serializer,
24995        {
24996            use serde::ser::SerializeMap;
24997            #[allow(unused_imports)]
24998            use std::option::Option::Some;
24999            let mut state = serializer.serialize_map(std::option::Option::None)?;
25000            if let Some(value) = self.ip_address() {
25001                state.serialize_entry("ipAddress", value)?;
25002            }
25003            if let Some(value) = self.ip_address_range() {
25004                state.serialize_entry("ipAddressRange", value)?;
25005            }
25006            if let Some(value) = self.external_address() {
25007                state.serialize_entry("externalAddress", value)?;
25008            }
25009            if !self._unknown_fields.is_empty() {
25010                for (key, value) in self._unknown_fields.iter() {
25011                    state.serialize_entry(key, &value)?;
25012                }
25013            }
25014            state.end()
25015        }
25016    }
25017
25018    impl std::fmt::Debug for IpRange {
25019        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25020            let mut debug_struct = f.debug_struct("IpRange");
25021            debug_struct.field("ip_range", &self.ip_range);
25022            if !self._unknown_fields.is_empty() {
25023                debug_struct.field("_unknown_fields", &self._unknown_fields);
25024            }
25025            debug_struct.finish()
25026        }
25027    }
25028
25029    /// Defines additional types related to [IpRange].
25030    pub mod ip_range {
25031        #[allow(unused_imports)]
25032        use super::*;
25033
25034        #[derive(Clone, Debug, PartialEq)]
25035        #[non_exhaustive]
25036        pub enum IpRange {
25037            /// A single IP address. For example: `10.0.0.5`.
25038            IpAddress(std::string::String),
25039            /// An IP address range in the CIDR format. For example: `10.0.0.0/24`.
25040            IpAddressRange(std::string::String),
25041            /// The name of an `ExternalAddress` resource. The external address must
25042            /// have been reserved in the scope of this external access rule's parent
25043            /// network policy.  Provide the external address name in the form of
25044            /// `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`.
25045            /// For example:
25046            /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`.
25047            ExternalAddress(std::string::String),
25048        }
25049    }
25050
25051    /// Action determines whether the external access rule permits or blocks
25052    /// traffic, subject to the other components of the rule matching the traffic.
25053    ///
25054    /// # Working with unknown values
25055    ///
25056    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25057    /// additional enum variants at any time. Adding new variants is not considered
25058    /// a breaking change. Applications should write their code in anticipation of:
25059    ///
25060    /// - New values appearing in future releases of the client library, **and**
25061    /// - New values received dynamically, without application changes.
25062    ///
25063    /// Please consult the [Working with enums] section in the user guide for some
25064    /// guidelines.
25065    ///
25066    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25067    #[derive(Clone, Debug, PartialEq)]
25068    #[non_exhaustive]
25069    pub enum Action {
25070        /// Defaults to allow.
25071        Unspecified,
25072        /// Allows connections that match the other specified components.
25073        Allow,
25074        /// Blocks connections that match the other specified components.
25075        Deny,
25076        /// If set, the enum was initialized with an unknown value.
25077        ///
25078        /// Applications can examine the value using [Action::value] or
25079        /// [Action::name].
25080        UnknownValue(action::UnknownValue),
25081    }
25082
25083    #[doc(hidden)]
25084    pub mod action {
25085        #[allow(unused_imports)]
25086        use super::*;
25087        #[derive(Clone, Debug, PartialEq)]
25088        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25089    }
25090
25091    impl Action {
25092        /// Gets the enum value.
25093        ///
25094        /// Returns `None` if the enum contains an unknown value deserialized from
25095        /// the string representation of enums.
25096        pub fn value(&self) -> std::option::Option<i32> {
25097            match self {
25098                Self::Unspecified => std::option::Option::Some(0),
25099                Self::Allow => std::option::Option::Some(1),
25100                Self::Deny => std::option::Option::Some(2),
25101                Self::UnknownValue(u) => u.0.value(),
25102            }
25103        }
25104
25105        /// Gets the enum value as a string.
25106        ///
25107        /// Returns `None` if the enum contains an unknown value deserialized from
25108        /// the integer representation of enums.
25109        pub fn name(&self) -> std::option::Option<&str> {
25110            match self {
25111                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
25112                Self::Allow => std::option::Option::Some("ALLOW"),
25113                Self::Deny => std::option::Option::Some("DENY"),
25114                Self::UnknownValue(u) => u.0.name(),
25115            }
25116        }
25117    }
25118
25119    impl std::default::Default for Action {
25120        fn default() -> Self {
25121            use std::convert::From;
25122            Self::from(0)
25123        }
25124    }
25125
25126    impl std::fmt::Display for Action {
25127        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25128            wkt::internal::display_enum(f, self.name(), self.value())
25129        }
25130    }
25131
25132    impl std::convert::From<i32> for Action {
25133        fn from(value: i32) -> Self {
25134            match value {
25135                0 => Self::Unspecified,
25136                1 => Self::Allow,
25137                2 => Self::Deny,
25138                _ => Self::UnknownValue(action::UnknownValue(
25139                    wkt::internal::UnknownEnumValue::Integer(value),
25140                )),
25141            }
25142        }
25143    }
25144
25145    impl std::convert::From<&str> for Action {
25146        fn from(value: &str) -> Self {
25147            use std::string::ToString;
25148            match value {
25149                "ACTION_UNSPECIFIED" => Self::Unspecified,
25150                "ALLOW" => Self::Allow,
25151                "DENY" => Self::Deny,
25152                _ => Self::UnknownValue(action::UnknownValue(
25153                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25154                )),
25155            }
25156        }
25157    }
25158
25159    impl serde::ser::Serialize for Action {
25160        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25161        where
25162            S: serde::Serializer,
25163        {
25164            match self {
25165                Self::Unspecified => serializer.serialize_i32(0),
25166                Self::Allow => serializer.serialize_i32(1),
25167                Self::Deny => serializer.serialize_i32(2),
25168                Self::UnknownValue(u) => u.0.serialize(serializer),
25169            }
25170        }
25171    }
25172
25173    impl<'de> serde::de::Deserialize<'de> for Action {
25174        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25175        where
25176            D: serde::Deserializer<'de>,
25177        {
25178            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
25179                ".google.cloud.vmwareengine.v1.ExternalAccessRule.Action",
25180            ))
25181        }
25182    }
25183
25184    /// Defines possible states of external access firewall rules.
25185    ///
25186    /// # Working with unknown values
25187    ///
25188    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25189    /// additional enum variants at any time. Adding new variants is not considered
25190    /// a breaking change. Applications should write their code in anticipation of:
25191    ///
25192    /// - New values appearing in future releases of the client library, **and**
25193    /// - New values received dynamically, without application changes.
25194    ///
25195    /// Please consult the [Working with enums] section in the user guide for some
25196    /// guidelines.
25197    ///
25198    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25199    #[derive(Clone, Debug, PartialEq)]
25200    #[non_exhaustive]
25201    pub enum State {
25202        /// The default value. This value is used if the state is omitted.
25203        Unspecified,
25204        /// The rule is ready.
25205        Active,
25206        /// The rule is being created.
25207        Creating,
25208        /// The rule is being updated.
25209        Updating,
25210        /// The rule is being deleted.
25211        Deleting,
25212        /// If set, the enum was initialized with an unknown value.
25213        ///
25214        /// Applications can examine the value using [State::value] or
25215        /// [State::name].
25216        UnknownValue(state::UnknownValue),
25217    }
25218
25219    #[doc(hidden)]
25220    pub mod state {
25221        #[allow(unused_imports)]
25222        use super::*;
25223        #[derive(Clone, Debug, PartialEq)]
25224        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25225    }
25226
25227    impl State {
25228        /// Gets the enum value.
25229        ///
25230        /// Returns `None` if the enum contains an unknown value deserialized from
25231        /// the string representation of enums.
25232        pub fn value(&self) -> std::option::Option<i32> {
25233            match self {
25234                Self::Unspecified => std::option::Option::Some(0),
25235                Self::Active => std::option::Option::Some(1),
25236                Self::Creating => std::option::Option::Some(2),
25237                Self::Updating => std::option::Option::Some(3),
25238                Self::Deleting => std::option::Option::Some(4),
25239                Self::UnknownValue(u) => u.0.value(),
25240            }
25241        }
25242
25243        /// Gets the enum value as a string.
25244        ///
25245        /// Returns `None` if the enum contains an unknown value deserialized from
25246        /// the integer representation of enums.
25247        pub fn name(&self) -> std::option::Option<&str> {
25248            match self {
25249                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
25250                Self::Active => std::option::Option::Some("ACTIVE"),
25251                Self::Creating => std::option::Option::Some("CREATING"),
25252                Self::Updating => std::option::Option::Some("UPDATING"),
25253                Self::Deleting => std::option::Option::Some("DELETING"),
25254                Self::UnknownValue(u) => u.0.name(),
25255            }
25256        }
25257    }
25258
25259    impl std::default::Default for State {
25260        fn default() -> Self {
25261            use std::convert::From;
25262            Self::from(0)
25263        }
25264    }
25265
25266    impl std::fmt::Display for State {
25267        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25268            wkt::internal::display_enum(f, self.name(), self.value())
25269        }
25270    }
25271
25272    impl std::convert::From<i32> for State {
25273        fn from(value: i32) -> Self {
25274            match value {
25275                0 => Self::Unspecified,
25276                1 => Self::Active,
25277                2 => Self::Creating,
25278                3 => Self::Updating,
25279                4 => Self::Deleting,
25280                _ => Self::UnknownValue(state::UnknownValue(
25281                    wkt::internal::UnknownEnumValue::Integer(value),
25282                )),
25283            }
25284        }
25285    }
25286
25287    impl std::convert::From<&str> for State {
25288        fn from(value: &str) -> Self {
25289            use std::string::ToString;
25290            match value {
25291                "STATE_UNSPECIFIED" => Self::Unspecified,
25292                "ACTIVE" => Self::Active,
25293                "CREATING" => Self::Creating,
25294                "UPDATING" => Self::Updating,
25295                "DELETING" => Self::Deleting,
25296                _ => Self::UnknownValue(state::UnknownValue(
25297                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25298                )),
25299            }
25300        }
25301    }
25302
25303    impl serde::ser::Serialize for State {
25304        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25305        where
25306            S: serde::Serializer,
25307        {
25308            match self {
25309                Self::Unspecified => serializer.serialize_i32(0),
25310                Self::Active => serializer.serialize_i32(1),
25311                Self::Creating => serializer.serialize_i32(2),
25312                Self::Updating => serializer.serialize_i32(3),
25313                Self::Deleting => serializer.serialize_i32(4),
25314                Self::UnknownValue(u) => u.0.serialize(serializer),
25315            }
25316        }
25317    }
25318
25319    impl<'de> serde::de::Deserialize<'de> for State {
25320        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25321        where
25322            D: serde::Deserializer<'de>,
25323        {
25324            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
25325                ".google.cloud.vmwareengine.v1.ExternalAccessRule.State",
25326            ))
25327        }
25328    }
25329}
25330
25331/// Logging server to receive vCenter or ESXi logs.
25332#[derive(Clone, Default, PartialEq)]
25333#[non_exhaustive]
25334pub struct LoggingServer {
25335    /// Output only. The resource name of this logging server.
25336    /// Resource names are schemeless URIs that follow the conventions in
25337    /// <https://cloud.google.com/apis/design/resource_names>.
25338    /// For example:
25339    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server`
25340    pub name: std::string::String,
25341
25342    /// Output only. Creation time of this resource.
25343    pub create_time: std::option::Option<wkt::Timestamp>,
25344
25345    /// Output only. Last update time of this resource.
25346    pub update_time: std::option::Option<wkt::Timestamp>,
25347
25348    /// Required. Fully-qualified domain name (FQDN) or IP Address of the logging
25349    /// server.
25350    pub hostname: std::string::String,
25351
25352    /// Required. Port number at which the logging server receives logs.
25353    pub port: i32,
25354
25355    /// Required. Protocol used by vCenter to send logs to a logging server.
25356    pub protocol: crate::model::logging_server::Protocol,
25357
25358    /// Required. The type of component that produces logs that will be forwarded
25359    /// to this logging server.
25360    pub source_type: crate::model::logging_server::SourceType,
25361
25362    /// Output only. System-generated unique identifier for the resource.
25363    pub uid: std::string::String,
25364
25365    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25366}
25367
25368impl LoggingServer {
25369    pub fn new() -> Self {
25370        std::default::Default::default()
25371    }
25372
25373    /// Sets the value of [name][crate::model::LoggingServer::name].
25374    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25375        self.name = v.into();
25376        self
25377    }
25378
25379    /// Sets the value of [create_time][crate::model::LoggingServer::create_time].
25380    pub fn set_create_time<T>(mut self, v: T) -> Self
25381    where
25382        T: std::convert::Into<wkt::Timestamp>,
25383    {
25384        self.create_time = std::option::Option::Some(v.into());
25385        self
25386    }
25387
25388    /// Sets or clears the value of [create_time][crate::model::LoggingServer::create_time].
25389    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
25390    where
25391        T: std::convert::Into<wkt::Timestamp>,
25392    {
25393        self.create_time = v.map(|x| x.into());
25394        self
25395    }
25396
25397    /// Sets the value of [update_time][crate::model::LoggingServer::update_time].
25398    pub fn set_update_time<T>(mut self, v: T) -> Self
25399    where
25400        T: std::convert::Into<wkt::Timestamp>,
25401    {
25402        self.update_time = std::option::Option::Some(v.into());
25403        self
25404    }
25405
25406    /// Sets or clears the value of [update_time][crate::model::LoggingServer::update_time].
25407    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
25408    where
25409        T: std::convert::Into<wkt::Timestamp>,
25410    {
25411        self.update_time = v.map(|x| x.into());
25412        self
25413    }
25414
25415    /// Sets the value of [hostname][crate::model::LoggingServer::hostname].
25416    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25417        self.hostname = v.into();
25418        self
25419    }
25420
25421    /// Sets the value of [port][crate::model::LoggingServer::port].
25422    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25423        self.port = v.into();
25424        self
25425    }
25426
25427    /// Sets the value of [protocol][crate::model::LoggingServer::protocol].
25428    pub fn set_protocol<T: std::convert::Into<crate::model::logging_server::Protocol>>(
25429        mut self,
25430        v: T,
25431    ) -> Self {
25432        self.protocol = v.into();
25433        self
25434    }
25435
25436    /// Sets the value of [source_type][crate::model::LoggingServer::source_type].
25437    pub fn set_source_type<T: std::convert::Into<crate::model::logging_server::SourceType>>(
25438        mut self,
25439        v: T,
25440    ) -> Self {
25441        self.source_type = v.into();
25442        self
25443    }
25444
25445    /// Sets the value of [uid][crate::model::LoggingServer::uid].
25446    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25447        self.uid = v.into();
25448        self
25449    }
25450}
25451
25452impl wkt::message::Message for LoggingServer {
25453    fn typename() -> &'static str {
25454        "type.googleapis.com/google.cloud.vmwareengine.v1.LoggingServer"
25455    }
25456}
25457
25458#[doc(hidden)]
25459impl<'de> serde::de::Deserialize<'de> for LoggingServer {
25460    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25461    where
25462        D: serde::Deserializer<'de>,
25463    {
25464        #[allow(non_camel_case_types)]
25465        #[doc(hidden)]
25466        #[derive(PartialEq, Eq, Hash)]
25467        enum __FieldTag {
25468            __name,
25469            __create_time,
25470            __update_time,
25471            __hostname,
25472            __port,
25473            __protocol,
25474            __source_type,
25475            __uid,
25476            Unknown(std::string::String),
25477        }
25478        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25479            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25480            where
25481                D: serde::Deserializer<'de>,
25482            {
25483                struct Visitor;
25484                impl<'de> serde::de::Visitor<'de> for Visitor {
25485                    type Value = __FieldTag;
25486                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25487                        formatter.write_str("a field name for LoggingServer")
25488                    }
25489                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25490                    where
25491                        E: serde::de::Error,
25492                    {
25493                        use std::result::Result::Ok;
25494                        use std::string::ToString;
25495                        match value {
25496                            "name" => Ok(__FieldTag::__name),
25497                            "createTime" => Ok(__FieldTag::__create_time),
25498                            "create_time" => Ok(__FieldTag::__create_time),
25499                            "updateTime" => Ok(__FieldTag::__update_time),
25500                            "update_time" => Ok(__FieldTag::__update_time),
25501                            "hostname" => Ok(__FieldTag::__hostname),
25502                            "port" => Ok(__FieldTag::__port),
25503                            "protocol" => Ok(__FieldTag::__protocol),
25504                            "sourceType" => Ok(__FieldTag::__source_type),
25505                            "source_type" => Ok(__FieldTag::__source_type),
25506                            "uid" => Ok(__FieldTag::__uid),
25507                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25508                        }
25509                    }
25510                }
25511                deserializer.deserialize_identifier(Visitor)
25512            }
25513        }
25514        struct Visitor;
25515        impl<'de> serde::de::Visitor<'de> for Visitor {
25516            type Value = LoggingServer;
25517            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25518                formatter.write_str("struct LoggingServer")
25519            }
25520            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25521            where
25522                A: serde::de::MapAccess<'de>,
25523            {
25524                #[allow(unused_imports)]
25525                use serde::de::Error;
25526                use std::option::Option::Some;
25527                let mut fields = std::collections::HashSet::new();
25528                let mut result = Self::Value::new();
25529                while let Some(tag) = map.next_key::<__FieldTag>()? {
25530                    #[allow(clippy::match_single_binding)]
25531                    match tag {
25532                        __FieldTag::__name => {
25533                            if !fields.insert(__FieldTag::__name) {
25534                                return std::result::Result::Err(A::Error::duplicate_field(
25535                                    "multiple values for name",
25536                                ));
25537                            }
25538                            result.name = map
25539                                .next_value::<std::option::Option<std::string::String>>()?
25540                                .unwrap_or_default();
25541                        }
25542                        __FieldTag::__create_time => {
25543                            if !fields.insert(__FieldTag::__create_time) {
25544                                return std::result::Result::Err(A::Error::duplicate_field(
25545                                    "multiple values for create_time",
25546                                ));
25547                            }
25548                            result.create_time =
25549                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
25550                        }
25551                        __FieldTag::__update_time => {
25552                            if !fields.insert(__FieldTag::__update_time) {
25553                                return std::result::Result::Err(A::Error::duplicate_field(
25554                                    "multiple values for update_time",
25555                                ));
25556                            }
25557                            result.update_time =
25558                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
25559                        }
25560                        __FieldTag::__hostname => {
25561                            if !fields.insert(__FieldTag::__hostname) {
25562                                return std::result::Result::Err(A::Error::duplicate_field(
25563                                    "multiple values for hostname",
25564                                ));
25565                            }
25566                            result.hostname = map
25567                                .next_value::<std::option::Option<std::string::String>>()?
25568                                .unwrap_or_default();
25569                        }
25570                        __FieldTag::__port => {
25571                            if !fields.insert(__FieldTag::__port) {
25572                                return std::result::Result::Err(A::Error::duplicate_field(
25573                                    "multiple values for port",
25574                                ));
25575                            }
25576                            struct __With(std::option::Option<i32>);
25577                            impl<'de> serde::de::Deserialize<'de> for __With {
25578                                fn deserialize<D>(
25579                                    deserializer: D,
25580                                ) -> std::result::Result<Self, D::Error>
25581                                where
25582                                    D: serde::de::Deserializer<'de>,
25583                                {
25584                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
25585                                }
25586                            }
25587                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
25588                        }
25589                        __FieldTag::__protocol => {
25590                            if !fields.insert(__FieldTag::__protocol) {
25591                                return std::result::Result::Err(A::Error::duplicate_field(
25592                                    "multiple values for protocol",
25593                                ));
25594                            }
25595                            result.protocol = map.next_value::<std::option::Option<crate::model::logging_server::Protocol>>()?.unwrap_or_default();
25596                        }
25597                        __FieldTag::__source_type => {
25598                            if !fields.insert(__FieldTag::__source_type) {
25599                                return std::result::Result::Err(A::Error::duplicate_field(
25600                                    "multiple values for source_type",
25601                                ));
25602                            }
25603                            result.source_type = map.next_value::<std::option::Option<crate::model::logging_server::SourceType>>()?.unwrap_or_default();
25604                        }
25605                        __FieldTag::__uid => {
25606                            if !fields.insert(__FieldTag::__uid) {
25607                                return std::result::Result::Err(A::Error::duplicate_field(
25608                                    "multiple values for uid",
25609                                ));
25610                            }
25611                            result.uid = map
25612                                .next_value::<std::option::Option<std::string::String>>()?
25613                                .unwrap_or_default();
25614                        }
25615                        __FieldTag::Unknown(key) => {
25616                            let value = map.next_value::<serde_json::Value>()?;
25617                            result._unknown_fields.insert(key, value);
25618                        }
25619                    }
25620                }
25621                std::result::Result::Ok(result)
25622            }
25623        }
25624        deserializer.deserialize_any(Visitor)
25625    }
25626}
25627
25628#[doc(hidden)]
25629impl serde::ser::Serialize for LoggingServer {
25630    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25631    where
25632        S: serde::ser::Serializer,
25633    {
25634        use serde::ser::SerializeMap;
25635        #[allow(unused_imports)]
25636        use std::option::Option::Some;
25637        let mut state = serializer.serialize_map(std::option::Option::None)?;
25638        if !self.name.is_empty() {
25639            state.serialize_entry("name", &self.name)?;
25640        }
25641        if self.create_time.is_some() {
25642            state.serialize_entry("createTime", &self.create_time)?;
25643        }
25644        if self.update_time.is_some() {
25645            state.serialize_entry("updateTime", &self.update_time)?;
25646        }
25647        if !self.hostname.is_empty() {
25648            state.serialize_entry("hostname", &self.hostname)?;
25649        }
25650        if !wkt::internal::is_default(&self.port) {
25651            struct __With<'a>(&'a i32);
25652            impl<'a> serde::ser::Serialize for __With<'a> {
25653                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25654                where
25655                    S: serde::ser::Serializer,
25656                {
25657                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
25658                }
25659            }
25660            state.serialize_entry("port", &__With(&self.port))?;
25661        }
25662        if !wkt::internal::is_default(&self.protocol) {
25663            state.serialize_entry("protocol", &self.protocol)?;
25664        }
25665        if !wkt::internal::is_default(&self.source_type) {
25666            state.serialize_entry("sourceType", &self.source_type)?;
25667        }
25668        if !self.uid.is_empty() {
25669            state.serialize_entry("uid", &self.uid)?;
25670        }
25671        if !self._unknown_fields.is_empty() {
25672            for (key, value) in self._unknown_fields.iter() {
25673                state.serialize_entry(key, &value)?;
25674            }
25675        }
25676        state.end()
25677    }
25678}
25679
25680impl std::fmt::Debug for LoggingServer {
25681    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25682        let mut debug_struct = f.debug_struct("LoggingServer");
25683        debug_struct.field("name", &self.name);
25684        debug_struct.field("create_time", &self.create_time);
25685        debug_struct.field("update_time", &self.update_time);
25686        debug_struct.field("hostname", &self.hostname);
25687        debug_struct.field("port", &self.port);
25688        debug_struct.field("protocol", &self.protocol);
25689        debug_struct.field("source_type", &self.source_type);
25690        debug_struct.field("uid", &self.uid);
25691        if !self._unknown_fields.is_empty() {
25692            debug_struct.field("_unknown_fields", &self._unknown_fields);
25693        }
25694        debug_struct.finish()
25695    }
25696}
25697
25698/// Defines additional types related to [LoggingServer].
25699pub mod logging_server {
25700    #[allow(unused_imports)]
25701    use super::*;
25702
25703    /// Defines possible protocols used to send logs to
25704    /// a logging server.
25705    ///
25706    /// # Working with unknown values
25707    ///
25708    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25709    /// additional enum variants at any time. Adding new variants is not considered
25710    /// a breaking change. Applications should write their code in anticipation of:
25711    ///
25712    /// - New values appearing in future releases of the client library, **and**
25713    /// - New values received dynamically, without application changes.
25714    ///
25715    /// Please consult the [Working with enums] section in the user guide for some
25716    /// guidelines.
25717    ///
25718    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25719    #[derive(Clone, Debug, PartialEq)]
25720    #[non_exhaustive]
25721    pub enum Protocol {
25722        /// Unspecified communications protocol. This is the default value.
25723        Unspecified,
25724        /// UDP
25725        Udp,
25726        /// TCP
25727        Tcp,
25728        /// TLS
25729        Tls,
25730        /// SSL
25731        Ssl,
25732        /// RELP
25733        Relp,
25734        /// If set, the enum was initialized with an unknown value.
25735        ///
25736        /// Applications can examine the value using [Protocol::value] or
25737        /// [Protocol::name].
25738        UnknownValue(protocol::UnknownValue),
25739    }
25740
25741    #[doc(hidden)]
25742    pub mod protocol {
25743        #[allow(unused_imports)]
25744        use super::*;
25745        #[derive(Clone, Debug, PartialEq)]
25746        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25747    }
25748
25749    impl Protocol {
25750        /// Gets the enum value.
25751        ///
25752        /// Returns `None` if the enum contains an unknown value deserialized from
25753        /// the string representation of enums.
25754        pub fn value(&self) -> std::option::Option<i32> {
25755            match self {
25756                Self::Unspecified => std::option::Option::Some(0),
25757                Self::Udp => std::option::Option::Some(1),
25758                Self::Tcp => std::option::Option::Some(2),
25759                Self::Tls => std::option::Option::Some(3),
25760                Self::Ssl => std::option::Option::Some(4),
25761                Self::Relp => std::option::Option::Some(5),
25762                Self::UnknownValue(u) => u.0.value(),
25763            }
25764        }
25765
25766        /// Gets the enum value as a string.
25767        ///
25768        /// Returns `None` if the enum contains an unknown value deserialized from
25769        /// the integer representation of enums.
25770        pub fn name(&self) -> std::option::Option<&str> {
25771            match self {
25772                Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
25773                Self::Udp => std::option::Option::Some("UDP"),
25774                Self::Tcp => std::option::Option::Some("TCP"),
25775                Self::Tls => std::option::Option::Some("TLS"),
25776                Self::Ssl => std::option::Option::Some("SSL"),
25777                Self::Relp => std::option::Option::Some("RELP"),
25778                Self::UnknownValue(u) => u.0.name(),
25779            }
25780        }
25781    }
25782
25783    impl std::default::Default for Protocol {
25784        fn default() -> Self {
25785            use std::convert::From;
25786            Self::from(0)
25787        }
25788    }
25789
25790    impl std::fmt::Display for Protocol {
25791        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25792            wkt::internal::display_enum(f, self.name(), self.value())
25793        }
25794    }
25795
25796    impl std::convert::From<i32> for Protocol {
25797        fn from(value: i32) -> Self {
25798            match value {
25799                0 => Self::Unspecified,
25800                1 => Self::Udp,
25801                2 => Self::Tcp,
25802                3 => Self::Tls,
25803                4 => Self::Ssl,
25804                5 => Self::Relp,
25805                _ => Self::UnknownValue(protocol::UnknownValue(
25806                    wkt::internal::UnknownEnumValue::Integer(value),
25807                )),
25808            }
25809        }
25810    }
25811
25812    impl std::convert::From<&str> for Protocol {
25813        fn from(value: &str) -> Self {
25814            use std::string::ToString;
25815            match value {
25816                "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
25817                "UDP" => Self::Udp,
25818                "TCP" => Self::Tcp,
25819                "TLS" => Self::Tls,
25820                "SSL" => Self::Ssl,
25821                "RELP" => Self::Relp,
25822                _ => Self::UnknownValue(protocol::UnknownValue(
25823                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25824                )),
25825            }
25826        }
25827    }
25828
25829    impl serde::ser::Serialize for Protocol {
25830        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25831        where
25832            S: serde::Serializer,
25833        {
25834            match self {
25835                Self::Unspecified => serializer.serialize_i32(0),
25836                Self::Udp => serializer.serialize_i32(1),
25837                Self::Tcp => serializer.serialize_i32(2),
25838                Self::Tls => serializer.serialize_i32(3),
25839                Self::Ssl => serializer.serialize_i32(4),
25840                Self::Relp => serializer.serialize_i32(5),
25841                Self::UnknownValue(u) => u.0.serialize(serializer),
25842            }
25843        }
25844    }
25845
25846    impl<'de> serde::de::Deserialize<'de> for Protocol {
25847        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25848        where
25849            D: serde::Deserializer<'de>,
25850        {
25851            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
25852                ".google.cloud.vmwareengine.v1.LoggingServer.Protocol",
25853            ))
25854        }
25855    }
25856
25857    /// Defines possible types of component that produces logs.
25858    ///
25859    /// # Working with unknown values
25860    ///
25861    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25862    /// additional enum variants at any time. Adding new variants is not considered
25863    /// a breaking change. Applications should write their code in anticipation of:
25864    ///
25865    /// - New values appearing in future releases of the client library, **and**
25866    /// - New values received dynamically, without application changes.
25867    ///
25868    /// Please consult the [Working with enums] section in the user guide for some
25869    /// guidelines.
25870    ///
25871    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25872    #[derive(Clone, Debug, PartialEq)]
25873    #[non_exhaustive]
25874    pub enum SourceType {
25875        /// The default value. This value should never be used.
25876        Unspecified,
25877        /// Logs produced by ESXI hosts
25878        Esxi,
25879        /// Logs produced by vCenter server
25880        Vcsa,
25881        /// If set, the enum was initialized with an unknown value.
25882        ///
25883        /// Applications can examine the value using [SourceType::value] or
25884        /// [SourceType::name].
25885        UnknownValue(source_type::UnknownValue),
25886    }
25887
25888    #[doc(hidden)]
25889    pub mod source_type {
25890        #[allow(unused_imports)]
25891        use super::*;
25892        #[derive(Clone, Debug, PartialEq)]
25893        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25894    }
25895
25896    impl SourceType {
25897        /// Gets the enum value.
25898        ///
25899        /// Returns `None` if the enum contains an unknown value deserialized from
25900        /// the string representation of enums.
25901        pub fn value(&self) -> std::option::Option<i32> {
25902            match self {
25903                Self::Unspecified => std::option::Option::Some(0),
25904                Self::Esxi => std::option::Option::Some(1),
25905                Self::Vcsa => std::option::Option::Some(2),
25906                Self::UnknownValue(u) => u.0.value(),
25907            }
25908        }
25909
25910        /// Gets the enum value as a string.
25911        ///
25912        /// Returns `None` if the enum contains an unknown value deserialized from
25913        /// the integer representation of enums.
25914        pub fn name(&self) -> std::option::Option<&str> {
25915            match self {
25916                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
25917                Self::Esxi => std::option::Option::Some("ESXI"),
25918                Self::Vcsa => std::option::Option::Some("VCSA"),
25919                Self::UnknownValue(u) => u.0.name(),
25920            }
25921        }
25922    }
25923
25924    impl std::default::Default for SourceType {
25925        fn default() -> Self {
25926            use std::convert::From;
25927            Self::from(0)
25928        }
25929    }
25930
25931    impl std::fmt::Display for SourceType {
25932        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25933            wkt::internal::display_enum(f, self.name(), self.value())
25934        }
25935    }
25936
25937    impl std::convert::From<i32> for SourceType {
25938        fn from(value: i32) -> Self {
25939            match value {
25940                0 => Self::Unspecified,
25941                1 => Self::Esxi,
25942                2 => Self::Vcsa,
25943                _ => Self::UnknownValue(source_type::UnknownValue(
25944                    wkt::internal::UnknownEnumValue::Integer(value),
25945                )),
25946            }
25947        }
25948    }
25949
25950    impl std::convert::From<&str> for SourceType {
25951        fn from(value: &str) -> Self {
25952            use std::string::ToString;
25953            match value {
25954                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
25955                "ESXI" => Self::Esxi,
25956                "VCSA" => Self::Vcsa,
25957                _ => Self::UnknownValue(source_type::UnknownValue(
25958                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25959                )),
25960            }
25961        }
25962    }
25963
25964    impl serde::ser::Serialize for SourceType {
25965        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25966        where
25967            S: serde::Serializer,
25968        {
25969            match self {
25970                Self::Unspecified => serializer.serialize_i32(0),
25971                Self::Esxi => serializer.serialize_i32(1),
25972                Self::Vcsa => serializer.serialize_i32(2),
25973                Self::UnknownValue(u) => u.0.serialize(serializer),
25974            }
25975        }
25976    }
25977
25978    impl<'de> serde::de::Deserialize<'de> for SourceType {
25979        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25980        where
25981            D: serde::Deserializer<'de>,
25982        {
25983            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
25984                ".google.cloud.vmwareengine.v1.LoggingServer.SourceType",
25985            ))
25986        }
25987    }
25988}
25989
25990/// Describes node type.
25991#[derive(Clone, Default, PartialEq)]
25992#[non_exhaustive]
25993pub struct NodeType {
25994    /// Output only. The resource name of this node type.
25995    /// Resource names are schemeless URIs that follow the conventions in
25996    /// <https://cloud.google.com/apis/design/resource_names>.
25997    /// For example:
25998    /// `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72`
25999    pub name: std::string::String,
26000
26001    /// Output only. The canonical identifier of the node type
26002    /// (corresponds to the `NodeType`). For example: standard-72.
26003    pub node_type_id: std::string::String,
26004
26005    /// Output only. The friendly name for this node type.
26006    /// For example: ve1-standard-72
26007    pub display_name: std::string::String,
26008
26009    /// Output only. The total number of virtual CPUs in a single node.
26010    pub virtual_cpu_count: i32,
26011
26012    /// Output only. The total number of CPU cores in a single node.
26013    pub total_core_count: i32,
26014
26015    /// Output only. The amount of physical memory available, defined in GB.
26016    pub memory_gb: i32,
26017
26018    /// Output only. The amount of storage available, defined in GB.
26019    pub disk_size_gb: i32,
26020
26021    /// Output only. List of possible values of custom core count.
26022    pub available_custom_core_counts: std::vec::Vec<i32>,
26023
26024    /// Output only. The type of the resource.
26025    pub kind: crate::model::node_type::Kind,
26026
26027    /// Output only. Families of the node type.
26028    /// For node types to be in the same cluster
26029    /// they must share at least one element in the `families`.
26030    pub families: std::vec::Vec<std::string::String>,
26031
26032    /// Output only. Capabilities of this node type.
26033    pub capabilities: std::vec::Vec<crate::model::node_type::Capability>,
26034
26035    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26036}
26037
26038impl NodeType {
26039    pub fn new() -> Self {
26040        std::default::Default::default()
26041    }
26042
26043    /// Sets the value of [name][crate::model::NodeType::name].
26044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26045        self.name = v.into();
26046        self
26047    }
26048
26049    /// Sets the value of [node_type_id][crate::model::NodeType::node_type_id].
26050    pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26051        self.node_type_id = v.into();
26052        self
26053    }
26054
26055    /// Sets the value of [display_name][crate::model::NodeType::display_name].
26056    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26057        self.display_name = v.into();
26058        self
26059    }
26060
26061    /// Sets the value of [virtual_cpu_count][crate::model::NodeType::virtual_cpu_count].
26062    pub fn set_virtual_cpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26063        self.virtual_cpu_count = v.into();
26064        self
26065    }
26066
26067    /// Sets the value of [total_core_count][crate::model::NodeType::total_core_count].
26068    pub fn set_total_core_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26069        self.total_core_count = v.into();
26070        self
26071    }
26072
26073    /// Sets the value of [memory_gb][crate::model::NodeType::memory_gb].
26074    pub fn set_memory_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26075        self.memory_gb = v.into();
26076        self
26077    }
26078
26079    /// Sets the value of [disk_size_gb][crate::model::NodeType::disk_size_gb].
26080    pub fn set_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26081        self.disk_size_gb = v.into();
26082        self
26083    }
26084
26085    /// Sets the value of [available_custom_core_counts][crate::model::NodeType::available_custom_core_counts].
26086    pub fn set_available_custom_core_counts<T, V>(mut self, v: T) -> Self
26087    where
26088        T: std::iter::IntoIterator<Item = V>,
26089        V: std::convert::Into<i32>,
26090    {
26091        use std::iter::Iterator;
26092        self.available_custom_core_counts = v.into_iter().map(|i| i.into()).collect();
26093        self
26094    }
26095
26096    /// Sets the value of [kind][crate::model::NodeType::kind].
26097    pub fn set_kind<T: std::convert::Into<crate::model::node_type::Kind>>(mut self, v: T) -> Self {
26098        self.kind = v.into();
26099        self
26100    }
26101
26102    /// Sets the value of [families][crate::model::NodeType::families].
26103    pub fn set_families<T, V>(mut self, v: T) -> Self
26104    where
26105        T: std::iter::IntoIterator<Item = V>,
26106        V: std::convert::Into<std::string::String>,
26107    {
26108        use std::iter::Iterator;
26109        self.families = v.into_iter().map(|i| i.into()).collect();
26110        self
26111    }
26112
26113    /// Sets the value of [capabilities][crate::model::NodeType::capabilities].
26114    pub fn set_capabilities<T, V>(mut self, v: T) -> Self
26115    where
26116        T: std::iter::IntoIterator<Item = V>,
26117        V: std::convert::Into<crate::model::node_type::Capability>,
26118    {
26119        use std::iter::Iterator;
26120        self.capabilities = v.into_iter().map(|i| i.into()).collect();
26121        self
26122    }
26123}
26124
26125impl wkt::message::Message for NodeType {
26126    fn typename() -> &'static str {
26127        "type.googleapis.com/google.cloud.vmwareengine.v1.NodeType"
26128    }
26129}
26130
26131#[doc(hidden)]
26132impl<'de> serde::de::Deserialize<'de> for NodeType {
26133    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26134    where
26135        D: serde::Deserializer<'de>,
26136    {
26137        #[allow(non_camel_case_types)]
26138        #[doc(hidden)]
26139        #[derive(PartialEq, Eq, Hash)]
26140        enum __FieldTag {
26141            __name,
26142            __node_type_id,
26143            __display_name,
26144            __virtual_cpu_count,
26145            __total_core_count,
26146            __memory_gb,
26147            __disk_size_gb,
26148            __available_custom_core_counts,
26149            __kind,
26150            __families,
26151            __capabilities,
26152            Unknown(std::string::String),
26153        }
26154        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26155            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26156            where
26157                D: serde::Deserializer<'de>,
26158            {
26159                struct Visitor;
26160                impl<'de> serde::de::Visitor<'de> for Visitor {
26161                    type Value = __FieldTag;
26162                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26163                        formatter.write_str("a field name for NodeType")
26164                    }
26165                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26166                    where
26167                        E: serde::de::Error,
26168                    {
26169                        use std::result::Result::Ok;
26170                        use std::string::ToString;
26171                        match value {
26172                            "name" => Ok(__FieldTag::__name),
26173                            "nodeTypeId" => Ok(__FieldTag::__node_type_id),
26174                            "node_type_id" => Ok(__FieldTag::__node_type_id),
26175                            "displayName" => Ok(__FieldTag::__display_name),
26176                            "display_name" => Ok(__FieldTag::__display_name),
26177                            "virtualCpuCount" => Ok(__FieldTag::__virtual_cpu_count),
26178                            "virtual_cpu_count" => Ok(__FieldTag::__virtual_cpu_count),
26179                            "totalCoreCount" => Ok(__FieldTag::__total_core_count),
26180                            "total_core_count" => Ok(__FieldTag::__total_core_count),
26181                            "memoryGb" => Ok(__FieldTag::__memory_gb),
26182                            "memory_gb" => Ok(__FieldTag::__memory_gb),
26183                            "diskSizeGb" => Ok(__FieldTag::__disk_size_gb),
26184                            "disk_size_gb" => Ok(__FieldTag::__disk_size_gb),
26185                            "availableCustomCoreCounts" => {
26186                                Ok(__FieldTag::__available_custom_core_counts)
26187                            }
26188                            "available_custom_core_counts" => {
26189                                Ok(__FieldTag::__available_custom_core_counts)
26190                            }
26191                            "kind" => Ok(__FieldTag::__kind),
26192                            "families" => Ok(__FieldTag::__families),
26193                            "capabilities" => Ok(__FieldTag::__capabilities),
26194                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26195                        }
26196                    }
26197                }
26198                deserializer.deserialize_identifier(Visitor)
26199            }
26200        }
26201        struct Visitor;
26202        impl<'de> serde::de::Visitor<'de> for Visitor {
26203            type Value = NodeType;
26204            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26205                formatter.write_str("struct NodeType")
26206            }
26207            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26208            where
26209                A: serde::de::MapAccess<'de>,
26210            {
26211                #[allow(unused_imports)]
26212                use serde::de::Error;
26213                use std::option::Option::Some;
26214                let mut fields = std::collections::HashSet::new();
26215                let mut result = Self::Value::new();
26216                while let Some(tag) = map.next_key::<__FieldTag>()? {
26217                    #[allow(clippy::match_single_binding)]
26218                    match tag {
26219                        __FieldTag::__name => {
26220                            if !fields.insert(__FieldTag::__name) {
26221                                return std::result::Result::Err(A::Error::duplicate_field(
26222                                    "multiple values for name",
26223                                ));
26224                            }
26225                            result.name = map
26226                                .next_value::<std::option::Option<std::string::String>>()?
26227                                .unwrap_or_default();
26228                        }
26229                        __FieldTag::__node_type_id => {
26230                            if !fields.insert(__FieldTag::__node_type_id) {
26231                                return std::result::Result::Err(A::Error::duplicate_field(
26232                                    "multiple values for node_type_id",
26233                                ));
26234                            }
26235                            result.node_type_id = map
26236                                .next_value::<std::option::Option<std::string::String>>()?
26237                                .unwrap_or_default();
26238                        }
26239                        __FieldTag::__display_name => {
26240                            if !fields.insert(__FieldTag::__display_name) {
26241                                return std::result::Result::Err(A::Error::duplicate_field(
26242                                    "multiple values for display_name",
26243                                ));
26244                            }
26245                            result.display_name = map
26246                                .next_value::<std::option::Option<std::string::String>>()?
26247                                .unwrap_or_default();
26248                        }
26249                        __FieldTag::__virtual_cpu_count => {
26250                            if !fields.insert(__FieldTag::__virtual_cpu_count) {
26251                                return std::result::Result::Err(A::Error::duplicate_field(
26252                                    "multiple values for virtual_cpu_count",
26253                                ));
26254                            }
26255                            struct __With(std::option::Option<i32>);
26256                            impl<'de> serde::de::Deserialize<'de> for __With {
26257                                fn deserialize<D>(
26258                                    deserializer: D,
26259                                ) -> std::result::Result<Self, D::Error>
26260                                where
26261                                    D: serde::de::Deserializer<'de>,
26262                                {
26263                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
26264                                }
26265                            }
26266                            result.virtual_cpu_count =
26267                                map.next_value::<__With>()?.0.unwrap_or_default();
26268                        }
26269                        __FieldTag::__total_core_count => {
26270                            if !fields.insert(__FieldTag::__total_core_count) {
26271                                return std::result::Result::Err(A::Error::duplicate_field(
26272                                    "multiple values for total_core_count",
26273                                ));
26274                            }
26275                            struct __With(std::option::Option<i32>);
26276                            impl<'de> serde::de::Deserialize<'de> for __With {
26277                                fn deserialize<D>(
26278                                    deserializer: D,
26279                                ) -> std::result::Result<Self, D::Error>
26280                                where
26281                                    D: serde::de::Deserializer<'de>,
26282                                {
26283                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
26284                                }
26285                            }
26286                            result.total_core_count =
26287                                map.next_value::<__With>()?.0.unwrap_or_default();
26288                        }
26289                        __FieldTag::__memory_gb => {
26290                            if !fields.insert(__FieldTag::__memory_gb) {
26291                                return std::result::Result::Err(A::Error::duplicate_field(
26292                                    "multiple values for memory_gb",
26293                                ));
26294                            }
26295                            struct __With(std::option::Option<i32>);
26296                            impl<'de> serde::de::Deserialize<'de> for __With {
26297                                fn deserialize<D>(
26298                                    deserializer: D,
26299                                ) -> std::result::Result<Self, D::Error>
26300                                where
26301                                    D: serde::de::Deserializer<'de>,
26302                                {
26303                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
26304                                }
26305                            }
26306                            result.memory_gb = map.next_value::<__With>()?.0.unwrap_or_default();
26307                        }
26308                        __FieldTag::__disk_size_gb => {
26309                            if !fields.insert(__FieldTag::__disk_size_gb) {
26310                                return std::result::Result::Err(A::Error::duplicate_field(
26311                                    "multiple values for disk_size_gb",
26312                                ));
26313                            }
26314                            struct __With(std::option::Option<i32>);
26315                            impl<'de> serde::de::Deserialize<'de> for __With {
26316                                fn deserialize<D>(
26317                                    deserializer: D,
26318                                ) -> std::result::Result<Self, D::Error>
26319                                where
26320                                    D: serde::de::Deserializer<'de>,
26321                                {
26322                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
26323                                }
26324                            }
26325                            result.disk_size_gb = map.next_value::<__With>()?.0.unwrap_or_default();
26326                        }
26327                        __FieldTag::__available_custom_core_counts => {
26328                            if !fields.insert(__FieldTag::__available_custom_core_counts) {
26329                                return std::result::Result::Err(A::Error::duplicate_field(
26330                                    "multiple values for available_custom_core_counts",
26331                                ));
26332                            }
26333                            struct __With(std::option::Option<std::vec::Vec<i32>>);
26334                            impl<'de> serde::de::Deserialize<'de> for __With {
26335                                fn deserialize<D>(
26336                                    deserializer: D,
26337                                ) -> std::result::Result<Self, D::Error>
26338                                where
26339                                    D: serde::de::Deserializer<'de>,
26340                                {
26341                                    serde_with::As::<
26342                                        std::option::Option<std::vec::Vec<wkt::internal::I32>>,
26343                                    >::deserialize(deserializer)
26344                                    .map(__With)
26345                                }
26346                            }
26347                            result.available_custom_core_counts =
26348                                map.next_value::<__With>()?.0.unwrap_or_default();
26349                        }
26350                        __FieldTag::__kind => {
26351                            if !fields.insert(__FieldTag::__kind) {
26352                                return std::result::Result::Err(A::Error::duplicate_field(
26353                                    "multiple values for kind",
26354                                ));
26355                            }
26356                            result.kind = map
26357                                .next_value::<std::option::Option<crate::model::node_type::Kind>>()?
26358                                .unwrap_or_default();
26359                        }
26360                        __FieldTag::__families => {
26361                            if !fields.insert(__FieldTag::__families) {
26362                                return std::result::Result::Err(A::Error::duplicate_field(
26363                                    "multiple values for families",
26364                                ));
26365                            }
26366                            result.families = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
26367                        }
26368                        __FieldTag::__capabilities => {
26369                            if !fields.insert(__FieldTag::__capabilities) {
26370                                return std::result::Result::Err(A::Error::duplicate_field(
26371                                    "multiple values for capabilities",
26372                                ));
26373                            }
26374                            result.capabilities = map
26375                                .next_value::<std::option::Option<
26376                                    std::vec::Vec<crate::model::node_type::Capability>,
26377                                >>()?
26378                                .unwrap_or_default();
26379                        }
26380                        __FieldTag::Unknown(key) => {
26381                            let value = map.next_value::<serde_json::Value>()?;
26382                            result._unknown_fields.insert(key, value);
26383                        }
26384                    }
26385                }
26386                std::result::Result::Ok(result)
26387            }
26388        }
26389        deserializer.deserialize_any(Visitor)
26390    }
26391}
26392
26393#[doc(hidden)]
26394impl serde::ser::Serialize for NodeType {
26395    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26396    where
26397        S: serde::ser::Serializer,
26398    {
26399        use serde::ser::SerializeMap;
26400        #[allow(unused_imports)]
26401        use std::option::Option::Some;
26402        let mut state = serializer.serialize_map(std::option::Option::None)?;
26403        if !self.name.is_empty() {
26404            state.serialize_entry("name", &self.name)?;
26405        }
26406        if !self.node_type_id.is_empty() {
26407            state.serialize_entry("nodeTypeId", &self.node_type_id)?;
26408        }
26409        if !self.display_name.is_empty() {
26410            state.serialize_entry("displayName", &self.display_name)?;
26411        }
26412        if !wkt::internal::is_default(&self.virtual_cpu_count) {
26413            struct __With<'a>(&'a i32);
26414            impl<'a> serde::ser::Serialize for __With<'a> {
26415                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26416                where
26417                    S: serde::ser::Serializer,
26418                {
26419                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
26420                }
26421            }
26422            state.serialize_entry("virtualCpuCount", &__With(&self.virtual_cpu_count))?;
26423        }
26424        if !wkt::internal::is_default(&self.total_core_count) {
26425            struct __With<'a>(&'a i32);
26426            impl<'a> serde::ser::Serialize for __With<'a> {
26427                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26428                where
26429                    S: serde::ser::Serializer,
26430                {
26431                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
26432                }
26433            }
26434            state.serialize_entry("totalCoreCount", &__With(&self.total_core_count))?;
26435        }
26436        if !wkt::internal::is_default(&self.memory_gb) {
26437            struct __With<'a>(&'a i32);
26438            impl<'a> serde::ser::Serialize for __With<'a> {
26439                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26440                where
26441                    S: serde::ser::Serializer,
26442                {
26443                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
26444                }
26445            }
26446            state.serialize_entry("memoryGb", &__With(&self.memory_gb))?;
26447        }
26448        if !wkt::internal::is_default(&self.disk_size_gb) {
26449            struct __With<'a>(&'a i32);
26450            impl<'a> serde::ser::Serialize for __With<'a> {
26451                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26452                where
26453                    S: serde::ser::Serializer,
26454                {
26455                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
26456                }
26457            }
26458            state.serialize_entry("diskSizeGb", &__With(&self.disk_size_gb))?;
26459        }
26460        if !self.available_custom_core_counts.is_empty() {
26461            struct __With<'a>(&'a std::vec::Vec<i32>);
26462            impl<'a> serde::ser::Serialize for __With<'a> {
26463                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26464                where
26465                    S: serde::ser::Serializer,
26466                {
26467                    serde_with::As::<std::vec::Vec<wkt::internal::I32>>::serialize(
26468                        self.0, serializer,
26469                    )
26470                }
26471            }
26472            state.serialize_entry(
26473                "availableCustomCoreCounts",
26474                &__With(&self.available_custom_core_counts),
26475            )?;
26476        }
26477        if !wkt::internal::is_default(&self.kind) {
26478            state.serialize_entry("kind", &self.kind)?;
26479        }
26480        if !self.families.is_empty() {
26481            state.serialize_entry("families", &self.families)?;
26482        }
26483        if !self.capabilities.is_empty() {
26484            state.serialize_entry("capabilities", &self.capabilities)?;
26485        }
26486        if !self._unknown_fields.is_empty() {
26487            for (key, value) in self._unknown_fields.iter() {
26488                state.serialize_entry(key, &value)?;
26489            }
26490        }
26491        state.end()
26492    }
26493}
26494
26495impl std::fmt::Debug for NodeType {
26496    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26497        let mut debug_struct = f.debug_struct("NodeType");
26498        debug_struct.field("name", &self.name);
26499        debug_struct.field("node_type_id", &self.node_type_id);
26500        debug_struct.field("display_name", &self.display_name);
26501        debug_struct.field("virtual_cpu_count", &self.virtual_cpu_count);
26502        debug_struct.field("total_core_count", &self.total_core_count);
26503        debug_struct.field("memory_gb", &self.memory_gb);
26504        debug_struct.field("disk_size_gb", &self.disk_size_gb);
26505        debug_struct.field(
26506            "available_custom_core_counts",
26507            &self.available_custom_core_counts,
26508        );
26509        debug_struct.field("kind", &self.kind);
26510        debug_struct.field("families", &self.families);
26511        debug_struct.field("capabilities", &self.capabilities);
26512        if !self._unknown_fields.is_empty() {
26513            debug_struct.field("_unknown_fields", &self._unknown_fields);
26514        }
26515        debug_struct.finish()
26516    }
26517}
26518
26519/// Defines additional types related to [NodeType].
26520pub mod node_type {
26521    #[allow(unused_imports)]
26522    use super::*;
26523
26524    /// Enum Kind defines possible types of a NodeType.
26525    ///
26526    /// # Working with unknown values
26527    ///
26528    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26529    /// additional enum variants at any time. Adding new variants is not considered
26530    /// a breaking change. Applications should write their code in anticipation of:
26531    ///
26532    /// - New values appearing in future releases of the client library, **and**
26533    /// - New values received dynamically, without application changes.
26534    ///
26535    /// Please consult the [Working with enums] section in the user guide for some
26536    /// guidelines.
26537    ///
26538    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
26539    #[derive(Clone, Debug, PartialEq)]
26540    #[non_exhaustive]
26541    pub enum Kind {
26542        /// The default value. This value should never be used.
26543        Unspecified,
26544        /// Standard HCI node.
26545        Standard,
26546        /// Storage only Node.
26547        StorageOnly,
26548        /// If set, the enum was initialized with an unknown value.
26549        ///
26550        /// Applications can examine the value using [Kind::value] or
26551        /// [Kind::name].
26552        UnknownValue(kind::UnknownValue),
26553    }
26554
26555    #[doc(hidden)]
26556    pub mod kind {
26557        #[allow(unused_imports)]
26558        use super::*;
26559        #[derive(Clone, Debug, PartialEq)]
26560        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26561    }
26562
26563    impl Kind {
26564        /// Gets the enum value.
26565        ///
26566        /// Returns `None` if the enum contains an unknown value deserialized from
26567        /// the string representation of enums.
26568        pub fn value(&self) -> std::option::Option<i32> {
26569            match self {
26570                Self::Unspecified => std::option::Option::Some(0),
26571                Self::Standard => std::option::Option::Some(1),
26572                Self::StorageOnly => std::option::Option::Some(2),
26573                Self::UnknownValue(u) => u.0.value(),
26574            }
26575        }
26576
26577        /// Gets the enum value as a string.
26578        ///
26579        /// Returns `None` if the enum contains an unknown value deserialized from
26580        /// the integer representation of enums.
26581        pub fn name(&self) -> std::option::Option<&str> {
26582            match self {
26583                Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
26584                Self::Standard => std::option::Option::Some("STANDARD"),
26585                Self::StorageOnly => std::option::Option::Some("STORAGE_ONLY"),
26586                Self::UnknownValue(u) => u.0.name(),
26587            }
26588        }
26589    }
26590
26591    impl std::default::Default for Kind {
26592        fn default() -> Self {
26593            use std::convert::From;
26594            Self::from(0)
26595        }
26596    }
26597
26598    impl std::fmt::Display for Kind {
26599        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26600            wkt::internal::display_enum(f, self.name(), self.value())
26601        }
26602    }
26603
26604    impl std::convert::From<i32> for Kind {
26605        fn from(value: i32) -> Self {
26606            match value {
26607                0 => Self::Unspecified,
26608                1 => Self::Standard,
26609                2 => Self::StorageOnly,
26610                _ => Self::UnknownValue(kind::UnknownValue(
26611                    wkt::internal::UnknownEnumValue::Integer(value),
26612                )),
26613            }
26614        }
26615    }
26616
26617    impl std::convert::From<&str> for Kind {
26618        fn from(value: &str) -> Self {
26619            use std::string::ToString;
26620            match value {
26621                "KIND_UNSPECIFIED" => Self::Unspecified,
26622                "STANDARD" => Self::Standard,
26623                "STORAGE_ONLY" => Self::StorageOnly,
26624                _ => Self::UnknownValue(kind::UnknownValue(
26625                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26626                )),
26627            }
26628        }
26629    }
26630
26631    impl serde::ser::Serialize for Kind {
26632        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26633        where
26634            S: serde::Serializer,
26635        {
26636            match self {
26637                Self::Unspecified => serializer.serialize_i32(0),
26638                Self::Standard => serializer.serialize_i32(1),
26639                Self::StorageOnly => serializer.serialize_i32(2),
26640                Self::UnknownValue(u) => u.0.serialize(serializer),
26641            }
26642        }
26643    }
26644
26645    impl<'de> serde::de::Deserialize<'de> for Kind {
26646        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26647        where
26648            D: serde::Deserializer<'de>,
26649        {
26650            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
26651                ".google.cloud.vmwareengine.v1.NodeType.Kind",
26652            ))
26653        }
26654    }
26655
26656    /// Capability of a node type.
26657    ///
26658    /// # Working with unknown values
26659    ///
26660    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26661    /// additional enum variants at any time. Adding new variants is not considered
26662    /// a breaking change. Applications should write their code in anticipation of:
26663    ///
26664    /// - New values appearing in future releases of the client library, **and**
26665    /// - New values received dynamically, without application changes.
26666    ///
26667    /// Please consult the [Working with enums] section in the user guide for some
26668    /// guidelines.
26669    ///
26670    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
26671    #[derive(Clone, Debug, PartialEq)]
26672    #[non_exhaustive]
26673    pub enum Capability {
26674        /// The default value. This value is used if the capability is omitted or
26675        /// unknown.
26676        Unspecified,
26677        /// This node type supports stretch clusters.
26678        StretchedClusters,
26679        /// If set, the enum was initialized with an unknown value.
26680        ///
26681        /// Applications can examine the value using [Capability::value] or
26682        /// [Capability::name].
26683        UnknownValue(capability::UnknownValue),
26684    }
26685
26686    #[doc(hidden)]
26687    pub mod capability {
26688        #[allow(unused_imports)]
26689        use super::*;
26690        #[derive(Clone, Debug, PartialEq)]
26691        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26692    }
26693
26694    impl Capability {
26695        /// Gets the enum value.
26696        ///
26697        /// Returns `None` if the enum contains an unknown value deserialized from
26698        /// the string representation of enums.
26699        pub fn value(&self) -> std::option::Option<i32> {
26700            match self {
26701                Self::Unspecified => std::option::Option::Some(0),
26702                Self::StretchedClusters => std::option::Option::Some(1),
26703                Self::UnknownValue(u) => u.0.value(),
26704            }
26705        }
26706
26707        /// Gets the enum value as a string.
26708        ///
26709        /// Returns `None` if the enum contains an unknown value deserialized from
26710        /// the integer representation of enums.
26711        pub fn name(&self) -> std::option::Option<&str> {
26712            match self {
26713                Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
26714                Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
26715                Self::UnknownValue(u) => u.0.name(),
26716            }
26717        }
26718    }
26719
26720    impl std::default::Default for Capability {
26721        fn default() -> Self {
26722            use std::convert::From;
26723            Self::from(0)
26724        }
26725    }
26726
26727    impl std::fmt::Display for Capability {
26728        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26729            wkt::internal::display_enum(f, self.name(), self.value())
26730        }
26731    }
26732
26733    impl std::convert::From<i32> for Capability {
26734        fn from(value: i32) -> Self {
26735            match value {
26736                0 => Self::Unspecified,
26737                1 => Self::StretchedClusters,
26738                _ => Self::UnknownValue(capability::UnknownValue(
26739                    wkt::internal::UnknownEnumValue::Integer(value),
26740                )),
26741            }
26742        }
26743    }
26744
26745    impl std::convert::From<&str> for Capability {
26746        fn from(value: &str) -> Self {
26747            use std::string::ToString;
26748            match value {
26749                "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
26750                "STRETCHED_CLUSTERS" => Self::StretchedClusters,
26751                _ => Self::UnknownValue(capability::UnknownValue(
26752                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26753                )),
26754            }
26755        }
26756    }
26757
26758    impl serde::ser::Serialize for Capability {
26759        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26760        where
26761            S: serde::Serializer,
26762        {
26763            match self {
26764                Self::Unspecified => serializer.serialize_i32(0),
26765                Self::StretchedClusters => serializer.serialize_i32(1),
26766                Self::UnknownValue(u) => u.0.serialize(serializer),
26767            }
26768        }
26769    }
26770
26771    impl<'de> serde::de::Deserialize<'de> for Capability {
26772        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26773        where
26774            D: serde::Deserializer<'de>,
26775        {
26776            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
26777                ".google.cloud.vmwareengine.v1.NodeType.Capability",
26778            ))
26779        }
26780    }
26781}
26782
26783/// Credentials for a private cloud.
26784#[derive(Clone, Default, PartialEq)]
26785#[non_exhaustive]
26786pub struct Credentials {
26787    /// Initial username.
26788    pub username: std::string::String,
26789
26790    /// Initial password.
26791    pub password: std::string::String,
26792
26793    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26794}
26795
26796impl Credentials {
26797    pub fn new() -> Self {
26798        std::default::Default::default()
26799    }
26800
26801    /// Sets the value of [username][crate::model::Credentials::username].
26802    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26803        self.username = v.into();
26804        self
26805    }
26806
26807    /// Sets the value of [password][crate::model::Credentials::password].
26808    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26809        self.password = v.into();
26810        self
26811    }
26812}
26813
26814impl wkt::message::Message for Credentials {
26815    fn typename() -> &'static str {
26816        "type.googleapis.com/google.cloud.vmwareengine.v1.Credentials"
26817    }
26818}
26819
26820#[doc(hidden)]
26821impl<'de> serde::de::Deserialize<'de> for Credentials {
26822    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26823    where
26824        D: serde::Deserializer<'de>,
26825    {
26826        #[allow(non_camel_case_types)]
26827        #[doc(hidden)]
26828        #[derive(PartialEq, Eq, Hash)]
26829        enum __FieldTag {
26830            __username,
26831            __password,
26832            Unknown(std::string::String),
26833        }
26834        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26835            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26836            where
26837                D: serde::Deserializer<'de>,
26838            {
26839                struct Visitor;
26840                impl<'de> serde::de::Visitor<'de> for Visitor {
26841                    type Value = __FieldTag;
26842                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26843                        formatter.write_str("a field name for Credentials")
26844                    }
26845                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26846                    where
26847                        E: serde::de::Error,
26848                    {
26849                        use std::result::Result::Ok;
26850                        use std::string::ToString;
26851                        match value {
26852                            "username" => Ok(__FieldTag::__username),
26853                            "password" => Ok(__FieldTag::__password),
26854                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26855                        }
26856                    }
26857                }
26858                deserializer.deserialize_identifier(Visitor)
26859            }
26860        }
26861        struct Visitor;
26862        impl<'de> serde::de::Visitor<'de> for Visitor {
26863            type Value = Credentials;
26864            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26865                formatter.write_str("struct Credentials")
26866            }
26867            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26868            where
26869                A: serde::de::MapAccess<'de>,
26870            {
26871                #[allow(unused_imports)]
26872                use serde::de::Error;
26873                use std::option::Option::Some;
26874                let mut fields = std::collections::HashSet::new();
26875                let mut result = Self::Value::new();
26876                while let Some(tag) = map.next_key::<__FieldTag>()? {
26877                    #[allow(clippy::match_single_binding)]
26878                    match tag {
26879                        __FieldTag::__username => {
26880                            if !fields.insert(__FieldTag::__username) {
26881                                return std::result::Result::Err(A::Error::duplicate_field(
26882                                    "multiple values for username",
26883                                ));
26884                            }
26885                            result.username = map
26886                                .next_value::<std::option::Option<std::string::String>>()?
26887                                .unwrap_or_default();
26888                        }
26889                        __FieldTag::__password => {
26890                            if !fields.insert(__FieldTag::__password) {
26891                                return std::result::Result::Err(A::Error::duplicate_field(
26892                                    "multiple values for password",
26893                                ));
26894                            }
26895                            result.password = map
26896                                .next_value::<std::option::Option<std::string::String>>()?
26897                                .unwrap_or_default();
26898                        }
26899                        __FieldTag::Unknown(key) => {
26900                            let value = map.next_value::<serde_json::Value>()?;
26901                            result._unknown_fields.insert(key, value);
26902                        }
26903                    }
26904                }
26905                std::result::Result::Ok(result)
26906            }
26907        }
26908        deserializer.deserialize_any(Visitor)
26909    }
26910}
26911
26912#[doc(hidden)]
26913impl serde::ser::Serialize for Credentials {
26914    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26915    where
26916        S: serde::ser::Serializer,
26917    {
26918        use serde::ser::SerializeMap;
26919        #[allow(unused_imports)]
26920        use std::option::Option::Some;
26921        let mut state = serializer.serialize_map(std::option::Option::None)?;
26922        if !self.username.is_empty() {
26923            state.serialize_entry("username", &self.username)?;
26924        }
26925        if !self.password.is_empty() {
26926            state.serialize_entry("password", &self.password)?;
26927        }
26928        if !self._unknown_fields.is_empty() {
26929            for (key, value) in self._unknown_fields.iter() {
26930                state.serialize_entry(key, &value)?;
26931            }
26932        }
26933        state.end()
26934    }
26935}
26936
26937impl std::fmt::Debug for Credentials {
26938    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26939        let mut debug_struct = f.debug_struct("Credentials");
26940        debug_struct.field("username", &self.username);
26941        debug_struct.field("password", &self.password);
26942        if !self._unknown_fields.is_empty() {
26943            debug_struct.field("_unknown_fields", &self._unknown_fields);
26944        }
26945        debug_struct.finish()
26946    }
26947}
26948
26949/// HCX activation key. A default key is created during
26950/// private cloud provisioning, but this behavior is subject to change
26951/// and you should always verify active keys.
26952/// Use
26953/// [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]
26954/// to retrieve existing keys and
26955/// [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]
26956/// to create new ones.
26957///
26958/// [google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey]: crate::client::VmwareEngine::create_hcx_activation_key
26959/// [google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys]: crate::client::VmwareEngine::list_hcx_activation_keys
26960#[derive(Clone, Default, PartialEq)]
26961#[non_exhaustive]
26962pub struct HcxActivationKey {
26963    /// Output only. The resource name of this HcxActivationKey.
26964    /// Resource names are schemeless URIs that follow the conventions in
26965    /// <https://cloud.google.com/apis/design/resource_names>.
26966    /// For example:
26967    /// `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key`
26968    pub name: std::string::String,
26969
26970    /// Output only. Creation time of HCX activation key.
26971    pub create_time: std::option::Option<wkt::Timestamp>,
26972
26973    /// Output only. State of HCX activation key.
26974    pub state: crate::model::hcx_activation_key::State,
26975
26976    /// Output only. HCX activation key.
26977    pub activation_key: std::string::String,
26978
26979    /// Output only. System-generated unique identifier for the resource.
26980    pub uid: std::string::String,
26981
26982    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26983}
26984
26985impl HcxActivationKey {
26986    pub fn new() -> Self {
26987        std::default::Default::default()
26988    }
26989
26990    /// Sets the value of [name][crate::model::HcxActivationKey::name].
26991    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26992        self.name = v.into();
26993        self
26994    }
26995
26996    /// Sets the value of [create_time][crate::model::HcxActivationKey::create_time].
26997    pub fn set_create_time<T>(mut self, v: T) -> Self
26998    where
26999        T: std::convert::Into<wkt::Timestamp>,
27000    {
27001        self.create_time = std::option::Option::Some(v.into());
27002        self
27003    }
27004
27005    /// Sets or clears the value of [create_time][crate::model::HcxActivationKey::create_time].
27006    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
27007    where
27008        T: std::convert::Into<wkt::Timestamp>,
27009    {
27010        self.create_time = v.map(|x| x.into());
27011        self
27012    }
27013
27014    /// Sets the value of [state][crate::model::HcxActivationKey::state].
27015    pub fn set_state<T: std::convert::Into<crate::model::hcx_activation_key::State>>(
27016        mut self,
27017        v: T,
27018    ) -> Self {
27019        self.state = v.into();
27020        self
27021    }
27022
27023    /// Sets the value of [activation_key][crate::model::HcxActivationKey::activation_key].
27024    pub fn set_activation_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27025        self.activation_key = v.into();
27026        self
27027    }
27028
27029    /// Sets the value of [uid][crate::model::HcxActivationKey::uid].
27030    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27031        self.uid = v.into();
27032        self
27033    }
27034}
27035
27036impl wkt::message::Message for HcxActivationKey {
27037    fn typename() -> &'static str {
27038        "type.googleapis.com/google.cloud.vmwareengine.v1.HcxActivationKey"
27039    }
27040}
27041
27042#[doc(hidden)]
27043impl<'de> serde::de::Deserialize<'de> for HcxActivationKey {
27044    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27045    where
27046        D: serde::Deserializer<'de>,
27047    {
27048        #[allow(non_camel_case_types)]
27049        #[doc(hidden)]
27050        #[derive(PartialEq, Eq, Hash)]
27051        enum __FieldTag {
27052            __name,
27053            __create_time,
27054            __state,
27055            __activation_key,
27056            __uid,
27057            Unknown(std::string::String),
27058        }
27059        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27060            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27061            where
27062                D: serde::Deserializer<'de>,
27063            {
27064                struct Visitor;
27065                impl<'de> serde::de::Visitor<'de> for Visitor {
27066                    type Value = __FieldTag;
27067                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27068                        formatter.write_str("a field name for HcxActivationKey")
27069                    }
27070                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27071                    where
27072                        E: serde::de::Error,
27073                    {
27074                        use std::result::Result::Ok;
27075                        use std::string::ToString;
27076                        match value {
27077                            "name" => Ok(__FieldTag::__name),
27078                            "createTime" => Ok(__FieldTag::__create_time),
27079                            "create_time" => Ok(__FieldTag::__create_time),
27080                            "state" => Ok(__FieldTag::__state),
27081                            "activationKey" => Ok(__FieldTag::__activation_key),
27082                            "activation_key" => Ok(__FieldTag::__activation_key),
27083                            "uid" => Ok(__FieldTag::__uid),
27084                            _ => Ok(__FieldTag::Unknown(value.to_string())),
27085                        }
27086                    }
27087                }
27088                deserializer.deserialize_identifier(Visitor)
27089            }
27090        }
27091        struct Visitor;
27092        impl<'de> serde::de::Visitor<'de> for Visitor {
27093            type Value = HcxActivationKey;
27094            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27095                formatter.write_str("struct HcxActivationKey")
27096            }
27097            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27098            where
27099                A: serde::de::MapAccess<'de>,
27100            {
27101                #[allow(unused_imports)]
27102                use serde::de::Error;
27103                use std::option::Option::Some;
27104                let mut fields = std::collections::HashSet::new();
27105                let mut result = Self::Value::new();
27106                while let Some(tag) = map.next_key::<__FieldTag>()? {
27107                    #[allow(clippy::match_single_binding)]
27108                    match tag {
27109                        __FieldTag::__name => {
27110                            if !fields.insert(__FieldTag::__name) {
27111                                return std::result::Result::Err(A::Error::duplicate_field(
27112                                    "multiple values for name",
27113                                ));
27114                            }
27115                            result.name = map
27116                                .next_value::<std::option::Option<std::string::String>>()?
27117                                .unwrap_or_default();
27118                        }
27119                        __FieldTag::__create_time => {
27120                            if !fields.insert(__FieldTag::__create_time) {
27121                                return std::result::Result::Err(A::Error::duplicate_field(
27122                                    "multiple values for create_time",
27123                                ));
27124                            }
27125                            result.create_time =
27126                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
27127                        }
27128                        __FieldTag::__state => {
27129                            if !fields.insert(__FieldTag::__state) {
27130                                return std::result::Result::Err(A::Error::duplicate_field(
27131                                    "multiple values for state",
27132                                ));
27133                            }
27134                            result.state = map.next_value::<std::option::Option<crate::model::hcx_activation_key::State>>()?.unwrap_or_default();
27135                        }
27136                        __FieldTag::__activation_key => {
27137                            if !fields.insert(__FieldTag::__activation_key) {
27138                                return std::result::Result::Err(A::Error::duplicate_field(
27139                                    "multiple values for activation_key",
27140                                ));
27141                            }
27142                            result.activation_key = map
27143                                .next_value::<std::option::Option<std::string::String>>()?
27144                                .unwrap_or_default();
27145                        }
27146                        __FieldTag::__uid => {
27147                            if !fields.insert(__FieldTag::__uid) {
27148                                return std::result::Result::Err(A::Error::duplicate_field(
27149                                    "multiple values for uid",
27150                                ));
27151                            }
27152                            result.uid = map
27153                                .next_value::<std::option::Option<std::string::String>>()?
27154                                .unwrap_or_default();
27155                        }
27156                        __FieldTag::Unknown(key) => {
27157                            let value = map.next_value::<serde_json::Value>()?;
27158                            result._unknown_fields.insert(key, value);
27159                        }
27160                    }
27161                }
27162                std::result::Result::Ok(result)
27163            }
27164        }
27165        deserializer.deserialize_any(Visitor)
27166    }
27167}
27168
27169#[doc(hidden)]
27170impl serde::ser::Serialize for HcxActivationKey {
27171    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27172    where
27173        S: serde::ser::Serializer,
27174    {
27175        use serde::ser::SerializeMap;
27176        #[allow(unused_imports)]
27177        use std::option::Option::Some;
27178        let mut state = serializer.serialize_map(std::option::Option::None)?;
27179        if !self.name.is_empty() {
27180            state.serialize_entry("name", &self.name)?;
27181        }
27182        if self.create_time.is_some() {
27183            state.serialize_entry("createTime", &self.create_time)?;
27184        }
27185        if !wkt::internal::is_default(&self.state) {
27186            state.serialize_entry("state", &self.state)?;
27187        }
27188        if !self.activation_key.is_empty() {
27189            state.serialize_entry("activationKey", &self.activation_key)?;
27190        }
27191        if !self.uid.is_empty() {
27192            state.serialize_entry("uid", &self.uid)?;
27193        }
27194        if !self._unknown_fields.is_empty() {
27195            for (key, value) in self._unknown_fields.iter() {
27196                state.serialize_entry(key, &value)?;
27197            }
27198        }
27199        state.end()
27200    }
27201}
27202
27203impl std::fmt::Debug for HcxActivationKey {
27204    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27205        let mut debug_struct = f.debug_struct("HcxActivationKey");
27206        debug_struct.field("name", &self.name);
27207        debug_struct.field("create_time", &self.create_time);
27208        debug_struct.field("state", &self.state);
27209        debug_struct.field("activation_key", &self.activation_key);
27210        debug_struct.field("uid", &self.uid);
27211        if !self._unknown_fields.is_empty() {
27212            debug_struct.field("_unknown_fields", &self._unknown_fields);
27213        }
27214        debug_struct.finish()
27215    }
27216}
27217
27218/// Defines additional types related to [HcxActivationKey].
27219pub mod hcx_activation_key {
27220    #[allow(unused_imports)]
27221    use super::*;
27222
27223    /// State of HCX activation key
27224    ///
27225    /// # Working with unknown values
27226    ///
27227    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27228    /// additional enum variants at any time. Adding new variants is not considered
27229    /// a breaking change. Applications should write their code in anticipation of:
27230    ///
27231    /// - New values appearing in future releases of the client library, **and**
27232    /// - New values received dynamically, without application changes.
27233    ///
27234    /// Please consult the [Working with enums] section in the user guide for some
27235    /// guidelines.
27236    ///
27237    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27238    #[derive(Clone, Debug, PartialEq)]
27239    #[non_exhaustive]
27240    pub enum State {
27241        /// Unspecified state.
27242        Unspecified,
27243        /// State of a newly generated activation key.
27244        Available,
27245        /// State of key when it has been used to activate HCX appliance.
27246        Consumed,
27247        /// State of key when it is being created.
27248        Creating,
27249        /// If set, the enum was initialized with an unknown value.
27250        ///
27251        /// Applications can examine the value using [State::value] or
27252        /// [State::name].
27253        UnknownValue(state::UnknownValue),
27254    }
27255
27256    #[doc(hidden)]
27257    pub mod state {
27258        #[allow(unused_imports)]
27259        use super::*;
27260        #[derive(Clone, Debug, PartialEq)]
27261        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27262    }
27263
27264    impl State {
27265        /// Gets the enum value.
27266        ///
27267        /// Returns `None` if the enum contains an unknown value deserialized from
27268        /// the string representation of enums.
27269        pub fn value(&self) -> std::option::Option<i32> {
27270            match self {
27271                Self::Unspecified => std::option::Option::Some(0),
27272                Self::Available => std::option::Option::Some(1),
27273                Self::Consumed => std::option::Option::Some(2),
27274                Self::Creating => std::option::Option::Some(3),
27275                Self::UnknownValue(u) => u.0.value(),
27276            }
27277        }
27278
27279        /// Gets the enum value as a string.
27280        ///
27281        /// Returns `None` if the enum contains an unknown value deserialized from
27282        /// the integer representation of enums.
27283        pub fn name(&self) -> std::option::Option<&str> {
27284            match self {
27285                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
27286                Self::Available => std::option::Option::Some("AVAILABLE"),
27287                Self::Consumed => std::option::Option::Some("CONSUMED"),
27288                Self::Creating => std::option::Option::Some("CREATING"),
27289                Self::UnknownValue(u) => u.0.name(),
27290            }
27291        }
27292    }
27293
27294    impl std::default::Default for State {
27295        fn default() -> Self {
27296            use std::convert::From;
27297            Self::from(0)
27298        }
27299    }
27300
27301    impl std::fmt::Display for State {
27302        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27303            wkt::internal::display_enum(f, self.name(), self.value())
27304        }
27305    }
27306
27307    impl std::convert::From<i32> for State {
27308        fn from(value: i32) -> Self {
27309            match value {
27310                0 => Self::Unspecified,
27311                1 => Self::Available,
27312                2 => Self::Consumed,
27313                3 => Self::Creating,
27314                _ => Self::UnknownValue(state::UnknownValue(
27315                    wkt::internal::UnknownEnumValue::Integer(value),
27316                )),
27317            }
27318        }
27319    }
27320
27321    impl std::convert::From<&str> for State {
27322        fn from(value: &str) -> Self {
27323            use std::string::ToString;
27324            match value {
27325                "STATE_UNSPECIFIED" => Self::Unspecified,
27326                "AVAILABLE" => Self::Available,
27327                "CONSUMED" => Self::Consumed,
27328                "CREATING" => Self::Creating,
27329                _ => Self::UnknownValue(state::UnknownValue(
27330                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27331                )),
27332            }
27333        }
27334    }
27335
27336    impl serde::ser::Serialize for State {
27337        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27338        where
27339            S: serde::Serializer,
27340        {
27341            match self {
27342                Self::Unspecified => serializer.serialize_i32(0),
27343                Self::Available => serializer.serialize_i32(1),
27344                Self::Consumed => serializer.serialize_i32(2),
27345                Self::Creating => serializer.serialize_i32(3),
27346                Self::UnknownValue(u) => u.0.serialize(serializer),
27347            }
27348        }
27349    }
27350
27351    impl<'de> serde::de::Deserialize<'de> for State {
27352        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27353        where
27354            D: serde::Deserializer<'de>,
27355        {
27356            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
27357                ".google.cloud.vmwareengine.v1.HcxActivationKey.State",
27358            ))
27359        }
27360    }
27361}
27362
27363/// Details about a HCX Cloud Manager appliance.
27364#[derive(Clone, Default, PartialEq)]
27365#[non_exhaustive]
27366pub struct Hcx {
27367    /// Internal IP address of the appliance.
27368    pub internal_ip: std::string::String,
27369
27370    /// Version of the appliance.
27371    pub version: std::string::String,
27372
27373    /// Output only. The state of the appliance.
27374    pub state: crate::model::hcx::State,
27375
27376    /// Fully qualified domain name of the appliance.
27377    pub fqdn: std::string::String,
27378
27379    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27380}
27381
27382impl Hcx {
27383    pub fn new() -> Self {
27384        std::default::Default::default()
27385    }
27386
27387    /// Sets the value of [internal_ip][crate::model::Hcx::internal_ip].
27388    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27389        self.internal_ip = v.into();
27390        self
27391    }
27392
27393    /// Sets the value of [version][crate::model::Hcx::version].
27394    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27395        self.version = v.into();
27396        self
27397    }
27398
27399    /// Sets the value of [state][crate::model::Hcx::state].
27400    pub fn set_state<T: std::convert::Into<crate::model::hcx::State>>(mut self, v: T) -> Self {
27401        self.state = v.into();
27402        self
27403    }
27404
27405    /// Sets the value of [fqdn][crate::model::Hcx::fqdn].
27406    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27407        self.fqdn = v.into();
27408        self
27409    }
27410}
27411
27412impl wkt::message::Message for Hcx {
27413    fn typename() -> &'static str {
27414        "type.googleapis.com/google.cloud.vmwareengine.v1.Hcx"
27415    }
27416}
27417
27418#[doc(hidden)]
27419impl<'de> serde::de::Deserialize<'de> for Hcx {
27420    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27421    where
27422        D: serde::Deserializer<'de>,
27423    {
27424        #[allow(non_camel_case_types)]
27425        #[doc(hidden)]
27426        #[derive(PartialEq, Eq, Hash)]
27427        enum __FieldTag {
27428            __internal_ip,
27429            __version,
27430            __state,
27431            __fqdn,
27432            Unknown(std::string::String),
27433        }
27434        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27435            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27436            where
27437                D: serde::Deserializer<'de>,
27438            {
27439                struct Visitor;
27440                impl<'de> serde::de::Visitor<'de> for Visitor {
27441                    type Value = __FieldTag;
27442                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27443                        formatter.write_str("a field name for Hcx")
27444                    }
27445                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27446                    where
27447                        E: serde::de::Error,
27448                    {
27449                        use std::result::Result::Ok;
27450                        use std::string::ToString;
27451                        match value {
27452                            "internalIp" => Ok(__FieldTag::__internal_ip),
27453                            "internal_ip" => Ok(__FieldTag::__internal_ip),
27454                            "version" => Ok(__FieldTag::__version),
27455                            "state" => Ok(__FieldTag::__state),
27456                            "fqdn" => Ok(__FieldTag::__fqdn),
27457                            _ => Ok(__FieldTag::Unknown(value.to_string())),
27458                        }
27459                    }
27460                }
27461                deserializer.deserialize_identifier(Visitor)
27462            }
27463        }
27464        struct Visitor;
27465        impl<'de> serde::de::Visitor<'de> for Visitor {
27466            type Value = Hcx;
27467            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27468                formatter.write_str("struct Hcx")
27469            }
27470            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27471            where
27472                A: serde::de::MapAccess<'de>,
27473            {
27474                #[allow(unused_imports)]
27475                use serde::de::Error;
27476                use std::option::Option::Some;
27477                let mut fields = std::collections::HashSet::new();
27478                let mut result = Self::Value::new();
27479                while let Some(tag) = map.next_key::<__FieldTag>()? {
27480                    #[allow(clippy::match_single_binding)]
27481                    match tag {
27482                        __FieldTag::__internal_ip => {
27483                            if !fields.insert(__FieldTag::__internal_ip) {
27484                                return std::result::Result::Err(A::Error::duplicate_field(
27485                                    "multiple values for internal_ip",
27486                                ));
27487                            }
27488                            result.internal_ip = map
27489                                .next_value::<std::option::Option<std::string::String>>()?
27490                                .unwrap_or_default();
27491                        }
27492                        __FieldTag::__version => {
27493                            if !fields.insert(__FieldTag::__version) {
27494                                return std::result::Result::Err(A::Error::duplicate_field(
27495                                    "multiple values for version",
27496                                ));
27497                            }
27498                            result.version = map
27499                                .next_value::<std::option::Option<std::string::String>>()?
27500                                .unwrap_or_default();
27501                        }
27502                        __FieldTag::__state => {
27503                            if !fields.insert(__FieldTag::__state) {
27504                                return std::result::Result::Err(A::Error::duplicate_field(
27505                                    "multiple values for state",
27506                                ));
27507                            }
27508                            result.state = map
27509                                .next_value::<std::option::Option<crate::model::hcx::State>>()?
27510                                .unwrap_or_default();
27511                        }
27512                        __FieldTag::__fqdn => {
27513                            if !fields.insert(__FieldTag::__fqdn) {
27514                                return std::result::Result::Err(A::Error::duplicate_field(
27515                                    "multiple values for fqdn",
27516                                ));
27517                            }
27518                            result.fqdn = map
27519                                .next_value::<std::option::Option<std::string::String>>()?
27520                                .unwrap_or_default();
27521                        }
27522                        __FieldTag::Unknown(key) => {
27523                            let value = map.next_value::<serde_json::Value>()?;
27524                            result._unknown_fields.insert(key, value);
27525                        }
27526                    }
27527                }
27528                std::result::Result::Ok(result)
27529            }
27530        }
27531        deserializer.deserialize_any(Visitor)
27532    }
27533}
27534
27535#[doc(hidden)]
27536impl serde::ser::Serialize for Hcx {
27537    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27538    where
27539        S: serde::ser::Serializer,
27540    {
27541        use serde::ser::SerializeMap;
27542        #[allow(unused_imports)]
27543        use std::option::Option::Some;
27544        let mut state = serializer.serialize_map(std::option::Option::None)?;
27545        if !self.internal_ip.is_empty() {
27546            state.serialize_entry("internalIp", &self.internal_ip)?;
27547        }
27548        if !self.version.is_empty() {
27549            state.serialize_entry("version", &self.version)?;
27550        }
27551        if !wkt::internal::is_default(&self.state) {
27552            state.serialize_entry("state", &self.state)?;
27553        }
27554        if !self.fqdn.is_empty() {
27555            state.serialize_entry("fqdn", &self.fqdn)?;
27556        }
27557        if !self._unknown_fields.is_empty() {
27558            for (key, value) in self._unknown_fields.iter() {
27559                state.serialize_entry(key, &value)?;
27560            }
27561        }
27562        state.end()
27563    }
27564}
27565
27566impl std::fmt::Debug for Hcx {
27567    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27568        let mut debug_struct = f.debug_struct("Hcx");
27569        debug_struct.field("internal_ip", &self.internal_ip);
27570        debug_struct.field("version", &self.version);
27571        debug_struct.field("state", &self.state);
27572        debug_struct.field("fqdn", &self.fqdn);
27573        if !self._unknown_fields.is_empty() {
27574            debug_struct.field("_unknown_fields", &self._unknown_fields);
27575        }
27576        debug_struct.finish()
27577    }
27578}
27579
27580/// Defines additional types related to [Hcx].
27581pub mod hcx {
27582    #[allow(unused_imports)]
27583    use super::*;
27584
27585    /// State of the appliance
27586    ///
27587    /// # Working with unknown values
27588    ///
27589    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27590    /// additional enum variants at any time. Adding new variants is not considered
27591    /// a breaking change. Applications should write their code in anticipation of:
27592    ///
27593    /// - New values appearing in future releases of the client library, **and**
27594    /// - New values received dynamically, without application changes.
27595    ///
27596    /// Please consult the [Working with enums] section in the user guide for some
27597    /// guidelines.
27598    ///
27599    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27600    #[derive(Clone, Debug, PartialEq)]
27601    #[non_exhaustive]
27602    pub enum State {
27603        /// Unspecified appliance state. This is the default value.
27604        Unspecified,
27605        /// The appliance is operational and can be used.
27606        Active,
27607        /// The appliance is being deployed.
27608        Creating,
27609        /// The appliance is being activated.
27610        Activating,
27611        /// If set, the enum was initialized with an unknown value.
27612        ///
27613        /// Applications can examine the value using [State::value] or
27614        /// [State::name].
27615        UnknownValue(state::UnknownValue),
27616    }
27617
27618    #[doc(hidden)]
27619    pub mod state {
27620        #[allow(unused_imports)]
27621        use super::*;
27622        #[derive(Clone, Debug, PartialEq)]
27623        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27624    }
27625
27626    impl State {
27627        /// Gets the enum value.
27628        ///
27629        /// Returns `None` if the enum contains an unknown value deserialized from
27630        /// the string representation of enums.
27631        pub fn value(&self) -> std::option::Option<i32> {
27632            match self {
27633                Self::Unspecified => std::option::Option::Some(0),
27634                Self::Active => std::option::Option::Some(1),
27635                Self::Creating => std::option::Option::Some(2),
27636                Self::Activating => std::option::Option::Some(3),
27637                Self::UnknownValue(u) => u.0.value(),
27638            }
27639        }
27640
27641        /// Gets the enum value as a string.
27642        ///
27643        /// Returns `None` if the enum contains an unknown value deserialized from
27644        /// the integer representation of enums.
27645        pub fn name(&self) -> std::option::Option<&str> {
27646            match self {
27647                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
27648                Self::Active => std::option::Option::Some("ACTIVE"),
27649                Self::Creating => std::option::Option::Some("CREATING"),
27650                Self::Activating => std::option::Option::Some("ACTIVATING"),
27651                Self::UnknownValue(u) => u.0.name(),
27652            }
27653        }
27654    }
27655
27656    impl std::default::Default for State {
27657        fn default() -> Self {
27658            use std::convert::From;
27659            Self::from(0)
27660        }
27661    }
27662
27663    impl std::fmt::Display for State {
27664        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27665            wkt::internal::display_enum(f, self.name(), self.value())
27666        }
27667    }
27668
27669    impl std::convert::From<i32> for State {
27670        fn from(value: i32) -> Self {
27671            match value {
27672                0 => Self::Unspecified,
27673                1 => Self::Active,
27674                2 => Self::Creating,
27675                3 => Self::Activating,
27676                _ => Self::UnknownValue(state::UnknownValue(
27677                    wkt::internal::UnknownEnumValue::Integer(value),
27678                )),
27679            }
27680        }
27681    }
27682
27683    impl std::convert::From<&str> for State {
27684        fn from(value: &str) -> Self {
27685            use std::string::ToString;
27686            match value {
27687                "STATE_UNSPECIFIED" => Self::Unspecified,
27688                "ACTIVE" => Self::Active,
27689                "CREATING" => Self::Creating,
27690                "ACTIVATING" => Self::Activating,
27691                _ => Self::UnknownValue(state::UnknownValue(
27692                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27693                )),
27694            }
27695        }
27696    }
27697
27698    impl serde::ser::Serialize for State {
27699        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27700        where
27701            S: serde::Serializer,
27702        {
27703            match self {
27704                Self::Unspecified => serializer.serialize_i32(0),
27705                Self::Active => serializer.serialize_i32(1),
27706                Self::Creating => serializer.serialize_i32(2),
27707                Self::Activating => serializer.serialize_i32(3),
27708                Self::UnknownValue(u) => u.0.serialize(serializer),
27709            }
27710        }
27711    }
27712
27713    impl<'de> serde::de::Deserialize<'de> for State {
27714        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27715        where
27716            D: serde::Deserializer<'de>,
27717        {
27718            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
27719                ".google.cloud.vmwareengine.v1.Hcx.State",
27720            ))
27721        }
27722    }
27723}
27724
27725/// Details about a NSX Manager appliance.
27726#[derive(Clone, Default, PartialEq)]
27727#[non_exhaustive]
27728pub struct Nsx {
27729    /// Internal IP address of the appliance.
27730    pub internal_ip: std::string::String,
27731
27732    /// Version of the appliance.
27733    pub version: std::string::String,
27734
27735    /// Output only. The state of the appliance.
27736    pub state: crate::model::nsx::State,
27737
27738    /// Fully qualified domain name of the appliance.
27739    pub fqdn: std::string::String,
27740
27741    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27742}
27743
27744impl Nsx {
27745    pub fn new() -> Self {
27746        std::default::Default::default()
27747    }
27748
27749    /// Sets the value of [internal_ip][crate::model::Nsx::internal_ip].
27750    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27751        self.internal_ip = v.into();
27752        self
27753    }
27754
27755    /// Sets the value of [version][crate::model::Nsx::version].
27756    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27757        self.version = v.into();
27758        self
27759    }
27760
27761    /// Sets the value of [state][crate::model::Nsx::state].
27762    pub fn set_state<T: std::convert::Into<crate::model::nsx::State>>(mut self, v: T) -> Self {
27763        self.state = v.into();
27764        self
27765    }
27766
27767    /// Sets the value of [fqdn][crate::model::Nsx::fqdn].
27768    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27769        self.fqdn = v.into();
27770        self
27771    }
27772}
27773
27774impl wkt::message::Message for Nsx {
27775    fn typename() -> &'static str {
27776        "type.googleapis.com/google.cloud.vmwareengine.v1.Nsx"
27777    }
27778}
27779
27780#[doc(hidden)]
27781impl<'de> serde::de::Deserialize<'de> for Nsx {
27782    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27783    where
27784        D: serde::Deserializer<'de>,
27785    {
27786        #[allow(non_camel_case_types)]
27787        #[doc(hidden)]
27788        #[derive(PartialEq, Eq, Hash)]
27789        enum __FieldTag {
27790            __internal_ip,
27791            __version,
27792            __state,
27793            __fqdn,
27794            Unknown(std::string::String),
27795        }
27796        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27797            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27798            where
27799                D: serde::Deserializer<'de>,
27800            {
27801                struct Visitor;
27802                impl<'de> serde::de::Visitor<'de> for Visitor {
27803                    type Value = __FieldTag;
27804                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27805                        formatter.write_str("a field name for Nsx")
27806                    }
27807                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27808                    where
27809                        E: serde::de::Error,
27810                    {
27811                        use std::result::Result::Ok;
27812                        use std::string::ToString;
27813                        match value {
27814                            "internalIp" => Ok(__FieldTag::__internal_ip),
27815                            "internal_ip" => Ok(__FieldTag::__internal_ip),
27816                            "version" => Ok(__FieldTag::__version),
27817                            "state" => Ok(__FieldTag::__state),
27818                            "fqdn" => Ok(__FieldTag::__fqdn),
27819                            _ => Ok(__FieldTag::Unknown(value.to_string())),
27820                        }
27821                    }
27822                }
27823                deserializer.deserialize_identifier(Visitor)
27824            }
27825        }
27826        struct Visitor;
27827        impl<'de> serde::de::Visitor<'de> for Visitor {
27828            type Value = Nsx;
27829            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27830                formatter.write_str("struct Nsx")
27831            }
27832            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27833            where
27834                A: serde::de::MapAccess<'de>,
27835            {
27836                #[allow(unused_imports)]
27837                use serde::de::Error;
27838                use std::option::Option::Some;
27839                let mut fields = std::collections::HashSet::new();
27840                let mut result = Self::Value::new();
27841                while let Some(tag) = map.next_key::<__FieldTag>()? {
27842                    #[allow(clippy::match_single_binding)]
27843                    match tag {
27844                        __FieldTag::__internal_ip => {
27845                            if !fields.insert(__FieldTag::__internal_ip) {
27846                                return std::result::Result::Err(A::Error::duplicate_field(
27847                                    "multiple values for internal_ip",
27848                                ));
27849                            }
27850                            result.internal_ip = map
27851                                .next_value::<std::option::Option<std::string::String>>()?
27852                                .unwrap_or_default();
27853                        }
27854                        __FieldTag::__version => {
27855                            if !fields.insert(__FieldTag::__version) {
27856                                return std::result::Result::Err(A::Error::duplicate_field(
27857                                    "multiple values for version",
27858                                ));
27859                            }
27860                            result.version = map
27861                                .next_value::<std::option::Option<std::string::String>>()?
27862                                .unwrap_or_default();
27863                        }
27864                        __FieldTag::__state => {
27865                            if !fields.insert(__FieldTag::__state) {
27866                                return std::result::Result::Err(A::Error::duplicate_field(
27867                                    "multiple values for state",
27868                                ));
27869                            }
27870                            result.state = map
27871                                .next_value::<std::option::Option<crate::model::nsx::State>>()?
27872                                .unwrap_or_default();
27873                        }
27874                        __FieldTag::__fqdn => {
27875                            if !fields.insert(__FieldTag::__fqdn) {
27876                                return std::result::Result::Err(A::Error::duplicate_field(
27877                                    "multiple values for fqdn",
27878                                ));
27879                            }
27880                            result.fqdn = map
27881                                .next_value::<std::option::Option<std::string::String>>()?
27882                                .unwrap_or_default();
27883                        }
27884                        __FieldTag::Unknown(key) => {
27885                            let value = map.next_value::<serde_json::Value>()?;
27886                            result._unknown_fields.insert(key, value);
27887                        }
27888                    }
27889                }
27890                std::result::Result::Ok(result)
27891            }
27892        }
27893        deserializer.deserialize_any(Visitor)
27894    }
27895}
27896
27897#[doc(hidden)]
27898impl serde::ser::Serialize for Nsx {
27899    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27900    where
27901        S: serde::ser::Serializer,
27902    {
27903        use serde::ser::SerializeMap;
27904        #[allow(unused_imports)]
27905        use std::option::Option::Some;
27906        let mut state = serializer.serialize_map(std::option::Option::None)?;
27907        if !self.internal_ip.is_empty() {
27908            state.serialize_entry("internalIp", &self.internal_ip)?;
27909        }
27910        if !self.version.is_empty() {
27911            state.serialize_entry("version", &self.version)?;
27912        }
27913        if !wkt::internal::is_default(&self.state) {
27914            state.serialize_entry("state", &self.state)?;
27915        }
27916        if !self.fqdn.is_empty() {
27917            state.serialize_entry("fqdn", &self.fqdn)?;
27918        }
27919        if !self._unknown_fields.is_empty() {
27920            for (key, value) in self._unknown_fields.iter() {
27921                state.serialize_entry(key, &value)?;
27922            }
27923        }
27924        state.end()
27925    }
27926}
27927
27928impl std::fmt::Debug for Nsx {
27929    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27930        let mut debug_struct = f.debug_struct("Nsx");
27931        debug_struct.field("internal_ip", &self.internal_ip);
27932        debug_struct.field("version", &self.version);
27933        debug_struct.field("state", &self.state);
27934        debug_struct.field("fqdn", &self.fqdn);
27935        if !self._unknown_fields.is_empty() {
27936            debug_struct.field("_unknown_fields", &self._unknown_fields);
27937        }
27938        debug_struct.finish()
27939    }
27940}
27941
27942/// Defines additional types related to [Nsx].
27943pub mod nsx {
27944    #[allow(unused_imports)]
27945    use super::*;
27946
27947    /// State of the appliance
27948    ///
27949    /// # Working with unknown values
27950    ///
27951    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27952    /// additional enum variants at any time. Adding new variants is not considered
27953    /// a breaking change. Applications should write their code in anticipation of:
27954    ///
27955    /// - New values appearing in future releases of the client library, **and**
27956    /// - New values received dynamically, without application changes.
27957    ///
27958    /// Please consult the [Working with enums] section in the user guide for some
27959    /// guidelines.
27960    ///
27961    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27962    #[derive(Clone, Debug, PartialEq)]
27963    #[non_exhaustive]
27964    pub enum State {
27965        /// Unspecified appliance state. This is the default value.
27966        Unspecified,
27967        /// The appliance is operational and can be used.
27968        Active,
27969        /// The appliance is being deployed.
27970        Creating,
27971        /// If set, the enum was initialized with an unknown value.
27972        ///
27973        /// Applications can examine the value using [State::value] or
27974        /// [State::name].
27975        UnknownValue(state::UnknownValue),
27976    }
27977
27978    #[doc(hidden)]
27979    pub mod state {
27980        #[allow(unused_imports)]
27981        use super::*;
27982        #[derive(Clone, Debug, PartialEq)]
27983        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27984    }
27985
27986    impl State {
27987        /// Gets the enum value.
27988        ///
27989        /// Returns `None` if the enum contains an unknown value deserialized from
27990        /// the string representation of enums.
27991        pub fn value(&self) -> std::option::Option<i32> {
27992            match self {
27993                Self::Unspecified => std::option::Option::Some(0),
27994                Self::Active => std::option::Option::Some(1),
27995                Self::Creating => std::option::Option::Some(2),
27996                Self::UnknownValue(u) => u.0.value(),
27997            }
27998        }
27999
28000        /// Gets the enum value as a string.
28001        ///
28002        /// Returns `None` if the enum contains an unknown value deserialized from
28003        /// the integer representation of enums.
28004        pub fn name(&self) -> std::option::Option<&str> {
28005            match self {
28006                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
28007                Self::Active => std::option::Option::Some("ACTIVE"),
28008                Self::Creating => std::option::Option::Some("CREATING"),
28009                Self::UnknownValue(u) => u.0.name(),
28010            }
28011        }
28012    }
28013
28014    impl std::default::Default for State {
28015        fn default() -> Self {
28016            use std::convert::From;
28017            Self::from(0)
28018        }
28019    }
28020
28021    impl std::fmt::Display for State {
28022        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28023            wkt::internal::display_enum(f, self.name(), self.value())
28024        }
28025    }
28026
28027    impl std::convert::From<i32> for State {
28028        fn from(value: i32) -> Self {
28029            match value {
28030                0 => Self::Unspecified,
28031                1 => Self::Active,
28032                2 => Self::Creating,
28033                _ => Self::UnknownValue(state::UnknownValue(
28034                    wkt::internal::UnknownEnumValue::Integer(value),
28035                )),
28036            }
28037        }
28038    }
28039
28040    impl std::convert::From<&str> for State {
28041        fn from(value: &str) -> Self {
28042            use std::string::ToString;
28043            match value {
28044                "STATE_UNSPECIFIED" => Self::Unspecified,
28045                "ACTIVE" => Self::Active,
28046                "CREATING" => Self::Creating,
28047                _ => Self::UnknownValue(state::UnknownValue(
28048                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28049                )),
28050            }
28051        }
28052    }
28053
28054    impl serde::ser::Serialize for State {
28055        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28056        where
28057            S: serde::Serializer,
28058        {
28059            match self {
28060                Self::Unspecified => serializer.serialize_i32(0),
28061                Self::Active => serializer.serialize_i32(1),
28062                Self::Creating => serializer.serialize_i32(2),
28063                Self::UnknownValue(u) => u.0.serialize(serializer),
28064            }
28065        }
28066    }
28067
28068    impl<'de> serde::de::Deserialize<'de> for State {
28069        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28070        where
28071            D: serde::Deserializer<'de>,
28072        {
28073            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
28074                ".google.cloud.vmwareengine.v1.Nsx.State",
28075            ))
28076        }
28077    }
28078}
28079
28080/// Details about a vCenter Server management appliance.
28081#[derive(Clone, Default, PartialEq)]
28082#[non_exhaustive]
28083pub struct Vcenter {
28084    /// Internal IP address of the appliance.
28085    pub internal_ip: std::string::String,
28086
28087    /// Version of the appliance.
28088    pub version: std::string::String,
28089
28090    /// Output only. The state of the appliance.
28091    pub state: crate::model::vcenter::State,
28092
28093    /// Fully qualified domain name of the appliance.
28094    pub fqdn: std::string::String,
28095
28096    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28097}
28098
28099impl Vcenter {
28100    pub fn new() -> Self {
28101        std::default::Default::default()
28102    }
28103
28104    /// Sets the value of [internal_ip][crate::model::Vcenter::internal_ip].
28105    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28106        self.internal_ip = v.into();
28107        self
28108    }
28109
28110    /// Sets the value of [version][crate::model::Vcenter::version].
28111    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28112        self.version = v.into();
28113        self
28114    }
28115
28116    /// Sets the value of [state][crate::model::Vcenter::state].
28117    pub fn set_state<T: std::convert::Into<crate::model::vcenter::State>>(mut self, v: T) -> Self {
28118        self.state = v.into();
28119        self
28120    }
28121
28122    /// Sets the value of [fqdn][crate::model::Vcenter::fqdn].
28123    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28124        self.fqdn = v.into();
28125        self
28126    }
28127}
28128
28129impl wkt::message::Message for Vcenter {
28130    fn typename() -> &'static str {
28131        "type.googleapis.com/google.cloud.vmwareengine.v1.Vcenter"
28132    }
28133}
28134
28135#[doc(hidden)]
28136impl<'de> serde::de::Deserialize<'de> for Vcenter {
28137    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28138    where
28139        D: serde::Deserializer<'de>,
28140    {
28141        #[allow(non_camel_case_types)]
28142        #[doc(hidden)]
28143        #[derive(PartialEq, Eq, Hash)]
28144        enum __FieldTag {
28145            __internal_ip,
28146            __version,
28147            __state,
28148            __fqdn,
28149            Unknown(std::string::String),
28150        }
28151        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28152            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28153            where
28154                D: serde::Deserializer<'de>,
28155            {
28156                struct Visitor;
28157                impl<'de> serde::de::Visitor<'de> for Visitor {
28158                    type Value = __FieldTag;
28159                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28160                        formatter.write_str("a field name for Vcenter")
28161                    }
28162                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28163                    where
28164                        E: serde::de::Error,
28165                    {
28166                        use std::result::Result::Ok;
28167                        use std::string::ToString;
28168                        match value {
28169                            "internalIp" => Ok(__FieldTag::__internal_ip),
28170                            "internal_ip" => Ok(__FieldTag::__internal_ip),
28171                            "version" => Ok(__FieldTag::__version),
28172                            "state" => Ok(__FieldTag::__state),
28173                            "fqdn" => Ok(__FieldTag::__fqdn),
28174                            _ => Ok(__FieldTag::Unknown(value.to_string())),
28175                        }
28176                    }
28177                }
28178                deserializer.deserialize_identifier(Visitor)
28179            }
28180        }
28181        struct Visitor;
28182        impl<'de> serde::de::Visitor<'de> for Visitor {
28183            type Value = Vcenter;
28184            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28185                formatter.write_str("struct Vcenter")
28186            }
28187            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28188            where
28189                A: serde::de::MapAccess<'de>,
28190            {
28191                #[allow(unused_imports)]
28192                use serde::de::Error;
28193                use std::option::Option::Some;
28194                let mut fields = std::collections::HashSet::new();
28195                let mut result = Self::Value::new();
28196                while let Some(tag) = map.next_key::<__FieldTag>()? {
28197                    #[allow(clippy::match_single_binding)]
28198                    match tag {
28199                        __FieldTag::__internal_ip => {
28200                            if !fields.insert(__FieldTag::__internal_ip) {
28201                                return std::result::Result::Err(A::Error::duplicate_field(
28202                                    "multiple values for internal_ip",
28203                                ));
28204                            }
28205                            result.internal_ip = map
28206                                .next_value::<std::option::Option<std::string::String>>()?
28207                                .unwrap_or_default();
28208                        }
28209                        __FieldTag::__version => {
28210                            if !fields.insert(__FieldTag::__version) {
28211                                return std::result::Result::Err(A::Error::duplicate_field(
28212                                    "multiple values for version",
28213                                ));
28214                            }
28215                            result.version = map
28216                                .next_value::<std::option::Option<std::string::String>>()?
28217                                .unwrap_or_default();
28218                        }
28219                        __FieldTag::__state => {
28220                            if !fields.insert(__FieldTag::__state) {
28221                                return std::result::Result::Err(A::Error::duplicate_field(
28222                                    "multiple values for state",
28223                                ));
28224                            }
28225                            result.state = map
28226                                .next_value::<std::option::Option<crate::model::vcenter::State>>()?
28227                                .unwrap_or_default();
28228                        }
28229                        __FieldTag::__fqdn => {
28230                            if !fields.insert(__FieldTag::__fqdn) {
28231                                return std::result::Result::Err(A::Error::duplicate_field(
28232                                    "multiple values for fqdn",
28233                                ));
28234                            }
28235                            result.fqdn = map
28236                                .next_value::<std::option::Option<std::string::String>>()?
28237                                .unwrap_or_default();
28238                        }
28239                        __FieldTag::Unknown(key) => {
28240                            let value = map.next_value::<serde_json::Value>()?;
28241                            result._unknown_fields.insert(key, value);
28242                        }
28243                    }
28244                }
28245                std::result::Result::Ok(result)
28246            }
28247        }
28248        deserializer.deserialize_any(Visitor)
28249    }
28250}
28251
28252#[doc(hidden)]
28253impl serde::ser::Serialize for Vcenter {
28254    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28255    where
28256        S: serde::ser::Serializer,
28257    {
28258        use serde::ser::SerializeMap;
28259        #[allow(unused_imports)]
28260        use std::option::Option::Some;
28261        let mut state = serializer.serialize_map(std::option::Option::None)?;
28262        if !self.internal_ip.is_empty() {
28263            state.serialize_entry("internalIp", &self.internal_ip)?;
28264        }
28265        if !self.version.is_empty() {
28266            state.serialize_entry("version", &self.version)?;
28267        }
28268        if !wkt::internal::is_default(&self.state) {
28269            state.serialize_entry("state", &self.state)?;
28270        }
28271        if !self.fqdn.is_empty() {
28272            state.serialize_entry("fqdn", &self.fqdn)?;
28273        }
28274        if !self._unknown_fields.is_empty() {
28275            for (key, value) in self._unknown_fields.iter() {
28276                state.serialize_entry(key, &value)?;
28277            }
28278        }
28279        state.end()
28280    }
28281}
28282
28283impl std::fmt::Debug for Vcenter {
28284    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28285        let mut debug_struct = f.debug_struct("Vcenter");
28286        debug_struct.field("internal_ip", &self.internal_ip);
28287        debug_struct.field("version", &self.version);
28288        debug_struct.field("state", &self.state);
28289        debug_struct.field("fqdn", &self.fqdn);
28290        if !self._unknown_fields.is_empty() {
28291            debug_struct.field("_unknown_fields", &self._unknown_fields);
28292        }
28293        debug_struct.finish()
28294    }
28295}
28296
28297/// Defines additional types related to [Vcenter].
28298pub mod vcenter {
28299    #[allow(unused_imports)]
28300    use super::*;
28301
28302    /// State of the appliance
28303    ///
28304    /// # Working with unknown values
28305    ///
28306    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28307    /// additional enum variants at any time. Adding new variants is not considered
28308    /// a breaking change. Applications should write their code in anticipation of:
28309    ///
28310    /// - New values appearing in future releases of the client library, **and**
28311    /// - New values received dynamically, without application changes.
28312    ///
28313    /// Please consult the [Working with enums] section in the user guide for some
28314    /// guidelines.
28315    ///
28316    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28317    #[derive(Clone, Debug, PartialEq)]
28318    #[non_exhaustive]
28319    pub enum State {
28320        /// Unspecified appliance state. This is the default value.
28321        Unspecified,
28322        /// The appliance is operational and can be used.
28323        Active,
28324        /// The appliance is being deployed.
28325        Creating,
28326        /// If set, the enum was initialized with an unknown value.
28327        ///
28328        /// Applications can examine the value using [State::value] or
28329        /// [State::name].
28330        UnknownValue(state::UnknownValue),
28331    }
28332
28333    #[doc(hidden)]
28334    pub mod state {
28335        #[allow(unused_imports)]
28336        use super::*;
28337        #[derive(Clone, Debug, PartialEq)]
28338        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28339    }
28340
28341    impl State {
28342        /// Gets the enum value.
28343        ///
28344        /// Returns `None` if the enum contains an unknown value deserialized from
28345        /// the string representation of enums.
28346        pub fn value(&self) -> std::option::Option<i32> {
28347            match self {
28348                Self::Unspecified => std::option::Option::Some(0),
28349                Self::Active => std::option::Option::Some(1),
28350                Self::Creating => std::option::Option::Some(2),
28351                Self::UnknownValue(u) => u.0.value(),
28352            }
28353        }
28354
28355        /// Gets the enum value as a string.
28356        ///
28357        /// Returns `None` if the enum contains an unknown value deserialized from
28358        /// the integer representation of enums.
28359        pub fn name(&self) -> std::option::Option<&str> {
28360            match self {
28361                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
28362                Self::Active => std::option::Option::Some("ACTIVE"),
28363                Self::Creating => std::option::Option::Some("CREATING"),
28364                Self::UnknownValue(u) => u.0.name(),
28365            }
28366        }
28367    }
28368
28369    impl std::default::Default for State {
28370        fn default() -> Self {
28371            use std::convert::From;
28372            Self::from(0)
28373        }
28374    }
28375
28376    impl std::fmt::Display for State {
28377        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28378            wkt::internal::display_enum(f, self.name(), self.value())
28379        }
28380    }
28381
28382    impl std::convert::From<i32> for State {
28383        fn from(value: i32) -> Self {
28384            match value {
28385                0 => Self::Unspecified,
28386                1 => Self::Active,
28387                2 => Self::Creating,
28388                _ => Self::UnknownValue(state::UnknownValue(
28389                    wkt::internal::UnknownEnumValue::Integer(value),
28390                )),
28391            }
28392        }
28393    }
28394
28395    impl std::convert::From<&str> for State {
28396        fn from(value: &str) -> Self {
28397            use std::string::ToString;
28398            match value {
28399                "STATE_UNSPECIFIED" => Self::Unspecified,
28400                "ACTIVE" => Self::Active,
28401                "CREATING" => Self::Creating,
28402                _ => Self::UnknownValue(state::UnknownValue(
28403                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28404                )),
28405            }
28406        }
28407    }
28408
28409    impl serde::ser::Serialize for State {
28410        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28411        where
28412            S: serde::Serializer,
28413        {
28414            match self {
28415                Self::Unspecified => serializer.serialize_i32(0),
28416                Self::Active => serializer.serialize_i32(1),
28417                Self::Creating => serializer.serialize_i32(2),
28418                Self::UnknownValue(u) => u.0.serialize(serializer),
28419            }
28420        }
28421    }
28422
28423    impl<'de> serde::de::Deserialize<'de> for State {
28424        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28425        where
28426            D: serde::Deserializer<'de>,
28427        {
28428            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
28429                ".google.cloud.vmwareengine.v1.Vcenter.State",
28430            ))
28431        }
28432    }
28433}
28434
28435/// Autoscaling settings define the rules used by VMware Engine to
28436/// automatically scale-out and scale-in the clusters in a private cloud.
28437#[derive(Clone, Default, PartialEq)]
28438#[non_exhaustive]
28439pub struct AutoscalingSettings {
28440    /// Required. The map with autoscaling policies applied to the cluster.
28441    /// The key is the identifier of the policy.
28442    /// It must meet the following requirements:
28443    ///
28444    /// * Only contains 1-63 alphanumeric characters and hyphens
28445    /// * Begins with an alphabetical character
28446    /// * Ends with a non-hyphen character
28447    /// * Not formatted as a UUID
28448    /// * Complies with [RFC
28449    ///   1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
28450    ///
28451    /// Currently there map must contain only one element
28452    /// that describes the autoscaling policy for compute nodes.
28453    pub autoscaling_policies: std::collections::HashMap<
28454        std::string::String,
28455        crate::model::autoscaling_settings::AutoscalingPolicy,
28456    >,
28457
28458    /// Optional. Minimum number of nodes of any type in a cluster.
28459    /// If not specified the default limits apply.
28460    pub min_cluster_node_count: i32,
28461
28462    /// Optional. Maximum number of nodes of any type in a cluster.
28463    /// If not specified the default limits apply.
28464    pub max_cluster_node_count: i32,
28465
28466    /// Optional. The minimum duration between consecutive autoscale operations.
28467    /// It starts once addition or removal of nodes is fully completed.
28468    /// Defaults to 30 minutes if not specified. Cool down period must be in whole
28469    /// minutes (for example, 30, 31, 50, 180 minutes).
28470    pub cool_down_period: std::option::Option<wkt::Duration>,
28471
28472    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28473}
28474
28475impl AutoscalingSettings {
28476    pub fn new() -> Self {
28477        std::default::Default::default()
28478    }
28479
28480    /// Sets the value of [autoscaling_policies][crate::model::AutoscalingSettings::autoscaling_policies].
28481    pub fn set_autoscaling_policies<T, K, V>(mut self, v: T) -> Self
28482    where
28483        T: std::iter::IntoIterator<Item = (K, V)>,
28484        K: std::convert::Into<std::string::String>,
28485        V: std::convert::Into<crate::model::autoscaling_settings::AutoscalingPolicy>,
28486    {
28487        use std::iter::Iterator;
28488        self.autoscaling_policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
28489        self
28490    }
28491
28492    /// Sets the value of [min_cluster_node_count][crate::model::AutoscalingSettings::min_cluster_node_count].
28493    pub fn set_min_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28494        self.min_cluster_node_count = v.into();
28495        self
28496    }
28497
28498    /// Sets the value of [max_cluster_node_count][crate::model::AutoscalingSettings::max_cluster_node_count].
28499    pub fn set_max_cluster_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28500        self.max_cluster_node_count = v.into();
28501        self
28502    }
28503
28504    /// Sets the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
28505    pub fn set_cool_down_period<T>(mut self, v: T) -> Self
28506    where
28507        T: std::convert::Into<wkt::Duration>,
28508    {
28509        self.cool_down_period = std::option::Option::Some(v.into());
28510        self
28511    }
28512
28513    /// Sets or clears the value of [cool_down_period][crate::model::AutoscalingSettings::cool_down_period].
28514    pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
28515    where
28516        T: std::convert::Into<wkt::Duration>,
28517    {
28518        self.cool_down_period = v.map(|x| x.into());
28519        self
28520    }
28521}
28522
28523impl wkt::message::Message for AutoscalingSettings {
28524    fn typename() -> &'static str {
28525        "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings"
28526    }
28527}
28528
28529#[doc(hidden)]
28530impl<'de> serde::de::Deserialize<'de> for AutoscalingSettings {
28531    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28532    where
28533        D: serde::Deserializer<'de>,
28534    {
28535        #[allow(non_camel_case_types)]
28536        #[doc(hidden)]
28537        #[derive(PartialEq, Eq, Hash)]
28538        enum __FieldTag {
28539            __autoscaling_policies,
28540            __min_cluster_node_count,
28541            __max_cluster_node_count,
28542            __cool_down_period,
28543            Unknown(std::string::String),
28544        }
28545        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28546            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28547            where
28548                D: serde::Deserializer<'de>,
28549            {
28550                struct Visitor;
28551                impl<'de> serde::de::Visitor<'de> for Visitor {
28552                    type Value = __FieldTag;
28553                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28554                        formatter.write_str("a field name for AutoscalingSettings")
28555                    }
28556                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28557                    where
28558                        E: serde::de::Error,
28559                    {
28560                        use std::result::Result::Ok;
28561                        use std::string::ToString;
28562                        match value {
28563                            "autoscalingPolicies" => Ok(__FieldTag::__autoscaling_policies),
28564                            "autoscaling_policies" => Ok(__FieldTag::__autoscaling_policies),
28565                            "minClusterNodeCount" => Ok(__FieldTag::__min_cluster_node_count),
28566                            "min_cluster_node_count" => Ok(__FieldTag::__min_cluster_node_count),
28567                            "maxClusterNodeCount" => Ok(__FieldTag::__max_cluster_node_count),
28568                            "max_cluster_node_count" => Ok(__FieldTag::__max_cluster_node_count),
28569                            "coolDownPeriod" => Ok(__FieldTag::__cool_down_period),
28570                            "cool_down_period" => Ok(__FieldTag::__cool_down_period),
28571                            _ => Ok(__FieldTag::Unknown(value.to_string())),
28572                        }
28573                    }
28574                }
28575                deserializer.deserialize_identifier(Visitor)
28576            }
28577        }
28578        struct Visitor;
28579        impl<'de> serde::de::Visitor<'de> for Visitor {
28580            type Value = AutoscalingSettings;
28581            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28582                formatter.write_str("struct AutoscalingSettings")
28583            }
28584            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28585            where
28586                A: serde::de::MapAccess<'de>,
28587            {
28588                #[allow(unused_imports)]
28589                use serde::de::Error;
28590                use std::option::Option::Some;
28591                let mut fields = std::collections::HashSet::new();
28592                let mut result = Self::Value::new();
28593                while let Some(tag) = map.next_key::<__FieldTag>()? {
28594                    #[allow(clippy::match_single_binding)]
28595                    match tag {
28596                        __FieldTag::__autoscaling_policies => {
28597                            if !fields.insert(__FieldTag::__autoscaling_policies) {
28598                                return std::result::Result::Err(A::Error::duplicate_field(
28599                                    "multiple values for autoscaling_policies",
28600                                ));
28601                            }
28602                            result.autoscaling_policies = map
28603                                .next_value::<std::option::Option<
28604                                    std::collections::HashMap<
28605                                        std::string::String,
28606                                        crate::model::autoscaling_settings::AutoscalingPolicy,
28607                                    >,
28608                                >>()?
28609                                .unwrap_or_default();
28610                        }
28611                        __FieldTag::__min_cluster_node_count => {
28612                            if !fields.insert(__FieldTag::__min_cluster_node_count) {
28613                                return std::result::Result::Err(A::Error::duplicate_field(
28614                                    "multiple values for min_cluster_node_count",
28615                                ));
28616                            }
28617                            struct __With(std::option::Option<i32>);
28618                            impl<'de> serde::de::Deserialize<'de> for __With {
28619                                fn deserialize<D>(
28620                                    deserializer: D,
28621                                ) -> std::result::Result<Self, D::Error>
28622                                where
28623                                    D: serde::de::Deserializer<'de>,
28624                                {
28625                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
28626                                }
28627                            }
28628                            result.min_cluster_node_count =
28629                                map.next_value::<__With>()?.0.unwrap_or_default();
28630                        }
28631                        __FieldTag::__max_cluster_node_count => {
28632                            if !fields.insert(__FieldTag::__max_cluster_node_count) {
28633                                return std::result::Result::Err(A::Error::duplicate_field(
28634                                    "multiple values for max_cluster_node_count",
28635                                ));
28636                            }
28637                            struct __With(std::option::Option<i32>);
28638                            impl<'de> serde::de::Deserialize<'de> for __With {
28639                                fn deserialize<D>(
28640                                    deserializer: D,
28641                                ) -> std::result::Result<Self, D::Error>
28642                                where
28643                                    D: serde::de::Deserializer<'de>,
28644                                {
28645                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
28646                                }
28647                            }
28648                            result.max_cluster_node_count =
28649                                map.next_value::<__With>()?.0.unwrap_or_default();
28650                        }
28651                        __FieldTag::__cool_down_period => {
28652                            if !fields.insert(__FieldTag::__cool_down_period) {
28653                                return std::result::Result::Err(A::Error::duplicate_field(
28654                                    "multiple values for cool_down_period",
28655                                ));
28656                            }
28657                            result.cool_down_period =
28658                                map.next_value::<std::option::Option<wkt::Duration>>()?;
28659                        }
28660                        __FieldTag::Unknown(key) => {
28661                            let value = map.next_value::<serde_json::Value>()?;
28662                            result._unknown_fields.insert(key, value);
28663                        }
28664                    }
28665                }
28666                std::result::Result::Ok(result)
28667            }
28668        }
28669        deserializer.deserialize_any(Visitor)
28670    }
28671}
28672
28673#[doc(hidden)]
28674impl serde::ser::Serialize for AutoscalingSettings {
28675    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28676    where
28677        S: serde::ser::Serializer,
28678    {
28679        use serde::ser::SerializeMap;
28680        #[allow(unused_imports)]
28681        use std::option::Option::Some;
28682        let mut state = serializer.serialize_map(std::option::Option::None)?;
28683        if !self.autoscaling_policies.is_empty() {
28684            state.serialize_entry("autoscalingPolicies", &self.autoscaling_policies)?;
28685        }
28686        if !wkt::internal::is_default(&self.min_cluster_node_count) {
28687            struct __With<'a>(&'a i32);
28688            impl<'a> serde::ser::Serialize for __With<'a> {
28689                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28690                where
28691                    S: serde::ser::Serializer,
28692                {
28693                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
28694                }
28695            }
28696            state.serialize_entry("minClusterNodeCount", &__With(&self.min_cluster_node_count))?;
28697        }
28698        if !wkt::internal::is_default(&self.max_cluster_node_count) {
28699            struct __With<'a>(&'a i32);
28700            impl<'a> serde::ser::Serialize for __With<'a> {
28701                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28702                where
28703                    S: serde::ser::Serializer,
28704                {
28705                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
28706                }
28707            }
28708            state.serialize_entry("maxClusterNodeCount", &__With(&self.max_cluster_node_count))?;
28709        }
28710        if self.cool_down_period.is_some() {
28711            state.serialize_entry("coolDownPeriod", &self.cool_down_period)?;
28712        }
28713        if !self._unknown_fields.is_empty() {
28714            for (key, value) in self._unknown_fields.iter() {
28715                state.serialize_entry(key, &value)?;
28716            }
28717        }
28718        state.end()
28719    }
28720}
28721
28722impl std::fmt::Debug for AutoscalingSettings {
28723    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28724        let mut debug_struct = f.debug_struct("AutoscalingSettings");
28725        debug_struct.field("autoscaling_policies", &self.autoscaling_policies);
28726        debug_struct.field("min_cluster_node_count", &self.min_cluster_node_count);
28727        debug_struct.field("max_cluster_node_count", &self.max_cluster_node_count);
28728        debug_struct.field("cool_down_period", &self.cool_down_period);
28729        if !self._unknown_fields.is_empty() {
28730            debug_struct.field("_unknown_fields", &self._unknown_fields);
28731        }
28732        debug_struct.finish()
28733    }
28734}
28735
28736/// Defines additional types related to [AutoscalingSettings].
28737pub mod autoscaling_settings {
28738    #[allow(unused_imports)]
28739    use super::*;
28740
28741    /// Thresholds define the utilization of resources triggering
28742    /// scale-out and scale-in operations.
28743    #[derive(Clone, Default, PartialEq)]
28744    #[non_exhaustive]
28745    pub struct Thresholds {
28746        /// Required. The utilization triggering the scale-out operation in percent.
28747        pub scale_out: i32,
28748
28749        /// Required. The utilization triggering the scale-in operation in percent.
28750        pub scale_in: i32,
28751
28752        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28753    }
28754
28755    impl Thresholds {
28756        pub fn new() -> Self {
28757            std::default::Default::default()
28758        }
28759
28760        /// Sets the value of [scale_out][crate::model::autoscaling_settings::Thresholds::scale_out].
28761        pub fn set_scale_out<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28762            self.scale_out = v.into();
28763            self
28764        }
28765
28766        /// Sets the value of [scale_in][crate::model::autoscaling_settings::Thresholds::scale_in].
28767        pub fn set_scale_in<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28768            self.scale_in = v.into();
28769            self
28770        }
28771    }
28772
28773    impl wkt::message::Message for Thresholds {
28774        fn typename() -> &'static str {
28775            "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds"
28776        }
28777    }
28778
28779    #[doc(hidden)]
28780    impl<'de> serde::de::Deserialize<'de> for Thresholds {
28781        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28782        where
28783            D: serde::Deserializer<'de>,
28784        {
28785            #[allow(non_camel_case_types)]
28786            #[doc(hidden)]
28787            #[derive(PartialEq, Eq, Hash)]
28788            enum __FieldTag {
28789                __scale_out,
28790                __scale_in,
28791                Unknown(std::string::String),
28792            }
28793            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28794                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28795                where
28796                    D: serde::Deserializer<'de>,
28797                {
28798                    struct Visitor;
28799                    impl<'de> serde::de::Visitor<'de> for Visitor {
28800                        type Value = __FieldTag;
28801                        fn expecting(
28802                            &self,
28803                            formatter: &mut std::fmt::Formatter,
28804                        ) -> std::fmt::Result {
28805                            formatter.write_str("a field name for Thresholds")
28806                        }
28807                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28808                        where
28809                            E: serde::de::Error,
28810                        {
28811                            use std::result::Result::Ok;
28812                            use std::string::ToString;
28813                            match value {
28814                                "scaleOut" => Ok(__FieldTag::__scale_out),
28815                                "scale_out" => Ok(__FieldTag::__scale_out),
28816                                "scaleIn" => Ok(__FieldTag::__scale_in),
28817                                "scale_in" => Ok(__FieldTag::__scale_in),
28818                                _ => Ok(__FieldTag::Unknown(value.to_string())),
28819                            }
28820                        }
28821                    }
28822                    deserializer.deserialize_identifier(Visitor)
28823                }
28824            }
28825            struct Visitor;
28826            impl<'de> serde::de::Visitor<'de> for Visitor {
28827                type Value = Thresholds;
28828                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28829                    formatter.write_str("struct Thresholds")
28830                }
28831                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28832                where
28833                    A: serde::de::MapAccess<'de>,
28834                {
28835                    #[allow(unused_imports)]
28836                    use serde::de::Error;
28837                    use std::option::Option::Some;
28838                    let mut fields = std::collections::HashSet::new();
28839                    let mut result = Self::Value::new();
28840                    while let Some(tag) = map.next_key::<__FieldTag>()? {
28841                        #[allow(clippy::match_single_binding)]
28842                        match tag {
28843                            __FieldTag::__scale_out => {
28844                                if !fields.insert(__FieldTag::__scale_out) {
28845                                    return std::result::Result::Err(A::Error::duplicate_field(
28846                                        "multiple values for scale_out",
28847                                    ));
28848                                }
28849                                struct __With(std::option::Option<i32>);
28850                                impl<'de> serde::de::Deserialize<'de> for __With {
28851                                    fn deserialize<D>(
28852                                        deserializer: D,
28853                                    ) -> std::result::Result<Self, D::Error>
28854                                    where
28855                                        D: serde::de::Deserializer<'de>,
28856                                    {
28857                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
28858                                    }
28859                                }
28860                                result.scale_out =
28861                                    map.next_value::<__With>()?.0.unwrap_or_default();
28862                            }
28863                            __FieldTag::__scale_in => {
28864                                if !fields.insert(__FieldTag::__scale_in) {
28865                                    return std::result::Result::Err(A::Error::duplicate_field(
28866                                        "multiple values for scale_in",
28867                                    ));
28868                                }
28869                                struct __With(std::option::Option<i32>);
28870                                impl<'de> serde::de::Deserialize<'de> for __With {
28871                                    fn deserialize<D>(
28872                                        deserializer: D,
28873                                    ) -> std::result::Result<Self, D::Error>
28874                                    where
28875                                        D: serde::de::Deserializer<'de>,
28876                                    {
28877                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
28878                                    }
28879                                }
28880                                result.scale_in = map.next_value::<__With>()?.0.unwrap_or_default();
28881                            }
28882                            __FieldTag::Unknown(key) => {
28883                                let value = map.next_value::<serde_json::Value>()?;
28884                                result._unknown_fields.insert(key, value);
28885                            }
28886                        }
28887                    }
28888                    std::result::Result::Ok(result)
28889                }
28890            }
28891            deserializer.deserialize_any(Visitor)
28892        }
28893    }
28894
28895    #[doc(hidden)]
28896    impl serde::ser::Serialize for Thresholds {
28897        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28898        where
28899            S: serde::ser::Serializer,
28900        {
28901            use serde::ser::SerializeMap;
28902            #[allow(unused_imports)]
28903            use std::option::Option::Some;
28904            let mut state = serializer.serialize_map(std::option::Option::None)?;
28905            if !wkt::internal::is_default(&self.scale_out) {
28906                struct __With<'a>(&'a i32);
28907                impl<'a> serde::ser::Serialize for __With<'a> {
28908                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28909                    where
28910                        S: serde::ser::Serializer,
28911                    {
28912                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
28913                    }
28914                }
28915                state.serialize_entry("scaleOut", &__With(&self.scale_out))?;
28916            }
28917            if !wkt::internal::is_default(&self.scale_in) {
28918                struct __With<'a>(&'a i32);
28919                impl<'a> serde::ser::Serialize for __With<'a> {
28920                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28921                    where
28922                        S: serde::ser::Serializer,
28923                    {
28924                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
28925                    }
28926                }
28927                state.serialize_entry("scaleIn", &__With(&self.scale_in))?;
28928            }
28929            if !self._unknown_fields.is_empty() {
28930                for (key, value) in self._unknown_fields.iter() {
28931                    state.serialize_entry(key, &value)?;
28932                }
28933            }
28934            state.end()
28935        }
28936    }
28937
28938    impl std::fmt::Debug for Thresholds {
28939        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28940            let mut debug_struct = f.debug_struct("Thresholds");
28941            debug_struct.field("scale_out", &self.scale_out);
28942            debug_struct.field("scale_in", &self.scale_in);
28943            if !self._unknown_fields.is_empty() {
28944                debug_struct.field("_unknown_fields", &self._unknown_fields);
28945            }
28946            debug_struct.finish()
28947        }
28948    }
28949
28950    /// Autoscaling policy describes the behavior of the autoscaling
28951    /// with respect to the resource utilization.
28952    /// The scale-out operation is initiated if the utilization
28953    /// exceeds ANY of the respective thresholds.
28954    /// The scale-in operation is initiated if the utilization
28955    /// is below ALL of the respective thresholds.
28956    #[derive(Clone, Default, PartialEq)]
28957    #[non_exhaustive]
28958    pub struct AutoscalingPolicy {
28959        /// Required. The canonical identifier of the node type to add or remove.
28960        /// Corresponds to the `NodeType`.
28961        pub node_type_id: std::string::String,
28962
28963        /// Required. Number of nodes to add to a cluster during a scale-out
28964        /// operation. Must be divisible by 2 for stretched clusters. During a
28965        /// scale-in operation only one node (or 2 for stretched clusters) are
28966        /// removed in a single iteration.
28967        pub scale_out_size: i32,
28968
28969        /// Optional. Utilization thresholds pertaining to CPU utilization.
28970        pub cpu_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
28971
28972        /// Optional. Utilization thresholds pertaining to amount of granted memory.
28973        pub granted_memory_thresholds:
28974            std::option::Option<crate::model::autoscaling_settings::Thresholds>,
28975
28976        /// Optional. Utilization thresholds pertaining to amount of consumed memory.
28977        pub consumed_memory_thresholds:
28978            std::option::Option<crate::model::autoscaling_settings::Thresholds>,
28979
28980        /// Optional. Utilization thresholds pertaining to amount of consumed
28981        /// storage.
28982        pub storage_thresholds: std::option::Option<crate::model::autoscaling_settings::Thresholds>,
28983
28984        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28985    }
28986
28987    impl AutoscalingPolicy {
28988        pub fn new() -> Self {
28989            std::default::Default::default()
28990        }
28991
28992        /// Sets the value of [node_type_id][crate::model::autoscaling_settings::AutoscalingPolicy::node_type_id].
28993        pub fn set_node_type_id<T: std::convert::Into<std::string::String>>(
28994            mut self,
28995            v: T,
28996        ) -> Self {
28997            self.node_type_id = v.into();
28998            self
28999        }
29000
29001        /// Sets the value of [scale_out_size][crate::model::autoscaling_settings::AutoscalingPolicy::scale_out_size].
29002        pub fn set_scale_out_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
29003            self.scale_out_size = v.into();
29004            self
29005        }
29006
29007        /// Sets the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
29008        pub fn set_cpu_thresholds<T>(mut self, v: T) -> Self
29009        where
29010            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29011        {
29012            self.cpu_thresholds = std::option::Option::Some(v.into());
29013            self
29014        }
29015
29016        /// Sets or clears the value of [cpu_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::cpu_thresholds].
29017        pub fn set_or_clear_cpu_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
29018        where
29019            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29020        {
29021            self.cpu_thresholds = v.map(|x| x.into());
29022            self
29023        }
29024
29025        /// Sets the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
29026        pub fn set_granted_memory_thresholds<T>(mut self, v: T) -> Self
29027        where
29028            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29029        {
29030            self.granted_memory_thresholds = std::option::Option::Some(v.into());
29031            self
29032        }
29033
29034        /// Sets or clears the value of [granted_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::granted_memory_thresholds].
29035        pub fn set_or_clear_granted_memory_thresholds<T>(
29036            mut self,
29037            v: std::option::Option<T>,
29038        ) -> Self
29039        where
29040            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29041        {
29042            self.granted_memory_thresholds = v.map(|x| x.into());
29043            self
29044        }
29045
29046        /// Sets the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
29047        pub fn set_consumed_memory_thresholds<T>(mut self, v: T) -> Self
29048        where
29049            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29050        {
29051            self.consumed_memory_thresholds = std::option::Option::Some(v.into());
29052            self
29053        }
29054
29055        /// Sets or clears the value of [consumed_memory_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::consumed_memory_thresholds].
29056        pub fn set_or_clear_consumed_memory_thresholds<T>(
29057            mut self,
29058            v: std::option::Option<T>,
29059        ) -> Self
29060        where
29061            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29062        {
29063            self.consumed_memory_thresholds = v.map(|x| x.into());
29064            self
29065        }
29066
29067        /// Sets the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
29068        pub fn set_storage_thresholds<T>(mut self, v: T) -> Self
29069        where
29070            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29071        {
29072            self.storage_thresholds = std::option::Option::Some(v.into());
29073            self
29074        }
29075
29076        /// Sets or clears the value of [storage_thresholds][crate::model::autoscaling_settings::AutoscalingPolicy::storage_thresholds].
29077        pub fn set_or_clear_storage_thresholds<T>(mut self, v: std::option::Option<T>) -> Self
29078        where
29079            T: std::convert::Into<crate::model::autoscaling_settings::Thresholds>,
29080        {
29081            self.storage_thresholds = v.map(|x| x.into());
29082            self
29083        }
29084    }
29085
29086    impl wkt::message::Message for AutoscalingPolicy {
29087        fn typename() -> &'static str {
29088            "type.googleapis.com/google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy"
29089        }
29090    }
29091
29092    #[doc(hidden)]
29093    impl<'de> serde::de::Deserialize<'de> for AutoscalingPolicy {
29094        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29095        where
29096            D: serde::Deserializer<'de>,
29097        {
29098            #[allow(non_camel_case_types)]
29099            #[doc(hidden)]
29100            #[derive(PartialEq, Eq, Hash)]
29101            enum __FieldTag {
29102                __node_type_id,
29103                __scale_out_size,
29104                __cpu_thresholds,
29105                __granted_memory_thresholds,
29106                __consumed_memory_thresholds,
29107                __storage_thresholds,
29108                Unknown(std::string::String),
29109            }
29110            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
29111                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29112                where
29113                    D: serde::Deserializer<'de>,
29114                {
29115                    struct Visitor;
29116                    impl<'de> serde::de::Visitor<'de> for Visitor {
29117                        type Value = __FieldTag;
29118                        fn expecting(
29119                            &self,
29120                            formatter: &mut std::fmt::Formatter,
29121                        ) -> std::fmt::Result {
29122                            formatter.write_str("a field name for AutoscalingPolicy")
29123                        }
29124                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
29125                        where
29126                            E: serde::de::Error,
29127                        {
29128                            use std::result::Result::Ok;
29129                            use std::string::ToString;
29130                            match value {
29131                                "nodeTypeId" => Ok(__FieldTag::__node_type_id),
29132                                "node_type_id" => Ok(__FieldTag::__node_type_id),
29133                                "scaleOutSize" => Ok(__FieldTag::__scale_out_size),
29134                                "scale_out_size" => Ok(__FieldTag::__scale_out_size),
29135                                "cpuThresholds" => Ok(__FieldTag::__cpu_thresholds),
29136                                "cpu_thresholds" => Ok(__FieldTag::__cpu_thresholds),
29137                                "grantedMemoryThresholds" => {
29138                                    Ok(__FieldTag::__granted_memory_thresholds)
29139                                }
29140                                "granted_memory_thresholds" => {
29141                                    Ok(__FieldTag::__granted_memory_thresholds)
29142                                }
29143                                "consumedMemoryThresholds" => {
29144                                    Ok(__FieldTag::__consumed_memory_thresholds)
29145                                }
29146                                "consumed_memory_thresholds" => {
29147                                    Ok(__FieldTag::__consumed_memory_thresholds)
29148                                }
29149                                "storageThresholds" => Ok(__FieldTag::__storage_thresholds),
29150                                "storage_thresholds" => Ok(__FieldTag::__storage_thresholds),
29151                                _ => Ok(__FieldTag::Unknown(value.to_string())),
29152                            }
29153                        }
29154                    }
29155                    deserializer.deserialize_identifier(Visitor)
29156                }
29157            }
29158            struct Visitor;
29159            impl<'de> serde::de::Visitor<'de> for Visitor {
29160                type Value = AutoscalingPolicy;
29161                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29162                    formatter.write_str("struct AutoscalingPolicy")
29163                }
29164                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
29165                where
29166                    A: serde::de::MapAccess<'de>,
29167                {
29168                    #[allow(unused_imports)]
29169                    use serde::de::Error;
29170                    use std::option::Option::Some;
29171                    let mut fields = std::collections::HashSet::new();
29172                    let mut result = Self::Value::new();
29173                    while let Some(tag) = map.next_key::<__FieldTag>()? {
29174                        #[allow(clippy::match_single_binding)]
29175                        match tag {
29176                            __FieldTag::__node_type_id => {
29177                                if !fields.insert(__FieldTag::__node_type_id) {
29178                                    return std::result::Result::Err(A::Error::duplicate_field(
29179                                        "multiple values for node_type_id",
29180                                    ));
29181                                }
29182                                result.node_type_id = map
29183                                    .next_value::<std::option::Option<std::string::String>>()?
29184                                    .unwrap_or_default();
29185                            }
29186                            __FieldTag::__scale_out_size => {
29187                                if !fields.insert(__FieldTag::__scale_out_size) {
29188                                    return std::result::Result::Err(A::Error::duplicate_field(
29189                                        "multiple values for scale_out_size",
29190                                    ));
29191                                }
29192                                struct __With(std::option::Option<i32>);
29193                                impl<'de> serde::de::Deserialize<'de> for __With {
29194                                    fn deserialize<D>(
29195                                        deserializer: D,
29196                                    ) -> std::result::Result<Self, D::Error>
29197                                    where
29198                                        D: serde::de::Deserializer<'de>,
29199                                    {
29200                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
29201                                    }
29202                                }
29203                                result.scale_out_size =
29204                                    map.next_value::<__With>()?.0.unwrap_or_default();
29205                            }
29206                            __FieldTag::__cpu_thresholds => {
29207                                if !fields.insert(__FieldTag::__cpu_thresholds) {
29208                                    return std::result::Result::Err(A::Error::duplicate_field(
29209                                        "multiple values for cpu_thresholds",
29210                                    ));
29211                                }
29212                                result.cpu_thresholds = map.next_value::<std::option::Option<
29213                                    crate::model::autoscaling_settings::Thresholds,
29214                                >>()?;
29215                            }
29216                            __FieldTag::__granted_memory_thresholds => {
29217                                if !fields.insert(__FieldTag::__granted_memory_thresholds) {
29218                                    return std::result::Result::Err(A::Error::duplicate_field(
29219                                        "multiple values for granted_memory_thresholds",
29220                                    ));
29221                                }
29222                                result.granted_memory_thresholds = map
29223                                    .next_value::<std::option::Option<
29224                                        crate::model::autoscaling_settings::Thresholds,
29225                                    >>()?;
29226                            }
29227                            __FieldTag::__consumed_memory_thresholds => {
29228                                if !fields.insert(__FieldTag::__consumed_memory_thresholds) {
29229                                    return std::result::Result::Err(A::Error::duplicate_field(
29230                                        "multiple values for consumed_memory_thresholds",
29231                                    ));
29232                                }
29233                                result.consumed_memory_thresholds = map
29234                                    .next_value::<std::option::Option<
29235                                        crate::model::autoscaling_settings::Thresholds,
29236                                    >>()?;
29237                            }
29238                            __FieldTag::__storage_thresholds => {
29239                                if !fields.insert(__FieldTag::__storage_thresholds) {
29240                                    return std::result::Result::Err(A::Error::duplicate_field(
29241                                        "multiple values for storage_thresholds",
29242                                    ));
29243                                }
29244                                result.storage_thresholds = map
29245                                    .next_value::<std::option::Option<
29246                                        crate::model::autoscaling_settings::Thresholds,
29247                                    >>()?;
29248                            }
29249                            __FieldTag::Unknown(key) => {
29250                                let value = map.next_value::<serde_json::Value>()?;
29251                                result._unknown_fields.insert(key, value);
29252                            }
29253                        }
29254                    }
29255                    std::result::Result::Ok(result)
29256                }
29257            }
29258            deserializer.deserialize_any(Visitor)
29259        }
29260    }
29261
29262    #[doc(hidden)]
29263    impl serde::ser::Serialize for AutoscalingPolicy {
29264        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29265        where
29266            S: serde::ser::Serializer,
29267        {
29268            use serde::ser::SerializeMap;
29269            #[allow(unused_imports)]
29270            use std::option::Option::Some;
29271            let mut state = serializer.serialize_map(std::option::Option::None)?;
29272            if !self.node_type_id.is_empty() {
29273                state.serialize_entry("nodeTypeId", &self.node_type_id)?;
29274            }
29275            if !wkt::internal::is_default(&self.scale_out_size) {
29276                struct __With<'a>(&'a i32);
29277                impl<'a> serde::ser::Serialize for __With<'a> {
29278                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29279                    where
29280                        S: serde::ser::Serializer,
29281                    {
29282                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
29283                    }
29284                }
29285                state.serialize_entry("scaleOutSize", &__With(&self.scale_out_size))?;
29286            }
29287            if self.cpu_thresholds.is_some() {
29288                state.serialize_entry("cpuThresholds", &self.cpu_thresholds)?;
29289            }
29290            if self.granted_memory_thresholds.is_some() {
29291                state
29292                    .serialize_entry("grantedMemoryThresholds", &self.granted_memory_thresholds)?;
29293            }
29294            if self.consumed_memory_thresholds.is_some() {
29295                state.serialize_entry(
29296                    "consumedMemoryThresholds",
29297                    &self.consumed_memory_thresholds,
29298                )?;
29299            }
29300            if self.storage_thresholds.is_some() {
29301                state.serialize_entry("storageThresholds", &self.storage_thresholds)?;
29302            }
29303            if !self._unknown_fields.is_empty() {
29304                for (key, value) in self._unknown_fields.iter() {
29305                    state.serialize_entry(key, &value)?;
29306                }
29307            }
29308            state.end()
29309        }
29310    }
29311
29312    impl std::fmt::Debug for AutoscalingPolicy {
29313        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29314            let mut debug_struct = f.debug_struct("AutoscalingPolicy");
29315            debug_struct.field("node_type_id", &self.node_type_id);
29316            debug_struct.field("scale_out_size", &self.scale_out_size);
29317            debug_struct.field("cpu_thresholds", &self.cpu_thresholds);
29318            debug_struct.field("granted_memory_thresholds", &self.granted_memory_thresholds);
29319            debug_struct.field(
29320                "consumed_memory_thresholds",
29321                &self.consumed_memory_thresholds,
29322            );
29323            debug_struct.field("storage_thresholds", &self.storage_thresholds);
29324            if !self._unknown_fields.is_empty() {
29325                debug_struct.field("_unknown_fields", &self._unknown_fields);
29326            }
29327            debug_struct.finish()
29328        }
29329    }
29330}
29331
29332/// DNS forwarding config.
29333/// This config defines a list of domain to name server mappings,
29334/// and is attached to the private cloud for custom domain resolution.
29335#[derive(Clone, Default, PartialEq)]
29336#[non_exhaustive]
29337pub struct DnsForwarding {
29338    /// Output only. The resource name of this DNS profile.
29339    /// Resource names are schemeless URIs that follow the conventions in
29340    /// <https://cloud.google.com/apis/design/resource_names>.
29341    /// For example:
29342    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding`
29343    pub name: std::string::String,
29344
29345    /// Output only. Creation time of this resource.
29346    pub create_time: std::option::Option<wkt::Timestamp>,
29347
29348    /// Output only. Last update time of this resource.
29349    pub update_time: std::option::Option<wkt::Timestamp>,
29350
29351    /// Required. List of domain mappings to configure
29352    pub forwarding_rules: std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
29353
29354    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29355}
29356
29357impl DnsForwarding {
29358    pub fn new() -> Self {
29359        std::default::Default::default()
29360    }
29361
29362    /// Sets the value of [name][crate::model::DnsForwarding::name].
29363    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29364        self.name = v.into();
29365        self
29366    }
29367
29368    /// Sets the value of [create_time][crate::model::DnsForwarding::create_time].
29369    pub fn set_create_time<T>(mut self, v: T) -> Self
29370    where
29371        T: std::convert::Into<wkt::Timestamp>,
29372    {
29373        self.create_time = std::option::Option::Some(v.into());
29374        self
29375    }
29376
29377    /// Sets or clears the value of [create_time][crate::model::DnsForwarding::create_time].
29378    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
29379    where
29380        T: std::convert::Into<wkt::Timestamp>,
29381    {
29382        self.create_time = v.map(|x| x.into());
29383        self
29384    }
29385
29386    /// Sets the value of [update_time][crate::model::DnsForwarding::update_time].
29387    pub fn set_update_time<T>(mut self, v: T) -> Self
29388    where
29389        T: std::convert::Into<wkt::Timestamp>,
29390    {
29391        self.update_time = std::option::Option::Some(v.into());
29392        self
29393    }
29394
29395    /// Sets or clears the value of [update_time][crate::model::DnsForwarding::update_time].
29396    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
29397    where
29398        T: std::convert::Into<wkt::Timestamp>,
29399    {
29400        self.update_time = v.map(|x| x.into());
29401        self
29402    }
29403
29404    /// Sets the value of [forwarding_rules][crate::model::DnsForwarding::forwarding_rules].
29405    pub fn set_forwarding_rules<T, V>(mut self, v: T) -> Self
29406    where
29407        T: std::iter::IntoIterator<Item = V>,
29408        V: std::convert::Into<crate::model::dns_forwarding::ForwardingRule>,
29409    {
29410        use std::iter::Iterator;
29411        self.forwarding_rules = v.into_iter().map(|i| i.into()).collect();
29412        self
29413    }
29414}
29415
29416impl wkt::message::Message for DnsForwarding {
29417    fn typename() -> &'static str {
29418        "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding"
29419    }
29420}
29421
29422#[doc(hidden)]
29423impl<'de> serde::de::Deserialize<'de> for DnsForwarding {
29424    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29425    where
29426        D: serde::Deserializer<'de>,
29427    {
29428        #[allow(non_camel_case_types)]
29429        #[doc(hidden)]
29430        #[derive(PartialEq, Eq, Hash)]
29431        enum __FieldTag {
29432            __name,
29433            __create_time,
29434            __update_time,
29435            __forwarding_rules,
29436            Unknown(std::string::String),
29437        }
29438        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
29439            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29440            where
29441                D: serde::Deserializer<'de>,
29442            {
29443                struct Visitor;
29444                impl<'de> serde::de::Visitor<'de> for Visitor {
29445                    type Value = __FieldTag;
29446                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29447                        formatter.write_str("a field name for DnsForwarding")
29448                    }
29449                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
29450                    where
29451                        E: serde::de::Error,
29452                    {
29453                        use std::result::Result::Ok;
29454                        use std::string::ToString;
29455                        match value {
29456                            "name" => Ok(__FieldTag::__name),
29457                            "createTime" => Ok(__FieldTag::__create_time),
29458                            "create_time" => Ok(__FieldTag::__create_time),
29459                            "updateTime" => Ok(__FieldTag::__update_time),
29460                            "update_time" => Ok(__FieldTag::__update_time),
29461                            "forwardingRules" => Ok(__FieldTag::__forwarding_rules),
29462                            "forwarding_rules" => Ok(__FieldTag::__forwarding_rules),
29463                            _ => Ok(__FieldTag::Unknown(value.to_string())),
29464                        }
29465                    }
29466                }
29467                deserializer.deserialize_identifier(Visitor)
29468            }
29469        }
29470        struct Visitor;
29471        impl<'de> serde::de::Visitor<'de> for Visitor {
29472            type Value = DnsForwarding;
29473            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29474                formatter.write_str("struct DnsForwarding")
29475            }
29476            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
29477            where
29478                A: serde::de::MapAccess<'de>,
29479            {
29480                #[allow(unused_imports)]
29481                use serde::de::Error;
29482                use std::option::Option::Some;
29483                let mut fields = std::collections::HashSet::new();
29484                let mut result = Self::Value::new();
29485                while let Some(tag) = map.next_key::<__FieldTag>()? {
29486                    #[allow(clippy::match_single_binding)]
29487                    match tag {
29488                        __FieldTag::__name => {
29489                            if !fields.insert(__FieldTag::__name) {
29490                                return std::result::Result::Err(A::Error::duplicate_field(
29491                                    "multiple values for name",
29492                                ));
29493                            }
29494                            result.name = map
29495                                .next_value::<std::option::Option<std::string::String>>()?
29496                                .unwrap_or_default();
29497                        }
29498                        __FieldTag::__create_time => {
29499                            if !fields.insert(__FieldTag::__create_time) {
29500                                return std::result::Result::Err(A::Error::duplicate_field(
29501                                    "multiple values for create_time",
29502                                ));
29503                            }
29504                            result.create_time =
29505                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
29506                        }
29507                        __FieldTag::__update_time => {
29508                            if !fields.insert(__FieldTag::__update_time) {
29509                                return std::result::Result::Err(A::Error::duplicate_field(
29510                                    "multiple values for update_time",
29511                                ));
29512                            }
29513                            result.update_time =
29514                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
29515                        }
29516                        __FieldTag::__forwarding_rules => {
29517                            if !fields.insert(__FieldTag::__forwarding_rules) {
29518                                return std::result::Result::Err(A::Error::duplicate_field(
29519                                    "multiple values for forwarding_rules",
29520                                ));
29521                            }
29522                            result.forwarding_rules = map
29523                                .next_value::<std::option::Option<
29524                                    std::vec::Vec<crate::model::dns_forwarding::ForwardingRule>,
29525                                >>()?
29526                                .unwrap_or_default();
29527                        }
29528                        __FieldTag::Unknown(key) => {
29529                            let value = map.next_value::<serde_json::Value>()?;
29530                            result._unknown_fields.insert(key, value);
29531                        }
29532                    }
29533                }
29534                std::result::Result::Ok(result)
29535            }
29536        }
29537        deserializer.deserialize_any(Visitor)
29538    }
29539}
29540
29541#[doc(hidden)]
29542impl serde::ser::Serialize for DnsForwarding {
29543    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29544    where
29545        S: serde::ser::Serializer,
29546    {
29547        use serde::ser::SerializeMap;
29548        #[allow(unused_imports)]
29549        use std::option::Option::Some;
29550        let mut state = serializer.serialize_map(std::option::Option::None)?;
29551        if !self.name.is_empty() {
29552            state.serialize_entry("name", &self.name)?;
29553        }
29554        if self.create_time.is_some() {
29555            state.serialize_entry("createTime", &self.create_time)?;
29556        }
29557        if self.update_time.is_some() {
29558            state.serialize_entry("updateTime", &self.update_time)?;
29559        }
29560        if !self.forwarding_rules.is_empty() {
29561            state.serialize_entry("forwardingRules", &self.forwarding_rules)?;
29562        }
29563        if !self._unknown_fields.is_empty() {
29564            for (key, value) in self._unknown_fields.iter() {
29565                state.serialize_entry(key, &value)?;
29566            }
29567        }
29568        state.end()
29569    }
29570}
29571
29572impl std::fmt::Debug for DnsForwarding {
29573    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29574        let mut debug_struct = f.debug_struct("DnsForwarding");
29575        debug_struct.field("name", &self.name);
29576        debug_struct.field("create_time", &self.create_time);
29577        debug_struct.field("update_time", &self.update_time);
29578        debug_struct.field("forwarding_rules", &self.forwarding_rules);
29579        if !self._unknown_fields.is_empty() {
29580            debug_struct.field("_unknown_fields", &self._unknown_fields);
29581        }
29582        debug_struct.finish()
29583    }
29584}
29585
29586/// Defines additional types related to [DnsForwarding].
29587pub mod dns_forwarding {
29588    #[allow(unused_imports)]
29589    use super::*;
29590
29591    /// A forwarding rule is a mapping of a `domain` to `name_servers`.
29592    /// This mapping allows VMware Engine to resolve domains for attached private
29593    /// clouds by forwarding DNS requests for a given domain to the specified
29594    /// nameservers.
29595    #[derive(Clone, Default, PartialEq)]
29596    #[non_exhaustive]
29597    pub struct ForwardingRule {
29598        /// Required. Domain used to resolve a `name_servers` list.
29599        pub domain: std::string::String,
29600
29601        /// Required. List of DNS servers to use for domain resolution
29602        pub name_servers: std::vec::Vec<std::string::String>,
29603
29604        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29605    }
29606
29607    impl ForwardingRule {
29608        pub fn new() -> Self {
29609            std::default::Default::default()
29610        }
29611
29612        /// Sets the value of [domain][crate::model::dns_forwarding::ForwardingRule::domain].
29613        pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29614            self.domain = v.into();
29615            self
29616        }
29617
29618        /// Sets the value of [name_servers][crate::model::dns_forwarding::ForwardingRule::name_servers].
29619        pub fn set_name_servers<T, V>(mut self, v: T) -> Self
29620        where
29621            T: std::iter::IntoIterator<Item = V>,
29622            V: std::convert::Into<std::string::String>,
29623        {
29624            use std::iter::Iterator;
29625            self.name_servers = v.into_iter().map(|i| i.into()).collect();
29626            self
29627        }
29628    }
29629
29630    impl wkt::message::Message for ForwardingRule {
29631        fn typename() -> &'static str {
29632            "type.googleapis.com/google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule"
29633        }
29634    }
29635
29636    #[doc(hidden)]
29637    impl<'de> serde::de::Deserialize<'de> for ForwardingRule {
29638        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29639        where
29640            D: serde::Deserializer<'de>,
29641        {
29642            #[allow(non_camel_case_types)]
29643            #[doc(hidden)]
29644            #[derive(PartialEq, Eq, Hash)]
29645            enum __FieldTag {
29646                __domain,
29647                __name_servers,
29648                Unknown(std::string::String),
29649            }
29650            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
29651                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29652                where
29653                    D: serde::Deserializer<'de>,
29654                {
29655                    struct Visitor;
29656                    impl<'de> serde::de::Visitor<'de> for Visitor {
29657                        type Value = __FieldTag;
29658                        fn expecting(
29659                            &self,
29660                            formatter: &mut std::fmt::Formatter,
29661                        ) -> std::fmt::Result {
29662                            formatter.write_str("a field name for ForwardingRule")
29663                        }
29664                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
29665                        where
29666                            E: serde::de::Error,
29667                        {
29668                            use std::result::Result::Ok;
29669                            use std::string::ToString;
29670                            match value {
29671                                "domain" => Ok(__FieldTag::__domain),
29672                                "nameServers" => Ok(__FieldTag::__name_servers),
29673                                "name_servers" => Ok(__FieldTag::__name_servers),
29674                                _ => Ok(__FieldTag::Unknown(value.to_string())),
29675                            }
29676                        }
29677                    }
29678                    deserializer.deserialize_identifier(Visitor)
29679                }
29680            }
29681            struct Visitor;
29682            impl<'de> serde::de::Visitor<'de> for Visitor {
29683                type Value = ForwardingRule;
29684                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29685                    formatter.write_str("struct ForwardingRule")
29686                }
29687                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
29688                where
29689                    A: serde::de::MapAccess<'de>,
29690                {
29691                    #[allow(unused_imports)]
29692                    use serde::de::Error;
29693                    use std::option::Option::Some;
29694                    let mut fields = std::collections::HashSet::new();
29695                    let mut result = Self::Value::new();
29696                    while let Some(tag) = map.next_key::<__FieldTag>()? {
29697                        #[allow(clippy::match_single_binding)]
29698                        match tag {
29699                            __FieldTag::__domain => {
29700                                if !fields.insert(__FieldTag::__domain) {
29701                                    return std::result::Result::Err(A::Error::duplicate_field(
29702                                        "multiple values for domain",
29703                                    ));
29704                                }
29705                                result.domain = map
29706                                    .next_value::<std::option::Option<std::string::String>>()?
29707                                    .unwrap_or_default();
29708                            }
29709                            __FieldTag::__name_servers => {
29710                                if !fields.insert(__FieldTag::__name_servers) {
29711                                    return std::result::Result::Err(A::Error::duplicate_field(
29712                                        "multiple values for name_servers",
29713                                    ));
29714                                }
29715                                result.name_servers = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
29716                            }
29717                            __FieldTag::Unknown(key) => {
29718                                let value = map.next_value::<serde_json::Value>()?;
29719                                result._unknown_fields.insert(key, value);
29720                            }
29721                        }
29722                    }
29723                    std::result::Result::Ok(result)
29724                }
29725            }
29726            deserializer.deserialize_any(Visitor)
29727        }
29728    }
29729
29730    #[doc(hidden)]
29731    impl serde::ser::Serialize for ForwardingRule {
29732        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29733        where
29734            S: serde::ser::Serializer,
29735        {
29736            use serde::ser::SerializeMap;
29737            #[allow(unused_imports)]
29738            use std::option::Option::Some;
29739            let mut state = serializer.serialize_map(std::option::Option::None)?;
29740            if !self.domain.is_empty() {
29741                state.serialize_entry("domain", &self.domain)?;
29742            }
29743            if !self.name_servers.is_empty() {
29744                state.serialize_entry("nameServers", &self.name_servers)?;
29745            }
29746            if !self._unknown_fields.is_empty() {
29747                for (key, value) in self._unknown_fields.iter() {
29748                    state.serialize_entry(key, &value)?;
29749                }
29750            }
29751            state.end()
29752        }
29753    }
29754
29755    impl std::fmt::Debug for ForwardingRule {
29756        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29757            let mut debug_struct = f.debug_struct("ForwardingRule");
29758            debug_struct.field("domain", &self.domain);
29759            debug_struct.field("name_servers", &self.name_servers);
29760            if !self._unknown_fields.is_empty() {
29761                debug_struct.field("_unknown_fields", &self._unknown_fields);
29762            }
29763            debug_struct.finish()
29764        }
29765    }
29766}
29767
29768/// Details of a network peering.
29769#[derive(Clone, Default, PartialEq)]
29770#[non_exhaustive]
29771pub struct NetworkPeering {
29772    /// Output only. The resource name of the network peering. NetworkPeering is a
29773    /// global resource and location can only be global. Resource names are
29774    /// scheme-less URIs that follow the conventions in
29775    /// <https://cloud.google.com/apis/design/resource_names>.
29776    /// For example:
29777    /// `projects/my-project/locations/global/networkPeerings/my-peering`
29778    pub name: std::string::String,
29779
29780    /// Output only. Creation time of this resource.
29781    pub create_time: std::option::Option<wkt::Timestamp>,
29782
29783    /// Output only. Last update time of this resource.
29784    pub update_time: std::option::Option<wkt::Timestamp>,
29785
29786    /// Required. The relative resource name of the network to peer with
29787    /// a standard VMware Engine network. The provided network can be a
29788    /// consumer VPC network or another standard VMware Engine network. If the
29789    /// `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form:
29790    /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
29791    /// Otherwise specify the name in the form:
29792    /// `projects/{project}/global/networks/{network_id}`, where
29793    /// `{project}` can either be a project number or a project ID.
29794    pub peer_network: std::string::String,
29795
29796    /// Optional. True if custom routes are exported to the peered network;
29797    /// false otherwise. The default value is true.
29798    pub export_custom_routes: std::option::Option<bool>,
29799
29800    /// Optional. True if custom routes are imported from the peered network;
29801    /// false otherwise. The default value is true.
29802    pub import_custom_routes: std::option::Option<bool>,
29803
29804    /// Optional. True if full mesh connectivity is created and managed
29805    /// automatically between peered networks; false otherwise. Currently this
29806    /// field is always true because Google Compute Engine automatically creates
29807    /// and manages subnetwork routes between two VPC networks when peering state
29808    /// is 'ACTIVE'.
29809    pub exchange_subnet_routes: std::option::Option<bool>,
29810
29811    /// Optional. True if all subnet routes with a public IP address range are
29812    /// exported; false otherwise. The default value is true. IPv4 special-use
29813    /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
29814    /// exported to peers and are not controlled by this field.
29815    pub export_custom_routes_with_public_ip: std::option::Option<bool>,
29816
29817    /// Optional. True if all subnet routes with public IP address range are
29818    /// imported; false otherwise. The default value is true. IPv4 special-use
29819    /// ranges (<https://en.wikipedia.org/wiki/IPv4#Special_addresses>) are always
29820    /// imported to peers and are not controlled by this field.
29821    pub import_custom_routes_with_public_ip: std::option::Option<bool>,
29822
29823    /// Output only. State of the network peering. This field
29824    /// has a value of 'ACTIVE' when there's a matching configuration in the peer
29825    /// network. New values may be added to this enum when appropriate.
29826    pub state: crate::model::network_peering::State,
29827
29828    /// Output only. Output Only. Details about the current state of the network
29829    /// peering.
29830    pub state_details: std::string::String,
29831
29832    /// Optional. Maximum transmission unit (MTU) in bytes.
29833    /// The default value is `1500`. If a value of `0` is provided for this field,
29834    /// VMware Engine uses the default value instead.
29835    pub peer_mtu: i32,
29836
29837    /// Required. The type of the network to peer with the VMware Engine network.
29838    pub peer_network_type: crate::model::network_peering::PeerNetworkType,
29839
29840    /// Output only. System-generated unique identifier for the resource.
29841    pub uid: std::string::String,
29842
29843    /// Required. The relative resource name of the VMware Engine network.
29844    /// Specify the name in the following form:
29845    /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
29846    /// where `{project}` can either be a project number or a project ID.
29847    pub vmware_engine_network: std::string::String,
29848
29849    /// Optional. User-provided description for this network peering.
29850    pub description: std::string::String,
29851
29852    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29853}
29854
29855impl NetworkPeering {
29856    pub fn new() -> Self {
29857        std::default::Default::default()
29858    }
29859
29860    /// Sets the value of [name][crate::model::NetworkPeering::name].
29861    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29862        self.name = v.into();
29863        self
29864    }
29865
29866    /// Sets the value of [create_time][crate::model::NetworkPeering::create_time].
29867    pub fn set_create_time<T>(mut self, v: T) -> Self
29868    where
29869        T: std::convert::Into<wkt::Timestamp>,
29870    {
29871        self.create_time = std::option::Option::Some(v.into());
29872        self
29873    }
29874
29875    /// Sets or clears the value of [create_time][crate::model::NetworkPeering::create_time].
29876    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
29877    where
29878        T: std::convert::Into<wkt::Timestamp>,
29879    {
29880        self.create_time = v.map(|x| x.into());
29881        self
29882    }
29883
29884    /// Sets the value of [update_time][crate::model::NetworkPeering::update_time].
29885    pub fn set_update_time<T>(mut self, v: T) -> Self
29886    where
29887        T: std::convert::Into<wkt::Timestamp>,
29888    {
29889        self.update_time = std::option::Option::Some(v.into());
29890        self
29891    }
29892
29893    /// Sets or clears the value of [update_time][crate::model::NetworkPeering::update_time].
29894    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
29895    where
29896        T: std::convert::Into<wkt::Timestamp>,
29897    {
29898        self.update_time = v.map(|x| x.into());
29899        self
29900    }
29901
29902    /// Sets the value of [peer_network][crate::model::NetworkPeering::peer_network].
29903    pub fn set_peer_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29904        self.peer_network = v.into();
29905        self
29906    }
29907
29908    /// Sets the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
29909    pub fn set_export_custom_routes<T>(mut self, v: T) -> Self
29910    where
29911        T: std::convert::Into<bool>,
29912    {
29913        self.export_custom_routes = std::option::Option::Some(v.into());
29914        self
29915    }
29916
29917    /// Sets or clears the value of [export_custom_routes][crate::model::NetworkPeering::export_custom_routes].
29918    pub fn set_or_clear_export_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
29919    where
29920        T: std::convert::Into<bool>,
29921    {
29922        self.export_custom_routes = v.map(|x| x.into());
29923        self
29924    }
29925
29926    /// Sets the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
29927    pub fn set_import_custom_routes<T>(mut self, v: T) -> Self
29928    where
29929        T: std::convert::Into<bool>,
29930    {
29931        self.import_custom_routes = std::option::Option::Some(v.into());
29932        self
29933    }
29934
29935    /// Sets or clears the value of [import_custom_routes][crate::model::NetworkPeering::import_custom_routes].
29936    pub fn set_or_clear_import_custom_routes<T>(mut self, v: std::option::Option<T>) -> Self
29937    where
29938        T: std::convert::Into<bool>,
29939    {
29940        self.import_custom_routes = v.map(|x| x.into());
29941        self
29942    }
29943
29944    /// Sets the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
29945    pub fn set_exchange_subnet_routes<T>(mut self, v: T) -> Self
29946    where
29947        T: std::convert::Into<bool>,
29948    {
29949        self.exchange_subnet_routes = std::option::Option::Some(v.into());
29950        self
29951    }
29952
29953    /// Sets or clears the value of [exchange_subnet_routes][crate::model::NetworkPeering::exchange_subnet_routes].
29954    pub fn set_or_clear_exchange_subnet_routes<T>(mut self, v: std::option::Option<T>) -> Self
29955    where
29956        T: std::convert::Into<bool>,
29957    {
29958        self.exchange_subnet_routes = v.map(|x| x.into());
29959        self
29960    }
29961
29962    /// Sets the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
29963    pub fn set_export_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
29964    where
29965        T: std::convert::Into<bool>,
29966    {
29967        self.export_custom_routes_with_public_ip = std::option::Option::Some(v.into());
29968        self
29969    }
29970
29971    /// Sets or clears the value of [export_custom_routes_with_public_ip][crate::model::NetworkPeering::export_custom_routes_with_public_ip].
29972    pub fn set_or_clear_export_custom_routes_with_public_ip<T>(
29973        mut self,
29974        v: std::option::Option<T>,
29975    ) -> Self
29976    where
29977        T: std::convert::Into<bool>,
29978    {
29979        self.export_custom_routes_with_public_ip = v.map(|x| x.into());
29980        self
29981    }
29982
29983    /// Sets the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
29984    pub fn set_import_custom_routes_with_public_ip<T>(mut self, v: T) -> Self
29985    where
29986        T: std::convert::Into<bool>,
29987    {
29988        self.import_custom_routes_with_public_ip = std::option::Option::Some(v.into());
29989        self
29990    }
29991
29992    /// Sets or clears the value of [import_custom_routes_with_public_ip][crate::model::NetworkPeering::import_custom_routes_with_public_ip].
29993    pub fn set_or_clear_import_custom_routes_with_public_ip<T>(
29994        mut self,
29995        v: std::option::Option<T>,
29996    ) -> Self
29997    where
29998        T: std::convert::Into<bool>,
29999    {
30000        self.import_custom_routes_with_public_ip = v.map(|x| x.into());
30001        self
30002    }
30003
30004    /// Sets the value of [state][crate::model::NetworkPeering::state].
30005    pub fn set_state<T: std::convert::Into<crate::model::network_peering::State>>(
30006        mut self,
30007        v: T,
30008    ) -> Self {
30009        self.state = v.into();
30010        self
30011    }
30012
30013    /// Sets the value of [state_details][crate::model::NetworkPeering::state_details].
30014    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30015        self.state_details = v.into();
30016        self
30017    }
30018
30019    /// Sets the value of [peer_mtu][crate::model::NetworkPeering::peer_mtu].
30020    pub fn set_peer_mtu<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
30021        self.peer_mtu = v.into();
30022        self
30023    }
30024
30025    /// Sets the value of [peer_network_type][crate::model::NetworkPeering::peer_network_type].
30026    pub fn set_peer_network_type<
30027        T: std::convert::Into<crate::model::network_peering::PeerNetworkType>,
30028    >(
30029        mut self,
30030        v: T,
30031    ) -> Self {
30032        self.peer_network_type = v.into();
30033        self
30034    }
30035
30036    /// Sets the value of [uid][crate::model::NetworkPeering::uid].
30037    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30038        self.uid = v.into();
30039        self
30040    }
30041
30042    /// Sets the value of [vmware_engine_network][crate::model::NetworkPeering::vmware_engine_network].
30043    pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
30044        mut self,
30045        v: T,
30046    ) -> Self {
30047        self.vmware_engine_network = v.into();
30048        self
30049    }
30050
30051    /// Sets the value of [description][crate::model::NetworkPeering::description].
30052    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30053        self.description = v.into();
30054        self
30055    }
30056}
30057
30058impl wkt::message::Message for NetworkPeering {
30059    fn typename() -> &'static str {
30060        "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPeering"
30061    }
30062}
30063
30064#[doc(hidden)]
30065impl<'de> serde::de::Deserialize<'de> for NetworkPeering {
30066    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30067    where
30068        D: serde::Deserializer<'de>,
30069    {
30070        #[allow(non_camel_case_types)]
30071        #[doc(hidden)]
30072        #[derive(PartialEq, Eq, Hash)]
30073        enum __FieldTag {
30074            __name,
30075            __create_time,
30076            __update_time,
30077            __peer_network,
30078            __export_custom_routes,
30079            __import_custom_routes,
30080            __exchange_subnet_routes,
30081            __export_custom_routes_with_public_ip,
30082            __import_custom_routes_with_public_ip,
30083            __state,
30084            __state_details,
30085            __peer_mtu,
30086            __peer_network_type,
30087            __uid,
30088            __vmware_engine_network,
30089            __description,
30090            Unknown(std::string::String),
30091        }
30092        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
30093            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30094            where
30095                D: serde::Deserializer<'de>,
30096            {
30097                struct Visitor;
30098                impl<'de> serde::de::Visitor<'de> for Visitor {
30099                    type Value = __FieldTag;
30100                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30101                        formatter.write_str("a field name for NetworkPeering")
30102                    }
30103                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
30104                    where
30105                        E: serde::de::Error,
30106                    {
30107                        use std::result::Result::Ok;
30108                        use std::string::ToString;
30109                        match value {
30110                            "name" => Ok(__FieldTag::__name),
30111                            "createTime" => Ok(__FieldTag::__create_time),
30112                            "create_time" => Ok(__FieldTag::__create_time),
30113                            "updateTime" => Ok(__FieldTag::__update_time),
30114                            "update_time" => Ok(__FieldTag::__update_time),
30115                            "peerNetwork" => Ok(__FieldTag::__peer_network),
30116                            "peer_network" => Ok(__FieldTag::__peer_network),
30117                            "exportCustomRoutes" => Ok(__FieldTag::__export_custom_routes),
30118                            "export_custom_routes" => Ok(__FieldTag::__export_custom_routes),
30119                            "importCustomRoutes" => Ok(__FieldTag::__import_custom_routes),
30120                            "import_custom_routes" => Ok(__FieldTag::__import_custom_routes),
30121                            "exchangeSubnetRoutes" => Ok(__FieldTag::__exchange_subnet_routes),
30122                            "exchange_subnet_routes" => Ok(__FieldTag::__exchange_subnet_routes),
30123                            "exportCustomRoutesWithPublicIp" => {
30124                                Ok(__FieldTag::__export_custom_routes_with_public_ip)
30125                            }
30126                            "export_custom_routes_with_public_ip" => {
30127                                Ok(__FieldTag::__export_custom_routes_with_public_ip)
30128                            }
30129                            "importCustomRoutesWithPublicIp" => {
30130                                Ok(__FieldTag::__import_custom_routes_with_public_ip)
30131                            }
30132                            "import_custom_routes_with_public_ip" => {
30133                                Ok(__FieldTag::__import_custom_routes_with_public_ip)
30134                            }
30135                            "state" => Ok(__FieldTag::__state),
30136                            "stateDetails" => Ok(__FieldTag::__state_details),
30137                            "state_details" => Ok(__FieldTag::__state_details),
30138                            "peerMtu" => Ok(__FieldTag::__peer_mtu),
30139                            "peer_mtu" => Ok(__FieldTag::__peer_mtu),
30140                            "peerNetworkType" => Ok(__FieldTag::__peer_network_type),
30141                            "peer_network_type" => Ok(__FieldTag::__peer_network_type),
30142                            "uid" => Ok(__FieldTag::__uid),
30143                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
30144                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
30145                            "description" => Ok(__FieldTag::__description),
30146                            _ => Ok(__FieldTag::Unknown(value.to_string())),
30147                        }
30148                    }
30149                }
30150                deserializer.deserialize_identifier(Visitor)
30151            }
30152        }
30153        struct Visitor;
30154        impl<'de> serde::de::Visitor<'de> for Visitor {
30155            type Value = NetworkPeering;
30156            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30157                formatter.write_str("struct NetworkPeering")
30158            }
30159            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
30160            where
30161                A: serde::de::MapAccess<'de>,
30162            {
30163                #[allow(unused_imports)]
30164                use serde::de::Error;
30165                use std::option::Option::Some;
30166                let mut fields = std::collections::HashSet::new();
30167                let mut result = Self::Value::new();
30168                while let Some(tag) = map.next_key::<__FieldTag>()? {
30169                    #[allow(clippy::match_single_binding)]
30170                    match tag {
30171                        __FieldTag::__name => {
30172                            if !fields.insert(__FieldTag::__name) {
30173                                return std::result::Result::Err(A::Error::duplicate_field(
30174                                    "multiple values for name",
30175                                ));
30176                            }
30177                            result.name = map
30178                                .next_value::<std::option::Option<std::string::String>>()?
30179                                .unwrap_or_default();
30180                        }
30181                        __FieldTag::__create_time => {
30182                            if !fields.insert(__FieldTag::__create_time) {
30183                                return std::result::Result::Err(A::Error::duplicate_field(
30184                                    "multiple values for create_time",
30185                                ));
30186                            }
30187                            result.create_time =
30188                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
30189                        }
30190                        __FieldTag::__update_time => {
30191                            if !fields.insert(__FieldTag::__update_time) {
30192                                return std::result::Result::Err(A::Error::duplicate_field(
30193                                    "multiple values for update_time",
30194                                ));
30195                            }
30196                            result.update_time =
30197                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
30198                        }
30199                        __FieldTag::__peer_network => {
30200                            if !fields.insert(__FieldTag::__peer_network) {
30201                                return std::result::Result::Err(A::Error::duplicate_field(
30202                                    "multiple values for peer_network",
30203                                ));
30204                            }
30205                            result.peer_network = map
30206                                .next_value::<std::option::Option<std::string::String>>()?
30207                                .unwrap_or_default();
30208                        }
30209                        __FieldTag::__export_custom_routes => {
30210                            if !fields.insert(__FieldTag::__export_custom_routes) {
30211                                return std::result::Result::Err(A::Error::duplicate_field(
30212                                    "multiple values for export_custom_routes",
30213                                ));
30214                            }
30215                            result.export_custom_routes =
30216                                map.next_value::<std::option::Option<bool>>()?;
30217                        }
30218                        __FieldTag::__import_custom_routes => {
30219                            if !fields.insert(__FieldTag::__import_custom_routes) {
30220                                return std::result::Result::Err(A::Error::duplicate_field(
30221                                    "multiple values for import_custom_routes",
30222                                ));
30223                            }
30224                            result.import_custom_routes =
30225                                map.next_value::<std::option::Option<bool>>()?;
30226                        }
30227                        __FieldTag::__exchange_subnet_routes => {
30228                            if !fields.insert(__FieldTag::__exchange_subnet_routes) {
30229                                return std::result::Result::Err(A::Error::duplicate_field(
30230                                    "multiple values for exchange_subnet_routes",
30231                                ));
30232                            }
30233                            result.exchange_subnet_routes =
30234                                map.next_value::<std::option::Option<bool>>()?;
30235                        }
30236                        __FieldTag::__export_custom_routes_with_public_ip => {
30237                            if !fields.insert(__FieldTag::__export_custom_routes_with_public_ip) {
30238                                return std::result::Result::Err(A::Error::duplicate_field(
30239                                    "multiple values for export_custom_routes_with_public_ip",
30240                                ));
30241                            }
30242                            result.export_custom_routes_with_public_ip =
30243                                map.next_value::<std::option::Option<bool>>()?;
30244                        }
30245                        __FieldTag::__import_custom_routes_with_public_ip => {
30246                            if !fields.insert(__FieldTag::__import_custom_routes_with_public_ip) {
30247                                return std::result::Result::Err(A::Error::duplicate_field(
30248                                    "multiple values for import_custom_routes_with_public_ip",
30249                                ));
30250                            }
30251                            result.import_custom_routes_with_public_ip =
30252                                map.next_value::<std::option::Option<bool>>()?;
30253                        }
30254                        __FieldTag::__state => {
30255                            if !fields.insert(__FieldTag::__state) {
30256                                return std::result::Result::Err(A::Error::duplicate_field(
30257                                    "multiple values for state",
30258                                ));
30259                            }
30260                            result.state = map.next_value::<std::option::Option<crate::model::network_peering::State>>()?.unwrap_or_default();
30261                        }
30262                        __FieldTag::__state_details => {
30263                            if !fields.insert(__FieldTag::__state_details) {
30264                                return std::result::Result::Err(A::Error::duplicate_field(
30265                                    "multiple values for state_details",
30266                                ));
30267                            }
30268                            result.state_details = map
30269                                .next_value::<std::option::Option<std::string::String>>()?
30270                                .unwrap_or_default();
30271                        }
30272                        __FieldTag::__peer_mtu => {
30273                            if !fields.insert(__FieldTag::__peer_mtu) {
30274                                return std::result::Result::Err(A::Error::duplicate_field(
30275                                    "multiple values for peer_mtu",
30276                                ));
30277                            }
30278                            struct __With(std::option::Option<i32>);
30279                            impl<'de> serde::de::Deserialize<'de> for __With {
30280                                fn deserialize<D>(
30281                                    deserializer: D,
30282                                ) -> std::result::Result<Self, D::Error>
30283                                where
30284                                    D: serde::de::Deserializer<'de>,
30285                                {
30286                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
30287                                }
30288                            }
30289                            result.peer_mtu = map.next_value::<__With>()?.0.unwrap_or_default();
30290                        }
30291                        __FieldTag::__peer_network_type => {
30292                            if !fields.insert(__FieldTag::__peer_network_type) {
30293                                return std::result::Result::Err(A::Error::duplicate_field(
30294                                    "multiple values for peer_network_type",
30295                                ));
30296                            }
30297                            result.peer_network_type =
30298                                map.next_value::<std::option::Option<
30299                                    crate::model::network_peering::PeerNetworkType,
30300                                >>()?
30301                                .unwrap_or_default();
30302                        }
30303                        __FieldTag::__uid => {
30304                            if !fields.insert(__FieldTag::__uid) {
30305                                return std::result::Result::Err(A::Error::duplicate_field(
30306                                    "multiple values for uid",
30307                                ));
30308                            }
30309                            result.uid = map
30310                                .next_value::<std::option::Option<std::string::String>>()?
30311                                .unwrap_or_default();
30312                        }
30313                        __FieldTag::__vmware_engine_network => {
30314                            if !fields.insert(__FieldTag::__vmware_engine_network) {
30315                                return std::result::Result::Err(A::Error::duplicate_field(
30316                                    "multiple values for vmware_engine_network",
30317                                ));
30318                            }
30319                            result.vmware_engine_network = map
30320                                .next_value::<std::option::Option<std::string::String>>()?
30321                                .unwrap_or_default();
30322                        }
30323                        __FieldTag::__description => {
30324                            if !fields.insert(__FieldTag::__description) {
30325                                return std::result::Result::Err(A::Error::duplicate_field(
30326                                    "multiple values for description",
30327                                ));
30328                            }
30329                            result.description = map
30330                                .next_value::<std::option::Option<std::string::String>>()?
30331                                .unwrap_or_default();
30332                        }
30333                        __FieldTag::Unknown(key) => {
30334                            let value = map.next_value::<serde_json::Value>()?;
30335                            result._unknown_fields.insert(key, value);
30336                        }
30337                    }
30338                }
30339                std::result::Result::Ok(result)
30340            }
30341        }
30342        deserializer.deserialize_any(Visitor)
30343    }
30344}
30345
30346#[doc(hidden)]
30347impl serde::ser::Serialize for NetworkPeering {
30348    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30349    where
30350        S: serde::ser::Serializer,
30351    {
30352        use serde::ser::SerializeMap;
30353        #[allow(unused_imports)]
30354        use std::option::Option::Some;
30355        let mut state = serializer.serialize_map(std::option::Option::None)?;
30356        if !self.name.is_empty() {
30357            state.serialize_entry("name", &self.name)?;
30358        }
30359        if self.create_time.is_some() {
30360            state.serialize_entry("createTime", &self.create_time)?;
30361        }
30362        if self.update_time.is_some() {
30363            state.serialize_entry("updateTime", &self.update_time)?;
30364        }
30365        if !self.peer_network.is_empty() {
30366            state.serialize_entry("peerNetwork", &self.peer_network)?;
30367        }
30368        if self.export_custom_routes.is_some() {
30369            state.serialize_entry("exportCustomRoutes", &self.export_custom_routes)?;
30370        }
30371        if self.import_custom_routes.is_some() {
30372            state.serialize_entry("importCustomRoutes", &self.import_custom_routes)?;
30373        }
30374        if self.exchange_subnet_routes.is_some() {
30375            state.serialize_entry("exchangeSubnetRoutes", &self.exchange_subnet_routes)?;
30376        }
30377        if self.export_custom_routes_with_public_ip.is_some() {
30378            state.serialize_entry(
30379                "exportCustomRoutesWithPublicIp",
30380                &self.export_custom_routes_with_public_ip,
30381            )?;
30382        }
30383        if self.import_custom_routes_with_public_ip.is_some() {
30384            state.serialize_entry(
30385                "importCustomRoutesWithPublicIp",
30386                &self.import_custom_routes_with_public_ip,
30387            )?;
30388        }
30389        if !wkt::internal::is_default(&self.state) {
30390            state.serialize_entry("state", &self.state)?;
30391        }
30392        if !self.state_details.is_empty() {
30393            state.serialize_entry("stateDetails", &self.state_details)?;
30394        }
30395        if !wkt::internal::is_default(&self.peer_mtu) {
30396            struct __With<'a>(&'a i32);
30397            impl<'a> serde::ser::Serialize for __With<'a> {
30398                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30399                where
30400                    S: serde::ser::Serializer,
30401                {
30402                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
30403                }
30404            }
30405            state.serialize_entry("peerMtu", &__With(&self.peer_mtu))?;
30406        }
30407        if !wkt::internal::is_default(&self.peer_network_type) {
30408            state.serialize_entry("peerNetworkType", &self.peer_network_type)?;
30409        }
30410        if !self.uid.is_empty() {
30411            state.serialize_entry("uid", &self.uid)?;
30412        }
30413        if !self.vmware_engine_network.is_empty() {
30414            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
30415        }
30416        if !self.description.is_empty() {
30417            state.serialize_entry("description", &self.description)?;
30418        }
30419        if !self._unknown_fields.is_empty() {
30420            for (key, value) in self._unknown_fields.iter() {
30421                state.serialize_entry(key, &value)?;
30422            }
30423        }
30424        state.end()
30425    }
30426}
30427
30428impl std::fmt::Debug for NetworkPeering {
30429    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30430        let mut debug_struct = f.debug_struct("NetworkPeering");
30431        debug_struct.field("name", &self.name);
30432        debug_struct.field("create_time", &self.create_time);
30433        debug_struct.field("update_time", &self.update_time);
30434        debug_struct.field("peer_network", &self.peer_network);
30435        debug_struct.field("export_custom_routes", &self.export_custom_routes);
30436        debug_struct.field("import_custom_routes", &self.import_custom_routes);
30437        debug_struct.field("exchange_subnet_routes", &self.exchange_subnet_routes);
30438        debug_struct.field(
30439            "export_custom_routes_with_public_ip",
30440            &self.export_custom_routes_with_public_ip,
30441        );
30442        debug_struct.field(
30443            "import_custom_routes_with_public_ip",
30444            &self.import_custom_routes_with_public_ip,
30445        );
30446        debug_struct.field("state", &self.state);
30447        debug_struct.field("state_details", &self.state_details);
30448        debug_struct.field("peer_mtu", &self.peer_mtu);
30449        debug_struct.field("peer_network_type", &self.peer_network_type);
30450        debug_struct.field("uid", &self.uid);
30451        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
30452        debug_struct.field("description", &self.description);
30453        if !self._unknown_fields.is_empty() {
30454            debug_struct.field("_unknown_fields", &self._unknown_fields);
30455        }
30456        debug_struct.finish()
30457    }
30458}
30459
30460/// Defines additional types related to [NetworkPeering].
30461pub mod network_peering {
30462    #[allow(unused_imports)]
30463    use super::*;
30464
30465    /// Possible states of a network peering.
30466    ///
30467    /// # Working with unknown values
30468    ///
30469    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30470    /// additional enum variants at any time. Adding new variants is not considered
30471    /// a breaking change. Applications should write their code in anticipation of:
30472    ///
30473    /// - New values appearing in future releases of the client library, **and**
30474    /// - New values received dynamically, without application changes.
30475    ///
30476    /// Please consult the [Working with enums] section in the user guide for some
30477    /// guidelines.
30478    ///
30479    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30480    #[derive(Clone, Debug, PartialEq)]
30481    #[non_exhaustive]
30482    pub enum State {
30483        /// Unspecified network peering state. This is the default value.
30484        Unspecified,
30485        /// The peering is not active.
30486        Inactive,
30487        /// The peering is active.
30488        Active,
30489        /// The peering is being created.
30490        Creating,
30491        /// The peering is being deleted.
30492        Deleting,
30493        /// If set, the enum was initialized with an unknown value.
30494        ///
30495        /// Applications can examine the value using [State::value] or
30496        /// [State::name].
30497        UnknownValue(state::UnknownValue),
30498    }
30499
30500    #[doc(hidden)]
30501    pub mod state {
30502        #[allow(unused_imports)]
30503        use super::*;
30504        #[derive(Clone, Debug, PartialEq)]
30505        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30506    }
30507
30508    impl State {
30509        /// Gets the enum value.
30510        ///
30511        /// Returns `None` if the enum contains an unknown value deserialized from
30512        /// the string representation of enums.
30513        pub fn value(&self) -> std::option::Option<i32> {
30514            match self {
30515                Self::Unspecified => std::option::Option::Some(0),
30516                Self::Inactive => std::option::Option::Some(1),
30517                Self::Active => std::option::Option::Some(2),
30518                Self::Creating => std::option::Option::Some(3),
30519                Self::Deleting => std::option::Option::Some(4),
30520                Self::UnknownValue(u) => u.0.value(),
30521            }
30522        }
30523
30524        /// Gets the enum value as a string.
30525        ///
30526        /// Returns `None` if the enum contains an unknown value deserialized from
30527        /// the integer representation of enums.
30528        pub fn name(&self) -> std::option::Option<&str> {
30529            match self {
30530                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
30531                Self::Inactive => std::option::Option::Some("INACTIVE"),
30532                Self::Active => std::option::Option::Some("ACTIVE"),
30533                Self::Creating => std::option::Option::Some("CREATING"),
30534                Self::Deleting => std::option::Option::Some("DELETING"),
30535                Self::UnknownValue(u) => u.0.name(),
30536            }
30537        }
30538    }
30539
30540    impl std::default::Default for State {
30541        fn default() -> Self {
30542            use std::convert::From;
30543            Self::from(0)
30544        }
30545    }
30546
30547    impl std::fmt::Display for State {
30548        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30549            wkt::internal::display_enum(f, self.name(), self.value())
30550        }
30551    }
30552
30553    impl std::convert::From<i32> for State {
30554        fn from(value: i32) -> Self {
30555            match value {
30556                0 => Self::Unspecified,
30557                1 => Self::Inactive,
30558                2 => Self::Active,
30559                3 => Self::Creating,
30560                4 => Self::Deleting,
30561                _ => Self::UnknownValue(state::UnknownValue(
30562                    wkt::internal::UnknownEnumValue::Integer(value),
30563                )),
30564            }
30565        }
30566    }
30567
30568    impl std::convert::From<&str> for State {
30569        fn from(value: &str) -> Self {
30570            use std::string::ToString;
30571            match value {
30572                "STATE_UNSPECIFIED" => Self::Unspecified,
30573                "INACTIVE" => Self::Inactive,
30574                "ACTIVE" => Self::Active,
30575                "CREATING" => Self::Creating,
30576                "DELETING" => Self::Deleting,
30577                _ => Self::UnknownValue(state::UnknownValue(
30578                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30579                )),
30580            }
30581        }
30582    }
30583
30584    impl serde::ser::Serialize for State {
30585        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30586        where
30587            S: serde::Serializer,
30588        {
30589            match self {
30590                Self::Unspecified => serializer.serialize_i32(0),
30591                Self::Inactive => serializer.serialize_i32(1),
30592                Self::Active => serializer.serialize_i32(2),
30593                Self::Creating => serializer.serialize_i32(3),
30594                Self::Deleting => serializer.serialize_i32(4),
30595                Self::UnknownValue(u) => u.0.serialize(serializer),
30596            }
30597        }
30598    }
30599
30600    impl<'de> serde::de::Deserialize<'de> for State {
30601        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30602        where
30603            D: serde::Deserializer<'de>,
30604        {
30605            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
30606                ".google.cloud.vmwareengine.v1.NetworkPeering.State",
30607            ))
30608        }
30609    }
30610
30611    /// Type or purpose of the network peering connection.
30612    ///
30613    /// # Working with unknown values
30614    ///
30615    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30616    /// additional enum variants at any time. Adding new variants is not considered
30617    /// a breaking change. Applications should write their code in anticipation of:
30618    ///
30619    /// - New values appearing in future releases of the client library, **and**
30620    /// - New values received dynamically, without application changes.
30621    ///
30622    /// Please consult the [Working with enums] section in the user guide for some
30623    /// guidelines.
30624    ///
30625    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30626    #[derive(Clone, Debug, PartialEq)]
30627    #[non_exhaustive]
30628    pub enum PeerNetworkType {
30629        /// Unspecified
30630        Unspecified,
30631        /// Peering connection used for connecting to another VPC network established
30632        /// by the same user. For example, a peering connection to another VPC
30633        /// network in the same project or to an on-premises network.
30634        Standard,
30635        /// Peering connection used for connecting to another VMware Engine network.
30636        VmwareEngineNetwork,
30637        /// Peering connection used for establishing [private services
30638        /// access](https://cloud.google.com/vpc/docs/private-services-access).
30639        PrivateServicesAccess,
30640        /// Peering connection used for connecting to NetApp Cloud Volumes.
30641        NetappCloudVolumes,
30642        /// Peering connection used for connecting to third-party services. Most
30643        /// third-party services require manual setup of reverse peering on the VPC
30644        /// network associated with the third-party service.
30645        ThirdPartyService,
30646        /// Peering connection used for connecting to Dell PowerScale Filers
30647        DellPowerscale,
30648        /// Peering connection used for connecting to Google Cloud NetApp Volumes.
30649        GoogleCloudNetappVolumes,
30650        /// If set, the enum was initialized with an unknown value.
30651        ///
30652        /// Applications can examine the value using [PeerNetworkType::value] or
30653        /// [PeerNetworkType::name].
30654        UnknownValue(peer_network_type::UnknownValue),
30655    }
30656
30657    #[doc(hidden)]
30658    pub mod peer_network_type {
30659        #[allow(unused_imports)]
30660        use super::*;
30661        #[derive(Clone, Debug, PartialEq)]
30662        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30663    }
30664
30665    impl PeerNetworkType {
30666        /// Gets the enum value.
30667        ///
30668        /// Returns `None` if the enum contains an unknown value deserialized from
30669        /// the string representation of enums.
30670        pub fn value(&self) -> std::option::Option<i32> {
30671            match self {
30672                Self::Unspecified => std::option::Option::Some(0),
30673                Self::Standard => std::option::Option::Some(1),
30674                Self::VmwareEngineNetwork => std::option::Option::Some(2),
30675                Self::PrivateServicesAccess => std::option::Option::Some(3),
30676                Self::NetappCloudVolumes => std::option::Option::Some(4),
30677                Self::ThirdPartyService => std::option::Option::Some(5),
30678                Self::DellPowerscale => std::option::Option::Some(6),
30679                Self::GoogleCloudNetappVolumes => std::option::Option::Some(7),
30680                Self::UnknownValue(u) => u.0.value(),
30681            }
30682        }
30683
30684        /// Gets the enum value as a string.
30685        ///
30686        /// Returns `None` if the enum contains an unknown value deserialized from
30687        /// the integer representation of enums.
30688        pub fn name(&self) -> std::option::Option<&str> {
30689            match self {
30690                Self::Unspecified => std::option::Option::Some("PEER_NETWORK_TYPE_UNSPECIFIED"),
30691                Self::Standard => std::option::Option::Some("STANDARD"),
30692                Self::VmwareEngineNetwork => std::option::Option::Some("VMWARE_ENGINE_NETWORK"),
30693                Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
30694                Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
30695                Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
30696                Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
30697                Self::GoogleCloudNetappVolumes => {
30698                    std::option::Option::Some("GOOGLE_CLOUD_NETAPP_VOLUMES")
30699                }
30700                Self::UnknownValue(u) => u.0.name(),
30701            }
30702        }
30703    }
30704
30705    impl std::default::Default for PeerNetworkType {
30706        fn default() -> Self {
30707            use std::convert::From;
30708            Self::from(0)
30709        }
30710    }
30711
30712    impl std::fmt::Display for PeerNetworkType {
30713        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30714            wkt::internal::display_enum(f, self.name(), self.value())
30715        }
30716    }
30717
30718    impl std::convert::From<i32> for PeerNetworkType {
30719        fn from(value: i32) -> Self {
30720            match value {
30721                0 => Self::Unspecified,
30722                1 => Self::Standard,
30723                2 => Self::VmwareEngineNetwork,
30724                3 => Self::PrivateServicesAccess,
30725                4 => Self::NetappCloudVolumes,
30726                5 => Self::ThirdPartyService,
30727                6 => Self::DellPowerscale,
30728                7 => Self::GoogleCloudNetappVolumes,
30729                _ => Self::UnknownValue(peer_network_type::UnknownValue(
30730                    wkt::internal::UnknownEnumValue::Integer(value),
30731                )),
30732            }
30733        }
30734    }
30735
30736    impl std::convert::From<&str> for PeerNetworkType {
30737        fn from(value: &str) -> Self {
30738            use std::string::ToString;
30739            match value {
30740                "PEER_NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
30741                "STANDARD" => Self::Standard,
30742                "VMWARE_ENGINE_NETWORK" => Self::VmwareEngineNetwork,
30743                "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
30744                "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
30745                "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
30746                "DELL_POWERSCALE" => Self::DellPowerscale,
30747                "GOOGLE_CLOUD_NETAPP_VOLUMES" => Self::GoogleCloudNetappVolumes,
30748                _ => Self::UnknownValue(peer_network_type::UnknownValue(
30749                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30750                )),
30751            }
30752        }
30753    }
30754
30755    impl serde::ser::Serialize for PeerNetworkType {
30756        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30757        where
30758            S: serde::Serializer,
30759        {
30760            match self {
30761                Self::Unspecified => serializer.serialize_i32(0),
30762                Self::Standard => serializer.serialize_i32(1),
30763                Self::VmwareEngineNetwork => serializer.serialize_i32(2),
30764                Self::PrivateServicesAccess => serializer.serialize_i32(3),
30765                Self::NetappCloudVolumes => serializer.serialize_i32(4),
30766                Self::ThirdPartyService => serializer.serialize_i32(5),
30767                Self::DellPowerscale => serializer.serialize_i32(6),
30768                Self::GoogleCloudNetappVolumes => serializer.serialize_i32(7),
30769                Self::UnknownValue(u) => u.0.serialize(serializer),
30770            }
30771        }
30772    }
30773
30774    impl<'de> serde::de::Deserialize<'de> for PeerNetworkType {
30775        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30776        where
30777            D: serde::Deserializer<'de>,
30778        {
30779            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeerNetworkType>::new(
30780                ".google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType",
30781            ))
30782        }
30783    }
30784}
30785
30786/// Exchanged network peering route.
30787#[derive(Clone, Default, PartialEq)]
30788#[non_exhaustive]
30789pub struct PeeringRoute {
30790    /// Output only. Destination range of the peering route in CIDR notation.
30791    pub dest_range: std::string::String,
30792
30793    /// Output only. Type of the route in the peer VPC network.
30794    pub r#type: crate::model::peering_route::Type,
30795
30796    /// Output only. Region containing the next hop of the peering route. This
30797    /// field only applies to dynamic routes in the peer VPC network.
30798    pub next_hop_region: std::string::String,
30799
30800    /// Output only. The priority of the peering route.
30801    pub priority: i64,
30802
30803    /// Output only. True if the peering route has been imported from a peered
30804    /// VPC network; false otherwise. The import happens if the field
30805    /// `NetworkPeering.importCustomRoutes` is true for this network,
30806    /// `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and
30807    /// the import does not result in a route conflict.
30808    pub imported: bool,
30809
30810    /// Output only. Direction of the routes exchanged with the peer network, from
30811    /// the VMware Engine network perspective:
30812    ///
30813    /// * Routes of direction `INCOMING` are imported from the peer network.
30814    /// * Routes of direction `OUTGOING` are exported from the intranet VPC network
30815    ///   of the VMware Engine network.
30816    pub direction: crate::model::peering_route::Direction,
30817
30818    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30819}
30820
30821impl PeeringRoute {
30822    pub fn new() -> Self {
30823        std::default::Default::default()
30824    }
30825
30826    /// Sets the value of [dest_range][crate::model::PeeringRoute::dest_range].
30827    pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30828        self.dest_range = v.into();
30829        self
30830    }
30831
30832    /// Sets the value of [r#type][crate::model::PeeringRoute::type].
30833    pub fn set_type<T: std::convert::Into<crate::model::peering_route::Type>>(
30834        mut self,
30835        v: T,
30836    ) -> Self {
30837        self.r#type = v.into();
30838        self
30839    }
30840
30841    /// Sets the value of [next_hop_region][crate::model::PeeringRoute::next_hop_region].
30842    pub fn set_next_hop_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30843        self.next_hop_region = v.into();
30844        self
30845    }
30846
30847    /// Sets the value of [priority][crate::model::PeeringRoute::priority].
30848    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30849        self.priority = v.into();
30850        self
30851    }
30852
30853    /// Sets the value of [imported][crate::model::PeeringRoute::imported].
30854    pub fn set_imported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30855        self.imported = v.into();
30856        self
30857    }
30858
30859    /// Sets the value of [direction][crate::model::PeeringRoute::direction].
30860    pub fn set_direction<T: std::convert::Into<crate::model::peering_route::Direction>>(
30861        mut self,
30862        v: T,
30863    ) -> Self {
30864        self.direction = v.into();
30865        self
30866    }
30867}
30868
30869impl wkt::message::Message for PeeringRoute {
30870    fn typename() -> &'static str {
30871        "type.googleapis.com/google.cloud.vmwareengine.v1.PeeringRoute"
30872    }
30873}
30874
30875#[doc(hidden)]
30876impl<'de> serde::de::Deserialize<'de> for PeeringRoute {
30877    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30878    where
30879        D: serde::Deserializer<'de>,
30880    {
30881        #[allow(non_camel_case_types)]
30882        #[doc(hidden)]
30883        #[derive(PartialEq, Eq, Hash)]
30884        enum __FieldTag {
30885            __dest_range,
30886            __type,
30887            __next_hop_region,
30888            __priority,
30889            __imported,
30890            __direction,
30891            Unknown(std::string::String),
30892        }
30893        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
30894            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30895            where
30896                D: serde::Deserializer<'de>,
30897            {
30898                struct Visitor;
30899                impl<'de> serde::de::Visitor<'de> for Visitor {
30900                    type Value = __FieldTag;
30901                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30902                        formatter.write_str("a field name for PeeringRoute")
30903                    }
30904                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
30905                    where
30906                        E: serde::de::Error,
30907                    {
30908                        use std::result::Result::Ok;
30909                        use std::string::ToString;
30910                        match value {
30911                            "destRange" => Ok(__FieldTag::__dest_range),
30912                            "dest_range" => Ok(__FieldTag::__dest_range),
30913                            "type" => Ok(__FieldTag::__type),
30914                            "nextHopRegion" => Ok(__FieldTag::__next_hop_region),
30915                            "next_hop_region" => Ok(__FieldTag::__next_hop_region),
30916                            "priority" => Ok(__FieldTag::__priority),
30917                            "imported" => Ok(__FieldTag::__imported),
30918                            "direction" => Ok(__FieldTag::__direction),
30919                            _ => Ok(__FieldTag::Unknown(value.to_string())),
30920                        }
30921                    }
30922                }
30923                deserializer.deserialize_identifier(Visitor)
30924            }
30925        }
30926        struct Visitor;
30927        impl<'de> serde::de::Visitor<'de> for Visitor {
30928            type Value = PeeringRoute;
30929            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30930                formatter.write_str("struct PeeringRoute")
30931            }
30932            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
30933            where
30934                A: serde::de::MapAccess<'de>,
30935            {
30936                #[allow(unused_imports)]
30937                use serde::de::Error;
30938                use std::option::Option::Some;
30939                let mut fields = std::collections::HashSet::new();
30940                let mut result = Self::Value::new();
30941                while let Some(tag) = map.next_key::<__FieldTag>()? {
30942                    #[allow(clippy::match_single_binding)]
30943                    match tag {
30944                        __FieldTag::__dest_range => {
30945                            if !fields.insert(__FieldTag::__dest_range) {
30946                                return std::result::Result::Err(A::Error::duplicate_field(
30947                                    "multiple values for dest_range",
30948                                ));
30949                            }
30950                            result.dest_range = map
30951                                .next_value::<std::option::Option<std::string::String>>()?
30952                                .unwrap_or_default();
30953                        }
30954                        __FieldTag::__type => {
30955                            if !fields.insert(__FieldTag::__type) {
30956                                return std::result::Result::Err(A::Error::duplicate_field(
30957                                    "multiple values for type",
30958                                ));
30959                            }
30960                            result.r#type = map.next_value::<std::option::Option<crate::model::peering_route::Type>>()?.unwrap_or_default();
30961                        }
30962                        __FieldTag::__next_hop_region => {
30963                            if !fields.insert(__FieldTag::__next_hop_region) {
30964                                return std::result::Result::Err(A::Error::duplicate_field(
30965                                    "multiple values for next_hop_region",
30966                                ));
30967                            }
30968                            result.next_hop_region = map
30969                                .next_value::<std::option::Option<std::string::String>>()?
30970                                .unwrap_or_default();
30971                        }
30972                        __FieldTag::__priority => {
30973                            if !fields.insert(__FieldTag::__priority) {
30974                                return std::result::Result::Err(A::Error::duplicate_field(
30975                                    "multiple values for priority",
30976                                ));
30977                            }
30978                            struct __With(std::option::Option<i64>);
30979                            impl<'de> serde::de::Deserialize<'de> for __With {
30980                                fn deserialize<D>(
30981                                    deserializer: D,
30982                                ) -> std::result::Result<Self, D::Error>
30983                                where
30984                                    D: serde::de::Deserializer<'de>,
30985                                {
30986                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
30987                                }
30988                            }
30989                            result.priority = map.next_value::<__With>()?.0.unwrap_or_default();
30990                        }
30991                        __FieldTag::__imported => {
30992                            if !fields.insert(__FieldTag::__imported) {
30993                                return std::result::Result::Err(A::Error::duplicate_field(
30994                                    "multiple values for imported",
30995                                ));
30996                            }
30997                            result.imported = map
30998                                .next_value::<std::option::Option<bool>>()?
30999                                .unwrap_or_default();
31000                        }
31001                        __FieldTag::__direction => {
31002                            if !fields.insert(__FieldTag::__direction) {
31003                                return std::result::Result::Err(A::Error::duplicate_field(
31004                                    "multiple values for direction",
31005                                ));
31006                            }
31007                            result.direction = map.next_value::<std::option::Option<crate::model::peering_route::Direction>>()?.unwrap_or_default();
31008                        }
31009                        __FieldTag::Unknown(key) => {
31010                            let value = map.next_value::<serde_json::Value>()?;
31011                            result._unknown_fields.insert(key, value);
31012                        }
31013                    }
31014                }
31015                std::result::Result::Ok(result)
31016            }
31017        }
31018        deserializer.deserialize_any(Visitor)
31019    }
31020}
31021
31022#[doc(hidden)]
31023impl serde::ser::Serialize for PeeringRoute {
31024    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31025    where
31026        S: serde::ser::Serializer,
31027    {
31028        use serde::ser::SerializeMap;
31029        #[allow(unused_imports)]
31030        use std::option::Option::Some;
31031        let mut state = serializer.serialize_map(std::option::Option::None)?;
31032        if !self.dest_range.is_empty() {
31033            state.serialize_entry("destRange", &self.dest_range)?;
31034        }
31035        if !wkt::internal::is_default(&self.r#type) {
31036            state.serialize_entry("type", &self.r#type)?;
31037        }
31038        if !self.next_hop_region.is_empty() {
31039            state.serialize_entry("nextHopRegion", &self.next_hop_region)?;
31040        }
31041        if !wkt::internal::is_default(&self.priority) {
31042            struct __With<'a>(&'a i64);
31043            impl<'a> serde::ser::Serialize for __With<'a> {
31044                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31045                where
31046                    S: serde::ser::Serializer,
31047                {
31048                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
31049                }
31050            }
31051            state.serialize_entry("priority", &__With(&self.priority))?;
31052        }
31053        if !wkt::internal::is_default(&self.imported) {
31054            state.serialize_entry("imported", &self.imported)?;
31055        }
31056        if !wkt::internal::is_default(&self.direction) {
31057            state.serialize_entry("direction", &self.direction)?;
31058        }
31059        if !self._unknown_fields.is_empty() {
31060            for (key, value) in self._unknown_fields.iter() {
31061                state.serialize_entry(key, &value)?;
31062            }
31063        }
31064        state.end()
31065    }
31066}
31067
31068impl std::fmt::Debug for PeeringRoute {
31069    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31070        let mut debug_struct = f.debug_struct("PeeringRoute");
31071        debug_struct.field("dest_range", &self.dest_range);
31072        debug_struct.field("r#type", &self.r#type);
31073        debug_struct.field("next_hop_region", &self.next_hop_region);
31074        debug_struct.field("priority", &self.priority);
31075        debug_struct.field("imported", &self.imported);
31076        debug_struct.field("direction", &self.direction);
31077        if !self._unknown_fields.is_empty() {
31078            debug_struct.field("_unknown_fields", &self._unknown_fields);
31079        }
31080        debug_struct.finish()
31081    }
31082}
31083
31084/// Defines additional types related to [PeeringRoute].
31085pub mod peering_route {
31086    #[allow(unused_imports)]
31087    use super::*;
31088
31089    /// The type of the peering route.
31090    ///
31091    /// # Working with unknown values
31092    ///
31093    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31094    /// additional enum variants at any time. Adding new variants is not considered
31095    /// a breaking change. Applications should write their code in anticipation of:
31096    ///
31097    /// - New values appearing in future releases of the client library, **and**
31098    /// - New values received dynamically, without application changes.
31099    ///
31100    /// Please consult the [Working with enums] section in the user guide for some
31101    /// guidelines.
31102    ///
31103    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31104    #[derive(Clone, Debug, PartialEq)]
31105    #[non_exhaustive]
31106    pub enum Type {
31107        /// Unspecified peering route type. This is the default value.
31108        Unspecified,
31109        /// Dynamic routes in the peer network.
31110        DynamicPeeringRoute,
31111        /// Static routes in the peer network.
31112        StaticPeeringRoute,
31113        /// Created, updated, and removed automatically by Google Cloud when subnets
31114        /// are created, modified, or deleted in the peer network.
31115        SubnetPeeringRoute,
31116        /// If set, the enum was initialized with an unknown value.
31117        ///
31118        /// Applications can examine the value using [Type::value] or
31119        /// [Type::name].
31120        UnknownValue(r#type::UnknownValue),
31121    }
31122
31123    #[doc(hidden)]
31124    pub mod r#type {
31125        #[allow(unused_imports)]
31126        use super::*;
31127        #[derive(Clone, Debug, PartialEq)]
31128        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31129    }
31130
31131    impl Type {
31132        /// Gets the enum value.
31133        ///
31134        /// Returns `None` if the enum contains an unknown value deserialized from
31135        /// the string representation of enums.
31136        pub fn value(&self) -> std::option::Option<i32> {
31137            match self {
31138                Self::Unspecified => std::option::Option::Some(0),
31139                Self::DynamicPeeringRoute => std::option::Option::Some(1),
31140                Self::StaticPeeringRoute => std::option::Option::Some(2),
31141                Self::SubnetPeeringRoute => std::option::Option::Some(3),
31142                Self::UnknownValue(u) => u.0.value(),
31143            }
31144        }
31145
31146        /// Gets the enum value as a string.
31147        ///
31148        /// Returns `None` if the enum contains an unknown value deserialized from
31149        /// the integer representation of enums.
31150        pub fn name(&self) -> std::option::Option<&str> {
31151            match self {
31152                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
31153                Self::DynamicPeeringRoute => std::option::Option::Some("DYNAMIC_PEERING_ROUTE"),
31154                Self::StaticPeeringRoute => std::option::Option::Some("STATIC_PEERING_ROUTE"),
31155                Self::SubnetPeeringRoute => std::option::Option::Some("SUBNET_PEERING_ROUTE"),
31156                Self::UnknownValue(u) => u.0.name(),
31157            }
31158        }
31159    }
31160
31161    impl std::default::Default for Type {
31162        fn default() -> Self {
31163            use std::convert::From;
31164            Self::from(0)
31165        }
31166    }
31167
31168    impl std::fmt::Display for Type {
31169        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31170            wkt::internal::display_enum(f, self.name(), self.value())
31171        }
31172    }
31173
31174    impl std::convert::From<i32> for Type {
31175        fn from(value: i32) -> Self {
31176            match value {
31177                0 => Self::Unspecified,
31178                1 => Self::DynamicPeeringRoute,
31179                2 => Self::StaticPeeringRoute,
31180                3 => Self::SubnetPeeringRoute,
31181                _ => Self::UnknownValue(r#type::UnknownValue(
31182                    wkt::internal::UnknownEnumValue::Integer(value),
31183                )),
31184            }
31185        }
31186    }
31187
31188    impl std::convert::From<&str> for Type {
31189        fn from(value: &str) -> Self {
31190            use std::string::ToString;
31191            match value {
31192                "TYPE_UNSPECIFIED" => Self::Unspecified,
31193                "DYNAMIC_PEERING_ROUTE" => Self::DynamicPeeringRoute,
31194                "STATIC_PEERING_ROUTE" => Self::StaticPeeringRoute,
31195                "SUBNET_PEERING_ROUTE" => Self::SubnetPeeringRoute,
31196                _ => Self::UnknownValue(r#type::UnknownValue(
31197                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31198                )),
31199            }
31200        }
31201    }
31202
31203    impl serde::ser::Serialize for Type {
31204        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31205        where
31206            S: serde::Serializer,
31207        {
31208            match self {
31209                Self::Unspecified => serializer.serialize_i32(0),
31210                Self::DynamicPeeringRoute => serializer.serialize_i32(1),
31211                Self::StaticPeeringRoute => serializer.serialize_i32(2),
31212                Self::SubnetPeeringRoute => serializer.serialize_i32(3),
31213                Self::UnknownValue(u) => u.0.serialize(serializer),
31214            }
31215        }
31216    }
31217
31218    impl<'de> serde::de::Deserialize<'de> for Type {
31219        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31220        where
31221            D: serde::Deserializer<'de>,
31222        {
31223            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
31224                ".google.cloud.vmwareengine.v1.PeeringRoute.Type",
31225            ))
31226        }
31227    }
31228
31229    /// The direction of the exchanged routes.
31230    ///
31231    /// # Working with unknown values
31232    ///
31233    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31234    /// additional enum variants at any time. Adding new variants is not considered
31235    /// a breaking change. Applications should write their code in anticipation of:
31236    ///
31237    /// - New values appearing in future releases of the client library, **and**
31238    /// - New values received dynamically, without application changes.
31239    ///
31240    /// Please consult the [Working with enums] section in the user guide for some
31241    /// guidelines.
31242    ///
31243    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31244    #[derive(Clone, Debug, PartialEq)]
31245    #[non_exhaustive]
31246    pub enum Direction {
31247        /// Unspecified exchanged routes direction. This is default.
31248        Unspecified,
31249        /// Routes imported from the peer network.
31250        Incoming,
31251        /// Routes exported to the peer network.
31252        Outgoing,
31253        /// If set, the enum was initialized with an unknown value.
31254        ///
31255        /// Applications can examine the value using [Direction::value] or
31256        /// [Direction::name].
31257        UnknownValue(direction::UnknownValue),
31258    }
31259
31260    #[doc(hidden)]
31261    pub mod direction {
31262        #[allow(unused_imports)]
31263        use super::*;
31264        #[derive(Clone, Debug, PartialEq)]
31265        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31266    }
31267
31268    impl Direction {
31269        /// Gets the enum value.
31270        ///
31271        /// Returns `None` if the enum contains an unknown value deserialized from
31272        /// the string representation of enums.
31273        pub fn value(&self) -> std::option::Option<i32> {
31274            match self {
31275                Self::Unspecified => std::option::Option::Some(0),
31276                Self::Incoming => std::option::Option::Some(1),
31277                Self::Outgoing => std::option::Option::Some(2),
31278                Self::UnknownValue(u) => u.0.value(),
31279            }
31280        }
31281
31282        /// Gets the enum value as a string.
31283        ///
31284        /// Returns `None` if the enum contains an unknown value deserialized from
31285        /// the integer representation of enums.
31286        pub fn name(&self) -> std::option::Option<&str> {
31287            match self {
31288                Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
31289                Self::Incoming => std::option::Option::Some("INCOMING"),
31290                Self::Outgoing => std::option::Option::Some("OUTGOING"),
31291                Self::UnknownValue(u) => u.0.name(),
31292            }
31293        }
31294    }
31295
31296    impl std::default::Default for Direction {
31297        fn default() -> Self {
31298            use std::convert::From;
31299            Self::from(0)
31300        }
31301    }
31302
31303    impl std::fmt::Display for Direction {
31304        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31305            wkt::internal::display_enum(f, self.name(), self.value())
31306        }
31307    }
31308
31309    impl std::convert::From<i32> for Direction {
31310        fn from(value: i32) -> Self {
31311            match value {
31312                0 => Self::Unspecified,
31313                1 => Self::Incoming,
31314                2 => Self::Outgoing,
31315                _ => Self::UnknownValue(direction::UnknownValue(
31316                    wkt::internal::UnknownEnumValue::Integer(value),
31317                )),
31318            }
31319        }
31320    }
31321
31322    impl std::convert::From<&str> for Direction {
31323        fn from(value: &str) -> Self {
31324            use std::string::ToString;
31325            match value {
31326                "DIRECTION_UNSPECIFIED" => Self::Unspecified,
31327                "INCOMING" => Self::Incoming,
31328                "OUTGOING" => Self::Outgoing,
31329                _ => Self::UnknownValue(direction::UnknownValue(
31330                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31331                )),
31332            }
31333        }
31334    }
31335
31336    impl serde::ser::Serialize for Direction {
31337        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31338        where
31339            S: serde::Serializer,
31340        {
31341            match self {
31342                Self::Unspecified => serializer.serialize_i32(0),
31343                Self::Incoming => serializer.serialize_i32(1),
31344                Self::Outgoing => serializer.serialize_i32(2),
31345                Self::UnknownValue(u) => u.0.serialize(serializer),
31346            }
31347        }
31348    }
31349
31350    impl<'de> serde::de::Deserialize<'de> for Direction {
31351        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31352        where
31353            D: serde::Deserializer<'de>,
31354        {
31355            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
31356                ".google.cloud.vmwareengine.v1.PeeringRoute.Direction",
31357            ))
31358        }
31359    }
31360}
31361
31362/// Represents a network policy resource. Network policies are regional
31363/// resources. You can use a network policy to enable or disable internet access
31364/// and external IP access. Network policies are associated with a VMware Engine
31365/// network, which might span across regions. For a given region, a network
31366/// policy applies to all private clouds in the VMware Engine network associated
31367/// with the policy.
31368#[derive(Clone, Default, PartialEq)]
31369#[non_exhaustive]
31370pub struct NetworkPolicy {
31371    /// Output only. The resource name of this network policy.
31372    /// Resource names are schemeless URIs that follow the conventions in
31373    /// <https://cloud.google.com/apis/design/resource_names>.
31374    /// For example:
31375    /// `projects/my-project/locations/us-central1/networkPolicies/my-network-policy`
31376    pub name: std::string::String,
31377
31378    /// Output only. Creation time of this resource.
31379    pub create_time: std::option::Option<wkt::Timestamp>,
31380
31381    /// Output only. Last update time of this resource.
31382    pub update_time: std::option::Option<wkt::Timestamp>,
31383
31384    /// Network service that allows VMware workloads to access the internet.
31385    pub internet_access: std::option::Option<crate::model::network_policy::NetworkService>,
31386
31387    /// Network service that allows External IP addresses to be assigned to VMware
31388    /// workloads. This service can only be enabled when `internet_access` is also
31389    /// enabled.
31390    pub external_ip: std::option::Option<crate::model::network_policy::NetworkService>,
31391
31392    /// Required. IP address range in CIDR notation used to create internet access
31393    /// and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is
31394    /// required. The range cannot overlap with any prefixes either in the consumer
31395    /// VPC network or in use by the private clouds attached to that VPC network.
31396    pub edge_services_cidr: std::string::String,
31397
31398    /// Output only. System-generated unique identifier for the resource.
31399    pub uid: std::string::String,
31400
31401    /// Optional. The relative resource name of the VMware Engine network.
31402    /// Specify the name in the following form:
31403    /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
31404    /// where `{project}` can either be a project number or a project ID.
31405    pub vmware_engine_network: std::string::String,
31406
31407    /// Optional. User-provided description for this network policy.
31408    pub description: std::string::String,
31409
31410    /// Output only. The canonical name of the VMware Engine network in the form:
31411    /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
31412    pub vmware_engine_network_canonical: std::string::String,
31413
31414    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31415}
31416
31417impl NetworkPolicy {
31418    pub fn new() -> Self {
31419        std::default::Default::default()
31420    }
31421
31422    /// Sets the value of [name][crate::model::NetworkPolicy::name].
31423    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31424        self.name = v.into();
31425        self
31426    }
31427
31428    /// Sets the value of [create_time][crate::model::NetworkPolicy::create_time].
31429    pub fn set_create_time<T>(mut self, v: T) -> Self
31430    where
31431        T: std::convert::Into<wkt::Timestamp>,
31432    {
31433        self.create_time = std::option::Option::Some(v.into());
31434        self
31435    }
31436
31437    /// Sets or clears the value of [create_time][crate::model::NetworkPolicy::create_time].
31438    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
31439    where
31440        T: std::convert::Into<wkt::Timestamp>,
31441    {
31442        self.create_time = v.map(|x| x.into());
31443        self
31444    }
31445
31446    /// Sets the value of [update_time][crate::model::NetworkPolicy::update_time].
31447    pub fn set_update_time<T>(mut self, v: T) -> Self
31448    where
31449        T: std::convert::Into<wkt::Timestamp>,
31450    {
31451        self.update_time = std::option::Option::Some(v.into());
31452        self
31453    }
31454
31455    /// Sets or clears the value of [update_time][crate::model::NetworkPolicy::update_time].
31456    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
31457    where
31458        T: std::convert::Into<wkt::Timestamp>,
31459    {
31460        self.update_time = v.map(|x| x.into());
31461        self
31462    }
31463
31464    /// Sets the value of [internet_access][crate::model::NetworkPolicy::internet_access].
31465    pub fn set_internet_access<T>(mut self, v: T) -> Self
31466    where
31467        T: std::convert::Into<crate::model::network_policy::NetworkService>,
31468    {
31469        self.internet_access = std::option::Option::Some(v.into());
31470        self
31471    }
31472
31473    /// Sets or clears the value of [internet_access][crate::model::NetworkPolicy::internet_access].
31474    pub fn set_or_clear_internet_access<T>(mut self, v: std::option::Option<T>) -> Self
31475    where
31476        T: std::convert::Into<crate::model::network_policy::NetworkService>,
31477    {
31478        self.internet_access = v.map(|x| x.into());
31479        self
31480    }
31481
31482    /// Sets the value of [external_ip][crate::model::NetworkPolicy::external_ip].
31483    pub fn set_external_ip<T>(mut self, v: T) -> Self
31484    where
31485        T: std::convert::Into<crate::model::network_policy::NetworkService>,
31486    {
31487        self.external_ip = std::option::Option::Some(v.into());
31488        self
31489    }
31490
31491    /// Sets or clears the value of [external_ip][crate::model::NetworkPolicy::external_ip].
31492    pub fn set_or_clear_external_ip<T>(mut self, v: std::option::Option<T>) -> Self
31493    where
31494        T: std::convert::Into<crate::model::network_policy::NetworkService>,
31495    {
31496        self.external_ip = v.map(|x| x.into());
31497        self
31498    }
31499
31500    /// Sets the value of [edge_services_cidr][crate::model::NetworkPolicy::edge_services_cidr].
31501    pub fn set_edge_services_cidr<T: std::convert::Into<std::string::String>>(
31502        mut self,
31503        v: T,
31504    ) -> Self {
31505        self.edge_services_cidr = v.into();
31506        self
31507    }
31508
31509    /// Sets the value of [uid][crate::model::NetworkPolicy::uid].
31510    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31511        self.uid = v.into();
31512        self
31513    }
31514
31515    /// Sets the value of [vmware_engine_network][crate::model::NetworkPolicy::vmware_engine_network].
31516    pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
31517        mut self,
31518        v: T,
31519    ) -> Self {
31520        self.vmware_engine_network = v.into();
31521        self
31522    }
31523
31524    /// Sets the value of [description][crate::model::NetworkPolicy::description].
31525    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31526        self.description = v.into();
31527        self
31528    }
31529
31530    /// Sets the value of [vmware_engine_network_canonical][crate::model::NetworkPolicy::vmware_engine_network_canonical].
31531    pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
31532        mut self,
31533        v: T,
31534    ) -> Self {
31535        self.vmware_engine_network_canonical = v.into();
31536        self
31537    }
31538}
31539
31540impl wkt::message::Message for NetworkPolicy {
31541    fn typename() -> &'static str {
31542        "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy"
31543    }
31544}
31545
31546#[doc(hidden)]
31547impl<'de> serde::de::Deserialize<'de> for NetworkPolicy {
31548    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31549    where
31550        D: serde::Deserializer<'de>,
31551    {
31552        #[allow(non_camel_case_types)]
31553        #[doc(hidden)]
31554        #[derive(PartialEq, Eq, Hash)]
31555        enum __FieldTag {
31556            __name,
31557            __create_time,
31558            __update_time,
31559            __internet_access,
31560            __external_ip,
31561            __edge_services_cidr,
31562            __uid,
31563            __vmware_engine_network,
31564            __description,
31565            __vmware_engine_network_canonical,
31566            Unknown(std::string::String),
31567        }
31568        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31569            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31570            where
31571                D: serde::Deserializer<'de>,
31572            {
31573                struct Visitor;
31574                impl<'de> serde::de::Visitor<'de> for Visitor {
31575                    type Value = __FieldTag;
31576                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31577                        formatter.write_str("a field name for NetworkPolicy")
31578                    }
31579                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31580                    where
31581                        E: serde::de::Error,
31582                    {
31583                        use std::result::Result::Ok;
31584                        use std::string::ToString;
31585                        match value {
31586                            "name" => Ok(__FieldTag::__name),
31587                            "createTime" => Ok(__FieldTag::__create_time),
31588                            "create_time" => Ok(__FieldTag::__create_time),
31589                            "updateTime" => Ok(__FieldTag::__update_time),
31590                            "update_time" => Ok(__FieldTag::__update_time),
31591                            "internetAccess" => Ok(__FieldTag::__internet_access),
31592                            "internet_access" => Ok(__FieldTag::__internet_access),
31593                            "externalIp" => Ok(__FieldTag::__external_ip),
31594                            "external_ip" => Ok(__FieldTag::__external_ip),
31595                            "edgeServicesCidr" => Ok(__FieldTag::__edge_services_cidr),
31596                            "edge_services_cidr" => Ok(__FieldTag::__edge_services_cidr),
31597                            "uid" => Ok(__FieldTag::__uid),
31598                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
31599                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
31600                            "description" => Ok(__FieldTag::__description),
31601                            "vmwareEngineNetworkCanonical" => {
31602                                Ok(__FieldTag::__vmware_engine_network_canonical)
31603                            }
31604                            "vmware_engine_network_canonical" => {
31605                                Ok(__FieldTag::__vmware_engine_network_canonical)
31606                            }
31607                            _ => Ok(__FieldTag::Unknown(value.to_string())),
31608                        }
31609                    }
31610                }
31611                deserializer.deserialize_identifier(Visitor)
31612            }
31613        }
31614        struct Visitor;
31615        impl<'de> serde::de::Visitor<'de> for Visitor {
31616            type Value = NetworkPolicy;
31617            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31618                formatter.write_str("struct NetworkPolicy")
31619            }
31620            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31621            where
31622                A: serde::de::MapAccess<'de>,
31623            {
31624                #[allow(unused_imports)]
31625                use serde::de::Error;
31626                use std::option::Option::Some;
31627                let mut fields = std::collections::HashSet::new();
31628                let mut result = Self::Value::new();
31629                while let Some(tag) = map.next_key::<__FieldTag>()? {
31630                    #[allow(clippy::match_single_binding)]
31631                    match tag {
31632                        __FieldTag::__name => {
31633                            if !fields.insert(__FieldTag::__name) {
31634                                return std::result::Result::Err(A::Error::duplicate_field(
31635                                    "multiple values for name",
31636                                ));
31637                            }
31638                            result.name = map
31639                                .next_value::<std::option::Option<std::string::String>>()?
31640                                .unwrap_or_default();
31641                        }
31642                        __FieldTag::__create_time => {
31643                            if !fields.insert(__FieldTag::__create_time) {
31644                                return std::result::Result::Err(A::Error::duplicate_field(
31645                                    "multiple values for create_time",
31646                                ));
31647                            }
31648                            result.create_time =
31649                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
31650                        }
31651                        __FieldTag::__update_time => {
31652                            if !fields.insert(__FieldTag::__update_time) {
31653                                return std::result::Result::Err(A::Error::duplicate_field(
31654                                    "multiple values for update_time",
31655                                ));
31656                            }
31657                            result.update_time =
31658                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
31659                        }
31660                        __FieldTag::__internet_access => {
31661                            if !fields.insert(__FieldTag::__internet_access) {
31662                                return std::result::Result::Err(A::Error::duplicate_field(
31663                                    "multiple values for internet_access",
31664                                ));
31665                            }
31666                            result.internet_access =
31667                                map.next_value::<std::option::Option<
31668                                    crate::model::network_policy::NetworkService,
31669                                >>()?;
31670                        }
31671                        __FieldTag::__external_ip => {
31672                            if !fields.insert(__FieldTag::__external_ip) {
31673                                return std::result::Result::Err(A::Error::duplicate_field(
31674                                    "multiple values for external_ip",
31675                                ));
31676                            }
31677                            result.external_ip =
31678                                map.next_value::<std::option::Option<
31679                                    crate::model::network_policy::NetworkService,
31680                                >>()?;
31681                        }
31682                        __FieldTag::__edge_services_cidr => {
31683                            if !fields.insert(__FieldTag::__edge_services_cidr) {
31684                                return std::result::Result::Err(A::Error::duplicate_field(
31685                                    "multiple values for edge_services_cidr",
31686                                ));
31687                            }
31688                            result.edge_services_cidr = map
31689                                .next_value::<std::option::Option<std::string::String>>()?
31690                                .unwrap_or_default();
31691                        }
31692                        __FieldTag::__uid => {
31693                            if !fields.insert(__FieldTag::__uid) {
31694                                return std::result::Result::Err(A::Error::duplicate_field(
31695                                    "multiple values for uid",
31696                                ));
31697                            }
31698                            result.uid = map
31699                                .next_value::<std::option::Option<std::string::String>>()?
31700                                .unwrap_or_default();
31701                        }
31702                        __FieldTag::__vmware_engine_network => {
31703                            if !fields.insert(__FieldTag::__vmware_engine_network) {
31704                                return std::result::Result::Err(A::Error::duplicate_field(
31705                                    "multiple values for vmware_engine_network",
31706                                ));
31707                            }
31708                            result.vmware_engine_network = map
31709                                .next_value::<std::option::Option<std::string::String>>()?
31710                                .unwrap_or_default();
31711                        }
31712                        __FieldTag::__description => {
31713                            if !fields.insert(__FieldTag::__description) {
31714                                return std::result::Result::Err(A::Error::duplicate_field(
31715                                    "multiple values for description",
31716                                ));
31717                            }
31718                            result.description = map
31719                                .next_value::<std::option::Option<std::string::String>>()?
31720                                .unwrap_or_default();
31721                        }
31722                        __FieldTag::__vmware_engine_network_canonical => {
31723                            if !fields.insert(__FieldTag::__vmware_engine_network_canonical) {
31724                                return std::result::Result::Err(A::Error::duplicate_field(
31725                                    "multiple values for vmware_engine_network_canonical",
31726                                ));
31727                            }
31728                            result.vmware_engine_network_canonical = map
31729                                .next_value::<std::option::Option<std::string::String>>()?
31730                                .unwrap_or_default();
31731                        }
31732                        __FieldTag::Unknown(key) => {
31733                            let value = map.next_value::<serde_json::Value>()?;
31734                            result._unknown_fields.insert(key, value);
31735                        }
31736                    }
31737                }
31738                std::result::Result::Ok(result)
31739            }
31740        }
31741        deserializer.deserialize_any(Visitor)
31742    }
31743}
31744
31745#[doc(hidden)]
31746impl serde::ser::Serialize for NetworkPolicy {
31747    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31748    where
31749        S: serde::ser::Serializer,
31750    {
31751        use serde::ser::SerializeMap;
31752        #[allow(unused_imports)]
31753        use std::option::Option::Some;
31754        let mut state = serializer.serialize_map(std::option::Option::None)?;
31755        if !self.name.is_empty() {
31756            state.serialize_entry("name", &self.name)?;
31757        }
31758        if self.create_time.is_some() {
31759            state.serialize_entry("createTime", &self.create_time)?;
31760        }
31761        if self.update_time.is_some() {
31762            state.serialize_entry("updateTime", &self.update_time)?;
31763        }
31764        if self.internet_access.is_some() {
31765            state.serialize_entry("internetAccess", &self.internet_access)?;
31766        }
31767        if self.external_ip.is_some() {
31768            state.serialize_entry("externalIp", &self.external_ip)?;
31769        }
31770        if !self.edge_services_cidr.is_empty() {
31771            state.serialize_entry("edgeServicesCidr", &self.edge_services_cidr)?;
31772        }
31773        if !self.uid.is_empty() {
31774            state.serialize_entry("uid", &self.uid)?;
31775        }
31776        if !self.vmware_engine_network.is_empty() {
31777            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
31778        }
31779        if !self.description.is_empty() {
31780            state.serialize_entry("description", &self.description)?;
31781        }
31782        if !self.vmware_engine_network_canonical.is_empty() {
31783            state.serialize_entry(
31784                "vmwareEngineNetworkCanonical",
31785                &self.vmware_engine_network_canonical,
31786            )?;
31787        }
31788        if !self._unknown_fields.is_empty() {
31789            for (key, value) in self._unknown_fields.iter() {
31790                state.serialize_entry(key, &value)?;
31791            }
31792        }
31793        state.end()
31794    }
31795}
31796
31797impl std::fmt::Debug for NetworkPolicy {
31798    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31799        let mut debug_struct = f.debug_struct("NetworkPolicy");
31800        debug_struct.field("name", &self.name);
31801        debug_struct.field("create_time", &self.create_time);
31802        debug_struct.field("update_time", &self.update_time);
31803        debug_struct.field("internet_access", &self.internet_access);
31804        debug_struct.field("external_ip", &self.external_ip);
31805        debug_struct.field("edge_services_cidr", &self.edge_services_cidr);
31806        debug_struct.field("uid", &self.uid);
31807        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
31808        debug_struct.field("description", &self.description);
31809        debug_struct.field(
31810            "vmware_engine_network_canonical",
31811            &self.vmware_engine_network_canonical,
31812        );
31813        if !self._unknown_fields.is_empty() {
31814            debug_struct.field("_unknown_fields", &self._unknown_fields);
31815        }
31816        debug_struct.finish()
31817    }
31818}
31819
31820/// Defines additional types related to [NetworkPolicy].
31821pub mod network_policy {
31822    #[allow(unused_imports)]
31823    use super::*;
31824
31825    /// Represents a network service that is managed by a `NetworkPolicy` resource.
31826    /// A network service provides a way to control an aspect of external access to
31827    /// VMware workloads. For example, whether the VMware workloads in the
31828    /// private clouds governed by a network policy can access or be accessed from
31829    /// the internet.
31830    #[derive(Clone, Default, PartialEq)]
31831    #[non_exhaustive]
31832    pub struct NetworkService {
31833        /// True if the service is enabled; false otherwise.
31834        pub enabled: bool,
31835
31836        /// Output only. State of the service. New values may be added to this enum
31837        /// when appropriate.
31838        pub state: crate::model::network_policy::network_service::State,
31839
31840        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31841    }
31842
31843    impl NetworkService {
31844        pub fn new() -> Self {
31845            std::default::Default::default()
31846        }
31847
31848        /// Sets the value of [enabled][crate::model::network_policy::NetworkService::enabled].
31849        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31850            self.enabled = v.into();
31851            self
31852        }
31853
31854        /// Sets the value of [state][crate::model::network_policy::NetworkService::state].
31855        pub fn set_state<
31856            T: std::convert::Into<crate::model::network_policy::network_service::State>,
31857        >(
31858            mut self,
31859            v: T,
31860        ) -> Self {
31861            self.state = v.into();
31862            self
31863        }
31864    }
31865
31866    impl wkt::message::Message for NetworkService {
31867        fn typename() -> &'static str {
31868            "type.googleapis.com/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"
31869        }
31870    }
31871
31872    #[doc(hidden)]
31873    impl<'de> serde::de::Deserialize<'de> for NetworkService {
31874        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31875        where
31876            D: serde::Deserializer<'de>,
31877        {
31878            #[allow(non_camel_case_types)]
31879            #[doc(hidden)]
31880            #[derive(PartialEq, Eq, Hash)]
31881            enum __FieldTag {
31882                __enabled,
31883                __state,
31884                Unknown(std::string::String),
31885            }
31886            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31887                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31888                where
31889                    D: serde::Deserializer<'de>,
31890                {
31891                    struct Visitor;
31892                    impl<'de> serde::de::Visitor<'de> for Visitor {
31893                        type Value = __FieldTag;
31894                        fn expecting(
31895                            &self,
31896                            formatter: &mut std::fmt::Formatter,
31897                        ) -> std::fmt::Result {
31898                            formatter.write_str("a field name for NetworkService")
31899                        }
31900                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31901                        where
31902                            E: serde::de::Error,
31903                        {
31904                            use std::result::Result::Ok;
31905                            use std::string::ToString;
31906                            match value {
31907                                "enabled" => Ok(__FieldTag::__enabled),
31908                                "state" => Ok(__FieldTag::__state),
31909                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31910                            }
31911                        }
31912                    }
31913                    deserializer.deserialize_identifier(Visitor)
31914                }
31915            }
31916            struct Visitor;
31917            impl<'de> serde::de::Visitor<'de> for Visitor {
31918                type Value = NetworkService;
31919                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31920                    formatter.write_str("struct NetworkService")
31921                }
31922                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31923                where
31924                    A: serde::de::MapAccess<'de>,
31925                {
31926                    #[allow(unused_imports)]
31927                    use serde::de::Error;
31928                    use std::option::Option::Some;
31929                    let mut fields = std::collections::HashSet::new();
31930                    let mut result = Self::Value::new();
31931                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31932                        #[allow(clippy::match_single_binding)]
31933                        match tag {
31934                            __FieldTag::__enabled => {
31935                                if !fields.insert(__FieldTag::__enabled) {
31936                                    return std::result::Result::Err(A::Error::duplicate_field(
31937                                        "multiple values for enabled",
31938                                    ));
31939                                }
31940                                result.enabled = map
31941                                    .next_value::<std::option::Option<bool>>()?
31942                                    .unwrap_or_default();
31943                            }
31944                            __FieldTag::__state => {
31945                                if !fields.insert(__FieldTag::__state) {
31946                                    return std::result::Result::Err(A::Error::duplicate_field(
31947                                        "multiple values for state",
31948                                    ));
31949                                }
31950                                result.state = map
31951                                    .next_value::<std::option::Option<
31952                                        crate::model::network_policy::network_service::State,
31953                                    >>()?
31954                                    .unwrap_or_default();
31955                            }
31956                            __FieldTag::Unknown(key) => {
31957                                let value = map.next_value::<serde_json::Value>()?;
31958                                result._unknown_fields.insert(key, value);
31959                            }
31960                        }
31961                    }
31962                    std::result::Result::Ok(result)
31963                }
31964            }
31965            deserializer.deserialize_any(Visitor)
31966        }
31967    }
31968
31969    #[doc(hidden)]
31970    impl serde::ser::Serialize for NetworkService {
31971        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31972        where
31973            S: serde::ser::Serializer,
31974        {
31975            use serde::ser::SerializeMap;
31976            #[allow(unused_imports)]
31977            use std::option::Option::Some;
31978            let mut state = serializer.serialize_map(std::option::Option::None)?;
31979            if !wkt::internal::is_default(&self.enabled) {
31980                state.serialize_entry("enabled", &self.enabled)?;
31981            }
31982            if !wkt::internal::is_default(&self.state) {
31983                state.serialize_entry("state", &self.state)?;
31984            }
31985            if !self._unknown_fields.is_empty() {
31986                for (key, value) in self._unknown_fields.iter() {
31987                    state.serialize_entry(key, &value)?;
31988                }
31989            }
31990            state.end()
31991        }
31992    }
31993
31994    impl std::fmt::Debug for NetworkService {
31995        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31996            let mut debug_struct = f.debug_struct("NetworkService");
31997            debug_struct.field("enabled", &self.enabled);
31998            debug_struct.field("state", &self.state);
31999            if !self._unknown_fields.is_empty() {
32000                debug_struct.field("_unknown_fields", &self._unknown_fields);
32001            }
32002            debug_struct.finish()
32003        }
32004    }
32005
32006    /// Defines additional types related to [NetworkService].
32007    pub mod network_service {
32008        #[allow(unused_imports)]
32009        use super::*;
32010
32011        /// Enum State defines possible states of a network policy controlled
32012        /// service.
32013        ///
32014        /// # Working with unknown values
32015        ///
32016        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32017        /// additional enum variants at any time. Adding new variants is not considered
32018        /// a breaking change. Applications should write their code in anticipation of:
32019        ///
32020        /// - New values appearing in future releases of the client library, **and**
32021        /// - New values received dynamically, without application changes.
32022        ///
32023        /// Please consult the [Working with enums] section in the user guide for some
32024        /// guidelines.
32025        ///
32026        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32027        #[derive(Clone, Debug, PartialEq)]
32028        #[non_exhaustive]
32029        pub enum State {
32030            /// Unspecified service state. This is the default value.
32031            Unspecified,
32032            /// Service is not provisioned.
32033            Unprovisioned,
32034            /// Service is in the process of being provisioned/deprovisioned.
32035            Reconciling,
32036            /// Service is active.
32037            Active,
32038            /// If set, the enum was initialized with an unknown value.
32039            ///
32040            /// Applications can examine the value using [State::value] or
32041            /// [State::name].
32042            UnknownValue(state::UnknownValue),
32043        }
32044
32045        #[doc(hidden)]
32046        pub mod state {
32047            #[allow(unused_imports)]
32048            use super::*;
32049            #[derive(Clone, Debug, PartialEq)]
32050            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32051        }
32052
32053        impl State {
32054            /// Gets the enum value.
32055            ///
32056            /// Returns `None` if the enum contains an unknown value deserialized from
32057            /// the string representation of enums.
32058            pub fn value(&self) -> std::option::Option<i32> {
32059                match self {
32060                    Self::Unspecified => std::option::Option::Some(0),
32061                    Self::Unprovisioned => std::option::Option::Some(1),
32062                    Self::Reconciling => std::option::Option::Some(2),
32063                    Self::Active => std::option::Option::Some(3),
32064                    Self::UnknownValue(u) => u.0.value(),
32065                }
32066            }
32067
32068            /// Gets the enum value as a string.
32069            ///
32070            /// Returns `None` if the enum contains an unknown value deserialized from
32071            /// the integer representation of enums.
32072            pub fn name(&self) -> std::option::Option<&str> {
32073                match self {
32074                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
32075                    Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
32076                    Self::Reconciling => std::option::Option::Some("RECONCILING"),
32077                    Self::Active => std::option::Option::Some("ACTIVE"),
32078                    Self::UnknownValue(u) => u.0.name(),
32079                }
32080            }
32081        }
32082
32083        impl std::default::Default for State {
32084            fn default() -> Self {
32085                use std::convert::From;
32086                Self::from(0)
32087            }
32088        }
32089
32090        impl std::fmt::Display for State {
32091            fn fmt(
32092                &self,
32093                f: &mut std::fmt::Formatter<'_>,
32094            ) -> std::result::Result<(), std::fmt::Error> {
32095                wkt::internal::display_enum(f, self.name(), self.value())
32096            }
32097        }
32098
32099        impl std::convert::From<i32> for State {
32100            fn from(value: i32) -> Self {
32101                match value {
32102                    0 => Self::Unspecified,
32103                    1 => Self::Unprovisioned,
32104                    2 => Self::Reconciling,
32105                    3 => Self::Active,
32106                    _ => Self::UnknownValue(state::UnknownValue(
32107                        wkt::internal::UnknownEnumValue::Integer(value),
32108                    )),
32109                }
32110            }
32111        }
32112
32113        impl std::convert::From<&str> for State {
32114            fn from(value: &str) -> Self {
32115                use std::string::ToString;
32116                match value {
32117                    "STATE_UNSPECIFIED" => Self::Unspecified,
32118                    "UNPROVISIONED" => Self::Unprovisioned,
32119                    "RECONCILING" => Self::Reconciling,
32120                    "ACTIVE" => Self::Active,
32121                    _ => Self::UnknownValue(state::UnknownValue(
32122                        wkt::internal::UnknownEnumValue::String(value.to_string()),
32123                    )),
32124                }
32125            }
32126        }
32127
32128        impl serde::ser::Serialize for State {
32129            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32130            where
32131                S: serde::Serializer,
32132            {
32133                match self {
32134                    Self::Unspecified => serializer.serialize_i32(0),
32135                    Self::Unprovisioned => serializer.serialize_i32(1),
32136                    Self::Reconciling => serializer.serialize_i32(2),
32137                    Self::Active => serializer.serialize_i32(3),
32138                    Self::UnknownValue(u) => u.0.serialize(serializer),
32139                }
32140            }
32141        }
32142
32143        impl<'de> serde::de::Deserialize<'de> for State {
32144            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32145            where
32146                D: serde::Deserializer<'de>,
32147            {
32148                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
32149                    ".google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State",
32150                ))
32151            }
32152        }
32153    }
32154}
32155
32156/// Represents a binding between a network and the management DNS zone.
32157/// A management DNS zone is the Cloud DNS cross-project binding zone that
32158/// VMware Engine creates for each private cloud. It contains FQDNs and
32159/// corresponding IP addresses for the private cloud's ESXi hosts and management
32160/// VM appliances like vCenter and NSX Manager.
32161#[derive(Clone, Default, PartialEq)]
32162#[non_exhaustive]
32163pub struct ManagementDnsZoneBinding {
32164    /// Output only. The resource name of this binding.
32165    /// Resource names are schemeless URIs that follow the conventions in
32166    /// <https://cloud.google.com/apis/design/resource_names>.
32167    /// For example:
32168    /// `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding`
32169    pub name: std::string::String,
32170
32171    /// Output only. Creation time of this resource.
32172    pub create_time: std::option::Option<wkt::Timestamp>,
32173
32174    /// Output only. Last update time of this resource.
32175    pub update_time: std::option::Option<wkt::Timestamp>,
32176
32177    /// Output only. The state of the resource.
32178    pub state: crate::model::management_dns_zone_binding::State,
32179
32180    /// User-provided description for this resource.
32181    pub description: std::string::String,
32182
32183    /// Output only. System-generated unique identifier for the resource.
32184    pub uid: std::string::String,
32185
32186    /// Required. The relative resource name of the network to bind to the
32187    /// management DNS zone. This network can be a consumer VPC network or a
32188    /// VMware engine network.
32189    pub bind_network: std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
32190
32191    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32192}
32193
32194impl ManagementDnsZoneBinding {
32195    pub fn new() -> Self {
32196        std::default::Default::default()
32197    }
32198
32199    /// Sets the value of [name][crate::model::ManagementDnsZoneBinding::name].
32200    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32201        self.name = v.into();
32202        self
32203    }
32204
32205    /// Sets the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
32206    pub fn set_create_time<T>(mut self, v: T) -> Self
32207    where
32208        T: std::convert::Into<wkt::Timestamp>,
32209    {
32210        self.create_time = std::option::Option::Some(v.into());
32211        self
32212    }
32213
32214    /// Sets or clears the value of [create_time][crate::model::ManagementDnsZoneBinding::create_time].
32215    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
32216    where
32217        T: std::convert::Into<wkt::Timestamp>,
32218    {
32219        self.create_time = v.map(|x| x.into());
32220        self
32221    }
32222
32223    /// Sets the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
32224    pub fn set_update_time<T>(mut self, v: T) -> Self
32225    where
32226        T: std::convert::Into<wkt::Timestamp>,
32227    {
32228        self.update_time = std::option::Option::Some(v.into());
32229        self
32230    }
32231
32232    /// Sets or clears the value of [update_time][crate::model::ManagementDnsZoneBinding::update_time].
32233    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
32234    where
32235        T: std::convert::Into<wkt::Timestamp>,
32236    {
32237        self.update_time = v.map(|x| x.into());
32238        self
32239    }
32240
32241    /// Sets the value of [state][crate::model::ManagementDnsZoneBinding::state].
32242    pub fn set_state<T: std::convert::Into<crate::model::management_dns_zone_binding::State>>(
32243        mut self,
32244        v: T,
32245    ) -> Self {
32246        self.state = v.into();
32247        self
32248    }
32249
32250    /// Sets the value of [description][crate::model::ManagementDnsZoneBinding::description].
32251    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32252        self.description = v.into();
32253        self
32254    }
32255
32256    /// Sets the value of [uid][crate::model::ManagementDnsZoneBinding::uid].
32257    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32258        self.uid = v.into();
32259        self
32260    }
32261
32262    /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network].
32263    ///
32264    /// Note that all the setters affecting `bind_network` are mutually
32265    /// exclusive.
32266    pub fn set_bind_network<
32267        T: std::convert::Into<
32268                std::option::Option<crate::model::management_dns_zone_binding::BindNetwork>,
32269            >,
32270    >(
32271        mut self,
32272        v: T,
32273    ) -> Self {
32274        self.bind_network = v.into();
32275        self
32276    }
32277
32278    /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
32279    /// if it holds a `VpcNetwork`, `None` if the field is not set or
32280    /// holds a different branch.
32281    pub fn vpc_network(&self) -> std::option::Option<&std::string::String> {
32282        #[allow(unreachable_patterns)]
32283        self.bind_network.as_ref().and_then(|v| match v {
32284            crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v) => {
32285                std::option::Option::Some(v)
32286            }
32287            _ => std::option::Option::None,
32288        })
32289    }
32290
32291    /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
32292    /// to hold a `VpcNetwork`.
32293    ///
32294    /// Note that all the setters affecting `bind_network` are
32295    /// mutually exclusive.
32296    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32297        self.bind_network = std::option::Option::Some(
32298            crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(v.into()),
32299        );
32300        self
32301    }
32302
32303    /// The value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
32304    /// if it holds a `VmwareEngineNetwork`, `None` if the field is not set or
32305    /// holds a different branch.
32306    pub fn vmware_engine_network(&self) -> std::option::Option<&std::string::String> {
32307        #[allow(unreachable_patterns)]
32308        self.bind_network.as_ref().and_then(|v| match v {
32309            crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v) => {
32310                std::option::Option::Some(v)
32311            }
32312            _ => std::option::Option::None,
32313        })
32314    }
32315
32316    /// Sets the value of [bind_network][crate::model::ManagementDnsZoneBinding::bind_network]
32317    /// to hold a `VmwareEngineNetwork`.
32318    ///
32319    /// Note that all the setters affecting `bind_network` are
32320    /// mutually exclusive.
32321    pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
32322        mut self,
32323        v: T,
32324    ) -> Self {
32325        self.bind_network = std::option::Option::Some(
32326            crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(v.into()),
32327        );
32328        self
32329    }
32330}
32331
32332impl wkt::message::Message for ManagementDnsZoneBinding {
32333    fn typename() -> &'static str {
32334        "type.googleapis.com/google.cloud.vmwareengine.v1.ManagementDnsZoneBinding"
32335    }
32336}
32337
32338#[doc(hidden)]
32339impl<'de> serde::de::Deserialize<'de> for ManagementDnsZoneBinding {
32340    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32341    where
32342        D: serde::Deserializer<'de>,
32343    {
32344        #[allow(non_camel_case_types)]
32345        #[doc(hidden)]
32346        #[derive(PartialEq, Eq, Hash)]
32347        enum __FieldTag {
32348            __name,
32349            __create_time,
32350            __update_time,
32351            __state,
32352            __description,
32353            __vpc_network,
32354            __vmware_engine_network,
32355            __uid,
32356            Unknown(std::string::String),
32357        }
32358        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
32359            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32360            where
32361                D: serde::Deserializer<'de>,
32362            {
32363                struct Visitor;
32364                impl<'de> serde::de::Visitor<'de> for Visitor {
32365                    type Value = __FieldTag;
32366                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32367                        formatter.write_str("a field name for ManagementDnsZoneBinding")
32368                    }
32369                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
32370                    where
32371                        E: serde::de::Error,
32372                    {
32373                        use std::result::Result::Ok;
32374                        use std::string::ToString;
32375                        match value {
32376                            "name" => Ok(__FieldTag::__name),
32377                            "createTime" => Ok(__FieldTag::__create_time),
32378                            "create_time" => Ok(__FieldTag::__create_time),
32379                            "updateTime" => Ok(__FieldTag::__update_time),
32380                            "update_time" => Ok(__FieldTag::__update_time),
32381                            "state" => Ok(__FieldTag::__state),
32382                            "description" => Ok(__FieldTag::__description),
32383                            "vpcNetwork" => Ok(__FieldTag::__vpc_network),
32384                            "vpc_network" => Ok(__FieldTag::__vpc_network),
32385                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
32386                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
32387                            "uid" => Ok(__FieldTag::__uid),
32388                            _ => Ok(__FieldTag::Unknown(value.to_string())),
32389                        }
32390                    }
32391                }
32392                deserializer.deserialize_identifier(Visitor)
32393            }
32394        }
32395        struct Visitor;
32396        impl<'de> serde::de::Visitor<'de> for Visitor {
32397            type Value = ManagementDnsZoneBinding;
32398            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32399                formatter.write_str("struct ManagementDnsZoneBinding")
32400            }
32401            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
32402            where
32403                A: serde::de::MapAccess<'de>,
32404            {
32405                #[allow(unused_imports)]
32406                use serde::de::Error;
32407                use std::option::Option::Some;
32408                let mut fields = std::collections::HashSet::new();
32409                let mut result = Self::Value::new();
32410                while let Some(tag) = map.next_key::<__FieldTag>()? {
32411                    #[allow(clippy::match_single_binding)]
32412                    match tag {
32413                        __FieldTag::__name => {
32414                            if !fields.insert(__FieldTag::__name) {
32415                                return std::result::Result::Err(A::Error::duplicate_field(
32416                                    "multiple values for name",
32417                                ));
32418                            }
32419                            result.name = map
32420                                .next_value::<std::option::Option<std::string::String>>()?
32421                                .unwrap_or_default();
32422                        }
32423                        __FieldTag::__create_time => {
32424                            if !fields.insert(__FieldTag::__create_time) {
32425                                return std::result::Result::Err(A::Error::duplicate_field(
32426                                    "multiple values for create_time",
32427                                ));
32428                            }
32429                            result.create_time =
32430                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32431                        }
32432                        __FieldTag::__update_time => {
32433                            if !fields.insert(__FieldTag::__update_time) {
32434                                return std::result::Result::Err(A::Error::duplicate_field(
32435                                    "multiple values for update_time",
32436                                ));
32437                            }
32438                            result.update_time =
32439                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32440                        }
32441                        __FieldTag::__state => {
32442                            if !fields.insert(__FieldTag::__state) {
32443                                return std::result::Result::Err(A::Error::duplicate_field(
32444                                    "multiple values for state",
32445                                ));
32446                            }
32447                            result.state = map
32448                                .next_value::<std::option::Option<
32449                                    crate::model::management_dns_zone_binding::State,
32450                                >>()?
32451                                .unwrap_or_default();
32452                        }
32453                        __FieldTag::__description => {
32454                            if !fields.insert(__FieldTag::__description) {
32455                                return std::result::Result::Err(A::Error::duplicate_field(
32456                                    "multiple values for description",
32457                                ));
32458                            }
32459                            result.description = map
32460                                .next_value::<std::option::Option<std::string::String>>()?
32461                                .unwrap_or_default();
32462                        }
32463                        __FieldTag::__vpc_network => {
32464                            if !fields.insert(__FieldTag::__vpc_network) {
32465                                return std::result::Result::Err(A::Error::duplicate_field(
32466                                    "multiple values for vpc_network",
32467                                ));
32468                            }
32469                            if result.bind_network.is_some() {
32470                                return std::result::Result::Err(A::Error::duplicate_field(
32471                                    "multiple values for `bind_network`, a oneof with full ID .google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.vpc_network, latest field was vpcNetwork",
32472                                ));
32473                            }
32474                            result.bind_network = std::option::Option::Some(
32475                                crate::model::management_dns_zone_binding::BindNetwork::VpcNetwork(
32476                                    map.next_value::<std::option::Option<std::string::String>>()?
32477                                        .unwrap_or_default(),
32478                                ),
32479                            );
32480                        }
32481                        __FieldTag::__vmware_engine_network => {
32482                            if !fields.insert(__FieldTag::__vmware_engine_network) {
32483                                return std::result::Result::Err(A::Error::duplicate_field(
32484                                    "multiple values for vmware_engine_network",
32485                                ));
32486                            }
32487                            if result.bind_network.is_some() {
32488                                return std::result::Result::Err(A::Error::duplicate_field(
32489                                    "multiple values for `bind_network`, a oneof with full ID .google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.vmware_engine_network, latest field was vmwareEngineNetwork",
32490                                ));
32491                            }
32492                            result.bind_network = std::option::Option::Some(
32493                                crate::model::management_dns_zone_binding::BindNetwork::VmwareEngineNetwork(
32494                                    map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
32495                                ),
32496                            );
32497                        }
32498                        __FieldTag::__uid => {
32499                            if !fields.insert(__FieldTag::__uid) {
32500                                return std::result::Result::Err(A::Error::duplicate_field(
32501                                    "multiple values for uid",
32502                                ));
32503                            }
32504                            result.uid = map
32505                                .next_value::<std::option::Option<std::string::String>>()?
32506                                .unwrap_or_default();
32507                        }
32508                        __FieldTag::Unknown(key) => {
32509                            let value = map.next_value::<serde_json::Value>()?;
32510                            result._unknown_fields.insert(key, value);
32511                        }
32512                    }
32513                }
32514                std::result::Result::Ok(result)
32515            }
32516        }
32517        deserializer.deserialize_any(Visitor)
32518    }
32519}
32520
32521#[doc(hidden)]
32522impl serde::ser::Serialize for ManagementDnsZoneBinding {
32523    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32524    where
32525        S: serde::ser::Serializer,
32526    {
32527        use serde::ser::SerializeMap;
32528        #[allow(unused_imports)]
32529        use std::option::Option::Some;
32530        let mut state = serializer.serialize_map(std::option::Option::None)?;
32531        if !self.name.is_empty() {
32532            state.serialize_entry("name", &self.name)?;
32533        }
32534        if self.create_time.is_some() {
32535            state.serialize_entry("createTime", &self.create_time)?;
32536        }
32537        if self.update_time.is_some() {
32538            state.serialize_entry("updateTime", &self.update_time)?;
32539        }
32540        if !wkt::internal::is_default(&self.state) {
32541            state.serialize_entry("state", &self.state)?;
32542        }
32543        if !self.description.is_empty() {
32544            state.serialize_entry("description", &self.description)?;
32545        }
32546        if let Some(value) = self.vpc_network() {
32547            state.serialize_entry("vpcNetwork", value)?;
32548        }
32549        if let Some(value) = self.vmware_engine_network() {
32550            state.serialize_entry("vmwareEngineNetwork", value)?;
32551        }
32552        if !self.uid.is_empty() {
32553            state.serialize_entry("uid", &self.uid)?;
32554        }
32555        if !self._unknown_fields.is_empty() {
32556            for (key, value) in self._unknown_fields.iter() {
32557                state.serialize_entry(key, &value)?;
32558            }
32559        }
32560        state.end()
32561    }
32562}
32563
32564impl std::fmt::Debug for ManagementDnsZoneBinding {
32565    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32566        let mut debug_struct = f.debug_struct("ManagementDnsZoneBinding");
32567        debug_struct.field("name", &self.name);
32568        debug_struct.field("create_time", &self.create_time);
32569        debug_struct.field("update_time", &self.update_time);
32570        debug_struct.field("state", &self.state);
32571        debug_struct.field("description", &self.description);
32572        debug_struct.field("uid", &self.uid);
32573        debug_struct.field("bind_network", &self.bind_network);
32574        if !self._unknown_fields.is_empty() {
32575            debug_struct.field("_unknown_fields", &self._unknown_fields);
32576        }
32577        debug_struct.finish()
32578    }
32579}
32580
32581/// Defines additional types related to [ManagementDnsZoneBinding].
32582pub mod management_dns_zone_binding {
32583    #[allow(unused_imports)]
32584    use super::*;
32585
32586    /// Enum State defines possible states of binding between the consumer VPC
32587    /// network and the management DNS zone.
32588    ///
32589    /// # Working with unknown values
32590    ///
32591    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32592    /// additional enum variants at any time. Adding new variants is not considered
32593    /// a breaking change. Applications should write their code in anticipation of:
32594    ///
32595    /// - New values appearing in future releases of the client library, **and**
32596    /// - New values received dynamically, without application changes.
32597    ///
32598    /// Please consult the [Working with enums] section in the user guide for some
32599    /// guidelines.
32600    ///
32601    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32602    #[derive(Clone, Debug, PartialEq)]
32603    #[non_exhaustive]
32604    pub enum State {
32605        /// The default value. This value should never be used.
32606        Unspecified,
32607        /// The binding is ready.
32608        Active,
32609        /// The binding is being created.
32610        Creating,
32611        /// The binding is being updated.
32612        Updating,
32613        /// The binding is being deleted.
32614        Deleting,
32615        /// The binding has failed.
32616        Failed,
32617        /// If set, the enum was initialized with an unknown value.
32618        ///
32619        /// Applications can examine the value using [State::value] or
32620        /// [State::name].
32621        UnknownValue(state::UnknownValue),
32622    }
32623
32624    #[doc(hidden)]
32625    pub mod state {
32626        #[allow(unused_imports)]
32627        use super::*;
32628        #[derive(Clone, Debug, PartialEq)]
32629        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32630    }
32631
32632    impl State {
32633        /// Gets the enum value.
32634        ///
32635        /// Returns `None` if the enum contains an unknown value deserialized from
32636        /// the string representation of enums.
32637        pub fn value(&self) -> std::option::Option<i32> {
32638            match self {
32639                Self::Unspecified => std::option::Option::Some(0),
32640                Self::Active => std::option::Option::Some(1),
32641                Self::Creating => std::option::Option::Some(2),
32642                Self::Updating => std::option::Option::Some(3),
32643                Self::Deleting => std::option::Option::Some(4),
32644                Self::Failed => std::option::Option::Some(5),
32645                Self::UnknownValue(u) => u.0.value(),
32646            }
32647        }
32648
32649        /// Gets the enum value as a string.
32650        ///
32651        /// Returns `None` if the enum contains an unknown value deserialized from
32652        /// the integer representation of enums.
32653        pub fn name(&self) -> std::option::Option<&str> {
32654            match self {
32655                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
32656                Self::Active => std::option::Option::Some("ACTIVE"),
32657                Self::Creating => std::option::Option::Some("CREATING"),
32658                Self::Updating => std::option::Option::Some("UPDATING"),
32659                Self::Deleting => std::option::Option::Some("DELETING"),
32660                Self::Failed => std::option::Option::Some("FAILED"),
32661                Self::UnknownValue(u) => u.0.name(),
32662            }
32663        }
32664    }
32665
32666    impl std::default::Default for State {
32667        fn default() -> Self {
32668            use std::convert::From;
32669            Self::from(0)
32670        }
32671    }
32672
32673    impl std::fmt::Display for State {
32674        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32675            wkt::internal::display_enum(f, self.name(), self.value())
32676        }
32677    }
32678
32679    impl std::convert::From<i32> for State {
32680        fn from(value: i32) -> Self {
32681            match value {
32682                0 => Self::Unspecified,
32683                1 => Self::Active,
32684                2 => Self::Creating,
32685                3 => Self::Updating,
32686                4 => Self::Deleting,
32687                5 => Self::Failed,
32688                _ => Self::UnknownValue(state::UnknownValue(
32689                    wkt::internal::UnknownEnumValue::Integer(value),
32690                )),
32691            }
32692        }
32693    }
32694
32695    impl std::convert::From<&str> for State {
32696        fn from(value: &str) -> Self {
32697            use std::string::ToString;
32698            match value {
32699                "STATE_UNSPECIFIED" => Self::Unspecified,
32700                "ACTIVE" => Self::Active,
32701                "CREATING" => Self::Creating,
32702                "UPDATING" => Self::Updating,
32703                "DELETING" => Self::Deleting,
32704                "FAILED" => Self::Failed,
32705                _ => Self::UnknownValue(state::UnknownValue(
32706                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32707                )),
32708            }
32709        }
32710    }
32711
32712    impl serde::ser::Serialize for State {
32713        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32714        where
32715            S: serde::Serializer,
32716        {
32717            match self {
32718                Self::Unspecified => serializer.serialize_i32(0),
32719                Self::Active => serializer.serialize_i32(1),
32720                Self::Creating => serializer.serialize_i32(2),
32721                Self::Updating => serializer.serialize_i32(3),
32722                Self::Deleting => serializer.serialize_i32(4),
32723                Self::Failed => serializer.serialize_i32(5),
32724                Self::UnknownValue(u) => u.0.serialize(serializer),
32725            }
32726        }
32727    }
32728
32729    impl<'de> serde::de::Deserialize<'de> for State {
32730        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32731        where
32732            D: serde::Deserializer<'de>,
32733        {
32734            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
32735                ".google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State",
32736            ))
32737        }
32738    }
32739
32740    /// Required. The relative resource name of the network to bind to the
32741    /// management DNS zone. This network can be a consumer VPC network or a
32742    /// VMware engine network.
32743    #[derive(Clone, Debug, PartialEq)]
32744    #[non_exhaustive]
32745    pub enum BindNetwork {
32746        /// Network to bind is a standard consumer VPC.
32747        /// Specify the name in the following form for consumer
32748        /// VPC network: `projects/{project}/global/networks/{network_id}`.
32749        /// `{project}` can either be a project number or a project ID.
32750        VpcNetwork(std::string::String),
32751        /// Network to bind is a VMware Engine network.
32752        /// Specify the name in the following form for VMware engine network:
32753        /// `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`.
32754        /// `{project}` can either be a project number or a project ID.
32755        VmwareEngineNetwork(std::string::String),
32756    }
32757}
32758
32759/// VMware Engine network resource that provides connectivity for VMware Engine
32760/// private clouds.
32761#[derive(Clone, Default, PartialEq)]
32762#[non_exhaustive]
32763pub struct VmwareEngineNetwork {
32764    /// Output only. The resource name of the VMware Engine network.
32765    /// Resource names are schemeless URIs that follow the conventions in
32766    /// <https://cloud.google.com/apis/design/resource_names>.
32767    /// For example:
32768    /// `projects/my-project/locations/global/vmwareEngineNetworks/my-network`
32769    pub name: std::string::String,
32770
32771    /// Output only. Creation time of this resource.
32772    pub create_time: std::option::Option<wkt::Timestamp>,
32773
32774    /// Output only. Last update time of this resource.
32775    pub update_time: std::option::Option<wkt::Timestamp>,
32776
32777    /// User-provided description for this VMware Engine network.
32778    pub description: std::string::String,
32779
32780    /// Output only. VMware Engine service VPC networks that provide connectivity
32781    /// from a private cloud to customer projects, the internet, and other Google
32782    /// Cloud services.
32783    pub vpc_networks: std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
32784
32785    /// Output only. State of the VMware Engine network.
32786    pub state: crate::model::vmware_engine_network::State,
32787
32788    /// Required. VMware Engine network type.
32789    pub r#type: crate::model::vmware_engine_network::Type,
32790
32791    /// Output only. System-generated unique identifier for the resource.
32792    pub uid: std::string::String,
32793
32794    /// Checksum that may be sent on update and delete requests to ensure that the
32795    /// user-provided value is up to date before the server processes a request.
32796    /// The server computes checksums based on the value of other fields in the
32797    /// request.
32798    pub etag: std::string::String,
32799
32800    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32801}
32802
32803impl VmwareEngineNetwork {
32804    pub fn new() -> Self {
32805        std::default::Default::default()
32806    }
32807
32808    /// Sets the value of [name][crate::model::VmwareEngineNetwork::name].
32809    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32810        self.name = v.into();
32811        self
32812    }
32813
32814    /// Sets the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
32815    pub fn set_create_time<T>(mut self, v: T) -> Self
32816    where
32817        T: std::convert::Into<wkt::Timestamp>,
32818    {
32819        self.create_time = std::option::Option::Some(v.into());
32820        self
32821    }
32822
32823    /// Sets or clears the value of [create_time][crate::model::VmwareEngineNetwork::create_time].
32824    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
32825    where
32826        T: std::convert::Into<wkt::Timestamp>,
32827    {
32828        self.create_time = v.map(|x| x.into());
32829        self
32830    }
32831
32832    /// Sets the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
32833    pub fn set_update_time<T>(mut self, v: T) -> Self
32834    where
32835        T: std::convert::Into<wkt::Timestamp>,
32836    {
32837        self.update_time = std::option::Option::Some(v.into());
32838        self
32839    }
32840
32841    /// Sets or clears the value of [update_time][crate::model::VmwareEngineNetwork::update_time].
32842    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
32843    where
32844        T: std::convert::Into<wkt::Timestamp>,
32845    {
32846        self.update_time = v.map(|x| x.into());
32847        self
32848    }
32849
32850    /// Sets the value of [description][crate::model::VmwareEngineNetwork::description].
32851    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32852        self.description = v.into();
32853        self
32854    }
32855
32856    /// Sets the value of [vpc_networks][crate::model::VmwareEngineNetwork::vpc_networks].
32857    pub fn set_vpc_networks<T, V>(mut self, v: T) -> Self
32858    where
32859        T: std::iter::IntoIterator<Item = V>,
32860        V: std::convert::Into<crate::model::vmware_engine_network::VpcNetwork>,
32861    {
32862        use std::iter::Iterator;
32863        self.vpc_networks = v.into_iter().map(|i| i.into()).collect();
32864        self
32865    }
32866
32867    /// Sets the value of [state][crate::model::VmwareEngineNetwork::state].
32868    pub fn set_state<T: std::convert::Into<crate::model::vmware_engine_network::State>>(
32869        mut self,
32870        v: T,
32871    ) -> Self {
32872        self.state = v.into();
32873        self
32874    }
32875
32876    /// Sets the value of [r#type][crate::model::VmwareEngineNetwork::type].
32877    pub fn set_type<T: std::convert::Into<crate::model::vmware_engine_network::Type>>(
32878        mut self,
32879        v: T,
32880    ) -> Self {
32881        self.r#type = v.into();
32882        self
32883    }
32884
32885    /// Sets the value of [uid][crate::model::VmwareEngineNetwork::uid].
32886    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32887        self.uid = v.into();
32888        self
32889    }
32890
32891    /// Sets the value of [etag][crate::model::VmwareEngineNetwork::etag].
32892    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32893        self.etag = v.into();
32894        self
32895    }
32896}
32897
32898impl wkt::message::Message for VmwareEngineNetwork {
32899    fn typename() -> &'static str {
32900        "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork"
32901    }
32902}
32903
32904#[doc(hidden)]
32905impl<'de> serde::de::Deserialize<'de> for VmwareEngineNetwork {
32906    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32907    where
32908        D: serde::Deserializer<'de>,
32909    {
32910        #[allow(non_camel_case_types)]
32911        #[doc(hidden)]
32912        #[derive(PartialEq, Eq, Hash)]
32913        enum __FieldTag {
32914            __name,
32915            __create_time,
32916            __update_time,
32917            __description,
32918            __vpc_networks,
32919            __state,
32920            __type,
32921            __uid,
32922            __etag,
32923            Unknown(std::string::String),
32924        }
32925        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
32926            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32927            where
32928                D: serde::Deserializer<'de>,
32929            {
32930                struct Visitor;
32931                impl<'de> serde::de::Visitor<'de> for Visitor {
32932                    type Value = __FieldTag;
32933                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32934                        formatter.write_str("a field name for VmwareEngineNetwork")
32935                    }
32936                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
32937                    where
32938                        E: serde::de::Error,
32939                    {
32940                        use std::result::Result::Ok;
32941                        use std::string::ToString;
32942                        match value {
32943                            "name" => Ok(__FieldTag::__name),
32944                            "createTime" => Ok(__FieldTag::__create_time),
32945                            "create_time" => Ok(__FieldTag::__create_time),
32946                            "updateTime" => Ok(__FieldTag::__update_time),
32947                            "update_time" => Ok(__FieldTag::__update_time),
32948                            "description" => Ok(__FieldTag::__description),
32949                            "vpcNetworks" => Ok(__FieldTag::__vpc_networks),
32950                            "vpc_networks" => Ok(__FieldTag::__vpc_networks),
32951                            "state" => Ok(__FieldTag::__state),
32952                            "type" => Ok(__FieldTag::__type),
32953                            "uid" => Ok(__FieldTag::__uid),
32954                            "etag" => Ok(__FieldTag::__etag),
32955                            _ => Ok(__FieldTag::Unknown(value.to_string())),
32956                        }
32957                    }
32958                }
32959                deserializer.deserialize_identifier(Visitor)
32960            }
32961        }
32962        struct Visitor;
32963        impl<'de> serde::de::Visitor<'de> for Visitor {
32964            type Value = VmwareEngineNetwork;
32965            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32966                formatter.write_str("struct VmwareEngineNetwork")
32967            }
32968            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
32969            where
32970                A: serde::de::MapAccess<'de>,
32971            {
32972                #[allow(unused_imports)]
32973                use serde::de::Error;
32974                use std::option::Option::Some;
32975                let mut fields = std::collections::HashSet::new();
32976                let mut result = Self::Value::new();
32977                while let Some(tag) = map.next_key::<__FieldTag>()? {
32978                    #[allow(clippy::match_single_binding)]
32979                    match tag {
32980                        __FieldTag::__name => {
32981                            if !fields.insert(__FieldTag::__name) {
32982                                return std::result::Result::Err(A::Error::duplicate_field(
32983                                    "multiple values for name",
32984                                ));
32985                            }
32986                            result.name = map
32987                                .next_value::<std::option::Option<std::string::String>>()?
32988                                .unwrap_or_default();
32989                        }
32990                        __FieldTag::__create_time => {
32991                            if !fields.insert(__FieldTag::__create_time) {
32992                                return std::result::Result::Err(A::Error::duplicate_field(
32993                                    "multiple values for create_time",
32994                                ));
32995                            }
32996                            result.create_time =
32997                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32998                        }
32999                        __FieldTag::__update_time => {
33000                            if !fields.insert(__FieldTag::__update_time) {
33001                                return std::result::Result::Err(A::Error::duplicate_field(
33002                                    "multiple values for update_time",
33003                                ));
33004                            }
33005                            result.update_time =
33006                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
33007                        }
33008                        __FieldTag::__description => {
33009                            if !fields.insert(__FieldTag::__description) {
33010                                return std::result::Result::Err(A::Error::duplicate_field(
33011                                    "multiple values for description",
33012                                ));
33013                            }
33014                            result.description = map
33015                                .next_value::<std::option::Option<std::string::String>>()?
33016                                .unwrap_or_default();
33017                        }
33018                        __FieldTag::__vpc_networks => {
33019                            if !fields.insert(__FieldTag::__vpc_networks) {
33020                                return std::result::Result::Err(A::Error::duplicate_field(
33021                                    "multiple values for vpc_networks",
33022                                ));
33023                            }
33024                            result.vpc_networks = map
33025                                .next_value::<std::option::Option<
33026                                    std::vec::Vec<crate::model::vmware_engine_network::VpcNetwork>,
33027                                >>()?
33028                                .unwrap_or_default();
33029                        }
33030                        __FieldTag::__state => {
33031                            if !fields.insert(__FieldTag::__state) {
33032                                return std::result::Result::Err(A::Error::duplicate_field(
33033                                    "multiple values for state",
33034                                ));
33035                            }
33036                            result.state = map.next_value::<std::option::Option<crate::model::vmware_engine_network::State>>()?.unwrap_or_default();
33037                        }
33038                        __FieldTag::__type => {
33039                            if !fields.insert(__FieldTag::__type) {
33040                                return std::result::Result::Err(A::Error::duplicate_field(
33041                                    "multiple values for type",
33042                                ));
33043                            }
33044                            result.r#type = map.next_value::<std::option::Option<crate::model::vmware_engine_network::Type>>()?.unwrap_or_default();
33045                        }
33046                        __FieldTag::__uid => {
33047                            if !fields.insert(__FieldTag::__uid) {
33048                                return std::result::Result::Err(A::Error::duplicate_field(
33049                                    "multiple values for uid",
33050                                ));
33051                            }
33052                            result.uid = map
33053                                .next_value::<std::option::Option<std::string::String>>()?
33054                                .unwrap_or_default();
33055                        }
33056                        __FieldTag::__etag => {
33057                            if !fields.insert(__FieldTag::__etag) {
33058                                return std::result::Result::Err(A::Error::duplicate_field(
33059                                    "multiple values for etag",
33060                                ));
33061                            }
33062                            result.etag = map
33063                                .next_value::<std::option::Option<std::string::String>>()?
33064                                .unwrap_or_default();
33065                        }
33066                        __FieldTag::Unknown(key) => {
33067                            let value = map.next_value::<serde_json::Value>()?;
33068                            result._unknown_fields.insert(key, value);
33069                        }
33070                    }
33071                }
33072                std::result::Result::Ok(result)
33073            }
33074        }
33075        deserializer.deserialize_any(Visitor)
33076    }
33077}
33078
33079#[doc(hidden)]
33080impl serde::ser::Serialize for VmwareEngineNetwork {
33081    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33082    where
33083        S: serde::ser::Serializer,
33084    {
33085        use serde::ser::SerializeMap;
33086        #[allow(unused_imports)]
33087        use std::option::Option::Some;
33088        let mut state = serializer.serialize_map(std::option::Option::None)?;
33089        if !self.name.is_empty() {
33090            state.serialize_entry("name", &self.name)?;
33091        }
33092        if self.create_time.is_some() {
33093            state.serialize_entry("createTime", &self.create_time)?;
33094        }
33095        if self.update_time.is_some() {
33096            state.serialize_entry("updateTime", &self.update_time)?;
33097        }
33098        if !self.description.is_empty() {
33099            state.serialize_entry("description", &self.description)?;
33100        }
33101        if !self.vpc_networks.is_empty() {
33102            state.serialize_entry("vpcNetworks", &self.vpc_networks)?;
33103        }
33104        if !wkt::internal::is_default(&self.state) {
33105            state.serialize_entry("state", &self.state)?;
33106        }
33107        if !wkt::internal::is_default(&self.r#type) {
33108            state.serialize_entry("type", &self.r#type)?;
33109        }
33110        if !self.uid.is_empty() {
33111            state.serialize_entry("uid", &self.uid)?;
33112        }
33113        if !self.etag.is_empty() {
33114            state.serialize_entry("etag", &self.etag)?;
33115        }
33116        if !self._unknown_fields.is_empty() {
33117            for (key, value) in self._unknown_fields.iter() {
33118                state.serialize_entry(key, &value)?;
33119            }
33120        }
33121        state.end()
33122    }
33123}
33124
33125impl std::fmt::Debug for VmwareEngineNetwork {
33126    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33127        let mut debug_struct = f.debug_struct("VmwareEngineNetwork");
33128        debug_struct.field("name", &self.name);
33129        debug_struct.field("create_time", &self.create_time);
33130        debug_struct.field("update_time", &self.update_time);
33131        debug_struct.field("description", &self.description);
33132        debug_struct.field("vpc_networks", &self.vpc_networks);
33133        debug_struct.field("state", &self.state);
33134        debug_struct.field("r#type", &self.r#type);
33135        debug_struct.field("uid", &self.uid);
33136        debug_struct.field("etag", &self.etag);
33137        if !self._unknown_fields.is_empty() {
33138            debug_struct.field("_unknown_fields", &self._unknown_fields);
33139        }
33140        debug_struct.finish()
33141    }
33142}
33143
33144/// Defines additional types related to [VmwareEngineNetwork].
33145pub mod vmware_engine_network {
33146    #[allow(unused_imports)]
33147    use super::*;
33148
33149    /// Represents a VMware Engine VPC network that is managed by a
33150    /// VMware Engine network resource.
33151    #[derive(Clone, Default, PartialEq)]
33152    #[non_exhaustive]
33153    pub struct VpcNetwork {
33154        /// Output only. Type of VPC network (INTRANET, INTERNET, or
33155        /// GOOGLE_CLOUD)
33156        pub r#type: crate::model::vmware_engine_network::vpc_network::Type,
33157
33158        /// Output only. The relative resource name of the service VPC network this
33159        /// VMware Engine network is attached to. For example:
33160        /// `projects/123123/global/networks/my-network`
33161        pub network: std::string::String,
33162
33163        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33164    }
33165
33166    impl VpcNetwork {
33167        pub fn new() -> Self {
33168            std::default::Default::default()
33169        }
33170
33171        /// Sets the value of [r#type][crate::model::vmware_engine_network::VpcNetwork::type].
33172        pub fn set_type<
33173            T: std::convert::Into<crate::model::vmware_engine_network::vpc_network::Type>,
33174        >(
33175            mut self,
33176            v: T,
33177        ) -> Self {
33178            self.r#type = v.into();
33179            self
33180        }
33181
33182        /// Sets the value of [network][crate::model::vmware_engine_network::VpcNetwork::network].
33183        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33184            self.network = v.into();
33185            self
33186        }
33187    }
33188
33189    impl wkt::message::Message for VpcNetwork {
33190        fn typename() -> &'static str {
33191            "type.googleapis.com/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"
33192        }
33193    }
33194
33195    #[doc(hidden)]
33196    impl<'de> serde::de::Deserialize<'de> for VpcNetwork {
33197        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33198        where
33199            D: serde::Deserializer<'de>,
33200        {
33201            #[allow(non_camel_case_types)]
33202            #[doc(hidden)]
33203            #[derive(PartialEq, Eq, Hash)]
33204            enum __FieldTag {
33205                __type,
33206                __network,
33207                Unknown(std::string::String),
33208            }
33209            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
33210                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33211                where
33212                    D: serde::Deserializer<'de>,
33213                {
33214                    struct Visitor;
33215                    impl<'de> serde::de::Visitor<'de> for Visitor {
33216                        type Value = __FieldTag;
33217                        fn expecting(
33218                            &self,
33219                            formatter: &mut std::fmt::Formatter,
33220                        ) -> std::fmt::Result {
33221                            formatter.write_str("a field name for VpcNetwork")
33222                        }
33223                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
33224                        where
33225                            E: serde::de::Error,
33226                        {
33227                            use std::result::Result::Ok;
33228                            use std::string::ToString;
33229                            match value {
33230                                "type" => Ok(__FieldTag::__type),
33231                                "network" => Ok(__FieldTag::__network),
33232                                _ => Ok(__FieldTag::Unknown(value.to_string())),
33233                            }
33234                        }
33235                    }
33236                    deserializer.deserialize_identifier(Visitor)
33237                }
33238            }
33239            struct Visitor;
33240            impl<'de> serde::de::Visitor<'de> for Visitor {
33241                type Value = VpcNetwork;
33242                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33243                    formatter.write_str("struct VpcNetwork")
33244                }
33245                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
33246                where
33247                    A: serde::de::MapAccess<'de>,
33248                {
33249                    #[allow(unused_imports)]
33250                    use serde::de::Error;
33251                    use std::option::Option::Some;
33252                    let mut fields = std::collections::HashSet::new();
33253                    let mut result = Self::Value::new();
33254                    while let Some(tag) = map.next_key::<__FieldTag>()? {
33255                        #[allow(clippy::match_single_binding)]
33256                        match tag {
33257                            __FieldTag::__type => {
33258                                if !fields.insert(__FieldTag::__type) {
33259                                    return std::result::Result::Err(A::Error::duplicate_field(
33260                                        "multiple values for type",
33261                                    ));
33262                                }
33263                                result.r#type = map
33264                                    .next_value::<std::option::Option<
33265                                        crate::model::vmware_engine_network::vpc_network::Type,
33266                                    >>()?
33267                                    .unwrap_or_default();
33268                            }
33269                            __FieldTag::__network => {
33270                                if !fields.insert(__FieldTag::__network) {
33271                                    return std::result::Result::Err(A::Error::duplicate_field(
33272                                        "multiple values for network",
33273                                    ));
33274                                }
33275                                result.network = map
33276                                    .next_value::<std::option::Option<std::string::String>>()?
33277                                    .unwrap_or_default();
33278                            }
33279                            __FieldTag::Unknown(key) => {
33280                                let value = map.next_value::<serde_json::Value>()?;
33281                                result._unknown_fields.insert(key, value);
33282                            }
33283                        }
33284                    }
33285                    std::result::Result::Ok(result)
33286                }
33287            }
33288            deserializer.deserialize_any(Visitor)
33289        }
33290    }
33291
33292    #[doc(hidden)]
33293    impl serde::ser::Serialize for VpcNetwork {
33294        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33295        where
33296            S: serde::ser::Serializer,
33297        {
33298            use serde::ser::SerializeMap;
33299            #[allow(unused_imports)]
33300            use std::option::Option::Some;
33301            let mut state = serializer.serialize_map(std::option::Option::None)?;
33302            if !wkt::internal::is_default(&self.r#type) {
33303                state.serialize_entry("type", &self.r#type)?;
33304            }
33305            if !self.network.is_empty() {
33306                state.serialize_entry("network", &self.network)?;
33307            }
33308            if !self._unknown_fields.is_empty() {
33309                for (key, value) in self._unknown_fields.iter() {
33310                    state.serialize_entry(key, &value)?;
33311                }
33312            }
33313            state.end()
33314        }
33315    }
33316
33317    impl std::fmt::Debug for VpcNetwork {
33318        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33319            let mut debug_struct = f.debug_struct("VpcNetwork");
33320            debug_struct.field("r#type", &self.r#type);
33321            debug_struct.field("network", &self.network);
33322            if !self._unknown_fields.is_empty() {
33323                debug_struct.field("_unknown_fields", &self._unknown_fields);
33324            }
33325            debug_struct.finish()
33326        }
33327    }
33328
33329    /// Defines additional types related to [VpcNetwork].
33330    pub mod vpc_network {
33331        #[allow(unused_imports)]
33332        use super::*;
33333
33334        /// Enum Type defines possible types of a VMware Engine network controlled
33335        /// service.
33336        ///
33337        /// # Working with unknown values
33338        ///
33339        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33340        /// additional enum variants at any time. Adding new variants is not considered
33341        /// a breaking change. Applications should write their code in anticipation of:
33342        ///
33343        /// - New values appearing in future releases of the client library, **and**
33344        /// - New values received dynamically, without application changes.
33345        ///
33346        /// Please consult the [Working with enums] section in the user guide for some
33347        /// guidelines.
33348        ///
33349        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33350        #[derive(Clone, Debug, PartialEq)]
33351        #[non_exhaustive]
33352        pub enum Type {
33353            /// The default value. This value should never be used.
33354            Unspecified,
33355            /// VPC network that will be peered with a consumer VPC network or the
33356            /// intranet VPC of another VMware Engine network. Access a private cloud
33357            /// through Compute Engine VMs on a peered VPC network or an on-premises
33358            /// resource connected to a peered consumer VPC network.
33359            Intranet,
33360            /// VPC network used for internet access to and from a private cloud.
33361            Internet,
33362            /// VPC network used for access to Google Cloud services like
33363            /// Cloud Storage.
33364            GoogleCloud,
33365            /// If set, the enum was initialized with an unknown value.
33366            ///
33367            /// Applications can examine the value using [Type::value] or
33368            /// [Type::name].
33369            UnknownValue(r#type::UnknownValue),
33370        }
33371
33372        #[doc(hidden)]
33373        pub mod r#type {
33374            #[allow(unused_imports)]
33375            use super::*;
33376            #[derive(Clone, Debug, PartialEq)]
33377            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33378        }
33379
33380        impl Type {
33381            /// Gets the enum value.
33382            ///
33383            /// Returns `None` if the enum contains an unknown value deserialized from
33384            /// the string representation of enums.
33385            pub fn value(&self) -> std::option::Option<i32> {
33386                match self {
33387                    Self::Unspecified => std::option::Option::Some(0),
33388                    Self::Intranet => std::option::Option::Some(1),
33389                    Self::Internet => std::option::Option::Some(2),
33390                    Self::GoogleCloud => std::option::Option::Some(3),
33391                    Self::UnknownValue(u) => u.0.value(),
33392                }
33393            }
33394
33395            /// Gets the enum value as a string.
33396            ///
33397            /// Returns `None` if the enum contains an unknown value deserialized from
33398            /// the integer representation of enums.
33399            pub fn name(&self) -> std::option::Option<&str> {
33400                match self {
33401                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
33402                    Self::Intranet => std::option::Option::Some("INTRANET"),
33403                    Self::Internet => std::option::Option::Some("INTERNET"),
33404                    Self::GoogleCloud => std::option::Option::Some("GOOGLE_CLOUD"),
33405                    Self::UnknownValue(u) => u.0.name(),
33406                }
33407            }
33408        }
33409
33410        impl std::default::Default for Type {
33411            fn default() -> Self {
33412                use std::convert::From;
33413                Self::from(0)
33414            }
33415        }
33416
33417        impl std::fmt::Display for Type {
33418            fn fmt(
33419                &self,
33420                f: &mut std::fmt::Formatter<'_>,
33421            ) -> std::result::Result<(), std::fmt::Error> {
33422                wkt::internal::display_enum(f, self.name(), self.value())
33423            }
33424        }
33425
33426        impl std::convert::From<i32> for Type {
33427            fn from(value: i32) -> Self {
33428                match value {
33429                    0 => Self::Unspecified,
33430                    1 => Self::Intranet,
33431                    2 => Self::Internet,
33432                    3 => Self::GoogleCloud,
33433                    _ => Self::UnknownValue(r#type::UnknownValue(
33434                        wkt::internal::UnknownEnumValue::Integer(value),
33435                    )),
33436                }
33437            }
33438        }
33439
33440        impl std::convert::From<&str> for Type {
33441            fn from(value: &str) -> Self {
33442                use std::string::ToString;
33443                match value {
33444                    "TYPE_UNSPECIFIED" => Self::Unspecified,
33445                    "INTRANET" => Self::Intranet,
33446                    "INTERNET" => Self::Internet,
33447                    "GOOGLE_CLOUD" => Self::GoogleCloud,
33448                    _ => Self::UnknownValue(r#type::UnknownValue(
33449                        wkt::internal::UnknownEnumValue::String(value.to_string()),
33450                    )),
33451                }
33452            }
33453        }
33454
33455        impl serde::ser::Serialize for Type {
33456            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33457            where
33458                S: serde::Serializer,
33459            {
33460                match self {
33461                    Self::Unspecified => serializer.serialize_i32(0),
33462                    Self::Intranet => serializer.serialize_i32(1),
33463                    Self::Internet => serializer.serialize_i32(2),
33464                    Self::GoogleCloud => serializer.serialize_i32(3),
33465                    Self::UnknownValue(u) => u.0.serialize(serializer),
33466                }
33467            }
33468        }
33469
33470        impl<'de> serde::de::Deserialize<'de> for Type {
33471            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33472            where
33473                D: serde::Deserializer<'de>,
33474            {
33475                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
33476                    ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type",
33477                ))
33478            }
33479        }
33480    }
33481
33482    /// Enum State defines possible states of VMware Engine network.
33483    ///
33484    /// # Working with unknown values
33485    ///
33486    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33487    /// additional enum variants at any time. Adding new variants is not considered
33488    /// a breaking change. Applications should write their code in anticipation of:
33489    ///
33490    /// - New values appearing in future releases of the client library, **and**
33491    /// - New values received dynamically, without application changes.
33492    ///
33493    /// Please consult the [Working with enums] section in the user guide for some
33494    /// guidelines.
33495    ///
33496    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33497    #[derive(Clone, Debug, PartialEq)]
33498    #[non_exhaustive]
33499    pub enum State {
33500        /// The default value. This value is used if the state is omitted.
33501        Unspecified,
33502        /// The VMware Engine network is being created.
33503        Creating,
33504        /// The VMware Engine network is ready.
33505        Active,
33506        /// The VMware Engine network is being updated.
33507        Updating,
33508        /// The VMware Engine network is being deleted.
33509        Deleting,
33510        /// If set, the enum was initialized with an unknown value.
33511        ///
33512        /// Applications can examine the value using [State::value] or
33513        /// [State::name].
33514        UnknownValue(state::UnknownValue),
33515    }
33516
33517    #[doc(hidden)]
33518    pub mod state {
33519        #[allow(unused_imports)]
33520        use super::*;
33521        #[derive(Clone, Debug, PartialEq)]
33522        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33523    }
33524
33525    impl State {
33526        /// Gets the enum value.
33527        ///
33528        /// Returns `None` if the enum contains an unknown value deserialized from
33529        /// the string representation of enums.
33530        pub fn value(&self) -> std::option::Option<i32> {
33531            match self {
33532                Self::Unspecified => std::option::Option::Some(0),
33533                Self::Creating => std::option::Option::Some(1),
33534                Self::Active => std::option::Option::Some(2),
33535                Self::Updating => std::option::Option::Some(3),
33536                Self::Deleting => std::option::Option::Some(4),
33537                Self::UnknownValue(u) => u.0.value(),
33538            }
33539        }
33540
33541        /// Gets the enum value as a string.
33542        ///
33543        /// Returns `None` if the enum contains an unknown value deserialized from
33544        /// the integer representation of enums.
33545        pub fn name(&self) -> std::option::Option<&str> {
33546            match self {
33547                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
33548                Self::Creating => std::option::Option::Some("CREATING"),
33549                Self::Active => std::option::Option::Some("ACTIVE"),
33550                Self::Updating => std::option::Option::Some("UPDATING"),
33551                Self::Deleting => std::option::Option::Some("DELETING"),
33552                Self::UnknownValue(u) => u.0.name(),
33553            }
33554        }
33555    }
33556
33557    impl std::default::Default for State {
33558        fn default() -> Self {
33559            use std::convert::From;
33560            Self::from(0)
33561        }
33562    }
33563
33564    impl std::fmt::Display for State {
33565        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33566            wkt::internal::display_enum(f, self.name(), self.value())
33567        }
33568    }
33569
33570    impl std::convert::From<i32> for State {
33571        fn from(value: i32) -> Self {
33572            match value {
33573                0 => Self::Unspecified,
33574                1 => Self::Creating,
33575                2 => Self::Active,
33576                3 => Self::Updating,
33577                4 => Self::Deleting,
33578                _ => Self::UnknownValue(state::UnknownValue(
33579                    wkt::internal::UnknownEnumValue::Integer(value),
33580                )),
33581            }
33582        }
33583    }
33584
33585    impl std::convert::From<&str> for State {
33586        fn from(value: &str) -> Self {
33587            use std::string::ToString;
33588            match value {
33589                "STATE_UNSPECIFIED" => Self::Unspecified,
33590                "CREATING" => Self::Creating,
33591                "ACTIVE" => Self::Active,
33592                "UPDATING" => Self::Updating,
33593                "DELETING" => Self::Deleting,
33594                _ => Self::UnknownValue(state::UnknownValue(
33595                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33596                )),
33597            }
33598        }
33599    }
33600
33601    impl serde::ser::Serialize for State {
33602        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33603        where
33604            S: serde::Serializer,
33605        {
33606            match self {
33607                Self::Unspecified => serializer.serialize_i32(0),
33608                Self::Creating => serializer.serialize_i32(1),
33609                Self::Active => serializer.serialize_i32(2),
33610                Self::Updating => serializer.serialize_i32(3),
33611                Self::Deleting => serializer.serialize_i32(4),
33612                Self::UnknownValue(u) => u.0.serialize(serializer),
33613            }
33614        }
33615    }
33616
33617    impl<'de> serde::de::Deserialize<'de> for State {
33618        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33619        where
33620            D: serde::Deserializer<'de>,
33621        {
33622            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
33623                ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.State",
33624            ))
33625        }
33626    }
33627
33628    /// Enum Type defines possible types of VMware Engine network.
33629    ///
33630    /// # Working with unknown values
33631    ///
33632    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33633    /// additional enum variants at any time. Adding new variants is not considered
33634    /// a breaking change. Applications should write their code in anticipation of:
33635    ///
33636    /// - New values appearing in future releases of the client library, **and**
33637    /// - New values received dynamically, without application changes.
33638    ///
33639    /// Please consult the [Working with enums] section in the user guide for some
33640    /// guidelines.
33641    ///
33642    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33643    #[derive(Clone, Debug, PartialEq)]
33644    #[non_exhaustive]
33645    pub enum Type {
33646        /// The default value. This value should never be used.
33647        Unspecified,
33648        /// Network type used by private clouds created in projects without a network
33649        /// of type `STANDARD`. This network type is no longer used for new VMware
33650        /// Engine private cloud deployments.
33651        Legacy,
33652        /// Standard network type used for private cloud connectivity.
33653        Standard,
33654        /// If set, the enum was initialized with an unknown value.
33655        ///
33656        /// Applications can examine the value using [Type::value] or
33657        /// [Type::name].
33658        UnknownValue(r#type::UnknownValue),
33659    }
33660
33661    #[doc(hidden)]
33662    pub mod r#type {
33663        #[allow(unused_imports)]
33664        use super::*;
33665        #[derive(Clone, Debug, PartialEq)]
33666        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33667    }
33668
33669    impl Type {
33670        /// Gets the enum value.
33671        ///
33672        /// Returns `None` if the enum contains an unknown value deserialized from
33673        /// the string representation of enums.
33674        pub fn value(&self) -> std::option::Option<i32> {
33675            match self {
33676                Self::Unspecified => std::option::Option::Some(0),
33677                Self::Legacy => std::option::Option::Some(1),
33678                Self::Standard => std::option::Option::Some(2),
33679                Self::UnknownValue(u) => u.0.value(),
33680            }
33681        }
33682
33683        /// Gets the enum value as a string.
33684        ///
33685        /// Returns `None` if the enum contains an unknown value deserialized from
33686        /// the integer representation of enums.
33687        pub fn name(&self) -> std::option::Option<&str> {
33688            match self {
33689                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
33690                Self::Legacy => std::option::Option::Some("LEGACY"),
33691                Self::Standard => std::option::Option::Some("STANDARD"),
33692                Self::UnknownValue(u) => u.0.name(),
33693            }
33694        }
33695    }
33696
33697    impl std::default::Default for Type {
33698        fn default() -> Self {
33699            use std::convert::From;
33700            Self::from(0)
33701        }
33702    }
33703
33704    impl std::fmt::Display for Type {
33705        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33706            wkt::internal::display_enum(f, self.name(), self.value())
33707        }
33708    }
33709
33710    impl std::convert::From<i32> for Type {
33711        fn from(value: i32) -> Self {
33712            match value {
33713                0 => Self::Unspecified,
33714                1 => Self::Legacy,
33715                2 => Self::Standard,
33716                _ => Self::UnknownValue(r#type::UnknownValue(
33717                    wkt::internal::UnknownEnumValue::Integer(value),
33718                )),
33719            }
33720        }
33721    }
33722
33723    impl std::convert::From<&str> for Type {
33724        fn from(value: &str) -> Self {
33725            use std::string::ToString;
33726            match value {
33727                "TYPE_UNSPECIFIED" => Self::Unspecified,
33728                "LEGACY" => Self::Legacy,
33729                "STANDARD" => Self::Standard,
33730                _ => Self::UnknownValue(r#type::UnknownValue(
33731                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33732                )),
33733            }
33734        }
33735    }
33736
33737    impl serde::ser::Serialize for Type {
33738        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33739        where
33740            S: serde::Serializer,
33741        {
33742            match self {
33743                Self::Unspecified => serializer.serialize_i32(0),
33744                Self::Legacy => serializer.serialize_i32(1),
33745                Self::Standard => serializer.serialize_i32(2),
33746                Self::UnknownValue(u) => u.0.serialize(serializer),
33747            }
33748        }
33749    }
33750
33751    impl<'de> serde::de::Deserialize<'de> for Type {
33752        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33753        where
33754            D: serde::Deserializer<'de>,
33755        {
33756            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
33757                ".google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type",
33758            ))
33759        }
33760    }
33761}
33762
33763/// Private connection resource that provides connectivity for VMware Engine
33764/// private clouds.
33765#[derive(Clone, Default, PartialEq)]
33766#[non_exhaustive]
33767pub struct PrivateConnection {
33768    /// Output only. The resource name of the private connection.
33769    /// Resource names are schemeless URIs that follow the conventions in
33770    /// <https://cloud.google.com/apis/design/resource_names>.
33771    /// For example:
33772    /// `projects/my-project/locations/us-central1/privateConnections/my-connection`
33773    pub name: std::string::String,
33774
33775    /// Output only. Creation time of this resource.
33776    pub create_time: std::option::Option<wkt::Timestamp>,
33777
33778    /// Output only. Last update time of this resource.
33779    pub update_time: std::option::Option<wkt::Timestamp>,
33780
33781    /// Optional. User-provided description for this private connection.
33782    pub description: std::string::String,
33783
33784    /// Output only. State of the private connection.
33785    pub state: crate::model::private_connection::State,
33786
33787    /// Required. The relative resource name of Legacy VMware Engine network.
33788    /// Specify the name in the following form:
33789    /// `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
33790    /// where `{project}`, `{location}` will be same as specified in private
33791    /// connection resource name and `{vmware_engine_network_id}` will be in the
33792    /// form of `{location}`-default e.g.
33793    /// projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default.
33794    pub vmware_engine_network: std::string::String,
33795
33796    /// Output only. The canonical name of the VMware Engine network in the form:
33797    /// `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`
33798    pub vmware_engine_network_canonical: std::string::String,
33799
33800    /// Required. Private connection type.
33801    pub r#type: crate::model::private_connection::Type,
33802
33803    /// Output only. VPC network peering id between given network VPC and
33804    /// VMwareEngineNetwork.
33805    pub peering_id: std::string::String,
33806
33807    /// Optional. Routing Mode.
33808    /// Default value is set to GLOBAL.
33809    /// For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or
33810    /// REGIONAL, for other types only GLOBAL is supported.
33811    pub routing_mode: crate::model::private_connection::RoutingMode,
33812
33813    /// Output only. System-generated unique identifier for the resource.
33814    pub uid: std::string::String,
33815
33816    /// Required. Service network to create private connection.
33817    /// Specify the name in the following form:
33818    /// `projects/{project}/global/networks/{network_id}`
33819    /// For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking
33820    /// VPC, e.g. projects/project-tp/global/networks/servicenetworking.
33821    /// For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC,
33822    /// e.g. projects/project-tp/global/networks/netapp-tenant-vpc.
33823    /// For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g.
33824    /// projects/project-tp/global/networks/dell-tenant-vpc.
33825    /// For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or
33826    /// any other producer VPC to which the VMware Engine Network needs to be
33827    /// connected, e.g. projects/project/global/networks/vpc.
33828    pub service_network: std::string::String,
33829
33830    /// Output only. Peering state between service network and VMware Engine
33831    /// network.
33832    pub peering_state: crate::model::private_connection::PeeringState,
33833
33834    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33835}
33836
33837impl PrivateConnection {
33838    pub fn new() -> Self {
33839        std::default::Default::default()
33840    }
33841
33842    /// Sets the value of [name][crate::model::PrivateConnection::name].
33843    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33844        self.name = v.into();
33845        self
33846    }
33847
33848    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
33849    pub fn set_create_time<T>(mut self, v: T) -> Self
33850    where
33851        T: std::convert::Into<wkt::Timestamp>,
33852    {
33853        self.create_time = std::option::Option::Some(v.into());
33854        self
33855    }
33856
33857    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
33858    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
33859    where
33860        T: std::convert::Into<wkt::Timestamp>,
33861    {
33862        self.create_time = v.map(|x| x.into());
33863        self
33864    }
33865
33866    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
33867    pub fn set_update_time<T>(mut self, v: T) -> Self
33868    where
33869        T: std::convert::Into<wkt::Timestamp>,
33870    {
33871        self.update_time = std::option::Option::Some(v.into());
33872        self
33873    }
33874
33875    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
33876    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
33877    where
33878        T: std::convert::Into<wkt::Timestamp>,
33879    {
33880        self.update_time = v.map(|x| x.into());
33881        self
33882    }
33883
33884    /// Sets the value of [description][crate::model::PrivateConnection::description].
33885    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33886        self.description = v.into();
33887        self
33888    }
33889
33890    /// Sets the value of [state][crate::model::PrivateConnection::state].
33891    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
33892        mut self,
33893        v: T,
33894    ) -> Self {
33895        self.state = v.into();
33896        self
33897    }
33898
33899    /// Sets the value of [vmware_engine_network][crate::model::PrivateConnection::vmware_engine_network].
33900    pub fn set_vmware_engine_network<T: std::convert::Into<std::string::String>>(
33901        mut self,
33902        v: T,
33903    ) -> Self {
33904        self.vmware_engine_network = v.into();
33905        self
33906    }
33907
33908    /// Sets the value of [vmware_engine_network_canonical][crate::model::PrivateConnection::vmware_engine_network_canonical].
33909    pub fn set_vmware_engine_network_canonical<T: std::convert::Into<std::string::String>>(
33910        mut self,
33911        v: T,
33912    ) -> Self {
33913        self.vmware_engine_network_canonical = v.into();
33914        self
33915    }
33916
33917    /// Sets the value of [r#type][crate::model::PrivateConnection::type].
33918    pub fn set_type<T: std::convert::Into<crate::model::private_connection::Type>>(
33919        mut self,
33920        v: T,
33921    ) -> Self {
33922        self.r#type = v.into();
33923        self
33924    }
33925
33926    /// Sets the value of [peering_id][crate::model::PrivateConnection::peering_id].
33927    pub fn set_peering_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33928        self.peering_id = v.into();
33929        self
33930    }
33931
33932    /// Sets the value of [routing_mode][crate::model::PrivateConnection::routing_mode].
33933    pub fn set_routing_mode<
33934        T: std::convert::Into<crate::model::private_connection::RoutingMode>,
33935    >(
33936        mut self,
33937        v: T,
33938    ) -> Self {
33939        self.routing_mode = v.into();
33940        self
33941    }
33942
33943    /// Sets the value of [uid][crate::model::PrivateConnection::uid].
33944    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33945        self.uid = v.into();
33946        self
33947    }
33948
33949    /// Sets the value of [service_network][crate::model::PrivateConnection::service_network].
33950    pub fn set_service_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33951        self.service_network = v.into();
33952        self
33953    }
33954
33955    /// Sets the value of [peering_state][crate::model::PrivateConnection::peering_state].
33956    pub fn set_peering_state<
33957        T: std::convert::Into<crate::model::private_connection::PeeringState>,
33958    >(
33959        mut self,
33960        v: T,
33961    ) -> Self {
33962        self.peering_state = v.into();
33963        self
33964    }
33965}
33966
33967impl wkt::message::Message for PrivateConnection {
33968    fn typename() -> &'static str {
33969        "type.googleapis.com/google.cloud.vmwareengine.v1.PrivateConnection"
33970    }
33971}
33972
33973#[doc(hidden)]
33974impl<'de> serde::de::Deserialize<'de> for PrivateConnection {
33975    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33976    where
33977        D: serde::Deserializer<'de>,
33978    {
33979        #[allow(non_camel_case_types)]
33980        #[doc(hidden)]
33981        #[derive(PartialEq, Eq, Hash)]
33982        enum __FieldTag {
33983            __name,
33984            __create_time,
33985            __update_time,
33986            __description,
33987            __state,
33988            __vmware_engine_network,
33989            __vmware_engine_network_canonical,
33990            __type,
33991            __peering_id,
33992            __routing_mode,
33993            __uid,
33994            __service_network,
33995            __peering_state,
33996            Unknown(std::string::String),
33997        }
33998        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
33999            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34000            where
34001                D: serde::Deserializer<'de>,
34002            {
34003                struct Visitor;
34004                impl<'de> serde::de::Visitor<'de> for Visitor {
34005                    type Value = __FieldTag;
34006                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34007                        formatter.write_str("a field name for PrivateConnection")
34008                    }
34009                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34010                    where
34011                        E: serde::de::Error,
34012                    {
34013                        use std::result::Result::Ok;
34014                        use std::string::ToString;
34015                        match value {
34016                            "name" => Ok(__FieldTag::__name),
34017                            "createTime" => Ok(__FieldTag::__create_time),
34018                            "create_time" => Ok(__FieldTag::__create_time),
34019                            "updateTime" => Ok(__FieldTag::__update_time),
34020                            "update_time" => Ok(__FieldTag::__update_time),
34021                            "description" => Ok(__FieldTag::__description),
34022                            "state" => Ok(__FieldTag::__state),
34023                            "vmwareEngineNetwork" => Ok(__FieldTag::__vmware_engine_network),
34024                            "vmware_engine_network" => Ok(__FieldTag::__vmware_engine_network),
34025                            "vmwareEngineNetworkCanonical" => {
34026                                Ok(__FieldTag::__vmware_engine_network_canonical)
34027                            }
34028                            "vmware_engine_network_canonical" => {
34029                                Ok(__FieldTag::__vmware_engine_network_canonical)
34030                            }
34031                            "type" => Ok(__FieldTag::__type),
34032                            "peeringId" => Ok(__FieldTag::__peering_id),
34033                            "peering_id" => Ok(__FieldTag::__peering_id),
34034                            "routingMode" => Ok(__FieldTag::__routing_mode),
34035                            "routing_mode" => Ok(__FieldTag::__routing_mode),
34036                            "uid" => Ok(__FieldTag::__uid),
34037                            "serviceNetwork" => Ok(__FieldTag::__service_network),
34038                            "service_network" => Ok(__FieldTag::__service_network),
34039                            "peeringState" => Ok(__FieldTag::__peering_state),
34040                            "peering_state" => Ok(__FieldTag::__peering_state),
34041                            _ => Ok(__FieldTag::Unknown(value.to_string())),
34042                        }
34043                    }
34044                }
34045                deserializer.deserialize_identifier(Visitor)
34046            }
34047        }
34048        struct Visitor;
34049        impl<'de> serde::de::Visitor<'de> for Visitor {
34050            type Value = PrivateConnection;
34051            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34052                formatter.write_str("struct PrivateConnection")
34053            }
34054            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34055            where
34056                A: serde::de::MapAccess<'de>,
34057            {
34058                #[allow(unused_imports)]
34059                use serde::de::Error;
34060                use std::option::Option::Some;
34061                let mut fields = std::collections::HashSet::new();
34062                let mut result = Self::Value::new();
34063                while let Some(tag) = map.next_key::<__FieldTag>()? {
34064                    #[allow(clippy::match_single_binding)]
34065                    match tag {
34066                        __FieldTag::__name => {
34067                            if !fields.insert(__FieldTag::__name) {
34068                                return std::result::Result::Err(A::Error::duplicate_field(
34069                                    "multiple values for name",
34070                                ));
34071                            }
34072                            result.name = map
34073                                .next_value::<std::option::Option<std::string::String>>()?
34074                                .unwrap_or_default();
34075                        }
34076                        __FieldTag::__create_time => {
34077                            if !fields.insert(__FieldTag::__create_time) {
34078                                return std::result::Result::Err(A::Error::duplicate_field(
34079                                    "multiple values for create_time",
34080                                ));
34081                            }
34082                            result.create_time =
34083                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
34084                        }
34085                        __FieldTag::__update_time => {
34086                            if !fields.insert(__FieldTag::__update_time) {
34087                                return std::result::Result::Err(A::Error::duplicate_field(
34088                                    "multiple values for update_time",
34089                                ));
34090                            }
34091                            result.update_time =
34092                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
34093                        }
34094                        __FieldTag::__description => {
34095                            if !fields.insert(__FieldTag::__description) {
34096                                return std::result::Result::Err(A::Error::duplicate_field(
34097                                    "multiple values for description",
34098                                ));
34099                            }
34100                            result.description = map
34101                                .next_value::<std::option::Option<std::string::String>>()?
34102                                .unwrap_or_default();
34103                        }
34104                        __FieldTag::__state => {
34105                            if !fields.insert(__FieldTag::__state) {
34106                                return std::result::Result::Err(A::Error::duplicate_field(
34107                                    "multiple values for state",
34108                                ));
34109                            }
34110                            result.state = map.next_value::<std::option::Option<crate::model::private_connection::State>>()?.unwrap_or_default();
34111                        }
34112                        __FieldTag::__vmware_engine_network => {
34113                            if !fields.insert(__FieldTag::__vmware_engine_network) {
34114                                return std::result::Result::Err(A::Error::duplicate_field(
34115                                    "multiple values for vmware_engine_network",
34116                                ));
34117                            }
34118                            result.vmware_engine_network = map
34119                                .next_value::<std::option::Option<std::string::String>>()?
34120                                .unwrap_or_default();
34121                        }
34122                        __FieldTag::__vmware_engine_network_canonical => {
34123                            if !fields.insert(__FieldTag::__vmware_engine_network_canonical) {
34124                                return std::result::Result::Err(A::Error::duplicate_field(
34125                                    "multiple values for vmware_engine_network_canonical",
34126                                ));
34127                            }
34128                            result.vmware_engine_network_canonical = map
34129                                .next_value::<std::option::Option<std::string::String>>()?
34130                                .unwrap_or_default();
34131                        }
34132                        __FieldTag::__type => {
34133                            if !fields.insert(__FieldTag::__type) {
34134                                return std::result::Result::Err(A::Error::duplicate_field(
34135                                    "multiple values for type",
34136                                ));
34137                            }
34138                            result.r#type = map.next_value::<std::option::Option<crate::model::private_connection::Type>>()?.unwrap_or_default();
34139                        }
34140                        __FieldTag::__peering_id => {
34141                            if !fields.insert(__FieldTag::__peering_id) {
34142                                return std::result::Result::Err(A::Error::duplicate_field(
34143                                    "multiple values for peering_id",
34144                                ));
34145                            }
34146                            result.peering_id = map
34147                                .next_value::<std::option::Option<std::string::String>>()?
34148                                .unwrap_or_default();
34149                        }
34150                        __FieldTag::__routing_mode => {
34151                            if !fields.insert(__FieldTag::__routing_mode) {
34152                                return std::result::Result::Err(A::Error::duplicate_field(
34153                                    "multiple values for routing_mode",
34154                                ));
34155                            }
34156                            result.routing_mode =
34157                                map.next_value::<std::option::Option<
34158                                    crate::model::private_connection::RoutingMode,
34159                                >>()?
34160                                .unwrap_or_default();
34161                        }
34162                        __FieldTag::__uid => {
34163                            if !fields.insert(__FieldTag::__uid) {
34164                                return std::result::Result::Err(A::Error::duplicate_field(
34165                                    "multiple values for uid",
34166                                ));
34167                            }
34168                            result.uid = map
34169                                .next_value::<std::option::Option<std::string::String>>()?
34170                                .unwrap_or_default();
34171                        }
34172                        __FieldTag::__service_network => {
34173                            if !fields.insert(__FieldTag::__service_network) {
34174                                return std::result::Result::Err(A::Error::duplicate_field(
34175                                    "multiple values for service_network",
34176                                ));
34177                            }
34178                            result.service_network = map
34179                                .next_value::<std::option::Option<std::string::String>>()?
34180                                .unwrap_or_default();
34181                        }
34182                        __FieldTag::__peering_state => {
34183                            if !fields.insert(__FieldTag::__peering_state) {
34184                                return std::result::Result::Err(A::Error::duplicate_field(
34185                                    "multiple values for peering_state",
34186                                ));
34187                            }
34188                            result.peering_state =
34189                                map.next_value::<std::option::Option<
34190                                    crate::model::private_connection::PeeringState,
34191                                >>()?
34192                                .unwrap_or_default();
34193                        }
34194                        __FieldTag::Unknown(key) => {
34195                            let value = map.next_value::<serde_json::Value>()?;
34196                            result._unknown_fields.insert(key, value);
34197                        }
34198                    }
34199                }
34200                std::result::Result::Ok(result)
34201            }
34202        }
34203        deserializer.deserialize_any(Visitor)
34204    }
34205}
34206
34207#[doc(hidden)]
34208impl serde::ser::Serialize for PrivateConnection {
34209    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34210    where
34211        S: serde::ser::Serializer,
34212    {
34213        use serde::ser::SerializeMap;
34214        #[allow(unused_imports)]
34215        use std::option::Option::Some;
34216        let mut state = serializer.serialize_map(std::option::Option::None)?;
34217        if !self.name.is_empty() {
34218            state.serialize_entry("name", &self.name)?;
34219        }
34220        if self.create_time.is_some() {
34221            state.serialize_entry("createTime", &self.create_time)?;
34222        }
34223        if self.update_time.is_some() {
34224            state.serialize_entry("updateTime", &self.update_time)?;
34225        }
34226        if !self.description.is_empty() {
34227            state.serialize_entry("description", &self.description)?;
34228        }
34229        if !wkt::internal::is_default(&self.state) {
34230            state.serialize_entry("state", &self.state)?;
34231        }
34232        if !self.vmware_engine_network.is_empty() {
34233            state.serialize_entry("vmwareEngineNetwork", &self.vmware_engine_network)?;
34234        }
34235        if !self.vmware_engine_network_canonical.is_empty() {
34236            state.serialize_entry(
34237                "vmwareEngineNetworkCanonical",
34238                &self.vmware_engine_network_canonical,
34239            )?;
34240        }
34241        if !wkt::internal::is_default(&self.r#type) {
34242            state.serialize_entry("type", &self.r#type)?;
34243        }
34244        if !self.peering_id.is_empty() {
34245            state.serialize_entry("peeringId", &self.peering_id)?;
34246        }
34247        if !wkt::internal::is_default(&self.routing_mode) {
34248            state.serialize_entry("routingMode", &self.routing_mode)?;
34249        }
34250        if !self.uid.is_empty() {
34251            state.serialize_entry("uid", &self.uid)?;
34252        }
34253        if !self.service_network.is_empty() {
34254            state.serialize_entry("serviceNetwork", &self.service_network)?;
34255        }
34256        if !wkt::internal::is_default(&self.peering_state) {
34257            state.serialize_entry("peeringState", &self.peering_state)?;
34258        }
34259        if !self._unknown_fields.is_empty() {
34260            for (key, value) in self._unknown_fields.iter() {
34261                state.serialize_entry(key, &value)?;
34262            }
34263        }
34264        state.end()
34265    }
34266}
34267
34268impl std::fmt::Debug for PrivateConnection {
34269    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34270        let mut debug_struct = f.debug_struct("PrivateConnection");
34271        debug_struct.field("name", &self.name);
34272        debug_struct.field("create_time", &self.create_time);
34273        debug_struct.field("update_time", &self.update_time);
34274        debug_struct.field("description", &self.description);
34275        debug_struct.field("state", &self.state);
34276        debug_struct.field("vmware_engine_network", &self.vmware_engine_network);
34277        debug_struct.field(
34278            "vmware_engine_network_canonical",
34279            &self.vmware_engine_network_canonical,
34280        );
34281        debug_struct.field("r#type", &self.r#type);
34282        debug_struct.field("peering_id", &self.peering_id);
34283        debug_struct.field("routing_mode", &self.routing_mode);
34284        debug_struct.field("uid", &self.uid);
34285        debug_struct.field("service_network", &self.service_network);
34286        debug_struct.field("peering_state", &self.peering_state);
34287        if !self._unknown_fields.is_empty() {
34288            debug_struct.field("_unknown_fields", &self._unknown_fields);
34289        }
34290        debug_struct.finish()
34291    }
34292}
34293
34294/// Defines additional types related to [PrivateConnection].
34295pub mod private_connection {
34296    #[allow(unused_imports)]
34297    use super::*;
34298
34299    /// Enum State defines possible states of private connection.
34300    ///
34301    /// # Working with unknown values
34302    ///
34303    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34304    /// additional enum variants at any time. Adding new variants is not considered
34305    /// a breaking change. Applications should write their code in anticipation of:
34306    ///
34307    /// - New values appearing in future releases of the client library, **and**
34308    /// - New values received dynamically, without application changes.
34309    ///
34310    /// Please consult the [Working with enums] section in the user guide for some
34311    /// guidelines.
34312    ///
34313    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34314    #[derive(Clone, Debug, PartialEq)]
34315    #[non_exhaustive]
34316    pub enum State {
34317        /// The default value. This value is used if the state is omitted.
34318        Unspecified,
34319        /// The private connection is being created.
34320        Creating,
34321        /// The private connection is ready.
34322        Active,
34323        /// The private connection is being updated.
34324        Updating,
34325        /// The private connection is being deleted.
34326        Deleting,
34327        /// The private connection is not provisioned, since no private cloud is
34328        /// present for which this private connection is needed.
34329        Unprovisioned,
34330        /// The private connection is in failed state.
34331        Failed,
34332        /// If set, the enum was initialized with an unknown value.
34333        ///
34334        /// Applications can examine the value using [State::value] or
34335        /// [State::name].
34336        UnknownValue(state::UnknownValue),
34337    }
34338
34339    #[doc(hidden)]
34340    pub mod state {
34341        #[allow(unused_imports)]
34342        use super::*;
34343        #[derive(Clone, Debug, PartialEq)]
34344        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34345    }
34346
34347    impl State {
34348        /// Gets the enum value.
34349        ///
34350        /// Returns `None` if the enum contains an unknown value deserialized from
34351        /// the string representation of enums.
34352        pub fn value(&self) -> std::option::Option<i32> {
34353            match self {
34354                Self::Unspecified => std::option::Option::Some(0),
34355                Self::Creating => std::option::Option::Some(1),
34356                Self::Active => std::option::Option::Some(2),
34357                Self::Updating => std::option::Option::Some(3),
34358                Self::Deleting => std::option::Option::Some(4),
34359                Self::Unprovisioned => std::option::Option::Some(5),
34360                Self::Failed => std::option::Option::Some(6),
34361                Self::UnknownValue(u) => u.0.value(),
34362            }
34363        }
34364
34365        /// Gets the enum value as a string.
34366        ///
34367        /// Returns `None` if the enum contains an unknown value deserialized from
34368        /// the integer representation of enums.
34369        pub fn name(&self) -> std::option::Option<&str> {
34370            match self {
34371                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
34372                Self::Creating => std::option::Option::Some("CREATING"),
34373                Self::Active => std::option::Option::Some("ACTIVE"),
34374                Self::Updating => std::option::Option::Some("UPDATING"),
34375                Self::Deleting => std::option::Option::Some("DELETING"),
34376                Self::Unprovisioned => std::option::Option::Some("UNPROVISIONED"),
34377                Self::Failed => std::option::Option::Some("FAILED"),
34378                Self::UnknownValue(u) => u.0.name(),
34379            }
34380        }
34381    }
34382
34383    impl std::default::Default for State {
34384        fn default() -> Self {
34385            use std::convert::From;
34386            Self::from(0)
34387        }
34388    }
34389
34390    impl std::fmt::Display for State {
34391        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34392            wkt::internal::display_enum(f, self.name(), self.value())
34393        }
34394    }
34395
34396    impl std::convert::From<i32> for State {
34397        fn from(value: i32) -> Self {
34398            match value {
34399                0 => Self::Unspecified,
34400                1 => Self::Creating,
34401                2 => Self::Active,
34402                3 => Self::Updating,
34403                4 => Self::Deleting,
34404                5 => Self::Unprovisioned,
34405                6 => Self::Failed,
34406                _ => Self::UnknownValue(state::UnknownValue(
34407                    wkt::internal::UnknownEnumValue::Integer(value),
34408                )),
34409            }
34410        }
34411    }
34412
34413    impl std::convert::From<&str> for State {
34414        fn from(value: &str) -> Self {
34415            use std::string::ToString;
34416            match value {
34417                "STATE_UNSPECIFIED" => Self::Unspecified,
34418                "CREATING" => Self::Creating,
34419                "ACTIVE" => Self::Active,
34420                "UPDATING" => Self::Updating,
34421                "DELETING" => Self::Deleting,
34422                "UNPROVISIONED" => Self::Unprovisioned,
34423                "FAILED" => Self::Failed,
34424                _ => Self::UnknownValue(state::UnknownValue(
34425                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34426                )),
34427            }
34428        }
34429    }
34430
34431    impl serde::ser::Serialize for State {
34432        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34433        where
34434            S: serde::Serializer,
34435        {
34436            match self {
34437                Self::Unspecified => serializer.serialize_i32(0),
34438                Self::Creating => serializer.serialize_i32(1),
34439                Self::Active => serializer.serialize_i32(2),
34440                Self::Updating => serializer.serialize_i32(3),
34441                Self::Deleting => serializer.serialize_i32(4),
34442                Self::Unprovisioned => serializer.serialize_i32(5),
34443                Self::Failed => serializer.serialize_i32(6),
34444                Self::UnknownValue(u) => u.0.serialize(serializer),
34445            }
34446        }
34447    }
34448
34449    impl<'de> serde::de::Deserialize<'de> for State {
34450        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34451        where
34452            D: serde::Deserializer<'de>,
34453        {
34454            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
34455                ".google.cloud.vmwareengine.v1.PrivateConnection.State",
34456            ))
34457        }
34458    }
34459
34460    /// Enum Type defines possible types of private connection.
34461    ///
34462    /// # Working with unknown values
34463    ///
34464    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34465    /// additional enum variants at any time. Adding new variants is not considered
34466    /// a breaking change. Applications should write their code in anticipation of:
34467    ///
34468    /// - New values appearing in future releases of the client library, **and**
34469    /// - New values received dynamically, without application changes.
34470    ///
34471    /// Please consult the [Working with enums] section in the user guide for some
34472    /// guidelines.
34473    ///
34474    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34475    #[derive(Clone, Debug, PartialEq)]
34476    #[non_exhaustive]
34477    pub enum Type {
34478        /// The default value. This value should never be used.
34479        Unspecified,
34480        /// Connection used for establishing [private services
34481        /// access](https://cloud.google.com/vpc/docs/private-services-access).
34482        PrivateServiceAccess,
34483        /// Connection used for connecting to NetApp Cloud Volumes.
34484        NetappCloudVolumes,
34485        /// Connection used for connecting to Dell PowerScale.
34486        DellPowerscale,
34487        /// Connection used for connecting to third-party services.
34488        ThirdPartyService,
34489        /// If set, the enum was initialized with an unknown value.
34490        ///
34491        /// Applications can examine the value using [Type::value] or
34492        /// [Type::name].
34493        UnknownValue(r#type::UnknownValue),
34494    }
34495
34496    #[doc(hidden)]
34497    pub mod r#type {
34498        #[allow(unused_imports)]
34499        use super::*;
34500        #[derive(Clone, Debug, PartialEq)]
34501        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34502    }
34503
34504    impl Type {
34505        /// Gets the enum value.
34506        ///
34507        /// Returns `None` if the enum contains an unknown value deserialized from
34508        /// the string representation of enums.
34509        pub fn value(&self) -> std::option::Option<i32> {
34510            match self {
34511                Self::Unspecified => std::option::Option::Some(0),
34512                Self::PrivateServiceAccess => std::option::Option::Some(1),
34513                Self::NetappCloudVolumes => std::option::Option::Some(2),
34514                Self::DellPowerscale => std::option::Option::Some(3),
34515                Self::ThirdPartyService => std::option::Option::Some(4),
34516                Self::UnknownValue(u) => u.0.value(),
34517            }
34518        }
34519
34520        /// Gets the enum value as a string.
34521        ///
34522        /// Returns `None` if the enum contains an unknown value deserialized from
34523        /// the integer representation of enums.
34524        pub fn name(&self) -> std::option::Option<&str> {
34525            match self {
34526                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
34527                Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
34528                Self::NetappCloudVolumes => std::option::Option::Some("NETAPP_CLOUD_VOLUMES"),
34529                Self::DellPowerscale => std::option::Option::Some("DELL_POWERSCALE"),
34530                Self::ThirdPartyService => std::option::Option::Some("THIRD_PARTY_SERVICE"),
34531                Self::UnknownValue(u) => u.0.name(),
34532            }
34533        }
34534    }
34535
34536    impl std::default::Default for Type {
34537        fn default() -> Self {
34538            use std::convert::From;
34539            Self::from(0)
34540        }
34541    }
34542
34543    impl std::fmt::Display for Type {
34544        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34545            wkt::internal::display_enum(f, self.name(), self.value())
34546        }
34547    }
34548
34549    impl std::convert::From<i32> for Type {
34550        fn from(value: i32) -> Self {
34551            match value {
34552                0 => Self::Unspecified,
34553                1 => Self::PrivateServiceAccess,
34554                2 => Self::NetappCloudVolumes,
34555                3 => Self::DellPowerscale,
34556                4 => Self::ThirdPartyService,
34557                _ => Self::UnknownValue(r#type::UnknownValue(
34558                    wkt::internal::UnknownEnumValue::Integer(value),
34559                )),
34560            }
34561        }
34562    }
34563
34564    impl std::convert::From<&str> for Type {
34565        fn from(value: &str) -> Self {
34566            use std::string::ToString;
34567            match value {
34568                "TYPE_UNSPECIFIED" => Self::Unspecified,
34569                "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
34570                "NETAPP_CLOUD_VOLUMES" => Self::NetappCloudVolumes,
34571                "DELL_POWERSCALE" => Self::DellPowerscale,
34572                "THIRD_PARTY_SERVICE" => Self::ThirdPartyService,
34573                _ => Self::UnknownValue(r#type::UnknownValue(
34574                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34575                )),
34576            }
34577        }
34578    }
34579
34580    impl serde::ser::Serialize for Type {
34581        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34582        where
34583            S: serde::Serializer,
34584        {
34585            match self {
34586                Self::Unspecified => serializer.serialize_i32(0),
34587                Self::PrivateServiceAccess => serializer.serialize_i32(1),
34588                Self::NetappCloudVolumes => serializer.serialize_i32(2),
34589                Self::DellPowerscale => serializer.serialize_i32(3),
34590                Self::ThirdPartyService => serializer.serialize_i32(4),
34591                Self::UnknownValue(u) => u.0.serialize(serializer),
34592            }
34593        }
34594    }
34595
34596    impl<'de> serde::de::Deserialize<'de> for Type {
34597        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34598        where
34599            D: serde::Deserializer<'de>,
34600        {
34601            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
34602                ".google.cloud.vmwareengine.v1.PrivateConnection.Type",
34603            ))
34604        }
34605    }
34606
34607    /// Possible types for RoutingMode
34608    ///
34609    /// # Working with unknown values
34610    ///
34611    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34612    /// additional enum variants at any time. Adding new variants is not considered
34613    /// a breaking change. Applications should write their code in anticipation of:
34614    ///
34615    /// - New values appearing in future releases of the client library, **and**
34616    /// - New values received dynamically, without application changes.
34617    ///
34618    /// Please consult the [Working with enums] section in the user guide for some
34619    /// guidelines.
34620    ///
34621    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34622    #[derive(Clone, Debug, PartialEq)]
34623    #[non_exhaustive]
34624    pub enum RoutingMode {
34625        /// The default value. This value should never be used.
34626        Unspecified,
34627        /// Global Routing Mode
34628        Global,
34629        /// Regional Routing Mode
34630        Regional,
34631        /// If set, the enum was initialized with an unknown value.
34632        ///
34633        /// Applications can examine the value using [RoutingMode::value] or
34634        /// [RoutingMode::name].
34635        UnknownValue(routing_mode::UnknownValue),
34636    }
34637
34638    #[doc(hidden)]
34639    pub mod routing_mode {
34640        #[allow(unused_imports)]
34641        use super::*;
34642        #[derive(Clone, Debug, PartialEq)]
34643        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34644    }
34645
34646    impl RoutingMode {
34647        /// Gets the enum value.
34648        ///
34649        /// Returns `None` if the enum contains an unknown value deserialized from
34650        /// the string representation of enums.
34651        pub fn value(&self) -> std::option::Option<i32> {
34652            match self {
34653                Self::Unspecified => std::option::Option::Some(0),
34654                Self::Global => std::option::Option::Some(1),
34655                Self::Regional => std::option::Option::Some(2),
34656                Self::UnknownValue(u) => u.0.value(),
34657            }
34658        }
34659
34660        /// Gets the enum value as a string.
34661        ///
34662        /// Returns `None` if the enum contains an unknown value deserialized from
34663        /// the integer representation of enums.
34664        pub fn name(&self) -> std::option::Option<&str> {
34665            match self {
34666                Self::Unspecified => std::option::Option::Some("ROUTING_MODE_UNSPECIFIED"),
34667                Self::Global => std::option::Option::Some("GLOBAL"),
34668                Self::Regional => std::option::Option::Some("REGIONAL"),
34669                Self::UnknownValue(u) => u.0.name(),
34670            }
34671        }
34672    }
34673
34674    impl std::default::Default for RoutingMode {
34675        fn default() -> Self {
34676            use std::convert::From;
34677            Self::from(0)
34678        }
34679    }
34680
34681    impl std::fmt::Display for RoutingMode {
34682        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34683            wkt::internal::display_enum(f, self.name(), self.value())
34684        }
34685    }
34686
34687    impl std::convert::From<i32> for RoutingMode {
34688        fn from(value: i32) -> Self {
34689            match value {
34690                0 => Self::Unspecified,
34691                1 => Self::Global,
34692                2 => Self::Regional,
34693                _ => Self::UnknownValue(routing_mode::UnknownValue(
34694                    wkt::internal::UnknownEnumValue::Integer(value),
34695                )),
34696            }
34697        }
34698    }
34699
34700    impl std::convert::From<&str> for RoutingMode {
34701        fn from(value: &str) -> Self {
34702            use std::string::ToString;
34703            match value {
34704                "ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
34705                "GLOBAL" => Self::Global,
34706                "REGIONAL" => Self::Regional,
34707                _ => Self::UnknownValue(routing_mode::UnknownValue(
34708                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34709                )),
34710            }
34711        }
34712    }
34713
34714    impl serde::ser::Serialize for RoutingMode {
34715        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34716        where
34717            S: serde::Serializer,
34718        {
34719            match self {
34720                Self::Unspecified => serializer.serialize_i32(0),
34721                Self::Global => serializer.serialize_i32(1),
34722                Self::Regional => serializer.serialize_i32(2),
34723                Self::UnknownValue(u) => u.0.serialize(serializer),
34724            }
34725        }
34726    }
34727
34728    impl<'de> serde::de::Deserialize<'de> for RoutingMode {
34729        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34730        where
34731            D: serde::Deserializer<'de>,
34732        {
34733            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingMode>::new(
34734                ".google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode",
34735            ))
34736        }
34737    }
34738
34739    /// Enum PeeringState defines the possible states of peering between service
34740    /// network and the vpc network peered to service network
34741    ///
34742    /// # Working with unknown values
34743    ///
34744    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34745    /// additional enum variants at any time. Adding new variants is not considered
34746    /// a breaking change. Applications should write their code in anticipation of:
34747    ///
34748    /// - New values appearing in future releases of the client library, **and**
34749    /// - New values received dynamically, without application changes.
34750    ///
34751    /// Please consult the [Working with enums] section in the user guide for some
34752    /// guidelines.
34753    ///
34754    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34755    #[derive(Clone, Debug, PartialEq)]
34756    #[non_exhaustive]
34757    pub enum PeeringState {
34758        /// The default value. This value is used if the peering state is omitted or
34759        /// unknown.
34760        Unspecified,
34761        /// The peering is in active state.
34762        PeeringActive,
34763        /// The peering is in inactive state.
34764        PeeringInactive,
34765        /// If set, the enum was initialized with an unknown value.
34766        ///
34767        /// Applications can examine the value using [PeeringState::value] or
34768        /// [PeeringState::name].
34769        UnknownValue(peering_state::UnknownValue),
34770    }
34771
34772    #[doc(hidden)]
34773    pub mod peering_state {
34774        #[allow(unused_imports)]
34775        use super::*;
34776        #[derive(Clone, Debug, PartialEq)]
34777        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34778    }
34779
34780    impl PeeringState {
34781        /// Gets the enum value.
34782        ///
34783        /// Returns `None` if the enum contains an unknown value deserialized from
34784        /// the string representation of enums.
34785        pub fn value(&self) -> std::option::Option<i32> {
34786            match self {
34787                Self::Unspecified => std::option::Option::Some(0),
34788                Self::PeeringActive => std::option::Option::Some(1),
34789                Self::PeeringInactive => std::option::Option::Some(2),
34790                Self::UnknownValue(u) => u.0.value(),
34791            }
34792        }
34793
34794        /// Gets the enum value as a string.
34795        ///
34796        /// Returns `None` if the enum contains an unknown value deserialized from
34797        /// the integer representation of enums.
34798        pub fn name(&self) -> std::option::Option<&str> {
34799            match self {
34800                Self::Unspecified => std::option::Option::Some("PEERING_STATE_UNSPECIFIED"),
34801                Self::PeeringActive => std::option::Option::Some("PEERING_ACTIVE"),
34802                Self::PeeringInactive => std::option::Option::Some("PEERING_INACTIVE"),
34803                Self::UnknownValue(u) => u.0.name(),
34804            }
34805        }
34806    }
34807
34808    impl std::default::Default for PeeringState {
34809        fn default() -> Self {
34810            use std::convert::From;
34811            Self::from(0)
34812        }
34813    }
34814
34815    impl std::fmt::Display for PeeringState {
34816        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34817            wkt::internal::display_enum(f, self.name(), self.value())
34818        }
34819    }
34820
34821    impl std::convert::From<i32> for PeeringState {
34822        fn from(value: i32) -> Self {
34823            match value {
34824                0 => Self::Unspecified,
34825                1 => Self::PeeringActive,
34826                2 => Self::PeeringInactive,
34827                _ => Self::UnknownValue(peering_state::UnknownValue(
34828                    wkt::internal::UnknownEnumValue::Integer(value),
34829                )),
34830            }
34831        }
34832    }
34833
34834    impl std::convert::From<&str> for PeeringState {
34835        fn from(value: &str) -> Self {
34836            use std::string::ToString;
34837            match value {
34838                "PEERING_STATE_UNSPECIFIED" => Self::Unspecified,
34839                "PEERING_ACTIVE" => Self::PeeringActive,
34840                "PEERING_INACTIVE" => Self::PeeringInactive,
34841                _ => Self::UnknownValue(peering_state::UnknownValue(
34842                    wkt::internal::UnknownEnumValue::String(value.to_string()),
34843                )),
34844            }
34845        }
34846    }
34847
34848    impl serde::ser::Serialize for PeeringState {
34849        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34850        where
34851            S: serde::Serializer,
34852        {
34853            match self {
34854                Self::Unspecified => serializer.serialize_i32(0),
34855                Self::PeeringActive => serializer.serialize_i32(1),
34856                Self::PeeringInactive => serializer.serialize_i32(2),
34857                Self::UnknownValue(u) => u.0.serialize(serializer),
34858            }
34859        }
34860    }
34861
34862    impl<'de> serde::de::Deserialize<'de> for PeeringState {
34863        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34864        where
34865            D: serde::Deserializer<'de>,
34866        {
34867            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PeeringState>::new(
34868                ".google.cloud.vmwareengine.v1.PrivateConnection.PeeringState",
34869            ))
34870        }
34871    }
34872}
34873
34874/// VmwareEngine specific metadata for the given
34875/// [google.cloud.location.Location][google.cloud.location.Location]. It is
34876/// returned as a content of the `google.cloud.location.Location.metadata` field.
34877///
34878/// [google.cloud.location.Location]: location::model::Location
34879#[derive(Clone, Default, PartialEq)]
34880#[non_exhaustive]
34881pub struct LocationMetadata {
34882    /// Output only. Capabilities of this location.
34883    pub capabilities: std::vec::Vec<crate::model::location_metadata::Capability>,
34884
34885    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34886}
34887
34888impl LocationMetadata {
34889    pub fn new() -> Self {
34890        std::default::Default::default()
34891    }
34892
34893    /// Sets the value of [capabilities][crate::model::LocationMetadata::capabilities].
34894    pub fn set_capabilities<T, V>(mut self, v: T) -> Self
34895    where
34896        T: std::iter::IntoIterator<Item = V>,
34897        V: std::convert::Into<crate::model::location_metadata::Capability>,
34898    {
34899        use std::iter::Iterator;
34900        self.capabilities = v.into_iter().map(|i| i.into()).collect();
34901        self
34902    }
34903}
34904
34905impl wkt::message::Message for LocationMetadata {
34906    fn typename() -> &'static str {
34907        "type.googleapis.com/google.cloud.vmwareengine.v1.LocationMetadata"
34908    }
34909}
34910
34911#[doc(hidden)]
34912impl<'de> serde::de::Deserialize<'de> for LocationMetadata {
34913    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34914    where
34915        D: serde::Deserializer<'de>,
34916    {
34917        #[allow(non_camel_case_types)]
34918        #[doc(hidden)]
34919        #[derive(PartialEq, Eq, Hash)]
34920        enum __FieldTag {
34921            __capabilities,
34922            Unknown(std::string::String),
34923        }
34924        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34925            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34926            where
34927                D: serde::Deserializer<'de>,
34928            {
34929                struct Visitor;
34930                impl<'de> serde::de::Visitor<'de> for Visitor {
34931                    type Value = __FieldTag;
34932                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34933                        formatter.write_str("a field name for LocationMetadata")
34934                    }
34935                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34936                    where
34937                        E: serde::de::Error,
34938                    {
34939                        use std::result::Result::Ok;
34940                        use std::string::ToString;
34941                        match value {
34942                            "capabilities" => Ok(__FieldTag::__capabilities),
34943                            _ => Ok(__FieldTag::Unknown(value.to_string())),
34944                        }
34945                    }
34946                }
34947                deserializer.deserialize_identifier(Visitor)
34948            }
34949        }
34950        struct Visitor;
34951        impl<'de> serde::de::Visitor<'de> for Visitor {
34952            type Value = LocationMetadata;
34953            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34954                formatter.write_str("struct LocationMetadata")
34955            }
34956            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34957            where
34958                A: serde::de::MapAccess<'de>,
34959            {
34960                #[allow(unused_imports)]
34961                use serde::de::Error;
34962                use std::option::Option::Some;
34963                let mut fields = std::collections::HashSet::new();
34964                let mut result = Self::Value::new();
34965                while let Some(tag) = map.next_key::<__FieldTag>()? {
34966                    #[allow(clippy::match_single_binding)]
34967                    match tag {
34968                        __FieldTag::__capabilities => {
34969                            if !fields.insert(__FieldTag::__capabilities) {
34970                                return std::result::Result::Err(A::Error::duplicate_field(
34971                                    "multiple values for capabilities",
34972                                ));
34973                            }
34974                            result.capabilities = map
34975                                .next_value::<std::option::Option<
34976                                    std::vec::Vec<crate::model::location_metadata::Capability>,
34977                                >>()?
34978                                .unwrap_or_default();
34979                        }
34980                        __FieldTag::Unknown(key) => {
34981                            let value = map.next_value::<serde_json::Value>()?;
34982                            result._unknown_fields.insert(key, value);
34983                        }
34984                    }
34985                }
34986                std::result::Result::Ok(result)
34987            }
34988        }
34989        deserializer.deserialize_any(Visitor)
34990    }
34991}
34992
34993#[doc(hidden)]
34994impl serde::ser::Serialize for LocationMetadata {
34995    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34996    where
34997        S: serde::ser::Serializer,
34998    {
34999        use serde::ser::SerializeMap;
35000        #[allow(unused_imports)]
35001        use std::option::Option::Some;
35002        let mut state = serializer.serialize_map(std::option::Option::None)?;
35003        if !self.capabilities.is_empty() {
35004            state.serialize_entry("capabilities", &self.capabilities)?;
35005        }
35006        if !self._unknown_fields.is_empty() {
35007            for (key, value) in self._unknown_fields.iter() {
35008                state.serialize_entry(key, &value)?;
35009            }
35010        }
35011        state.end()
35012    }
35013}
35014
35015impl std::fmt::Debug for LocationMetadata {
35016    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35017        let mut debug_struct = f.debug_struct("LocationMetadata");
35018        debug_struct.field("capabilities", &self.capabilities);
35019        if !self._unknown_fields.is_empty() {
35020            debug_struct.field("_unknown_fields", &self._unknown_fields);
35021        }
35022        debug_struct.finish()
35023    }
35024}
35025
35026/// Defines additional types related to [LocationMetadata].
35027pub mod location_metadata {
35028    #[allow(unused_imports)]
35029    use super::*;
35030
35031    /// Capability of a location.
35032    ///
35033    /// # Working with unknown values
35034    ///
35035    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35036    /// additional enum variants at any time. Adding new variants is not considered
35037    /// a breaking change. Applications should write their code in anticipation of:
35038    ///
35039    /// - New values appearing in future releases of the client library, **and**
35040    /// - New values received dynamically, without application changes.
35041    ///
35042    /// Please consult the [Working with enums] section in the user guide for some
35043    /// guidelines.
35044    ///
35045    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35046    #[derive(Clone, Debug, PartialEq)]
35047    #[non_exhaustive]
35048    pub enum Capability {
35049        /// The default value. This value is used if the capability is omitted or
35050        /// unknown.
35051        Unspecified,
35052        /// Stretch clusters are supported in this location.
35053        StretchedClusters,
35054        /// If set, the enum was initialized with an unknown value.
35055        ///
35056        /// Applications can examine the value using [Capability::value] or
35057        /// [Capability::name].
35058        UnknownValue(capability::UnknownValue),
35059    }
35060
35061    #[doc(hidden)]
35062    pub mod capability {
35063        #[allow(unused_imports)]
35064        use super::*;
35065        #[derive(Clone, Debug, PartialEq)]
35066        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35067    }
35068
35069    impl Capability {
35070        /// Gets the enum value.
35071        ///
35072        /// Returns `None` if the enum contains an unknown value deserialized from
35073        /// the string representation of enums.
35074        pub fn value(&self) -> std::option::Option<i32> {
35075            match self {
35076                Self::Unspecified => std::option::Option::Some(0),
35077                Self::StretchedClusters => std::option::Option::Some(1),
35078                Self::UnknownValue(u) => u.0.value(),
35079            }
35080        }
35081
35082        /// Gets the enum value as a string.
35083        ///
35084        /// Returns `None` if the enum contains an unknown value deserialized from
35085        /// the integer representation of enums.
35086        pub fn name(&self) -> std::option::Option<&str> {
35087            match self {
35088                Self::Unspecified => std::option::Option::Some("CAPABILITY_UNSPECIFIED"),
35089                Self::StretchedClusters => std::option::Option::Some("STRETCHED_CLUSTERS"),
35090                Self::UnknownValue(u) => u.0.name(),
35091            }
35092        }
35093    }
35094
35095    impl std::default::Default for Capability {
35096        fn default() -> Self {
35097            use std::convert::From;
35098            Self::from(0)
35099        }
35100    }
35101
35102    impl std::fmt::Display for Capability {
35103        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35104            wkt::internal::display_enum(f, self.name(), self.value())
35105        }
35106    }
35107
35108    impl std::convert::From<i32> for Capability {
35109        fn from(value: i32) -> Self {
35110            match value {
35111                0 => Self::Unspecified,
35112                1 => Self::StretchedClusters,
35113                _ => Self::UnknownValue(capability::UnknownValue(
35114                    wkt::internal::UnknownEnumValue::Integer(value),
35115                )),
35116            }
35117        }
35118    }
35119
35120    impl std::convert::From<&str> for Capability {
35121        fn from(value: &str) -> Self {
35122            use std::string::ToString;
35123            match value {
35124                "CAPABILITY_UNSPECIFIED" => Self::Unspecified,
35125                "STRETCHED_CLUSTERS" => Self::StretchedClusters,
35126                _ => Self::UnknownValue(capability::UnknownValue(
35127                    wkt::internal::UnknownEnumValue::String(value.to_string()),
35128                )),
35129            }
35130        }
35131    }
35132
35133    impl serde::ser::Serialize for Capability {
35134        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35135        where
35136            S: serde::Serializer,
35137        {
35138            match self {
35139                Self::Unspecified => serializer.serialize_i32(0),
35140                Self::StretchedClusters => serializer.serialize_i32(1),
35141                Self::UnknownValue(u) => u.0.serialize(serializer),
35142            }
35143        }
35144    }
35145
35146    impl<'de> serde::de::Deserialize<'de> for Capability {
35147        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35148        where
35149            D: serde::Deserializer<'de>,
35150        {
35151            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Capability>::new(
35152                ".google.cloud.vmwareengine.v1.LocationMetadata.Capability",
35153            ))
35154        }
35155    }
35156}
35157
35158/// DnsBindPermission resource that contains the accounts having the consumer DNS
35159/// bind permission on the corresponding intranet VPC of the consumer project.
35160#[derive(Clone, Default, PartialEq)]
35161#[non_exhaustive]
35162pub struct DnsBindPermission {
35163    /// Required. Output only. The name of the resource which stores the
35164    /// users/service accounts having the permission to bind to the corresponding
35165    /// intranet VPC of the consumer project. DnsBindPermission is a global
35166    /// resource and location can only be global. Resource names are schemeless
35167    /// URIs that follow the conventions in
35168    /// <https://cloud.google.com/apis/design/resource_names>. For example:
35169    /// `projects/my-project/locations/global/dnsBindPermission`
35170    pub name: std::string::String,
35171
35172    /// Output only. Users/Service accounts which have access for binding on the
35173    /// intranet VPC project corresponding to the consumer project.
35174    pub principals: std::vec::Vec<crate::model::Principal>,
35175
35176    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35177}
35178
35179impl DnsBindPermission {
35180    pub fn new() -> Self {
35181        std::default::Default::default()
35182    }
35183
35184    /// Sets the value of [name][crate::model::DnsBindPermission::name].
35185    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35186        self.name = v.into();
35187        self
35188    }
35189
35190    /// Sets the value of [principals][crate::model::DnsBindPermission::principals].
35191    pub fn set_principals<T, V>(mut self, v: T) -> Self
35192    where
35193        T: std::iter::IntoIterator<Item = V>,
35194        V: std::convert::Into<crate::model::Principal>,
35195    {
35196        use std::iter::Iterator;
35197        self.principals = v.into_iter().map(|i| i.into()).collect();
35198        self
35199    }
35200}
35201
35202impl wkt::message::Message for DnsBindPermission {
35203    fn typename() -> &'static str {
35204        "type.googleapis.com/google.cloud.vmwareengine.v1.DnsBindPermission"
35205    }
35206}
35207
35208#[doc(hidden)]
35209impl<'de> serde::de::Deserialize<'de> for DnsBindPermission {
35210    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35211    where
35212        D: serde::Deserializer<'de>,
35213    {
35214        #[allow(non_camel_case_types)]
35215        #[doc(hidden)]
35216        #[derive(PartialEq, Eq, Hash)]
35217        enum __FieldTag {
35218            __name,
35219            __principals,
35220            Unknown(std::string::String),
35221        }
35222        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
35223            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35224            where
35225                D: serde::Deserializer<'de>,
35226            {
35227                struct Visitor;
35228                impl<'de> serde::de::Visitor<'de> for Visitor {
35229                    type Value = __FieldTag;
35230                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35231                        formatter.write_str("a field name for DnsBindPermission")
35232                    }
35233                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
35234                    where
35235                        E: serde::de::Error,
35236                    {
35237                        use std::result::Result::Ok;
35238                        use std::string::ToString;
35239                        match value {
35240                            "name" => Ok(__FieldTag::__name),
35241                            "principals" => Ok(__FieldTag::__principals),
35242                            _ => Ok(__FieldTag::Unknown(value.to_string())),
35243                        }
35244                    }
35245                }
35246                deserializer.deserialize_identifier(Visitor)
35247            }
35248        }
35249        struct Visitor;
35250        impl<'de> serde::de::Visitor<'de> for Visitor {
35251            type Value = DnsBindPermission;
35252            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35253                formatter.write_str("struct DnsBindPermission")
35254            }
35255            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35256            where
35257                A: serde::de::MapAccess<'de>,
35258            {
35259                #[allow(unused_imports)]
35260                use serde::de::Error;
35261                use std::option::Option::Some;
35262                let mut fields = std::collections::HashSet::new();
35263                let mut result = Self::Value::new();
35264                while let Some(tag) = map.next_key::<__FieldTag>()? {
35265                    #[allow(clippy::match_single_binding)]
35266                    match tag {
35267                        __FieldTag::__name => {
35268                            if !fields.insert(__FieldTag::__name) {
35269                                return std::result::Result::Err(A::Error::duplicate_field(
35270                                    "multiple values for name",
35271                                ));
35272                            }
35273                            result.name = map
35274                                .next_value::<std::option::Option<std::string::String>>()?
35275                                .unwrap_or_default();
35276                        }
35277                        __FieldTag::__principals => {
35278                            if !fields.insert(__FieldTag::__principals) {
35279                                return std::result::Result::Err(A::Error::duplicate_field(
35280                                    "multiple values for principals",
35281                                ));
35282                            }
35283                            result.principals = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Principal>>>()?.unwrap_or_default();
35284                        }
35285                        __FieldTag::Unknown(key) => {
35286                            let value = map.next_value::<serde_json::Value>()?;
35287                            result._unknown_fields.insert(key, value);
35288                        }
35289                    }
35290                }
35291                std::result::Result::Ok(result)
35292            }
35293        }
35294        deserializer.deserialize_any(Visitor)
35295    }
35296}
35297
35298#[doc(hidden)]
35299impl serde::ser::Serialize for DnsBindPermission {
35300    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35301    where
35302        S: serde::ser::Serializer,
35303    {
35304        use serde::ser::SerializeMap;
35305        #[allow(unused_imports)]
35306        use std::option::Option::Some;
35307        let mut state = serializer.serialize_map(std::option::Option::None)?;
35308        if !self.name.is_empty() {
35309            state.serialize_entry("name", &self.name)?;
35310        }
35311        if !self.principals.is_empty() {
35312            state.serialize_entry("principals", &self.principals)?;
35313        }
35314        if !self._unknown_fields.is_empty() {
35315            for (key, value) in self._unknown_fields.iter() {
35316                state.serialize_entry(key, &value)?;
35317            }
35318        }
35319        state.end()
35320    }
35321}
35322
35323impl std::fmt::Debug for DnsBindPermission {
35324    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35325        let mut debug_struct = f.debug_struct("DnsBindPermission");
35326        debug_struct.field("name", &self.name);
35327        debug_struct.field("principals", &self.principals);
35328        if !self._unknown_fields.is_empty() {
35329            debug_struct.field("_unknown_fields", &self._unknown_fields);
35330        }
35331        debug_struct.finish()
35332    }
35333}
35334
35335/// Users/Service accounts which have access for DNS binding on the intranet
35336/// VPC corresponding to the consumer project.
35337#[derive(Clone, Default, PartialEq)]
35338#[non_exhaustive]
35339pub struct Principal {
35340    /// The consumer provided user/service account which needs to be
35341    /// granted permission to DNS bind with the intranet VPC corresponding to the
35342    /// consumer project.
35343    pub principal: std::option::Option<crate::model::principal::Principal>,
35344
35345    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35346}
35347
35348impl Principal {
35349    pub fn new() -> Self {
35350        std::default::Default::default()
35351    }
35352
35353    /// Sets the value of [principal][crate::model::Principal::principal].
35354    ///
35355    /// Note that all the setters affecting `principal` are mutually
35356    /// exclusive.
35357    pub fn set_principal<
35358        T: std::convert::Into<std::option::Option<crate::model::principal::Principal>>,
35359    >(
35360        mut self,
35361        v: T,
35362    ) -> Self {
35363        self.principal = v.into();
35364        self
35365    }
35366
35367    /// The value of [principal][crate::model::Principal::principal]
35368    /// if it holds a `User`, `None` if the field is not set or
35369    /// holds a different branch.
35370    pub fn user(&self) -> std::option::Option<&std::string::String> {
35371        #[allow(unreachable_patterns)]
35372        self.principal.as_ref().and_then(|v| match v {
35373            crate::model::principal::Principal::User(v) => std::option::Option::Some(v),
35374            _ => std::option::Option::None,
35375        })
35376    }
35377
35378    /// Sets the value of [principal][crate::model::Principal::principal]
35379    /// to hold a `User`.
35380    ///
35381    /// Note that all the setters affecting `principal` are
35382    /// mutually exclusive.
35383    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35384        self.principal =
35385            std::option::Option::Some(crate::model::principal::Principal::User(v.into()));
35386        self
35387    }
35388
35389    /// The value of [principal][crate::model::Principal::principal]
35390    /// if it holds a `ServiceAccount`, `None` if the field is not set or
35391    /// holds a different branch.
35392    pub fn service_account(&self) -> std::option::Option<&std::string::String> {
35393        #[allow(unreachable_patterns)]
35394        self.principal.as_ref().and_then(|v| match v {
35395            crate::model::principal::Principal::ServiceAccount(v) => std::option::Option::Some(v),
35396            _ => std::option::Option::None,
35397        })
35398    }
35399
35400    /// Sets the value of [principal][crate::model::Principal::principal]
35401    /// to hold a `ServiceAccount`.
35402    ///
35403    /// Note that all the setters affecting `principal` are
35404    /// mutually exclusive.
35405    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35406        self.principal =
35407            std::option::Option::Some(crate::model::principal::Principal::ServiceAccount(v.into()));
35408        self
35409    }
35410}
35411
35412impl wkt::message::Message for Principal {
35413    fn typename() -> &'static str {
35414        "type.googleapis.com/google.cloud.vmwareengine.v1.Principal"
35415    }
35416}
35417
35418#[doc(hidden)]
35419impl<'de> serde::de::Deserialize<'de> for Principal {
35420    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35421    where
35422        D: serde::Deserializer<'de>,
35423    {
35424        #[allow(non_camel_case_types)]
35425        #[doc(hidden)]
35426        #[derive(PartialEq, Eq, Hash)]
35427        enum __FieldTag {
35428            __user,
35429            __service_account,
35430            Unknown(std::string::String),
35431        }
35432        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
35433            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35434            where
35435                D: serde::Deserializer<'de>,
35436            {
35437                struct Visitor;
35438                impl<'de> serde::de::Visitor<'de> for Visitor {
35439                    type Value = __FieldTag;
35440                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35441                        formatter.write_str("a field name for Principal")
35442                    }
35443                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
35444                    where
35445                        E: serde::de::Error,
35446                    {
35447                        use std::result::Result::Ok;
35448                        use std::string::ToString;
35449                        match value {
35450                            "user" => Ok(__FieldTag::__user),
35451                            "serviceAccount" => Ok(__FieldTag::__service_account),
35452                            "service_account" => Ok(__FieldTag::__service_account),
35453                            _ => Ok(__FieldTag::Unknown(value.to_string())),
35454                        }
35455                    }
35456                }
35457                deserializer.deserialize_identifier(Visitor)
35458            }
35459        }
35460        struct Visitor;
35461        impl<'de> serde::de::Visitor<'de> for Visitor {
35462            type Value = Principal;
35463            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35464                formatter.write_str("struct Principal")
35465            }
35466            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35467            where
35468                A: serde::de::MapAccess<'de>,
35469            {
35470                #[allow(unused_imports)]
35471                use serde::de::Error;
35472                use std::option::Option::Some;
35473                let mut fields = std::collections::HashSet::new();
35474                let mut result = Self::Value::new();
35475                while let Some(tag) = map.next_key::<__FieldTag>()? {
35476                    #[allow(clippy::match_single_binding)]
35477                    match tag {
35478                        __FieldTag::__user => {
35479                            if !fields.insert(__FieldTag::__user) {
35480                                return std::result::Result::Err(A::Error::duplicate_field(
35481                                    "multiple values for user",
35482                                ));
35483                            }
35484                            if result.principal.is_some() {
35485                                return std::result::Result::Err(A::Error::duplicate_field(
35486                                    "multiple values for `principal`, a oneof with full ID .google.cloud.vmwareengine.v1.Principal.user, latest field was user",
35487                                ));
35488                            }
35489                            result.principal = std::option::Option::Some(
35490                                crate::model::principal::Principal::User(
35491                                    map.next_value::<std::option::Option<std::string::String>>()?
35492                                        .unwrap_or_default(),
35493                                ),
35494                            );
35495                        }
35496                        __FieldTag::__service_account => {
35497                            if !fields.insert(__FieldTag::__service_account) {
35498                                return std::result::Result::Err(A::Error::duplicate_field(
35499                                    "multiple values for service_account",
35500                                ));
35501                            }
35502                            if result.principal.is_some() {
35503                                return std::result::Result::Err(A::Error::duplicate_field(
35504                                    "multiple values for `principal`, a oneof with full ID .google.cloud.vmwareengine.v1.Principal.service_account, latest field was serviceAccount",
35505                                ));
35506                            }
35507                            result.principal = std::option::Option::Some(
35508                                crate::model::principal::Principal::ServiceAccount(
35509                                    map.next_value::<std::option::Option<std::string::String>>()?
35510                                        .unwrap_or_default(),
35511                                ),
35512                            );
35513                        }
35514                        __FieldTag::Unknown(key) => {
35515                            let value = map.next_value::<serde_json::Value>()?;
35516                            result._unknown_fields.insert(key, value);
35517                        }
35518                    }
35519                }
35520                std::result::Result::Ok(result)
35521            }
35522        }
35523        deserializer.deserialize_any(Visitor)
35524    }
35525}
35526
35527#[doc(hidden)]
35528impl serde::ser::Serialize for Principal {
35529    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35530    where
35531        S: serde::ser::Serializer,
35532    {
35533        use serde::ser::SerializeMap;
35534        #[allow(unused_imports)]
35535        use std::option::Option::Some;
35536        let mut state = serializer.serialize_map(std::option::Option::None)?;
35537        if let Some(value) = self.user() {
35538            state.serialize_entry("user", value)?;
35539        }
35540        if let Some(value) = self.service_account() {
35541            state.serialize_entry("serviceAccount", value)?;
35542        }
35543        if !self._unknown_fields.is_empty() {
35544            for (key, value) in self._unknown_fields.iter() {
35545                state.serialize_entry(key, &value)?;
35546            }
35547        }
35548        state.end()
35549    }
35550}
35551
35552impl std::fmt::Debug for Principal {
35553    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35554        let mut debug_struct = f.debug_struct("Principal");
35555        debug_struct.field("principal", &self.principal);
35556        if !self._unknown_fields.is_empty() {
35557            debug_struct.field("_unknown_fields", &self._unknown_fields);
35558        }
35559        debug_struct.finish()
35560    }
35561}
35562
35563/// Defines additional types related to [Principal].
35564pub mod principal {
35565    #[allow(unused_imports)]
35566    use super::*;
35567
35568    /// The consumer provided user/service account which needs to be
35569    /// granted permission to DNS bind with the intranet VPC corresponding to the
35570    /// consumer project.
35571    #[derive(Clone, Debug, PartialEq)]
35572    #[non_exhaustive]
35573    pub enum Principal {
35574        /// The user who needs to be granted permission.
35575        User(std::string::String),
35576        /// The service account which needs to be granted the permission.
35577        ServiceAccount(std::string::String),
35578    }
35579}