google_cloud_networkconnectivity_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 rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38/// Represents the metadata of the long-running operation.
39#[serde_with::serde_as]
40#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(default, rename_all = "camelCase")]
42#[non_exhaustive]
43pub struct OperationMetadata {
44    /// Output only. The time the operation was created.
45    #[serde(skip_serializing_if = "std::option::Option::is_none")]
46    pub create_time: std::option::Option<wkt::Timestamp>,
47
48    /// Output only. The time the operation finished running.
49    #[serde(skip_serializing_if = "std::option::Option::is_none")]
50    pub end_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Server-defined resource path for the target of the operation.
53    #[serde(skip_serializing_if = "std::string::String::is_empty")]
54    pub target: std::string::String,
55
56    /// Output only. Name of the verb executed by the operation.
57    #[serde(skip_serializing_if = "std::string::String::is_empty")]
58    pub verb: std::string::String,
59
60    /// Output only. Human-readable status of the operation, if any.
61    #[serde(skip_serializing_if = "std::string::String::is_empty")]
62    pub status_message: std::string::String,
63
64    /// Output only. Identifies whether the user has requested cancellation
65    /// of the operation. Operations that have been cancelled successfully
66    /// have
67    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
68    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
69    /// corresponding to `Code.CANCELLED`.
70    ///
71    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
72    /// [google.rpc.Status.code]: rpc::model::Status::code
73    #[serde(skip_serializing_if = "wkt::internal::is_default")]
74    pub requested_cancellation: bool,
75
76    /// Output only. API version used to start the operation.
77    #[serde(skip_serializing_if = "std::string::String::is_empty")]
78    pub api_version: std::string::String,
79
80    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
81    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
82}
83
84impl OperationMetadata {
85    pub fn new() -> Self {
86        std::default::Default::default()
87    }
88
89    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
90    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
91        mut self,
92        v: T,
93    ) -> Self {
94        self.create_time = v.into();
95        self
96    }
97
98    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
99    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
100        mut self,
101        v: T,
102    ) -> Self {
103        self.end_time = v.into();
104        self
105    }
106
107    /// Sets the value of [target][crate::model::OperationMetadata::target].
108    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
109        self.target = v.into();
110        self
111    }
112
113    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
114    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115        self.verb = v.into();
116        self
117    }
118
119    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
120    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121        self.status_message = v.into();
122        self
123    }
124
125    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
126    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
127        self.requested_cancellation = v.into();
128        self
129    }
130
131    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
132    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133        self.api_version = v.into();
134        self
135    }
136}
137
138impl wkt::message::Message for OperationMetadata {
139    fn typename() -> &'static str {
140        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
141    }
142}
143
144/// The ServiceConnectionMap resource.
145#[serde_with::serde_as]
146#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
147#[serde(default, rename_all = "camelCase")]
148#[non_exhaustive]
149pub struct ServiceConnectionMap {
150    /// Immutable. The name of a ServiceConnectionMap.
151    /// Format:
152    /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
153    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
155    pub name: std::string::String,
156
157    /// Output only. Time when the ServiceConnectionMap was created.
158    #[serde(skip_serializing_if = "std::option::Option::is_none")]
159    pub create_time: std::option::Option<wkt::Timestamp>,
160
161    /// Output only. Time when the ServiceConnectionMap was updated.
162    #[serde(skip_serializing_if = "std::option::Option::is_none")]
163    pub update_time: std::option::Option<wkt::Timestamp>,
164
165    /// User-defined labels.
166    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
167    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
168
169    /// A description of this resource.
170    #[serde(skip_serializing_if = "std::string::String::is_empty")]
171    pub description: std::string::String,
172
173    /// The service class identifier this ServiceConnectionMap is for.
174    /// The user of ServiceConnectionMap create API needs to have
175    /// networkconnecitivty.serviceclasses.use iam permission for the service
176    /// class.
177    #[serde(skip_serializing_if = "std::string::String::is_empty")]
178    pub service_class: std::string::String,
179
180    /// Output only. The service class uri this ServiceConnectionMap is for.
181    #[serde(skip_serializing_if = "std::string::String::is_empty")]
182    pub service_class_uri: std::string::String,
183
184    /// Output only. The infrastructure used for connections between
185    /// consumers/producers.
186    pub infrastructure: crate::model::Infrastructure,
187
188    /// The PSC configurations on producer side.
189    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
190    pub producer_psc_configs:
191        std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
192
193    /// The PSC configurations on consumer side.
194    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
195    pub consumer_psc_configs:
196        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
197
198    /// Output only. PSC connection details on consumer side.
199    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
200    pub consumer_psc_connections:
201        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
202
203    /// The token provided by the consumer. This token authenticates that the
204    /// consumer can create a connection within the specified project and network.
205    #[serde(skip_serializing_if = "std::string::String::is_empty")]
206    pub token: std::string::String,
207
208    /// Optional. The etag is computed by the server, and may be sent on update and
209    /// delete requests to ensure the client has an up-to-date value before
210    /// proceeding.
211    #[serde(skip_serializing_if = "std::option::Option::is_none")]
212    pub etag: std::option::Option<std::string::String>,
213
214    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
215    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
216}
217
218impl ServiceConnectionMap {
219    pub fn new() -> Self {
220        std::default::Default::default()
221    }
222
223    /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
224    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
225        self.name = v.into();
226        self
227    }
228
229    /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
230    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
231        mut self,
232        v: T,
233    ) -> Self {
234        self.create_time = v.into();
235        self
236    }
237
238    /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
239    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
240        mut self,
241        v: T,
242    ) -> Self {
243        self.update_time = v.into();
244        self
245    }
246
247    /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
248    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
249    where
250        T: std::iter::IntoIterator<Item = (K, V)>,
251        K: std::convert::Into<std::string::String>,
252        V: std::convert::Into<std::string::String>,
253    {
254        use std::iter::Iterator;
255        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
256        self
257    }
258
259    /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
260    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
261        self.description = v.into();
262        self
263    }
264
265    /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
266    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
267        self.service_class = v.into();
268        self
269    }
270
271    /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
272    pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
273        mut self,
274        v: T,
275    ) -> Self {
276        self.service_class_uri = v.into();
277        self
278    }
279
280    /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
281    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
282        mut self,
283        v: T,
284    ) -> Self {
285        self.infrastructure = v.into();
286        self
287    }
288
289    /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
290    pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
291    where
292        T: std::iter::IntoIterator<Item = V>,
293        V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
294    {
295        use std::iter::Iterator;
296        self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
297        self
298    }
299
300    /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
301    pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
302    where
303        T: std::iter::IntoIterator<Item = V>,
304        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
305    {
306        use std::iter::Iterator;
307        self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
308        self
309    }
310
311    /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
312    pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
313    where
314        T: std::iter::IntoIterator<Item = V>,
315        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
316    {
317        use std::iter::Iterator;
318        self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
319        self
320    }
321
322    /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
323    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
324        self.token = v.into();
325        self
326    }
327
328    /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
329    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
330        mut self,
331        v: T,
332    ) -> Self {
333        self.etag = v.into();
334        self
335    }
336}
337
338impl wkt::message::Message for ServiceConnectionMap {
339    fn typename() -> &'static str {
340        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
341    }
342}
343
344/// Defines additional types related to [ServiceConnectionMap].
345pub mod service_connection_map {
346    #[allow(unused_imports)]
347    use super::*;
348
349    /// The PSC configurations on producer side.
350    #[serde_with::serde_as]
351    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
352    #[serde(default, rename_all = "camelCase")]
353    #[non_exhaustive]
354    pub struct ProducerPscConfig {
355        /// The resource path of a service attachment.
356        /// Example:
357        /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
358        #[serde(skip_serializing_if = "std::string::String::is_empty")]
359        pub service_attachment_uri: std::string::String,
360
361        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
362        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
363    }
364
365    impl ProducerPscConfig {
366        pub fn new() -> Self {
367            std::default::Default::default()
368        }
369
370        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
371        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
372            mut self,
373            v: T,
374        ) -> Self {
375            self.service_attachment_uri = v.into();
376            self
377        }
378    }
379
380    impl wkt::message::Message for ProducerPscConfig {
381        fn typename() -> &'static str {
382            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
383        }
384    }
385
386    /// Allow the producer to specify which consumers can connect to it.
387    #[serde_with::serde_as]
388    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
389    #[serde(default, rename_all = "camelCase")]
390    #[non_exhaustive]
391    pub struct ConsumerPscConfig {
392        /// The consumer project where PSC connections are allowed to be created in.
393        #[serde(skip_serializing_if = "std::string::String::is_empty")]
394        pub project: std::string::String,
395
396        /// The resource path of the consumer network where PSC connections are
397        /// allowed to be created in. Note, this network does not need be in the
398        /// ConsumerPscConfig.project in the case of SharedVPC.
399        /// Example:
400        /// projects/{projectNumOrId}/global/networks/{networkId}.
401        #[serde(skip_serializing_if = "std::string::String::is_empty")]
402        pub network: std::string::String,
403
404        /// This is used in PSC consumer ForwardingRule to control whether the PSC
405        /// endpoint can be accessed from another region.
406        #[serde(skip_serializing_if = "wkt::internal::is_default")]
407        pub disable_global_access: bool,
408
409        /// Output only. Overall state of PSC Connections management for this
410        /// consumer psc config.
411        pub state: crate::model::service_connection_map::consumer_psc_config::State,
412
413        /// Immutable. Deprecated. Use producer_instance_metadata instead.
414        /// An immutable identifier for the producer instance.
415        #[serde(skip_serializing_if = "std::string::String::is_empty")]
416        #[deprecated]
417        pub producer_instance_id: std::string::String,
418
419        /// Output only. A map to store mapping between customer vip and target
420        /// service attachment. Only service attachment with producer specified ip
421        /// addresses are stored here.
422        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
423        pub service_attachment_ip_address_map:
424            std::collections::HashMap<std::string::String, std::string::String>,
425
426        /// Required. The project ID or project number of the consumer project. This
427        /// project is the one that the consumer uses to interact with the producer
428        /// instance. From the perspective of a consumer who's created a producer
429        /// instance, this is the project of the producer instance. Format:
430        /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
431        /// 'projects/1234'
432        #[serde(skip_serializing_if = "std::string::String::is_empty")]
433        pub consumer_instance_project: std::string::String,
434
435        /// Immutable. An immutable map for the producer instance metadata.
436        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
437        pub producer_instance_metadata:
438            std::collections::HashMap<std::string::String, std::string::String>,
439
440        /// The requested IP version for the PSC connection.
441        #[serde(skip_serializing_if = "std::option::Option::is_none")]
442        pub ip_version: std::option::Option<crate::model::IPVersion>,
443
444        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
445        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
446    }
447
448    impl ConsumerPscConfig {
449        pub fn new() -> Self {
450            std::default::Default::default()
451        }
452
453        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
454        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
455            self.project = v.into();
456            self
457        }
458
459        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
460        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
461            self.network = v.into();
462            self
463        }
464
465        /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
466        pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
467            self.disable_global_access = v.into();
468            self
469        }
470
471        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
472        pub fn set_state<
473            T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
474        >(
475            mut self,
476            v: T,
477        ) -> Self {
478            self.state = v.into();
479            self
480        }
481
482        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
483        #[deprecated]
484        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
485            mut self,
486            v: T,
487        ) -> Self {
488            self.producer_instance_id = v.into();
489            self
490        }
491
492        /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
493        pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
494        where
495            T: std::iter::IntoIterator<Item = (K, V)>,
496            K: std::convert::Into<std::string::String>,
497            V: std::convert::Into<std::string::String>,
498        {
499            use std::iter::Iterator;
500            self.service_attachment_ip_address_map =
501                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
502            self
503        }
504
505        /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
506        pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
507            mut self,
508            v: T,
509        ) -> Self {
510            self.consumer_instance_project = v.into();
511            self
512        }
513
514        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
515        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
516        where
517            T: std::iter::IntoIterator<Item = (K, V)>,
518            K: std::convert::Into<std::string::String>,
519            V: std::convert::Into<std::string::String>,
520        {
521            use std::iter::Iterator;
522            self.producer_instance_metadata =
523                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
524            self
525        }
526
527        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
528        pub fn set_ip_version<
529            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
530        >(
531            mut self,
532            v: T,
533        ) -> Self {
534            self.ip_version = v.into();
535            self
536        }
537    }
538
539    impl wkt::message::Message for ConsumerPscConfig {
540        fn typename() -> &'static str {
541            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
542        }
543    }
544
545    /// Defines additional types related to [ConsumerPscConfig].
546    pub mod consumer_psc_config {
547        #[allow(unused_imports)]
548        use super::*;
549
550        /// PSC Consumer Config State.
551        ///
552        /// # Working with unknown values
553        ///
554        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
555        /// additional enum variants at any time. Adding new variants is not considered
556        /// a breaking change. Applications should write their code in anticipation of:
557        ///
558        /// - New values appearing in future releases of the client library, **and**
559        /// - New values received dynamically, without application changes.
560        ///
561        /// Please consult the [Working with enums] section in the user guide for some
562        /// guidelines.
563        ///
564        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
565        #[derive(Clone, Debug, PartialEq)]
566        #[non_exhaustive]
567        pub enum State {
568            /// Default state, when Connection Map is created initially.
569            Unspecified,
570            /// Set when policy and map configuration is valid,
571            /// and their matching can lead to allowing creation of PSC Connections
572            /// subject to other constraints like connections limit.
573            Valid,
574            /// No Service Connection Policy found for this network and Service
575            /// Class
576            ConnectionPolicyMissing,
577            /// Service Connection Policy limit reached for this network and Service
578            /// Class
579            PolicyLimitReached,
580            /// The consumer instance project is not in
581            /// AllowedGoogleProducersResourceHierarchyLevels of the matching
582            /// ServiceConnectionPolicy.
583            ConsumerInstanceProjectNotAllowlisted,
584            /// If set, the enum was initialized with an unknown value.
585            ///
586            /// Applications can examine the value using [State::value] or
587            /// [State::name].
588            UnknownValue(state::UnknownValue),
589        }
590
591        #[doc(hidden)]
592        pub mod state {
593            #[allow(unused_imports)]
594            use super::*;
595            #[derive(Clone, Debug, PartialEq)]
596            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
597        }
598
599        impl State {
600            /// Gets the enum value.
601            ///
602            /// Returns `None` if the enum contains an unknown value deserialized from
603            /// the string representation of enums.
604            pub fn value(&self) -> std::option::Option<i32> {
605                match self {
606                    Self::Unspecified => std::option::Option::Some(0),
607                    Self::Valid => std::option::Option::Some(1),
608                    Self::ConnectionPolicyMissing => std::option::Option::Some(2),
609                    Self::PolicyLimitReached => std::option::Option::Some(3),
610                    Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
611                    Self::UnknownValue(u) => u.0.value(),
612                }
613            }
614
615            /// Gets the enum value as a string.
616            ///
617            /// Returns `None` if the enum contains an unknown value deserialized from
618            /// the integer representation of enums.
619            pub fn name(&self) -> std::option::Option<&str> {
620                match self {
621                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
622                    Self::Valid => std::option::Option::Some("VALID"),
623                    Self::ConnectionPolicyMissing => {
624                        std::option::Option::Some("CONNECTION_POLICY_MISSING")
625                    }
626                    Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
627                    Self::ConsumerInstanceProjectNotAllowlisted => {
628                        std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
629                    }
630                    Self::UnknownValue(u) => u.0.name(),
631                }
632            }
633        }
634
635        impl std::default::Default for State {
636            fn default() -> Self {
637                use std::convert::From;
638                Self::from(0)
639            }
640        }
641
642        impl std::fmt::Display for State {
643            fn fmt(
644                &self,
645                f: &mut std::fmt::Formatter<'_>,
646            ) -> std::result::Result<(), std::fmt::Error> {
647                wkt::internal::display_enum(f, self.name(), self.value())
648            }
649        }
650
651        impl std::convert::From<i32> for State {
652            fn from(value: i32) -> Self {
653                match value {
654                    0 => Self::Unspecified,
655                    1 => Self::Valid,
656                    2 => Self::ConnectionPolicyMissing,
657                    3 => Self::PolicyLimitReached,
658                    4 => Self::ConsumerInstanceProjectNotAllowlisted,
659                    _ => Self::UnknownValue(state::UnknownValue(
660                        wkt::internal::UnknownEnumValue::Integer(value),
661                    )),
662                }
663            }
664        }
665
666        impl std::convert::From<&str> for State {
667            fn from(value: &str) -> Self {
668                use std::string::ToString;
669                match value {
670                    "STATE_UNSPECIFIED" => Self::Unspecified,
671                    "VALID" => Self::Valid,
672                    "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
673                    "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
674                    "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
675                        Self::ConsumerInstanceProjectNotAllowlisted
676                    }
677                    _ => Self::UnknownValue(state::UnknownValue(
678                        wkt::internal::UnknownEnumValue::String(value.to_string()),
679                    )),
680                }
681            }
682        }
683
684        impl serde::ser::Serialize for State {
685            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
686            where
687                S: serde::Serializer,
688            {
689                match self {
690                    Self::Unspecified => serializer.serialize_i32(0),
691                    Self::Valid => serializer.serialize_i32(1),
692                    Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
693                    Self::PolicyLimitReached => serializer.serialize_i32(3),
694                    Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
695                    Self::UnknownValue(u) => u.0.serialize(serializer),
696                }
697            }
698        }
699
700        impl<'de> serde::de::Deserialize<'de> for State {
701            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
702            where
703                D: serde::Deserializer<'de>,
704            {
705                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
706                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
707            }
708        }
709    }
710
711    /// PSC connection details on consumer side.
712    #[serde_with::serde_as]
713    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
714    #[serde(default, rename_all = "camelCase")]
715    #[non_exhaustive]
716    pub struct ConsumerPscConnection {
717        /// The URI of a service attachment which is the target of the PSC
718        /// connection.
719        #[serde(skip_serializing_if = "std::string::String::is_empty")]
720        pub service_attachment_uri: std::string::String,
721
722        /// The state of the PSC connection.
723        pub state: crate::model::service_connection_map::consumer_psc_connection::State,
724
725        /// The consumer project whose PSC forwarding rule is connected to the
726        /// service attachments in this service connection map.
727        #[serde(skip_serializing_if = "std::string::String::is_empty")]
728        pub project: std::string::String,
729
730        /// The consumer network whose PSC forwarding rule is connected to the
731        /// service attachments in this service connection map.
732        /// Note that the network could be on a different project (shared VPC).
733        #[serde(skip_serializing_if = "std::string::String::is_empty")]
734        pub network: std::string::String,
735
736        /// The PSC connection id of the PSC forwarding rule connected
737        /// to the service attachments in this service connection map.
738        #[serde(skip_serializing_if = "std::string::String::is_empty")]
739        pub psc_connection_id: std::string::String,
740
741        /// The IP literal allocated on the consumer network for the PSC forwarding
742        /// rule that is created to connect to the producer service attachment in
743        /// this service connection map.
744        #[serde(skip_serializing_if = "std::string::String::is_empty")]
745        pub ip: std::string::String,
746
747        /// The error type indicates whether the error is consumer facing, producer
748        /// facing or system internal.
749        #[deprecated]
750        pub error_type: crate::model::ConnectionErrorType,
751
752        /// The most recent error during operating this connection.
753        #[serde(skip_serializing_if = "std::option::Option::is_none")]
754        #[deprecated]
755        pub error: std::option::Option<rpc::model::Status>,
756
757        /// The last Compute Engine operation to setup PSC connection.
758        #[serde(skip_serializing_if = "std::string::String::is_empty")]
759        pub gce_operation: std::string::String,
760
761        /// The URI of the consumer forwarding rule created.
762        /// Example:
763        /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
764        #[serde(skip_serializing_if = "std::string::String::is_empty")]
765        pub forwarding_rule: std::string::String,
766
767        /// Output only. The error info for the latest error during operating this
768        /// connection.
769        #[serde(skip_serializing_if = "std::option::Option::is_none")]
770        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
771
772        /// Output only. The URI of the selected subnetwork selected to allocate IP
773        /// address for this connection.
774        #[serde(skip_serializing_if = "std::string::String::is_empty")]
775        pub selected_subnetwork: std::string::String,
776
777        /// Immutable. Deprecated. Use producer_instance_metadata instead.
778        /// An immutable identifier for the producer instance.
779        #[serde(skip_serializing_if = "std::string::String::is_empty")]
780        #[deprecated]
781        pub producer_instance_id: std::string::String,
782
783        /// Immutable. An immutable map for the producer instance metadata.
784        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
785        pub producer_instance_metadata:
786            std::collections::HashMap<std::string::String, std::string::String>,
787
788        /// The requested IP version for the PSC connection.
789        #[serde(skip_serializing_if = "std::option::Option::is_none")]
790        pub ip_version: std::option::Option<crate::model::IPVersion>,
791
792        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
793        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
794    }
795
796    impl ConsumerPscConnection {
797        pub fn new() -> Self {
798            std::default::Default::default()
799        }
800
801        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
802        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
803            mut self,
804            v: T,
805        ) -> Self {
806            self.service_attachment_uri = v.into();
807            self
808        }
809
810        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
811        pub fn set_state<
812            T: std::convert::Into<
813                    crate::model::service_connection_map::consumer_psc_connection::State,
814                >,
815        >(
816            mut self,
817            v: T,
818        ) -> Self {
819            self.state = v.into();
820            self
821        }
822
823        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
824        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
825            self.project = v.into();
826            self
827        }
828
829        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
830        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
831            self.network = v.into();
832            self
833        }
834
835        /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
836        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
837            mut self,
838            v: T,
839        ) -> Self {
840            self.psc_connection_id = v.into();
841            self
842        }
843
844        /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
845        pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846            self.ip = v.into();
847            self
848        }
849
850        /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
851        #[deprecated]
852        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
853            mut self,
854            v: T,
855        ) -> Self {
856            self.error_type = v.into();
857            self
858        }
859
860        /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
861        #[deprecated]
862        pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
863            mut self,
864            v: T,
865        ) -> Self {
866            self.error = v.into();
867            self
868        }
869
870        /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
871        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
872            mut self,
873            v: T,
874        ) -> Self {
875            self.gce_operation = v.into();
876            self
877        }
878
879        /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
880        pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
881            mut self,
882            v: T,
883        ) -> Self {
884            self.forwarding_rule = v.into();
885            self
886        }
887
888        /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
889        pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
890            mut self,
891            v: T,
892        ) -> Self {
893            self.error_info = v.into();
894            self
895        }
896
897        /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
898        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
899            mut self,
900            v: T,
901        ) -> Self {
902            self.selected_subnetwork = v.into();
903            self
904        }
905
906        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
907        #[deprecated]
908        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
909            mut self,
910            v: T,
911        ) -> Self {
912            self.producer_instance_id = v.into();
913            self
914        }
915
916        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
917        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
918        where
919            T: std::iter::IntoIterator<Item = (K, V)>,
920            K: std::convert::Into<std::string::String>,
921            V: std::convert::Into<std::string::String>,
922        {
923            use std::iter::Iterator;
924            self.producer_instance_metadata =
925                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
926            self
927        }
928
929        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
930        pub fn set_ip_version<
931            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
932        >(
933            mut self,
934            v: T,
935        ) -> Self {
936            self.ip_version = v.into();
937            self
938        }
939    }
940
941    impl wkt::message::Message for ConsumerPscConnection {
942        fn typename() -> &'static str {
943            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
944        }
945    }
946
947    /// Defines additional types related to [ConsumerPscConnection].
948    pub mod consumer_psc_connection {
949        #[allow(unused_imports)]
950        use super::*;
951
952        /// The state of the PSC connection.
953        /// We reserve the right to add more states without notice in the future.
954        /// Users should not use exhaustive switch statements on this enum.
955        /// See <https://google.aip.dev/216>.
956        ///
957        /// # Working with unknown values
958        ///
959        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
960        /// additional enum variants at any time. Adding new variants is not considered
961        /// a breaking change. Applications should write their code in anticipation of:
962        ///
963        /// - New values appearing in future releases of the client library, **and**
964        /// - New values received dynamically, without application changes.
965        ///
966        /// Please consult the [Working with enums] section in the user guide for some
967        /// guidelines.
968        ///
969        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
970        #[derive(Clone, Debug, PartialEq)]
971        #[non_exhaustive]
972        pub enum State {
973            /// An invalid state as the default case.
974            Unspecified,
975            /// The connection has been created successfully. However, for the
976            /// up-to-date connection status, please use the service attachment's
977            /// "ConnectedEndpoint.status" as the source of truth.
978            Active,
979            /// The connection is not functional since some resources on the connection
980            /// fail to be created.
981            Failed,
982            /// The connection is being created.
983            Creating,
984            /// The connection is being deleted.
985            Deleting,
986            /// The connection is being repaired to complete creation.
987            CreateRepairing,
988            /// The connection is being repaired to complete deletion.
989            DeleteRepairing,
990            /// If set, the enum was initialized with an unknown value.
991            ///
992            /// Applications can examine the value using [State::value] or
993            /// [State::name].
994            UnknownValue(state::UnknownValue),
995        }
996
997        #[doc(hidden)]
998        pub mod state {
999            #[allow(unused_imports)]
1000            use super::*;
1001            #[derive(Clone, Debug, PartialEq)]
1002            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1003        }
1004
1005        impl State {
1006            /// Gets the enum value.
1007            ///
1008            /// Returns `None` if the enum contains an unknown value deserialized from
1009            /// the string representation of enums.
1010            pub fn value(&self) -> std::option::Option<i32> {
1011                match self {
1012                    Self::Unspecified => std::option::Option::Some(0),
1013                    Self::Active => std::option::Option::Some(1),
1014                    Self::Failed => std::option::Option::Some(2),
1015                    Self::Creating => std::option::Option::Some(3),
1016                    Self::Deleting => std::option::Option::Some(4),
1017                    Self::CreateRepairing => std::option::Option::Some(5),
1018                    Self::DeleteRepairing => std::option::Option::Some(6),
1019                    Self::UnknownValue(u) => u.0.value(),
1020                }
1021            }
1022
1023            /// Gets the enum value as a string.
1024            ///
1025            /// Returns `None` if the enum contains an unknown value deserialized from
1026            /// the integer representation of enums.
1027            pub fn name(&self) -> std::option::Option<&str> {
1028                match self {
1029                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1030                    Self::Active => std::option::Option::Some("ACTIVE"),
1031                    Self::Failed => std::option::Option::Some("FAILED"),
1032                    Self::Creating => std::option::Option::Some("CREATING"),
1033                    Self::Deleting => std::option::Option::Some("DELETING"),
1034                    Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1035                    Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1036                    Self::UnknownValue(u) => u.0.name(),
1037                }
1038            }
1039        }
1040
1041        impl std::default::Default for State {
1042            fn default() -> Self {
1043                use std::convert::From;
1044                Self::from(0)
1045            }
1046        }
1047
1048        impl std::fmt::Display for State {
1049            fn fmt(
1050                &self,
1051                f: &mut std::fmt::Formatter<'_>,
1052            ) -> std::result::Result<(), std::fmt::Error> {
1053                wkt::internal::display_enum(f, self.name(), self.value())
1054            }
1055        }
1056
1057        impl std::convert::From<i32> for State {
1058            fn from(value: i32) -> Self {
1059                match value {
1060                    0 => Self::Unspecified,
1061                    1 => Self::Active,
1062                    2 => Self::Failed,
1063                    3 => Self::Creating,
1064                    4 => Self::Deleting,
1065                    5 => Self::CreateRepairing,
1066                    6 => Self::DeleteRepairing,
1067                    _ => Self::UnknownValue(state::UnknownValue(
1068                        wkt::internal::UnknownEnumValue::Integer(value),
1069                    )),
1070                }
1071            }
1072        }
1073
1074        impl std::convert::From<&str> for State {
1075            fn from(value: &str) -> Self {
1076                use std::string::ToString;
1077                match value {
1078                    "STATE_UNSPECIFIED" => Self::Unspecified,
1079                    "ACTIVE" => Self::Active,
1080                    "FAILED" => Self::Failed,
1081                    "CREATING" => Self::Creating,
1082                    "DELETING" => Self::Deleting,
1083                    "CREATE_REPAIRING" => Self::CreateRepairing,
1084                    "DELETE_REPAIRING" => Self::DeleteRepairing,
1085                    _ => Self::UnknownValue(state::UnknownValue(
1086                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1087                    )),
1088                }
1089            }
1090        }
1091
1092        impl serde::ser::Serialize for State {
1093            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1094            where
1095                S: serde::Serializer,
1096            {
1097                match self {
1098                    Self::Unspecified => serializer.serialize_i32(0),
1099                    Self::Active => serializer.serialize_i32(1),
1100                    Self::Failed => serializer.serialize_i32(2),
1101                    Self::Creating => serializer.serialize_i32(3),
1102                    Self::Deleting => serializer.serialize_i32(4),
1103                    Self::CreateRepairing => serializer.serialize_i32(5),
1104                    Self::DeleteRepairing => serializer.serialize_i32(6),
1105                    Self::UnknownValue(u) => u.0.serialize(serializer),
1106                }
1107            }
1108        }
1109
1110        impl<'de> serde::de::Deserialize<'de> for State {
1111            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1112            where
1113                D: serde::Deserializer<'de>,
1114            {
1115                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1116                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1117            }
1118        }
1119    }
1120}
1121
1122/// Request for ListServiceConnectionMaps.
1123#[serde_with::serde_as]
1124#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1125#[serde(default, rename_all = "camelCase")]
1126#[non_exhaustive]
1127pub struct ListServiceConnectionMapsRequest {
1128    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1129    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1130    pub parent: std::string::String,
1131
1132    /// The maximum number of results per page that should be returned.
1133    #[serde(skip_serializing_if = "wkt::internal::is_default")]
1134    pub page_size: i32,
1135
1136    /// The page token.
1137    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1138    pub page_token: std::string::String,
1139
1140    /// A filter expression that filters the results listed in the response.
1141    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1142    pub filter: std::string::String,
1143
1144    /// Sort the results by a certain order.
1145    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1146    pub order_by: std::string::String,
1147
1148    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1149    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1150}
1151
1152impl ListServiceConnectionMapsRequest {
1153    pub fn new() -> Self {
1154        std::default::Default::default()
1155    }
1156
1157    /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1158    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1159        self.parent = v.into();
1160        self
1161    }
1162
1163    /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1164    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1165        self.page_size = v.into();
1166        self
1167    }
1168
1169    /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1170    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1171        self.page_token = v.into();
1172        self
1173    }
1174
1175    /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1176    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1177        self.filter = v.into();
1178        self
1179    }
1180
1181    /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1182    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1183        self.order_by = v.into();
1184        self
1185    }
1186}
1187
1188impl wkt::message::Message for ListServiceConnectionMapsRequest {
1189    fn typename() -> &'static str {
1190        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1191    }
1192}
1193
1194/// Response for ListServiceConnectionMaps.
1195#[serde_with::serde_as]
1196#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1197#[serde(default, rename_all = "camelCase")]
1198#[non_exhaustive]
1199pub struct ListServiceConnectionMapsResponse {
1200    /// ServiceConnectionMaps to be returned.
1201    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1202    pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1203
1204    /// The next pagination token in the List response. It should be used as
1205    /// page_token for the following request. An empty value means no more result.
1206    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1207    pub next_page_token: std::string::String,
1208
1209    /// Locations that could not be reached.
1210    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1211    pub unreachable: std::vec::Vec<std::string::String>,
1212
1213    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1214    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1215}
1216
1217impl ListServiceConnectionMapsResponse {
1218    pub fn new() -> Self {
1219        std::default::Default::default()
1220    }
1221
1222    /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1223    pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1224    where
1225        T: std::iter::IntoIterator<Item = V>,
1226        V: std::convert::Into<crate::model::ServiceConnectionMap>,
1227    {
1228        use std::iter::Iterator;
1229        self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1230        self
1231    }
1232
1233    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1234    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1235        self.next_page_token = v.into();
1236        self
1237    }
1238
1239    /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1240    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1241    where
1242        T: std::iter::IntoIterator<Item = V>,
1243        V: std::convert::Into<std::string::String>,
1244    {
1245        use std::iter::Iterator;
1246        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1247        self
1248    }
1249}
1250
1251impl wkt::message::Message for ListServiceConnectionMapsResponse {
1252    fn typename() -> &'static str {
1253        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1254    }
1255}
1256
1257#[doc(hidden)]
1258impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1259    type PageItem = crate::model::ServiceConnectionMap;
1260
1261    fn items(self) -> std::vec::Vec<Self::PageItem> {
1262        self.service_connection_maps
1263    }
1264
1265    fn next_page_token(&self) -> std::string::String {
1266        use std::clone::Clone;
1267        self.next_page_token.clone()
1268    }
1269}
1270
1271/// Request for GetServiceConnectionMap.
1272#[serde_with::serde_as]
1273#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1274#[serde(default, rename_all = "camelCase")]
1275#[non_exhaustive]
1276pub struct GetServiceConnectionMapRequest {
1277    /// Required. Name of the ServiceConnectionMap to get.
1278    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1279    pub name: std::string::String,
1280
1281    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1282    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1283}
1284
1285impl GetServiceConnectionMapRequest {
1286    pub fn new() -> Self {
1287        std::default::Default::default()
1288    }
1289
1290    /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1291    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292        self.name = v.into();
1293        self
1294    }
1295}
1296
1297impl wkt::message::Message for GetServiceConnectionMapRequest {
1298    fn typename() -> &'static str {
1299        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1300    }
1301}
1302
1303/// Request for CreateServiceConnectionMap.
1304#[serde_with::serde_as]
1305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1306#[serde(default, rename_all = "camelCase")]
1307#[non_exhaustive]
1308pub struct CreateServiceConnectionMapRequest {
1309    /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1310    /// projects/123/locations/us-east1
1311    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1312    pub parent: std::string::String,
1313
1314    /// Optional. Resource ID
1315    /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1316    /// See <https://google.aip.dev/122#resource-id-segments>
1317    /// Unique per location.
1318    /// If one is not provided, one will be generated.
1319    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1320    pub service_connection_map_id: std::string::String,
1321
1322    /// Required. Initial values for a new ServiceConnectionMaps
1323    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1324    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1325
1326    /// Optional. An optional request ID to identify requests. Specify a unique
1327    /// request ID so that if you must retry your request, the server will know to
1328    /// ignore the request if it has already been completed. The server will
1329    /// guarantee that for at least 60 minutes since the first request.
1330    ///
1331    /// For example, consider a situation where you make an initial request and
1332    /// the request times out. If you make the request again with the same request
1333    /// ID, the server can check if original operation with the same request ID
1334    /// was received, and if so, will ignore the second request. This prevents
1335    /// clients from accidentally creating duplicate commitments.
1336    ///
1337    /// The request ID must be a valid UUID with the exception that zero UUID is
1338    /// not supported (00000000-0000-0000-0000-000000000000).
1339    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1340    pub request_id: std::string::String,
1341
1342    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1343    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1344}
1345
1346impl CreateServiceConnectionMapRequest {
1347    pub fn new() -> Self {
1348        std::default::Default::default()
1349    }
1350
1351    /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1352    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1353        self.parent = v.into();
1354        self
1355    }
1356
1357    /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1358    pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1359        mut self,
1360        v: T,
1361    ) -> Self {
1362        self.service_connection_map_id = v.into();
1363        self
1364    }
1365
1366    /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1367    pub fn set_service_connection_map<
1368        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1369    >(
1370        mut self,
1371        v: T,
1372    ) -> Self {
1373        self.service_connection_map = v.into();
1374        self
1375    }
1376
1377    /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1378    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1379        self.request_id = v.into();
1380        self
1381    }
1382}
1383
1384impl wkt::message::Message for CreateServiceConnectionMapRequest {
1385    fn typename() -> &'static str {
1386        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1387    }
1388}
1389
1390/// Request for UpdateServiceConnectionMap.
1391#[serde_with::serde_as]
1392#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1393#[serde(default, rename_all = "camelCase")]
1394#[non_exhaustive]
1395pub struct UpdateServiceConnectionMapRequest {
1396    /// Optional. Field mask is used to specify the fields to be overwritten in the
1397    /// ServiceConnectionMap resource by the update.
1398    /// The fields specified in the update_mask are relative to the resource, not
1399    /// the full request. A field will be overwritten if it is in the mask. If the
1400    /// user does not provide a mask then all fields will be overwritten.
1401    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1402    pub update_mask: std::option::Option<wkt::FieldMask>,
1403
1404    /// Required. New values to be patched into the resource.
1405    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1406    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1407
1408    /// Optional. An optional request ID to identify requests. Specify a unique
1409    /// request ID so that if you must retry your request, the server will know to
1410    /// ignore the request if it has already been completed. The server will
1411    /// guarantee that for at least 60 minutes since the first request.
1412    ///
1413    /// For example, consider a situation where you make an initial request and
1414    /// the request times out. If you make the request again with the same request
1415    /// ID, the server can check if original operation with the same request ID
1416    /// was received, and if so, will ignore the second request. This prevents
1417    /// clients from accidentally creating duplicate commitments.
1418    ///
1419    /// The request ID must be a valid UUID with the exception that zero UUID is
1420    /// not supported (00000000-0000-0000-0000-000000000000).
1421    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1422    pub request_id: std::string::String,
1423
1424    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1425    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl UpdateServiceConnectionMapRequest {
1429    pub fn new() -> Self {
1430        std::default::Default::default()
1431    }
1432
1433    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1434    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1435        mut self,
1436        v: T,
1437    ) -> Self {
1438        self.update_mask = v.into();
1439        self
1440    }
1441
1442    /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1443    pub fn set_service_connection_map<
1444        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1445    >(
1446        mut self,
1447        v: T,
1448    ) -> Self {
1449        self.service_connection_map = v.into();
1450        self
1451    }
1452
1453    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1454    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1455        self.request_id = v.into();
1456        self
1457    }
1458}
1459
1460impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1461    fn typename() -> &'static str {
1462        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1463    }
1464}
1465
1466/// Request for DeleteServiceConnectionMap.
1467#[serde_with::serde_as]
1468#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1469#[serde(default, rename_all = "camelCase")]
1470#[non_exhaustive]
1471pub struct DeleteServiceConnectionMapRequest {
1472    /// Required. The name of the ServiceConnectionMap to delete.
1473    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1474    pub name: std::string::String,
1475
1476    /// Optional. An optional request ID to identify requests. Specify a unique
1477    /// request ID so that if you must retry your request, the server will know to
1478    /// ignore the request if it has already been completed. The server will
1479    /// guarantee that for at least 60 minutes after the first request.
1480    ///
1481    /// For example, consider a situation where you make an initial request and
1482    /// the request times out. If you make the request again with the same request
1483    /// ID, the server can check if original operation with the same request ID
1484    /// was received, and if so, will ignore the second request. This prevents
1485    /// clients from accidentally creating duplicate commitments.
1486    ///
1487    /// The request ID must be a valid UUID with the exception that zero UUID is
1488    /// not supported (00000000-0000-0000-0000-000000000000).
1489    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1490    pub request_id: std::string::String,
1491
1492    /// Optional. The etag is computed by the server, and may be sent on update and
1493    /// delete requests to ensure the client has an up-to-date value before
1494    /// proceeding.
1495    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1496    pub etag: std::option::Option<std::string::String>,
1497
1498    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1499    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1500}
1501
1502impl DeleteServiceConnectionMapRequest {
1503    pub fn new() -> Self {
1504        std::default::Default::default()
1505    }
1506
1507    /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
1508    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1509        self.name = v.into();
1510        self
1511    }
1512
1513    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
1514    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515        self.request_id = v.into();
1516        self
1517    }
1518
1519    /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
1520    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1521        mut self,
1522        v: T,
1523    ) -> Self {
1524        self.etag = v.into();
1525        self
1526    }
1527}
1528
1529impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1530    fn typename() -> &'static str {
1531        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1532    }
1533}
1534
1535/// The ServiceConnectionPolicy resource.
1536#[serde_with::serde_as]
1537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1538#[serde(default, rename_all = "camelCase")]
1539#[non_exhaustive]
1540pub struct ServiceConnectionPolicy {
1541    /// Immutable. The name of a ServiceConnectionPolicy.
1542    /// Format:
1543    /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
1544    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
1545    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1546    pub name: std::string::String,
1547
1548    /// Output only. Time when the ServiceConnectionPolicy was created.
1549    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1550    pub create_time: std::option::Option<wkt::Timestamp>,
1551
1552    /// Output only. Time when the ServiceConnectionPolicy was updated.
1553    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1554    pub update_time: std::option::Option<wkt::Timestamp>,
1555
1556    /// User-defined labels.
1557    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1558    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1559
1560    /// A description of this resource.
1561    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1562    pub description: std::string::String,
1563
1564    /// The resource path of the consumer network.
1565    /// Example:
1566    ///
1567    /// - projects/{projectNumOrId}/global/networks/{resourceId}.
1568    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1569    pub network: std::string::String,
1570
1571    /// The service class identifier for which this ServiceConnectionPolicy is for.
1572    /// The service class identifier is a unique, symbolic representation of a
1573    /// ServiceClass. It is provided by the Service Producer. Google services have
1574    /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
1575    /// google-cloud-sql. 3rd party services do not. For example,
1576    /// test-service-a3dfcx.
1577    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1578    pub service_class: std::string::String,
1579
1580    /// Output only. The type of underlying resources used to create the
1581    /// connection.
1582    pub infrastructure: crate::model::Infrastructure,
1583
1584    /// Configuration used for Private Service Connect connections. Used when
1585    /// Infrastructure is PSC.
1586    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1587    pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1588
1589    /// Output only. [Output only] Information about each Private Service Connect
1590    /// connection.
1591    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1592    pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1593
1594    /// Optional. The etag is computed by the server, and may be sent on update and
1595    /// delete requests to ensure the client has an up-to-date value before
1596    /// proceeding.
1597    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1598    pub etag: std::option::Option<std::string::String>,
1599
1600    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1601    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1602}
1603
1604impl ServiceConnectionPolicy {
1605    pub fn new() -> Self {
1606        std::default::Default::default()
1607    }
1608
1609    /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
1610    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1611        self.name = v.into();
1612        self
1613    }
1614
1615    /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
1616    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1617        mut self,
1618        v: T,
1619    ) -> Self {
1620        self.create_time = v.into();
1621        self
1622    }
1623
1624    /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
1625    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1626        mut self,
1627        v: T,
1628    ) -> Self {
1629        self.update_time = v.into();
1630        self
1631    }
1632
1633    /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
1634    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1635    where
1636        T: std::iter::IntoIterator<Item = (K, V)>,
1637        K: std::convert::Into<std::string::String>,
1638        V: std::convert::Into<std::string::String>,
1639    {
1640        use std::iter::Iterator;
1641        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1642        self
1643    }
1644
1645    /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
1646    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1647        self.description = v.into();
1648        self
1649    }
1650
1651    /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
1652    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1653        self.network = v.into();
1654        self
1655    }
1656
1657    /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
1658    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1659        self.service_class = v.into();
1660        self
1661    }
1662
1663    /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
1664    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1665        mut self,
1666        v: T,
1667    ) -> Self {
1668        self.infrastructure = v.into();
1669        self
1670    }
1671
1672    /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
1673    pub fn set_psc_config<
1674        T: std::convert::Into<std::option::Option<crate::model::service_connection_policy::PscConfig>>,
1675    >(
1676        mut self,
1677        v: T,
1678    ) -> Self {
1679        self.psc_config = v.into();
1680        self
1681    }
1682
1683    /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
1684    pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1685    where
1686        T: std::iter::IntoIterator<Item = V>,
1687        V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1688    {
1689        use std::iter::Iterator;
1690        self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1691        self
1692    }
1693
1694    /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
1695    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1696        mut self,
1697        v: T,
1698    ) -> Self {
1699        self.etag = v.into();
1700        self
1701    }
1702}
1703
1704impl wkt::message::Message for ServiceConnectionPolicy {
1705    fn typename() -> &'static str {
1706        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1707    }
1708}
1709
1710/// Defines additional types related to [ServiceConnectionPolicy].
1711pub mod service_connection_policy {
1712    #[allow(unused_imports)]
1713    use super::*;
1714
1715    /// Configuration used for Private Service Connect connections. Used when
1716    /// Infrastructure is PSC.
1717    #[serde_with::serde_as]
1718    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1719    #[serde(default, rename_all = "camelCase")]
1720    #[non_exhaustive]
1721    pub struct PscConfig {
1722        /// The resource paths of subnetworks to use for IP address management.
1723        /// Example:
1724        /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
1725        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1726        pub subnetworks: std::vec::Vec<std::string::String>,
1727
1728        /// Optional. Max number of PSC connections for this policy.
1729        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1730        #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1731        pub limit: std::option::Option<i64>,
1732
1733        /// Required. ProducerInstanceLocation is used to specify which authorization
1734        /// mechanism to use to determine which projects the Producer instance can be
1735        /// within.
1736        pub producer_instance_location:
1737            crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1738
1739        /// Optional. List of Projects, Folders, or Organizations from where the
1740        /// Producer instance can be within. For example, a network administrator can
1741        /// provide both 'organizations/foo' and 'projects/bar' as
1742        /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
1743        /// network to connect with any Producer instance within the 'foo'
1744        /// organization or the 'bar' project. By default,
1745        /// allowed_google_producers_resource_hierarchy_level is empty. The format
1746        /// for each allowed_google_producers_resource_hierarchy_level is \<resource
1747        /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
1748        /// 'organizations' and \<id\> is either the ID or the number of the resource
1749        /// type. Format for each allowed_google_producers_resource_hierarchy_level
1750        /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
1751        /// 'organizations/<organization_id>'
1752        /// Eg. [projects/my-project-id, projects/567, folders/891,
1753        /// organizations/123]
1754        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1755        pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1756
1757        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1758        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1759    }
1760
1761    impl PscConfig {
1762        pub fn new() -> Self {
1763            std::default::Default::default()
1764        }
1765
1766        /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
1767        pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1768        where
1769            T: std::iter::IntoIterator<Item = V>,
1770            V: std::convert::Into<std::string::String>,
1771        {
1772            use std::iter::Iterator;
1773            self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1774            self
1775        }
1776
1777        /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
1778        pub fn set_limit<T: std::convert::Into<std::option::Option<i64>>>(mut self, v: T) -> Self {
1779            self.limit = v.into();
1780            self
1781        }
1782
1783        /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
1784        pub fn set_producer_instance_location<
1785            T: std::convert::Into<
1786                    crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1787                >,
1788        >(
1789            mut self,
1790            v: T,
1791        ) -> Self {
1792            self.producer_instance_location = v.into();
1793            self
1794        }
1795
1796        /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
1797        pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1798        where
1799            T: std::iter::IntoIterator<Item = V>,
1800            V: std::convert::Into<std::string::String>,
1801        {
1802            use std::iter::Iterator;
1803            self.allowed_google_producers_resource_hierarchy_level =
1804                v.into_iter().map(|i| i.into()).collect();
1805            self
1806        }
1807    }
1808
1809    impl wkt::message::Message for PscConfig {
1810        fn typename() -> &'static str {
1811            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1812        }
1813    }
1814
1815    /// Defines additional types related to [PscConfig].
1816    pub mod psc_config {
1817        #[allow(unused_imports)]
1818        use super::*;
1819
1820        /// ProducerInstanceLocation is used to specify which authorization mechanism
1821        /// to use to determine which projects the Producer instance can be within.
1822        ///
1823        /// # Working with unknown values
1824        ///
1825        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1826        /// additional enum variants at any time. Adding new variants is not considered
1827        /// a breaking change. Applications should write their code in anticipation of:
1828        ///
1829        /// - New values appearing in future releases of the client library, **and**
1830        /// - New values received dynamically, without application changes.
1831        ///
1832        /// Please consult the [Working with enums] section in the user guide for some
1833        /// guidelines.
1834        ///
1835        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1836        #[derive(Clone, Debug, PartialEq)]
1837        #[non_exhaustive]
1838        pub enum ProducerInstanceLocation {
1839            /// Producer instance location is not specified. When this option is
1840            /// chosen, then the PSC connections created by this
1841            /// ServiceConnectionPolicy must be within the same project as the Producer
1842            /// instance. This is the default ProducerInstanceLocation value.
1843            /// To allow for PSC connections from this network to other networks, use
1844            /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
1845            Unspecified,
1846            /// Producer instance must be within one of the values provided in
1847            /// allowed_google_producers_resource_hierarchy_level.
1848            CustomResourceHierarchyLevels,
1849            /// If set, the enum was initialized with an unknown value.
1850            ///
1851            /// Applications can examine the value using [ProducerInstanceLocation::value] or
1852            /// [ProducerInstanceLocation::name].
1853            UnknownValue(producer_instance_location::UnknownValue),
1854        }
1855
1856        #[doc(hidden)]
1857        pub mod producer_instance_location {
1858            #[allow(unused_imports)]
1859            use super::*;
1860            #[derive(Clone, Debug, PartialEq)]
1861            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1862        }
1863
1864        impl ProducerInstanceLocation {
1865            /// Gets the enum value.
1866            ///
1867            /// Returns `None` if the enum contains an unknown value deserialized from
1868            /// the string representation of enums.
1869            pub fn value(&self) -> std::option::Option<i32> {
1870                match self {
1871                    Self::Unspecified => std::option::Option::Some(0),
1872                    Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
1873                    Self::UnknownValue(u) => u.0.value(),
1874                }
1875            }
1876
1877            /// Gets the enum value as a string.
1878            ///
1879            /// Returns `None` if the enum contains an unknown value deserialized from
1880            /// the integer representation of enums.
1881            pub fn name(&self) -> std::option::Option<&str> {
1882                match self {
1883                    Self::Unspecified => {
1884                        std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
1885                    }
1886                    Self::CustomResourceHierarchyLevels => {
1887                        std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
1888                    }
1889                    Self::UnknownValue(u) => u.0.name(),
1890                }
1891            }
1892        }
1893
1894        impl std::default::Default for ProducerInstanceLocation {
1895            fn default() -> Self {
1896                use std::convert::From;
1897                Self::from(0)
1898            }
1899        }
1900
1901        impl std::fmt::Display for ProducerInstanceLocation {
1902            fn fmt(
1903                &self,
1904                f: &mut std::fmt::Formatter<'_>,
1905            ) -> std::result::Result<(), std::fmt::Error> {
1906                wkt::internal::display_enum(f, self.name(), self.value())
1907            }
1908        }
1909
1910        impl std::convert::From<i32> for ProducerInstanceLocation {
1911            fn from(value: i32) -> Self {
1912                match value {
1913                    0 => Self::Unspecified,
1914                    1 => Self::CustomResourceHierarchyLevels,
1915                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1916                        wkt::internal::UnknownEnumValue::Integer(value),
1917                    )),
1918                }
1919            }
1920        }
1921
1922        impl std::convert::From<&str> for ProducerInstanceLocation {
1923            fn from(value: &str) -> Self {
1924                use std::string::ToString;
1925                match value {
1926                    "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
1927                    "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
1928                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1929                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1930                    )),
1931                }
1932            }
1933        }
1934
1935        impl serde::ser::Serialize for ProducerInstanceLocation {
1936            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1937            where
1938                S: serde::Serializer,
1939            {
1940                match self {
1941                    Self::Unspecified => serializer.serialize_i32(0),
1942                    Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
1943                    Self::UnknownValue(u) => u.0.serialize(serializer),
1944                }
1945            }
1946        }
1947
1948        impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
1949            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1950            where
1951                D: serde::Deserializer<'de>,
1952            {
1953                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
1954                    ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
1955            }
1956        }
1957    }
1958
1959    /// Information about a specific Private Service Connect connection.
1960    #[serde_with::serde_as]
1961    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1962    #[serde(default, rename_all = "camelCase")]
1963    #[non_exhaustive]
1964    pub struct PscConnection {
1965        /// State of the PSC Connection
1966        pub state: crate::model::service_connection_policy::State,
1967
1968        /// The resource reference of the PSC Forwarding Rule within the consumer
1969        /// VPC.
1970        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1971        pub consumer_forwarding_rule: std::string::String,
1972
1973        /// The resource reference of the consumer address.
1974        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1975        pub consumer_address: std::string::String,
1976
1977        /// The error type indicates whether the error is consumer facing, producer
1978        /// facing or system internal.
1979        #[deprecated]
1980        pub error_type: crate::model::ConnectionErrorType,
1981
1982        /// The most recent error during operating this connection.
1983        /// Deprecated, please use error_info instead.
1984        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1985        #[deprecated]
1986        pub error: std::option::Option<rpc::model::Status>,
1987
1988        /// The last Compute Engine operation to setup PSC connection.
1989        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1990        pub gce_operation: std::string::String,
1991
1992        /// The project where the PSC connection is created.
1993        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1994        pub consumer_target_project: std::string::String,
1995
1996        /// The PSC connection id of the PSC forwarding rule.
1997        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1998        pub psc_connection_id: std::string::String,
1999
2000        /// Output only. The error info for the latest error during operating this
2001        /// connection.
2002        #[serde(skip_serializing_if = "std::option::Option::is_none")]
2003        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
2004
2005        /// Output only. The URI of the subnetwork selected to allocate IP address
2006        /// for this connection.
2007        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2008        pub selected_subnetwork: std::string::String,
2009
2010        /// Immutable. Deprecated. Use producer_instance_metadata instead.
2011        /// An immutable identifier for the producer instance.
2012        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2013        #[deprecated]
2014        pub producer_instance_id: std::string::String,
2015
2016        /// Immutable. An immutable map for the producer instance metadata.
2017        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2018        pub producer_instance_metadata:
2019            std::collections::HashMap<std::string::String, std::string::String>,
2020
2021        /// Output only. [Output only] The service class associated with this PSC
2022        /// Connection. The value is derived from the SCPolicy and matches the
2023        /// service class name provided by the customer.
2024        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2025        pub service_class: std::string::String,
2026
2027        /// The requested IP version for the PSC connection.
2028        #[serde(skip_serializing_if = "std::option::Option::is_none")]
2029        pub ip_version: std::option::Option<crate::model::IPVersion>,
2030
2031        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2032        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2033    }
2034
2035    impl PscConnection {
2036        pub fn new() -> Self {
2037            std::default::Default::default()
2038        }
2039
2040        /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2041        pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2042            mut self,
2043            v: T,
2044        ) -> Self {
2045            self.state = v.into();
2046            self
2047        }
2048
2049        /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2050        pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2051            mut self,
2052            v: T,
2053        ) -> Self {
2054            self.consumer_forwarding_rule = v.into();
2055            self
2056        }
2057
2058        /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2059        pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2060            mut self,
2061            v: T,
2062        ) -> Self {
2063            self.consumer_address = v.into();
2064            self
2065        }
2066
2067        /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2068        #[deprecated]
2069        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2070            mut self,
2071            v: T,
2072        ) -> Self {
2073            self.error_type = v.into();
2074            self
2075        }
2076
2077        /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2078        #[deprecated]
2079        pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2080            mut self,
2081            v: T,
2082        ) -> Self {
2083            self.error = v.into();
2084            self
2085        }
2086
2087        /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2088        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2089            mut self,
2090            v: T,
2091        ) -> Self {
2092            self.gce_operation = v.into();
2093            self
2094        }
2095
2096        /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2097        pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2098            mut self,
2099            v: T,
2100        ) -> Self {
2101            self.consumer_target_project = v.into();
2102            self
2103        }
2104
2105        /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2106        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2107            mut self,
2108            v: T,
2109        ) -> Self {
2110            self.psc_connection_id = v.into();
2111            self
2112        }
2113
2114        /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2115        pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
2116            mut self,
2117            v: T,
2118        ) -> Self {
2119            self.error_info = v.into();
2120            self
2121        }
2122
2123        /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2124        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2125            mut self,
2126            v: T,
2127        ) -> Self {
2128            self.selected_subnetwork = v.into();
2129            self
2130        }
2131
2132        /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2133        #[deprecated]
2134        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2135            mut self,
2136            v: T,
2137        ) -> Self {
2138            self.producer_instance_id = v.into();
2139            self
2140        }
2141
2142        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2143        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2144        where
2145            T: std::iter::IntoIterator<Item = (K, V)>,
2146            K: std::convert::Into<std::string::String>,
2147            V: std::convert::Into<std::string::String>,
2148        {
2149            use std::iter::Iterator;
2150            self.producer_instance_metadata =
2151                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2152            self
2153        }
2154
2155        /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
2156        pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2157            mut self,
2158            v: T,
2159        ) -> Self {
2160            self.service_class = v.into();
2161            self
2162        }
2163
2164        /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
2165        pub fn set_ip_version<
2166            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
2167        >(
2168            mut self,
2169            v: T,
2170        ) -> Self {
2171            self.ip_version = v.into();
2172            self
2173        }
2174    }
2175
2176    impl wkt::message::Message for PscConnection {
2177        fn typename() -> &'static str {
2178            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
2179        }
2180    }
2181
2182    /// The state of the PSC connection.
2183    /// We reserve the right to add more states without notice in the future.
2184    /// Users should not use exhaustive switch statements on this enum.
2185    /// See <https://google.aip.dev/216>.
2186    ///
2187    /// # Working with unknown values
2188    ///
2189    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2190    /// additional enum variants at any time. Adding new variants is not considered
2191    /// a breaking change. Applications should write their code in anticipation of:
2192    ///
2193    /// - New values appearing in future releases of the client library, **and**
2194    /// - New values received dynamically, without application changes.
2195    ///
2196    /// Please consult the [Working with enums] section in the user guide for some
2197    /// guidelines.
2198    ///
2199    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2200    #[derive(Clone, Debug, PartialEq)]
2201    #[non_exhaustive]
2202    pub enum State {
2203        /// An invalid state as the default case.
2204        Unspecified,
2205        /// The connection has been created successfully. However, for the
2206        /// up-to-date connection status, please use the created forwarding rule's
2207        /// "PscConnectionStatus" as the source of truth.
2208        Active,
2209        /// The connection is not functional since some resources on the connection
2210        /// fail to be created.
2211        Failed,
2212        /// The connection is being created.
2213        Creating,
2214        /// The connection is being deleted.
2215        Deleting,
2216        /// The connection is being repaired to complete creation.
2217        CreateRepairing,
2218        /// The connection is being repaired to complete deletion.
2219        DeleteRepairing,
2220        /// If set, the enum was initialized with an unknown value.
2221        ///
2222        /// Applications can examine the value using [State::value] or
2223        /// [State::name].
2224        UnknownValue(state::UnknownValue),
2225    }
2226
2227    #[doc(hidden)]
2228    pub mod state {
2229        #[allow(unused_imports)]
2230        use super::*;
2231        #[derive(Clone, Debug, PartialEq)]
2232        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2233    }
2234
2235    impl State {
2236        /// Gets the enum value.
2237        ///
2238        /// Returns `None` if the enum contains an unknown value deserialized from
2239        /// the string representation of enums.
2240        pub fn value(&self) -> std::option::Option<i32> {
2241            match self {
2242                Self::Unspecified => std::option::Option::Some(0),
2243                Self::Active => std::option::Option::Some(1),
2244                Self::Failed => std::option::Option::Some(2),
2245                Self::Creating => std::option::Option::Some(3),
2246                Self::Deleting => std::option::Option::Some(4),
2247                Self::CreateRepairing => std::option::Option::Some(5),
2248                Self::DeleteRepairing => std::option::Option::Some(6),
2249                Self::UnknownValue(u) => u.0.value(),
2250            }
2251        }
2252
2253        /// Gets the enum value as a string.
2254        ///
2255        /// Returns `None` if the enum contains an unknown value deserialized from
2256        /// the integer representation of enums.
2257        pub fn name(&self) -> std::option::Option<&str> {
2258            match self {
2259                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2260                Self::Active => std::option::Option::Some("ACTIVE"),
2261                Self::Failed => std::option::Option::Some("FAILED"),
2262                Self::Creating => std::option::Option::Some("CREATING"),
2263                Self::Deleting => std::option::Option::Some("DELETING"),
2264                Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
2265                Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
2266                Self::UnknownValue(u) => u.0.name(),
2267            }
2268        }
2269    }
2270
2271    impl std::default::Default for State {
2272        fn default() -> Self {
2273            use std::convert::From;
2274            Self::from(0)
2275        }
2276    }
2277
2278    impl std::fmt::Display for State {
2279        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2280            wkt::internal::display_enum(f, self.name(), self.value())
2281        }
2282    }
2283
2284    impl std::convert::From<i32> for State {
2285        fn from(value: i32) -> Self {
2286            match value {
2287                0 => Self::Unspecified,
2288                1 => Self::Active,
2289                2 => Self::Failed,
2290                3 => Self::Creating,
2291                4 => Self::Deleting,
2292                5 => Self::CreateRepairing,
2293                6 => Self::DeleteRepairing,
2294                _ => Self::UnknownValue(state::UnknownValue(
2295                    wkt::internal::UnknownEnumValue::Integer(value),
2296                )),
2297            }
2298        }
2299    }
2300
2301    impl std::convert::From<&str> for State {
2302        fn from(value: &str) -> Self {
2303            use std::string::ToString;
2304            match value {
2305                "STATE_UNSPECIFIED" => Self::Unspecified,
2306                "ACTIVE" => Self::Active,
2307                "FAILED" => Self::Failed,
2308                "CREATING" => Self::Creating,
2309                "DELETING" => Self::Deleting,
2310                "CREATE_REPAIRING" => Self::CreateRepairing,
2311                "DELETE_REPAIRING" => Self::DeleteRepairing,
2312                _ => Self::UnknownValue(state::UnknownValue(
2313                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2314                )),
2315            }
2316        }
2317    }
2318
2319    impl serde::ser::Serialize for State {
2320        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2321        where
2322            S: serde::Serializer,
2323        {
2324            match self {
2325                Self::Unspecified => serializer.serialize_i32(0),
2326                Self::Active => serializer.serialize_i32(1),
2327                Self::Failed => serializer.serialize_i32(2),
2328                Self::Creating => serializer.serialize_i32(3),
2329                Self::Deleting => serializer.serialize_i32(4),
2330                Self::CreateRepairing => serializer.serialize_i32(5),
2331                Self::DeleteRepairing => serializer.serialize_i32(6),
2332                Self::UnknownValue(u) => u.0.serialize(serializer),
2333            }
2334        }
2335    }
2336
2337    impl<'de> serde::de::Deserialize<'de> for State {
2338        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2339        where
2340            D: serde::Deserializer<'de>,
2341        {
2342            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2343                ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
2344            ))
2345        }
2346    }
2347}
2348
2349/// Request for ListServiceConnectionPolicies.
2350#[serde_with::serde_as]
2351#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2352#[serde(default, rename_all = "camelCase")]
2353#[non_exhaustive]
2354pub struct ListServiceConnectionPoliciesRequest {
2355    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2356    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2357    pub parent: std::string::String,
2358
2359    /// The maximum number of results per page that should be returned.
2360    #[serde(skip_serializing_if = "wkt::internal::is_default")]
2361    pub page_size: i32,
2362
2363    /// The page token.
2364    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2365    pub page_token: std::string::String,
2366
2367    /// A filter expression that filters the results listed in the response.
2368    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2369    pub filter: std::string::String,
2370
2371    /// Sort the results by a certain order.
2372    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2373    pub order_by: std::string::String,
2374
2375    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2376    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2377}
2378
2379impl ListServiceConnectionPoliciesRequest {
2380    pub fn new() -> Self {
2381        std::default::Default::default()
2382    }
2383
2384    /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
2385    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2386        self.parent = v.into();
2387        self
2388    }
2389
2390    /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
2391    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2392        self.page_size = v.into();
2393        self
2394    }
2395
2396    /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
2397    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2398        self.page_token = v.into();
2399        self
2400    }
2401
2402    /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
2403    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2404        self.filter = v.into();
2405        self
2406    }
2407
2408    /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
2409    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410        self.order_by = v.into();
2411        self
2412    }
2413}
2414
2415impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2416    fn typename() -> &'static str {
2417        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2418    }
2419}
2420
2421/// Response for ListServiceConnectionPolicies.
2422#[serde_with::serde_as]
2423#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2424#[serde(default, rename_all = "camelCase")]
2425#[non_exhaustive]
2426pub struct ListServiceConnectionPoliciesResponse {
2427    /// ServiceConnectionPolicies to be returned.
2428    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2429    pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2430
2431    /// The next pagination token in the List response. It should be used as
2432    /// page_token for the following request. An empty value means no more result.
2433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2434    pub next_page_token: std::string::String,
2435
2436    /// Locations that could not be reached.
2437    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2438    pub unreachable: std::vec::Vec<std::string::String>,
2439
2440    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2441    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2442}
2443
2444impl ListServiceConnectionPoliciesResponse {
2445    pub fn new() -> Self {
2446        std::default::Default::default()
2447    }
2448
2449    /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
2450    pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2451    where
2452        T: std::iter::IntoIterator<Item = V>,
2453        V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2454    {
2455        use std::iter::Iterator;
2456        self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2457        self
2458    }
2459
2460    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
2461    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462        self.next_page_token = v.into();
2463        self
2464    }
2465
2466    /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
2467    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2468    where
2469        T: std::iter::IntoIterator<Item = V>,
2470        V: std::convert::Into<std::string::String>,
2471    {
2472        use std::iter::Iterator;
2473        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2474        self
2475    }
2476}
2477
2478impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2479    fn typename() -> &'static str {
2480        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2481    }
2482}
2483
2484#[doc(hidden)]
2485impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2486    type PageItem = crate::model::ServiceConnectionPolicy;
2487
2488    fn items(self) -> std::vec::Vec<Self::PageItem> {
2489        self.service_connection_policies
2490    }
2491
2492    fn next_page_token(&self) -> std::string::String {
2493        use std::clone::Clone;
2494        self.next_page_token.clone()
2495    }
2496}
2497
2498/// Request for GetServiceConnectionPolicy.
2499#[serde_with::serde_as]
2500#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2501#[serde(default, rename_all = "camelCase")]
2502#[non_exhaustive]
2503pub struct GetServiceConnectionPolicyRequest {
2504    /// Required. Name of the ServiceConnectionPolicy to get.
2505    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2506    pub name: std::string::String,
2507
2508    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2509    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2510}
2511
2512impl GetServiceConnectionPolicyRequest {
2513    pub fn new() -> Self {
2514        std::default::Default::default()
2515    }
2516
2517    /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
2518    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2519        self.name = v.into();
2520        self
2521    }
2522}
2523
2524impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2525    fn typename() -> &'static str {
2526        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2527    }
2528}
2529
2530/// Request for CreateServiceConnectionPolicy.
2531#[serde_with::serde_as]
2532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2533#[serde(default, rename_all = "camelCase")]
2534#[non_exhaustive]
2535pub struct CreateServiceConnectionPolicyRequest {
2536    /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
2537    /// projects/123/locations/us-east1
2538    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2539    pub parent: std::string::String,
2540
2541    /// Optional. Resource ID
2542    /// (i.e. 'foo' in
2543    /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
2544    /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
2545    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2546    pub service_connection_policy_id: std::string::String,
2547
2548    /// Required. Initial values for a new ServiceConnectionPolicies
2549    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2550    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2551
2552    /// Optional. An optional request ID to identify requests. Specify a unique
2553    /// request ID so that if you must retry your request, the server will know to
2554    /// ignore the request if it has already been completed. The server will
2555    /// guarantee that for at least 60 minutes since the first request.
2556    ///
2557    /// For example, consider a situation where you make an initial request and
2558    /// the request times out. If you make the request again with the same request
2559    /// ID, the server can check if original operation with the same request ID
2560    /// was received, and if so, will ignore the second request. This prevents
2561    /// clients from accidentally creating duplicate commitments.
2562    ///
2563    /// The request ID must be a valid UUID with the exception that zero UUID is
2564    /// not supported (00000000-0000-0000-0000-000000000000).
2565    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2566    pub request_id: std::string::String,
2567
2568    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2569    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2570}
2571
2572impl CreateServiceConnectionPolicyRequest {
2573    pub fn new() -> Self {
2574        std::default::Default::default()
2575    }
2576
2577    /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
2578    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2579        self.parent = v.into();
2580        self
2581    }
2582
2583    /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
2584    pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2585        mut self,
2586        v: T,
2587    ) -> Self {
2588        self.service_connection_policy_id = v.into();
2589        self
2590    }
2591
2592    /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
2593    pub fn set_service_connection_policy<
2594        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2595    >(
2596        mut self,
2597        v: T,
2598    ) -> Self {
2599        self.service_connection_policy = v.into();
2600        self
2601    }
2602
2603    /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
2604    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2605        self.request_id = v.into();
2606        self
2607    }
2608}
2609
2610impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2611    fn typename() -> &'static str {
2612        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2613    }
2614}
2615
2616/// Request for UpdateServiceConnectionPolicy.
2617#[serde_with::serde_as]
2618#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2619#[serde(default, rename_all = "camelCase")]
2620#[non_exhaustive]
2621pub struct UpdateServiceConnectionPolicyRequest {
2622    /// Optional. Field mask is used to specify the fields to be overwritten in the
2623    /// ServiceConnectionPolicy resource by the update.
2624    /// The fields specified in the update_mask are relative to the resource, not
2625    /// the full request. A field will be overwritten if it is in the mask. If the
2626    /// user does not provide a mask then all fields will be overwritten.
2627    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2628    pub update_mask: std::option::Option<wkt::FieldMask>,
2629
2630    /// Required. New values to be patched into the resource.
2631    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2632    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2633
2634    /// Optional. An optional request ID to identify requests. Specify a unique
2635    /// request ID so that if you must retry your request, the server will know to
2636    /// ignore the request if it has already been completed. The server will
2637    /// guarantee that for at least 60 minutes since the first request.
2638    ///
2639    /// For example, consider a situation where you make an initial request and
2640    /// the request times out. If you make the request again with the same request
2641    /// ID, the server can check if original operation with the same request ID
2642    /// was received, and if so, will ignore the second request. This prevents
2643    /// clients from accidentally creating duplicate commitments.
2644    ///
2645    /// The request ID must be a valid UUID with the exception that zero UUID is
2646    /// not supported (00000000-0000-0000-0000-000000000000).
2647    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2648    pub request_id: std::string::String,
2649
2650    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2651    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2652}
2653
2654impl UpdateServiceConnectionPolicyRequest {
2655    pub fn new() -> Self {
2656        std::default::Default::default()
2657    }
2658
2659    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
2660    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2661        mut self,
2662        v: T,
2663    ) -> Self {
2664        self.update_mask = v.into();
2665        self
2666    }
2667
2668    /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
2669    pub fn set_service_connection_policy<
2670        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2671    >(
2672        mut self,
2673        v: T,
2674    ) -> Self {
2675        self.service_connection_policy = v.into();
2676        self
2677    }
2678
2679    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
2680    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681        self.request_id = v.into();
2682        self
2683    }
2684}
2685
2686impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2687    fn typename() -> &'static str {
2688        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2689    }
2690}
2691
2692/// Request for DeleteServiceConnectionPolicy.
2693#[serde_with::serde_as]
2694#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2695#[serde(default, rename_all = "camelCase")]
2696#[non_exhaustive]
2697pub struct DeleteServiceConnectionPolicyRequest {
2698    /// Required. The name of the ServiceConnectionPolicy to delete.
2699    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2700    pub name: std::string::String,
2701
2702    /// Optional. An optional request ID to identify requests. Specify a unique
2703    /// request ID so that if you must retry your request, the server will know to
2704    /// ignore the request if it has already been completed. The server will
2705    /// guarantee that for at least 60 minutes after the first request.
2706    ///
2707    /// For example, consider a situation where you make an initial request and
2708    /// the request times out. If you make the request again with the same request
2709    /// ID, the server can check if original operation with the same request ID
2710    /// was received, and if so, will ignore the second request. This prevents
2711    /// clients from accidentally creating duplicate commitments.
2712    ///
2713    /// The request ID must be a valid UUID with the exception that zero UUID is
2714    /// not supported (00000000-0000-0000-0000-000000000000).
2715    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2716    pub request_id: std::string::String,
2717
2718    /// Optional. The etag is computed by the server, and may be sent on update and
2719    /// delete requests to ensure the client has an up-to-date value before
2720    /// proceeding.
2721    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2722    pub etag: std::option::Option<std::string::String>,
2723
2724    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2725    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2726}
2727
2728impl DeleteServiceConnectionPolicyRequest {
2729    pub fn new() -> Self {
2730        std::default::Default::default()
2731    }
2732
2733    /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
2734    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2735        self.name = v.into();
2736        self
2737    }
2738
2739    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
2740    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741        self.request_id = v.into();
2742        self
2743    }
2744
2745    /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
2746    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2747        mut self,
2748        v: T,
2749    ) -> Self {
2750        self.etag = v.into();
2751        self
2752    }
2753}
2754
2755impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2756    fn typename() -> &'static str {
2757        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2758    }
2759}
2760
2761/// The ServiceClass resource.
2762#[serde_with::serde_as]
2763#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2764#[serde(default, rename_all = "camelCase")]
2765#[non_exhaustive]
2766pub struct ServiceClass {
2767    /// Immutable. The name of a ServiceClass resource.
2768    /// Format:
2769    /// projects/{project}/locations/{location}/serviceClasses/{service_class}
2770    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2771    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2772    pub name: std::string::String,
2773
2774    /// Output only. The generated service class name. Use this name to refer to
2775    /// the Service class in Service Connection Maps and Service Connection
2776    /// Policies.
2777    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778    pub service_class: std::string::String,
2779
2780    /// Output only. Time when the ServiceClass was created.
2781    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2782    pub create_time: std::option::Option<wkt::Timestamp>,
2783
2784    /// Output only. Time when the ServiceClass was updated.
2785    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2786    pub update_time: std::option::Option<wkt::Timestamp>,
2787
2788    /// User-defined labels.
2789    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2790    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2791
2792    /// A description of this resource.
2793    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2794    pub description: std::string::String,
2795
2796    /// Optional. The etag is computed by the server, and may be sent on update and
2797    /// delete requests to ensure the client has an up-to-date value before
2798    /// proceeding.
2799    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2800    pub etag: std::option::Option<std::string::String>,
2801
2802    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2803    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2804}
2805
2806impl ServiceClass {
2807    pub fn new() -> Self {
2808        std::default::Default::default()
2809    }
2810
2811    /// Sets the value of [name][crate::model::ServiceClass::name].
2812    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2813        self.name = v.into();
2814        self
2815    }
2816
2817    /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
2818    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2819        self.service_class = v.into();
2820        self
2821    }
2822
2823    /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
2824    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2825        mut self,
2826        v: T,
2827    ) -> Self {
2828        self.create_time = v.into();
2829        self
2830    }
2831
2832    /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
2833    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2834        mut self,
2835        v: T,
2836    ) -> Self {
2837        self.update_time = v.into();
2838        self
2839    }
2840
2841    /// Sets the value of [labels][crate::model::ServiceClass::labels].
2842    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2843    where
2844        T: std::iter::IntoIterator<Item = (K, V)>,
2845        K: std::convert::Into<std::string::String>,
2846        V: std::convert::Into<std::string::String>,
2847    {
2848        use std::iter::Iterator;
2849        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2850        self
2851    }
2852
2853    /// Sets the value of [description][crate::model::ServiceClass::description].
2854    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2855        self.description = v.into();
2856        self
2857    }
2858
2859    /// Sets the value of [etag][crate::model::ServiceClass::etag].
2860    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2861        mut self,
2862        v: T,
2863    ) -> Self {
2864        self.etag = v.into();
2865        self
2866    }
2867}
2868
2869impl wkt::message::Message for ServiceClass {
2870    fn typename() -> &'static str {
2871        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2872    }
2873}
2874
2875/// Request for ListServiceClasses.
2876#[serde_with::serde_as]
2877#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2878#[serde(default, rename_all = "camelCase")]
2879#[non_exhaustive]
2880pub struct ListServiceClassesRequest {
2881    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2882    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2883    pub parent: std::string::String,
2884
2885    /// The maximum number of results per page that should be returned.
2886    #[serde(skip_serializing_if = "wkt::internal::is_default")]
2887    pub page_size: i32,
2888
2889    /// The page token.
2890    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2891    pub page_token: std::string::String,
2892
2893    /// A filter expression that filters the results listed in the response.
2894    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2895    pub filter: std::string::String,
2896
2897    /// Sort the results by a certain order.
2898    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2899    pub order_by: std::string::String,
2900
2901    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2902    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2903}
2904
2905impl ListServiceClassesRequest {
2906    pub fn new() -> Self {
2907        std::default::Default::default()
2908    }
2909
2910    /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
2911    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2912        self.parent = v.into();
2913        self
2914    }
2915
2916    /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
2917    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2918        self.page_size = v.into();
2919        self
2920    }
2921
2922    /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
2923    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924        self.page_token = v.into();
2925        self
2926    }
2927
2928    /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
2929    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2930        self.filter = v.into();
2931        self
2932    }
2933
2934    /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
2935    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2936        self.order_by = v.into();
2937        self
2938    }
2939}
2940
2941impl wkt::message::Message for ListServiceClassesRequest {
2942    fn typename() -> &'static str {
2943        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
2944    }
2945}
2946
2947/// Response for ListServiceClasses.
2948#[serde_with::serde_as]
2949#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2950#[serde(default, rename_all = "camelCase")]
2951#[non_exhaustive]
2952pub struct ListServiceClassesResponse {
2953    /// ServiceClasses to be returned.
2954    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2955    pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
2956
2957    /// The next pagination token in the List response. It should be used as
2958    /// page_token for the following request. An empty value means no more result.
2959    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2960    pub next_page_token: std::string::String,
2961
2962    /// Locations that could not be reached.
2963    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2964    pub unreachable: std::vec::Vec<std::string::String>,
2965
2966    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2967    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2968}
2969
2970impl ListServiceClassesResponse {
2971    pub fn new() -> Self {
2972        std::default::Default::default()
2973    }
2974
2975    /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
2976    pub fn set_service_classes<T, V>(mut self, v: T) -> Self
2977    where
2978        T: std::iter::IntoIterator<Item = V>,
2979        V: std::convert::Into<crate::model::ServiceClass>,
2980    {
2981        use std::iter::Iterator;
2982        self.service_classes = v.into_iter().map(|i| i.into()).collect();
2983        self
2984    }
2985
2986    /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
2987    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988        self.next_page_token = v.into();
2989        self
2990    }
2991
2992    /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
2993    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2994    where
2995        T: std::iter::IntoIterator<Item = V>,
2996        V: std::convert::Into<std::string::String>,
2997    {
2998        use std::iter::Iterator;
2999        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3000        self
3001    }
3002}
3003
3004impl wkt::message::Message for ListServiceClassesResponse {
3005    fn typename() -> &'static str {
3006        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
3007    }
3008}
3009
3010#[doc(hidden)]
3011impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
3012    type PageItem = crate::model::ServiceClass;
3013
3014    fn items(self) -> std::vec::Vec<Self::PageItem> {
3015        self.service_classes
3016    }
3017
3018    fn next_page_token(&self) -> std::string::String {
3019        use std::clone::Clone;
3020        self.next_page_token.clone()
3021    }
3022}
3023
3024/// Request for GetServiceClass.
3025#[serde_with::serde_as]
3026#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3027#[serde(default, rename_all = "camelCase")]
3028#[non_exhaustive]
3029pub struct GetServiceClassRequest {
3030    /// Required. Name of the ServiceClass to get.
3031    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3032    pub name: std::string::String,
3033
3034    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3035    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3036}
3037
3038impl GetServiceClassRequest {
3039    pub fn new() -> Self {
3040        std::default::Default::default()
3041    }
3042
3043    /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
3044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3045        self.name = v.into();
3046        self
3047    }
3048}
3049
3050impl wkt::message::Message for GetServiceClassRequest {
3051    fn typename() -> &'static str {
3052        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
3053    }
3054}
3055
3056/// Request for UpdateServiceClass.
3057#[serde_with::serde_as]
3058#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3059#[serde(default, rename_all = "camelCase")]
3060#[non_exhaustive]
3061pub struct UpdateServiceClassRequest {
3062    /// Optional. Field mask is used to specify the fields to be overwritten in the
3063    /// ServiceClass resource by the update.
3064    /// The fields specified in the update_mask are relative to the resource, not
3065    /// the full request. A field will be overwritten if it is in the mask. If the
3066    /// user does not provide a mask then all fields will be overwritten.
3067    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3068    pub update_mask: std::option::Option<wkt::FieldMask>,
3069
3070    /// Required. New values to be patched into the resource.
3071    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3072    pub service_class: std::option::Option<crate::model::ServiceClass>,
3073
3074    /// Optional. An optional request ID to identify requests. Specify a unique
3075    /// request ID so that if you must retry your request, the server will know to
3076    /// ignore the request if it has already been completed. The server will
3077    /// guarantee that for at least 60 minutes since the first request.
3078    ///
3079    /// For example, consider a situation where you make an initial request and
3080    /// the request times out. If you make the request again with the same request
3081    /// ID, the server can check if original operation with the same request ID
3082    /// was received, and if so, will ignore the second request. This prevents
3083    /// clients from accidentally creating duplicate commitments.
3084    ///
3085    /// The request ID must be a valid UUID with the exception that zero UUID is
3086    /// not supported (00000000-0000-0000-0000-000000000000).
3087    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3088    pub request_id: std::string::String,
3089
3090    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3091    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3092}
3093
3094impl UpdateServiceClassRequest {
3095    pub fn new() -> Self {
3096        std::default::Default::default()
3097    }
3098
3099    /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
3100    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
3101        mut self,
3102        v: T,
3103    ) -> Self {
3104        self.update_mask = v.into();
3105        self
3106    }
3107
3108    /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
3109    pub fn set_service_class<
3110        T: std::convert::Into<std::option::Option<crate::model::ServiceClass>>,
3111    >(
3112        mut self,
3113        v: T,
3114    ) -> Self {
3115        self.service_class = v.into();
3116        self
3117    }
3118
3119    /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
3120    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3121        self.request_id = v.into();
3122        self
3123    }
3124}
3125
3126impl wkt::message::Message for UpdateServiceClassRequest {
3127    fn typename() -> &'static str {
3128        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
3129    }
3130}
3131
3132/// Request for DeleteServiceClass.
3133#[serde_with::serde_as]
3134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3135#[serde(default, rename_all = "camelCase")]
3136#[non_exhaustive]
3137pub struct DeleteServiceClassRequest {
3138    /// Required. The name of the ServiceClass to delete.
3139    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3140    pub name: std::string::String,
3141
3142    /// Optional. An optional request ID to identify requests. Specify a unique
3143    /// request ID so that if you must retry your request, the server will know to
3144    /// ignore the request if it has already been completed. The server will
3145    /// guarantee that for at least 60 minutes after the first request.
3146    ///
3147    /// For example, consider a situation where you make an initial request and
3148    /// the request times out. If you make the request again with the same request
3149    /// ID, the server can check if original operation with the same request ID
3150    /// was received, and if so, will ignore the second request. This prevents
3151    /// clients from accidentally creating duplicate commitments.
3152    ///
3153    /// The request ID must be a valid UUID with the exception that zero UUID is
3154    /// not supported (00000000-0000-0000-0000-000000000000).
3155    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3156    pub request_id: std::string::String,
3157
3158    /// Optional. The etag is computed by the server, and may be sent on update and
3159    /// delete requests to ensure the client has an up-to-date value before
3160    /// proceeding.
3161    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3162    pub etag: std::option::Option<std::string::String>,
3163
3164    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3165    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3166}
3167
3168impl DeleteServiceClassRequest {
3169    pub fn new() -> Self {
3170        std::default::Default::default()
3171    }
3172
3173    /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
3174    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3175        self.name = v.into();
3176        self
3177    }
3178
3179    /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
3180    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3181        self.request_id = v.into();
3182        self
3183    }
3184
3185    /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
3186    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3187        mut self,
3188        v: T,
3189    ) -> Self {
3190        self.etag = v.into();
3191        self
3192    }
3193}
3194
3195impl wkt::message::Message for DeleteServiceClassRequest {
3196    fn typename() -> &'static str {
3197        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
3198    }
3199}
3200
3201/// The ServiceConnectionToken resource.
3202#[serde_with::serde_as]
3203#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3204#[serde(default, rename_all = "camelCase")]
3205#[non_exhaustive]
3206pub struct ServiceConnectionToken {
3207    /// Immutable. The name of a ServiceConnectionToken.
3208    /// Format:
3209    /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
3210    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3211    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3212    pub name: std::string::String,
3213
3214    /// Output only. Time when the ServiceConnectionToken was created.
3215    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3216    pub create_time: std::option::Option<wkt::Timestamp>,
3217
3218    /// Output only. Time when the ServiceConnectionToken was updated.
3219    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3220    pub update_time: std::option::Option<wkt::Timestamp>,
3221
3222    /// User-defined labels.
3223    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3224    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3225
3226    /// A description of this resource.
3227    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3228    pub description: std::string::String,
3229
3230    /// The resource path of the network associated with this token.
3231    /// Example:
3232    /// projects/{projectNumOrId}/global/networks/{resourceId}.
3233    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3234    pub network: std::string::String,
3235
3236    /// Output only. The token generated by Automation.
3237    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3238    pub token: std::string::String,
3239
3240    /// Output only. The time to which this token is valid.
3241    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3242    pub expire_time: std::option::Option<wkt::Timestamp>,
3243
3244    /// Optional. The etag is computed by the server, and may be sent on update and
3245    /// delete requests to ensure the client has an up-to-date value before
3246    /// proceeding.
3247    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3248    pub etag: std::option::Option<std::string::String>,
3249
3250    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3251    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3252}
3253
3254impl ServiceConnectionToken {
3255    pub fn new() -> Self {
3256        std::default::Default::default()
3257    }
3258
3259    /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
3260    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261        self.name = v.into();
3262        self
3263    }
3264
3265    /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
3266    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3267        mut self,
3268        v: T,
3269    ) -> Self {
3270        self.create_time = v.into();
3271        self
3272    }
3273
3274    /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
3275    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3276        mut self,
3277        v: T,
3278    ) -> Self {
3279        self.update_time = v.into();
3280        self
3281    }
3282
3283    /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
3284    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3285    where
3286        T: std::iter::IntoIterator<Item = (K, V)>,
3287        K: std::convert::Into<std::string::String>,
3288        V: std::convert::Into<std::string::String>,
3289    {
3290        use std::iter::Iterator;
3291        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3292        self
3293    }
3294
3295    /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
3296    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3297        self.description = v.into();
3298        self
3299    }
3300
3301    /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
3302    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3303        self.network = v.into();
3304        self
3305    }
3306
3307    /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
3308    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3309        self.token = v.into();
3310        self
3311    }
3312
3313    /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
3314    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3315        mut self,
3316        v: T,
3317    ) -> Self {
3318        self.expire_time = v.into();
3319        self
3320    }
3321
3322    /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
3323    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3324        mut self,
3325        v: T,
3326    ) -> Self {
3327        self.etag = v.into();
3328        self
3329    }
3330}
3331
3332impl wkt::message::Message for ServiceConnectionToken {
3333    fn typename() -> &'static str {
3334        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
3335    }
3336}
3337
3338/// Request for ListServiceConnectionTokens.
3339#[serde_with::serde_as]
3340#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3341#[serde(default, rename_all = "camelCase")]
3342#[non_exhaustive]
3343pub struct ListServiceConnectionTokensRequest {
3344    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3345    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3346    pub parent: std::string::String,
3347
3348    /// The maximum number of results per page that should be returned.
3349    #[serde(skip_serializing_if = "wkt::internal::is_default")]
3350    pub page_size: i32,
3351
3352    /// The page token.
3353    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3354    pub page_token: std::string::String,
3355
3356    /// A filter expression that filters the results listed in the response.
3357    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3358    pub filter: std::string::String,
3359
3360    /// Sort the results by a certain order.
3361    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3362    pub order_by: std::string::String,
3363
3364    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3365    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3366}
3367
3368impl ListServiceConnectionTokensRequest {
3369    pub fn new() -> Self {
3370        std::default::Default::default()
3371    }
3372
3373    /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
3374    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3375        self.parent = v.into();
3376        self
3377    }
3378
3379    /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
3380    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3381        self.page_size = v.into();
3382        self
3383    }
3384
3385    /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
3386    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3387        self.page_token = v.into();
3388        self
3389    }
3390
3391    /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
3392    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3393        self.filter = v.into();
3394        self
3395    }
3396
3397    /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
3398    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399        self.order_by = v.into();
3400        self
3401    }
3402}
3403
3404impl wkt::message::Message for ListServiceConnectionTokensRequest {
3405    fn typename() -> &'static str {
3406        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3407    }
3408}
3409
3410/// Response for ListServiceConnectionTokens.
3411#[serde_with::serde_as]
3412#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3413#[serde(default, rename_all = "camelCase")]
3414#[non_exhaustive]
3415pub struct ListServiceConnectionTokensResponse {
3416    /// ServiceConnectionTokens to be returned.
3417    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3418    pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3419
3420    /// The next pagination token in the List response. It should be used as
3421    /// page_token for the following request. An empty value means no more result.
3422    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3423    pub next_page_token: std::string::String,
3424
3425    /// Locations that could not be reached.
3426    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3427    pub unreachable: std::vec::Vec<std::string::String>,
3428
3429    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3430    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3431}
3432
3433impl ListServiceConnectionTokensResponse {
3434    pub fn new() -> Self {
3435        std::default::Default::default()
3436    }
3437
3438    /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
3439    pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3440    where
3441        T: std::iter::IntoIterator<Item = V>,
3442        V: std::convert::Into<crate::model::ServiceConnectionToken>,
3443    {
3444        use std::iter::Iterator;
3445        self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3446        self
3447    }
3448
3449    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
3450    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3451        self.next_page_token = v.into();
3452        self
3453    }
3454
3455    /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
3456    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3457    where
3458        T: std::iter::IntoIterator<Item = V>,
3459        V: std::convert::Into<std::string::String>,
3460    {
3461        use std::iter::Iterator;
3462        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3463        self
3464    }
3465}
3466
3467impl wkt::message::Message for ListServiceConnectionTokensResponse {
3468    fn typename() -> &'static str {
3469        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3470    }
3471}
3472
3473#[doc(hidden)]
3474impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3475    type PageItem = crate::model::ServiceConnectionToken;
3476
3477    fn items(self) -> std::vec::Vec<Self::PageItem> {
3478        self.service_connection_tokens
3479    }
3480
3481    fn next_page_token(&self) -> std::string::String {
3482        use std::clone::Clone;
3483        self.next_page_token.clone()
3484    }
3485}
3486
3487/// Request for GetServiceConnectionToken.
3488#[serde_with::serde_as]
3489#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3490#[serde(default, rename_all = "camelCase")]
3491#[non_exhaustive]
3492pub struct GetServiceConnectionTokenRequest {
3493    /// Required. Name of the ServiceConnectionToken to get.
3494    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3495    pub name: std::string::String,
3496
3497    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3498    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3499}
3500
3501impl GetServiceConnectionTokenRequest {
3502    pub fn new() -> Self {
3503        std::default::Default::default()
3504    }
3505
3506    /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
3507    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3508        self.name = v.into();
3509        self
3510    }
3511}
3512
3513impl wkt::message::Message for GetServiceConnectionTokenRequest {
3514    fn typename() -> &'static str {
3515        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3516    }
3517}
3518
3519/// Request for CreateServiceConnectionToken.
3520#[serde_with::serde_as]
3521#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3522#[serde(default, rename_all = "camelCase")]
3523#[non_exhaustive]
3524pub struct CreateServiceConnectionTokenRequest {
3525    /// Required. The parent resource's name of the ServiceConnectionToken. ex.
3526    /// projects/123/locations/us-east1
3527    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3528    pub parent: std::string::String,
3529
3530    /// Optional. Resource ID
3531    /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
3532    /// See <https://google.aip.dev/122#resource-id-segments>
3533    /// Unique per location.
3534    /// If one is not provided, one will be generated.
3535    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3536    pub service_connection_token_id: std::string::String,
3537
3538    /// Required. Initial values for a new ServiceConnectionTokens
3539    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3540    pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3541
3542    /// Optional. An optional request ID to identify requests. Specify a unique
3543    /// request ID so that if you must retry your request, the server will know to
3544    /// ignore the request if it has already been completed. The server will
3545    /// guarantee that for at least 60 minutes since the first request.
3546    ///
3547    /// For example, consider a situation where you make an initial request and
3548    /// the request times out. If you make the request again with the same request
3549    /// ID, the server can check if original operation with the same request ID
3550    /// was received, and if so, will ignore the second request. This prevents
3551    /// clients from accidentally creating duplicate commitments.
3552    ///
3553    /// The request ID must be a valid UUID with the exception that zero UUID is
3554    /// not supported (00000000-0000-0000-0000-000000000000).
3555    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3556    pub request_id: std::string::String,
3557
3558    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3559    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3560}
3561
3562impl CreateServiceConnectionTokenRequest {
3563    pub fn new() -> Self {
3564        std::default::Default::default()
3565    }
3566
3567    /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
3568    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3569        self.parent = v.into();
3570        self
3571    }
3572
3573    /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
3574    pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3575        mut self,
3576        v: T,
3577    ) -> Self {
3578        self.service_connection_token_id = v.into();
3579        self
3580    }
3581
3582    /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
3583    pub fn set_service_connection_token<
3584        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionToken>>,
3585    >(
3586        mut self,
3587        v: T,
3588    ) -> Self {
3589        self.service_connection_token = v.into();
3590        self
3591    }
3592
3593    /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
3594    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3595        self.request_id = v.into();
3596        self
3597    }
3598}
3599
3600impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3601    fn typename() -> &'static str {
3602        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3603    }
3604}
3605
3606/// Request for DeleteServiceConnectionToken.
3607#[serde_with::serde_as]
3608#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3609#[serde(default, rename_all = "camelCase")]
3610#[non_exhaustive]
3611pub struct DeleteServiceConnectionTokenRequest {
3612    /// Required. The name of the ServiceConnectionToken to delete.
3613    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3614    pub name: std::string::String,
3615
3616    /// Optional. An optional request ID to identify requests. Specify a unique
3617    /// request ID so that if you must retry your request, the server will know to
3618    /// ignore the request if it has already been completed. The server will
3619    /// guarantee that for at least 60 minutes after the first request.
3620    ///
3621    /// For example, consider a situation where you make an initial request and
3622    /// the request times out. If you make the request again with the same request
3623    /// ID, the server can check if original operation with the same request ID
3624    /// was received, and if so, will ignore the second request. This prevents
3625    /// clients from accidentally creating duplicate commitments.
3626    ///
3627    /// The request ID must be a valid UUID with the exception that zero UUID is
3628    /// not supported (00000000-0000-0000-0000-000000000000).
3629    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3630    pub request_id: std::string::String,
3631
3632    /// Optional. The etag is computed by the server, and may be sent on update and
3633    /// delete requests to ensure the client has an up-to-date value before
3634    /// proceeding.
3635    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3636    pub etag: std::option::Option<std::string::String>,
3637
3638    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3639    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3640}
3641
3642impl DeleteServiceConnectionTokenRequest {
3643    pub fn new() -> Self {
3644        std::default::Default::default()
3645    }
3646
3647    /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
3648    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649        self.name = v.into();
3650        self
3651    }
3652
3653    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
3654    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3655        self.request_id = v.into();
3656        self
3657    }
3658
3659    /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
3660    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3661        mut self,
3662        v: T,
3663    ) -> Self {
3664        self.etag = v.into();
3665        self
3666    }
3667}
3668
3669impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3670    fn typename() -> &'static str {
3671        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3672    }
3673}
3674
3675/// A Network Connectivity Center hub is a global management resource to which
3676/// you attach spokes. A single hub can contain spokes from multiple regions.
3677/// However, if any of a hub's spokes use the site-to-site data transfer feature,
3678/// the resources associated with those spokes must all be in the same VPC
3679/// network. Spokes that do not use site-to-site data transfer can be associated
3680/// with any VPC network in your project.
3681#[serde_with::serde_as]
3682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3683#[serde(default, rename_all = "camelCase")]
3684#[non_exhaustive]
3685pub struct Hub {
3686    /// Immutable. The name of the hub. Hub names must be unique. They use the
3687    /// following form:
3688    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
3689    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3690    pub name: std::string::String,
3691
3692    /// Output only. The time the hub was created.
3693    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3694    pub create_time: std::option::Option<wkt::Timestamp>,
3695
3696    /// Output only. The time the hub was last updated.
3697    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3698    pub update_time: std::option::Option<wkt::Timestamp>,
3699
3700    /// Optional labels in key-value pair format. For more information about
3701    /// labels, see [Requirements for
3702    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
3703    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3704    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3705
3706    /// Optional. An optional description of the hub.
3707    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3708    pub description: std::string::String,
3709
3710    /// Output only. The Google-generated UUID for the hub. This value is unique
3711    /// across all hub resources. If a hub is deleted and another with the same
3712    /// name is created, the new hub is assigned a different unique_id.
3713    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3714    pub unique_id: std::string::String,
3715
3716    /// Output only. The current lifecycle state of this hub.
3717    pub state: crate::model::State,
3718
3719    /// The VPC networks associated with this hub's spokes.
3720    ///
3721    /// This field is read-only. Network Connectivity Center automatically
3722    /// populates it based on the set of spokes attached to the hub.
3723    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3724    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
3725
3726    /// Output only. The route tables that belong to this hub. They use the
3727    /// following form:
3728    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
3729    ///
3730    /// This field is read-only. Network Connectivity Center automatically
3731    /// populates it based on the route tables nested under the hub.
3732    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3733    pub route_tables: std::vec::Vec<std::string::String>,
3734
3735    /// Output only. A summary of the spokes associated with a hub. The
3736    /// summary includes a count of spokes according to type
3737    /// and according to state. If any spokes are inactive,
3738    /// the summary also lists the reasons they are inactive,
3739    /// including a count for each reason.
3740    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3741    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
3742
3743    /// Optional. The policy mode of this hub. This field can be either
3744    /// PRESET or CUSTOM. If unspecified, the
3745    /// policy_mode defaults to PRESET.
3746    pub policy_mode: crate::model::PolicyMode,
3747
3748    /// Optional. The topology implemented in this hub. Currently, this field is
3749    /// only used when policy_mode = PRESET. The available preset topologies are
3750    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
3751    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
3752    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
3753    pub preset_topology: crate::model::PresetTopology,
3754
3755    /// Optional. Whether Private Service Connect connection propagation is enabled
3756    /// for the hub. If true, Private Service Connect endpoints in VPC spokes
3757    /// attached to the hub are made accessible to other VPC spokes attached to the
3758    /// hub. The default value is false.
3759    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3760    pub export_psc: std::option::Option<bool>,
3761
3762    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3763    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3764}
3765
3766impl Hub {
3767    pub fn new() -> Self {
3768        std::default::Default::default()
3769    }
3770
3771    /// Sets the value of [name][crate::model::Hub::name].
3772    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3773        self.name = v.into();
3774        self
3775    }
3776
3777    /// Sets the value of [create_time][crate::model::Hub::create_time].
3778    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3779        mut self,
3780        v: T,
3781    ) -> Self {
3782        self.create_time = v.into();
3783        self
3784    }
3785
3786    /// Sets the value of [update_time][crate::model::Hub::update_time].
3787    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3788        mut self,
3789        v: T,
3790    ) -> Self {
3791        self.update_time = v.into();
3792        self
3793    }
3794
3795    /// Sets the value of [labels][crate::model::Hub::labels].
3796    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3797    where
3798        T: std::iter::IntoIterator<Item = (K, V)>,
3799        K: std::convert::Into<std::string::String>,
3800        V: std::convert::Into<std::string::String>,
3801    {
3802        use std::iter::Iterator;
3803        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3804        self
3805    }
3806
3807    /// Sets the value of [description][crate::model::Hub::description].
3808    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3809        self.description = v.into();
3810        self
3811    }
3812
3813    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
3814    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815        self.unique_id = v.into();
3816        self
3817    }
3818
3819    /// Sets the value of [state][crate::model::Hub::state].
3820    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3821        self.state = v.into();
3822        self
3823    }
3824
3825    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
3826    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
3827    where
3828        T: std::iter::IntoIterator<Item = V>,
3829        V: std::convert::Into<crate::model::RoutingVPC>,
3830    {
3831        use std::iter::Iterator;
3832        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
3833        self
3834    }
3835
3836    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
3837    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
3838    where
3839        T: std::iter::IntoIterator<Item = V>,
3840        V: std::convert::Into<std::string::String>,
3841    {
3842        use std::iter::Iterator;
3843        self.route_tables = v.into_iter().map(|i| i.into()).collect();
3844        self
3845    }
3846
3847    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
3848    pub fn set_spoke_summary<
3849        T: std::convert::Into<std::option::Option<crate::model::SpokeSummary>>,
3850    >(
3851        mut self,
3852        v: T,
3853    ) -> Self {
3854        self.spoke_summary = v.into();
3855        self
3856    }
3857
3858    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
3859    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
3860        mut self,
3861        v: T,
3862    ) -> Self {
3863        self.policy_mode = v.into();
3864        self
3865    }
3866
3867    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
3868    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
3869        mut self,
3870        v: T,
3871    ) -> Self {
3872        self.preset_topology = v.into();
3873        self
3874    }
3875
3876    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
3877    pub fn set_export_psc<T: std::convert::Into<std::option::Option<bool>>>(
3878        mut self,
3879        v: T,
3880    ) -> Self {
3881        self.export_psc = v.into();
3882        self
3883    }
3884}
3885
3886impl wkt::message::Message for Hub {
3887    fn typename() -> &'static str {
3888        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
3889    }
3890}
3891
3892/// RoutingVPC contains information about the VPC networks associated
3893/// with the spokes of a Network Connectivity Center hub.
3894#[serde_with::serde_as]
3895#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3896#[serde(default, rename_all = "camelCase")]
3897#[non_exhaustive]
3898pub struct RoutingVPC {
3899    /// The URI of the VPC network.
3900    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3901    pub uri: std::string::String,
3902
3903    /// Output only. If true, indicates that this VPC network is currently
3904    /// associated with spokes that use the data transfer feature (spokes where the
3905    /// site_to_site_data_transfer field is set to true). If you create new spokes
3906    /// that use data transfer, they must be associated with this VPC network. At
3907    /// most, one VPC network will have this field set to true.
3908    #[serde(skip_serializing_if = "wkt::internal::is_default")]
3909    pub required_for_new_site_to_site_data_transfer_spokes: bool,
3910
3911    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3912    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3913}
3914
3915impl RoutingVPC {
3916    pub fn new() -> Self {
3917        std::default::Default::default()
3918    }
3919
3920    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
3921    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3922        self.uri = v.into();
3923        self
3924    }
3925
3926    /// Sets the value of [required_for_new_site_to_site_data_transfer_spokes][crate::model::RoutingVPC::required_for_new_site_to_site_data_transfer_spokes].
3927    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
3928        mut self,
3929        v: T,
3930    ) -> Self {
3931        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
3932        self
3933    }
3934}
3935
3936impl wkt::message::Message for RoutingVPC {
3937    fn typename() -> &'static str {
3938        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
3939    }
3940}
3941
3942/// A Network Connectivity Center spoke represents one or more network
3943/// connectivity resources.
3944///
3945/// When you create a spoke, you associate it with a hub. You must also
3946/// identify a value for exactly one of the following fields:
3947///
3948/// * linked_vpn_tunnels
3949/// * linked_interconnect_attachments
3950/// * linked_router_appliance_instances
3951/// * linked_vpc_network
3952#[serde_with::serde_as]
3953#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3954#[serde(default, rename_all = "camelCase")]
3955#[non_exhaustive]
3956pub struct Spoke {
3957    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
3958    /// following form:
3959    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
3960    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3961    pub name: std::string::String,
3962
3963    /// Output only. The time the spoke was created.
3964    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3965    pub create_time: std::option::Option<wkt::Timestamp>,
3966
3967    /// Output only. The time the spoke was last updated.
3968    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3969    pub update_time: std::option::Option<wkt::Timestamp>,
3970
3971    /// Optional labels in key-value pair format. For more information about
3972    /// labels, see [Requirements for
3973    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
3974    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3975    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3976
3977    /// Optional. An optional description of the spoke.
3978    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3979    pub description: std::string::String,
3980
3981    /// Immutable. The name of the hub that this spoke is attached to.
3982    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3983    pub hub: std::string::String,
3984
3985    /// Optional. The name of the group that this spoke is associated with.
3986    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3987    pub group: std::string::String,
3988
3989    /// Optional. VPN tunnels that are associated with the spoke.
3990    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3991    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
3992
3993    /// Optional. VLAN attachments that are associated with the spoke.
3994    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3995    pub linked_interconnect_attachments:
3996        std::option::Option<crate::model::LinkedInterconnectAttachments>,
3997
3998    /// Optional. Router appliance instances that are associated with the spoke.
3999    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4000    pub linked_router_appliance_instances:
4001        std::option::Option<crate::model::LinkedRouterApplianceInstances>,
4002
4003    /// Optional. VPC network that is associated with the spoke.
4004    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4005    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
4006
4007    /// Optional. The linked producer VPC that is associated with the spoke.
4008    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4009    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
4010
4011    /// Output only. The Google-generated UUID for the spoke. This value is unique
4012    /// across all spoke resources. If a spoke is deleted and another with the same
4013    /// name is created, the new spoke is assigned a different `unique_id`.
4014    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4015    pub unique_id: std::string::String,
4016
4017    /// Output only. The current lifecycle state of this spoke.
4018    pub state: crate::model::State,
4019
4020    /// Output only. The reasons for current state of the spoke.
4021    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4022    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
4023
4024    /// Output only. The type of resource associated with the spoke.
4025    pub spoke_type: crate::model::SpokeType,
4026
4027    /// Optional. This checksum is computed by the server based on the value of
4028    /// other fields, and may be sent on update and delete requests to ensure the
4029    /// client has an up-to-date value before proceeding.
4030    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4031    pub etag: std::string::String,
4032
4033    /// Optional. The list of fields waiting for hub administration's approval.
4034    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4035    pub field_paths_pending_update: std::vec::Vec<std::string::String>,
4036
4037    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4038    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4039}
4040
4041impl Spoke {
4042    pub fn new() -> Self {
4043        std::default::Default::default()
4044    }
4045
4046    /// Sets the value of [name][crate::model::Spoke::name].
4047    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4048        self.name = v.into();
4049        self
4050    }
4051
4052    /// Sets the value of [create_time][crate::model::Spoke::create_time].
4053    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4054        mut self,
4055        v: T,
4056    ) -> Self {
4057        self.create_time = v.into();
4058        self
4059    }
4060
4061    /// Sets the value of [update_time][crate::model::Spoke::update_time].
4062    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4063        mut self,
4064        v: T,
4065    ) -> Self {
4066        self.update_time = v.into();
4067        self
4068    }
4069
4070    /// Sets the value of [labels][crate::model::Spoke::labels].
4071    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4072    where
4073        T: std::iter::IntoIterator<Item = (K, V)>,
4074        K: std::convert::Into<std::string::String>,
4075        V: std::convert::Into<std::string::String>,
4076    {
4077        use std::iter::Iterator;
4078        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4079        self
4080    }
4081
4082    /// Sets the value of [description][crate::model::Spoke::description].
4083    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4084        self.description = v.into();
4085        self
4086    }
4087
4088    /// Sets the value of [hub][crate::model::Spoke::hub].
4089    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090        self.hub = v.into();
4091        self
4092    }
4093
4094    /// Sets the value of [group][crate::model::Spoke::group].
4095    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4096        self.group = v.into();
4097        self
4098    }
4099
4100    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
4101    pub fn set_linked_vpn_tunnels<
4102        T: std::convert::Into<std::option::Option<crate::model::LinkedVpnTunnels>>,
4103    >(
4104        mut self,
4105        v: T,
4106    ) -> Self {
4107        self.linked_vpn_tunnels = v.into();
4108        self
4109    }
4110
4111    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
4112    pub fn set_linked_interconnect_attachments<
4113        T: std::convert::Into<std::option::Option<crate::model::LinkedInterconnectAttachments>>,
4114    >(
4115        mut self,
4116        v: T,
4117    ) -> Self {
4118        self.linked_interconnect_attachments = v.into();
4119        self
4120    }
4121
4122    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
4123    pub fn set_linked_router_appliance_instances<
4124        T: std::convert::Into<std::option::Option<crate::model::LinkedRouterApplianceInstances>>,
4125    >(
4126        mut self,
4127        v: T,
4128    ) -> Self {
4129        self.linked_router_appliance_instances = v.into();
4130        self
4131    }
4132
4133    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
4134    pub fn set_linked_vpc_network<
4135        T: std::convert::Into<std::option::Option<crate::model::LinkedVpcNetwork>>,
4136    >(
4137        mut self,
4138        v: T,
4139    ) -> Self {
4140        self.linked_vpc_network = v.into();
4141        self
4142    }
4143
4144    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
4145    pub fn set_linked_producer_vpc_network<
4146        T: std::convert::Into<std::option::Option<crate::model::LinkedProducerVpcNetwork>>,
4147    >(
4148        mut self,
4149        v: T,
4150    ) -> Self {
4151        self.linked_producer_vpc_network = v.into();
4152        self
4153    }
4154
4155    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
4156    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157        self.unique_id = v.into();
4158        self
4159    }
4160
4161    /// Sets the value of [state][crate::model::Spoke::state].
4162    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4163        self.state = v.into();
4164        self
4165    }
4166
4167    /// Sets the value of [reasons][crate::model::Spoke::reasons].
4168    pub fn set_reasons<T, V>(mut self, v: T) -> Self
4169    where
4170        T: std::iter::IntoIterator<Item = V>,
4171        V: std::convert::Into<crate::model::spoke::StateReason>,
4172    {
4173        use std::iter::Iterator;
4174        self.reasons = v.into_iter().map(|i| i.into()).collect();
4175        self
4176    }
4177
4178    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
4179    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
4180        self.spoke_type = v.into();
4181        self
4182    }
4183
4184    /// Sets the value of [etag][crate::model::Spoke::etag].
4185    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4186        self.etag = v.into();
4187        self
4188    }
4189
4190    /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
4191    pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
4192    where
4193        T: std::iter::IntoIterator<Item = V>,
4194        V: std::convert::Into<std::string::String>,
4195    {
4196        use std::iter::Iterator;
4197        self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
4198        self
4199    }
4200}
4201
4202impl wkt::message::Message for Spoke {
4203    fn typename() -> &'static str {
4204        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
4205    }
4206}
4207
4208/// Defines additional types related to [Spoke].
4209pub mod spoke {
4210    #[allow(unused_imports)]
4211    use super::*;
4212
4213    /// The reason a spoke is inactive.
4214    #[serde_with::serde_as]
4215    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4216    #[serde(default, rename_all = "camelCase")]
4217    #[non_exhaustive]
4218    pub struct StateReason {
4219        /// The code associated with this reason.
4220        pub code: crate::model::spoke::state_reason::Code,
4221
4222        /// Human-readable details about this reason.
4223        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4224        pub message: std::string::String,
4225
4226        /// Additional information provided by the user in the RejectSpoke call.
4227        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4228        pub user_details: std::string::String,
4229
4230        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4231        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4232    }
4233
4234    impl StateReason {
4235        pub fn new() -> Self {
4236            std::default::Default::default()
4237        }
4238
4239        /// Sets the value of [code][crate::model::spoke::StateReason::code].
4240        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
4241            mut self,
4242            v: T,
4243        ) -> Self {
4244            self.code = v.into();
4245            self
4246        }
4247
4248        /// Sets the value of [message][crate::model::spoke::StateReason::message].
4249        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4250            self.message = v.into();
4251            self
4252        }
4253
4254        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
4255        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
4256            mut self,
4257            v: T,
4258        ) -> Self {
4259            self.user_details = v.into();
4260            self
4261        }
4262    }
4263
4264    impl wkt::message::Message for StateReason {
4265        fn typename() -> &'static str {
4266            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
4267        }
4268    }
4269
4270    /// Defines additional types related to [StateReason].
4271    pub mod state_reason {
4272        #[allow(unused_imports)]
4273        use super::*;
4274
4275        /// The Code enum represents the various reasons a state can be `INACTIVE`.
4276        ///
4277        /// # Working with unknown values
4278        ///
4279        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4280        /// additional enum variants at any time. Adding new variants is not considered
4281        /// a breaking change. Applications should write their code in anticipation of:
4282        ///
4283        /// - New values appearing in future releases of the client library, **and**
4284        /// - New values received dynamically, without application changes.
4285        ///
4286        /// Please consult the [Working with enums] section in the user guide for some
4287        /// guidelines.
4288        ///
4289        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4290        #[derive(Clone, Debug, PartialEq)]
4291        #[non_exhaustive]
4292        pub enum Code {
4293            /// No information available.
4294            Unspecified,
4295            /// The proposed spoke is pending review.
4296            PendingReview,
4297            /// The proposed spoke has been rejected by the hub administrator.
4298            Rejected,
4299            /// The spoke has been deactivated internally.
4300            Paused,
4301            /// Network Connectivity Center encountered errors while accepting
4302            /// the spoke.
4303            Failed,
4304            /// The proposed spoke update is pending review.
4305            UpdatePendingReview,
4306            /// The proposed spoke update has been rejected by the hub administrator.
4307            UpdateRejected,
4308            /// Network Connectivity Center encountered errors while accepting
4309            /// the spoke update.
4310            UpdateFailed,
4311            /// If set, the enum was initialized with an unknown value.
4312            ///
4313            /// Applications can examine the value using [Code::value] or
4314            /// [Code::name].
4315            UnknownValue(code::UnknownValue),
4316        }
4317
4318        #[doc(hidden)]
4319        pub mod code {
4320            #[allow(unused_imports)]
4321            use super::*;
4322            #[derive(Clone, Debug, PartialEq)]
4323            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4324        }
4325
4326        impl Code {
4327            /// Gets the enum value.
4328            ///
4329            /// Returns `None` if the enum contains an unknown value deserialized from
4330            /// the string representation of enums.
4331            pub fn value(&self) -> std::option::Option<i32> {
4332                match self {
4333                    Self::Unspecified => std::option::Option::Some(0),
4334                    Self::PendingReview => std::option::Option::Some(1),
4335                    Self::Rejected => std::option::Option::Some(2),
4336                    Self::Paused => std::option::Option::Some(3),
4337                    Self::Failed => std::option::Option::Some(4),
4338                    Self::UpdatePendingReview => std::option::Option::Some(5),
4339                    Self::UpdateRejected => std::option::Option::Some(6),
4340                    Self::UpdateFailed => std::option::Option::Some(7),
4341                    Self::UnknownValue(u) => u.0.value(),
4342                }
4343            }
4344
4345            /// Gets the enum value as a string.
4346            ///
4347            /// Returns `None` if the enum contains an unknown value deserialized from
4348            /// the integer representation of enums.
4349            pub fn name(&self) -> std::option::Option<&str> {
4350                match self {
4351                    Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
4352                    Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
4353                    Self::Rejected => std::option::Option::Some("REJECTED"),
4354                    Self::Paused => std::option::Option::Some("PAUSED"),
4355                    Self::Failed => std::option::Option::Some("FAILED"),
4356                    Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
4357                    Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
4358                    Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
4359                    Self::UnknownValue(u) => u.0.name(),
4360                }
4361            }
4362        }
4363
4364        impl std::default::Default for Code {
4365            fn default() -> Self {
4366                use std::convert::From;
4367                Self::from(0)
4368            }
4369        }
4370
4371        impl std::fmt::Display for Code {
4372            fn fmt(
4373                &self,
4374                f: &mut std::fmt::Formatter<'_>,
4375            ) -> std::result::Result<(), std::fmt::Error> {
4376                wkt::internal::display_enum(f, self.name(), self.value())
4377            }
4378        }
4379
4380        impl std::convert::From<i32> for Code {
4381            fn from(value: i32) -> Self {
4382                match value {
4383                    0 => Self::Unspecified,
4384                    1 => Self::PendingReview,
4385                    2 => Self::Rejected,
4386                    3 => Self::Paused,
4387                    4 => Self::Failed,
4388                    5 => Self::UpdatePendingReview,
4389                    6 => Self::UpdateRejected,
4390                    7 => Self::UpdateFailed,
4391                    _ => Self::UnknownValue(code::UnknownValue(
4392                        wkt::internal::UnknownEnumValue::Integer(value),
4393                    )),
4394                }
4395            }
4396        }
4397
4398        impl std::convert::From<&str> for Code {
4399            fn from(value: &str) -> Self {
4400                use std::string::ToString;
4401                match value {
4402                    "CODE_UNSPECIFIED" => Self::Unspecified,
4403                    "PENDING_REVIEW" => Self::PendingReview,
4404                    "REJECTED" => Self::Rejected,
4405                    "PAUSED" => Self::Paused,
4406                    "FAILED" => Self::Failed,
4407                    "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
4408                    "UPDATE_REJECTED" => Self::UpdateRejected,
4409                    "UPDATE_FAILED" => Self::UpdateFailed,
4410                    _ => Self::UnknownValue(code::UnknownValue(
4411                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4412                    )),
4413                }
4414            }
4415        }
4416
4417        impl serde::ser::Serialize for Code {
4418            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4419            where
4420                S: serde::Serializer,
4421            {
4422                match self {
4423                    Self::Unspecified => serializer.serialize_i32(0),
4424                    Self::PendingReview => serializer.serialize_i32(1),
4425                    Self::Rejected => serializer.serialize_i32(2),
4426                    Self::Paused => serializer.serialize_i32(3),
4427                    Self::Failed => serializer.serialize_i32(4),
4428                    Self::UpdatePendingReview => serializer.serialize_i32(5),
4429                    Self::UpdateRejected => serializer.serialize_i32(6),
4430                    Self::UpdateFailed => serializer.serialize_i32(7),
4431                    Self::UnknownValue(u) => u.0.serialize(serializer),
4432                }
4433            }
4434        }
4435
4436        impl<'de> serde::de::Deserialize<'de> for Code {
4437            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4438            where
4439                D: serde::Deserializer<'de>,
4440            {
4441                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
4442                    ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
4443                ))
4444            }
4445        }
4446    }
4447}
4448
4449#[serde_with::serde_as]
4450#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4451#[serde(default, rename_all = "camelCase")]
4452#[non_exhaustive]
4453pub struct RouteTable {
4454    /// Immutable. The name of the route table. Route table names must be unique.
4455    /// They use the following form:
4456    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
4457    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4458    pub name: std::string::String,
4459
4460    /// Output only. The time the route table was created.
4461    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4462    pub create_time: std::option::Option<wkt::Timestamp>,
4463
4464    /// Output only. The time the route table was last updated.
4465    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4466    pub update_time: std::option::Option<wkt::Timestamp>,
4467
4468    /// Optional labels in key-value pair format. For more information about
4469    /// labels, see [Requirements for
4470    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4471    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4472    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4473
4474    /// An optional description of the route table.
4475    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4476    pub description: std::string::String,
4477
4478    /// Output only. The Google-generated UUID for the route table. This value is
4479    /// unique across all route table resources. If a route table is deleted and
4480    /// another with the same name is created, the new route table is assigned
4481    /// a different `uid`.
4482    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4483    pub uid: std::string::String,
4484
4485    /// Output only. The current lifecycle state of this route table.
4486    pub state: crate::model::State,
4487
4488    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4489    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4490}
4491
4492impl RouteTable {
4493    pub fn new() -> Self {
4494        std::default::Default::default()
4495    }
4496
4497    /// Sets the value of [name][crate::model::RouteTable::name].
4498    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4499        self.name = v.into();
4500        self
4501    }
4502
4503    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
4504    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4505        mut self,
4506        v: T,
4507    ) -> Self {
4508        self.create_time = v.into();
4509        self
4510    }
4511
4512    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
4513    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4514        mut self,
4515        v: T,
4516    ) -> Self {
4517        self.update_time = v.into();
4518        self
4519    }
4520
4521    /// Sets the value of [labels][crate::model::RouteTable::labels].
4522    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4523    where
4524        T: std::iter::IntoIterator<Item = (K, V)>,
4525        K: std::convert::Into<std::string::String>,
4526        V: std::convert::Into<std::string::String>,
4527    {
4528        use std::iter::Iterator;
4529        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4530        self
4531    }
4532
4533    /// Sets the value of [description][crate::model::RouteTable::description].
4534    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4535        self.description = v.into();
4536        self
4537    }
4538
4539    /// Sets the value of [uid][crate::model::RouteTable::uid].
4540    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541        self.uid = v.into();
4542        self
4543    }
4544
4545    /// Sets the value of [state][crate::model::RouteTable::state].
4546    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4547        self.state = v.into();
4548        self
4549    }
4550}
4551
4552impl wkt::message::Message for RouteTable {
4553    fn typename() -> &'static str {
4554        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
4555    }
4556}
4557
4558/// A route defines a path from VM instances within a spoke to a specific
4559/// destination resource. Only VPC spokes have routes.
4560#[serde_with::serde_as]
4561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4562#[serde(default, rename_all = "camelCase")]
4563#[non_exhaustive]
4564pub struct Route {
4565    /// Immutable. The name of the route. Route names must be unique. Route names
4566    /// use the following form:
4567    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
4568    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4569    pub name: std::string::String,
4570
4571    /// Output only. The time the route was created.
4572    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4573    pub create_time: std::option::Option<wkt::Timestamp>,
4574
4575    /// Output only. The time the route was last updated.
4576    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4577    pub update_time: std::option::Option<wkt::Timestamp>,
4578
4579    /// The destination IP address range.
4580    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4581    pub ip_cidr_range: std::string::String,
4582
4583    /// Output only. The route's type. Its type is determined by the properties of
4584    /// its IP address range.
4585    #[serde(rename = "type")]
4586    pub r#type: crate::model::RouteType,
4587
4588    /// Immutable. The destination VPC network for packets on this route.
4589    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4590    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
4591
4592    /// Optional labels in key-value pair format. For more information about
4593    /// labels, see [Requirements for
4594    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4595    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4596    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4597
4598    /// An optional description of the route.
4599    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4600    pub description: std::string::String,
4601
4602    /// Output only. The Google-generated UUID for the route. This value is unique
4603    /// across all Network Connectivity Center route resources. If a
4604    /// route is deleted and another with the same name is created,
4605    /// the new route is assigned a different `uid`.
4606    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4607    pub uid: std::string::String,
4608
4609    /// Output only. The current lifecycle state of the route.
4610    pub state: crate::model::State,
4611
4612    /// Immutable. The spoke that this route leads to.
4613    /// Example: projects/12345/locations/global/spokes/SPOKE
4614    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4615    pub spoke: std::string::String,
4616
4617    /// Output only. The origin location of the route.
4618    /// Uses the following form: "projects/{project}/locations/{location}"
4619    /// Example: projects/1234/locations/us-central1
4620    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4621    pub location: std::string::String,
4622
4623    /// Output only. The priority of this route. Priority is used to break ties in
4624    /// cases where a destination matches more than one route. In these cases the
4625    /// route with the lowest-numbered priority value wins.
4626    #[serde(skip_serializing_if = "wkt::internal::is_default")]
4627    #[serde_as(as = "serde_with::DisplayFromStr")]
4628    pub priority: i64,
4629
4630    /// Immutable. The next-hop VPN tunnel for packets on this route.
4631    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4632    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
4633
4634    /// Immutable. The next-hop Router appliance instance for packets on this
4635    /// route.
4636    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4637    pub next_hop_router_appliance_instance:
4638        std::option::Option<crate::model::NextHopRouterApplianceInstance>,
4639
4640    /// Immutable. The next-hop VLAN attachment for packets on this route.
4641    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4642    pub next_hop_interconnect_attachment:
4643        std::option::Option<crate::model::NextHopInterconnectAttachment>,
4644
4645    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4646    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4647}
4648
4649impl Route {
4650    pub fn new() -> Self {
4651        std::default::Default::default()
4652    }
4653
4654    /// Sets the value of [name][crate::model::Route::name].
4655    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4656        self.name = v.into();
4657        self
4658    }
4659
4660    /// Sets the value of [create_time][crate::model::Route::create_time].
4661    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4662        mut self,
4663        v: T,
4664    ) -> Self {
4665        self.create_time = v.into();
4666        self
4667    }
4668
4669    /// Sets the value of [update_time][crate::model::Route::update_time].
4670    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4671        mut self,
4672        v: T,
4673    ) -> Self {
4674        self.update_time = v.into();
4675        self
4676    }
4677
4678    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
4679    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4680        self.ip_cidr_range = v.into();
4681        self
4682    }
4683
4684    /// Sets the value of [r#type][crate::model::Route::type].
4685    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
4686        self.r#type = v.into();
4687        self
4688    }
4689
4690    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
4691    pub fn set_next_hop_vpc_network<
4692        T: std::convert::Into<std::option::Option<crate::model::NextHopVpcNetwork>>,
4693    >(
4694        mut self,
4695        v: T,
4696    ) -> Self {
4697        self.next_hop_vpc_network = v.into();
4698        self
4699    }
4700
4701    /// Sets the value of [labels][crate::model::Route::labels].
4702    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4703    where
4704        T: std::iter::IntoIterator<Item = (K, V)>,
4705        K: std::convert::Into<std::string::String>,
4706        V: std::convert::Into<std::string::String>,
4707    {
4708        use std::iter::Iterator;
4709        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4710        self
4711    }
4712
4713    /// Sets the value of [description][crate::model::Route::description].
4714    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4715        self.description = v.into();
4716        self
4717    }
4718
4719    /// Sets the value of [uid][crate::model::Route::uid].
4720    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4721        self.uid = v.into();
4722        self
4723    }
4724
4725    /// Sets the value of [state][crate::model::Route::state].
4726    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4727        self.state = v.into();
4728        self
4729    }
4730
4731    /// Sets the value of [spoke][crate::model::Route::spoke].
4732    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4733        self.spoke = v.into();
4734        self
4735    }
4736
4737    /// Sets the value of [location][crate::model::Route::location].
4738    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4739        self.location = v.into();
4740        self
4741    }
4742
4743    /// Sets the value of [priority][crate::model::Route::priority].
4744    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4745        self.priority = v.into();
4746        self
4747    }
4748
4749    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
4750    pub fn set_next_hop_vpn_tunnel<
4751        T: std::convert::Into<std::option::Option<crate::model::NextHopVPNTunnel>>,
4752    >(
4753        mut self,
4754        v: T,
4755    ) -> Self {
4756        self.next_hop_vpn_tunnel = v.into();
4757        self
4758    }
4759
4760    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
4761    pub fn set_next_hop_router_appliance_instance<
4762        T: std::convert::Into<std::option::Option<crate::model::NextHopRouterApplianceInstance>>,
4763    >(
4764        mut self,
4765        v: T,
4766    ) -> Self {
4767        self.next_hop_router_appliance_instance = v.into();
4768        self
4769    }
4770
4771    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
4772    pub fn set_next_hop_interconnect_attachment<
4773        T: std::convert::Into<std::option::Option<crate::model::NextHopInterconnectAttachment>>,
4774    >(
4775        mut self,
4776        v: T,
4777    ) -> Self {
4778        self.next_hop_interconnect_attachment = v.into();
4779        self
4780    }
4781}
4782
4783impl wkt::message::Message for Route {
4784    fn typename() -> &'static str {
4785        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
4786    }
4787}
4788
4789/// A group represents a subset of spokes attached to a hub.
4790#[serde_with::serde_as]
4791#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4792#[serde(default, rename_all = "camelCase")]
4793#[non_exhaustive]
4794pub struct Group {
4795    /// Immutable. The name of the group. Group names must be unique. They
4796    /// use the following form:
4797    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
4798    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4799    pub name: std::string::String,
4800
4801    /// Output only. The time the group was created.
4802    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4803    pub create_time: std::option::Option<wkt::Timestamp>,
4804
4805    /// Output only. The time the group was last updated.
4806    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4807    pub update_time: std::option::Option<wkt::Timestamp>,
4808
4809    /// Optional. Labels in key-value pair format. For more information about
4810    /// labels, see [Requirements for
4811    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4812    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4813    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4814
4815    /// Optional. The description of the group.
4816    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4817    pub description: std::string::String,
4818
4819    /// Output only. The Google-generated UUID for the group. This value is unique
4820    /// across all group resources. If a group is deleted and
4821    /// another with the same name is created, the new route table is assigned
4822    /// a different unique_id.
4823    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4824    pub uid: std::string::String,
4825
4826    /// Output only. The current lifecycle state of this group.
4827    pub state: crate::model::State,
4828
4829    /// Optional. The auto-accept setting for this group.
4830    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4831    pub auto_accept: std::option::Option<crate::model::AutoAccept>,
4832
4833    /// Output only. The name of the route table that corresponds to this group.
4834    /// They use the following form:
4835    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
4836    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4837    pub route_table: std::string::String,
4838
4839    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4840    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4841}
4842
4843impl Group {
4844    pub fn new() -> Self {
4845        std::default::Default::default()
4846    }
4847
4848    /// Sets the value of [name][crate::model::Group::name].
4849    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4850        self.name = v.into();
4851        self
4852    }
4853
4854    /// Sets the value of [create_time][crate::model::Group::create_time].
4855    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4856        mut self,
4857        v: T,
4858    ) -> Self {
4859        self.create_time = v.into();
4860        self
4861    }
4862
4863    /// Sets the value of [update_time][crate::model::Group::update_time].
4864    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4865        mut self,
4866        v: T,
4867    ) -> Self {
4868        self.update_time = v.into();
4869        self
4870    }
4871
4872    /// Sets the value of [labels][crate::model::Group::labels].
4873    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4874    where
4875        T: std::iter::IntoIterator<Item = (K, V)>,
4876        K: std::convert::Into<std::string::String>,
4877        V: std::convert::Into<std::string::String>,
4878    {
4879        use std::iter::Iterator;
4880        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4881        self
4882    }
4883
4884    /// Sets the value of [description][crate::model::Group::description].
4885    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4886        self.description = v.into();
4887        self
4888    }
4889
4890    /// Sets the value of [uid][crate::model::Group::uid].
4891    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4892        self.uid = v.into();
4893        self
4894    }
4895
4896    /// Sets the value of [state][crate::model::Group::state].
4897    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4898        self.state = v.into();
4899        self
4900    }
4901
4902    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
4903    pub fn set_auto_accept<T: std::convert::Into<std::option::Option<crate::model::AutoAccept>>>(
4904        mut self,
4905        v: T,
4906    ) -> Self {
4907        self.auto_accept = v.into();
4908        self
4909    }
4910
4911    /// Sets the value of [route_table][crate::model::Group::route_table].
4912    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4913        self.route_table = v.into();
4914        self
4915    }
4916}
4917
4918impl wkt::message::Message for Group {
4919    fn typename() -> &'static str {
4920        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
4921    }
4922}
4923
4924/// The auto-accept setting for a group controls whether
4925/// proposed spokes are automatically attached to the hub. If auto-accept is
4926/// enabled, the spoke immediately is attached to the hub and becomes part of the
4927/// group. In this case, the new spoke is in the ACTIVE state.
4928/// If auto-accept is disabled, the spoke goes to the INACTIVE
4929/// state, and it must be reviewed and accepted by a hub
4930/// administrator.
4931#[serde_with::serde_as]
4932#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4933#[serde(default, rename_all = "camelCase")]
4934#[non_exhaustive]
4935pub struct AutoAccept {
4936    /// Optional. A list of project ids or project numbers for which you want
4937    /// to enable auto-accept. The auto-accept setting is applied to
4938    /// spokes being created or updated in these projects.
4939    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4940    pub auto_accept_projects: std::vec::Vec<std::string::String>,
4941
4942    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4943    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4944}
4945
4946impl AutoAccept {
4947    pub fn new() -> Self {
4948        std::default::Default::default()
4949    }
4950
4951    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
4952    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
4953    where
4954        T: std::iter::IntoIterator<Item = V>,
4955        V: std::convert::Into<std::string::String>,
4956    {
4957        use std::iter::Iterator;
4958        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
4959        self
4960    }
4961}
4962
4963impl wkt::message::Message for AutoAccept {
4964    fn typename() -> &'static str {
4965        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
4966    }
4967}
4968
4969/// Request for
4970/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
4971/// method.
4972///
4973/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
4974#[serde_with::serde_as]
4975#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4976#[serde(default, rename_all = "camelCase")]
4977#[non_exhaustive]
4978pub struct ListHubsRequest {
4979    /// Required. The parent resource's name.
4980    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4981    pub parent: std::string::String,
4982
4983    /// The maximum number of results per page to return.
4984    #[serde(skip_serializing_if = "wkt::internal::is_default")]
4985    pub page_size: i32,
4986
4987    /// The page token.
4988    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4989    pub page_token: std::string::String,
4990
4991    /// An expression that filters the list of results.
4992    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4993    pub filter: std::string::String,
4994
4995    /// Sort the results by a certain order.
4996    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4997    pub order_by: std::string::String,
4998
4999    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5000    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5001}
5002
5003impl ListHubsRequest {
5004    pub fn new() -> Self {
5005        std::default::Default::default()
5006    }
5007
5008    /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5009    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010        self.parent = v.into();
5011        self
5012    }
5013
5014    /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5015    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5016        self.page_size = v.into();
5017        self
5018    }
5019
5020    /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5021    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022        self.page_token = v.into();
5023        self
5024    }
5025
5026    /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5027    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5028        self.filter = v.into();
5029        self
5030    }
5031
5032    /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5033    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5034        self.order_by = v.into();
5035        self
5036    }
5037}
5038
5039impl wkt::message::Message for ListHubsRequest {
5040    fn typename() -> &'static str {
5041        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
5042    }
5043}
5044
5045/// Response for
5046/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
5047/// method.
5048///
5049/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
5050#[serde_with::serde_as]
5051#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5052#[serde(default, rename_all = "camelCase")]
5053#[non_exhaustive]
5054pub struct ListHubsResponse {
5055    /// The requested hubs.
5056    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5057    pub hubs: std::vec::Vec<crate::model::Hub>,
5058
5059    /// The token for the next page of the response. To see more results,
5060    /// use this value as the page_token for your next request. If this value
5061    /// is empty, there are no more results.
5062    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5063    pub next_page_token: std::string::String,
5064
5065    /// Locations that could not be reached.
5066    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5067    pub unreachable: std::vec::Vec<std::string::String>,
5068
5069    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5070    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5071}
5072
5073impl ListHubsResponse {
5074    pub fn new() -> Self {
5075        std::default::Default::default()
5076    }
5077
5078    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
5079    pub fn set_hubs<T, V>(mut self, v: T) -> Self
5080    where
5081        T: std::iter::IntoIterator<Item = V>,
5082        V: std::convert::Into<crate::model::Hub>,
5083    {
5084        use std::iter::Iterator;
5085        self.hubs = v.into_iter().map(|i| i.into()).collect();
5086        self
5087    }
5088
5089    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
5090    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5091        self.next_page_token = v.into();
5092        self
5093    }
5094
5095    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
5096    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5097    where
5098        T: std::iter::IntoIterator<Item = V>,
5099        V: std::convert::Into<std::string::String>,
5100    {
5101        use std::iter::Iterator;
5102        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5103        self
5104    }
5105}
5106
5107impl wkt::message::Message for ListHubsResponse {
5108    fn typename() -> &'static str {
5109        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
5110    }
5111}
5112
5113#[doc(hidden)]
5114impl gax::paginator::internal::PageableResponse for ListHubsResponse {
5115    type PageItem = crate::model::Hub;
5116
5117    fn items(self) -> std::vec::Vec<Self::PageItem> {
5118        self.hubs
5119    }
5120
5121    fn next_page_token(&self) -> std::string::String {
5122        use std::clone::Clone;
5123        self.next_page_token.clone()
5124    }
5125}
5126
5127/// Request for
5128/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
5129/// method.
5130///
5131/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
5132#[serde_with::serde_as]
5133#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5134#[serde(default, rename_all = "camelCase")]
5135#[non_exhaustive]
5136pub struct GetHubRequest {
5137    /// Required. The name of the hub resource to get.
5138    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5139    pub name: std::string::String,
5140
5141    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5142    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5143}
5144
5145impl GetHubRequest {
5146    pub fn new() -> Self {
5147        std::default::Default::default()
5148    }
5149
5150    /// Sets the value of [name][crate::model::GetHubRequest::name].
5151    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5152        self.name = v.into();
5153        self
5154    }
5155}
5156
5157impl wkt::message::Message for GetHubRequest {
5158    fn typename() -> &'static str {
5159        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
5160    }
5161}
5162
5163/// Request for
5164/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
5165/// method.
5166///
5167/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
5168#[serde_with::serde_as]
5169#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5170#[serde(default, rename_all = "camelCase")]
5171#[non_exhaustive]
5172pub struct CreateHubRequest {
5173    /// Required. The parent resource.
5174    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5175    pub parent: std::string::String,
5176
5177    /// Required. A unique identifier for the hub.
5178    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5179    pub hub_id: std::string::String,
5180
5181    /// Required. The initial values for a new hub.
5182    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5183    pub hub: std::option::Option<crate::model::Hub>,
5184
5185    /// Optional. A request ID to identify requests. Specify a unique request ID so
5186    /// that if you must retry your request, the server knows to ignore the request
5187    /// if it has already been completed. The server guarantees that a request
5188    /// doesn't result in creation of duplicate commitments for at least 60
5189    /// minutes.
5190    ///
5191    /// For example, consider a situation where you make an initial request and
5192    /// the request times out. If you make the request again with the same request
5193    /// ID, the server can check to see whether the original operation
5194    /// was received. If it was, the server ignores the second request. This
5195    /// behavior prevents clients from mistakenly creating duplicate commitments.
5196    ///
5197    /// The request ID must be a valid UUID, with the exception that zero UUID is
5198    /// not supported (00000000-0000-0000-0000-000000000000).
5199    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5200    pub request_id: std::string::String,
5201
5202    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5203    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5204}
5205
5206impl CreateHubRequest {
5207    pub fn new() -> Self {
5208        std::default::Default::default()
5209    }
5210
5211    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5212    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5213        self.parent = v.into();
5214        self
5215    }
5216
5217    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5218    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5219        self.hub_id = v.into();
5220        self
5221    }
5222
5223    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5224    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
5225        mut self,
5226        v: T,
5227    ) -> Self {
5228        self.hub = v.into();
5229        self
5230    }
5231
5232    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5233    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5234        self.request_id = v.into();
5235        self
5236    }
5237}
5238
5239impl wkt::message::Message for CreateHubRequest {
5240    fn typename() -> &'static str {
5241        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
5242    }
5243}
5244
5245/// Request for
5246/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
5247/// method.
5248///
5249/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
5250#[serde_with::serde_as]
5251#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5252#[serde(default, rename_all = "camelCase")]
5253#[non_exhaustive]
5254pub struct UpdateHubRequest {
5255    /// Optional. In the case of an update to an existing hub, field mask is used
5256    /// to specify the fields to be overwritten. The fields specified in the
5257    /// update_mask are relative to the resource, not the full request. A field is
5258    /// overwritten if it is in the mask. If the user does not provide a mask, then
5259    /// all fields are overwritten.
5260    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5261    pub update_mask: std::option::Option<wkt::FieldMask>,
5262
5263    /// Required. The state that the hub should be in after the update.
5264    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5265    pub hub: std::option::Option<crate::model::Hub>,
5266
5267    /// Optional. A request ID to identify requests. Specify a unique request ID so
5268    /// that if you must retry your request, the server knows to ignore the request
5269    /// if it has already been completed. The server guarantees that a request
5270    /// doesn't result in creation of duplicate commitments for at least 60
5271    /// minutes.
5272    ///
5273    /// For example, consider a situation where you make an initial request and
5274    /// the request times out. If you make the request again with the same request
5275    /// ID, the server can check to see whether the original operation
5276    /// was received. If it was, the server ignores the second request. This
5277    /// behavior prevents clients from mistakenly creating duplicate commitments.
5278    ///
5279    /// The request ID must be a valid UUID, with the exception that zero UUID is
5280    /// not supported (00000000-0000-0000-0000-000000000000).
5281    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5282    pub request_id: std::string::String,
5283
5284    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5285    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5286}
5287
5288impl UpdateHubRequest {
5289    pub fn new() -> Self {
5290        std::default::Default::default()
5291    }
5292
5293    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5294    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5295        mut self,
5296        v: T,
5297    ) -> Self {
5298        self.update_mask = v.into();
5299        self
5300    }
5301
5302    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5303    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
5304        mut self,
5305        v: T,
5306    ) -> Self {
5307        self.hub = v.into();
5308        self
5309    }
5310
5311    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5312    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313        self.request_id = v.into();
5314        self
5315    }
5316}
5317
5318impl wkt::message::Message for UpdateHubRequest {
5319    fn typename() -> &'static str {
5320        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
5321    }
5322}
5323
5324/// The request for
5325/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
5326///
5327/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
5328#[serde_with::serde_as]
5329#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5330#[serde(default, rename_all = "camelCase")]
5331#[non_exhaustive]
5332pub struct DeleteHubRequest {
5333    /// Required. The name of the hub to delete.
5334    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5335    pub name: std::string::String,
5336
5337    /// Optional. A request ID to identify requests. Specify a unique request ID so
5338    /// that if you must retry your request, the server knows to ignore the request
5339    /// if it has already been completed. The server guarantees that a request
5340    /// doesn't result in creation of duplicate commitments for at least 60
5341    /// minutes.
5342    ///
5343    /// For example, consider a situation where you make an initial request and
5344    /// the request times out. If you make the request again with the same request
5345    /// ID, the server can check to see whether the original operation
5346    /// was received. If it was, the server ignores the second request. This
5347    /// behavior prevents clients from mistakenly creating duplicate commitments.
5348    ///
5349    /// The request ID must be a valid UUID, with the exception that zero UUID is
5350    /// not supported (00000000-0000-0000-0000-000000000000).
5351    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5352    pub request_id: std::string::String,
5353
5354    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5355    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5356}
5357
5358impl DeleteHubRequest {
5359    pub fn new() -> Self {
5360        std::default::Default::default()
5361    }
5362
5363    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
5364    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5365        self.name = v.into();
5366        self
5367    }
5368
5369    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
5370    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5371        self.request_id = v.into();
5372        self
5373    }
5374}
5375
5376impl wkt::message::Message for DeleteHubRequest {
5377    fn typename() -> &'static str {
5378        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
5379    }
5380}
5381
5382/// The request for
5383/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
5384///
5385/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
5386#[serde_with::serde_as]
5387#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5388#[serde(default, rename_all = "camelCase")]
5389#[non_exhaustive]
5390pub struct ListHubSpokesRequest {
5391    /// Required. The name of the hub.
5392    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5393    pub name: std::string::String,
5394
5395    /// A list of locations.
5396    /// Specify one of the following: `[global]`, a single region (for
5397    /// example, `[us-central1]`), or a combination of
5398    /// values (for example, `[global, us-central1, us-west1]`).
5399    /// If the spoke_locations field is populated, the list of results
5400    /// includes only spokes in the specified location.
5401    /// If the spoke_locations field is not populated, the list of results
5402    /// includes spokes in all locations.
5403    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5404    pub spoke_locations: std::vec::Vec<std::string::String>,
5405
5406    /// The maximum number of results to return per page.
5407    #[serde(skip_serializing_if = "wkt::internal::is_default")]
5408    pub page_size: i32,
5409
5410    /// The page token.
5411    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5412    pub page_token: std::string::String,
5413
5414    /// An expression that filters the list of results.
5415    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5416    pub filter: std::string::String,
5417
5418    /// Sort the results by name or create_time.
5419    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5420    pub order_by: std::string::String,
5421
5422    /// The view of the spoke to return.
5423    /// The view that you use determines which spoke fields are included in the
5424    /// response.
5425    pub view: crate::model::list_hub_spokes_request::SpokeView,
5426
5427    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5428    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5429}
5430
5431impl ListHubSpokesRequest {
5432    pub fn new() -> Self {
5433        std::default::Default::default()
5434    }
5435
5436    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5437    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5438        self.name = v.into();
5439        self
5440    }
5441
5442    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5443    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5444    where
5445        T: std::iter::IntoIterator<Item = V>,
5446        V: std::convert::Into<std::string::String>,
5447    {
5448        use std::iter::Iterator;
5449        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5450        self
5451    }
5452
5453    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
5454    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5455        self.page_size = v.into();
5456        self
5457    }
5458
5459    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
5460    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5461        self.page_token = v.into();
5462        self
5463    }
5464
5465    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
5466    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5467        self.filter = v.into();
5468        self
5469    }
5470
5471    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
5472    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473        self.order_by = v.into();
5474        self
5475    }
5476
5477    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
5478    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
5479        mut self,
5480        v: T,
5481    ) -> Self {
5482        self.view = v.into();
5483        self
5484    }
5485}
5486
5487impl wkt::message::Message for ListHubSpokesRequest {
5488    fn typename() -> &'static str {
5489        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
5490    }
5491}
5492
5493/// Defines additional types related to [ListHubSpokesRequest].
5494pub mod list_hub_spokes_request {
5495    #[allow(unused_imports)]
5496    use super::*;
5497
5498    /// Enum that controls which spoke fields are included in the response.
5499    ///
5500    /// # Working with unknown values
5501    ///
5502    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5503    /// additional enum variants at any time. Adding new variants is not considered
5504    /// a breaking change. Applications should write their code in anticipation of:
5505    ///
5506    /// - New values appearing in future releases of the client library, **and**
5507    /// - New values received dynamically, without application changes.
5508    ///
5509    /// Please consult the [Working with enums] section in the user guide for some
5510    /// guidelines.
5511    ///
5512    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5513    #[derive(Clone, Debug, PartialEq)]
5514    #[non_exhaustive]
5515    pub enum SpokeView {
5516        /// The spoke view is unspecified. When the spoke view is unspecified, the
5517        /// API returns the same fields as the `BASIC` view.
5518        Unspecified,
5519        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
5520        /// and `spoke_type`. This is the default value.
5521        Basic,
5522        /// Includes all spoke fields except `labels`.
5523        /// You can use the `DETAILED` view only when you set the `spoke_locations`
5524        /// field to `[global]`.
5525        Detailed,
5526        /// If set, the enum was initialized with an unknown value.
5527        ///
5528        /// Applications can examine the value using [SpokeView::value] or
5529        /// [SpokeView::name].
5530        UnknownValue(spoke_view::UnknownValue),
5531    }
5532
5533    #[doc(hidden)]
5534    pub mod spoke_view {
5535        #[allow(unused_imports)]
5536        use super::*;
5537        #[derive(Clone, Debug, PartialEq)]
5538        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5539    }
5540
5541    impl SpokeView {
5542        /// Gets the enum value.
5543        ///
5544        /// Returns `None` if the enum contains an unknown value deserialized from
5545        /// the string representation of enums.
5546        pub fn value(&self) -> std::option::Option<i32> {
5547            match self {
5548                Self::Unspecified => std::option::Option::Some(0),
5549                Self::Basic => std::option::Option::Some(1),
5550                Self::Detailed => std::option::Option::Some(2),
5551                Self::UnknownValue(u) => u.0.value(),
5552            }
5553        }
5554
5555        /// Gets the enum value as a string.
5556        ///
5557        /// Returns `None` if the enum contains an unknown value deserialized from
5558        /// the integer representation of enums.
5559        pub fn name(&self) -> std::option::Option<&str> {
5560            match self {
5561                Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
5562                Self::Basic => std::option::Option::Some("BASIC"),
5563                Self::Detailed => std::option::Option::Some("DETAILED"),
5564                Self::UnknownValue(u) => u.0.name(),
5565            }
5566        }
5567    }
5568
5569    impl std::default::Default for SpokeView {
5570        fn default() -> Self {
5571            use std::convert::From;
5572            Self::from(0)
5573        }
5574    }
5575
5576    impl std::fmt::Display for SpokeView {
5577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5578            wkt::internal::display_enum(f, self.name(), self.value())
5579        }
5580    }
5581
5582    impl std::convert::From<i32> for SpokeView {
5583        fn from(value: i32) -> Self {
5584            match value {
5585                0 => Self::Unspecified,
5586                1 => Self::Basic,
5587                2 => Self::Detailed,
5588                _ => Self::UnknownValue(spoke_view::UnknownValue(
5589                    wkt::internal::UnknownEnumValue::Integer(value),
5590                )),
5591            }
5592        }
5593    }
5594
5595    impl std::convert::From<&str> for SpokeView {
5596        fn from(value: &str) -> Self {
5597            use std::string::ToString;
5598            match value {
5599                "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
5600                "BASIC" => Self::Basic,
5601                "DETAILED" => Self::Detailed,
5602                _ => Self::UnknownValue(spoke_view::UnknownValue(
5603                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5604                )),
5605            }
5606        }
5607    }
5608
5609    impl serde::ser::Serialize for SpokeView {
5610        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5611        where
5612            S: serde::Serializer,
5613        {
5614            match self {
5615                Self::Unspecified => serializer.serialize_i32(0),
5616                Self::Basic => serializer.serialize_i32(1),
5617                Self::Detailed => serializer.serialize_i32(2),
5618                Self::UnknownValue(u) => u.0.serialize(serializer),
5619            }
5620        }
5621    }
5622
5623    impl<'de> serde::de::Deserialize<'de> for SpokeView {
5624        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5625        where
5626            D: serde::Deserializer<'de>,
5627        {
5628            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
5629                ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
5630            ))
5631        }
5632    }
5633}
5634
5635/// The response for
5636/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
5637///
5638/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
5639#[serde_with::serde_as]
5640#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5641#[serde(default, rename_all = "camelCase")]
5642#[non_exhaustive]
5643pub struct ListHubSpokesResponse {
5644    /// The requested spokes.
5645    /// The spoke fields can be partially populated based on the `view` field in
5646    /// the request message.
5647    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5648    pub spokes: std::vec::Vec<crate::model::Spoke>,
5649
5650    /// The token for the next page of the response. To see more results,
5651    /// use this value as the page_token for your next request. If this value
5652    /// is empty, there are no more results.
5653    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5654    pub next_page_token: std::string::String,
5655
5656    /// Locations that could not be reached.
5657    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5658    pub unreachable: std::vec::Vec<std::string::String>,
5659
5660    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5661    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5662}
5663
5664impl ListHubSpokesResponse {
5665    pub fn new() -> Self {
5666        std::default::Default::default()
5667    }
5668
5669    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
5670    pub fn set_spokes<T, V>(mut self, v: T) -> Self
5671    where
5672        T: std::iter::IntoIterator<Item = V>,
5673        V: std::convert::Into<crate::model::Spoke>,
5674    {
5675        use std::iter::Iterator;
5676        self.spokes = v.into_iter().map(|i| i.into()).collect();
5677        self
5678    }
5679
5680    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
5681    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5682        self.next_page_token = v.into();
5683        self
5684    }
5685
5686    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
5687    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5688    where
5689        T: std::iter::IntoIterator<Item = V>,
5690        V: std::convert::Into<std::string::String>,
5691    {
5692        use std::iter::Iterator;
5693        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5694        self
5695    }
5696}
5697
5698impl wkt::message::Message for ListHubSpokesResponse {
5699    fn typename() -> &'static str {
5700        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
5701    }
5702}
5703
5704#[doc(hidden)]
5705impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
5706    type PageItem = crate::model::Spoke;
5707
5708    fn items(self) -> std::vec::Vec<Self::PageItem> {
5709        self.spokes
5710    }
5711
5712    fn next_page_token(&self) -> std::string::String {
5713        use std::clone::Clone;
5714        self.next_page_token.clone()
5715    }
5716}
5717
5718/// The request for
5719/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
5720///
5721/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
5722#[serde_with::serde_as]
5723#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5724#[serde(default, rename_all = "camelCase")]
5725#[non_exhaustive]
5726pub struct QueryHubStatusRequest {
5727    /// Required. The name of the hub.
5728    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5729    pub name: std::string::String,
5730
5731    /// Optional. The maximum number of results to return per page.
5732    #[serde(skip_serializing_if = "wkt::internal::is_default")]
5733    pub page_size: i32,
5734
5735    /// Optional. The page token.
5736    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5737    pub page_token: std::string::String,
5738
5739    /// Optional. An expression that filters the list of results.
5740    /// The filter can be used to filter the results by the following fields:
5741    ///
5742    /// * `psc_propagation_status.source_spoke`
5743    /// * `psc_propagation_status.source_group`
5744    /// * `psc_propagation_status.source_forwarding_rule`
5745    /// * `psc_propagation_status.target_spoke`
5746    /// * `psc_propagation_status.target_group`
5747    /// * `psc_propagation_status.code`
5748    /// * `psc_propagation_status.message`
5749    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5750    pub filter: std::string::String,
5751
5752    /// Optional. Sort the results in ascending order by the specified fields.
5753    /// A comma-separated list of any of these fields:
5754    ///
5755    /// * `psc_propagation_status.source_spoke`
5756    /// * `psc_propagation_status.source_group`
5757    /// * `psc_propagation_status.source_forwarding_rule`
5758    /// * `psc_propagation_status.target_spoke`
5759    /// * `psc_propagation_status.target_group`
5760    /// * `psc_propagation_status.code`
5761    ///   If `group_by` is set, the value of the `order_by` field must be the
5762    ///   same as or a subset of the `group_by` field.
5763    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5764    pub order_by: std::string::String,
5765
5766    /// Optional. Aggregate the results by the specified fields.
5767    /// A comma-separated list of any of these fields:
5768    ///
5769    /// * `psc_propagation_status.source_spoke`
5770    /// * `psc_propagation_status.source_group`
5771    /// * `psc_propagation_status.source_forwarding_rule`
5772    /// * `psc_propagation_status.target_spoke`
5773    /// * `psc_propagation_status.target_group`
5774    /// * `psc_propagation_status.code`
5775    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5776    pub group_by: std::string::String,
5777
5778    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5779    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5780}
5781
5782impl QueryHubStatusRequest {
5783    pub fn new() -> Self {
5784        std::default::Default::default()
5785    }
5786
5787    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
5788    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789        self.name = v.into();
5790        self
5791    }
5792
5793    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
5794    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5795        self.page_size = v.into();
5796        self
5797    }
5798
5799    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
5800    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5801        self.page_token = v.into();
5802        self
5803    }
5804
5805    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
5806    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5807        self.filter = v.into();
5808        self
5809    }
5810
5811    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
5812    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5813        self.order_by = v.into();
5814        self
5815    }
5816
5817    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
5818    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5819        self.group_by = v.into();
5820        self
5821    }
5822}
5823
5824impl wkt::message::Message for QueryHubStatusRequest {
5825    fn typename() -> &'static str {
5826        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
5827    }
5828}
5829
5830/// The response for
5831/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
5832///
5833/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
5834#[serde_with::serde_as]
5835#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5836#[serde(default, rename_all = "camelCase")]
5837#[non_exhaustive]
5838pub struct QueryHubStatusResponse {
5839    /// The list of hub status.
5840    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5841    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
5842
5843    /// The token for the next page of the response. To see more results,
5844    /// use this value as the page_token for your next request. If this value
5845    /// is empty, there are no more results.
5846    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5847    pub next_page_token: std::string::String,
5848
5849    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5850    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5851}
5852
5853impl QueryHubStatusResponse {
5854    pub fn new() -> Self {
5855        std::default::Default::default()
5856    }
5857
5858    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
5859    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
5860    where
5861        T: std::iter::IntoIterator<Item = V>,
5862        V: std::convert::Into<crate::model::HubStatusEntry>,
5863    {
5864        use std::iter::Iterator;
5865        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
5866        self
5867    }
5868
5869    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
5870    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5871        self.next_page_token = v.into();
5872        self
5873    }
5874}
5875
5876impl wkt::message::Message for QueryHubStatusResponse {
5877    fn typename() -> &'static str {
5878        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
5879    }
5880}
5881
5882#[doc(hidden)]
5883impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
5884    type PageItem = crate::model::HubStatusEntry;
5885
5886    fn items(self) -> std::vec::Vec<Self::PageItem> {
5887        self.hub_status_entries
5888    }
5889
5890    fn next_page_token(&self) -> std::string::String {
5891        use std::clone::Clone;
5892        self.next_page_token.clone()
5893    }
5894}
5895
5896/// A hub status entry represents the status of a set of propagated Private
5897/// Service Connect connections grouped by certain fields.
5898#[serde_with::serde_as]
5899#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5900#[serde(default, rename_all = "camelCase")]
5901#[non_exhaustive]
5902pub struct HubStatusEntry {
5903    /// The number of propagated Private Service Connect connections with this
5904    /// status. If the `group_by` field was not set in the request message, the
5905    /// value of this field is 1.
5906    #[serde(skip_serializing_if = "wkt::internal::is_default")]
5907    pub count: i32,
5908
5909    /// The fields that this entry is grouped by. This has the same value as the
5910    /// `group_by` field in the request message.
5911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5912    pub group_by: std::string::String,
5913
5914    /// The Private Service Connect propagation status.
5915    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5916    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
5917
5918    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5919    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5920}
5921
5922impl HubStatusEntry {
5923    pub fn new() -> Self {
5924        std::default::Default::default()
5925    }
5926
5927    /// Sets the value of [count][crate::model::HubStatusEntry::count].
5928    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5929        self.count = v.into();
5930        self
5931    }
5932
5933    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
5934    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5935        self.group_by = v.into();
5936        self
5937    }
5938
5939    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
5940    pub fn set_psc_propagation_status<
5941        T: std::convert::Into<std::option::Option<crate::model::PscPropagationStatus>>,
5942    >(
5943        mut self,
5944        v: T,
5945    ) -> Self {
5946        self.psc_propagation_status = v.into();
5947        self
5948    }
5949}
5950
5951impl wkt::message::Message for HubStatusEntry {
5952    fn typename() -> &'static str {
5953        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
5954    }
5955}
5956
5957/// The status of one or more propagated Private Service Connect connections in a
5958/// hub.
5959#[serde_with::serde_as]
5960#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5961#[serde(default, rename_all = "camelCase")]
5962#[non_exhaustive]
5963pub struct PscPropagationStatus {
5964    /// The name of the spoke that the source forwarding rule belongs to.
5965    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5966    pub source_spoke: std::string::String,
5967
5968    /// The name of the group that the source spoke belongs to.
5969    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5970    pub source_group: std::string::String,
5971
5972    /// The name of the forwarding rule exported to the hub.
5973    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5974    pub source_forwarding_rule: std::string::String,
5975
5976    /// The name of the spoke that the source forwarding rule propagates to.
5977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5978    pub target_spoke: std::string::String,
5979
5980    /// The name of the group that the target spoke belongs to.
5981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5982    pub target_group: std::string::String,
5983
5984    /// The propagation status.
5985    pub code: crate::model::psc_propagation_status::Code,
5986
5987    /// The human-readable summary of the Private Service Connect connection
5988    /// propagation status.
5989    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5990    pub message: std::string::String,
5991
5992    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5993    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5994}
5995
5996impl PscPropagationStatus {
5997    pub fn new() -> Self {
5998        std::default::Default::default()
5999    }
6000
6001    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
6002    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6003        self.source_spoke = v.into();
6004        self
6005    }
6006
6007    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
6008    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6009        self.source_group = v.into();
6010        self
6011    }
6012
6013    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
6014    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
6015        mut self,
6016        v: T,
6017    ) -> Self {
6018        self.source_forwarding_rule = v.into();
6019        self
6020    }
6021
6022    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
6023    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6024        self.target_spoke = v.into();
6025        self
6026    }
6027
6028    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
6029    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6030        self.target_group = v.into();
6031        self
6032    }
6033
6034    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
6035    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
6036        mut self,
6037        v: T,
6038    ) -> Self {
6039        self.code = v.into();
6040        self
6041    }
6042
6043    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
6044    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6045        self.message = v.into();
6046        self
6047    }
6048}
6049
6050impl wkt::message::Message for PscPropagationStatus {
6051    fn typename() -> &'static str {
6052        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
6053    }
6054}
6055
6056/// Defines additional types related to [PscPropagationStatus].
6057pub mod psc_propagation_status {
6058    #[allow(unused_imports)]
6059    use super::*;
6060
6061    /// The Code enum represents the state of the Private Service Connect
6062    /// propagation.
6063    ///
6064    /// # Working with unknown values
6065    ///
6066    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6067    /// additional enum variants at any time. Adding new variants is not considered
6068    /// a breaking change. Applications should write their code in anticipation of:
6069    ///
6070    /// - New values appearing in future releases of the client library, **and**
6071    /// - New values received dynamically, without application changes.
6072    ///
6073    /// Please consult the [Working with enums] section in the user guide for some
6074    /// guidelines.
6075    ///
6076    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6077    #[derive(Clone, Debug, PartialEq)]
6078    #[non_exhaustive]
6079    pub enum Code {
6080        /// The code is unspecified.
6081        Unspecified,
6082        /// The propagated Private Service Connect connection is ready.
6083        Ready,
6084        /// The Private Service Connect connection is propagating. This is a
6085        /// transient state.
6086        Propagating,
6087        /// The Private Service Connect connection propagation failed because the VPC
6088        /// network or the project of the target spoke has exceeded the connection
6089        /// limit set by the producer.
6090        ErrorProducerPropagatedConnectionLimitExceeded,
6091        /// The Private Service Connect connection propagation failed because the NAT
6092        /// IP subnet space has been exhausted. It is equivalent to the `Needs
6093        /// attention` status of the Private Service Connect connection. See
6094        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
6095        ErrorProducerNatIpSpaceExhausted,
6096        /// The Private Service Connect connection propagation failed because the
6097        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
6098        /// producer VPC network has been exceeded.
6099        ErrorProducerQuotaExceeded,
6100        /// The Private Service Connect connection propagation failed because the
6101        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
6102        /// VPC network has been exceeded.
6103        ErrorConsumerQuotaExceeded,
6104        /// If set, the enum was initialized with an unknown value.
6105        ///
6106        /// Applications can examine the value using [Code::value] or
6107        /// [Code::name].
6108        UnknownValue(code::UnknownValue),
6109    }
6110
6111    #[doc(hidden)]
6112    pub mod code {
6113        #[allow(unused_imports)]
6114        use super::*;
6115        #[derive(Clone, Debug, PartialEq)]
6116        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6117    }
6118
6119    impl Code {
6120        /// Gets the enum value.
6121        ///
6122        /// Returns `None` if the enum contains an unknown value deserialized from
6123        /// the string representation of enums.
6124        pub fn value(&self) -> std::option::Option<i32> {
6125            match self {
6126                Self::Unspecified => std::option::Option::Some(0),
6127                Self::Ready => std::option::Option::Some(1),
6128                Self::Propagating => std::option::Option::Some(2),
6129                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
6130                    std::option::Option::Some(3)
6131                }
6132                Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
6133                Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
6134                Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
6135                Self::UnknownValue(u) => u.0.value(),
6136            }
6137        }
6138
6139        /// Gets the enum value as a string.
6140        ///
6141        /// Returns `None` if the enum contains an unknown value deserialized from
6142        /// the integer representation of enums.
6143        pub fn name(&self) -> std::option::Option<&str> {
6144            match self {
6145                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
6146                Self::Ready => std::option::Option::Some("READY"),
6147                Self::Propagating => std::option::Option::Some("PROPAGATING"),
6148                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
6149                    std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
6150                }
6151                Self::ErrorProducerNatIpSpaceExhausted => {
6152                    std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
6153                }
6154                Self::ErrorProducerQuotaExceeded => {
6155                    std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
6156                }
6157                Self::ErrorConsumerQuotaExceeded => {
6158                    std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
6159                }
6160                Self::UnknownValue(u) => u.0.name(),
6161            }
6162        }
6163    }
6164
6165    impl std::default::Default for Code {
6166        fn default() -> Self {
6167            use std::convert::From;
6168            Self::from(0)
6169        }
6170    }
6171
6172    impl std::fmt::Display for Code {
6173        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6174            wkt::internal::display_enum(f, self.name(), self.value())
6175        }
6176    }
6177
6178    impl std::convert::From<i32> for Code {
6179        fn from(value: i32) -> Self {
6180            match value {
6181                0 => Self::Unspecified,
6182                1 => Self::Ready,
6183                2 => Self::Propagating,
6184                3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
6185                4 => Self::ErrorProducerNatIpSpaceExhausted,
6186                5 => Self::ErrorProducerQuotaExceeded,
6187                6 => Self::ErrorConsumerQuotaExceeded,
6188                _ => Self::UnknownValue(code::UnknownValue(
6189                    wkt::internal::UnknownEnumValue::Integer(value),
6190                )),
6191            }
6192        }
6193    }
6194
6195    impl std::convert::From<&str> for Code {
6196        fn from(value: &str) -> Self {
6197            use std::string::ToString;
6198            match value {
6199                "CODE_UNSPECIFIED" => Self::Unspecified,
6200                "READY" => Self::Ready,
6201                "PROPAGATING" => Self::Propagating,
6202                "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
6203                    Self::ErrorProducerPropagatedConnectionLimitExceeded
6204                }
6205                "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
6206                "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
6207                "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
6208                _ => Self::UnknownValue(code::UnknownValue(
6209                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6210                )),
6211            }
6212        }
6213    }
6214
6215    impl serde::ser::Serialize for Code {
6216        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6217        where
6218            S: serde::Serializer,
6219        {
6220            match self {
6221                Self::Unspecified => serializer.serialize_i32(0),
6222                Self::Ready => serializer.serialize_i32(1),
6223                Self::Propagating => serializer.serialize_i32(2),
6224                Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
6225                Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
6226                Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
6227                Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
6228                Self::UnknownValue(u) => u.0.serialize(serializer),
6229            }
6230        }
6231    }
6232
6233    impl<'de> serde::de::Deserialize<'de> for Code {
6234        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6235        where
6236            D: serde::Deserializer<'de>,
6237        {
6238            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
6239                ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
6240            ))
6241        }
6242    }
6243}
6244
6245/// The request for
6246/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
6247///
6248/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
6249#[serde_with::serde_as]
6250#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6251#[serde(default, rename_all = "camelCase")]
6252#[non_exhaustive]
6253pub struct ListSpokesRequest {
6254    /// Required. The parent resource.
6255    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6256    pub parent: std::string::String,
6257
6258    /// The maximum number of results to return per page.
6259    #[serde(skip_serializing_if = "wkt::internal::is_default")]
6260    pub page_size: i32,
6261
6262    /// The page token.
6263    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6264    pub page_token: std::string::String,
6265
6266    /// An expression that filters the list of results.
6267    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6268    pub filter: std::string::String,
6269
6270    /// Sort the results by a certain order.
6271    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6272    pub order_by: std::string::String,
6273
6274    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6275    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6276}
6277
6278impl ListSpokesRequest {
6279    pub fn new() -> Self {
6280        std::default::Default::default()
6281    }
6282
6283    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6284    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6285        self.parent = v.into();
6286        self
6287    }
6288
6289    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6290    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6291        self.page_size = v.into();
6292        self
6293    }
6294
6295    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6296    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6297        self.page_token = v.into();
6298        self
6299    }
6300
6301    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6302    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6303        self.filter = v.into();
6304        self
6305    }
6306
6307    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6308    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6309        self.order_by = v.into();
6310        self
6311    }
6312}
6313
6314impl wkt::message::Message for ListSpokesRequest {
6315    fn typename() -> &'static str {
6316        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
6317    }
6318}
6319
6320/// The response for
6321/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
6322///
6323/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
6324#[serde_with::serde_as]
6325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6326#[serde(default, rename_all = "camelCase")]
6327#[non_exhaustive]
6328pub struct ListSpokesResponse {
6329    /// The requested spokes.
6330    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6331    pub spokes: std::vec::Vec<crate::model::Spoke>,
6332
6333    /// The token for the next page of the response. To see more results,
6334    /// use this value as the page_token for your next request. If this value
6335    /// is empty, there are no more results.
6336    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6337    pub next_page_token: std::string::String,
6338
6339    /// Locations that could not be reached.
6340    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6341    pub unreachable: std::vec::Vec<std::string::String>,
6342
6343    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6344    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6345}
6346
6347impl ListSpokesResponse {
6348    pub fn new() -> Self {
6349        std::default::Default::default()
6350    }
6351
6352    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
6353    pub fn set_spokes<T, V>(mut self, v: T) -> Self
6354    where
6355        T: std::iter::IntoIterator<Item = V>,
6356        V: std::convert::Into<crate::model::Spoke>,
6357    {
6358        use std::iter::Iterator;
6359        self.spokes = v.into_iter().map(|i| i.into()).collect();
6360        self
6361    }
6362
6363    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
6364    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6365        self.next_page_token = v.into();
6366        self
6367    }
6368
6369    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
6370    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6371    where
6372        T: std::iter::IntoIterator<Item = V>,
6373        V: std::convert::Into<std::string::String>,
6374    {
6375        use std::iter::Iterator;
6376        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6377        self
6378    }
6379}
6380
6381impl wkt::message::Message for ListSpokesResponse {
6382    fn typename() -> &'static str {
6383        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
6384    }
6385}
6386
6387#[doc(hidden)]
6388impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
6389    type PageItem = crate::model::Spoke;
6390
6391    fn items(self) -> std::vec::Vec<Self::PageItem> {
6392        self.spokes
6393    }
6394
6395    fn next_page_token(&self) -> std::string::String {
6396        use std::clone::Clone;
6397        self.next_page_token.clone()
6398    }
6399}
6400
6401/// The request for
6402/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
6403///
6404/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
6405#[serde_with::serde_as]
6406#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6407#[serde(default, rename_all = "camelCase")]
6408#[non_exhaustive]
6409pub struct GetSpokeRequest {
6410    /// Required. The name of the spoke resource.
6411    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6412    pub name: std::string::String,
6413
6414    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6415    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6416}
6417
6418impl GetSpokeRequest {
6419    pub fn new() -> Self {
6420        std::default::Default::default()
6421    }
6422
6423    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6425        self.name = v.into();
6426        self
6427    }
6428}
6429
6430impl wkt::message::Message for GetSpokeRequest {
6431    fn typename() -> &'static str {
6432        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
6433    }
6434}
6435
6436/// The request for
6437/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
6438///
6439/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
6440#[serde_with::serde_as]
6441#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6442#[serde(default, rename_all = "camelCase")]
6443#[non_exhaustive]
6444pub struct CreateSpokeRequest {
6445    /// Required. The parent resource.
6446    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6447    pub parent: std::string::String,
6448
6449    /// Required. Unique id for the spoke to create.
6450    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6451    pub spoke_id: std::string::String,
6452
6453    /// Required. The initial values for a new spoke.
6454    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6455    pub spoke: std::option::Option<crate::model::Spoke>,
6456
6457    /// Optional. A request ID to identify requests. Specify a unique request ID so
6458    /// that if you must retry your request, the server knows to ignore the request
6459    /// if it has already been completed. The server guarantees that a request
6460    /// doesn't result in creation of duplicate commitments for at least 60
6461    /// minutes.
6462    ///
6463    /// For example, consider a situation where you make an initial request and
6464    /// the request times out. If you make the request again with the same request
6465    /// ID, the server can check to see whether the original operation
6466    /// was received. If it was, the server ignores the second request. This
6467    /// behavior prevents clients from mistakenly creating duplicate commitments.
6468    ///
6469    /// The request ID must be a valid UUID, with the exception that zero UUID is
6470    /// not supported (00000000-0000-0000-0000-000000000000).
6471    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6472    pub request_id: std::string::String,
6473
6474    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6475    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6476}
6477
6478impl CreateSpokeRequest {
6479    pub fn new() -> Self {
6480        std::default::Default::default()
6481    }
6482
6483    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6484    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6485        self.parent = v.into();
6486        self
6487    }
6488
6489    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6490    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491        self.spoke_id = v.into();
6492        self
6493    }
6494
6495    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6496    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6497        mut self,
6498        v: T,
6499    ) -> Self {
6500        self.spoke = v.into();
6501        self
6502    }
6503
6504    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6505    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506        self.request_id = v.into();
6507        self
6508    }
6509}
6510
6511impl wkt::message::Message for CreateSpokeRequest {
6512    fn typename() -> &'static str {
6513        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
6514    }
6515}
6516
6517/// Request for
6518/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
6519/// method.
6520///
6521/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
6522#[serde_with::serde_as]
6523#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6524#[serde(default, rename_all = "camelCase")]
6525#[non_exhaustive]
6526pub struct UpdateSpokeRequest {
6527    /// Optional. In the case of an update to an existing spoke, field mask is used
6528    /// to specify the fields to be overwritten. The fields specified in the
6529    /// update_mask are relative to the resource, not the full request. A field is
6530    /// overwritten if it is in the mask. If the user does not provide a mask, then
6531    /// all fields are overwritten.
6532    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6533    pub update_mask: std::option::Option<wkt::FieldMask>,
6534
6535    /// Required. The state that the spoke should be in after the update.
6536    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6537    pub spoke: std::option::Option<crate::model::Spoke>,
6538
6539    /// Optional. A request ID to identify requests. Specify a unique request ID so
6540    /// that if you must retry your request, the server knows to ignore the request
6541    /// if it has already been completed. The server guarantees that a request
6542    /// doesn't result in creation of duplicate commitments for at least 60
6543    /// minutes.
6544    ///
6545    /// For example, consider a situation where you make an initial request and
6546    /// the request times out. If you make the request again with the same request
6547    /// ID, the server can check to see whether the original operation
6548    /// was received. If it was, the server ignores the second request. This
6549    /// behavior prevents clients from mistakenly creating duplicate commitments.
6550    ///
6551    /// The request ID must be a valid UUID, with the exception that zero UUID is
6552    /// not supported (00000000-0000-0000-0000-000000000000).
6553    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6554    pub request_id: std::string::String,
6555
6556    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6557    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6558}
6559
6560impl UpdateSpokeRequest {
6561    pub fn new() -> Self {
6562        std::default::Default::default()
6563    }
6564
6565    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6566    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
6567        mut self,
6568        v: T,
6569    ) -> Self {
6570        self.update_mask = v.into();
6571        self
6572    }
6573
6574    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6575    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6576        mut self,
6577        v: T,
6578    ) -> Self {
6579        self.spoke = v.into();
6580        self
6581    }
6582
6583    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6584    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6585        self.request_id = v.into();
6586        self
6587    }
6588}
6589
6590impl wkt::message::Message for UpdateSpokeRequest {
6591    fn typename() -> &'static str {
6592        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
6593    }
6594}
6595
6596/// The request for
6597/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
6598///
6599/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
6600#[serde_with::serde_as]
6601#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6602#[serde(default, rename_all = "camelCase")]
6603#[non_exhaustive]
6604pub struct DeleteSpokeRequest {
6605    /// Required. The name of the spoke to delete.
6606    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6607    pub name: std::string::String,
6608
6609    /// Optional. A request ID to identify requests. Specify a unique request ID so
6610    /// that if you must retry your request, the server knows to ignore the request
6611    /// if it has already been completed. The server guarantees that a request
6612    /// doesn't result in creation of duplicate commitments for at least 60
6613    /// minutes.
6614    ///
6615    /// For example, consider a situation where you make an initial request and
6616    /// the request times out. If you make the request again with the same request
6617    /// ID, the server can check to see whether the original operation
6618    /// was received. If it was, the server ignores the second request. This
6619    /// behavior prevents clients from mistakenly creating duplicate commitments.
6620    ///
6621    /// The request ID must be a valid UUID, with the exception that zero UUID is
6622    /// not supported (00000000-0000-0000-0000-000000000000).
6623    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6624    pub request_id: std::string::String,
6625
6626    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6627    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6628}
6629
6630impl DeleteSpokeRequest {
6631    pub fn new() -> Self {
6632        std::default::Default::default()
6633    }
6634
6635    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
6636    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6637        self.name = v.into();
6638        self
6639    }
6640
6641    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
6642    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643        self.request_id = v.into();
6644        self
6645    }
6646}
6647
6648impl wkt::message::Message for DeleteSpokeRequest {
6649    fn typename() -> &'static str {
6650        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
6651    }
6652}
6653
6654/// The request for
6655/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
6656///
6657/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
6658#[serde_with::serde_as]
6659#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6660#[serde(default, rename_all = "camelCase")]
6661#[non_exhaustive]
6662pub struct AcceptHubSpokeRequest {
6663    /// Required. The name of the hub into which to accept the spoke.
6664    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6665    pub name: std::string::String,
6666
6667    /// Required. The URI of the spoke to accept into the hub.
6668    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6669    pub spoke_uri: std::string::String,
6670
6671    /// Optional. A request ID to identify requests. Specify a unique request ID so
6672    /// that if you must retry your request, the server knows to ignore the request
6673    /// if it has already been completed. The server guarantees that a request
6674    /// doesn't result in creation of duplicate commitments for at least 60
6675    /// minutes.
6676    ///
6677    /// For example, consider a situation where you make an initial request and
6678    /// the request times out. If you make the request again with the same request
6679    /// ID, the server can check to see whether the original operation
6680    /// was received. If it was, the server ignores the second request. This
6681    /// behavior prevents clients from mistakenly creating duplicate commitments.
6682    ///
6683    /// The request ID must be a valid UUID, with the exception that zero UUID is
6684    /// not supported (00000000-0000-0000-0000-000000000000).
6685    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6686    pub request_id: std::string::String,
6687
6688    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6689    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6690}
6691
6692impl AcceptHubSpokeRequest {
6693    pub fn new() -> Self {
6694        std::default::Default::default()
6695    }
6696
6697    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6698    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6699        self.name = v.into();
6700        self
6701    }
6702
6703    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6704    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6705        self.spoke_uri = v.into();
6706        self
6707    }
6708
6709    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6710    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6711        self.request_id = v.into();
6712        self
6713    }
6714}
6715
6716impl wkt::message::Message for AcceptHubSpokeRequest {
6717    fn typename() -> &'static str {
6718        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
6719    }
6720}
6721
6722/// The response for
6723/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
6724///
6725/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
6726#[serde_with::serde_as]
6727#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6728#[serde(default, rename_all = "camelCase")]
6729#[non_exhaustive]
6730pub struct AcceptHubSpokeResponse {
6731    /// The spoke that was operated on.
6732    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6733    pub spoke: std::option::Option<crate::model::Spoke>,
6734
6735    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6736    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6737}
6738
6739impl AcceptHubSpokeResponse {
6740    pub fn new() -> Self {
6741        std::default::Default::default()
6742    }
6743
6744    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
6745    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6746        mut self,
6747        v: T,
6748    ) -> Self {
6749        self.spoke = v.into();
6750        self
6751    }
6752}
6753
6754impl wkt::message::Message for AcceptHubSpokeResponse {
6755    fn typename() -> &'static str {
6756        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
6757    }
6758}
6759
6760/// The request for
6761/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
6762///
6763/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
6764#[serde_with::serde_as]
6765#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6766#[serde(default, rename_all = "camelCase")]
6767#[non_exhaustive]
6768pub struct RejectHubSpokeRequest {
6769    /// Required. The name of the hub from which to reject the spoke.
6770    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6771    pub name: std::string::String,
6772
6773    /// Required. The URI of the spoke to reject from the hub.
6774    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6775    pub spoke_uri: std::string::String,
6776
6777    /// Optional. A request ID to identify requests. Specify a unique request ID so
6778    /// that if you must retry your request, the server knows to ignore the request
6779    /// if it has already been completed. The server guarantees that a request
6780    /// doesn't result in creation of duplicate commitments for at least 60
6781    /// minutes.
6782    ///
6783    /// For example, consider a situation where you make an initial request and
6784    /// the request times out. If you make the request again with the same request
6785    /// ID, the server can check to see whether the original operation
6786    /// was received. If it was, the server ignores the second request. This
6787    /// behavior prevents clients from mistakenly creating duplicate commitments.
6788    ///
6789    /// The request ID must be a valid UUID, with the exception that zero UUID is
6790    /// not supported (00000000-0000-0000-0000-000000000000).
6791    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6792    pub request_id: std::string::String,
6793
6794    /// Optional. Additional information provided by the hub administrator.
6795    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6796    pub details: std::string::String,
6797
6798    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6799    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6800}
6801
6802impl RejectHubSpokeRequest {
6803    pub fn new() -> Self {
6804        std::default::Default::default()
6805    }
6806
6807    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6808    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6809        self.name = v.into();
6810        self
6811    }
6812
6813    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6814    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6815        self.spoke_uri = v.into();
6816        self
6817    }
6818
6819    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6820    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6821        self.request_id = v.into();
6822        self
6823    }
6824
6825    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6826    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827        self.details = v.into();
6828        self
6829    }
6830}
6831
6832impl wkt::message::Message for RejectHubSpokeRequest {
6833    fn typename() -> &'static str {
6834        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
6835    }
6836}
6837
6838/// The response for
6839/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
6840///
6841/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
6842#[serde_with::serde_as]
6843#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6844#[serde(default, rename_all = "camelCase")]
6845#[non_exhaustive]
6846pub struct RejectHubSpokeResponse {
6847    /// The spoke that was operated on.
6848    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6849    pub spoke: std::option::Option<crate::model::Spoke>,
6850
6851    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6852    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6853}
6854
6855impl RejectHubSpokeResponse {
6856    pub fn new() -> Self {
6857        std::default::Default::default()
6858    }
6859
6860    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
6861    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6862        mut self,
6863        v: T,
6864    ) -> Self {
6865        self.spoke = v.into();
6866        self
6867    }
6868}
6869
6870impl wkt::message::Message for RejectHubSpokeResponse {
6871    fn typename() -> &'static str {
6872        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
6873    }
6874}
6875
6876/// The request for
6877/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
6878///
6879/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
6880#[serde_with::serde_as]
6881#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6882#[serde(default, rename_all = "camelCase")]
6883#[non_exhaustive]
6884pub struct AcceptSpokeUpdateRequest {
6885    /// Required. The name of the hub to accept spoke update.
6886    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6887    pub name: std::string::String,
6888
6889    /// Required. The URI of the spoke to accept update.
6890    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6891    pub spoke_uri: std::string::String,
6892
6893    /// Required. The etag of the spoke to accept update.
6894    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6895    pub spoke_etag: std::string::String,
6896
6897    /// Optional. A request ID to identify requests. Specify a unique request ID so
6898    /// that if you must retry your request, the server knows to ignore the request
6899    /// if it has already been completed. The server guarantees that a request
6900    /// doesn't result in creation of duplicate commitments for at least 60
6901    /// minutes.
6902    ///
6903    /// For example, consider a situation where you make an initial request and
6904    /// the request times out. If you make the request again with the same request
6905    /// ID, the server can check to see whether the original operation
6906    /// was received. If it was, the server ignores the second request. This
6907    /// behavior prevents clients from mistakenly creating duplicate commitments.
6908    ///
6909    /// The request ID must be a valid UUID, with the exception that zero UUID is
6910    /// not supported (00000000-0000-0000-0000-000000000000).
6911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6912    pub request_id: std::string::String,
6913
6914    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6915    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6916}
6917
6918impl AcceptSpokeUpdateRequest {
6919    pub fn new() -> Self {
6920        std::default::Default::default()
6921    }
6922
6923    /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6924    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6925        self.name = v.into();
6926        self
6927    }
6928
6929    /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
6930    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6931        self.spoke_uri = v.into();
6932        self
6933    }
6934
6935    /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
6936    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6937        self.spoke_etag = v.into();
6938        self
6939    }
6940
6941    /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
6942    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6943        self.request_id = v.into();
6944        self
6945    }
6946}
6947
6948impl wkt::message::Message for AcceptSpokeUpdateRequest {
6949    fn typename() -> &'static str {
6950        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
6951    }
6952}
6953
6954/// The response for
6955/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
6956///
6957/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
6958#[serde_with::serde_as]
6959#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6960#[serde(default, rename_all = "camelCase")]
6961#[non_exhaustive]
6962pub struct AcceptSpokeUpdateResponse {
6963    /// The spoke that was operated on.
6964    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6965    pub spoke: std::option::Option<crate::model::Spoke>,
6966
6967    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6968    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6969}
6970
6971impl AcceptSpokeUpdateResponse {
6972    pub fn new() -> Self {
6973        std::default::Default::default()
6974    }
6975
6976    /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
6977    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6978        mut self,
6979        v: T,
6980    ) -> Self {
6981        self.spoke = v.into();
6982        self
6983    }
6984}
6985
6986impl wkt::message::Message for AcceptSpokeUpdateResponse {
6987    fn typename() -> &'static str {
6988        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
6989    }
6990}
6991
6992/// The request for
6993/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
6994///
6995/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
6996#[serde_with::serde_as]
6997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6998#[serde(default, rename_all = "camelCase")]
6999#[non_exhaustive]
7000pub struct RejectSpokeUpdateRequest {
7001    /// Required. The name of the hub to reject spoke update.
7002    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7003    pub name: std::string::String,
7004
7005    /// Required. The URI of the spoke to reject update.
7006    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7007    pub spoke_uri: std::string::String,
7008
7009    /// Required. The etag of the spoke to reject update.
7010    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7011    pub spoke_etag: std::string::String,
7012
7013    /// Optional. Additional information provided by the hub administrator.
7014    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7015    pub details: std::string::String,
7016
7017    /// Optional. A request ID to identify requests. Specify a unique request ID so
7018    /// that if you must retry your request, the server knows to ignore the request
7019    /// if it has already been completed. The server guarantees that a request
7020    /// doesn't result in creation of duplicate commitments for at least 60
7021    /// minutes.
7022    ///
7023    /// For example, consider a situation where you make an initial request and
7024    /// the request times out. If you make the request again with the same request
7025    /// ID, the server can check to see whether the original operation
7026    /// was received. If it was, the server ignores the second request. This
7027    /// behavior prevents clients from mistakenly creating duplicate commitments.
7028    ///
7029    /// The request ID must be a valid UUID, with the exception that zero UUID is
7030    /// not supported (00000000-0000-0000-0000-000000000000).
7031    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7032    pub request_id: std::string::String,
7033
7034    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7035    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7036}
7037
7038impl RejectSpokeUpdateRequest {
7039    pub fn new() -> Self {
7040        std::default::Default::default()
7041    }
7042
7043    /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
7044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7045        self.name = v.into();
7046        self
7047    }
7048
7049    /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
7050    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7051        self.spoke_uri = v.into();
7052        self
7053    }
7054
7055    /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
7056    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7057        self.spoke_etag = v.into();
7058        self
7059    }
7060
7061    /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
7062    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7063        self.details = v.into();
7064        self
7065    }
7066
7067    /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
7068    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7069        self.request_id = v.into();
7070        self
7071    }
7072}
7073
7074impl wkt::message::Message for RejectSpokeUpdateRequest {
7075    fn typename() -> &'static str {
7076        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
7077    }
7078}
7079
7080/// The response for
7081/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
7082///
7083/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
7084#[serde_with::serde_as]
7085#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7086#[serde(default, rename_all = "camelCase")]
7087#[non_exhaustive]
7088pub struct RejectSpokeUpdateResponse {
7089    /// The spoke that was operated on.
7090    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7091    pub spoke: std::option::Option<crate::model::Spoke>,
7092
7093    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7094    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7095}
7096
7097impl RejectSpokeUpdateResponse {
7098    pub fn new() -> Self {
7099        std::default::Default::default()
7100    }
7101
7102    /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
7103    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
7104        mut self,
7105        v: T,
7106    ) -> Self {
7107        self.spoke = v.into();
7108        self
7109    }
7110}
7111
7112impl wkt::message::Message for RejectSpokeUpdateResponse {
7113    fn typename() -> &'static str {
7114        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
7115    }
7116}
7117
7118/// The request for
7119/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
7120///
7121/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
7122#[serde_with::serde_as]
7123#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7124#[serde(default, rename_all = "camelCase")]
7125#[non_exhaustive]
7126pub struct GetRouteTableRequest {
7127    /// Required. The name of the route table resource.
7128    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7129    pub name: std::string::String,
7130
7131    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7132    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7133}
7134
7135impl GetRouteTableRequest {
7136    pub fn new() -> Self {
7137        std::default::Default::default()
7138    }
7139
7140    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
7141    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7142        self.name = v.into();
7143        self
7144    }
7145}
7146
7147impl wkt::message::Message for GetRouteTableRequest {
7148    fn typename() -> &'static str {
7149        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
7150    }
7151}
7152
7153/// The request for
7154/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
7155///
7156/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
7157#[serde_with::serde_as]
7158#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7159#[serde(default, rename_all = "camelCase")]
7160#[non_exhaustive]
7161pub struct GetRouteRequest {
7162    /// Required. The name of the route resource.
7163    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7164    pub name: std::string::String,
7165
7166    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7167    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7168}
7169
7170impl GetRouteRequest {
7171    pub fn new() -> Self {
7172        std::default::Default::default()
7173    }
7174
7175    /// Sets the value of [name][crate::model::GetRouteRequest::name].
7176    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7177        self.name = v.into();
7178        self
7179    }
7180}
7181
7182impl wkt::message::Message for GetRouteRequest {
7183    fn typename() -> &'static str {
7184        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
7185    }
7186}
7187
7188/// Request for
7189/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
7190/// method.
7191///
7192/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
7193#[serde_with::serde_as]
7194#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7195#[serde(default, rename_all = "camelCase")]
7196#[non_exhaustive]
7197pub struct ListRoutesRequest {
7198    /// Required. The parent resource's name.
7199    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7200    pub parent: std::string::String,
7201
7202    /// The maximum number of results to return per page.
7203    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7204    pub page_size: i32,
7205
7206    /// The page token.
7207    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7208    pub page_token: std::string::String,
7209
7210    /// An expression that filters the list of results.
7211    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7212    pub filter: std::string::String,
7213
7214    /// Sort the results by a certain order.
7215    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7216    pub order_by: std::string::String,
7217
7218    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7219    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7220}
7221
7222impl ListRoutesRequest {
7223    pub fn new() -> Self {
7224        std::default::Default::default()
7225    }
7226
7227    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7228    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7229        self.parent = v.into();
7230        self
7231    }
7232
7233    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7234    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7235        self.page_size = v.into();
7236        self
7237    }
7238
7239    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7240    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7241        self.page_token = v.into();
7242        self
7243    }
7244
7245    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7246    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7247        self.filter = v.into();
7248        self
7249    }
7250
7251    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7252    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7253        self.order_by = v.into();
7254        self
7255    }
7256}
7257
7258impl wkt::message::Message for ListRoutesRequest {
7259    fn typename() -> &'static str {
7260        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
7261    }
7262}
7263
7264/// Response for
7265/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
7266/// method.
7267///
7268/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
7269#[serde_with::serde_as]
7270#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7271#[serde(default, rename_all = "camelCase")]
7272#[non_exhaustive]
7273pub struct ListRoutesResponse {
7274    /// The requested routes.
7275    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7276    pub routes: std::vec::Vec<crate::model::Route>,
7277
7278    /// The token for the next page of the response. To see more results,
7279    /// use this value as the page_token for your next request. If this value
7280    /// is empty, there are no more results.
7281    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7282    pub next_page_token: std::string::String,
7283
7284    /// RouteTables that could not be reached.
7285    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7286    pub unreachable: std::vec::Vec<std::string::String>,
7287
7288    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7289    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7290}
7291
7292impl ListRoutesResponse {
7293    pub fn new() -> Self {
7294        std::default::Default::default()
7295    }
7296
7297    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
7298    pub fn set_routes<T, V>(mut self, v: T) -> Self
7299    where
7300        T: std::iter::IntoIterator<Item = V>,
7301        V: std::convert::Into<crate::model::Route>,
7302    {
7303        use std::iter::Iterator;
7304        self.routes = v.into_iter().map(|i| i.into()).collect();
7305        self
7306    }
7307
7308    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
7309    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7310        self.next_page_token = v.into();
7311        self
7312    }
7313
7314    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
7315    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7316    where
7317        T: std::iter::IntoIterator<Item = V>,
7318        V: std::convert::Into<std::string::String>,
7319    {
7320        use std::iter::Iterator;
7321        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7322        self
7323    }
7324}
7325
7326impl wkt::message::Message for ListRoutesResponse {
7327    fn typename() -> &'static str {
7328        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
7329    }
7330}
7331
7332#[doc(hidden)]
7333impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
7334    type PageItem = crate::model::Route;
7335
7336    fn items(self) -> std::vec::Vec<Self::PageItem> {
7337        self.routes
7338    }
7339
7340    fn next_page_token(&self) -> std::string::String {
7341        use std::clone::Clone;
7342        self.next_page_token.clone()
7343    }
7344}
7345
7346/// Request for
7347/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
7348/// method.
7349///
7350/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
7351#[serde_with::serde_as]
7352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7353#[serde(default, rename_all = "camelCase")]
7354#[non_exhaustive]
7355pub struct ListRouteTablesRequest {
7356    /// Required. The parent resource's name.
7357    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7358    pub parent: std::string::String,
7359
7360    /// The maximum number of results to return per page.
7361    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7362    pub page_size: i32,
7363
7364    /// The page token.
7365    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7366    pub page_token: std::string::String,
7367
7368    /// An expression that filters the list of results.
7369    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7370    pub filter: std::string::String,
7371
7372    /// Sort the results by a certain order.
7373    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7374    pub order_by: std::string::String,
7375
7376    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7377    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7378}
7379
7380impl ListRouteTablesRequest {
7381    pub fn new() -> Self {
7382        std::default::Default::default()
7383    }
7384
7385    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7386    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7387        self.parent = v.into();
7388        self
7389    }
7390
7391    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7392    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7393        self.page_size = v.into();
7394        self
7395    }
7396
7397    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7398    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7399        self.page_token = v.into();
7400        self
7401    }
7402
7403    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7404    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7405        self.filter = v.into();
7406        self
7407    }
7408
7409    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7410    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7411        self.order_by = v.into();
7412        self
7413    }
7414}
7415
7416impl wkt::message::Message for ListRouteTablesRequest {
7417    fn typename() -> &'static str {
7418        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
7419    }
7420}
7421
7422/// Response for
7423/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
7424/// method.
7425///
7426/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
7427#[serde_with::serde_as]
7428#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7429#[serde(default, rename_all = "camelCase")]
7430#[non_exhaustive]
7431pub struct ListRouteTablesResponse {
7432    /// The requested route tables.
7433    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7434    pub route_tables: std::vec::Vec<crate::model::RouteTable>,
7435
7436    /// The token for the next page of the response. To see more results,
7437    /// use this value as the page_token for your next request. If this value
7438    /// is empty, there are no more results.
7439    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7440    pub next_page_token: std::string::String,
7441
7442    /// Hubs that could not be reached.
7443    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7444    pub unreachable: std::vec::Vec<std::string::String>,
7445
7446    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7447    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7448}
7449
7450impl ListRouteTablesResponse {
7451    pub fn new() -> Self {
7452        std::default::Default::default()
7453    }
7454
7455    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
7456    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
7457    where
7458        T: std::iter::IntoIterator<Item = V>,
7459        V: std::convert::Into<crate::model::RouteTable>,
7460    {
7461        use std::iter::Iterator;
7462        self.route_tables = v.into_iter().map(|i| i.into()).collect();
7463        self
7464    }
7465
7466    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
7467    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7468        self.next_page_token = v.into();
7469        self
7470    }
7471
7472    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
7473    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7474    where
7475        T: std::iter::IntoIterator<Item = V>,
7476        V: std::convert::Into<std::string::String>,
7477    {
7478        use std::iter::Iterator;
7479        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7480        self
7481    }
7482}
7483
7484impl wkt::message::Message for ListRouteTablesResponse {
7485    fn typename() -> &'static str {
7486        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
7487    }
7488}
7489
7490#[doc(hidden)]
7491impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
7492    type PageItem = crate::model::RouteTable;
7493
7494    fn items(self) -> std::vec::Vec<Self::PageItem> {
7495        self.route_tables
7496    }
7497
7498    fn next_page_token(&self) -> std::string::String {
7499        use std::clone::Clone;
7500        self.next_page_token.clone()
7501    }
7502}
7503
7504/// Request for
7505/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
7506/// method.
7507///
7508/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
7509#[serde_with::serde_as]
7510#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7511#[serde(default, rename_all = "camelCase")]
7512#[non_exhaustive]
7513pub struct ListGroupsRequest {
7514    /// Required. The parent resource's name.
7515    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7516    pub parent: std::string::String,
7517
7518    /// The maximum number of results to return per page.
7519    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7520    pub page_size: i32,
7521
7522    /// The page token.
7523    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7524    pub page_token: std::string::String,
7525
7526    /// An expression that filters the list of results.
7527    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7528    pub filter: std::string::String,
7529
7530    /// Sort the results by a certain order.
7531    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7532    pub order_by: std::string::String,
7533
7534    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7535    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536}
7537
7538impl ListGroupsRequest {
7539    pub fn new() -> Self {
7540        std::default::Default::default()
7541    }
7542
7543    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7544    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7545        self.parent = v.into();
7546        self
7547    }
7548
7549    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7550    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7551        self.page_size = v.into();
7552        self
7553    }
7554
7555    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
7556    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7557        self.page_token = v.into();
7558        self
7559    }
7560
7561    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
7562    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7563        self.filter = v.into();
7564        self
7565    }
7566
7567    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
7568    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7569        self.order_by = v.into();
7570        self
7571    }
7572}
7573
7574impl wkt::message::Message for ListGroupsRequest {
7575    fn typename() -> &'static str {
7576        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
7577    }
7578}
7579
7580/// Response for
7581/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
7582/// method.
7583///
7584/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
7585#[serde_with::serde_as]
7586#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7587#[serde(default, rename_all = "camelCase")]
7588#[non_exhaustive]
7589pub struct ListGroupsResponse {
7590    /// The requested groups.
7591    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7592    pub groups: std::vec::Vec<crate::model::Group>,
7593
7594    /// The token for the next page of the response. To see more results,
7595    /// use this value as the page_token for your next request. If this value
7596    /// is empty, there are no more results.
7597    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7598    pub next_page_token: std::string::String,
7599
7600    /// Hubs that could not be reached.
7601    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7602    pub unreachable: std::vec::Vec<std::string::String>,
7603
7604    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7605    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7606}
7607
7608impl ListGroupsResponse {
7609    pub fn new() -> Self {
7610        std::default::Default::default()
7611    }
7612
7613    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
7614    pub fn set_groups<T, V>(mut self, v: T) -> Self
7615    where
7616        T: std::iter::IntoIterator<Item = V>,
7617        V: std::convert::Into<crate::model::Group>,
7618    {
7619        use std::iter::Iterator;
7620        self.groups = v.into_iter().map(|i| i.into()).collect();
7621        self
7622    }
7623
7624    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
7625    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7626        self.next_page_token = v.into();
7627        self
7628    }
7629
7630    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
7631    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7632    where
7633        T: std::iter::IntoIterator<Item = V>,
7634        V: std::convert::Into<std::string::String>,
7635    {
7636        use std::iter::Iterator;
7637        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7638        self
7639    }
7640}
7641
7642impl wkt::message::Message for ListGroupsResponse {
7643    fn typename() -> &'static str {
7644        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
7645    }
7646}
7647
7648#[doc(hidden)]
7649impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
7650    type PageItem = crate::model::Group;
7651
7652    fn items(self) -> std::vec::Vec<Self::PageItem> {
7653        self.groups
7654    }
7655
7656    fn next_page_token(&self) -> std::string::String {
7657        use std::clone::Clone;
7658        self.next_page_token.clone()
7659    }
7660}
7661
7662/// A collection of Cloud VPN tunnel resources. These resources should be
7663/// redundant HA VPN tunnels that all advertise the same prefixes to Google
7664/// Cloud. Alternatively, in a passive/active configuration, all tunnels
7665/// should be capable of advertising the same prefixes.
7666#[serde_with::serde_as]
7667#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7668#[serde(default, rename_all = "camelCase")]
7669#[non_exhaustive]
7670pub struct LinkedVpnTunnels {
7671    /// The URIs of linked VPN tunnel resources.
7672    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7673    pub uris: std::vec::Vec<std::string::String>,
7674
7675    /// A value that controls whether site-to-site data transfer is enabled for
7676    /// these resources. Data transfer is available only in [supported
7677    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7678    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7679    pub site_to_site_data_transfer: bool,
7680
7681    /// Output only. The VPC network where these VPN tunnels are located.
7682    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7683    pub vpc_network: std::string::String,
7684
7685    /// Optional. IP ranges allowed to be included during import from hub (does not
7686    /// control transit connectivity). The only allowed value for now is
7687    /// "ALL_IPV4_RANGES".
7688    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7689    pub include_import_ranges: std::vec::Vec<std::string::String>,
7690
7691    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7692    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7693}
7694
7695impl LinkedVpnTunnels {
7696    pub fn new() -> Self {
7697        std::default::Default::default()
7698    }
7699
7700    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
7701    pub fn set_uris<T, V>(mut self, v: T) -> Self
7702    where
7703        T: std::iter::IntoIterator<Item = V>,
7704        V: std::convert::Into<std::string::String>,
7705    {
7706        use std::iter::Iterator;
7707        self.uris = v.into_iter().map(|i| i.into()).collect();
7708        self
7709    }
7710
7711    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
7712    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7713        self.site_to_site_data_transfer = v.into();
7714        self
7715    }
7716
7717    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
7718    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7719        self.vpc_network = v.into();
7720        self
7721    }
7722
7723    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
7724    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7725    where
7726        T: std::iter::IntoIterator<Item = V>,
7727        V: std::convert::Into<std::string::String>,
7728    {
7729        use std::iter::Iterator;
7730        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7731        self
7732    }
7733}
7734
7735impl wkt::message::Message for LinkedVpnTunnels {
7736    fn typename() -> &'static str {
7737        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
7738    }
7739}
7740
7741/// A collection of VLAN attachment resources. These resources should
7742/// be redundant attachments that all advertise the same prefixes to Google
7743/// Cloud. Alternatively, in active/passive configurations, all attachments
7744/// should be capable of advertising the same prefixes.
7745#[serde_with::serde_as]
7746#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7747#[serde(default, rename_all = "camelCase")]
7748#[non_exhaustive]
7749pub struct LinkedInterconnectAttachments {
7750    /// The URIs of linked interconnect attachment resources
7751    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7752    pub uris: std::vec::Vec<std::string::String>,
7753
7754    /// A value that controls whether site-to-site data transfer is enabled for
7755    /// these resources. Data transfer is available only in [supported
7756    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7757    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7758    pub site_to_site_data_transfer: bool,
7759
7760    /// Output only. The VPC network where these VLAN attachments are located.
7761    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7762    pub vpc_network: std::string::String,
7763
7764    /// Optional. IP ranges allowed to be included during import from hub (does not
7765    /// control transit connectivity). The only allowed value for now is
7766    /// "ALL_IPV4_RANGES".
7767    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7768    pub include_import_ranges: std::vec::Vec<std::string::String>,
7769
7770    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7771    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7772}
7773
7774impl LinkedInterconnectAttachments {
7775    pub fn new() -> Self {
7776        std::default::Default::default()
7777    }
7778
7779    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
7780    pub fn set_uris<T, V>(mut self, v: T) -> Self
7781    where
7782        T: std::iter::IntoIterator<Item = V>,
7783        V: std::convert::Into<std::string::String>,
7784    {
7785        use std::iter::Iterator;
7786        self.uris = v.into_iter().map(|i| i.into()).collect();
7787        self
7788    }
7789
7790    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
7791    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7792        self.site_to_site_data_transfer = v.into();
7793        self
7794    }
7795
7796    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
7797    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7798        self.vpc_network = v.into();
7799        self
7800    }
7801
7802    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
7803    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7804    where
7805        T: std::iter::IntoIterator<Item = V>,
7806        V: std::convert::Into<std::string::String>,
7807    {
7808        use std::iter::Iterator;
7809        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7810        self
7811    }
7812}
7813
7814impl wkt::message::Message for LinkedInterconnectAttachments {
7815    fn typename() -> &'static str {
7816        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
7817    }
7818}
7819
7820/// A collection of router appliance instances. If you configure multiple router
7821/// appliance instances to receive data from the same set of sites outside of
7822/// Google Cloud, we recommend that you associate those instances with the same
7823/// spoke.
7824#[serde_with::serde_as]
7825#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7826#[serde(default, rename_all = "camelCase")]
7827#[non_exhaustive]
7828pub struct LinkedRouterApplianceInstances {
7829    /// The list of router appliance instances.
7830    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7831    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
7832
7833    /// A value that controls whether site-to-site data transfer is enabled for
7834    /// these resources. Data transfer is available only in [supported
7835    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7836    #[serde(skip_serializing_if = "wkt::internal::is_default")]
7837    pub site_to_site_data_transfer: bool,
7838
7839    /// Output only. The VPC network where these router appliance instances are
7840    /// located.
7841    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7842    pub vpc_network: std::string::String,
7843
7844    /// Optional. IP ranges allowed to be included during import from hub (does not
7845    /// control transit connectivity). The only allowed value for now is
7846    /// "ALL_IPV4_RANGES".
7847    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7848    pub include_import_ranges: std::vec::Vec<std::string::String>,
7849
7850    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7851    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7852}
7853
7854impl LinkedRouterApplianceInstances {
7855    pub fn new() -> Self {
7856        std::default::Default::default()
7857    }
7858
7859    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
7860    pub fn set_instances<T, V>(mut self, v: T) -> Self
7861    where
7862        T: std::iter::IntoIterator<Item = V>,
7863        V: std::convert::Into<crate::model::RouterApplianceInstance>,
7864    {
7865        use std::iter::Iterator;
7866        self.instances = v.into_iter().map(|i| i.into()).collect();
7867        self
7868    }
7869
7870    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
7871    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7872        self.site_to_site_data_transfer = v.into();
7873        self
7874    }
7875
7876    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
7877    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7878        self.vpc_network = v.into();
7879        self
7880    }
7881
7882    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
7883    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7884    where
7885        T: std::iter::IntoIterator<Item = V>,
7886        V: std::convert::Into<std::string::String>,
7887    {
7888        use std::iter::Iterator;
7889        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7890        self
7891    }
7892}
7893
7894impl wkt::message::Message for LinkedRouterApplianceInstances {
7895    fn typename() -> &'static str {
7896        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
7897    }
7898}
7899
7900/// An existing VPC network.
7901#[serde_with::serde_as]
7902#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7903#[serde(default, rename_all = "camelCase")]
7904#[non_exhaustive]
7905pub struct LinkedVpcNetwork {
7906    /// Required. The URI of the VPC network resource.
7907    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7908    pub uri: std::string::String,
7909
7910    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
7911    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7912    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7913
7914    /// Optional. IP ranges allowed to be included from peering.
7915    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7916    pub include_export_ranges: std::vec::Vec<std::string::String>,
7917
7918    /// Optional. The proposed include export IP ranges waiting for hub
7919    /// administration's approval.
7920    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7921    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7922
7923    /// Output only. The proposed exclude export IP ranges waiting for hub
7924    /// administration's approval.
7925    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7926    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7927
7928    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
7929    /// service consumer VPC spoke for. These producer VPCs are connected through
7930    /// VPC peering to this spoke's backing VPC network. Because they are directly
7931    /// connected throuh VPC peering, NCC export filters do not apply between the
7932    /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
7933    /// spoke cannot be deleted as long as any of these producer VPC spokes are
7934    /// connected to the NCC Hub.
7935    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7936    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
7937
7938    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7939    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7940}
7941
7942impl LinkedVpcNetwork {
7943    pub fn new() -> Self {
7944        std::default::Default::default()
7945    }
7946
7947    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
7948    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7949        self.uri = v.into();
7950        self
7951    }
7952
7953    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
7954    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7955    where
7956        T: std::iter::IntoIterator<Item = V>,
7957        V: std::convert::Into<std::string::String>,
7958    {
7959        use std::iter::Iterator;
7960        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7961        self
7962    }
7963
7964    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
7965    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7966    where
7967        T: std::iter::IntoIterator<Item = V>,
7968        V: std::convert::Into<std::string::String>,
7969    {
7970        use std::iter::Iterator;
7971        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7972        self
7973    }
7974
7975    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
7976    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7977    where
7978        T: std::iter::IntoIterator<Item = V>,
7979        V: std::convert::Into<std::string::String>,
7980    {
7981        use std::iter::Iterator;
7982        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7983        self
7984    }
7985
7986    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
7987    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7988    where
7989        T: std::iter::IntoIterator<Item = V>,
7990        V: std::convert::Into<std::string::String>,
7991    {
7992        use std::iter::Iterator;
7993        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7994        self
7995    }
7996
7997    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
7998    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
7999    where
8000        T: std::iter::IntoIterator<Item = V>,
8001        V: std::convert::Into<std::string::String>,
8002    {
8003        use std::iter::Iterator;
8004        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
8005        self
8006    }
8007}
8008
8009impl wkt::message::Message for LinkedVpcNetwork {
8010    fn typename() -> &'static str {
8011        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
8012    }
8013}
8014
8015#[serde_with::serde_as]
8016#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8017#[serde(default, rename_all = "camelCase")]
8018#[non_exhaustive]
8019pub struct LinkedProducerVpcNetwork {
8020    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
8021    /// peered with.
8022    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8023    pub network: std::string::String,
8024
8025    /// Output only. The Service Consumer Network spoke.
8026    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8027    pub service_consumer_vpc_spoke: std::string::String,
8028
8029    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
8030    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
8031    /// hub. This peering must be in ACTIVE state.
8032    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8033    pub peering: std::string::String,
8034
8035    /// Output only. The URI of the Producer VPC.
8036    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8037    pub producer_network: std::string::String,
8038
8039    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
8040    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8041    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
8042
8043    /// Optional. IP ranges allowed to be included from peering.
8044    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8045    pub include_export_ranges: std::vec::Vec<std::string::String>,
8046
8047    /// Optional. The proposed include export IP ranges waiting for hub
8048    /// administration's approval.
8049    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8050    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
8051
8052    /// Output only. The proposed exclude export IP ranges waiting for hub
8053    /// administration's approval.
8054    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8055    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
8056
8057    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8058    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8059}
8060
8061impl LinkedProducerVpcNetwork {
8062    pub fn new() -> Self {
8063        std::default::Default::default()
8064    }
8065
8066    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
8067    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8068        self.network = v.into();
8069        self
8070    }
8071
8072    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
8073    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
8074        mut self,
8075        v: T,
8076    ) -> Self {
8077        self.service_consumer_vpc_spoke = v.into();
8078        self
8079    }
8080
8081    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
8082    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8083        self.peering = v.into();
8084        self
8085    }
8086
8087    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
8088    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
8089        mut self,
8090        v: T,
8091    ) -> Self {
8092        self.producer_network = v.into();
8093        self
8094    }
8095
8096    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
8097    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
8098    where
8099        T: std::iter::IntoIterator<Item = V>,
8100        V: std::convert::Into<std::string::String>,
8101    {
8102        use std::iter::Iterator;
8103        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
8104        self
8105    }
8106
8107    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
8108    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
8109    where
8110        T: std::iter::IntoIterator<Item = V>,
8111        V: std::convert::Into<std::string::String>,
8112    {
8113        use std::iter::Iterator;
8114        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
8115        self
8116    }
8117
8118    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
8119    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
8120    where
8121        T: std::iter::IntoIterator<Item = V>,
8122        V: std::convert::Into<std::string::String>,
8123    {
8124        use std::iter::Iterator;
8125        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
8126        self
8127    }
8128
8129    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
8130    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
8131    where
8132        T: std::iter::IntoIterator<Item = V>,
8133        V: std::convert::Into<std::string::String>,
8134    {
8135        use std::iter::Iterator;
8136        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
8137        self
8138    }
8139}
8140
8141impl wkt::message::Message for LinkedProducerVpcNetwork {
8142    fn typename() -> &'static str {
8143        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
8144    }
8145}
8146
8147/// A router appliance instance is a Compute Engine virtual machine (VM) instance
8148/// that acts as a BGP speaker. A router appliance instance is specified by the
8149/// URI of the VM and the internal IP address of one of the VM's network
8150/// interfaces.
8151#[serde_with::serde_as]
8152#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8153#[serde(default, rename_all = "camelCase")]
8154#[non_exhaustive]
8155pub struct RouterApplianceInstance {
8156    /// The URI of the VM.
8157    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8158    pub virtual_machine: std::string::String,
8159
8160    /// The IP address on the VM to use for peering.
8161    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8162    pub ip_address: std::string::String,
8163
8164    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8165    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8166}
8167
8168impl RouterApplianceInstance {
8169    pub fn new() -> Self {
8170        std::default::Default::default()
8171    }
8172
8173    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
8174    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8175        self.virtual_machine = v.into();
8176        self
8177    }
8178
8179    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
8180    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8181        self.ip_address = v.into();
8182        self
8183    }
8184}
8185
8186impl wkt::message::Message for RouterApplianceInstance {
8187    fn typename() -> &'static str {
8188        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
8189    }
8190}
8191
8192/// Metadata about locations
8193#[serde_with::serde_as]
8194#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8195#[serde(default, rename_all = "camelCase")]
8196#[non_exhaustive]
8197pub struct LocationMetadata {
8198    /// List of supported features
8199    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8200    pub location_features: std::vec::Vec<crate::model::LocationFeature>,
8201
8202    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8203    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8204}
8205
8206impl LocationMetadata {
8207    pub fn new() -> Self {
8208        std::default::Default::default()
8209    }
8210
8211    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
8212    pub fn set_location_features<T, V>(mut self, v: T) -> Self
8213    where
8214        T: std::iter::IntoIterator<Item = V>,
8215        V: std::convert::Into<crate::model::LocationFeature>,
8216    {
8217        use std::iter::Iterator;
8218        self.location_features = v.into_iter().map(|i| i.into()).collect();
8219        self
8220    }
8221}
8222
8223impl wkt::message::Message for LocationMetadata {
8224    fn typename() -> &'static str {
8225        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
8226    }
8227}
8228
8229#[serde_with::serde_as]
8230#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8231#[serde(default, rename_all = "camelCase")]
8232#[non_exhaustive]
8233pub struct NextHopVpcNetwork {
8234    /// The URI of the VPC network resource
8235    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8236    pub uri: std::string::String,
8237
8238    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8239    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8240}
8241
8242impl NextHopVpcNetwork {
8243    pub fn new() -> Self {
8244        std::default::Default::default()
8245    }
8246
8247    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
8248    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8249        self.uri = v.into();
8250        self
8251    }
8252}
8253
8254impl wkt::message::Message for NextHopVpcNetwork {
8255    fn typename() -> &'static str {
8256        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
8257    }
8258}
8259
8260/// A route next hop that leads to a VPN tunnel resource.
8261#[serde_with::serde_as]
8262#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8263#[serde(default, rename_all = "camelCase")]
8264#[non_exhaustive]
8265pub struct NextHopVPNTunnel {
8266    /// The URI of the VPN tunnel resource.
8267    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8268    pub uri: std::string::String,
8269
8270    /// The VPC network where this VPN tunnel is located.
8271    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8272    pub vpc_network: std::string::String,
8273
8274    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
8275    /// resource. Data transfer is available only in [supported
8276    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
8277    #[serde(skip_serializing_if = "wkt::internal::is_default")]
8278    pub site_to_site_data_transfer: bool,
8279
8280    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8281    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8282}
8283
8284impl NextHopVPNTunnel {
8285    pub fn new() -> Self {
8286        std::default::Default::default()
8287    }
8288
8289    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
8290    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8291        self.uri = v.into();
8292        self
8293    }
8294
8295    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
8296    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297        self.vpc_network = v.into();
8298        self
8299    }
8300
8301    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
8302    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8303        self.site_to_site_data_transfer = v.into();
8304        self
8305    }
8306}
8307
8308impl wkt::message::Message for NextHopVPNTunnel {
8309    fn typename() -> &'static str {
8310        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
8311    }
8312}
8313
8314/// A route next hop that leads to a Router appliance instance.
8315#[serde_with::serde_as]
8316#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8317#[serde(default, rename_all = "camelCase")]
8318#[non_exhaustive]
8319pub struct NextHopRouterApplianceInstance {
8320    /// The URI of the Router appliance instance.
8321    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8322    pub uri: std::string::String,
8323
8324    /// The VPC network where this VM is located.
8325    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8326    pub vpc_network: std::string::String,
8327
8328    /// Indicates whether site-to-site data transfer is allowed for this Router
8329    /// appliance instance resource. Data transfer is available only in [supported
8330    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
8331    #[serde(skip_serializing_if = "wkt::internal::is_default")]
8332    pub site_to_site_data_transfer: bool,
8333
8334    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8335    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8336}
8337
8338impl NextHopRouterApplianceInstance {
8339    pub fn new() -> Self {
8340        std::default::Default::default()
8341    }
8342
8343    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
8344    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8345        self.uri = v.into();
8346        self
8347    }
8348
8349    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
8350    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8351        self.vpc_network = v.into();
8352        self
8353    }
8354
8355    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
8356    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8357        self.site_to_site_data_transfer = v.into();
8358        self
8359    }
8360}
8361
8362impl wkt::message::Message for NextHopRouterApplianceInstance {
8363    fn typename() -> &'static str {
8364        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
8365    }
8366}
8367
8368/// A route next hop that leads to an interconnect attachment resource.
8369#[serde_with::serde_as]
8370#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8371#[serde(default, rename_all = "camelCase")]
8372#[non_exhaustive]
8373pub struct NextHopInterconnectAttachment {
8374    /// The URI of the interconnect attachment resource.
8375    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8376    pub uri: std::string::String,
8377
8378    /// The VPC network where this interconnect attachment is located.
8379    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8380    pub vpc_network: std::string::String,
8381
8382    /// Indicates whether site-to-site data transfer is allowed for this
8383    /// interconnect attachment resource. Data transfer is available only in
8384    /// [supported
8385    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
8386    #[serde(skip_serializing_if = "wkt::internal::is_default")]
8387    pub site_to_site_data_transfer: bool,
8388
8389    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8390    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8391}
8392
8393impl NextHopInterconnectAttachment {
8394    pub fn new() -> Self {
8395        std::default::Default::default()
8396    }
8397
8398    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
8399    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8400        self.uri = v.into();
8401        self
8402    }
8403
8404    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
8405    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8406        self.vpc_network = v.into();
8407        self
8408    }
8409
8410    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
8411    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8412        self.site_to_site_data_transfer = v.into();
8413        self
8414    }
8415}
8416
8417impl wkt::message::Message for NextHopInterconnectAttachment {
8418    fn typename() -> &'static str {
8419        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
8420    }
8421}
8422
8423/// Summarizes information about the spokes associated with a hub.
8424/// The summary includes a count of spokes according to type
8425/// and according to state. If any spokes are inactive,
8426/// the summary also lists the reasons they are inactive,
8427/// including a count for each reason.
8428#[serde_with::serde_as]
8429#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8430#[serde(default, rename_all = "camelCase")]
8431#[non_exhaustive]
8432pub struct SpokeSummary {
8433    /// Output only. Counts the number of spokes of each type that are
8434    /// associated with a specific hub.
8435    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8436    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
8437
8438    /// Output only. Counts the number of spokes that are in each state
8439    /// and associated with a given hub.
8440    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8441    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
8442
8443    /// Output only. Counts the number of spokes that are inactive for each
8444    /// possible reason and associated with a given hub.
8445    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8446    pub spoke_state_reason_counts:
8447        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
8448
8449    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8450    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8451}
8452
8453impl SpokeSummary {
8454    pub fn new() -> Self {
8455        std::default::Default::default()
8456    }
8457
8458    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
8459    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
8460    where
8461        T: std::iter::IntoIterator<Item = V>,
8462        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
8463    {
8464        use std::iter::Iterator;
8465        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
8466        self
8467    }
8468
8469    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
8470    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
8471    where
8472        T: std::iter::IntoIterator<Item = V>,
8473        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
8474    {
8475        use std::iter::Iterator;
8476        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
8477        self
8478    }
8479
8480    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
8481    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
8482    where
8483        T: std::iter::IntoIterator<Item = V>,
8484        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
8485    {
8486        use std::iter::Iterator;
8487        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
8488        self
8489    }
8490}
8491
8492impl wkt::message::Message for SpokeSummary {
8493    fn typename() -> &'static str {
8494        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
8495    }
8496}
8497
8498/// Defines additional types related to [SpokeSummary].
8499pub mod spoke_summary {
8500    #[allow(unused_imports)]
8501    use super::*;
8502
8503    /// The number of spokes of a given type that are associated
8504    /// with a specific hub. The type indicates what kind of
8505    /// resource is associated with the spoke.
8506    #[serde_with::serde_as]
8507    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8508    #[serde(default, rename_all = "camelCase")]
8509    #[non_exhaustive]
8510    pub struct SpokeTypeCount {
8511        /// Output only. The type of the spokes.
8512        pub spoke_type: crate::model::SpokeType,
8513
8514        /// Output only. The total number of spokes of this type that are
8515        /// associated with the hub.
8516        #[serde(skip_serializing_if = "wkt::internal::is_default")]
8517        #[serde_as(as = "serde_with::DisplayFromStr")]
8518        pub count: i64,
8519
8520        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8521        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8522    }
8523
8524    impl SpokeTypeCount {
8525        pub fn new() -> Self {
8526            std::default::Default::default()
8527        }
8528
8529        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
8530        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
8531            mut self,
8532            v: T,
8533        ) -> Self {
8534            self.spoke_type = v.into();
8535            self
8536        }
8537
8538        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
8539        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8540            self.count = v.into();
8541            self
8542        }
8543    }
8544
8545    impl wkt::message::Message for SpokeTypeCount {
8546        fn typename() -> &'static str {
8547            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
8548        }
8549    }
8550
8551    /// The number of spokes that are in a particular state
8552    /// and associated with a given hub.
8553    #[serde_with::serde_as]
8554    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8555    #[serde(default, rename_all = "camelCase")]
8556    #[non_exhaustive]
8557    pub struct SpokeStateCount {
8558        /// Output only. The state of the spokes.
8559        pub state: crate::model::State,
8560
8561        /// Output only. The total number of spokes that are in this state
8562        /// and associated with a given hub.
8563        #[serde(skip_serializing_if = "wkt::internal::is_default")]
8564        #[serde_as(as = "serde_with::DisplayFromStr")]
8565        pub count: i64,
8566
8567        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8568        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8569    }
8570
8571    impl SpokeStateCount {
8572        pub fn new() -> Self {
8573            std::default::Default::default()
8574        }
8575
8576        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
8577        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8578            self.state = v.into();
8579            self
8580        }
8581
8582        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
8583        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8584            self.count = v.into();
8585            self
8586        }
8587    }
8588
8589    impl wkt::message::Message for SpokeStateCount {
8590        fn typename() -> &'static str {
8591            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
8592        }
8593    }
8594
8595    /// The number of spokes in the hub that are inactive for this reason.
8596    #[serde_with::serde_as]
8597    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8598    #[serde(default, rename_all = "camelCase")]
8599    #[non_exhaustive]
8600    pub struct SpokeStateReasonCount {
8601        /// Output only. The reason that a spoke is inactive.
8602        pub state_reason_code: crate::model::spoke::state_reason::Code,
8603
8604        /// Output only. The total number of spokes that are inactive for a
8605        /// particular reason and associated with a given hub.
8606        #[serde(skip_serializing_if = "wkt::internal::is_default")]
8607        #[serde_as(as = "serde_with::DisplayFromStr")]
8608        pub count: i64,
8609
8610        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8611        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8612    }
8613
8614    impl SpokeStateReasonCount {
8615        pub fn new() -> Self {
8616            std::default::Default::default()
8617        }
8618
8619        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
8620        pub fn set_state_reason_code<
8621            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
8622        >(
8623            mut self,
8624            v: T,
8625        ) -> Self {
8626            self.state_reason_code = v.into();
8627            self
8628        }
8629
8630        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
8631        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8632            self.count = v.into();
8633            self
8634        }
8635    }
8636
8637    impl wkt::message::Message for SpokeStateReasonCount {
8638        fn typename() -> &'static str {
8639            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
8640        }
8641    }
8642}
8643
8644/// The request for
8645/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
8646///
8647/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
8648#[serde_with::serde_as]
8649#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8650#[serde(default, rename_all = "camelCase")]
8651#[non_exhaustive]
8652pub struct GetGroupRequest {
8653    /// Required. The name of the route table resource.
8654    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8655    pub name: std::string::String,
8656
8657    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8658    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8659}
8660
8661impl GetGroupRequest {
8662    pub fn new() -> Self {
8663        std::default::Default::default()
8664    }
8665
8666    /// Sets the value of [name][crate::model::GetGroupRequest::name].
8667    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8668        self.name = v.into();
8669        self
8670    }
8671}
8672
8673impl wkt::message::Message for GetGroupRequest {
8674    fn typename() -> &'static str {
8675        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
8676    }
8677}
8678
8679/// Request for
8680/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
8681/// method.
8682///
8683/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
8684#[serde_with::serde_as]
8685#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8686#[serde(default, rename_all = "camelCase")]
8687#[non_exhaustive]
8688pub struct UpdateGroupRequest {
8689    /// Optional. In the case of an update to an existing group, field mask is used
8690    /// to specify the fields to be overwritten. The fields specified in the
8691    /// update_mask are relative to the resource, not the full request. A field is
8692    /// overwritten if it is in the mask. If the user does not provide a mask, then
8693    /// all fields are overwritten.
8694    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8695    pub update_mask: std::option::Option<wkt::FieldMask>,
8696
8697    /// Required. The state that the group should be in after the update.
8698    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8699    pub group: std::option::Option<crate::model::Group>,
8700
8701    /// Optional. A request ID to identify requests. Specify a unique request ID so
8702    /// that if you must retry your request, the server knows to ignore the request
8703    /// if it has already been completed. The server guarantees that a request
8704    /// doesn't result in creation of duplicate commitments for at least 60
8705    /// minutes.
8706    ///
8707    /// For example, consider a situation where you make an initial request and
8708    /// the request times out. If you make the request again with the same request
8709    /// ID, the server can check to see whether the original operation
8710    /// was received. If it was, the server ignores the second request. This
8711    /// behavior prevents clients from mistakenly creating duplicate commitments.
8712    ///
8713    /// The request ID must be a valid UUID, with the exception that zero UUID is
8714    /// not supported (00000000-0000-0000-0000-000000000000).
8715    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8716    pub request_id: std::string::String,
8717
8718    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8719    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8720}
8721
8722impl UpdateGroupRequest {
8723    pub fn new() -> Self {
8724        std::default::Default::default()
8725    }
8726
8727    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
8728    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
8729        mut self,
8730        v: T,
8731    ) -> Self {
8732        self.update_mask = v.into();
8733        self
8734    }
8735
8736    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
8737    pub fn set_group<T: std::convert::Into<std::option::Option<crate::model::Group>>>(
8738        mut self,
8739        v: T,
8740    ) -> Self {
8741        self.group = v.into();
8742        self
8743    }
8744
8745    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
8746    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8747        self.request_id = v.into();
8748        self
8749    }
8750}
8751
8752impl wkt::message::Message for UpdateGroupRequest {
8753    fn typename() -> &'static str {
8754        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
8755    }
8756}
8757
8758/// Policy-based routes route L4 network traffic based on not just destination IP
8759/// address, but also source IP address, protocol, and more. If a policy-based
8760/// route conflicts with other types of routes, the policy-based route always
8761/// takes precedence.
8762#[serde_with::serde_as]
8763#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8764#[serde(default, rename_all = "camelCase")]
8765#[non_exhaustive]
8766pub struct PolicyBasedRoute {
8767    /// Immutable. A unique name of the resource in the form of
8768    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
8769    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8770    pub name: std::string::String,
8771
8772    /// Output only. Time when the policy-based route was created.
8773    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8774    pub create_time: std::option::Option<wkt::Timestamp>,
8775
8776    /// Output only. Time when the policy-based route was updated.
8777    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8778    pub update_time: std::option::Option<wkt::Timestamp>,
8779
8780    /// User-defined labels.
8781    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8782    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8783
8784    /// Optional. An optional description of this resource. Provide this field when
8785    /// you create the resource.
8786    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8787    pub description: std::string::String,
8788
8789    /// Required. Fully-qualified URL of the network that this route applies to,
8790    /// for example: projects/my-project/global/networks/my-network.
8791    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8792    pub network: std::string::String,
8793
8794    /// Required. The filter to match L4 traffic.
8795    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8796    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
8797
8798    /// Optional. The priority of this policy-based route. Priority is used to
8799    /// break ties in cases where there are more than one matching policy-based
8800    /// routes found. In cases where multiple policy-based routes are matched, the
8801    /// one with the lowest-numbered priority value wins. The default value is
8802    /// 1000. The priority value must be from 1 to 65535, inclusive.
8803    #[serde(skip_serializing_if = "wkt::internal::is_default")]
8804    pub priority: i32,
8805
8806    /// Output only. If potential misconfigurations are detected for this route,
8807    /// this field will be populated with warning messages.
8808    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8809    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
8810
8811    /// Output only. Server-defined fully-qualified URL for this resource.
8812    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8813    pub self_link: std::string::String,
8814
8815    /// Output only. Type of this resource. Always
8816    /// networkconnectivity#policyBasedRoute for policy-based Route resources.
8817    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8818    pub kind: std::string::String,
8819
8820    /// Target specifies network endpoints that this policy-based route applies to.
8821    /// If no target is specified, the PBR will be installed on all network
8822    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
8823    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8824    pub target: std::option::Option<crate::model::policy_based_route::Target>,
8825
8826    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8827    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
8828
8829    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8830    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8831}
8832
8833impl PolicyBasedRoute {
8834    pub fn new() -> Self {
8835        std::default::Default::default()
8836    }
8837
8838    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
8839    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8840        self.name = v.into();
8841        self
8842    }
8843
8844    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
8845    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8846        mut self,
8847        v: T,
8848    ) -> Self {
8849        self.create_time = v.into();
8850        self
8851    }
8852
8853    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
8854    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8855        mut self,
8856        v: T,
8857    ) -> Self {
8858        self.update_time = v.into();
8859        self
8860    }
8861
8862    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
8863    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8864    where
8865        T: std::iter::IntoIterator<Item = (K, V)>,
8866        K: std::convert::Into<std::string::String>,
8867        V: std::convert::Into<std::string::String>,
8868    {
8869        use std::iter::Iterator;
8870        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8871        self
8872    }
8873
8874    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
8875    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8876        self.description = v.into();
8877        self
8878    }
8879
8880    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
8881    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8882        self.network = v.into();
8883        self
8884    }
8885
8886    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
8887    pub fn set_filter<
8888        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Filter>>,
8889    >(
8890        mut self,
8891        v: T,
8892    ) -> Self {
8893        self.filter = v.into();
8894        self
8895    }
8896
8897    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
8898    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8899        self.priority = v.into();
8900        self
8901    }
8902
8903    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
8904    pub fn set_warnings<T, V>(mut self, v: T) -> Self
8905    where
8906        T: std::iter::IntoIterator<Item = V>,
8907        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
8908    {
8909        use std::iter::Iterator;
8910        self.warnings = v.into_iter().map(|i| i.into()).collect();
8911        self
8912    }
8913
8914    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
8915    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8916        self.self_link = v.into();
8917        self
8918    }
8919
8920    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
8921    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8922        self.kind = v.into();
8923        self
8924    }
8925
8926    /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
8927    ///
8928    /// Note that all the setters affecting `target` are mutually
8929    /// exclusive.
8930    pub fn set_target<
8931        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
8932    >(
8933        mut self,
8934        v: T,
8935    ) -> Self {
8936        self.target = v.into();
8937        self
8938    }
8939
8940    /// The value of [target][crate::model::PolicyBasedRoute::target]
8941    /// if it holds a `VirtualMachine`, `None` if the field is not set or
8942    /// holds a different branch.
8943    pub fn virtual_machine(
8944        &self,
8945    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
8946    {
8947        #[allow(unreachable_patterns)]
8948        self.target.as_ref().and_then(|v| match v {
8949            crate::model::policy_based_route::Target::VirtualMachine(v) => {
8950                std::option::Option::Some(v)
8951            }
8952            _ => std::option::Option::None,
8953        })
8954    }
8955
8956    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
8957    /// to hold a `VirtualMachine`.
8958    ///
8959    /// Note that all the setters affecting `target` are
8960    /// mutually exclusive.
8961    pub fn set_virtual_machine<
8962        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
8963    >(
8964        mut self,
8965        v: T,
8966    ) -> Self {
8967        self.target = std::option::Option::Some(
8968            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
8969        );
8970        self
8971    }
8972
8973    /// The value of [target][crate::model::PolicyBasedRoute::target]
8974    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
8975    /// holds a different branch.
8976    pub fn interconnect_attachment(
8977        &self,
8978    ) -> std::option::Option<
8979        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8980    > {
8981        #[allow(unreachable_patterns)]
8982        self.target.as_ref().and_then(|v| match v {
8983            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
8984                std::option::Option::Some(v)
8985            }
8986            _ => std::option::Option::None,
8987        })
8988    }
8989
8990    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
8991    /// to hold a `InterconnectAttachment`.
8992    ///
8993    /// Note that all the setters affecting `target` are
8994    /// mutually exclusive.
8995    pub fn set_interconnect_attachment<
8996        T: std::convert::Into<
8997                std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8998            >,
8999    >(
9000        mut self,
9001        v: T,
9002    ) -> Self {
9003        self.target = std::option::Option::Some(
9004            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
9005        );
9006        self
9007    }
9008
9009    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
9010    ///
9011    /// Note that all the setters affecting `next_hop` are mutually
9012    /// exclusive.
9013    pub fn set_next_hop<
9014        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
9015    >(
9016        mut self,
9017        v: T,
9018    ) -> Self {
9019        self.next_hop = v.into();
9020        self
9021    }
9022
9023    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
9024    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
9025    /// holds a different branch.
9026    pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
9027        #[allow(unreachable_patterns)]
9028        self.next_hop.as_ref().and_then(|v| match v {
9029            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
9030                std::option::Option::Some(v)
9031            }
9032            _ => std::option::Option::None,
9033        })
9034    }
9035
9036    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
9037    /// to hold a `NextHopIlbIp`.
9038    ///
9039    /// Note that all the setters affecting `next_hop` are
9040    /// mutually exclusive.
9041    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9042        self.next_hop = std::option::Option::Some(
9043            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
9044        );
9045        self
9046    }
9047
9048    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
9049    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
9050    /// holds a different branch.
9051    pub fn next_hop_other_routes(
9052        &self,
9053    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
9054        #[allow(unreachable_patterns)]
9055        self.next_hop.as_ref().and_then(|v| match v {
9056            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
9057                std::option::Option::Some(v)
9058            }
9059            _ => std::option::Option::None,
9060        })
9061    }
9062
9063    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
9064    /// to hold a `NextHopOtherRoutes`.
9065    ///
9066    /// Note that all the setters affecting `next_hop` are
9067    /// mutually exclusive.
9068    pub fn set_next_hop_other_routes<
9069        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
9070    >(
9071        mut self,
9072        v: T,
9073    ) -> Self {
9074        self.next_hop = std::option::Option::Some(
9075            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
9076        );
9077        self
9078    }
9079}
9080
9081impl wkt::message::Message for PolicyBasedRoute {
9082    fn typename() -> &'static str {
9083        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
9084    }
9085}
9086
9087/// Defines additional types related to [PolicyBasedRoute].
9088pub mod policy_based_route {
9089    #[allow(unused_imports)]
9090    use super::*;
9091
9092    /// VM instances that this policy-based route applies to.
9093    #[serde_with::serde_as]
9094    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9095    #[serde(default, rename_all = "camelCase")]
9096    #[non_exhaustive]
9097    pub struct VirtualMachine {
9098        /// Optional. A list of VM instance tags that this policy-based route applies
9099        /// to. VM instances that have ANY of tags specified here installs this PBR.
9100        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9101        pub tags: std::vec::Vec<std::string::String>,
9102
9103        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9104        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9105    }
9106
9107    impl VirtualMachine {
9108        pub fn new() -> Self {
9109            std::default::Default::default()
9110        }
9111
9112        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
9113        pub fn set_tags<T, V>(mut self, v: T) -> Self
9114        where
9115            T: std::iter::IntoIterator<Item = V>,
9116            V: std::convert::Into<std::string::String>,
9117        {
9118            use std::iter::Iterator;
9119            self.tags = v.into_iter().map(|i| i.into()).collect();
9120            self
9121        }
9122    }
9123
9124    impl wkt::message::Message for VirtualMachine {
9125        fn typename() -> &'static str {
9126            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
9127        }
9128    }
9129
9130    /// InterconnectAttachment that this route applies to.
9131    #[serde_with::serde_as]
9132    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9133    #[serde(default, rename_all = "camelCase")]
9134    #[non_exhaustive]
9135    pub struct InterconnectAttachment {
9136        /// Optional. Cloud region to install this policy-based route on interconnect
9137        /// attachment. Use `all` to install it on all interconnect attachments.
9138        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9139        pub region: std::string::String,
9140
9141        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9142        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9143    }
9144
9145    impl InterconnectAttachment {
9146        pub fn new() -> Self {
9147            std::default::Default::default()
9148        }
9149
9150        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
9151        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9152            self.region = v.into();
9153            self
9154        }
9155    }
9156
9157    impl wkt::message::Message for InterconnectAttachment {
9158        fn typename() -> &'static str {
9159            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
9160        }
9161    }
9162
9163    /// Filter matches L4 traffic.
9164    #[serde_with::serde_as]
9165    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9166    #[serde(default, rename_all = "camelCase")]
9167    #[non_exhaustive]
9168    pub struct Filter {
9169        /// Optional. The IP protocol that this policy-based route applies to. Valid
9170        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
9171        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9172        pub ip_protocol: std::string::String,
9173
9174        /// Optional. The source IP range of outgoing packets that this policy-based
9175        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
9176        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9177        pub src_range: std::string::String,
9178
9179        /// Optional. The destination IP range of outgoing packets that this
9180        /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
9181        /// is IPv4.
9182        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9183        pub dest_range: std::string::String,
9184
9185        /// Required. Internet protocol versions this policy-based route applies to.
9186        /// For this version, only IPV4 is supported. IPV6 is supported in preview.
9187        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
9188
9189        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9190        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9191    }
9192
9193    impl Filter {
9194        pub fn new() -> Self {
9195            std::default::Default::default()
9196        }
9197
9198        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
9199        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9200            self.ip_protocol = v.into();
9201            self
9202        }
9203
9204        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
9205        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9206            self.src_range = v.into();
9207            self
9208        }
9209
9210        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
9211        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9212            self.dest_range = v.into();
9213            self
9214        }
9215
9216        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
9217        pub fn set_protocol_version<
9218            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
9219        >(
9220            mut self,
9221            v: T,
9222        ) -> Self {
9223            self.protocol_version = v.into();
9224            self
9225        }
9226    }
9227
9228    impl wkt::message::Message for Filter {
9229        fn typename() -> &'static str {
9230            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
9231        }
9232    }
9233
9234    /// Defines additional types related to [Filter].
9235    pub mod filter {
9236        #[allow(unused_imports)]
9237        use super::*;
9238
9239        /// The internet protocol version.
9240        ///
9241        /// # Working with unknown values
9242        ///
9243        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9244        /// additional enum variants at any time. Adding new variants is not considered
9245        /// a breaking change. Applications should write their code in anticipation of:
9246        ///
9247        /// - New values appearing in future releases of the client library, **and**
9248        /// - New values received dynamically, without application changes.
9249        ///
9250        /// Please consult the [Working with enums] section in the user guide for some
9251        /// guidelines.
9252        ///
9253        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9254        #[derive(Clone, Debug, PartialEq)]
9255        #[non_exhaustive]
9256        pub enum ProtocolVersion {
9257            /// Default value.
9258            Unspecified,
9259            /// The PBR is for IPv4 internet protocol traffic.
9260            Ipv4,
9261            /// If set, the enum was initialized with an unknown value.
9262            ///
9263            /// Applications can examine the value using [ProtocolVersion::value] or
9264            /// [ProtocolVersion::name].
9265            UnknownValue(protocol_version::UnknownValue),
9266        }
9267
9268        #[doc(hidden)]
9269        pub mod protocol_version {
9270            #[allow(unused_imports)]
9271            use super::*;
9272            #[derive(Clone, Debug, PartialEq)]
9273            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9274        }
9275
9276        impl ProtocolVersion {
9277            /// Gets the enum value.
9278            ///
9279            /// Returns `None` if the enum contains an unknown value deserialized from
9280            /// the string representation of enums.
9281            pub fn value(&self) -> std::option::Option<i32> {
9282                match self {
9283                    Self::Unspecified => std::option::Option::Some(0),
9284                    Self::Ipv4 => std::option::Option::Some(1),
9285                    Self::UnknownValue(u) => u.0.value(),
9286                }
9287            }
9288
9289            /// Gets the enum value as a string.
9290            ///
9291            /// Returns `None` if the enum contains an unknown value deserialized from
9292            /// the integer representation of enums.
9293            pub fn name(&self) -> std::option::Option<&str> {
9294                match self {
9295                    Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
9296                    Self::Ipv4 => std::option::Option::Some("IPV4"),
9297                    Self::UnknownValue(u) => u.0.name(),
9298                }
9299            }
9300        }
9301
9302        impl std::default::Default for ProtocolVersion {
9303            fn default() -> Self {
9304                use std::convert::From;
9305                Self::from(0)
9306            }
9307        }
9308
9309        impl std::fmt::Display for ProtocolVersion {
9310            fn fmt(
9311                &self,
9312                f: &mut std::fmt::Formatter<'_>,
9313            ) -> std::result::Result<(), std::fmt::Error> {
9314                wkt::internal::display_enum(f, self.name(), self.value())
9315            }
9316        }
9317
9318        impl std::convert::From<i32> for ProtocolVersion {
9319            fn from(value: i32) -> Self {
9320                match value {
9321                    0 => Self::Unspecified,
9322                    1 => Self::Ipv4,
9323                    _ => Self::UnknownValue(protocol_version::UnknownValue(
9324                        wkt::internal::UnknownEnumValue::Integer(value),
9325                    )),
9326                }
9327            }
9328        }
9329
9330        impl std::convert::From<&str> for ProtocolVersion {
9331            fn from(value: &str) -> Self {
9332                use std::string::ToString;
9333                match value {
9334                    "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
9335                    "IPV4" => Self::Ipv4,
9336                    _ => Self::UnknownValue(protocol_version::UnknownValue(
9337                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9338                    )),
9339                }
9340            }
9341        }
9342
9343        impl serde::ser::Serialize for ProtocolVersion {
9344            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9345            where
9346                S: serde::Serializer,
9347            {
9348                match self {
9349                    Self::Unspecified => serializer.serialize_i32(0),
9350                    Self::Ipv4 => serializer.serialize_i32(1),
9351                    Self::UnknownValue(u) => u.0.serialize(serializer),
9352                }
9353            }
9354        }
9355
9356        impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
9357            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9358            where
9359                D: serde::Deserializer<'de>,
9360            {
9361                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
9362                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
9363                ))
9364            }
9365        }
9366    }
9367
9368    /// Informational warning message.
9369    #[serde_with::serde_as]
9370    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9371    #[serde(default, rename_all = "camelCase")]
9372    #[non_exhaustive]
9373    pub struct Warnings {
9374        /// Output only. A warning code, if applicable.
9375        pub code: crate::model::policy_based_route::warnings::Code,
9376
9377        /// Output only. Metadata about this warning in key: value format. The key
9378        /// should provides more detail on the warning being returned. For example,
9379        /// for warnings where there are no results in a list request for a
9380        /// particular zone, this key might be scope and the key value might be the
9381        /// zone name. Other examples might be a key indicating a deprecated resource
9382        /// and a suggested replacement.
9383        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
9384        pub data: std::collections::HashMap<std::string::String, std::string::String>,
9385
9386        /// Output only. A human-readable description of the warning code.
9387        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9388        pub warning_message: std::string::String,
9389
9390        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9391        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9392    }
9393
9394    impl Warnings {
9395        pub fn new() -> Self {
9396            std::default::Default::default()
9397        }
9398
9399        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
9400        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
9401            mut self,
9402            v: T,
9403        ) -> Self {
9404            self.code = v.into();
9405            self
9406        }
9407
9408        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
9409        pub fn set_data<T, K, V>(mut self, v: T) -> Self
9410        where
9411            T: std::iter::IntoIterator<Item = (K, V)>,
9412            K: std::convert::Into<std::string::String>,
9413            V: std::convert::Into<std::string::String>,
9414        {
9415            use std::iter::Iterator;
9416            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9417            self
9418        }
9419
9420        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
9421        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
9422            mut self,
9423            v: T,
9424        ) -> Self {
9425            self.warning_message = v.into();
9426            self
9427        }
9428    }
9429
9430    impl wkt::message::Message for Warnings {
9431        fn typename() -> &'static str {
9432            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
9433        }
9434    }
9435
9436    /// Defines additional types related to [Warnings].
9437    pub mod warnings {
9438        #[allow(unused_imports)]
9439        use super::*;
9440
9441        /// Warning code for policy-based routing. Expect to add values in the
9442        /// future.
9443        ///
9444        /// # Working with unknown values
9445        ///
9446        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9447        /// additional enum variants at any time. Adding new variants is not considered
9448        /// a breaking change. Applications should write their code in anticipation of:
9449        ///
9450        /// - New values appearing in future releases of the client library, **and**
9451        /// - New values received dynamically, without application changes.
9452        ///
9453        /// Please consult the [Working with enums] section in the user guide for some
9454        /// guidelines.
9455        ///
9456        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9457        #[derive(Clone, Debug, PartialEq)]
9458        #[non_exhaustive]
9459        pub enum Code {
9460            /// Default value.
9461            WarningUnspecified,
9462            /// The policy-based route is not active and functioning. Common causes are
9463            /// that the dependent network was deleted or the resource project was
9464            /// turned off.
9465            ResourceNotActive,
9466            /// The policy-based route is being modified (e.g. created/deleted) at this
9467            /// time.
9468            ResourceBeingModified,
9469            /// If set, the enum was initialized with an unknown value.
9470            ///
9471            /// Applications can examine the value using [Code::value] or
9472            /// [Code::name].
9473            UnknownValue(code::UnknownValue),
9474        }
9475
9476        #[doc(hidden)]
9477        pub mod code {
9478            #[allow(unused_imports)]
9479            use super::*;
9480            #[derive(Clone, Debug, PartialEq)]
9481            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9482        }
9483
9484        impl Code {
9485            /// Gets the enum value.
9486            ///
9487            /// Returns `None` if the enum contains an unknown value deserialized from
9488            /// the string representation of enums.
9489            pub fn value(&self) -> std::option::Option<i32> {
9490                match self {
9491                    Self::WarningUnspecified => std::option::Option::Some(0),
9492                    Self::ResourceNotActive => std::option::Option::Some(1),
9493                    Self::ResourceBeingModified => std::option::Option::Some(2),
9494                    Self::UnknownValue(u) => u.0.value(),
9495                }
9496            }
9497
9498            /// Gets the enum value as a string.
9499            ///
9500            /// Returns `None` if the enum contains an unknown value deserialized from
9501            /// the integer representation of enums.
9502            pub fn name(&self) -> std::option::Option<&str> {
9503                match self {
9504                    Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
9505                    Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
9506                    Self::ResourceBeingModified => {
9507                        std::option::Option::Some("RESOURCE_BEING_MODIFIED")
9508                    }
9509                    Self::UnknownValue(u) => u.0.name(),
9510                }
9511            }
9512        }
9513
9514        impl std::default::Default for Code {
9515            fn default() -> Self {
9516                use std::convert::From;
9517                Self::from(0)
9518            }
9519        }
9520
9521        impl std::fmt::Display for Code {
9522            fn fmt(
9523                &self,
9524                f: &mut std::fmt::Formatter<'_>,
9525            ) -> std::result::Result<(), std::fmt::Error> {
9526                wkt::internal::display_enum(f, self.name(), self.value())
9527            }
9528        }
9529
9530        impl std::convert::From<i32> for Code {
9531            fn from(value: i32) -> Self {
9532                match value {
9533                    0 => Self::WarningUnspecified,
9534                    1 => Self::ResourceNotActive,
9535                    2 => Self::ResourceBeingModified,
9536                    _ => Self::UnknownValue(code::UnknownValue(
9537                        wkt::internal::UnknownEnumValue::Integer(value),
9538                    )),
9539                }
9540            }
9541        }
9542
9543        impl std::convert::From<&str> for Code {
9544            fn from(value: &str) -> Self {
9545                use std::string::ToString;
9546                match value {
9547                    "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
9548                    "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
9549                    "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
9550                    _ => Self::UnknownValue(code::UnknownValue(
9551                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9552                    )),
9553                }
9554            }
9555        }
9556
9557        impl serde::ser::Serialize for Code {
9558            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9559            where
9560                S: serde::Serializer,
9561            {
9562                match self {
9563                    Self::WarningUnspecified => serializer.serialize_i32(0),
9564                    Self::ResourceNotActive => serializer.serialize_i32(1),
9565                    Self::ResourceBeingModified => serializer.serialize_i32(2),
9566                    Self::UnknownValue(u) => u.0.serialize(serializer),
9567                }
9568            }
9569        }
9570
9571        impl<'de> serde::de::Deserialize<'de> for Code {
9572            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9573            where
9574                D: serde::Deserializer<'de>,
9575            {
9576                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
9577                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
9578                ))
9579            }
9580        }
9581    }
9582
9583    /// The other routing cases.
9584    ///
9585    /// # Working with unknown values
9586    ///
9587    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9588    /// additional enum variants at any time. Adding new variants is not considered
9589    /// a breaking change. Applications should write their code in anticipation of:
9590    ///
9591    /// - New values appearing in future releases of the client library, **and**
9592    /// - New values received dynamically, without application changes.
9593    ///
9594    /// Please consult the [Working with enums] section in the user guide for some
9595    /// guidelines.
9596    ///
9597    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9598    #[derive(Clone, Debug, PartialEq)]
9599    #[non_exhaustive]
9600    pub enum OtherRoutes {
9601        /// Default value.
9602        Unspecified,
9603        /// Use the routes from the default routing tables (system-generated routes,
9604        /// custom routes, peering route) to determine the next hop. This effectively
9605        /// excludes matching packets being applied on other PBRs with a lower
9606        /// priority.
9607        DefaultRouting,
9608        /// If set, the enum was initialized with an unknown value.
9609        ///
9610        /// Applications can examine the value using [OtherRoutes::value] or
9611        /// [OtherRoutes::name].
9612        UnknownValue(other_routes::UnknownValue),
9613    }
9614
9615    #[doc(hidden)]
9616    pub mod other_routes {
9617        #[allow(unused_imports)]
9618        use super::*;
9619        #[derive(Clone, Debug, PartialEq)]
9620        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9621    }
9622
9623    impl OtherRoutes {
9624        /// Gets the enum value.
9625        ///
9626        /// Returns `None` if the enum contains an unknown value deserialized from
9627        /// the string representation of enums.
9628        pub fn value(&self) -> std::option::Option<i32> {
9629            match self {
9630                Self::Unspecified => std::option::Option::Some(0),
9631                Self::DefaultRouting => std::option::Option::Some(1),
9632                Self::UnknownValue(u) => u.0.value(),
9633            }
9634        }
9635
9636        /// Gets the enum value as a string.
9637        ///
9638        /// Returns `None` if the enum contains an unknown value deserialized from
9639        /// the integer representation of enums.
9640        pub fn name(&self) -> std::option::Option<&str> {
9641            match self {
9642                Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
9643                Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
9644                Self::UnknownValue(u) => u.0.name(),
9645            }
9646        }
9647    }
9648
9649    impl std::default::Default for OtherRoutes {
9650        fn default() -> Self {
9651            use std::convert::From;
9652            Self::from(0)
9653        }
9654    }
9655
9656    impl std::fmt::Display for OtherRoutes {
9657        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9658            wkt::internal::display_enum(f, self.name(), self.value())
9659        }
9660    }
9661
9662    impl std::convert::From<i32> for OtherRoutes {
9663        fn from(value: i32) -> Self {
9664            match value {
9665                0 => Self::Unspecified,
9666                1 => Self::DefaultRouting,
9667                _ => Self::UnknownValue(other_routes::UnknownValue(
9668                    wkt::internal::UnknownEnumValue::Integer(value),
9669                )),
9670            }
9671        }
9672    }
9673
9674    impl std::convert::From<&str> for OtherRoutes {
9675        fn from(value: &str) -> Self {
9676            use std::string::ToString;
9677            match value {
9678                "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
9679                "DEFAULT_ROUTING" => Self::DefaultRouting,
9680                _ => Self::UnknownValue(other_routes::UnknownValue(
9681                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9682                )),
9683            }
9684        }
9685    }
9686
9687    impl serde::ser::Serialize for OtherRoutes {
9688        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9689        where
9690            S: serde::Serializer,
9691        {
9692            match self {
9693                Self::Unspecified => serializer.serialize_i32(0),
9694                Self::DefaultRouting => serializer.serialize_i32(1),
9695                Self::UnknownValue(u) => u.0.serialize(serializer),
9696            }
9697        }
9698    }
9699
9700    impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
9701        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9702        where
9703            D: serde::Deserializer<'de>,
9704        {
9705            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
9706                ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
9707            ))
9708        }
9709    }
9710
9711    /// Target specifies network endpoints that this policy-based route applies to.
9712    /// If no target is specified, the PBR will be installed on all network
9713    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
9714    #[serde_with::serde_as]
9715    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9716    #[serde(rename_all = "camelCase")]
9717    #[non_exhaustive]
9718    pub enum Target {
9719        /// Optional. VM instances that this policy-based route applies to.
9720        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
9721        /// Optional. The interconnect attachments that this policy-based route
9722        /// applies to.
9723        InterconnectAttachment(
9724            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
9725        ),
9726    }
9727
9728    #[serde_with::serde_as]
9729    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9730    #[serde(rename_all = "camelCase")]
9731    #[non_exhaustive]
9732    pub enum NextHop {
9733        /// Optional. The IP address of a global-access-enabled L4 ILB that is the
9734        /// next hop for matching packets. For this version, only nextHopIlbIp is
9735        /// supported.
9736        NextHopIlbIp(std::string::String),
9737        /// Optional. Other routes that will be referenced to determine the next hop
9738        /// of the packet.
9739        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
9740    }
9741}
9742
9743/// Request for
9744/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
9745/// method.
9746///
9747/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
9748#[serde_with::serde_as]
9749#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9750#[serde(default, rename_all = "camelCase")]
9751#[non_exhaustive]
9752pub struct ListPolicyBasedRoutesRequest {
9753    /// Required. The parent resource's name.
9754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9755    pub parent: std::string::String,
9756
9757    /// The maximum number of results per page that should be returned.
9758    #[serde(skip_serializing_if = "wkt::internal::is_default")]
9759    pub page_size: i32,
9760
9761    /// The page token.
9762    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9763    pub page_token: std::string::String,
9764
9765    /// A filter expression that filters the results listed in the response.
9766    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9767    pub filter: std::string::String,
9768
9769    /// Sort the results by a certain order.
9770    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9771    pub order_by: std::string::String,
9772
9773    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9774    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9775}
9776
9777impl ListPolicyBasedRoutesRequest {
9778    pub fn new() -> Self {
9779        std::default::Default::default()
9780    }
9781
9782    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
9783    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9784        self.parent = v.into();
9785        self
9786    }
9787
9788    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
9789    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9790        self.page_size = v.into();
9791        self
9792    }
9793
9794    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
9795    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9796        self.page_token = v.into();
9797        self
9798    }
9799
9800    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
9801    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9802        self.filter = v.into();
9803        self
9804    }
9805
9806    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
9807    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9808        self.order_by = v.into();
9809        self
9810    }
9811}
9812
9813impl wkt::message::Message for ListPolicyBasedRoutesRequest {
9814    fn typename() -> &'static str {
9815        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
9816    }
9817}
9818
9819/// Response for
9820/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
9821/// method.
9822///
9823/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
9824#[serde_with::serde_as]
9825#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9826#[serde(default, rename_all = "camelCase")]
9827#[non_exhaustive]
9828pub struct ListPolicyBasedRoutesResponse {
9829    /// Policy-based routes to be returned.
9830    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9831    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
9832
9833    /// The next pagination token in the List response. It should be used as
9834    /// page_token for the following request. An empty value means no more result.
9835    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9836    pub next_page_token: std::string::String,
9837
9838    /// Locations that could not be reached.
9839    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9840    pub unreachable: std::vec::Vec<std::string::String>,
9841
9842    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9843    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9844}
9845
9846impl ListPolicyBasedRoutesResponse {
9847    pub fn new() -> Self {
9848        std::default::Default::default()
9849    }
9850
9851    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
9852    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
9853    where
9854        T: std::iter::IntoIterator<Item = V>,
9855        V: std::convert::Into<crate::model::PolicyBasedRoute>,
9856    {
9857        use std::iter::Iterator;
9858        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
9859        self
9860    }
9861
9862    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
9863    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9864        self.next_page_token = v.into();
9865        self
9866    }
9867
9868    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
9869    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9870    where
9871        T: std::iter::IntoIterator<Item = V>,
9872        V: std::convert::Into<std::string::String>,
9873    {
9874        use std::iter::Iterator;
9875        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9876        self
9877    }
9878}
9879
9880impl wkt::message::Message for ListPolicyBasedRoutesResponse {
9881    fn typename() -> &'static str {
9882        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
9883    }
9884}
9885
9886#[doc(hidden)]
9887impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
9888    type PageItem = crate::model::PolicyBasedRoute;
9889
9890    fn items(self) -> std::vec::Vec<Self::PageItem> {
9891        self.policy_based_routes
9892    }
9893
9894    fn next_page_token(&self) -> std::string::String {
9895        use std::clone::Clone;
9896        self.next_page_token.clone()
9897    }
9898}
9899
9900/// Request for
9901/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
9902/// method.
9903///
9904/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
9905#[serde_with::serde_as]
9906#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9907#[serde(default, rename_all = "camelCase")]
9908#[non_exhaustive]
9909pub struct GetPolicyBasedRouteRequest {
9910    /// Required. Name of the PolicyBasedRoute resource to get.
9911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9912    pub name: std::string::String,
9913
9914    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9915    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9916}
9917
9918impl GetPolicyBasedRouteRequest {
9919    pub fn new() -> Self {
9920        std::default::Default::default()
9921    }
9922
9923    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
9924    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9925        self.name = v.into();
9926        self
9927    }
9928}
9929
9930impl wkt::message::Message for GetPolicyBasedRouteRequest {
9931    fn typename() -> &'static str {
9932        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
9933    }
9934}
9935
9936/// Request for
9937/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
9938/// method.
9939///
9940/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
9941#[serde_with::serde_as]
9942#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9943#[serde(default, rename_all = "camelCase")]
9944#[non_exhaustive]
9945pub struct CreatePolicyBasedRouteRequest {
9946    /// Required. The parent resource's name of the PolicyBasedRoute.
9947    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9948    pub parent: std::string::String,
9949
9950    /// Required. Unique id for the policy-based route to create. Provided by the
9951    /// client when the resource is created. The name must comply with
9952    /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
9953    /// must be 1-63 characters long and match the regular expression
9954    /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
9955    /// and all following characters (except for the last character) must be a
9956    /// dash, lowercase letter, or digit. The last character must be a lowercase
9957    /// letter or digit.
9958    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9959    pub policy_based_route_id: std::string::String,
9960
9961    /// Required. Initial values for a new policy-based route.
9962    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9963    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
9964
9965    /// Optional. An optional request ID to identify requests. Specify a unique
9966    /// request ID so that if you must retry your request, the server knows to
9967    /// ignore the request if it has already been completed. The server guarantees
9968    /// that for at least 60 minutes since the first request.
9969    ///
9970    /// For example, consider a situation where you make an initial request and
9971    /// the request times out. If you make the request again with the same request
9972    /// ID, the server can check if original operation with the same request ID
9973    /// was received, and if so, ignores the second request. This prevents clients
9974    /// from accidentally creating duplicate commitments.
9975    ///
9976    /// The request ID must be a valid UUID with the exception that zero UUID is
9977    /// not supported (00000000-0000-0000-0000-000000000000).
9978    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9979    pub request_id: std::string::String,
9980
9981    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9982    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9983}
9984
9985impl CreatePolicyBasedRouteRequest {
9986    pub fn new() -> Self {
9987        std::default::Default::default()
9988    }
9989
9990    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
9991    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9992        self.parent = v.into();
9993        self
9994    }
9995
9996    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
9997    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
9998        mut self,
9999        v: T,
10000    ) -> Self {
10001        self.policy_based_route_id = v.into();
10002        self
10003    }
10004
10005    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10006    pub fn set_policy_based_route<
10007        T: std::convert::Into<std::option::Option<crate::model::PolicyBasedRoute>>,
10008    >(
10009        mut self,
10010        v: T,
10011    ) -> Self {
10012        self.policy_based_route = v.into();
10013        self
10014    }
10015
10016    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10017    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10018        self.request_id = v.into();
10019        self
10020    }
10021}
10022
10023impl wkt::message::Message for CreatePolicyBasedRouteRequest {
10024    fn typename() -> &'static str {
10025        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
10026    }
10027}
10028
10029/// Request for
10030/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
10031/// method.
10032///
10033/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
10034#[serde_with::serde_as]
10035#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10036#[serde(default, rename_all = "camelCase")]
10037#[non_exhaustive]
10038pub struct DeletePolicyBasedRouteRequest {
10039    /// Required. Name of the policy-based route resource to delete.
10040    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10041    pub name: std::string::String,
10042
10043    /// Optional. An optional request ID to identify requests. Specify a unique
10044    /// request ID so that if you must retry your request, the server knows to
10045    /// ignore the request if it has already been completed. The server guarantees
10046    /// that for at least 60 minutes after the first request.
10047    ///
10048    /// For example, consider a situation where you make an initial request and
10049    /// the request times out. If you make the request again with the same request
10050    /// ID, the server can check if original operation with the same request ID
10051    /// was received, and if so, ignores the second request. This prevents clients
10052    /// from accidentally creating duplicate commitments.
10053    ///
10054    /// The request ID must be a valid UUID with the exception that zero UUID is
10055    /// not supported (00000000-0000-0000-0000-000000000000).
10056    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10057    pub request_id: std::string::String,
10058
10059    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10060    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10061}
10062
10063impl DeletePolicyBasedRouteRequest {
10064    pub fn new() -> Self {
10065        std::default::Default::default()
10066    }
10067
10068    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10069    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070        self.name = v.into();
10071        self
10072    }
10073
10074    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10075    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10076        self.request_id = v.into();
10077        self
10078    }
10079}
10080
10081impl wkt::message::Message for DeletePolicyBasedRouteRequest {
10082    fn typename() -> &'static str {
10083        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
10084    }
10085}
10086
10087/// The infrastructure used for connections between consumers/producers.
10088///
10089/// # Working with unknown values
10090///
10091/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10092/// additional enum variants at any time. Adding new variants is not considered
10093/// a breaking change. Applications should write their code in anticipation of:
10094///
10095/// - New values appearing in future releases of the client library, **and**
10096/// - New values received dynamically, without application changes.
10097///
10098/// Please consult the [Working with enums] section in the user guide for some
10099/// guidelines.
10100///
10101/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10102#[derive(Clone, Debug, PartialEq)]
10103#[non_exhaustive]
10104pub enum Infrastructure {
10105    /// An invalid infrastructure as the default case.
10106    Unspecified,
10107    /// Private Service Connect is used for connections.
10108    Psc,
10109    /// If set, the enum was initialized with an unknown value.
10110    ///
10111    /// Applications can examine the value using [Infrastructure::value] or
10112    /// [Infrastructure::name].
10113    UnknownValue(infrastructure::UnknownValue),
10114}
10115
10116#[doc(hidden)]
10117pub mod infrastructure {
10118    #[allow(unused_imports)]
10119    use super::*;
10120    #[derive(Clone, Debug, PartialEq)]
10121    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10122}
10123
10124impl Infrastructure {
10125    /// Gets the enum value.
10126    ///
10127    /// Returns `None` if the enum contains an unknown value deserialized from
10128    /// the string representation of enums.
10129    pub fn value(&self) -> std::option::Option<i32> {
10130        match self {
10131            Self::Unspecified => std::option::Option::Some(0),
10132            Self::Psc => std::option::Option::Some(1),
10133            Self::UnknownValue(u) => u.0.value(),
10134        }
10135    }
10136
10137    /// Gets the enum value as a string.
10138    ///
10139    /// Returns `None` if the enum contains an unknown value deserialized from
10140    /// the integer representation of enums.
10141    pub fn name(&self) -> std::option::Option<&str> {
10142        match self {
10143            Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
10144            Self::Psc => std::option::Option::Some("PSC"),
10145            Self::UnknownValue(u) => u.0.name(),
10146        }
10147    }
10148}
10149
10150impl std::default::Default for Infrastructure {
10151    fn default() -> Self {
10152        use std::convert::From;
10153        Self::from(0)
10154    }
10155}
10156
10157impl std::fmt::Display for Infrastructure {
10158    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10159        wkt::internal::display_enum(f, self.name(), self.value())
10160    }
10161}
10162
10163impl std::convert::From<i32> for Infrastructure {
10164    fn from(value: i32) -> Self {
10165        match value {
10166            0 => Self::Unspecified,
10167            1 => Self::Psc,
10168            _ => Self::UnknownValue(infrastructure::UnknownValue(
10169                wkt::internal::UnknownEnumValue::Integer(value),
10170            )),
10171        }
10172    }
10173}
10174
10175impl std::convert::From<&str> for Infrastructure {
10176    fn from(value: &str) -> Self {
10177        use std::string::ToString;
10178        match value {
10179            "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
10180            "PSC" => Self::Psc,
10181            _ => Self::UnknownValue(infrastructure::UnknownValue(
10182                wkt::internal::UnknownEnumValue::String(value.to_string()),
10183            )),
10184        }
10185    }
10186}
10187
10188impl serde::ser::Serialize for Infrastructure {
10189    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10190    where
10191        S: serde::Serializer,
10192    {
10193        match self {
10194            Self::Unspecified => serializer.serialize_i32(0),
10195            Self::Psc => serializer.serialize_i32(1),
10196            Self::UnknownValue(u) => u.0.serialize(serializer),
10197        }
10198    }
10199}
10200
10201impl<'de> serde::de::Deserialize<'de> for Infrastructure {
10202    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10203    where
10204        D: serde::Deserializer<'de>,
10205    {
10206        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
10207            ".google.cloud.networkconnectivity.v1.Infrastructure",
10208        ))
10209    }
10210}
10211
10212/// The error type indicates whether a connection error is consumer facing,
10213/// producer facing or system internal.
10214///
10215/// # Working with unknown values
10216///
10217/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10218/// additional enum variants at any time. Adding new variants is not considered
10219/// a breaking change. Applications should write their code in anticipation of:
10220///
10221/// - New values appearing in future releases of the client library, **and**
10222/// - New values received dynamically, without application changes.
10223///
10224/// Please consult the [Working with enums] section in the user guide for some
10225/// guidelines.
10226///
10227/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10228#[derive(Clone, Debug, PartialEq)]
10229#[non_exhaustive]
10230pub enum ConnectionErrorType {
10231    /// An invalid error type as the default case.
10232    Unspecified,
10233    /// The error is due to Service Automation system internal.
10234    ErrorInternal,
10235    /// The error is due to the setup on consumer side.
10236    ErrorConsumerSide,
10237    /// The error is due to the setup on producer side.
10238    ErrorProducerSide,
10239    /// If set, the enum was initialized with an unknown value.
10240    ///
10241    /// Applications can examine the value using [ConnectionErrorType::value] or
10242    /// [ConnectionErrorType::name].
10243    UnknownValue(connection_error_type::UnknownValue),
10244}
10245
10246#[doc(hidden)]
10247pub mod connection_error_type {
10248    #[allow(unused_imports)]
10249    use super::*;
10250    #[derive(Clone, Debug, PartialEq)]
10251    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10252}
10253
10254impl ConnectionErrorType {
10255    /// Gets the enum value.
10256    ///
10257    /// Returns `None` if the enum contains an unknown value deserialized from
10258    /// the string representation of enums.
10259    pub fn value(&self) -> std::option::Option<i32> {
10260        match self {
10261            Self::Unspecified => std::option::Option::Some(0),
10262            Self::ErrorInternal => std::option::Option::Some(1),
10263            Self::ErrorConsumerSide => std::option::Option::Some(2),
10264            Self::ErrorProducerSide => std::option::Option::Some(3),
10265            Self::UnknownValue(u) => u.0.value(),
10266        }
10267    }
10268
10269    /// Gets the enum value as a string.
10270    ///
10271    /// Returns `None` if the enum contains an unknown value deserialized from
10272    /// the integer representation of enums.
10273    pub fn name(&self) -> std::option::Option<&str> {
10274        match self {
10275            Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
10276            Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
10277            Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
10278            Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
10279            Self::UnknownValue(u) => u.0.name(),
10280        }
10281    }
10282}
10283
10284impl std::default::Default for ConnectionErrorType {
10285    fn default() -> Self {
10286        use std::convert::From;
10287        Self::from(0)
10288    }
10289}
10290
10291impl std::fmt::Display for ConnectionErrorType {
10292    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10293        wkt::internal::display_enum(f, self.name(), self.value())
10294    }
10295}
10296
10297impl std::convert::From<i32> for ConnectionErrorType {
10298    fn from(value: i32) -> Self {
10299        match value {
10300            0 => Self::Unspecified,
10301            1 => Self::ErrorInternal,
10302            2 => Self::ErrorConsumerSide,
10303            3 => Self::ErrorProducerSide,
10304            _ => Self::UnknownValue(connection_error_type::UnknownValue(
10305                wkt::internal::UnknownEnumValue::Integer(value),
10306            )),
10307        }
10308    }
10309}
10310
10311impl std::convert::From<&str> for ConnectionErrorType {
10312    fn from(value: &str) -> Self {
10313        use std::string::ToString;
10314        match value {
10315            "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
10316            "ERROR_INTERNAL" => Self::ErrorInternal,
10317            "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
10318            "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
10319            _ => Self::UnknownValue(connection_error_type::UnknownValue(
10320                wkt::internal::UnknownEnumValue::String(value.to_string()),
10321            )),
10322        }
10323    }
10324}
10325
10326impl serde::ser::Serialize for ConnectionErrorType {
10327    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10328    where
10329        S: serde::Serializer,
10330    {
10331        match self {
10332            Self::Unspecified => serializer.serialize_i32(0),
10333            Self::ErrorInternal => serializer.serialize_i32(1),
10334            Self::ErrorConsumerSide => serializer.serialize_i32(2),
10335            Self::ErrorProducerSide => serializer.serialize_i32(3),
10336            Self::UnknownValue(u) => u.0.serialize(serializer),
10337        }
10338    }
10339}
10340
10341impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
10342    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10343    where
10344        D: serde::Deserializer<'de>,
10345    {
10346        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
10347            ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
10348        ))
10349    }
10350}
10351
10352/// The requested IP version for the PSC connection.
10353///
10354/// # Working with unknown values
10355///
10356/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10357/// additional enum variants at any time. Adding new variants is not considered
10358/// a breaking change. Applications should write their code in anticipation of:
10359///
10360/// - New values appearing in future releases of the client library, **and**
10361/// - New values received dynamically, without application changes.
10362///
10363/// Please consult the [Working with enums] section in the user guide for some
10364/// guidelines.
10365///
10366/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10367#[derive(Clone, Debug, PartialEq)]
10368#[non_exhaustive]
10369pub enum IPVersion {
10370    /// Default value. We will use IPv4 or IPv6 depending on the IP version of
10371    /// first available subnetwork.
10372    Unspecified,
10373    /// Will use IPv4 only.
10374    Ipv4,
10375    /// Will use IPv6 only.
10376    Ipv6,
10377    /// If set, the enum was initialized with an unknown value.
10378    ///
10379    /// Applications can examine the value using [IPVersion::value] or
10380    /// [IPVersion::name].
10381    UnknownValue(ip_version::UnknownValue),
10382}
10383
10384#[doc(hidden)]
10385pub mod ip_version {
10386    #[allow(unused_imports)]
10387    use super::*;
10388    #[derive(Clone, Debug, PartialEq)]
10389    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10390}
10391
10392impl IPVersion {
10393    /// Gets the enum value.
10394    ///
10395    /// Returns `None` if the enum contains an unknown value deserialized from
10396    /// the string representation of enums.
10397    pub fn value(&self) -> std::option::Option<i32> {
10398        match self {
10399            Self::Unspecified => std::option::Option::Some(0),
10400            Self::Ipv4 => std::option::Option::Some(1),
10401            Self::Ipv6 => std::option::Option::Some(2),
10402            Self::UnknownValue(u) => u.0.value(),
10403        }
10404    }
10405
10406    /// Gets the enum value as a string.
10407    ///
10408    /// Returns `None` if the enum contains an unknown value deserialized from
10409    /// the integer representation of enums.
10410    pub fn name(&self) -> std::option::Option<&str> {
10411        match self {
10412            Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
10413            Self::Ipv4 => std::option::Option::Some("IPV4"),
10414            Self::Ipv6 => std::option::Option::Some("IPV6"),
10415            Self::UnknownValue(u) => u.0.name(),
10416        }
10417    }
10418}
10419
10420impl std::default::Default for IPVersion {
10421    fn default() -> Self {
10422        use std::convert::From;
10423        Self::from(0)
10424    }
10425}
10426
10427impl std::fmt::Display for IPVersion {
10428    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10429        wkt::internal::display_enum(f, self.name(), self.value())
10430    }
10431}
10432
10433impl std::convert::From<i32> for IPVersion {
10434    fn from(value: i32) -> Self {
10435        match value {
10436            0 => Self::Unspecified,
10437            1 => Self::Ipv4,
10438            2 => Self::Ipv6,
10439            _ => Self::UnknownValue(ip_version::UnknownValue(
10440                wkt::internal::UnknownEnumValue::Integer(value),
10441            )),
10442        }
10443    }
10444}
10445
10446impl std::convert::From<&str> for IPVersion {
10447    fn from(value: &str) -> Self {
10448        use std::string::ToString;
10449        match value {
10450            "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
10451            "IPV4" => Self::Ipv4,
10452            "IPV6" => Self::Ipv6,
10453            _ => Self::UnknownValue(ip_version::UnknownValue(
10454                wkt::internal::UnknownEnumValue::String(value.to_string()),
10455            )),
10456        }
10457    }
10458}
10459
10460impl serde::ser::Serialize for IPVersion {
10461    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10462    where
10463        S: serde::Serializer,
10464    {
10465        match self {
10466            Self::Unspecified => serializer.serialize_i32(0),
10467            Self::Ipv4 => serializer.serialize_i32(1),
10468            Self::Ipv6 => serializer.serialize_i32(2),
10469            Self::UnknownValue(u) => u.0.serialize(serializer),
10470        }
10471    }
10472}
10473
10474impl<'de> serde::de::Deserialize<'de> for IPVersion {
10475    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10476    where
10477        D: serde::Deserializer<'de>,
10478    {
10479        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
10480            ".google.cloud.networkconnectivity.v1.IPVersion",
10481        ))
10482    }
10483}
10484
10485/// Supported features for a location
10486///
10487/// # Working with unknown values
10488///
10489/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10490/// additional enum variants at any time. Adding new variants is not considered
10491/// a breaking change. Applications should write their code in anticipation of:
10492///
10493/// - New values appearing in future releases of the client library, **and**
10494/// - New values received dynamically, without application changes.
10495///
10496/// Please consult the [Working with enums] section in the user guide for some
10497/// guidelines.
10498///
10499/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10500#[derive(Clone, Debug, PartialEq)]
10501#[non_exhaustive]
10502pub enum LocationFeature {
10503    /// No publicly supported feature in this location
10504    Unspecified,
10505    /// Site-to-cloud spokes are supported in this location
10506    SiteToCloudSpokes,
10507    /// Site-to-site spokes are supported in this location
10508    SiteToSiteSpokes,
10509    /// If set, the enum was initialized with an unknown value.
10510    ///
10511    /// Applications can examine the value using [LocationFeature::value] or
10512    /// [LocationFeature::name].
10513    UnknownValue(location_feature::UnknownValue),
10514}
10515
10516#[doc(hidden)]
10517pub mod location_feature {
10518    #[allow(unused_imports)]
10519    use super::*;
10520    #[derive(Clone, Debug, PartialEq)]
10521    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10522}
10523
10524impl LocationFeature {
10525    /// Gets the enum value.
10526    ///
10527    /// Returns `None` if the enum contains an unknown value deserialized from
10528    /// the string representation of enums.
10529    pub fn value(&self) -> std::option::Option<i32> {
10530        match self {
10531            Self::Unspecified => std::option::Option::Some(0),
10532            Self::SiteToCloudSpokes => std::option::Option::Some(1),
10533            Self::SiteToSiteSpokes => std::option::Option::Some(2),
10534            Self::UnknownValue(u) => u.0.value(),
10535        }
10536    }
10537
10538    /// Gets the enum value as a string.
10539    ///
10540    /// Returns `None` if the enum contains an unknown value deserialized from
10541    /// the integer representation of enums.
10542    pub fn name(&self) -> std::option::Option<&str> {
10543        match self {
10544            Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
10545            Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
10546            Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
10547            Self::UnknownValue(u) => u.0.name(),
10548        }
10549    }
10550}
10551
10552impl std::default::Default for LocationFeature {
10553    fn default() -> Self {
10554        use std::convert::From;
10555        Self::from(0)
10556    }
10557}
10558
10559impl std::fmt::Display for LocationFeature {
10560    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10561        wkt::internal::display_enum(f, self.name(), self.value())
10562    }
10563}
10564
10565impl std::convert::From<i32> for LocationFeature {
10566    fn from(value: i32) -> Self {
10567        match value {
10568            0 => Self::Unspecified,
10569            1 => Self::SiteToCloudSpokes,
10570            2 => Self::SiteToSiteSpokes,
10571            _ => Self::UnknownValue(location_feature::UnknownValue(
10572                wkt::internal::UnknownEnumValue::Integer(value),
10573            )),
10574        }
10575    }
10576}
10577
10578impl std::convert::From<&str> for LocationFeature {
10579    fn from(value: &str) -> Self {
10580        use std::string::ToString;
10581        match value {
10582            "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
10583            "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
10584            "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
10585            _ => Self::UnknownValue(location_feature::UnknownValue(
10586                wkt::internal::UnknownEnumValue::String(value.to_string()),
10587            )),
10588        }
10589    }
10590}
10591
10592impl serde::ser::Serialize for LocationFeature {
10593    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10594    where
10595        S: serde::Serializer,
10596    {
10597        match self {
10598            Self::Unspecified => serializer.serialize_i32(0),
10599            Self::SiteToCloudSpokes => serializer.serialize_i32(1),
10600            Self::SiteToSiteSpokes => serializer.serialize_i32(2),
10601            Self::UnknownValue(u) => u.0.serialize(serializer),
10602        }
10603    }
10604}
10605
10606impl<'de> serde::de::Deserialize<'de> for LocationFeature {
10607    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10608    where
10609        D: serde::Deserializer<'de>,
10610    {
10611        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
10612            ".google.cloud.networkconnectivity.v1.LocationFeature",
10613        ))
10614    }
10615}
10616
10617/// The route's type
10618///
10619/// # Working with unknown values
10620///
10621/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10622/// additional enum variants at any time. Adding new variants is not considered
10623/// a breaking change. Applications should write their code in anticipation of:
10624///
10625/// - New values appearing in future releases of the client library, **and**
10626/// - New values received dynamically, without application changes.
10627///
10628/// Please consult the [Working with enums] section in the user guide for some
10629/// guidelines.
10630///
10631/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10632#[derive(Clone, Debug, PartialEq)]
10633#[non_exhaustive]
10634pub enum RouteType {
10635    /// No route type information specified
10636    Unspecified,
10637    /// The route leads to a destination within the primary address range of the
10638    /// VPC network's subnet.
10639    VpcPrimarySubnet,
10640    /// The route leads to a destination within the secondary address range of the
10641    /// VPC network's subnet.
10642    VpcSecondarySubnet,
10643    /// The route leads to a destination in a dynamic route. Dynamic routes are
10644    /// derived from Border Gateway Protocol (BGP) advertisements received from an
10645    /// NCC hybrid spoke.
10646    DynamicRoute,
10647    /// If set, the enum was initialized with an unknown value.
10648    ///
10649    /// Applications can examine the value using [RouteType::value] or
10650    /// [RouteType::name].
10651    UnknownValue(route_type::UnknownValue),
10652}
10653
10654#[doc(hidden)]
10655pub mod route_type {
10656    #[allow(unused_imports)]
10657    use super::*;
10658    #[derive(Clone, Debug, PartialEq)]
10659    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10660}
10661
10662impl RouteType {
10663    /// Gets the enum value.
10664    ///
10665    /// Returns `None` if the enum contains an unknown value deserialized from
10666    /// the string representation of enums.
10667    pub fn value(&self) -> std::option::Option<i32> {
10668        match self {
10669            Self::Unspecified => std::option::Option::Some(0),
10670            Self::VpcPrimarySubnet => std::option::Option::Some(1),
10671            Self::VpcSecondarySubnet => std::option::Option::Some(2),
10672            Self::DynamicRoute => std::option::Option::Some(3),
10673            Self::UnknownValue(u) => u.0.value(),
10674        }
10675    }
10676
10677    /// Gets the enum value as a string.
10678    ///
10679    /// Returns `None` if the enum contains an unknown value deserialized from
10680    /// the integer representation of enums.
10681    pub fn name(&self) -> std::option::Option<&str> {
10682        match self {
10683            Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
10684            Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
10685            Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
10686            Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
10687            Self::UnknownValue(u) => u.0.name(),
10688        }
10689    }
10690}
10691
10692impl std::default::Default for RouteType {
10693    fn default() -> Self {
10694        use std::convert::From;
10695        Self::from(0)
10696    }
10697}
10698
10699impl std::fmt::Display for RouteType {
10700    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10701        wkt::internal::display_enum(f, self.name(), self.value())
10702    }
10703}
10704
10705impl std::convert::From<i32> for RouteType {
10706    fn from(value: i32) -> Self {
10707        match value {
10708            0 => Self::Unspecified,
10709            1 => Self::VpcPrimarySubnet,
10710            2 => Self::VpcSecondarySubnet,
10711            3 => Self::DynamicRoute,
10712            _ => Self::UnknownValue(route_type::UnknownValue(
10713                wkt::internal::UnknownEnumValue::Integer(value),
10714            )),
10715        }
10716    }
10717}
10718
10719impl std::convert::From<&str> for RouteType {
10720    fn from(value: &str) -> Self {
10721        use std::string::ToString;
10722        match value {
10723            "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
10724            "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
10725            "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
10726            "DYNAMIC_ROUTE" => Self::DynamicRoute,
10727            _ => Self::UnknownValue(route_type::UnknownValue(
10728                wkt::internal::UnknownEnumValue::String(value.to_string()),
10729            )),
10730        }
10731    }
10732}
10733
10734impl serde::ser::Serialize for RouteType {
10735    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10736    where
10737        S: serde::Serializer,
10738    {
10739        match self {
10740            Self::Unspecified => serializer.serialize_i32(0),
10741            Self::VpcPrimarySubnet => serializer.serialize_i32(1),
10742            Self::VpcSecondarySubnet => serializer.serialize_i32(2),
10743            Self::DynamicRoute => serializer.serialize_i32(3),
10744            Self::UnknownValue(u) => u.0.serialize(serializer),
10745        }
10746    }
10747}
10748
10749impl<'de> serde::de::Deserialize<'de> for RouteType {
10750    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10751    where
10752        D: serde::Deserializer<'de>,
10753    {
10754        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
10755            ".google.cloud.networkconnectivity.v1.RouteType",
10756        ))
10757    }
10758}
10759
10760/// The State enum represents the lifecycle stage of a Network Connectivity
10761/// Center resource.
10762///
10763/// # Working with unknown values
10764///
10765/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10766/// additional enum variants at any time. Adding new variants is not considered
10767/// a breaking change. Applications should write their code in anticipation of:
10768///
10769/// - New values appearing in future releases of the client library, **and**
10770/// - New values received dynamically, without application changes.
10771///
10772/// Please consult the [Working with enums] section in the user guide for some
10773/// guidelines.
10774///
10775/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10776#[derive(Clone, Debug, PartialEq)]
10777#[non_exhaustive]
10778pub enum State {
10779    /// No state information available
10780    Unspecified,
10781    /// The resource's create operation is in progress.
10782    Creating,
10783    /// The resource is active
10784    Active,
10785    /// The resource's delete operation is in progress.
10786    Deleting,
10787    /// The resource's accept operation is in progress.
10788    Accepting,
10789    /// The resource's reject operation is in progress.
10790    Rejecting,
10791    /// The resource's update operation is in progress.
10792    Updating,
10793    /// The resource is inactive.
10794    Inactive,
10795    /// The hub associated with this spoke resource has been deleted.
10796    /// This state applies to spoke resources only.
10797    Obsolete,
10798    /// The resource is in an undefined state due to resource creation or deletion
10799    /// failure. You can try to delete the resource later or contact support for
10800    /// help.
10801    Failed,
10802    /// If set, the enum was initialized with an unknown value.
10803    ///
10804    /// Applications can examine the value using [State::value] or
10805    /// [State::name].
10806    UnknownValue(state::UnknownValue),
10807}
10808
10809#[doc(hidden)]
10810pub mod state {
10811    #[allow(unused_imports)]
10812    use super::*;
10813    #[derive(Clone, Debug, PartialEq)]
10814    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10815}
10816
10817impl State {
10818    /// Gets the enum value.
10819    ///
10820    /// Returns `None` if the enum contains an unknown value deserialized from
10821    /// the string representation of enums.
10822    pub fn value(&self) -> std::option::Option<i32> {
10823        match self {
10824            Self::Unspecified => std::option::Option::Some(0),
10825            Self::Creating => std::option::Option::Some(1),
10826            Self::Active => std::option::Option::Some(2),
10827            Self::Deleting => std::option::Option::Some(3),
10828            Self::Accepting => std::option::Option::Some(8),
10829            Self::Rejecting => std::option::Option::Some(9),
10830            Self::Updating => std::option::Option::Some(6),
10831            Self::Inactive => std::option::Option::Some(7),
10832            Self::Obsolete => std::option::Option::Some(10),
10833            Self::Failed => std::option::Option::Some(11),
10834            Self::UnknownValue(u) => u.0.value(),
10835        }
10836    }
10837
10838    /// Gets the enum value as a string.
10839    ///
10840    /// Returns `None` if the enum contains an unknown value deserialized from
10841    /// the integer representation of enums.
10842    pub fn name(&self) -> std::option::Option<&str> {
10843        match self {
10844            Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10845            Self::Creating => std::option::Option::Some("CREATING"),
10846            Self::Active => std::option::Option::Some("ACTIVE"),
10847            Self::Deleting => std::option::Option::Some("DELETING"),
10848            Self::Accepting => std::option::Option::Some("ACCEPTING"),
10849            Self::Rejecting => std::option::Option::Some("REJECTING"),
10850            Self::Updating => std::option::Option::Some("UPDATING"),
10851            Self::Inactive => std::option::Option::Some("INACTIVE"),
10852            Self::Obsolete => std::option::Option::Some("OBSOLETE"),
10853            Self::Failed => std::option::Option::Some("FAILED"),
10854            Self::UnknownValue(u) => u.0.name(),
10855        }
10856    }
10857}
10858
10859impl std::default::Default for State {
10860    fn default() -> Self {
10861        use std::convert::From;
10862        Self::from(0)
10863    }
10864}
10865
10866impl std::fmt::Display for State {
10867    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10868        wkt::internal::display_enum(f, self.name(), self.value())
10869    }
10870}
10871
10872impl std::convert::From<i32> for State {
10873    fn from(value: i32) -> Self {
10874        match value {
10875            0 => Self::Unspecified,
10876            1 => Self::Creating,
10877            2 => Self::Active,
10878            3 => Self::Deleting,
10879            6 => Self::Updating,
10880            7 => Self::Inactive,
10881            8 => Self::Accepting,
10882            9 => Self::Rejecting,
10883            10 => Self::Obsolete,
10884            11 => Self::Failed,
10885            _ => Self::UnknownValue(state::UnknownValue(
10886                wkt::internal::UnknownEnumValue::Integer(value),
10887            )),
10888        }
10889    }
10890}
10891
10892impl std::convert::From<&str> for State {
10893    fn from(value: &str) -> Self {
10894        use std::string::ToString;
10895        match value {
10896            "STATE_UNSPECIFIED" => Self::Unspecified,
10897            "CREATING" => Self::Creating,
10898            "ACTIVE" => Self::Active,
10899            "DELETING" => Self::Deleting,
10900            "ACCEPTING" => Self::Accepting,
10901            "REJECTING" => Self::Rejecting,
10902            "UPDATING" => Self::Updating,
10903            "INACTIVE" => Self::Inactive,
10904            "OBSOLETE" => Self::Obsolete,
10905            "FAILED" => Self::Failed,
10906            _ => Self::UnknownValue(state::UnknownValue(
10907                wkt::internal::UnknownEnumValue::String(value.to_string()),
10908            )),
10909        }
10910    }
10911}
10912
10913impl serde::ser::Serialize for State {
10914    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10915    where
10916        S: serde::Serializer,
10917    {
10918        match self {
10919            Self::Unspecified => serializer.serialize_i32(0),
10920            Self::Creating => serializer.serialize_i32(1),
10921            Self::Active => serializer.serialize_i32(2),
10922            Self::Deleting => serializer.serialize_i32(3),
10923            Self::Accepting => serializer.serialize_i32(8),
10924            Self::Rejecting => serializer.serialize_i32(9),
10925            Self::Updating => serializer.serialize_i32(6),
10926            Self::Inactive => serializer.serialize_i32(7),
10927            Self::Obsolete => serializer.serialize_i32(10),
10928            Self::Failed => serializer.serialize_i32(11),
10929            Self::UnknownValue(u) => u.0.serialize(serializer),
10930        }
10931    }
10932}
10933
10934impl<'de> serde::de::Deserialize<'de> for State {
10935    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10936    where
10937        D: serde::Deserializer<'de>,
10938    {
10939        deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10940            ".google.cloud.networkconnectivity.v1.State",
10941        ))
10942    }
10943}
10944
10945/// The SpokeType enum represents the type of spoke. The type
10946/// reflects the kind of resource that a spoke is associated with.
10947///
10948/// # Working with unknown values
10949///
10950/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10951/// additional enum variants at any time. Adding new variants is not considered
10952/// a breaking change. Applications should write their code in anticipation of:
10953///
10954/// - New values appearing in future releases of the client library, **and**
10955/// - New values received dynamically, without application changes.
10956///
10957/// Please consult the [Working with enums] section in the user guide for some
10958/// guidelines.
10959///
10960/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10961#[derive(Clone, Debug, PartialEq)]
10962#[non_exhaustive]
10963pub enum SpokeType {
10964    /// Unspecified spoke type.
10965    Unspecified,
10966    /// Spokes associated with VPN tunnels.
10967    VpnTunnel,
10968    /// Spokes associated with VLAN attachments.
10969    InterconnectAttachment,
10970    /// Spokes associated with router appliance instances.
10971    RouterAppliance,
10972    /// Spokes associated with VPC networks.
10973    VpcNetwork,
10974    /// Spokes that are backed by a producer VPC network.
10975    ProducerVpcNetwork,
10976    /// If set, the enum was initialized with an unknown value.
10977    ///
10978    /// Applications can examine the value using [SpokeType::value] or
10979    /// [SpokeType::name].
10980    UnknownValue(spoke_type::UnknownValue),
10981}
10982
10983#[doc(hidden)]
10984pub mod spoke_type {
10985    #[allow(unused_imports)]
10986    use super::*;
10987    #[derive(Clone, Debug, PartialEq)]
10988    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10989}
10990
10991impl SpokeType {
10992    /// Gets the enum value.
10993    ///
10994    /// Returns `None` if the enum contains an unknown value deserialized from
10995    /// the string representation of enums.
10996    pub fn value(&self) -> std::option::Option<i32> {
10997        match self {
10998            Self::Unspecified => std::option::Option::Some(0),
10999            Self::VpnTunnel => std::option::Option::Some(1),
11000            Self::InterconnectAttachment => std::option::Option::Some(2),
11001            Self::RouterAppliance => std::option::Option::Some(3),
11002            Self::VpcNetwork => std::option::Option::Some(4),
11003            Self::ProducerVpcNetwork => std::option::Option::Some(7),
11004            Self::UnknownValue(u) => u.0.value(),
11005        }
11006    }
11007
11008    /// Gets the enum value as a string.
11009    ///
11010    /// Returns `None` if the enum contains an unknown value deserialized from
11011    /// the integer representation of enums.
11012    pub fn name(&self) -> std::option::Option<&str> {
11013        match self {
11014            Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
11015            Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
11016            Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
11017            Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11018            Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
11019            Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
11020            Self::UnknownValue(u) => u.0.name(),
11021        }
11022    }
11023}
11024
11025impl std::default::Default for SpokeType {
11026    fn default() -> Self {
11027        use std::convert::From;
11028        Self::from(0)
11029    }
11030}
11031
11032impl std::fmt::Display for SpokeType {
11033    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11034        wkt::internal::display_enum(f, self.name(), self.value())
11035    }
11036}
11037
11038impl std::convert::From<i32> for SpokeType {
11039    fn from(value: i32) -> Self {
11040        match value {
11041            0 => Self::Unspecified,
11042            1 => Self::VpnTunnel,
11043            2 => Self::InterconnectAttachment,
11044            3 => Self::RouterAppliance,
11045            4 => Self::VpcNetwork,
11046            7 => Self::ProducerVpcNetwork,
11047            _ => Self::UnknownValue(spoke_type::UnknownValue(
11048                wkt::internal::UnknownEnumValue::Integer(value),
11049            )),
11050        }
11051    }
11052}
11053
11054impl std::convert::From<&str> for SpokeType {
11055    fn from(value: &str) -> Self {
11056        use std::string::ToString;
11057        match value {
11058            "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
11059            "VPN_TUNNEL" => Self::VpnTunnel,
11060            "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
11061            "ROUTER_APPLIANCE" => Self::RouterAppliance,
11062            "VPC_NETWORK" => Self::VpcNetwork,
11063            "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
11064            _ => Self::UnknownValue(spoke_type::UnknownValue(
11065                wkt::internal::UnknownEnumValue::String(value.to_string()),
11066            )),
11067        }
11068    }
11069}
11070
11071impl serde::ser::Serialize for SpokeType {
11072    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11073    where
11074        S: serde::Serializer,
11075    {
11076        match self {
11077            Self::Unspecified => serializer.serialize_i32(0),
11078            Self::VpnTunnel => serializer.serialize_i32(1),
11079            Self::InterconnectAttachment => serializer.serialize_i32(2),
11080            Self::RouterAppliance => serializer.serialize_i32(3),
11081            Self::VpcNetwork => serializer.serialize_i32(4),
11082            Self::ProducerVpcNetwork => serializer.serialize_i32(7),
11083            Self::UnknownValue(u) => u.0.serialize(serializer),
11084        }
11085    }
11086}
11087
11088impl<'de> serde::de::Deserialize<'de> for SpokeType {
11089    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11090    where
11091        D: serde::Deserializer<'de>,
11092    {
11093        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
11094            ".google.cloud.networkconnectivity.v1.SpokeType",
11095        ))
11096    }
11097}
11098
11099/// This enum controls the policy mode used in a hub.
11100///
11101/// # Working with unknown values
11102///
11103/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11104/// additional enum variants at any time. Adding new variants is not considered
11105/// a breaking change. Applications should write their code in anticipation of:
11106///
11107/// - New values appearing in future releases of the client library, **and**
11108/// - New values received dynamically, without application changes.
11109///
11110/// Please consult the [Working with enums] section in the user guide for some
11111/// guidelines.
11112///
11113/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11114#[derive(Clone, Debug, PartialEq)]
11115#[non_exhaustive]
11116pub enum PolicyMode {
11117    /// Policy mode is unspecified. It defaults to PRESET
11118    /// with preset_topology = MESH.
11119    Unspecified,
11120    /// Hub uses one of the preset topologies.
11121    Preset,
11122    /// If set, the enum was initialized with an unknown value.
11123    ///
11124    /// Applications can examine the value using [PolicyMode::value] or
11125    /// [PolicyMode::name].
11126    UnknownValue(policy_mode::UnknownValue),
11127}
11128
11129#[doc(hidden)]
11130pub mod policy_mode {
11131    #[allow(unused_imports)]
11132    use super::*;
11133    #[derive(Clone, Debug, PartialEq)]
11134    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11135}
11136
11137impl PolicyMode {
11138    /// Gets the enum value.
11139    ///
11140    /// Returns `None` if the enum contains an unknown value deserialized from
11141    /// the string representation of enums.
11142    pub fn value(&self) -> std::option::Option<i32> {
11143        match self {
11144            Self::Unspecified => std::option::Option::Some(0),
11145            Self::Preset => std::option::Option::Some(1),
11146            Self::UnknownValue(u) => u.0.value(),
11147        }
11148    }
11149
11150    /// Gets the enum value as a string.
11151    ///
11152    /// Returns `None` if the enum contains an unknown value deserialized from
11153    /// the integer representation of enums.
11154    pub fn name(&self) -> std::option::Option<&str> {
11155        match self {
11156            Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
11157            Self::Preset => std::option::Option::Some("PRESET"),
11158            Self::UnknownValue(u) => u.0.name(),
11159        }
11160    }
11161}
11162
11163impl std::default::Default for PolicyMode {
11164    fn default() -> Self {
11165        use std::convert::From;
11166        Self::from(0)
11167    }
11168}
11169
11170impl std::fmt::Display for PolicyMode {
11171    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11172        wkt::internal::display_enum(f, self.name(), self.value())
11173    }
11174}
11175
11176impl std::convert::From<i32> for PolicyMode {
11177    fn from(value: i32) -> Self {
11178        match value {
11179            0 => Self::Unspecified,
11180            1 => Self::Preset,
11181            _ => Self::UnknownValue(policy_mode::UnknownValue(
11182                wkt::internal::UnknownEnumValue::Integer(value),
11183            )),
11184        }
11185    }
11186}
11187
11188impl std::convert::From<&str> for PolicyMode {
11189    fn from(value: &str) -> Self {
11190        use std::string::ToString;
11191        match value {
11192            "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
11193            "PRESET" => Self::Preset,
11194            _ => Self::UnknownValue(policy_mode::UnknownValue(
11195                wkt::internal::UnknownEnumValue::String(value.to_string()),
11196            )),
11197        }
11198    }
11199}
11200
11201impl serde::ser::Serialize for PolicyMode {
11202    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11203    where
11204        S: serde::Serializer,
11205    {
11206        match self {
11207            Self::Unspecified => serializer.serialize_i32(0),
11208            Self::Preset => serializer.serialize_i32(1),
11209            Self::UnknownValue(u) => u.0.serialize(serializer),
11210        }
11211    }
11212}
11213
11214impl<'de> serde::de::Deserialize<'de> for PolicyMode {
11215    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11216    where
11217        D: serde::Deserializer<'de>,
11218    {
11219        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
11220            ".google.cloud.networkconnectivity.v1.PolicyMode",
11221        ))
11222    }
11223}
11224
11225/// The list of available preset topologies.
11226///
11227/// # Working with unknown values
11228///
11229/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11230/// additional enum variants at any time. Adding new variants is not considered
11231/// a breaking change. Applications should write their code in anticipation of:
11232///
11233/// - New values appearing in future releases of the client library, **and**
11234/// - New values received dynamically, without application changes.
11235///
11236/// Please consult the [Working with enums] section in the user guide for some
11237/// guidelines.
11238///
11239/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11240#[derive(Clone, Debug, PartialEq)]
11241#[non_exhaustive]
11242pub enum PresetTopology {
11243    /// Preset topology is unspecified. When policy_mode = PRESET,
11244    /// it defaults to MESH.
11245    Unspecified,
11246    /// Mesh topology is implemented. Group `default` is automatically created.
11247    /// All spokes in the hub are added to group `default`.
11248    Mesh,
11249    /// Star topology is implemented. Two groups, `center` and `edge`, are
11250    /// automatically created along with hub creation. Spokes have to join one of
11251    /// the groups during creation.
11252    Star,
11253    /// If set, the enum was initialized with an unknown value.
11254    ///
11255    /// Applications can examine the value using [PresetTopology::value] or
11256    /// [PresetTopology::name].
11257    UnknownValue(preset_topology::UnknownValue),
11258}
11259
11260#[doc(hidden)]
11261pub mod preset_topology {
11262    #[allow(unused_imports)]
11263    use super::*;
11264    #[derive(Clone, Debug, PartialEq)]
11265    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11266}
11267
11268impl PresetTopology {
11269    /// Gets the enum value.
11270    ///
11271    /// Returns `None` if the enum contains an unknown value deserialized from
11272    /// the string representation of enums.
11273    pub fn value(&self) -> std::option::Option<i32> {
11274        match self {
11275            Self::Unspecified => std::option::Option::Some(0),
11276            Self::Mesh => std::option::Option::Some(2),
11277            Self::Star => std::option::Option::Some(3),
11278            Self::UnknownValue(u) => u.0.value(),
11279        }
11280    }
11281
11282    /// Gets the enum value as a string.
11283    ///
11284    /// Returns `None` if the enum contains an unknown value deserialized from
11285    /// the integer representation of enums.
11286    pub fn name(&self) -> std::option::Option<&str> {
11287        match self {
11288            Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
11289            Self::Mesh => std::option::Option::Some("MESH"),
11290            Self::Star => std::option::Option::Some("STAR"),
11291            Self::UnknownValue(u) => u.0.name(),
11292        }
11293    }
11294}
11295
11296impl std::default::Default for PresetTopology {
11297    fn default() -> Self {
11298        use std::convert::From;
11299        Self::from(0)
11300    }
11301}
11302
11303impl std::fmt::Display for PresetTopology {
11304    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11305        wkt::internal::display_enum(f, self.name(), self.value())
11306    }
11307}
11308
11309impl std::convert::From<i32> for PresetTopology {
11310    fn from(value: i32) -> Self {
11311        match value {
11312            0 => Self::Unspecified,
11313            2 => Self::Mesh,
11314            3 => Self::Star,
11315            _ => Self::UnknownValue(preset_topology::UnknownValue(
11316                wkt::internal::UnknownEnumValue::Integer(value),
11317            )),
11318        }
11319    }
11320}
11321
11322impl std::convert::From<&str> for PresetTopology {
11323    fn from(value: &str) -> Self {
11324        use std::string::ToString;
11325        match value {
11326            "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
11327            "MESH" => Self::Mesh,
11328            "STAR" => Self::Star,
11329            _ => Self::UnknownValue(preset_topology::UnknownValue(
11330                wkt::internal::UnknownEnumValue::String(value.to_string()),
11331            )),
11332        }
11333    }
11334}
11335
11336impl serde::ser::Serialize for PresetTopology {
11337    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11338    where
11339        S: serde::Serializer,
11340    {
11341        match self {
11342            Self::Unspecified => serializer.serialize_i32(0),
11343            Self::Mesh => serializer.serialize_i32(2),
11344            Self::Star => serializer.serialize_i32(3),
11345            Self::UnknownValue(u) => u.0.serialize(serializer),
11346        }
11347    }
11348}
11349
11350impl<'de> serde::de::Deserialize<'de> for PresetTopology {
11351    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11352    where
11353        D: serde::Deserializer<'de>,
11354    {
11355        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
11356            ".google.cloud.networkconnectivity.v1.PresetTopology",
11357        ))
11358    }
11359}