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
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Represents the metadata of the long-running operation.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct OperationMetadata {
46    /// Output only. The time the operation was created.
47    pub create_time: std::option::Option<wkt::Timestamp>,
48
49    /// Output only. The time the operation finished running.
50    pub end_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Server-defined resource path for the target of the operation.
53    pub target: std::string::String,
54
55    /// Output only. Name of the verb executed by the operation.
56    pub verb: std::string::String,
57
58    /// Output only. Human-readable status of the operation, if any.
59    pub status_message: std::string::String,
60
61    /// Output only. Identifies whether the user has requested cancellation
62    /// of the operation. Operations that have been cancelled successfully
63    /// have
64    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
65    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
66    /// corresponding to `Code.CANCELLED`.
67    ///
68    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
69    /// [google.rpc.Status.code]: rpc::model::Status::code
70    pub requested_cancellation: bool,
71
72    /// Output only. API version used to start the operation.
73    pub api_version: std::string::String,
74
75    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
76}
77
78impl OperationMetadata {
79    pub fn new() -> Self {
80        std::default::Default::default()
81    }
82
83    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
84    pub fn set_create_time<T>(mut self, v: T) -> Self
85    where
86        T: std::convert::Into<wkt::Timestamp>,
87    {
88        self.create_time = std::option::Option::Some(v.into());
89        self
90    }
91
92    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
93    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
94    where
95        T: std::convert::Into<wkt::Timestamp>,
96    {
97        self.create_time = v.map(|x| x.into());
98        self
99    }
100
101    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
102    pub fn set_end_time<T>(mut self, v: T) -> Self
103    where
104        T: std::convert::Into<wkt::Timestamp>,
105    {
106        self.end_time = std::option::Option::Some(v.into());
107        self
108    }
109
110    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
111    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
112    where
113        T: std::convert::Into<wkt::Timestamp>,
114    {
115        self.end_time = v.map(|x| x.into());
116        self
117    }
118
119    /// Sets the value of [target][crate::model::OperationMetadata::target].
120    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121        self.target = v.into();
122        self
123    }
124
125    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
126    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127        self.verb = v.into();
128        self
129    }
130
131    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
132    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133        self.status_message = v.into();
134        self
135    }
136
137    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
138    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
139        self.requested_cancellation = v.into();
140        self
141    }
142
143    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
144    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145        self.api_version = v.into();
146        self
147    }
148}
149
150impl wkt::message::Message for OperationMetadata {
151    fn typename() -> &'static str {
152        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
153    }
154}
155
156/// The ServiceConnectionMap resource.
157#[derive(Clone, Default, PartialEq)]
158#[non_exhaustive]
159pub struct ServiceConnectionMap {
160    /// Immutable. The name of a ServiceConnectionMap.
161    /// Format:
162    /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
163    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
164    pub name: std::string::String,
165
166    /// Output only. Time when the ServiceConnectionMap was created.
167    pub create_time: std::option::Option<wkt::Timestamp>,
168
169    /// Output only. Time when the ServiceConnectionMap was updated.
170    pub update_time: std::option::Option<wkt::Timestamp>,
171
172    /// User-defined labels.
173    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
174
175    /// A description of this resource.
176    pub description: std::string::String,
177
178    /// The service class identifier this ServiceConnectionMap is for.
179    /// The user of ServiceConnectionMap create API needs to have
180    /// networkconnecitivty.serviceclasses.use iam permission for the service
181    /// class.
182    pub service_class: std::string::String,
183
184    /// Output only. The service class uri this ServiceConnectionMap is for.
185    pub service_class_uri: std::string::String,
186
187    /// Output only. The infrastructure used for connections between
188    /// consumers/producers.
189    pub infrastructure: crate::model::Infrastructure,
190
191    /// The PSC configurations on producer side.
192    pub producer_psc_configs:
193        std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
194
195    /// The PSC configurations on consumer side.
196    pub consumer_psc_configs:
197        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
198
199    /// Output only. PSC connection details on consumer side.
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    pub token: std::string::String,
206
207    /// Optional. The etag is computed by the server, and may be sent on update and
208    /// delete requests to ensure the client has an up-to-date value before
209    /// proceeding.
210    pub etag: std::option::Option<std::string::String>,
211
212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
213}
214
215impl ServiceConnectionMap {
216    pub fn new() -> Self {
217        std::default::Default::default()
218    }
219
220    /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
221    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222        self.name = v.into();
223        self
224    }
225
226    /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
227    pub fn set_create_time<T>(mut self, v: T) -> Self
228    where
229        T: std::convert::Into<wkt::Timestamp>,
230    {
231        self.create_time = std::option::Option::Some(v.into());
232        self
233    }
234
235    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
236    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
237    where
238        T: std::convert::Into<wkt::Timestamp>,
239    {
240        self.create_time = v.map(|x| x.into());
241        self
242    }
243
244    /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
245    pub fn set_update_time<T>(mut self, v: T) -> Self
246    where
247        T: std::convert::Into<wkt::Timestamp>,
248    {
249        self.update_time = std::option::Option::Some(v.into());
250        self
251    }
252
253    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
254    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
255    where
256        T: std::convert::Into<wkt::Timestamp>,
257    {
258        self.update_time = v.map(|x| x.into());
259        self
260    }
261
262    /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
263    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
264    where
265        T: std::iter::IntoIterator<Item = (K, V)>,
266        K: std::convert::Into<std::string::String>,
267        V: std::convert::Into<std::string::String>,
268    {
269        use std::iter::Iterator;
270        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
271        self
272    }
273
274    /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
275    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
276        self.description = v.into();
277        self
278    }
279
280    /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
281    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
282        self.service_class = v.into();
283        self
284    }
285
286    /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
287    pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
288        mut self,
289        v: T,
290    ) -> Self {
291        self.service_class_uri = v.into();
292        self
293    }
294
295    /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
296    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
297        mut self,
298        v: T,
299    ) -> Self {
300        self.infrastructure = v.into();
301        self
302    }
303
304    /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
305    pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
306    where
307        T: std::iter::IntoIterator<Item = V>,
308        V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
309    {
310        use std::iter::Iterator;
311        self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
312        self
313    }
314
315    /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
316    pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
317    where
318        T: std::iter::IntoIterator<Item = V>,
319        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
320    {
321        use std::iter::Iterator;
322        self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
323        self
324    }
325
326    /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
327    pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
328    where
329        T: std::iter::IntoIterator<Item = V>,
330        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
331    {
332        use std::iter::Iterator;
333        self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
334        self
335    }
336
337    /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
338    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
339        self.token = v.into();
340        self
341    }
342
343    /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
344    pub fn set_etag<T>(mut self, v: T) -> Self
345    where
346        T: std::convert::Into<std::string::String>,
347    {
348        self.etag = std::option::Option::Some(v.into());
349        self
350    }
351
352    /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
353    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
354    where
355        T: std::convert::Into<std::string::String>,
356    {
357        self.etag = v.map(|x| x.into());
358        self
359    }
360}
361
362impl wkt::message::Message for ServiceConnectionMap {
363    fn typename() -> &'static str {
364        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
365    }
366}
367
368/// Defines additional types related to [ServiceConnectionMap].
369pub mod service_connection_map {
370    #[allow(unused_imports)]
371    use super::*;
372
373    /// The PSC configurations on producer side.
374    #[derive(Clone, Default, PartialEq)]
375    #[non_exhaustive]
376    pub struct ProducerPscConfig {
377        /// The resource path of a service attachment.
378        /// Example:
379        /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
380        pub service_attachment_uri: std::string::String,
381
382        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
383    }
384
385    impl ProducerPscConfig {
386        pub fn new() -> Self {
387            std::default::Default::default()
388        }
389
390        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
391        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
392            mut self,
393            v: T,
394        ) -> Self {
395            self.service_attachment_uri = v.into();
396            self
397        }
398    }
399
400    impl wkt::message::Message for ProducerPscConfig {
401        fn typename() -> &'static str {
402            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
403        }
404    }
405
406    /// Allow the producer to specify which consumers can connect to it.
407    #[derive(Clone, Default, PartialEq)]
408    #[non_exhaustive]
409    pub struct ConsumerPscConfig {
410        /// The consumer project where PSC connections are allowed to be created in.
411        pub project: std::string::String,
412
413        /// The resource path of the consumer network where PSC connections are
414        /// allowed to be created in. Note, this network does not need be in the
415        /// ConsumerPscConfig.project in the case of SharedVPC.
416        /// Example:
417        /// projects/{projectNumOrId}/global/networks/{networkId}.
418        pub network: std::string::String,
419
420        /// This is used in PSC consumer ForwardingRule to control whether the PSC
421        /// endpoint can be accessed from another region.
422        pub disable_global_access: bool,
423
424        /// Output only. Overall state of PSC Connections management for this
425        /// consumer psc config.
426        pub state: crate::model::service_connection_map::consumer_psc_config::State,
427
428        /// Immutable. Deprecated. Use producer_instance_metadata instead.
429        /// An immutable identifier for the producer instance.
430        #[deprecated]
431        pub producer_instance_id: std::string::String,
432
433        /// Output only. A map to store mapping between customer vip and target
434        /// service attachment. Only service attachment with producer specified ip
435        /// addresses are stored here.
436        pub service_attachment_ip_address_map:
437            std::collections::HashMap<std::string::String, std::string::String>,
438
439        /// Required. The project ID or project number of the consumer project. This
440        /// project is the one that the consumer uses to interact with the producer
441        /// instance. From the perspective of a consumer who's created a producer
442        /// instance, this is the project of the producer instance. Format:
443        /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
444        /// 'projects/1234'
445        pub consumer_instance_project: std::string::String,
446
447        /// Immutable. An immutable map for the producer instance metadata.
448        pub producer_instance_metadata:
449            std::collections::HashMap<std::string::String, std::string::String>,
450
451        /// The requested IP version for the PSC connection.
452        pub ip_version: std::option::Option<crate::model::IPVersion>,
453
454        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
455    }
456
457    impl ConsumerPscConfig {
458        pub fn new() -> Self {
459            std::default::Default::default()
460        }
461
462        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
463        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
464            self.project = v.into();
465            self
466        }
467
468        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
469        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470            self.network = v.into();
471            self
472        }
473
474        /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
475        pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
476            self.disable_global_access = v.into();
477            self
478        }
479
480        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
481        pub fn set_state<
482            T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
483        >(
484            mut self,
485            v: T,
486        ) -> Self {
487            self.state = v.into();
488            self
489        }
490
491        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
492        #[deprecated]
493        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
494            mut self,
495            v: T,
496        ) -> Self {
497            self.producer_instance_id = v.into();
498            self
499        }
500
501        /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
502        pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
503        where
504            T: std::iter::IntoIterator<Item = (K, V)>,
505            K: std::convert::Into<std::string::String>,
506            V: std::convert::Into<std::string::String>,
507        {
508            use std::iter::Iterator;
509            self.service_attachment_ip_address_map =
510                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
511            self
512        }
513
514        /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
515        pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
516            mut self,
517            v: T,
518        ) -> Self {
519            self.consumer_instance_project = v.into();
520            self
521        }
522
523        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
524        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
525        where
526            T: std::iter::IntoIterator<Item = (K, V)>,
527            K: std::convert::Into<std::string::String>,
528            V: std::convert::Into<std::string::String>,
529        {
530            use std::iter::Iterator;
531            self.producer_instance_metadata =
532                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
533            self
534        }
535
536        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
537        pub fn set_ip_version<T>(mut self, v: T) -> Self
538        where
539            T: std::convert::Into<crate::model::IPVersion>,
540        {
541            self.ip_version = std::option::Option::Some(v.into());
542            self
543        }
544
545        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
546        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
547        where
548            T: std::convert::Into<crate::model::IPVersion>,
549        {
550            self.ip_version = v.map(|x| x.into());
551            self
552        }
553    }
554
555    impl wkt::message::Message for ConsumerPscConfig {
556        fn typename() -> &'static str {
557            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
558        }
559    }
560
561    /// Defines additional types related to [ConsumerPscConfig].
562    pub mod consumer_psc_config {
563        #[allow(unused_imports)]
564        use super::*;
565
566        /// PSC Consumer Config State.
567        ///
568        /// # Working with unknown values
569        ///
570        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
571        /// additional enum variants at any time. Adding new variants is not considered
572        /// a breaking change. Applications should write their code in anticipation of:
573        ///
574        /// - New values appearing in future releases of the client library, **and**
575        /// - New values received dynamically, without application changes.
576        ///
577        /// Please consult the [Working with enums] section in the user guide for some
578        /// guidelines.
579        ///
580        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
581        #[derive(Clone, Debug, PartialEq)]
582        #[non_exhaustive]
583        pub enum State {
584            /// Default state, when Connection Map is created initially.
585            Unspecified,
586            /// Set when policy and map configuration is valid,
587            /// and their matching can lead to allowing creation of PSC Connections
588            /// subject to other constraints like connections limit.
589            Valid,
590            /// No Service Connection Policy found for this network and Service
591            /// Class
592            ConnectionPolicyMissing,
593            /// Service Connection Policy limit reached for this network and Service
594            /// Class
595            PolicyLimitReached,
596            /// The consumer instance project is not in
597            /// AllowedGoogleProducersResourceHierarchyLevels of the matching
598            /// ServiceConnectionPolicy.
599            ConsumerInstanceProjectNotAllowlisted,
600            /// If set, the enum was initialized with an unknown value.
601            ///
602            /// Applications can examine the value using [State::value] or
603            /// [State::name].
604            UnknownValue(state::UnknownValue),
605        }
606
607        #[doc(hidden)]
608        pub mod state {
609            #[allow(unused_imports)]
610            use super::*;
611            #[derive(Clone, Debug, PartialEq)]
612            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
613        }
614
615        impl State {
616            /// Gets the enum value.
617            ///
618            /// Returns `None` if the enum contains an unknown value deserialized from
619            /// the string representation of enums.
620            pub fn value(&self) -> std::option::Option<i32> {
621                match self {
622                    Self::Unspecified => std::option::Option::Some(0),
623                    Self::Valid => std::option::Option::Some(1),
624                    Self::ConnectionPolicyMissing => std::option::Option::Some(2),
625                    Self::PolicyLimitReached => std::option::Option::Some(3),
626                    Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
627                    Self::UnknownValue(u) => u.0.value(),
628                }
629            }
630
631            /// Gets the enum value as a string.
632            ///
633            /// Returns `None` if the enum contains an unknown value deserialized from
634            /// the integer representation of enums.
635            pub fn name(&self) -> std::option::Option<&str> {
636                match self {
637                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
638                    Self::Valid => std::option::Option::Some("VALID"),
639                    Self::ConnectionPolicyMissing => {
640                        std::option::Option::Some("CONNECTION_POLICY_MISSING")
641                    }
642                    Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
643                    Self::ConsumerInstanceProjectNotAllowlisted => {
644                        std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
645                    }
646                    Self::UnknownValue(u) => u.0.name(),
647                }
648            }
649        }
650
651        impl std::default::Default for State {
652            fn default() -> Self {
653                use std::convert::From;
654                Self::from(0)
655            }
656        }
657
658        impl std::fmt::Display for State {
659            fn fmt(
660                &self,
661                f: &mut std::fmt::Formatter<'_>,
662            ) -> std::result::Result<(), std::fmt::Error> {
663                wkt::internal::display_enum(f, self.name(), self.value())
664            }
665        }
666
667        impl std::convert::From<i32> for State {
668            fn from(value: i32) -> Self {
669                match value {
670                    0 => Self::Unspecified,
671                    1 => Self::Valid,
672                    2 => Self::ConnectionPolicyMissing,
673                    3 => Self::PolicyLimitReached,
674                    4 => Self::ConsumerInstanceProjectNotAllowlisted,
675                    _ => Self::UnknownValue(state::UnknownValue(
676                        wkt::internal::UnknownEnumValue::Integer(value),
677                    )),
678                }
679            }
680        }
681
682        impl std::convert::From<&str> for State {
683            fn from(value: &str) -> Self {
684                use std::string::ToString;
685                match value {
686                    "STATE_UNSPECIFIED" => Self::Unspecified,
687                    "VALID" => Self::Valid,
688                    "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
689                    "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
690                    "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
691                        Self::ConsumerInstanceProjectNotAllowlisted
692                    }
693                    _ => Self::UnknownValue(state::UnknownValue(
694                        wkt::internal::UnknownEnumValue::String(value.to_string()),
695                    )),
696                }
697            }
698        }
699
700        impl serde::ser::Serialize for State {
701            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
702            where
703                S: serde::Serializer,
704            {
705                match self {
706                    Self::Unspecified => serializer.serialize_i32(0),
707                    Self::Valid => serializer.serialize_i32(1),
708                    Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
709                    Self::PolicyLimitReached => serializer.serialize_i32(3),
710                    Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
711                    Self::UnknownValue(u) => u.0.serialize(serializer),
712                }
713            }
714        }
715
716        impl<'de> serde::de::Deserialize<'de> for State {
717            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
718            where
719                D: serde::Deserializer<'de>,
720            {
721                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
722                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
723            }
724        }
725    }
726
727    /// PSC connection details on consumer side.
728    #[derive(Clone, Default, PartialEq)]
729    #[non_exhaustive]
730    pub struct ConsumerPscConnection {
731        /// The URI of a service attachment which is the target of the PSC
732        /// connection.
733        pub service_attachment_uri: std::string::String,
734
735        /// The state of the PSC connection.
736        pub state: crate::model::service_connection_map::consumer_psc_connection::State,
737
738        /// The consumer project whose PSC forwarding rule is connected to the
739        /// service attachments in this service connection map.
740        pub project: std::string::String,
741
742        /// The consumer network whose PSC forwarding rule is connected to the
743        /// service attachments in this service connection map.
744        /// Note that the network could be on a different project (shared VPC).
745        pub network: std::string::String,
746
747        /// The PSC connection id of the PSC forwarding rule connected
748        /// to the service attachments in this service connection map.
749        pub psc_connection_id: std::string::String,
750
751        /// The IP literal allocated on the consumer network for the PSC forwarding
752        /// rule that is created to connect to the producer service attachment in
753        /// this service connection map.
754        pub ip: std::string::String,
755
756        /// The error type indicates whether the error is consumer facing, producer
757        /// facing or system internal.
758        #[deprecated]
759        pub error_type: crate::model::ConnectionErrorType,
760
761        /// The most recent error during operating this connection.
762        #[deprecated]
763        pub error: std::option::Option<rpc::model::Status>,
764
765        /// The last Compute Engine operation to setup PSC connection.
766        pub gce_operation: std::string::String,
767
768        /// The URI of the consumer forwarding rule created.
769        /// Example:
770        /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
771        pub forwarding_rule: std::string::String,
772
773        /// Output only. The error info for the latest error during operating this
774        /// connection.
775        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
776
777        /// Output only. The URI of the selected subnetwork selected to allocate IP
778        /// address for this connection.
779        pub selected_subnetwork: std::string::String,
780
781        /// Immutable. Deprecated. Use producer_instance_metadata instead.
782        /// An immutable identifier for the producer instance.
783        #[deprecated]
784        pub producer_instance_id: std::string::String,
785
786        /// Immutable. An immutable map for the producer instance metadata.
787        pub producer_instance_metadata:
788            std::collections::HashMap<std::string::String, std::string::String>,
789
790        /// The requested IP version for the PSC connection.
791        pub ip_version: std::option::Option<crate::model::IPVersion>,
792
793        pub(crate) _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>(mut self, v: T) -> Self
863        where
864            T: std::convert::Into<rpc::model::Status>,
865        {
866            self.error = std::option::Option::Some(v.into());
867            self
868        }
869
870        /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
871        #[deprecated]
872        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
873        where
874            T: std::convert::Into<rpc::model::Status>,
875        {
876            self.error = v.map(|x| x.into());
877            self
878        }
879
880        /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
881        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
882            mut self,
883            v: T,
884        ) -> Self {
885            self.gce_operation = v.into();
886            self
887        }
888
889        /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
890        pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
891            mut self,
892            v: T,
893        ) -> Self {
894            self.forwarding_rule = v.into();
895            self
896        }
897
898        /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
899        pub fn set_error_info<T>(mut self, v: T) -> Self
900        where
901            T: std::convert::Into<rpc::model::ErrorInfo>,
902        {
903            self.error_info = std::option::Option::Some(v.into());
904            self
905        }
906
907        /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
908        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
909        where
910            T: std::convert::Into<rpc::model::ErrorInfo>,
911        {
912            self.error_info = v.map(|x| x.into());
913            self
914        }
915
916        /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
917        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
918            mut self,
919            v: T,
920        ) -> Self {
921            self.selected_subnetwork = v.into();
922            self
923        }
924
925        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
926        #[deprecated]
927        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
928            mut self,
929            v: T,
930        ) -> Self {
931            self.producer_instance_id = v.into();
932            self
933        }
934
935        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
936        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
937        where
938            T: std::iter::IntoIterator<Item = (K, V)>,
939            K: std::convert::Into<std::string::String>,
940            V: std::convert::Into<std::string::String>,
941        {
942            use std::iter::Iterator;
943            self.producer_instance_metadata =
944                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
945            self
946        }
947
948        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
949        pub fn set_ip_version<T>(mut self, v: T) -> Self
950        where
951            T: std::convert::Into<crate::model::IPVersion>,
952        {
953            self.ip_version = std::option::Option::Some(v.into());
954            self
955        }
956
957        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
958        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
959        where
960            T: std::convert::Into<crate::model::IPVersion>,
961        {
962            self.ip_version = v.map(|x| x.into());
963            self
964        }
965    }
966
967    impl wkt::message::Message for ConsumerPscConnection {
968        fn typename() -> &'static str {
969            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
970        }
971    }
972
973    /// Defines additional types related to [ConsumerPscConnection].
974    pub mod consumer_psc_connection {
975        #[allow(unused_imports)]
976        use super::*;
977
978        /// The state of the PSC connection.
979        /// We reserve the right to add more states without notice in the future.
980        /// Users should not use exhaustive switch statements on this enum.
981        /// See <https://google.aip.dev/216>.
982        ///
983        /// # Working with unknown values
984        ///
985        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
986        /// additional enum variants at any time. Adding new variants is not considered
987        /// a breaking change. Applications should write their code in anticipation of:
988        ///
989        /// - New values appearing in future releases of the client library, **and**
990        /// - New values received dynamically, without application changes.
991        ///
992        /// Please consult the [Working with enums] section in the user guide for some
993        /// guidelines.
994        ///
995        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
996        #[derive(Clone, Debug, PartialEq)]
997        #[non_exhaustive]
998        pub enum State {
999            /// An invalid state as the default case.
1000            Unspecified,
1001            /// The connection has been created successfully. However, for the
1002            /// up-to-date connection status, please use the service attachment's
1003            /// "ConnectedEndpoint.status" as the source of truth.
1004            Active,
1005            /// The connection is not functional since some resources on the connection
1006            /// fail to be created.
1007            Failed,
1008            /// The connection is being created.
1009            Creating,
1010            /// The connection is being deleted.
1011            Deleting,
1012            /// The connection is being repaired to complete creation.
1013            CreateRepairing,
1014            /// The connection is being repaired to complete deletion.
1015            DeleteRepairing,
1016            /// If set, the enum was initialized with an unknown value.
1017            ///
1018            /// Applications can examine the value using [State::value] or
1019            /// [State::name].
1020            UnknownValue(state::UnknownValue),
1021        }
1022
1023        #[doc(hidden)]
1024        pub mod state {
1025            #[allow(unused_imports)]
1026            use super::*;
1027            #[derive(Clone, Debug, PartialEq)]
1028            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1029        }
1030
1031        impl State {
1032            /// Gets the enum value.
1033            ///
1034            /// Returns `None` if the enum contains an unknown value deserialized from
1035            /// the string representation of enums.
1036            pub fn value(&self) -> std::option::Option<i32> {
1037                match self {
1038                    Self::Unspecified => std::option::Option::Some(0),
1039                    Self::Active => std::option::Option::Some(1),
1040                    Self::Failed => std::option::Option::Some(2),
1041                    Self::Creating => std::option::Option::Some(3),
1042                    Self::Deleting => std::option::Option::Some(4),
1043                    Self::CreateRepairing => std::option::Option::Some(5),
1044                    Self::DeleteRepairing => std::option::Option::Some(6),
1045                    Self::UnknownValue(u) => u.0.value(),
1046                }
1047            }
1048
1049            /// Gets the enum value as a string.
1050            ///
1051            /// Returns `None` if the enum contains an unknown value deserialized from
1052            /// the integer representation of enums.
1053            pub fn name(&self) -> std::option::Option<&str> {
1054                match self {
1055                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1056                    Self::Active => std::option::Option::Some("ACTIVE"),
1057                    Self::Failed => std::option::Option::Some("FAILED"),
1058                    Self::Creating => std::option::Option::Some("CREATING"),
1059                    Self::Deleting => std::option::Option::Some("DELETING"),
1060                    Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1061                    Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1062                    Self::UnknownValue(u) => u.0.name(),
1063                }
1064            }
1065        }
1066
1067        impl std::default::Default for State {
1068            fn default() -> Self {
1069                use std::convert::From;
1070                Self::from(0)
1071            }
1072        }
1073
1074        impl std::fmt::Display for State {
1075            fn fmt(
1076                &self,
1077                f: &mut std::fmt::Formatter<'_>,
1078            ) -> std::result::Result<(), std::fmt::Error> {
1079                wkt::internal::display_enum(f, self.name(), self.value())
1080            }
1081        }
1082
1083        impl std::convert::From<i32> for State {
1084            fn from(value: i32) -> Self {
1085                match value {
1086                    0 => Self::Unspecified,
1087                    1 => Self::Active,
1088                    2 => Self::Failed,
1089                    3 => Self::Creating,
1090                    4 => Self::Deleting,
1091                    5 => Self::CreateRepairing,
1092                    6 => Self::DeleteRepairing,
1093                    _ => Self::UnknownValue(state::UnknownValue(
1094                        wkt::internal::UnknownEnumValue::Integer(value),
1095                    )),
1096                }
1097            }
1098        }
1099
1100        impl std::convert::From<&str> for State {
1101            fn from(value: &str) -> Self {
1102                use std::string::ToString;
1103                match value {
1104                    "STATE_UNSPECIFIED" => Self::Unspecified,
1105                    "ACTIVE" => Self::Active,
1106                    "FAILED" => Self::Failed,
1107                    "CREATING" => Self::Creating,
1108                    "DELETING" => Self::Deleting,
1109                    "CREATE_REPAIRING" => Self::CreateRepairing,
1110                    "DELETE_REPAIRING" => Self::DeleteRepairing,
1111                    _ => Self::UnknownValue(state::UnknownValue(
1112                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1113                    )),
1114                }
1115            }
1116        }
1117
1118        impl serde::ser::Serialize for State {
1119            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1120            where
1121                S: serde::Serializer,
1122            {
1123                match self {
1124                    Self::Unspecified => serializer.serialize_i32(0),
1125                    Self::Active => serializer.serialize_i32(1),
1126                    Self::Failed => serializer.serialize_i32(2),
1127                    Self::Creating => serializer.serialize_i32(3),
1128                    Self::Deleting => serializer.serialize_i32(4),
1129                    Self::CreateRepairing => serializer.serialize_i32(5),
1130                    Self::DeleteRepairing => serializer.serialize_i32(6),
1131                    Self::UnknownValue(u) => u.0.serialize(serializer),
1132                }
1133            }
1134        }
1135
1136        impl<'de> serde::de::Deserialize<'de> for State {
1137            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1138            where
1139                D: serde::Deserializer<'de>,
1140            {
1141                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1142                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1143            }
1144        }
1145    }
1146}
1147
1148/// Request for ListServiceConnectionMaps.
1149#[derive(Clone, Default, PartialEq)]
1150#[non_exhaustive]
1151pub struct ListServiceConnectionMapsRequest {
1152    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1153    pub parent: std::string::String,
1154
1155    /// The maximum number of results per page that should be returned.
1156    pub page_size: i32,
1157
1158    /// The page token.
1159    pub page_token: std::string::String,
1160
1161    /// A filter expression that filters the results listed in the response.
1162    pub filter: std::string::String,
1163
1164    /// Sort the results by a certain order.
1165    pub order_by: std::string::String,
1166
1167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1168}
1169
1170impl ListServiceConnectionMapsRequest {
1171    pub fn new() -> Self {
1172        std::default::Default::default()
1173    }
1174
1175    /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1176    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1177        self.parent = v.into();
1178        self
1179    }
1180
1181    /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1182    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1183        self.page_size = v.into();
1184        self
1185    }
1186
1187    /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1188    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1189        self.page_token = v.into();
1190        self
1191    }
1192
1193    /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1194    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195        self.filter = v.into();
1196        self
1197    }
1198
1199    /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1200    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1201        self.order_by = v.into();
1202        self
1203    }
1204}
1205
1206impl wkt::message::Message for ListServiceConnectionMapsRequest {
1207    fn typename() -> &'static str {
1208        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1209    }
1210}
1211
1212/// Response for ListServiceConnectionMaps.
1213#[derive(Clone, Default, PartialEq)]
1214#[non_exhaustive]
1215pub struct ListServiceConnectionMapsResponse {
1216    /// ServiceConnectionMaps to be returned.
1217    pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1218
1219    /// The next pagination token in the List response. It should be used as
1220    /// page_token for the following request. An empty value means no more result.
1221    pub next_page_token: std::string::String,
1222
1223    /// Locations that could not be reached.
1224    pub unreachable: std::vec::Vec<std::string::String>,
1225
1226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1227}
1228
1229impl ListServiceConnectionMapsResponse {
1230    pub fn new() -> Self {
1231        std::default::Default::default()
1232    }
1233
1234    /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1235    pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1236    where
1237        T: std::iter::IntoIterator<Item = V>,
1238        V: std::convert::Into<crate::model::ServiceConnectionMap>,
1239    {
1240        use std::iter::Iterator;
1241        self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1242        self
1243    }
1244
1245    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1246    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1247        self.next_page_token = v.into();
1248        self
1249    }
1250
1251    /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1252    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1253    where
1254        T: std::iter::IntoIterator<Item = V>,
1255        V: std::convert::Into<std::string::String>,
1256    {
1257        use std::iter::Iterator;
1258        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1259        self
1260    }
1261}
1262
1263impl wkt::message::Message for ListServiceConnectionMapsResponse {
1264    fn typename() -> &'static str {
1265        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1266    }
1267}
1268
1269#[doc(hidden)]
1270impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1271    type PageItem = crate::model::ServiceConnectionMap;
1272
1273    fn items(self) -> std::vec::Vec<Self::PageItem> {
1274        self.service_connection_maps
1275    }
1276
1277    fn next_page_token(&self) -> std::string::String {
1278        use std::clone::Clone;
1279        self.next_page_token.clone()
1280    }
1281}
1282
1283/// Request for GetServiceConnectionMap.
1284#[derive(Clone, Default, PartialEq)]
1285#[non_exhaustive]
1286pub struct GetServiceConnectionMapRequest {
1287    /// Required. Name of the ServiceConnectionMap to get.
1288    pub name: std::string::String,
1289
1290    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1291}
1292
1293impl GetServiceConnectionMapRequest {
1294    pub fn new() -> Self {
1295        std::default::Default::default()
1296    }
1297
1298    /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1299    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1300        self.name = v.into();
1301        self
1302    }
1303}
1304
1305impl wkt::message::Message for GetServiceConnectionMapRequest {
1306    fn typename() -> &'static str {
1307        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1308    }
1309}
1310
1311/// Request for CreateServiceConnectionMap.
1312#[derive(Clone, Default, PartialEq)]
1313#[non_exhaustive]
1314pub struct CreateServiceConnectionMapRequest {
1315    /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1316    /// projects/123/locations/us-east1
1317    pub parent: std::string::String,
1318
1319    /// Optional. Resource ID
1320    /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1321    /// See <https://google.aip.dev/122#resource-id-segments>
1322    /// Unique per location.
1323    /// If one is not provided, one will be generated.
1324    pub service_connection_map_id: std::string::String,
1325
1326    /// Required. Initial values for a new ServiceConnectionMaps
1327    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1328
1329    /// Optional. An optional request ID to identify requests. Specify a unique
1330    /// request ID so that if you must retry your request, the server will know to
1331    /// ignore the request if it has already been completed. The server will
1332    /// guarantee that for at least 60 minutes since the first request.
1333    ///
1334    /// For example, consider a situation where you make an initial request and
1335    /// the request times out. If you make the request again with the same request
1336    /// ID, the server can check if original operation with the same request ID
1337    /// was received, and if so, will ignore the second request. This prevents
1338    /// clients from accidentally creating duplicate commitments.
1339    ///
1340    /// The request ID must be a valid UUID with the exception that zero UUID is
1341    /// not supported (00000000-0000-0000-0000-000000000000).
1342    pub request_id: std::string::String,
1343
1344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1345}
1346
1347impl CreateServiceConnectionMapRequest {
1348    pub fn new() -> Self {
1349        std::default::Default::default()
1350    }
1351
1352    /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1353    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354        self.parent = v.into();
1355        self
1356    }
1357
1358    /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1359    pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1360        mut self,
1361        v: T,
1362    ) -> Self {
1363        self.service_connection_map_id = v.into();
1364        self
1365    }
1366
1367    /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1368    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1369    where
1370        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1371    {
1372        self.service_connection_map = std::option::Option::Some(v.into());
1373        self
1374    }
1375
1376    /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1377    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1378    where
1379        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1380    {
1381        self.service_connection_map = v.map(|x| x.into());
1382        self
1383    }
1384
1385    /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1386    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1387        self.request_id = v.into();
1388        self
1389    }
1390}
1391
1392impl wkt::message::Message for CreateServiceConnectionMapRequest {
1393    fn typename() -> &'static str {
1394        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1395    }
1396}
1397
1398/// Request for UpdateServiceConnectionMap.
1399#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct UpdateServiceConnectionMapRequest {
1402    /// Optional. Field mask is used to specify the fields to be overwritten in the
1403    /// ServiceConnectionMap resource by the update.
1404    /// The fields specified in the update_mask are relative to the resource, not
1405    /// the full request. A field will be overwritten if it is in the mask. If the
1406    /// user does not provide a mask then all fields will be overwritten.
1407    pub update_mask: std::option::Option<wkt::FieldMask>,
1408
1409    /// Required. New values to be patched into the resource.
1410    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1411
1412    /// Optional. An optional request ID to identify requests. Specify a unique
1413    /// request ID so that if you must retry your request, the server will know to
1414    /// ignore the request if it has already been completed. The server will
1415    /// guarantee that for at least 60 minutes since the first request.
1416    ///
1417    /// For example, consider a situation where you make an initial request and
1418    /// the request times out. If you make the request again with the same request
1419    /// ID, the server can check if original operation with the same request ID
1420    /// was received, and if so, will ignore the second request. This prevents
1421    /// clients from accidentally creating duplicate commitments.
1422    ///
1423    /// The request ID must be a valid UUID with the exception that zero UUID is
1424    /// not supported (00000000-0000-0000-0000-000000000000).
1425    pub request_id: std::string::String,
1426
1427    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1428}
1429
1430impl UpdateServiceConnectionMapRequest {
1431    pub fn new() -> Self {
1432        std::default::Default::default()
1433    }
1434
1435    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1436    pub fn set_update_mask<T>(mut self, v: T) -> Self
1437    where
1438        T: std::convert::Into<wkt::FieldMask>,
1439    {
1440        self.update_mask = std::option::Option::Some(v.into());
1441        self
1442    }
1443
1444    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1445    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1446    where
1447        T: std::convert::Into<wkt::FieldMask>,
1448    {
1449        self.update_mask = v.map(|x| x.into());
1450        self
1451    }
1452
1453    /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1454    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1455    where
1456        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1457    {
1458        self.service_connection_map = std::option::Option::Some(v.into());
1459        self
1460    }
1461
1462    /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1463    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1464    where
1465        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1466    {
1467        self.service_connection_map = v.map(|x| x.into());
1468        self
1469    }
1470
1471    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1472    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1473        self.request_id = v.into();
1474        self
1475    }
1476}
1477
1478impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1479    fn typename() -> &'static str {
1480        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1481    }
1482}
1483
1484/// Request for DeleteServiceConnectionMap.
1485#[derive(Clone, Default, PartialEq)]
1486#[non_exhaustive]
1487pub struct DeleteServiceConnectionMapRequest {
1488    /// Required. The name of the ServiceConnectionMap to delete.
1489    pub name: std::string::String,
1490
1491    /// Optional. An optional request ID to identify requests. Specify a unique
1492    /// request ID so that if you must retry your request, the server will know to
1493    /// ignore the request if it has already been completed. The server will
1494    /// guarantee that for at least 60 minutes after the first request.
1495    ///
1496    /// For example, consider a situation where you make an initial request and
1497    /// the request times out. If you make the request again with the same request
1498    /// ID, the server can check if original operation with the same request ID
1499    /// was received, and if so, will ignore the second request. This prevents
1500    /// clients from accidentally creating duplicate commitments.
1501    ///
1502    /// The request ID must be a valid UUID with the exception that zero UUID is
1503    /// not supported (00000000-0000-0000-0000-000000000000).
1504    pub request_id: std::string::String,
1505
1506    /// Optional. The etag is computed by the server, and may be sent on update and
1507    /// delete requests to ensure the client has an up-to-date value before
1508    /// proceeding.
1509    pub etag: std::option::Option<std::string::String>,
1510
1511    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1512}
1513
1514impl DeleteServiceConnectionMapRequest {
1515    pub fn new() -> Self {
1516        std::default::Default::default()
1517    }
1518
1519    /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
1520    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1521        self.name = v.into();
1522        self
1523    }
1524
1525    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
1526    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1527        self.request_id = v.into();
1528        self
1529    }
1530
1531    /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
1532    pub fn set_etag<T>(mut self, v: T) -> Self
1533    where
1534        T: std::convert::Into<std::string::String>,
1535    {
1536        self.etag = std::option::Option::Some(v.into());
1537        self
1538    }
1539
1540    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
1541    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1542    where
1543        T: std::convert::Into<std::string::String>,
1544    {
1545        self.etag = v.map(|x| x.into());
1546        self
1547    }
1548}
1549
1550impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1551    fn typename() -> &'static str {
1552        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1553    }
1554}
1555
1556/// The ServiceConnectionPolicy resource.
1557#[derive(Clone, Default, PartialEq)]
1558#[non_exhaustive]
1559pub struct ServiceConnectionPolicy {
1560    /// Immutable. The name of a ServiceConnectionPolicy.
1561    /// Format:
1562    /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
1563    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
1564    pub name: std::string::String,
1565
1566    /// Output only. Time when the ServiceConnectionPolicy was created.
1567    pub create_time: std::option::Option<wkt::Timestamp>,
1568
1569    /// Output only. Time when the ServiceConnectionPolicy was updated.
1570    pub update_time: std::option::Option<wkt::Timestamp>,
1571
1572    /// User-defined labels.
1573    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1574
1575    /// A description of this resource.
1576    pub description: std::string::String,
1577
1578    /// The resource path of the consumer network.
1579    /// Example:
1580    ///
1581    /// - projects/{projectNumOrId}/global/networks/{resourceId}.
1582    pub network: std::string::String,
1583
1584    /// The service class identifier for which this ServiceConnectionPolicy is for.
1585    /// The service class identifier is a unique, symbolic representation of a
1586    /// ServiceClass. It is provided by the Service Producer. Google services have
1587    /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
1588    /// google-cloud-sql. 3rd party services do not. For example,
1589    /// test-service-a3dfcx.
1590    pub service_class: std::string::String,
1591
1592    /// Output only. The type of underlying resources used to create the
1593    /// connection.
1594    pub infrastructure: crate::model::Infrastructure,
1595
1596    /// Configuration used for Private Service Connect connections. Used when
1597    /// Infrastructure is PSC.
1598    pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1599
1600    /// Output only. [Output only] Information about each Private Service Connect
1601    /// connection.
1602    pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1603
1604    /// Optional. The etag is computed by the server, and may be sent on update and
1605    /// delete requests to ensure the client has an up-to-date value before
1606    /// proceeding.
1607    pub etag: std::option::Option<std::string::String>,
1608
1609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1610}
1611
1612impl ServiceConnectionPolicy {
1613    pub fn new() -> Self {
1614        std::default::Default::default()
1615    }
1616
1617    /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
1618    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1619        self.name = v.into();
1620        self
1621    }
1622
1623    /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
1624    pub fn set_create_time<T>(mut self, v: T) -> Self
1625    where
1626        T: std::convert::Into<wkt::Timestamp>,
1627    {
1628        self.create_time = std::option::Option::Some(v.into());
1629        self
1630    }
1631
1632    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
1633    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1634    where
1635        T: std::convert::Into<wkt::Timestamp>,
1636    {
1637        self.create_time = v.map(|x| x.into());
1638        self
1639    }
1640
1641    /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
1642    pub fn set_update_time<T>(mut self, v: T) -> Self
1643    where
1644        T: std::convert::Into<wkt::Timestamp>,
1645    {
1646        self.update_time = std::option::Option::Some(v.into());
1647        self
1648    }
1649
1650    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
1651    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1652    where
1653        T: std::convert::Into<wkt::Timestamp>,
1654    {
1655        self.update_time = v.map(|x| x.into());
1656        self
1657    }
1658
1659    /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
1660    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1661    where
1662        T: std::iter::IntoIterator<Item = (K, V)>,
1663        K: std::convert::Into<std::string::String>,
1664        V: std::convert::Into<std::string::String>,
1665    {
1666        use std::iter::Iterator;
1667        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1668        self
1669    }
1670
1671    /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
1672    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1673        self.description = v.into();
1674        self
1675    }
1676
1677    /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
1678    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1679        self.network = v.into();
1680        self
1681    }
1682
1683    /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
1684    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685        self.service_class = v.into();
1686        self
1687    }
1688
1689    /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
1690    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1691        mut self,
1692        v: T,
1693    ) -> Self {
1694        self.infrastructure = v.into();
1695        self
1696    }
1697
1698    /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
1699    pub fn set_psc_config<T>(mut self, v: T) -> Self
1700    where
1701        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
1702    {
1703        self.psc_config = std::option::Option::Some(v.into());
1704        self
1705    }
1706
1707    /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
1708    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
1709    where
1710        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
1711    {
1712        self.psc_config = v.map(|x| x.into());
1713        self
1714    }
1715
1716    /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
1717    pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1718    where
1719        T: std::iter::IntoIterator<Item = V>,
1720        V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1721    {
1722        use std::iter::Iterator;
1723        self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1724        self
1725    }
1726
1727    /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
1728    pub fn set_etag<T>(mut self, v: T) -> Self
1729    where
1730        T: std::convert::Into<std::string::String>,
1731    {
1732        self.etag = std::option::Option::Some(v.into());
1733        self
1734    }
1735
1736    /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
1737    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1738    where
1739        T: std::convert::Into<std::string::String>,
1740    {
1741        self.etag = v.map(|x| x.into());
1742        self
1743    }
1744}
1745
1746impl wkt::message::Message for ServiceConnectionPolicy {
1747    fn typename() -> &'static str {
1748        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1749    }
1750}
1751
1752/// Defines additional types related to [ServiceConnectionPolicy].
1753pub mod service_connection_policy {
1754    #[allow(unused_imports)]
1755    use super::*;
1756
1757    /// Configuration used for Private Service Connect connections. Used when
1758    /// Infrastructure is PSC.
1759    #[derive(Clone, Default, PartialEq)]
1760    #[non_exhaustive]
1761    pub struct PscConfig {
1762        /// The resource paths of subnetworks to use for IP address management.
1763        /// Example:
1764        /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
1765        pub subnetworks: std::vec::Vec<std::string::String>,
1766
1767        /// Optional. Max number of PSC connections for this policy.
1768        pub limit: std::option::Option<i64>,
1769
1770        /// Required. ProducerInstanceLocation is used to specify which authorization
1771        /// mechanism to use to determine which projects the Producer instance can be
1772        /// within.
1773        pub producer_instance_location:
1774            crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1775
1776        /// Optional. List of Projects, Folders, or Organizations from where the
1777        /// Producer instance can be within. For example, a network administrator can
1778        /// provide both 'organizations/foo' and 'projects/bar' as
1779        /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
1780        /// network to connect with any Producer instance within the 'foo'
1781        /// organization or the 'bar' project. By default,
1782        /// allowed_google_producers_resource_hierarchy_level is empty. The format
1783        /// for each allowed_google_producers_resource_hierarchy_level is \<resource
1784        /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
1785        /// 'organizations' and \<id\> is either the ID or the number of the resource
1786        /// type. Format for each allowed_google_producers_resource_hierarchy_level
1787        /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
1788        /// 'organizations/<organization_id>'
1789        /// Eg. [projects/my-project-id, projects/567, folders/891,
1790        /// organizations/123]
1791        pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1792
1793        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1794    }
1795
1796    impl PscConfig {
1797        pub fn new() -> Self {
1798            std::default::Default::default()
1799        }
1800
1801        /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
1802        pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1803        where
1804            T: std::iter::IntoIterator<Item = V>,
1805            V: std::convert::Into<std::string::String>,
1806        {
1807            use std::iter::Iterator;
1808            self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1809            self
1810        }
1811
1812        /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
1813        pub fn set_limit<T>(mut self, v: T) -> Self
1814        where
1815            T: std::convert::Into<i64>,
1816        {
1817            self.limit = std::option::Option::Some(v.into());
1818            self
1819        }
1820
1821        /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
1822        pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
1823        where
1824            T: std::convert::Into<i64>,
1825        {
1826            self.limit = v.map(|x| x.into());
1827            self
1828        }
1829
1830        /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
1831        pub fn set_producer_instance_location<
1832            T: std::convert::Into<
1833                    crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1834                >,
1835        >(
1836            mut self,
1837            v: T,
1838        ) -> Self {
1839            self.producer_instance_location = v.into();
1840            self
1841        }
1842
1843        /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
1844        pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1845        where
1846            T: std::iter::IntoIterator<Item = V>,
1847            V: std::convert::Into<std::string::String>,
1848        {
1849            use std::iter::Iterator;
1850            self.allowed_google_producers_resource_hierarchy_level =
1851                v.into_iter().map(|i| i.into()).collect();
1852            self
1853        }
1854    }
1855
1856    impl wkt::message::Message for PscConfig {
1857        fn typename() -> &'static str {
1858            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1859        }
1860    }
1861
1862    /// Defines additional types related to [PscConfig].
1863    pub mod psc_config {
1864        #[allow(unused_imports)]
1865        use super::*;
1866
1867        /// ProducerInstanceLocation is used to specify which authorization mechanism
1868        /// to use to determine which projects the Producer instance can be within.
1869        ///
1870        /// # Working with unknown values
1871        ///
1872        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1873        /// additional enum variants at any time. Adding new variants is not considered
1874        /// a breaking change. Applications should write their code in anticipation of:
1875        ///
1876        /// - New values appearing in future releases of the client library, **and**
1877        /// - New values received dynamically, without application changes.
1878        ///
1879        /// Please consult the [Working with enums] section in the user guide for some
1880        /// guidelines.
1881        ///
1882        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1883        #[derive(Clone, Debug, PartialEq)]
1884        #[non_exhaustive]
1885        pub enum ProducerInstanceLocation {
1886            /// Producer instance location is not specified. When this option is
1887            /// chosen, then the PSC connections created by this
1888            /// ServiceConnectionPolicy must be within the same project as the Producer
1889            /// instance. This is the default ProducerInstanceLocation value.
1890            /// To allow for PSC connections from this network to other networks, use
1891            /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
1892            Unspecified,
1893            /// Producer instance must be within one of the values provided in
1894            /// allowed_google_producers_resource_hierarchy_level.
1895            CustomResourceHierarchyLevels,
1896            /// If set, the enum was initialized with an unknown value.
1897            ///
1898            /// Applications can examine the value using [ProducerInstanceLocation::value] or
1899            /// [ProducerInstanceLocation::name].
1900            UnknownValue(producer_instance_location::UnknownValue),
1901        }
1902
1903        #[doc(hidden)]
1904        pub mod producer_instance_location {
1905            #[allow(unused_imports)]
1906            use super::*;
1907            #[derive(Clone, Debug, PartialEq)]
1908            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1909        }
1910
1911        impl ProducerInstanceLocation {
1912            /// Gets the enum value.
1913            ///
1914            /// Returns `None` if the enum contains an unknown value deserialized from
1915            /// the string representation of enums.
1916            pub fn value(&self) -> std::option::Option<i32> {
1917                match self {
1918                    Self::Unspecified => std::option::Option::Some(0),
1919                    Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
1920                    Self::UnknownValue(u) => u.0.value(),
1921                }
1922            }
1923
1924            /// Gets the enum value as a string.
1925            ///
1926            /// Returns `None` if the enum contains an unknown value deserialized from
1927            /// the integer representation of enums.
1928            pub fn name(&self) -> std::option::Option<&str> {
1929                match self {
1930                    Self::Unspecified => {
1931                        std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
1932                    }
1933                    Self::CustomResourceHierarchyLevels => {
1934                        std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
1935                    }
1936                    Self::UnknownValue(u) => u.0.name(),
1937                }
1938            }
1939        }
1940
1941        impl std::default::Default for ProducerInstanceLocation {
1942            fn default() -> Self {
1943                use std::convert::From;
1944                Self::from(0)
1945            }
1946        }
1947
1948        impl std::fmt::Display for ProducerInstanceLocation {
1949            fn fmt(
1950                &self,
1951                f: &mut std::fmt::Formatter<'_>,
1952            ) -> std::result::Result<(), std::fmt::Error> {
1953                wkt::internal::display_enum(f, self.name(), self.value())
1954            }
1955        }
1956
1957        impl std::convert::From<i32> for ProducerInstanceLocation {
1958            fn from(value: i32) -> Self {
1959                match value {
1960                    0 => Self::Unspecified,
1961                    1 => Self::CustomResourceHierarchyLevels,
1962                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1963                        wkt::internal::UnknownEnumValue::Integer(value),
1964                    )),
1965                }
1966            }
1967        }
1968
1969        impl std::convert::From<&str> for ProducerInstanceLocation {
1970            fn from(value: &str) -> Self {
1971                use std::string::ToString;
1972                match value {
1973                    "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
1974                    "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
1975                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1976                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1977                    )),
1978                }
1979            }
1980        }
1981
1982        impl serde::ser::Serialize for ProducerInstanceLocation {
1983            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1984            where
1985                S: serde::Serializer,
1986            {
1987                match self {
1988                    Self::Unspecified => serializer.serialize_i32(0),
1989                    Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
1990                    Self::UnknownValue(u) => u.0.serialize(serializer),
1991                }
1992            }
1993        }
1994
1995        impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
1996            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1997            where
1998                D: serde::Deserializer<'de>,
1999            {
2000                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2001                    ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2002            }
2003        }
2004    }
2005
2006    /// Information about a specific Private Service Connect connection.
2007    #[derive(Clone, Default, PartialEq)]
2008    #[non_exhaustive]
2009    pub struct PscConnection {
2010        /// State of the PSC Connection
2011        pub state: crate::model::service_connection_policy::State,
2012
2013        /// The resource reference of the PSC Forwarding Rule within the consumer
2014        /// VPC.
2015        pub consumer_forwarding_rule: std::string::String,
2016
2017        /// The resource reference of the consumer address.
2018        pub consumer_address: std::string::String,
2019
2020        /// The error type indicates whether the error is consumer facing, producer
2021        /// facing or system internal.
2022        #[deprecated]
2023        pub error_type: crate::model::ConnectionErrorType,
2024
2025        /// The most recent error during operating this connection.
2026        /// Deprecated, please use error_info instead.
2027        #[deprecated]
2028        pub error: std::option::Option<rpc::model::Status>,
2029
2030        /// The last Compute Engine operation to setup PSC connection.
2031        pub gce_operation: std::string::String,
2032
2033        /// The project where the PSC connection is created.
2034        pub consumer_target_project: std::string::String,
2035
2036        /// The PSC connection id of the PSC forwarding rule.
2037        pub psc_connection_id: std::string::String,
2038
2039        /// Output only. The error info for the latest error during operating this
2040        /// connection.
2041        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
2042
2043        /// Output only. The URI of the subnetwork selected to allocate IP address
2044        /// for this connection.
2045        pub selected_subnetwork: std::string::String,
2046
2047        /// Immutable. Deprecated. Use producer_instance_metadata instead.
2048        /// An immutable identifier for the producer instance.
2049        #[deprecated]
2050        pub producer_instance_id: std::string::String,
2051
2052        /// Immutable. An immutable map for the producer instance metadata.
2053        pub producer_instance_metadata:
2054            std::collections::HashMap<std::string::String, std::string::String>,
2055
2056        /// Output only. [Output only] The service class associated with this PSC
2057        /// Connection. The value is derived from the SCPolicy and matches the
2058        /// service class name provided by the customer.
2059        pub service_class: std::string::String,
2060
2061        /// The requested IP version for the PSC connection.
2062        pub ip_version: std::option::Option<crate::model::IPVersion>,
2063
2064        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2065    }
2066
2067    impl PscConnection {
2068        pub fn new() -> Self {
2069            std::default::Default::default()
2070        }
2071
2072        /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2073        pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2074            mut self,
2075            v: T,
2076        ) -> Self {
2077            self.state = v.into();
2078            self
2079        }
2080
2081        /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2082        pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2083            mut self,
2084            v: T,
2085        ) -> Self {
2086            self.consumer_forwarding_rule = v.into();
2087            self
2088        }
2089
2090        /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2091        pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2092            mut self,
2093            v: T,
2094        ) -> Self {
2095            self.consumer_address = v.into();
2096            self
2097        }
2098
2099        /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2100        #[deprecated]
2101        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2102            mut self,
2103            v: T,
2104        ) -> Self {
2105            self.error_type = v.into();
2106            self
2107        }
2108
2109        /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2110        #[deprecated]
2111        pub fn set_error<T>(mut self, v: T) -> Self
2112        where
2113            T: std::convert::Into<rpc::model::Status>,
2114        {
2115            self.error = std::option::Option::Some(v.into());
2116            self
2117        }
2118
2119        /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2120        #[deprecated]
2121        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2122        where
2123            T: std::convert::Into<rpc::model::Status>,
2124        {
2125            self.error = v.map(|x| x.into());
2126            self
2127        }
2128
2129        /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2130        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2131            mut self,
2132            v: T,
2133        ) -> Self {
2134            self.gce_operation = v.into();
2135            self
2136        }
2137
2138        /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2139        pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2140            mut self,
2141            v: T,
2142        ) -> Self {
2143            self.consumer_target_project = v.into();
2144            self
2145        }
2146
2147        /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2148        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2149            mut self,
2150            v: T,
2151        ) -> Self {
2152            self.psc_connection_id = v.into();
2153            self
2154        }
2155
2156        /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2157        pub fn set_error_info<T>(mut self, v: T) -> Self
2158        where
2159            T: std::convert::Into<rpc::model::ErrorInfo>,
2160        {
2161            self.error_info = std::option::Option::Some(v.into());
2162            self
2163        }
2164
2165        /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2166        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2167        where
2168            T: std::convert::Into<rpc::model::ErrorInfo>,
2169        {
2170            self.error_info = v.map(|x| x.into());
2171            self
2172        }
2173
2174        /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2175        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2176            mut self,
2177            v: T,
2178        ) -> Self {
2179            self.selected_subnetwork = v.into();
2180            self
2181        }
2182
2183        /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2184        #[deprecated]
2185        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2186            mut self,
2187            v: T,
2188        ) -> Self {
2189            self.producer_instance_id = v.into();
2190            self
2191        }
2192
2193        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2194        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2195        where
2196            T: std::iter::IntoIterator<Item = (K, V)>,
2197            K: std::convert::Into<std::string::String>,
2198            V: std::convert::Into<std::string::String>,
2199        {
2200            use std::iter::Iterator;
2201            self.producer_instance_metadata =
2202                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2203            self
2204        }
2205
2206        /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
2207        pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2208            mut self,
2209            v: T,
2210        ) -> Self {
2211            self.service_class = v.into();
2212            self
2213        }
2214
2215        /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
2216        pub fn set_ip_version<T>(mut self, v: T) -> Self
2217        where
2218            T: std::convert::Into<crate::model::IPVersion>,
2219        {
2220            self.ip_version = std::option::Option::Some(v.into());
2221            self
2222        }
2223
2224        /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
2225        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
2226        where
2227            T: std::convert::Into<crate::model::IPVersion>,
2228        {
2229            self.ip_version = v.map(|x| x.into());
2230            self
2231        }
2232    }
2233
2234    impl wkt::message::Message for PscConnection {
2235        fn typename() -> &'static str {
2236            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
2237        }
2238    }
2239
2240    /// The state of the PSC connection.
2241    /// We reserve the right to add more states without notice in the future.
2242    /// Users should not use exhaustive switch statements on this enum.
2243    /// See <https://google.aip.dev/216>.
2244    ///
2245    /// # Working with unknown values
2246    ///
2247    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2248    /// additional enum variants at any time. Adding new variants is not considered
2249    /// a breaking change. Applications should write their code in anticipation of:
2250    ///
2251    /// - New values appearing in future releases of the client library, **and**
2252    /// - New values received dynamically, without application changes.
2253    ///
2254    /// Please consult the [Working with enums] section in the user guide for some
2255    /// guidelines.
2256    ///
2257    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2258    #[derive(Clone, Debug, PartialEq)]
2259    #[non_exhaustive]
2260    pub enum State {
2261        /// An invalid state as the default case.
2262        Unspecified,
2263        /// The connection has been created successfully. However, for the
2264        /// up-to-date connection status, please use the created forwarding rule's
2265        /// "PscConnectionStatus" as the source of truth.
2266        Active,
2267        /// The connection is not functional since some resources on the connection
2268        /// fail to be created.
2269        Failed,
2270        /// The connection is being created.
2271        Creating,
2272        /// The connection is being deleted.
2273        Deleting,
2274        /// The connection is being repaired to complete creation.
2275        CreateRepairing,
2276        /// The connection is being repaired to complete deletion.
2277        DeleteRepairing,
2278        /// If set, the enum was initialized with an unknown value.
2279        ///
2280        /// Applications can examine the value using [State::value] or
2281        /// [State::name].
2282        UnknownValue(state::UnknownValue),
2283    }
2284
2285    #[doc(hidden)]
2286    pub mod state {
2287        #[allow(unused_imports)]
2288        use super::*;
2289        #[derive(Clone, Debug, PartialEq)]
2290        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2291    }
2292
2293    impl State {
2294        /// Gets the enum value.
2295        ///
2296        /// Returns `None` if the enum contains an unknown value deserialized from
2297        /// the string representation of enums.
2298        pub fn value(&self) -> std::option::Option<i32> {
2299            match self {
2300                Self::Unspecified => std::option::Option::Some(0),
2301                Self::Active => std::option::Option::Some(1),
2302                Self::Failed => std::option::Option::Some(2),
2303                Self::Creating => std::option::Option::Some(3),
2304                Self::Deleting => std::option::Option::Some(4),
2305                Self::CreateRepairing => std::option::Option::Some(5),
2306                Self::DeleteRepairing => std::option::Option::Some(6),
2307                Self::UnknownValue(u) => u.0.value(),
2308            }
2309        }
2310
2311        /// Gets the enum value as a string.
2312        ///
2313        /// Returns `None` if the enum contains an unknown value deserialized from
2314        /// the integer representation of enums.
2315        pub fn name(&self) -> std::option::Option<&str> {
2316            match self {
2317                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2318                Self::Active => std::option::Option::Some("ACTIVE"),
2319                Self::Failed => std::option::Option::Some("FAILED"),
2320                Self::Creating => std::option::Option::Some("CREATING"),
2321                Self::Deleting => std::option::Option::Some("DELETING"),
2322                Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
2323                Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
2324                Self::UnknownValue(u) => u.0.name(),
2325            }
2326        }
2327    }
2328
2329    impl std::default::Default for State {
2330        fn default() -> Self {
2331            use std::convert::From;
2332            Self::from(0)
2333        }
2334    }
2335
2336    impl std::fmt::Display for State {
2337        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2338            wkt::internal::display_enum(f, self.name(), self.value())
2339        }
2340    }
2341
2342    impl std::convert::From<i32> for State {
2343        fn from(value: i32) -> Self {
2344            match value {
2345                0 => Self::Unspecified,
2346                1 => Self::Active,
2347                2 => Self::Failed,
2348                3 => Self::Creating,
2349                4 => Self::Deleting,
2350                5 => Self::CreateRepairing,
2351                6 => Self::DeleteRepairing,
2352                _ => Self::UnknownValue(state::UnknownValue(
2353                    wkt::internal::UnknownEnumValue::Integer(value),
2354                )),
2355            }
2356        }
2357    }
2358
2359    impl std::convert::From<&str> for State {
2360        fn from(value: &str) -> Self {
2361            use std::string::ToString;
2362            match value {
2363                "STATE_UNSPECIFIED" => Self::Unspecified,
2364                "ACTIVE" => Self::Active,
2365                "FAILED" => Self::Failed,
2366                "CREATING" => Self::Creating,
2367                "DELETING" => Self::Deleting,
2368                "CREATE_REPAIRING" => Self::CreateRepairing,
2369                "DELETE_REPAIRING" => Self::DeleteRepairing,
2370                _ => Self::UnknownValue(state::UnknownValue(
2371                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2372                )),
2373            }
2374        }
2375    }
2376
2377    impl serde::ser::Serialize for State {
2378        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2379        where
2380            S: serde::Serializer,
2381        {
2382            match self {
2383                Self::Unspecified => serializer.serialize_i32(0),
2384                Self::Active => serializer.serialize_i32(1),
2385                Self::Failed => serializer.serialize_i32(2),
2386                Self::Creating => serializer.serialize_i32(3),
2387                Self::Deleting => serializer.serialize_i32(4),
2388                Self::CreateRepairing => serializer.serialize_i32(5),
2389                Self::DeleteRepairing => serializer.serialize_i32(6),
2390                Self::UnknownValue(u) => u.0.serialize(serializer),
2391            }
2392        }
2393    }
2394
2395    impl<'de> serde::de::Deserialize<'de> for State {
2396        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2397        where
2398            D: serde::Deserializer<'de>,
2399        {
2400            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2401                ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
2402            ))
2403        }
2404    }
2405}
2406
2407/// Request for ListServiceConnectionPolicies.
2408#[derive(Clone, Default, PartialEq)]
2409#[non_exhaustive]
2410pub struct ListServiceConnectionPoliciesRequest {
2411    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2412    pub parent: std::string::String,
2413
2414    /// The maximum number of results per page that should be returned.
2415    pub page_size: i32,
2416
2417    /// The page token.
2418    pub page_token: std::string::String,
2419
2420    /// A filter expression that filters the results listed in the response.
2421    pub filter: std::string::String,
2422
2423    /// Sort the results by a certain order.
2424    pub order_by: std::string::String,
2425
2426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2427}
2428
2429impl ListServiceConnectionPoliciesRequest {
2430    pub fn new() -> Self {
2431        std::default::Default::default()
2432    }
2433
2434    /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
2435    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2436        self.parent = v.into();
2437        self
2438    }
2439
2440    /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
2441    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2442        self.page_size = v.into();
2443        self
2444    }
2445
2446    /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
2447    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2448        self.page_token = v.into();
2449        self
2450    }
2451
2452    /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
2453    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454        self.filter = v.into();
2455        self
2456    }
2457
2458    /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
2459    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2460        self.order_by = v.into();
2461        self
2462    }
2463}
2464
2465impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2466    fn typename() -> &'static str {
2467        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2468    }
2469}
2470
2471/// Response for ListServiceConnectionPolicies.
2472#[derive(Clone, Default, PartialEq)]
2473#[non_exhaustive]
2474pub struct ListServiceConnectionPoliciesResponse {
2475    /// ServiceConnectionPolicies to be returned.
2476    pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2477
2478    /// The next pagination token in the List response. It should be used as
2479    /// page_token for the following request. An empty value means no more result.
2480    pub next_page_token: std::string::String,
2481
2482    /// Locations that could not be reached.
2483    pub unreachable: std::vec::Vec<std::string::String>,
2484
2485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2486}
2487
2488impl ListServiceConnectionPoliciesResponse {
2489    pub fn new() -> Self {
2490        std::default::Default::default()
2491    }
2492
2493    /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
2494    pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2495    where
2496        T: std::iter::IntoIterator<Item = V>,
2497        V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2498    {
2499        use std::iter::Iterator;
2500        self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2501        self
2502    }
2503
2504    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
2505    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2506        self.next_page_token = v.into();
2507        self
2508    }
2509
2510    /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
2511    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2512    where
2513        T: std::iter::IntoIterator<Item = V>,
2514        V: std::convert::Into<std::string::String>,
2515    {
2516        use std::iter::Iterator;
2517        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2518        self
2519    }
2520}
2521
2522impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2523    fn typename() -> &'static str {
2524        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2525    }
2526}
2527
2528#[doc(hidden)]
2529impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2530    type PageItem = crate::model::ServiceConnectionPolicy;
2531
2532    fn items(self) -> std::vec::Vec<Self::PageItem> {
2533        self.service_connection_policies
2534    }
2535
2536    fn next_page_token(&self) -> std::string::String {
2537        use std::clone::Clone;
2538        self.next_page_token.clone()
2539    }
2540}
2541
2542/// Request for GetServiceConnectionPolicy.
2543#[derive(Clone, Default, PartialEq)]
2544#[non_exhaustive]
2545pub struct GetServiceConnectionPolicyRequest {
2546    /// Required. Name of the ServiceConnectionPolicy to get.
2547    pub name: std::string::String,
2548
2549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2550}
2551
2552impl GetServiceConnectionPolicyRequest {
2553    pub fn new() -> Self {
2554        std::default::Default::default()
2555    }
2556
2557    /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
2558    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2559        self.name = v.into();
2560        self
2561    }
2562}
2563
2564impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2565    fn typename() -> &'static str {
2566        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2567    }
2568}
2569
2570/// Request for CreateServiceConnectionPolicy.
2571#[derive(Clone, Default, PartialEq)]
2572#[non_exhaustive]
2573pub struct CreateServiceConnectionPolicyRequest {
2574    /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
2575    /// projects/123/locations/us-east1
2576    pub parent: std::string::String,
2577
2578    /// Optional. Resource ID
2579    /// (i.e. 'foo' in
2580    /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
2581    /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
2582    pub service_connection_policy_id: std::string::String,
2583
2584    /// Required. Initial values for a new ServiceConnectionPolicies
2585    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2586
2587    /// Optional. An optional request ID to identify requests. Specify a unique
2588    /// request ID so that if you must retry your request, the server will know to
2589    /// ignore the request if it has already been completed. The server will
2590    /// guarantee that for at least 60 minutes since the first request.
2591    ///
2592    /// For example, consider a situation where you make an initial request and
2593    /// the request times out. If you make the request again with the same request
2594    /// ID, the server can check if original operation with the same request ID
2595    /// was received, and if so, will ignore the second request. This prevents
2596    /// clients from accidentally creating duplicate commitments.
2597    ///
2598    /// The request ID must be a valid UUID with the exception that zero UUID is
2599    /// not supported (00000000-0000-0000-0000-000000000000).
2600    pub request_id: std::string::String,
2601
2602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2603}
2604
2605impl CreateServiceConnectionPolicyRequest {
2606    pub fn new() -> Self {
2607        std::default::Default::default()
2608    }
2609
2610    /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
2611    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612        self.parent = v.into();
2613        self
2614    }
2615
2616    /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
2617    pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2618        mut self,
2619        v: T,
2620    ) -> Self {
2621        self.service_connection_policy_id = v.into();
2622        self
2623    }
2624
2625    /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
2626    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
2627    where
2628        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2629    {
2630        self.service_connection_policy = std::option::Option::Some(v.into());
2631        self
2632    }
2633
2634    /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
2635    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
2636    where
2637        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2638    {
2639        self.service_connection_policy = v.map(|x| x.into());
2640        self
2641    }
2642
2643    /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
2644    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2645        self.request_id = v.into();
2646        self
2647    }
2648}
2649
2650impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2651    fn typename() -> &'static str {
2652        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2653    }
2654}
2655
2656/// Request for UpdateServiceConnectionPolicy.
2657#[derive(Clone, Default, PartialEq)]
2658#[non_exhaustive]
2659pub struct UpdateServiceConnectionPolicyRequest {
2660    /// Optional. Field mask is used to specify the fields to be overwritten in the
2661    /// ServiceConnectionPolicy resource by the update.
2662    /// The fields specified in the update_mask are relative to the resource, not
2663    /// the full request. A field will be overwritten if it is in the mask. If the
2664    /// user does not provide a mask then all fields will be overwritten.
2665    pub update_mask: std::option::Option<wkt::FieldMask>,
2666
2667    /// Required. New values to be patched into the resource.
2668    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2669
2670    /// Optional. An optional request ID to identify requests. Specify a unique
2671    /// request ID so that if you must retry your request, the server will know to
2672    /// ignore the request if it has already been completed. The server will
2673    /// guarantee that for at least 60 minutes since the first request.
2674    ///
2675    /// For example, consider a situation where you make an initial request and
2676    /// the request times out. If you make the request again with the same request
2677    /// ID, the server can check if original operation with the same request ID
2678    /// was received, and if so, will ignore the second request. This prevents
2679    /// clients from accidentally creating duplicate commitments.
2680    ///
2681    /// The request ID must be a valid UUID with the exception that zero UUID is
2682    /// not supported (00000000-0000-0000-0000-000000000000).
2683    pub request_id: std::string::String,
2684
2685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2686}
2687
2688impl UpdateServiceConnectionPolicyRequest {
2689    pub fn new() -> Self {
2690        std::default::Default::default()
2691    }
2692
2693    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
2694    pub fn set_update_mask<T>(mut self, v: T) -> Self
2695    where
2696        T: std::convert::Into<wkt::FieldMask>,
2697    {
2698        self.update_mask = std::option::Option::Some(v.into());
2699        self
2700    }
2701
2702    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
2703    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2704    where
2705        T: std::convert::Into<wkt::FieldMask>,
2706    {
2707        self.update_mask = v.map(|x| x.into());
2708        self
2709    }
2710
2711    /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
2712    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
2713    where
2714        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2715    {
2716        self.service_connection_policy = std::option::Option::Some(v.into());
2717        self
2718    }
2719
2720    /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
2721    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
2722    where
2723        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2724    {
2725        self.service_connection_policy = v.map(|x| x.into());
2726        self
2727    }
2728
2729    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
2730    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2731        self.request_id = v.into();
2732        self
2733    }
2734}
2735
2736impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2737    fn typename() -> &'static str {
2738        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2739    }
2740}
2741
2742/// Request for DeleteServiceConnectionPolicy.
2743#[derive(Clone, Default, PartialEq)]
2744#[non_exhaustive]
2745pub struct DeleteServiceConnectionPolicyRequest {
2746    /// Required. The name of the ServiceConnectionPolicy to delete.
2747    pub name: std::string::String,
2748
2749    /// Optional. An optional request ID to identify requests. Specify a unique
2750    /// request ID so that if you must retry your request, the server will know to
2751    /// ignore the request if it has already been completed. The server will
2752    /// guarantee that for at least 60 minutes after the first request.
2753    ///
2754    /// For example, consider a situation where you make an initial request and
2755    /// the request times out. If you make the request again with the same request
2756    /// ID, the server can check if original operation with the same request ID
2757    /// was received, and if so, will ignore the second request. This prevents
2758    /// clients from accidentally creating duplicate commitments.
2759    ///
2760    /// The request ID must be a valid UUID with the exception that zero UUID is
2761    /// not supported (00000000-0000-0000-0000-000000000000).
2762    pub request_id: std::string::String,
2763
2764    /// Optional. The etag is computed by the server, and may be sent on update and
2765    /// delete requests to ensure the client has an up-to-date value before
2766    /// proceeding.
2767    pub etag: std::option::Option<std::string::String>,
2768
2769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2770}
2771
2772impl DeleteServiceConnectionPolicyRequest {
2773    pub fn new() -> Self {
2774        std::default::Default::default()
2775    }
2776
2777    /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
2778    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2779        self.name = v.into();
2780        self
2781    }
2782
2783    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
2784    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2785        self.request_id = v.into();
2786        self
2787    }
2788
2789    /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
2790    pub fn set_etag<T>(mut self, v: T) -> Self
2791    where
2792        T: std::convert::Into<std::string::String>,
2793    {
2794        self.etag = std::option::Option::Some(v.into());
2795        self
2796    }
2797
2798    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
2799    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2800    where
2801        T: std::convert::Into<std::string::String>,
2802    {
2803        self.etag = v.map(|x| x.into());
2804        self
2805    }
2806}
2807
2808impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2809    fn typename() -> &'static str {
2810        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2811    }
2812}
2813
2814/// The ServiceClass resource.
2815#[derive(Clone, Default, PartialEq)]
2816#[non_exhaustive]
2817pub struct ServiceClass {
2818    /// Immutable. The name of a ServiceClass resource.
2819    /// Format:
2820    /// projects/{project}/locations/{location}/serviceClasses/{service_class}
2821    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2822    pub name: std::string::String,
2823
2824    /// Output only. The generated service class name. Use this name to refer to
2825    /// the Service class in Service Connection Maps and Service Connection
2826    /// Policies.
2827    pub service_class: std::string::String,
2828
2829    /// Output only. Time when the ServiceClass was created.
2830    pub create_time: std::option::Option<wkt::Timestamp>,
2831
2832    /// Output only. Time when the ServiceClass was updated.
2833    pub update_time: std::option::Option<wkt::Timestamp>,
2834
2835    /// User-defined labels.
2836    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2837
2838    /// A description of this resource.
2839    pub description: std::string::String,
2840
2841    /// Optional. The etag is computed by the server, and may be sent on update and
2842    /// delete requests to ensure the client has an up-to-date value before
2843    /// proceeding.
2844    pub etag: std::option::Option<std::string::String>,
2845
2846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2847}
2848
2849impl ServiceClass {
2850    pub fn new() -> Self {
2851        std::default::Default::default()
2852    }
2853
2854    /// Sets the value of [name][crate::model::ServiceClass::name].
2855    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2856        self.name = v.into();
2857        self
2858    }
2859
2860    /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
2861    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2862        self.service_class = v.into();
2863        self
2864    }
2865
2866    /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
2867    pub fn set_create_time<T>(mut self, v: T) -> Self
2868    where
2869        T: std::convert::Into<wkt::Timestamp>,
2870    {
2871        self.create_time = std::option::Option::Some(v.into());
2872        self
2873    }
2874
2875    /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
2876    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2877    where
2878        T: std::convert::Into<wkt::Timestamp>,
2879    {
2880        self.create_time = v.map(|x| x.into());
2881        self
2882    }
2883
2884    /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
2885    pub fn set_update_time<T>(mut self, v: T) -> Self
2886    where
2887        T: std::convert::Into<wkt::Timestamp>,
2888    {
2889        self.update_time = std::option::Option::Some(v.into());
2890        self
2891    }
2892
2893    /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
2894    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2895    where
2896        T: std::convert::Into<wkt::Timestamp>,
2897    {
2898        self.update_time = v.map(|x| x.into());
2899        self
2900    }
2901
2902    /// Sets the value of [labels][crate::model::ServiceClass::labels].
2903    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2904    where
2905        T: std::iter::IntoIterator<Item = (K, V)>,
2906        K: std::convert::Into<std::string::String>,
2907        V: std::convert::Into<std::string::String>,
2908    {
2909        use std::iter::Iterator;
2910        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2911        self
2912    }
2913
2914    /// Sets the value of [description][crate::model::ServiceClass::description].
2915    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2916        self.description = v.into();
2917        self
2918    }
2919
2920    /// Sets the value of [etag][crate::model::ServiceClass::etag].
2921    pub fn set_etag<T>(mut self, v: T) -> Self
2922    where
2923        T: std::convert::Into<std::string::String>,
2924    {
2925        self.etag = std::option::Option::Some(v.into());
2926        self
2927    }
2928
2929    /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
2930    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2931    where
2932        T: std::convert::Into<std::string::String>,
2933    {
2934        self.etag = v.map(|x| x.into());
2935        self
2936    }
2937}
2938
2939impl wkt::message::Message for ServiceClass {
2940    fn typename() -> &'static str {
2941        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2942    }
2943}
2944
2945/// Request for ListServiceClasses.
2946#[derive(Clone, Default, PartialEq)]
2947#[non_exhaustive]
2948pub struct ListServiceClassesRequest {
2949    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2950    pub parent: std::string::String,
2951
2952    /// The maximum number of results per page that should be returned.
2953    pub page_size: i32,
2954
2955    /// The page token.
2956    pub page_token: std::string::String,
2957
2958    /// A filter expression that filters the results listed in the response.
2959    pub filter: std::string::String,
2960
2961    /// Sort the results by a certain order.
2962    pub order_by: std::string::String,
2963
2964    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2965}
2966
2967impl ListServiceClassesRequest {
2968    pub fn new() -> Self {
2969        std::default::Default::default()
2970    }
2971
2972    /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
2973    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2974        self.parent = v.into();
2975        self
2976    }
2977
2978    /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
2979    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2980        self.page_size = v.into();
2981        self
2982    }
2983
2984    /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
2985    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2986        self.page_token = v.into();
2987        self
2988    }
2989
2990    /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
2991    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2992        self.filter = v.into();
2993        self
2994    }
2995
2996    /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
2997    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2998        self.order_by = v.into();
2999        self
3000    }
3001}
3002
3003impl wkt::message::Message for ListServiceClassesRequest {
3004    fn typename() -> &'static str {
3005        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
3006    }
3007}
3008
3009/// Response for ListServiceClasses.
3010#[derive(Clone, Default, PartialEq)]
3011#[non_exhaustive]
3012pub struct ListServiceClassesResponse {
3013    /// ServiceClasses to be returned.
3014    pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
3015
3016    /// The next pagination token in the List response. It should be used as
3017    /// page_token for the following request. An empty value means no more result.
3018    pub next_page_token: std::string::String,
3019
3020    /// Locations that could not be reached.
3021    pub unreachable: std::vec::Vec<std::string::String>,
3022
3023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3024}
3025
3026impl ListServiceClassesResponse {
3027    pub fn new() -> Self {
3028        std::default::Default::default()
3029    }
3030
3031    /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
3032    pub fn set_service_classes<T, V>(mut self, v: T) -> Self
3033    where
3034        T: std::iter::IntoIterator<Item = V>,
3035        V: std::convert::Into<crate::model::ServiceClass>,
3036    {
3037        use std::iter::Iterator;
3038        self.service_classes = v.into_iter().map(|i| i.into()).collect();
3039        self
3040    }
3041
3042    /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
3043    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3044        self.next_page_token = v.into();
3045        self
3046    }
3047
3048    /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
3049    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3050    where
3051        T: std::iter::IntoIterator<Item = V>,
3052        V: std::convert::Into<std::string::String>,
3053    {
3054        use std::iter::Iterator;
3055        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3056        self
3057    }
3058}
3059
3060impl wkt::message::Message for ListServiceClassesResponse {
3061    fn typename() -> &'static str {
3062        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
3063    }
3064}
3065
3066#[doc(hidden)]
3067impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
3068    type PageItem = crate::model::ServiceClass;
3069
3070    fn items(self) -> std::vec::Vec<Self::PageItem> {
3071        self.service_classes
3072    }
3073
3074    fn next_page_token(&self) -> std::string::String {
3075        use std::clone::Clone;
3076        self.next_page_token.clone()
3077    }
3078}
3079
3080/// Request for GetServiceClass.
3081#[derive(Clone, Default, PartialEq)]
3082#[non_exhaustive]
3083pub struct GetServiceClassRequest {
3084    /// Required. Name of the ServiceClass to get.
3085    pub name: std::string::String,
3086
3087    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3088}
3089
3090impl GetServiceClassRequest {
3091    pub fn new() -> Self {
3092        std::default::Default::default()
3093    }
3094
3095    /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
3096    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3097        self.name = v.into();
3098        self
3099    }
3100}
3101
3102impl wkt::message::Message for GetServiceClassRequest {
3103    fn typename() -> &'static str {
3104        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
3105    }
3106}
3107
3108/// Request for UpdateServiceClass.
3109#[derive(Clone, Default, PartialEq)]
3110#[non_exhaustive]
3111pub struct UpdateServiceClassRequest {
3112    /// Optional. Field mask is used to specify the fields to be overwritten in the
3113    /// ServiceClass resource by the update.
3114    /// The fields specified in the update_mask are relative to the resource, not
3115    /// the full request. A field will be overwritten if it is in the mask. If the
3116    /// user does not provide a mask then all fields will be overwritten.
3117    pub update_mask: std::option::Option<wkt::FieldMask>,
3118
3119    /// Required. New values to be patched into the resource.
3120    pub service_class: std::option::Option<crate::model::ServiceClass>,
3121
3122    /// Optional. An optional request ID to identify requests. Specify a unique
3123    /// request ID so that if you must retry your request, the server will know to
3124    /// ignore the request if it has already been completed. The server will
3125    /// guarantee that for at least 60 minutes since the first request.
3126    ///
3127    /// For example, consider a situation where you make an initial request and
3128    /// the request times out. If you make the request again with the same request
3129    /// ID, the server can check if original operation with the same request ID
3130    /// was received, and if so, will ignore the second request. This prevents
3131    /// clients from accidentally creating duplicate commitments.
3132    ///
3133    /// The request ID must be a valid UUID with the exception that zero UUID is
3134    /// not supported (00000000-0000-0000-0000-000000000000).
3135    pub request_id: std::string::String,
3136
3137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3138}
3139
3140impl UpdateServiceClassRequest {
3141    pub fn new() -> Self {
3142        std::default::Default::default()
3143    }
3144
3145    /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
3146    pub fn set_update_mask<T>(mut self, v: T) -> Self
3147    where
3148        T: std::convert::Into<wkt::FieldMask>,
3149    {
3150        self.update_mask = std::option::Option::Some(v.into());
3151        self
3152    }
3153
3154    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
3155    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3156    where
3157        T: std::convert::Into<wkt::FieldMask>,
3158    {
3159        self.update_mask = v.map(|x| x.into());
3160        self
3161    }
3162
3163    /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
3164    pub fn set_service_class<T>(mut self, v: T) -> Self
3165    where
3166        T: std::convert::Into<crate::model::ServiceClass>,
3167    {
3168        self.service_class = std::option::Option::Some(v.into());
3169        self
3170    }
3171
3172    /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
3173    pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
3174    where
3175        T: std::convert::Into<crate::model::ServiceClass>,
3176    {
3177        self.service_class = v.map(|x| x.into());
3178        self
3179    }
3180
3181    /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
3182    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183        self.request_id = v.into();
3184        self
3185    }
3186}
3187
3188impl wkt::message::Message for UpdateServiceClassRequest {
3189    fn typename() -> &'static str {
3190        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
3191    }
3192}
3193
3194/// Request for DeleteServiceClass.
3195#[derive(Clone, Default, PartialEq)]
3196#[non_exhaustive]
3197pub struct DeleteServiceClassRequest {
3198    /// Required. The name of the ServiceClass to delete.
3199    pub name: std::string::String,
3200
3201    /// Optional. An optional request ID to identify requests. Specify a unique
3202    /// request ID so that if you must retry your request, the server will know to
3203    /// ignore the request if it has already been completed. The server will
3204    /// guarantee that for at least 60 minutes after the first request.
3205    ///
3206    /// For example, consider a situation where you make an initial request and
3207    /// the request times out. If you make the request again with the same request
3208    /// ID, the server can check if original operation with the same request ID
3209    /// was received, and if so, will ignore the second request. This prevents
3210    /// clients from accidentally creating duplicate commitments.
3211    ///
3212    /// The request ID must be a valid UUID with the exception that zero UUID is
3213    /// not supported (00000000-0000-0000-0000-000000000000).
3214    pub request_id: std::string::String,
3215
3216    /// Optional. The etag is computed by the server, and may be sent on update and
3217    /// delete requests to ensure the client has an up-to-date value before
3218    /// proceeding.
3219    pub etag: std::option::Option<std::string::String>,
3220
3221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3222}
3223
3224impl DeleteServiceClassRequest {
3225    pub fn new() -> Self {
3226        std::default::Default::default()
3227    }
3228
3229    /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
3230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3231        self.name = v.into();
3232        self
3233    }
3234
3235    /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
3236    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237        self.request_id = v.into();
3238        self
3239    }
3240
3241    /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
3242    pub fn set_etag<T>(mut self, v: T) -> Self
3243    where
3244        T: std::convert::Into<std::string::String>,
3245    {
3246        self.etag = std::option::Option::Some(v.into());
3247        self
3248    }
3249
3250    /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
3251    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3252    where
3253        T: std::convert::Into<std::string::String>,
3254    {
3255        self.etag = v.map(|x| x.into());
3256        self
3257    }
3258}
3259
3260impl wkt::message::Message for DeleteServiceClassRequest {
3261    fn typename() -> &'static str {
3262        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
3263    }
3264}
3265
3266/// The ServiceConnectionToken resource.
3267#[derive(Clone, Default, PartialEq)]
3268#[non_exhaustive]
3269pub struct ServiceConnectionToken {
3270    /// Immutable. The name of a ServiceConnectionToken.
3271    /// Format:
3272    /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
3273    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3274    pub name: std::string::String,
3275
3276    /// Output only. Time when the ServiceConnectionToken was created.
3277    pub create_time: std::option::Option<wkt::Timestamp>,
3278
3279    /// Output only. Time when the ServiceConnectionToken was updated.
3280    pub update_time: std::option::Option<wkt::Timestamp>,
3281
3282    /// User-defined labels.
3283    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3284
3285    /// A description of this resource.
3286    pub description: std::string::String,
3287
3288    /// The resource path of the network associated with this token.
3289    /// Example:
3290    /// projects/{projectNumOrId}/global/networks/{resourceId}.
3291    pub network: std::string::String,
3292
3293    /// Output only. The token generated by Automation.
3294    pub token: std::string::String,
3295
3296    /// Output only. The time to which this token is valid.
3297    pub expire_time: std::option::Option<wkt::Timestamp>,
3298
3299    /// Optional. The etag is computed by the server, and may be sent on update and
3300    /// delete requests to ensure the client has an up-to-date value before
3301    /// proceeding.
3302    pub etag: std::option::Option<std::string::String>,
3303
3304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3305}
3306
3307impl ServiceConnectionToken {
3308    pub fn new() -> Self {
3309        std::default::Default::default()
3310    }
3311
3312    /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
3313    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3314        self.name = v.into();
3315        self
3316    }
3317
3318    /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
3319    pub fn set_create_time<T>(mut self, v: T) -> Self
3320    where
3321        T: std::convert::Into<wkt::Timestamp>,
3322    {
3323        self.create_time = std::option::Option::Some(v.into());
3324        self
3325    }
3326
3327    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
3328    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3329    where
3330        T: std::convert::Into<wkt::Timestamp>,
3331    {
3332        self.create_time = v.map(|x| x.into());
3333        self
3334    }
3335
3336    /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
3337    pub fn set_update_time<T>(mut self, v: T) -> Self
3338    where
3339        T: std::convert::Into<wkt::Timestamp>,
3340    {
3341        self.update_time = std::option::Option::Some(v.into());
3342        self
3343    }
3344
3345    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
3346    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3347    where
3348        T: std::convert::Into<wkt::Timestamp>,
3349    {
3350        self.update_time = v.map(|x| x.into());
3351        self
3352    }
3353
3354    /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
3355    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3356    where
3357        T: std::iter::IntoIterator<Item = (K, V)>,
3358        K: std::convert::Into<std::string::String>,
3359        V: std::convert::Into<std::string::String>,
3360    {
3361        use std::iter::Iterator;
3362        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3363        self
3364    }
3365
3366    /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
3367    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3368        self.description = v.into();
3369        self
3370    }
3371
3372    /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
3373    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3374        self.network = v.into();
3375        self
3376    }
3377
3378    /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
3379    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3380        self.token = v.into();
3381        self
3382    }
3383
3384    /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
3385    pub fn set_expire_time<T>(mut self, v: T) -> Self
3386    where
3387        T: std::convert::Into<wkt::Timestamp>,
3388    {
3389        self.expire_time = std::option::Option::Some(v.into());
3390        self
3391    }
3392
3393    /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
3394    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3395    where
3396        T: std::convert::Into<wkt::Timestamp>,
3397    {
3398        self.expire_time = v.map(|x| x.into());
3399        self
3400    }
3401
3402    /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
3403    pub fn set_etag<T>(mut self, v: T) -> Self
3404    where
3405        T: std::convert::Into<std::string::String>,
3406    {
3407        self.etag = std::option::Option::Some(v.into());
3408        self
3409    }
3410
3411    /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
3412    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3413    where
3414        T: std::convert::Into<std::string::String>,
3415    {
3416        self.etag = v.map(|x| x.into());
3417        self
3418    }
3419}
3420
3421impl wkt::message::Message for ServiceConnectionToken {
3422    fn typename() -> &'static str {
3423        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
3424    }
3425}
3426
3427/// Request for ListServiceConnectionTokens.
3428#[derive(Clone, Default, PartialEq)]
3429#[non_exhaustive]
3430pub struct ListServiceConnectionTokensRequest {
3431    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3432    pub parent: std::string::String,
3433
3434    /// The maximum number of results per page that should be returned.
3435    pub page_size: i32,
3436
3437    /// The page token.
3438    pub page_token: std::string::String,
3439
3440    /// A filter expression that filters the results listed in the response.
3441    pub filter: std::string::String,
3442
3443    /// Sort the results by a certain order.
3444    pub order_by: std::string::String,
3445
3446    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3447}
3448
3449impl ListServiceConnectionTokensRequest {
3450    pub fn new() -> Self {
3451        std::default::Default::default()
3452    }
3453
3454    /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
3455    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456        self.parent = v.into();
3457        self
3458    }
3459
3460    /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
3461    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3462        self.page_size = v.into();
3463        self
3464    }
3465
3466    /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
3467    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3468        self.page_token = v.into();
3469        self
3470    }
3471
3472    /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
3473    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3474        self.filter = v.into();
3475        self
3476    }
3477
3478    /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
3479    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3480        self.order_by = v.into();
3481        self
3482    }
3483}
3484
3485impl wkt::message::Message for ListServiceConnectionTokensRequest {
3486    fn typename() -> &'static str {
3487        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3488    }
3489}
3490
3491/// Response for ListServiceConnectionTokens.
3492#[derive(Clone, Default, PartialEq)]
3493#[non_exhaustive]
3494pub struct ListServiceConnectionTokensResponse {
3495    /// ServiceConnectionTokens to be returned.
3496    pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3497
3498    /// The next pagination token in the List response. It should be used as
3499    /// page_token for the following request. An empty value means no more result.
3500    pub next_page_token: std::string::String,
3501
3502    /// Locations that could not be reached.
3503    pub unreachable: std::vec::Vec<std::string::String>,
3504
3505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3506}
3507
3508impl ListServiceConnectionTokensResponse {
3509    pub fn new() -> Self {
3510        std::default::Default::default()
3511    }
3512
3513    /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
3514    pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3515    where
3516        T: std::iter::IntoIterator<Item = V>,
3517        V: std::convert::Into<crate::model::ServiceConnectionToken>,
3518    {
3519        use std::iter::Iterator;
3520        self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3521        self
3522    }
3523
3524    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
3525    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3526        self.next_page_token = v.into();
3527        self
3528    }
3529
3530    /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
3531    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3532    where
3533        T: std::iter::IntoIterator<Item = V>,
3534        V: std::convert::Into<std::string::String>,
3535    {
3536        use std::iter::Iterator;
3537        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3538        self
3539    }
3540}
3541
3542impl wkt::message::Message for ListServiceConnectionTokensResponse {
3543    fn typename() -> &'static str {
3544        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3545    }
3546}
3547
3548#[doc(hidden)]
3549impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3550    type PageItem = crate::model::ServiceConnectionToken;
3551
3552    fn items(self) -> std::vec::Vec<Self::PageItem> {
3553        self.service_connection_tokens
3554    }
3555
3556    fn next_page_token(&self) -> std::string::String {
3557        use std::clone::Clone;
3558        self.next_page_token.clone()
3559    }
3560}
3561
3562/// Request for GetServiceConnectionToken.
3563#[derive(Clone, Default, PartialEq)]
3564#[non_exhaustive]
3565pub struct GetServiceConnectionTokenRequest {
3566    /// Required. Name of the ServiceConnectionToken to get.
3567    pub name: std::string::String,
3568
3569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3570}
3571
3572impl GetServiceConnectionTokenRequest {
3573    pub fn new() -> Self {
3574        std::default::Default::default()
3575    }
3576
3577    /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
3578    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3579        self.name = v.into();
3580        self
3581    }
3582}
3583
3584impl wkt::message::Message for GetServiceConnectionTokenRequest {
3585    fn typename() -> &'static str {
3586        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3587    }
3588}
3589
3590/// Request for CreateServiceConnectionToken.
3591#[derive(Clone, Default, PartialEq)]
3592#[non_exhaustive]
3593pub struct CreateServiceConnectionTokenRequest {
3594    /// Required. The parent resource's name of the ServiceConnectionToken. ex.
3595    /// projects/123/locations/us-east1
3596    pub parent: std::string::String,
3597
3598    /// Optional. Resource ID
3599    /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
3600    /// See <https://google.aip.dev/122#resource-id-segments>
3601    /// Unique per location.
3602    /// If one is not provided, one will be generated.
3603    pub service_connection_token_id: std::string::String,
3604
3605    /// Required. Initial values for a new ServiceConnectionTokens
3606    pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3607
3608    /// Optional. An optional request ID to identify requests. Specify a unique
3609    /// request ID so that if you must retry your request, the server will know to
3610    /// ignore the request if it has already been completed. The server will
3611    /// guarantee that for at least 60 minutes since the first request.
3612    ///
3613    /// For example, consider a situation where you make an initial request and
3614    /// the request times out. If you make the request again with the same request
3615    /// ID, the server can check if original operation with the same request ID
3616    /// was received, and if so, will ignore the second request. This prevents
3617    /// clients from accidentally creating duplicate commitments.
3618    ///
3619    /// The request ID must be a valid UUID with the exception that zero UUID is
3620    /// not supported (00000000-0000-0000-0000-000000000000).
3621    pub request_id: std::string::String,
3622
3623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3624}
3625
3626impl CreateServiceConnectionTokenRequest {
3627    pub fn new() -> Self {
3628        std::default::Default::default()
3629    }
3630
3631    /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
3632    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3633        self.parent = v.into();
3634        self
3635    }
3636
3637    /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
3638    pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3639        mut self,
3640        v: T,
3641    ) -> Self {
3642        self.service_connection_token_id = v.into();
3643        self
3644    }
3645
3646    /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
3647    pub fn set_service_connection_token<T>(mut self, v: T) -> Self
3648    where
3649        T: std::convert::Into<crate::model::ServiceConnectionToken>,
3650    {
3651        self.service_connection_token = std::option::Option::Some(v.into());
3652        self
3653    }
3654
3655    /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
3656    pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
3657    where
3658        T: std::convert::Into<crate::model::ServiceConnectionToken>,
3659    {
3660        self.service_connection_token = v.map(|x| x.into());
3661        self
3662    }
3663
3664    /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
3665    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3666        self.request_id = v.into();
3667        self
3668    }
3669}
3670
3671impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3672    fn typename() -> &'static str {
3673        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3674    }
3675}
3676
3677/// Request for DeleteServiceConnectionToken.
3678#[derive(Clone, Default, PartialEq)]
3679#[non_exhaustive]
3680pub struct DeleteServiceConnectionTokenRequest {
3681    /// Required. The name of the ServiceConnectionToken to delete.
3682    pub name: std::string::String,
3683
3684    /// Optional. An optional request ID to identify requests. Specify a unique
3685    /// request ID so that if you must retry your request, the server will know to
3686    /// ignore the request if it has already been completed. The server will
3687    /// guarantee that for at least 60 minutes after the first request.
3688    ///
3689    /// For example, consider a situation where you make an initial request and
3690    /// the request times out. If you make the request again with the same request
3691    /// ID, the server can check if original operation with the same request ID
3692    /// was received, and if so, will ignore the second request. This prevents
3693    /// clients from accidentally creating duplicate commitments.
3694    ///
3695    /// The request ID must be a valid UUID with the exception that zero UUID is
3696    /// not supported (00000000-0000-0000-0000-000000000000).
3697    pub request_id: std::string::String,
3698
3699    /// Optional. The etag is computed by the server, and may be sent on update and
3700    /// delete requests to ensure the client has an up-to-date value before
3701    /// proceeding.
3702    pub etag: std::option::Option<std::string::String>,
3703
3704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705}
3706
3707impl DeleteServiceConnectionTokenRequest {
3708    pub fn new() -> Self {
3709        std::default::Default::default()
3710    }
3711
3712    /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
3713    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3714        self.name = v.into();
3715        self
3716    }
3717
3718    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
3719    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3720        self.request_id = v.into();
3721        self
3722    }
3723
3724    /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
3725    pub fn set_etag<T>(mut self, v: T) -> Self
3726    where
3727        T: std::convert::Into<std::string::String>,
3728    {
3729        self.etag = std::option::Option::Some(v.into());
3730        self
3731    }
3732
3733    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
3734    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3735    where
3736        T: std::convert::Into<std::string::String>,
3737    {
3738        self.etag = v.map(|x| x.into());
3739        self
3740    }
3741}
3742
3743impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3744    fn typename() -> &'static str {
3745        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3746    }
3747}
3748
3749/// The `MulticloudDataTransferConfig` resource. It lists the services that you
3750/// configure for Data Transfer Essentials billing and metering.
3751#[derive(Clone, Default, PartialEq)]
3752#[non_exhaustive]
3753pub struct MulticloudDataTransferConfig {
3754    /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
3755    /// Format:
3756    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
3757    pub name: std::string::String,
3758
3759    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
3760    /// created.
3761    pub create_time: std::option::Option<wkt::Timestamp>,
3762
3763    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
3764    /// updated.
3765    pub update_time: std::option::Option<wkt::Timestamp>,
3766
3767    /// Optional. User-defined labels.
3768    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3769
3770    /// The etag is computed by the server, and might be sent with update and
3771    /// delete requests so that the client has an up-to-date value before
3772    /// proceeding.
3773    pub etag: std::string::String,
3774
3775    /// Optional. A description of this resource.
3776    pub description: std::string::String,
3777
3778    /// Output only. The number of `Destination` resources configured for the
3779    /// `MulticloudDataTransferConfig` resource.
3780    pub destinations_count: i32,
3781
3782    /// Output only. The number of `Destination` resources in use with the
3783    /// `MulticloudDataTransferConfig` resource.
3784    pub destinations_active_count: i32,
3785
3786    /// Optional. Maps services to their current or planned states. Service names
3787    /// are keys, and the associated values describe the state of the service. If a
3788    /// state change is expected, the value is either `ADDING` or `DELETING`,
3789    /// depending on the actions taken.
3790    ///
3791    /// Sample output:
3792    /// "services": {
3793    /// "big-query": {
3794    /// "states": [
3795    /// {
3796    /// "effectiveTime": "2024-12-12T08:00:00Z"
3797    /// "state": "ADDING",
3798    /// },
3799    /// ]
3800    /// },
3801    /// "cloud-storage": {
3802    /// "states": [
3803    /// {
3804    /// "state": "ACTIVE",
3805    /// }
3806    /// ]
3807    /// }
3808    /// }
3809    pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
3810
3811    /// Output only. The Google-generated unique ID for the
3812    /// `MulticloudDataTransferConfig` resource. This value is unique across all
3813    /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
3814    /// another with the same name is created, the new resource is assigned a
3815    /// different and unique ID.
3816    pub uid: std::string::String,
3817
3818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3819}
3820
3821impl MulticloudDataTransferConfig {
3822    pub fn new() -> Self {
3823        std::default::Default::default()
3824    }
3825
3826    /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
3827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3828        self.name = v.into();
3829        self
3830    }
3831
3832    /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
3833    pub fn set_create_time<T>(mut self, v: T) -> Self
3834    where
3835        T: std::convert::Into<wkt::Timestamp>,
3836    {
3837        self.create_time = std::option::Option::Some(v.into());
3838        self
3839    }
3840
3841    /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
3842    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3843    where
3844        T: std::convert::Into<wkt::Timestamp>,
3845    {
3846        self.create_time = v.map(|x| x.into());
3847        self
3848    }
3849
3850    /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
3851    pub fn set_update_time<T>(mut self, v: T) -> Self
3852    where
3853        T: std::convert::Into<wkt::Timestamp>,
3854    {
3855        self.update_time = std::option::Option::Some(v.into());
3856        self
3857    }
3858
3859    /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
3860    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3861    where
3862        T: std::convert::Into<wkt::Timestamp>,
3863    {
3864        self.update_time = v.map(|x| x.into());
3865        self
3866    }
3867
3868    /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
3869    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3870    where
3871        T: std::iter::IntoIterator<Item = (K, V)>,
3872        K: std::convert::Into<std::string::String>,
3873        V: std::convert::Into<std::string::String>,
3874    {
3875        use std::iter::Iterator;
3876        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3877        self
3878    }
3879
3880    /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
3881    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3882        self.etag = v.into();
3883        self
3884    }
3885
3886    /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
3887    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3888        self.description = v.into();
3889        self
3890    }
3891
3892    /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
3893    pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3894        self.destinations_count = v.into();
3895        self
3896    }
3897
3898    /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
3899    pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3900        self.destinations_active_count = v.into();
3901        self
3902    }
3903
3904    /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
3905    pub fn set_services<T, K, V>(mut self, v: T) -> Self
3906    where
3907        T: std::iter::IntoIterator<Item = (K, V)>,
3908        K: std::convert::Into<std::string::String>,
3909        V: std::convert::Into<crate::model::StateTimeline>,
3910    {
3911        use std::iter::Iterator;
3912        self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3913        self
3914    }
3915
3916    /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
3917    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3918        self.uid = v.into();
3919        self
3920    }
3921}
3922
3923impl wkt::message::Message for MulticloudDataTransferConfig {
3924    fn typename() -> &'static str {
3925        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
3926    }
3927}
3928
3929/// Request message to list `MulticloudDataTransferConfig` resources.
3930#[derive(Clone, Default, PartialEq)]
3931#[non_exhaustive]
3932pub struct ListMulticloudDataTransferConfigsRequest {
3933    /// Required. The name of the parent resource.
3934    pub parent: std::string::String,
3935
3936    /// Optional. The maximum number of results listed per page.
3937    pub page_size: i32,
3938
3939    /// Optional. The page token.
3940    pub page_token: std::string::String,
3941
3942    /// Optional. An expression that filters the results listed in the response.
3943    pub filter: std::string::String,
3944
3945    /// Optional. The sort order of the results.
3946    pub order_by: std::string::String,
3947
3948    /// Optional. If `true`, allows partial responses for multi-regional aggregated
3949    /// list requests.
3950    pub return_partial_success: bool,
3951
3952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3953}
3954
3955impl ListMulticloudDataTransferConfigsRequest {
3956    pub fn new() -> Self {
3957        std::default::Default::default()
3958    }
3959
3960    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3961    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3962        self.parent = v.into();
3963        self
3964    }
3965
3966    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3967    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3968        self.page_size = v.into();
3969        self
3970    }
3971
3972    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3973    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3974        self.page_token = v.into();
3975        self
3976    }
3977
3978    /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3979    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3980        self.filter = v.into();
3981        self
3982    }
3983
3984    /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3985    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3986        self.order_by = v.into();
3987        self
3988    }
3989
3990    /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3991    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3992        self.return_partial_success = v.into();
3993        self
3994    }
3995}
3996
3997impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
3998    fn typename() -> &'static str {
3999        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
4000    }
4001}
4002
4003/// Response message to list `MulticloudDataTransferConfig` resources.
4004#[derive(Clone, Default, PartialEq)]
4005#[non_exhaustive]
4006pub struct ListMulticloudDataTransferConfigsResponse {
4007    /// The list of `MulticloudDataTransferConfig` resources to be listed.
4008    pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
4009
4010    /// The next page token.
4011    pub next_page_token: std::string::String,
4012
4013    /// Locations that could not be reached.
4014    pub unreachable: std::vec::Vec<std::string::String>,
4015
4016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4017}
4018
4019impl ListMulticloudDataTransferConfigsResponse {
4020    pub fn new() -> Self {
4021        std::default::Default::default()
4022    }
4023
4024    /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
4025    pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
4026    where
4027        T: std::iter::IntoIterator<Item = V>,
4028        V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4029    {
4030        use std::iter::Iterator;
4031        self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
4032        self
4033    }
4034
4035    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
4036    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4037        self.next_page_token = v.into();
4038        self
4039    }
4040
4041    /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
4042    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4043    where
4044        T: std::iter::IntoIterator<Item = V>,
4045        V: std::convert::Into<std::string::String>,
4046    {
4047        use std::iter::Iterator;
4048        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4049        self
4050    }
4051}
4052
4053impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
4054    fn typename() -> &'static str {
4055        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
4056    }
4057}
4058
4059#[doc(hidden)]
4060impl gax::paginator::internal::PageableResponse for ListMulticloudDataTransferConfigsResponse {
4061    type PageItem = crate::model::MulticloudDataTransferConfig;
4062
4063    fn items(self) -> std::vec::Vec<Self::PageItem> {
4064        self.multicloud_data_transfer_configs
4065    }
4066
4067    fn next_page_token(&self) -> std::string::String {
4068        use std::clone::Clone;
4069        self.next_page_token.clone()
4070    }
4071}
4072
4073/// Request message to get the details of a `MulticloudDataTransferConfig`
4074/// resource.
4075#[derive(Clone, Default, PartialEq)]
4076#[non_exhaustive]
4077pub struct GetMulticloudDataTransferConfigRequest {
4078    /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
4079    pub name: std::string::String,
4080
4081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4082}
4083
4084impl GetMulticloudDataTransferConfigRequest {
4085    pub fn new() -> Self {
4086        std::default::Default::default()
4087    }
4088
4089    /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
4090    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4091        self.name = v.into();
4092        self
4093    }
4094}
4095
4096impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
4097    fn typename() -> &'static str {
4098        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
4099    }
4100}
4101
4102/// Request message to create a `MulticloudDataTransferConfig` resource.
4103#[derive(Clone, Default, PartialEq)]
4104#[non_exhaustive]
4105pub struct CreateMulticloudDataTransferConfigRequest {
4106    /// Required. The name of the parent resource.
4107    pub parent: std::string::String,
4108
4109    /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
4110    /// which becomes the final component of the `MulticloudDataTransferConfig`
4111    /// resource name.
4112    pub multicloud_data_transfer_config_id: std::string::String,
4113
4114    /// Required. The `MulticloudDataTransferConfig` resource to create.
4115    pub multicloud_data_transfer_config:
4116        std::option::Option<crate::model::MulticloudDataTransferConfig>,
4117
4118    /// Optional. A request ID to identify requests. Specify a unique request ID
4119    /// so that if you must retry your request, the server can ignore
4120    /// the request if it has already been completed. The server waits
4121    /// for at least 60 minutes since the first request.
4122    ///
4123    /// For example, consider a situation where you make an initial request and
4124    /// the request times out. If you make the request again with the same request
4125    /// ID, the server can check if original operation with the same request ID
4126    /// was received, and if so, can ignore the second request. This prevents
4127    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
4128    /// resources.
4129    ///
4130    /// The request ID must be a valid UUID with the exception that zero UUID
4131    /// (00000000-0000-0000-0000-000000000000) isn't supported.
4132    pub request_id: std::string::String,
4133
4134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4135}
4136
4137impl CreateMulticloudDataTransferConfigRequest {
4138    pub fn new() -> Self {
4139        std::default::Default::default()
4140    }
4141
4142    /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
4143    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4144        self.parent = v.into();
4145        self
4146    }
4147
4148    /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
4149    pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
4150        mut self,
4151        v: T,
4152    ) -> Self {
4153        self.multicloud_data_transfer_config_id = v.into();
4154        self
4155    }
4156
4157    /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
4158    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
4159    where
4160        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4161    {
4162        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
4163        self
4164    }
4165
4166    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
4167    pub fn set_or_clear_multicloud_data_transfer_config<T>(
4168        mut self,
4169        v: std::option::Option<T>,
4170    ) -> Self
4171    where
4172        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4173    {
4174        self.multicloud_data_transfer_config = v.map(|x| x.into());
4175        self
4176    }
4177
4178    /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
4179    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4180        self.request_id = v.into();
4181        self
4182    }
4183}
4184
4185impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
4186    fn typename() -> &'static str {
4187        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
4188    }
4189}
4190
4191/// Request message to update a `MulticloudDataTransferConfig` resource.
4192#[derive(Clone, Default, PartialEq)]
4193#[non_exhaustive]
4194pub struct UpdateMulticloudDataTransferConfigRequest {
4195    /// Optional. `FieldMask` is used to specify the fields in the
4196    /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
4197    /// The fields specified in `update_mask` are relative to the resource, not
4198    /// the full request. A field is overwritten if it is in the mask. If you
4199    /// don't specify a mask, all fields are overwritten.
4200    pub update_mask: std::option::Option<wkt::FieldMask>,
4201
4202    /// Required. The `MulticloudDataTransferConfig` resource to update.
4203    pub multicloud_data_transfer_config:
4204        std::option::Option<crate::model::MulticloudDataTransferConfig>,
4205
4206    /// Optional. A request ID to identify requests. Specify a unique request ID
4207    /// so that if you must retry your request, the server can ignore
4208    /// the request if it has already been completed. The server waits
4209    /// for at least 60 minutes since the first request.
4210    ///
4211    /// For example, consider a situation where you make an initial request and
4212    /// the request times out. If you make the request again with the same request
4213    /// ID, the server can check if original operation with the same request ID
4214    /// was received, and if so, can ignore the second request. This prevents
4215    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
4216    /// resources.
4217    ///
4218    /// The request ID must be a valid UUID with the exception that zero UUID
4219    /// (00000000-0000-0000-0000-000000000000) isn't supported.
4220    pub request_id: std::string::String,
4221
4222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4223}
4224
4225impl UpdateMulticloudDataTransferConfigRequest {
4226    pub fn new() -> Self {
4227        std::default::Default::default()
4228    }
4229
4230    /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
4231    pub fn set_update_mask<T>(mut self, v: T) -> Self
4232    where
4233        T: std::convert::Into<wkt::FieldMask>,
4234    {
4235        self.update_mask = std::option::Option::Some(v.into());
4236        self
4237    }
4238
4239    /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
4240    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4241    where
4242        T: std::convert::Into<wkt::FieldMask>,
4243    {
4244        self.update_mask = v.map(|x| x.into());
4245        self
4246    }
4247
4248    /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
4249    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
4250    where
4251        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4252    {
4253        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
4254        self
4255    }
4256
4257    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
4258    pub fn set_or_clear_multicloud_data_transfer_config<T>(
4259        mut self,
4260        v: std::option::Option<T>,
4261    ) -> Self
4262    where
4263        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4264    {
4265        self.multicloud_data_transfer_config = v.map(|x| x.into());
4266        self
4267    }
4268
4269    /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
4270    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4271        self.request_id = v.into();
4272        self
4273    }
4274}
4275
4276impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
4277    fn typename() -> &'static str {
4278        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
4279    }
4280}
4281
4282/// Request message to delete a `MulticloudDataTransferConfig` resource.
4283#[derive(Clone, Default, PartialEq)]
4284#[non_exhaustive]
4285pub struct DeleteMulticloudDataTransferConfigRequest {
4286    /// Required. The name of the `MulticloudDataTransferConfig` resource to
4287    /// delete.
4288    pub name: std::string::String,
4289
4290    /// Optional. A request ID to identify requests. Specify a unique request ID
4291    /// so that if you must retry your request, the server can ignore
4292    /// the request if it has already been completed. The server waits
4293    /// for at least 60 minutes since the first request.
4294    ///
4295    /// For example, consider a situation where you make an initial request and
4296    /// the request times out. If you make the request again with the same request
4297    /// ID, the server can check if original operation with the same request ID
4298    /// was received, and if so, can ignore the second request. This prevents
4299    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
4300    /// resources.
4301    ///
4302    /// The request ID must be a valid UUID with the exception that zero UUID
4303    /// (00000000-0000-0000-0000-000000000000) isn't supported.
4304    pub request_id: std::string::String,
4305
4306    /// Optional. The etag is computed by the server, and might be sent with update
4307    /// and delete requests so that the client has an up-to-date value before
4308    /// proceeding.
4309    pub etag: std::string::String,
4310
4311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4312}
4313
4314impl DeleteMulticloudDataTransferConfigRequest {
4315    pub fn new() -> Self {
4316        std::default::Default::default()
4317    }
4318
4319    /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
4320    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4321        self.name = v.into();
4322        self
4323    }
4324
4325    /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
4326    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4327        self.request_id = v.into();
4328        self
4329    }
4330
4331    /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
4332    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4333        self.etag = v.into();
4334        self
4335    }
4336}
4337
4338impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
4339    fn typename() -> &'static str {
4340        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
4341    }
4342}
4343
4344/// The `Destination` resource. It specifies the IP prefix and the associated
4345/// autonomous system numbers (ASN) that you want to include in a
4346/// `MulticloudDataTransferConfig` resource.
4347#[derive(Clone, Default, PartialEq)]
4348#[non_exhaustive]
4349pub struct Destination {
4350    /// Identifier. The name of the `Destination` resource.
4351    /// Format:
4352    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
4353    pub name: std::string::String,
4354
4355    /// Output only. Time when the `Destination` resource was created.
4356    pub create_time: std::option::Option<wkt::Timestamp>,
4357
4358    /// Output only. Time when the `Destination` resource was updated.
4359    pub update_time: std::option::Option<wkt::Timestamp>,
4360
4361    /// Optional. User-defined labels.
4362    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4363
4364    /// The etag is computed by the server, and might be sent with update and
4365    /// delete requests so that the client has an up-to-date value before
4366    /// proceeding.
4367    pub etag: std::string::String,
4368
4369    /// Optional. A description of this resource.
4370    pub description: std::string::String,
4371
4372    /// Required. Immutable. The IP prefix that represents your workload on another
4373    /// CSP.
4374    pub ip_prefix: std::string::String,
4375
4376    /// Required. Unordered list. The list of `DestinationEndpoint` resources
4377    /// configured for the IP prefix.
4378    pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
4379
4380    /// Output only. The timeline of the expected `Destination` states or the
4381    /// current rest state. If a state change is expected, the value is `ADDING`,
4382    /// `DELETING` or `SUSPENDING`, depending on the action specified.
4383    ///
4384    /// Example:
4385    /// "state_timeline": {
4386    /// "states": [
4387    /// {
4388    /// // The time when the `Destination` resource will be activated.
4389    /// "effectiveTime": "2024-12-01T08:00:00Z",
4390    /// "state": "ADDING"
4391    /// },
4392    /// {
4393    /// // The time when the `Destination` resource will be suspended.
4394    /// "effectiveTime": "2024-12-01T20:00:00Z",
4395    /// "state": "SUSPENDING"
4396    /// }
4397    /// ]
4398    /// }
4399    pub state_timeline: std::option::Option<crate::model::StateTimeline>,
4400
4401    /// Output only. The Google-generated unique ID for the `Destination` resource.
4402    /// This value is unique across all `Destination` resources.
4403    /// If a resource is deleted and another with the same name is
4404    /// created, the new resource is assigned a different and unique ID.
4405    pub uid: std::string::String,
4406
4407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4408}
4409
4410impl Destination {
4411    pub fn new() -> Self {
4412        std::default::Default::default()
4413    }
4414
4415    /// Sets the value of [name][crate::model::Destination::name].
4416    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4417        self.name = v.into();
4418        self
4419    }
4420
4421    /// Sets the value of [create_time][crate::model::Destination::create_time].
4422    pub fn set_create_time<T>(mut self, v: T) -> Self
4423    where
4424        T: std::convert::Into<wkt::Timestamp>,
4425    {
4426        self.create_time = std::option::Option::Some(v.into());
4427        self
4428    }
4429
4430    /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
4431    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4432    where
4433        T: std::convert::Into<wkt::Timestamp>,
4434    {
4435        self.create_time = v.map(|x| x.into());
4436        self
4437    }
4438
4439    /// Sets the value of [update_time][crate::model::Destination::update_time].
4440    pub fn set_update_time<T>(mut self, v: T) -> Self
4441    where
4442        T: std::convert::Into<wkt::Timestamp>,
4443    {
4444        self.update_time = std::option::Option::Some(v.into());
4445        self
4446    }
4447
4448    /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
4449    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4450    where
4451        T: std::convert::Into<wkt::Timestamp>,
4452    {
4453        self.update_time = v.map(|x| x.into());
4454        self
4455    }
4456
4457    /// Sets the value of [labels][crate::model::Destination::labels].
4458    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4459    where
4460        T: std::iter::IntoIterator<Item = (K, V)>,
4461        K: std::convert::Into<std::string::String>,
4462        V: std::convert::Into<std::string::String>,
4463    {
4464        use std::iter::Iterator;
4465        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4466        self
4467    }
4468
4469    /// Sets the value of [etag][crate::model::Destination::etag].
4470    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4471        self.etag = v.into();
4472        self
4473    }
4474
4475    /// Sets the value of [description][crate::model::Destination::description].
4476    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477        self.description = v.into();
4478        self
4479    }
4480
4481    /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
4482    pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4483        self.ip_prefix = v.into();
4484        self
4485    }
4486
4487    /// Sets the value of [endpoints][crate::model::Destination::endpoints].
4488    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
4489    where
4490        T: std::iter::IntoIterator<Item = V>,
4491        V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
4492    {
4493        use std::iter::Iterator;
4494        self.endpoints = v.into_iter().map(|i| i.into()).collect();
4495        self
4496    }
4497
4498    /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
4499    pub fn set_state_timeline<T>(mut self, v: T) -> Self
4500    where
4501        T: std::convert::Into<crate::model::StateTimeline>,
4502    {
4503        self.state_timeline = std::option::Option::Some(v.into());
4504        self
4505    }
4506
4507    /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
4508    pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
4509    where
4510        T: std::convert::Into<crate::model::StateTimeline>,
4511    {
4512        self.state_timeline = v.map(|x| x.into());
4513        self
4514    }
4515
4516    /// Sets the value of [uid][crate::model::Destination::uid].
4517    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4518        self.uid = v.into();
4519        self
4520    }
4521}
4522
4523impl wkt::message::Message for Destination {
4524    fn typename() -> &'static str {
4525        "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
4526    }
4527}
4528
4529/// Defines additional types related to [Destination].
4530pub mod destination {
4531    #[allow(unused_imports)]
4532    use super::*;
4533
4534    /// The metadata for a `DestinationEndpoint` resource.
4535    #[derive(Clone, Default, PartialEq)]
4536    #[non_exhaustive]
4537    pub struct DestinationEndpoint {
4538        /// Required. The ASN of the remote IP prefix.
4539        pub asn: i64,
4540
4541        /// Required. The CSP of the remote IP prefix.
4542        pub csp: std::string::String,
4543
4544        /// Output only. The state of the `DestinationEndpoint` resource.
4545        pub state: crate::model::destination::destination_endpoint::State,
4546
4547        /// Output only. Time when the `DestinationEndpoint` resource was updated.
4548        pub update_time: std::option::Option<wkt::Timestamp>,
4549
4550        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4551    }
4552
4553    impl DestinationEndpoint {
4554        pub fn new() -> Self {
4555            std::default::Default::default()
4556        }
4557
4558        /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
4559        pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4560            self.asn = v.into();
4561            self
4562        }
4563
4564        /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
4565        pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566            self.csp = v.into();
4567            self
4568        }
4569
4570        /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
4571        pub fn set_state<
4572            T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
4573        >(
4574            mut self,
4575            v: T,
4576        ) -> Self {
4577            self.state = v.into();
4578            self
4579        }
4580
4581        /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
4582        pub fn set_update_time<T>(mut self, v: T) -> Self
4583        where
4584            T: std::convert::Into<wkt::Timestamp>,
4585        {
4586            self.update_time = std::option::Option::Some(v.into());
4587            self
4588        }
4589
4590        /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
4591        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4592        where
4593            T: std::convert::Into<wkt::Timestamp>,
4594        {
4595            self.update_time = v.map(|x| x.into());
4596            self
4597        }
4598    }
4599
4600    impl wkt::message::Message for DestinationEndpoint {
4601        fn typename() -> &'static str {
4602            "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
4603        }
4604    }
4605
4606    /// Defines additional types related to [DestinationEndpoint].
4607    pub mod destination_endpoint {
4608        #[allow(unused_imports)]
4609        use super::*;
4610
4611        /// The state of the `DestinationEndpoint` resource.
4612        ///
4613        /// # Working with unknown values
4614        ///
4615        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4616        /// additional enum variants at any time. Adding new variants is not considered
4617        /// a breaking change. Applications should write their code in anticipation of:
4618        ///
4619        /// - New values appearing in future releases of the client library, **and**
4620        /// - New values received dynamically, without application changes.
4621        ///
4622        /// Please consult the [Working with enums] section in the user guide for some
4623        /// guidelines.
4624        ///
4625        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4626        #[derive(Clone, Debug, PartialEq)]
4627        #[non_exhaustive]
4628        pub enum State {
4629            /// An invalid state, which is the default case.
4630            Unspecified,
4631            /// The `DestinationEndpoint` resource is valid.
4632            Valid,
4633            /// The `DestinationEndpoint` resource is invalid.
4634            Invalid,
4635            /// If set, the enum was initialized with an unknown value.
4636            ///
4637            /// Applications can examine the value using [State::value] or
4638            /// [State::name].
4639            UnknownValue(state::UnknownValue),
4640        }
4641
4642        #[doc(hidden)]
4643        pub mod state {
4644            #[allow(unused_imports)]
4645            use super::*;
4646            #[derive(Clone, Debug, PartialEq)]
4647            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4648        }
4649
4650        impl State {
4651            /// Gets the enum value.
4652            ///
4653            /// Returns `None` if the enum contains an unknown value deserialized from
4654            /// the string representation of enums.
4655            pub fn value(&self) -> std::option::Option<i32> {
4656                match self {
4657                    Self::Unspecified => std::option::Option::Some(0),
4658                    Self::Valid => std::option::Option::Some(1),
4659                    Self::Invalid => std::option::Option::Some(2),
4660                    Self::UnknownValue(u) => u.0.value(),
4661                }
4662            }
4663
4664            /// Gets the enum value as a string.
4665            ///
4666            /// Returns `None` if the enum contains an unknown value deserialized from
4667            /// the integer representation of enums.
4668            pub fn name(&self) -> std::option::Option<&str> {
4669                match self {
4670                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4671                    Self::Valid => std::option::Option::Some("VALID"),
4672                    Self::Invalid => std::option::Option::Some("INVALID"),
4673                    Self::UnknownValue(u) => u.0.name(),
4674                }
4675            }
4676        }
4677
4678        impl std::default::Default for State {
4679            fn default() -> Self {
4680                use std::convert::From;
4681                Self::from(0)
4682            }
4683        }
4684
4685        impl std::fmt::Display for State {
4686            fn fmt(
4687                &self,
4688                f: &mut std::fmt::Formatter<'_>,
4689            ) -> std::result::Result<(), std::fmt::Error> {
4690                wkt::internal::display_enum(f, self.name(), self.value())
4691            }
4692        }
4693
4694        impl std::convert::From<i32> for State {
4695            fn from(value: i32) -> Self {
4696                match value {
4697                    0 => Self::Unspecified,
4698                    1 => Self::Valid,
4699                    2 => Self::Invalid,
4700                    _ => Self::UnknownValue(state::UnknownValue(
4701                        wkt::internal::UnknownEnumValue::Integer(value),
4702                    )),
4703                }
4704            }
4705        }
4706
4707        impl std::convert::From<&str> for State {
4708            fn from(value: &str) -> Self {
4709                use std::string::ToString;
4710                match value {
4711                    "STATE_UNSPECIFIED" => Self::Unspecified,
4712                    "VALID" => Self::Valid,
4713                    "INVALID" => Self::Invalid,
4714                    _ => Self::UnknownValue(state::UnknownValue(
4715                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4716                    )),
4717                }
4718            }
4719        }
4720
4721        impl serde::ser::Serialize for State {
4722            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4723            where
4724                S: serde::Serializer,
4725            {
4726                match self {
4727                    Self::Unspecified => serializer.serialize_i32(0),
4728                    Self::Valid => serializer.serialize_i32(1),
4729                    Self::Invalid => serializer.serialize_i32(2),
4730                    Self::UnknownValue(u) => u.0.serialize(serializer),
4731                }
4732            }
4733        }
4734
4735        impl<'de> serde::de::Deserialize<'de> for State {
4736            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4737            where
4738                D: serde::Deserializer<'de>,
4739            {
4740                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4741                    ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
4742                ))
4743            }
4744        }
4745    }
4746}
4747
4748/// Request message to list `Destination` resources.
4749#[derive(Clone, Default, PartialEq)]
4750#[non_exhaustive]
4751pub struct ListDestinationsRequest {
4752    /// Required. The name of the parent resource.
4753    pub parent: std::string::String,
4754
4755    /// Optional. The maximum number of results listed per page.
4756    pub page_size: i32,
4757
4758    /// Optional. The page token.
4759    pub page_token: std::string::String,
4760
4761    /// Optional. An expression that filters the results listed in the response.
4762    pub filter: std::string::String,
4763
4764    /// Optional. The sort order of the results.
4765    pub order_by: std::string::String,
4766
4767    /// Optional. If `true`, allow partial responses for multi-regional aggregated
4768    /// list requests.
4769    pub return_partial_success: bool,
4770
4771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4772}
4773
4774impl ListDestinationsRequest {
4775    pub fn new() -> Self {
4776        std::default::Default::default()
4777    }
4778
4779    /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
4780    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4781        self.parent = v.into();
4782        self
4783    }
4784
4785    /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
4786    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4787        self.page_size = v.into();
4788        self
4789    }
4790
4791    /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
4792    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4793        self.page_token = v.into();
4794        self
4795    }
4796
4797    /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
4798    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4799        self.filter = v.into();
4800        self
4801    }
4802
4803    /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
4804    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4805        self.order_by = v.into();
4806        self
4807    }
4808
4809    /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
4810    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4811        self.return_partial_success = v.into();
4812        self
4813    }
4814}
4815
4816impl wkt::message::Message for ListDestinationsRequest {
4817    fn typename() -> &'static str {
4818        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
4819    }
4820}
4821
4822/// Response message to list `Destination` resources.
4823#[derive(Clone, Default, PartialEq)]
4824#[non_exhaustive]
4825pub struct ListDestinationsResponse {
4826    /// The list of `Destination` resources to be listed.
4827    pub destinations: std::vec::Vec<crate::model::Destination>,
4828
4829    /// The next page token.
4830    pub next_page_token: std::string::String,
4831
4832    /// Locations that could not be reached.
4833    pub unreachable: std::vec::Vec<std::string::String>,
4834
4835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4836}
4837
4838impl ListDestinationsResponse {
4839    pub fn new() -> Self {
4840        std::default::Default::default()
4841    }
4842
4843    /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
4844    pub fn set_destinations<T, V>(mut self, v: T) -> Self
4845    where
4846        T: std::iter::IntoIterator<Item = V>,
4847        V: std::convert::Into<crate::model::Destination>,
4848    {
4849        use std::iter::Iterator;
4850        self.destinations = v.into_iter().map(|i| i.into()).collect();
4851        self
4852    }
4853
4854    /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
4855    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4856        self.next_page_token = v.into();
4857        self
4858    }
4859
4860    /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
4861    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4862    where
4863        T: std::iter::IntoIterator<Item = V>,
4864        V: std::convert::Into<std::string::String>,
4865    {
4866        use std::iter::Iterator;
4867        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4868        self
4869    }
4870}
4871
4872impl wkt::message::Message for ListDestinationsResponse {
4873    fn typename() -> &'static str {
4874        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
4875    }
4876}
4877
4878#[doc(hidden)]
4879impl gax::paginator::internal::PageableResponse for ListDestinationsResponse {
4880    type PageItem = crate::model::Destination;
4881
4882    fn items(self) -> std::vec::Vec<Self::PageItem> {
4883        self.destinations
4884    }
4885
4886    fn next_page_token(&self) -> std::string::String {
4887        use std::clone::Clone;
4888        self.next_page_token.clone()
4889    }
4890}
4891
4892/// Request message to get the details of a `Destination` resource.
4893#[derive(Clone, Default, PartialEq)]
4894#[non_exhaustive]
4895pub struct GetDestinationRequest {
4896    /// Required. The name of the `Destination` resource to get.
4897    pub name: std::string::String,
4898
4899    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4900}
4901
4902impl GetDestinationRequest {
4903    pub fn new() -> Self {
4904        std::default::Default::default()
4905    }
4906
4907    /// Sets the value of [name][crate::model::GetDestinationRequest::name].
4908    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4909        self.name = v.into();
4910        self
4911    }
4912}
4913
4914impl wkt::message::Message for GetDestinationRequest {
4915    fn typename() -> &'static str {
4916        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
4917    }
4918}
4919
4920/// Request message to create a `Destination` resource.
4921#[derive(Clone, Default, PartialEq)]
4922#[non_exhaustive]
4923pub struct CreateDestinationRequest {
4924    /// Required. The name of the parent resource.
4925    pub parent: std::string::String,
4926
4927    /// Required. The ID to use for the `Destination` resource, which becomes the
4928    /// final component of the `Destination` resource name.
4929    pub destination_id: std::string::String,
4930
4931    /// Required. The `Destination` resource to create.
4932    pub destination: std::option::Option<crate::model::Destination>,
4933
4934    /// Optional. A request ID to identify requests. Specify a unique request ID
4935    /// so that if you must retry your request, the server can ignore
4936    /// the request if it has already been completed. The server waits
4937    /// for at least 60 minutes since the first request.
4938    ///
4939    /// For example, consider a situation where you make an initial request and
4940    /// the request times out. If you make the request again with the same request
4941    /// ID, the server can check if original operation with the same request ID
4942    /// was received, and if so, can ignore the second request. This prevents
4943    /// clients from accidentally creating duplicate `Destination`
4944    /// resources.
4945    ///
4946    /// The request ID must be a valid UUID with the exception that zero UUID
4947    /// (00000000-0000-0000-0000-000000000000) isn't supported.
4948    pub request_id: std::string::String,
4949
4950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4951}
4952
4953impl CreateDestinationRequest {
4954    pub fn new() -> Self {
4955        std::default::Default::default()
4956    }
4957
4958    /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
4959    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4960        self.parent = v.into();
4961        self
4962    }
4963
4964    /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
4965    pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4966        self.destination_id = v.into();
4967        self
4968    }
4969
4970    /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
4971    pub fn set_destination<T>(mut self, v: T) -> Self
4972    where
4973        T: std::convert::Into<crate::model::Destination>,
4974    {
4975        self.destination = std::option::Option::Some(v.into());
4976        self
4977    }
4978
4979    /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
4980    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4981    where
4982        T: std::convert::Into<crate::model::Destination>,
4983    {
4984        self.destination = v.map(|x| x.into());
4985        self
4986    }
4987
4988    /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
4989    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4990        self.request_id = v.into();
4991        self
4992    }
4993}
4994
4995impl wkt::message::Message for CreateDestinationRequest {
4996    fn typename() -> &'static str {
4997        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
4998    }
4999}
5000
5001/// Request message to update a `Destination` resource.
5002#[derive(Clone, Default, PartialEq)]
5003#[non_exhaustive]
5004pub struct UpdateDestinationRequest {
5005    /// Optional. `FieldMask is used to specify the fields to be overwritten in the
5006    /// `Destination` resource by the update.
5007    /// The fields specified in `update_mask` are relative to the resource, not
5008    /// the full request. A field is overwritten if it is in the mask. If you
5009    /// don't specify a mask, all fields are overwritten.
5010    pub update_mask: std::option::Option<wkt::FieldMask>,
5011
5012    /// Required. The `Destination` resource to update.
5013    pub destination: std::option::Option<crate::model::Destination>,
5014
5015    /// Optional. A request ID to identify requests. Specify a unique request ID
5016    /// so that if you must retry your request, the server can ignore
5017    /// the request if it has already been completed. The server waits
5018    /// for at least 60 minutes since the first request.
5019    ///
5020    /// For example, consider a situation where you make an initial request and
5021    /// the request times out. If you make the request again with the same request
5022    /// ID, the server can check if original operation with the same request ID
5023    /// was received, and if so, can ignore the second request.
5024    ///
5025    /// The request ID must be a valid UUID with the exception that zero UUID
5026    /// (00000000-0000-0000-0000-000000000000) isn't supported.
5027    pub request_id: std::string::String,
5028
5029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5030}
5031
5032impl UpdateDestinationRequest {
5033    pub fn new() -> Self {
5034        std::default::Default::default()
5035    }
5036
5037    /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
5038    pub fn set_update_mask<T>(mut self, v: T) -> Self
5039    where
5040        T: std::convert::Into<wkt::FieldMask>,
5041    {
5042        self.update_mask = std::option::Option::Some(v.into());
5043        self
5044    }
5045
5046    /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
5047    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5048    where
5049        T: std::convert::Into<wkt::FieldMask>,
5050    {
5051        self.update_mask = v.map(|x| x.into());
5052        self
5053    }
5054
5055    /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
5056    pub fn set_destination<T>(mut self, v: T) -> Self
5057    where
5058        T: std::convert::Into<crate::model::Destination>,
5059    {
5060        self.destination = std::option::Option::Some(v.into());
5061        self
5062    }
5063
5064    /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
5065    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
5066    where
5067        T: std::convert::Into<crate::model::Destination>,
5068    {
5069        self.destination = v.map(|x| x.into());
5070        self
5071    }
5072
5073    /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
5074    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5075        self.request_id = v.into();
5076        self
5077    }
5078}
5079
5080impl wkt::message::Message for UpdateDestinationRequest {
5081    fn typename() -> &'static str {
5082        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
5083    }
5084}
5085
5086/// Request message to delete a `Destination` resource.
5087#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct DeleteDestinationRequest {
5090    /// Required. The name of the `Destination` resource to delete.
5091    pub name: std::string::String,
5092
5093    /// Optional. A request ID to identify requests. Specify a unique request ID
5094    /// so that if you must retry your request, the server can ignore
5095    /// the request if it has already been completed. The server waits
5096    /// for at least 60 minutes since the first request.
5097    ///
5098    /// For example, consider a situation where you make an initial request and
5099    /// the request times out. If you make the request again with the same request
5100    /// ID, the server can check if original operation with the same request ID
5101    /// was received, and if so, can ignore the second request.
5102    ///
5103    /// The request ID must be a valid UUID with the exception that zero UUID
5104    /// (00000000-0000-0000-0000-000000000000) isn't supported.
5105    pub request_id: std::string::String,
5106
5107    /// Optional. The etag is computed by the server, and might be sent with update
5108    /// and delete requests so that the client has an up-to-date value before
5109    /// proceeding.
5110    pub etag: std::string::String,
5111
5112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5113}
5114
5115impl DeleteDestinationRequest {
5116    pub fn new() -> Self {
5117        std::default::Default::default()
5118    }
5119
5120    /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
5121    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5122        self.name = v.into();
5123        self
5124    }
5125
5126    /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
5127    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5128        self.request_id = v.into();
5129        self
5130    }
5131
5132    /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
5133    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5134        self.etag = v.into();
5135        self
5136    }
5137}
5138
5139impl wkt::message::Message for DeleteDestinationRequest {
5140    fn typename() -> &'static str {
5141        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
5142    }
5143}
5144
5145/// The timeline of the pending states for a resource.
5146#[derive(Clone, Default, PartialEq)]
5147#[non_exhaustive]
5148pub struct StateTimeline {
5149    /// Output only. The state and activation time details of the resource state.
5150    pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
5151
5152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5153}
5154
5155impl StateTimeline {
5156    pub fn new() -> Self {
5157        std::default::Default::default()
5158    }
5159
5160    /// Sets the value of [states][crate::model::StateTimeline::states].
5161    pub fn set_states<T, V>(mut self, v: T) -> Self
5162    where
5163        T: std::iter::IntoIterator<Item = V>,
5164        V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
5165    {
5166        use std::iter::Iterator;
5167        self.states = v.into_iter().map(|i| i.into()).collect();
5168        self
5169    }
5170}
5171
5172impl wkt::message::Message for StateTimeline {
5173    fn typename() -> &'static str {
5174        "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
5175    }
5176}
5177
5178/// Defines additional types related to [StateTimeline].
5179pub mod state_timeline {
5180    #[allow(unused_imports)]
5181    use super::*;
5182
5183    /// The state and activation time details of the resource state.
5184    #[derive(Clone, Default, PartialEq)]
5185    #[non_exhaustive]
5186    pub struct StateMetadata {
5187        /// Output only. The state of the resource.
5188        pub state: crate::model::state_timeline::state_metadata::State,
5189
5190        /// Output only. Accompanies only the transient states, which include
5191        /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
5192        /// the transient state of the resource will be effective. For instance, if
5193        /// the state is `ADDING`, this field shows the time when the resource state
5194        /// transitions to `ACTIVE`.
5195        pub effective_time: std::option::Option<wkt::Timestamp>,
5196
5197        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5198    }
5199
5200    impl StateMetadata {
5201        pub fn new() -> Self {
5202            std::default::Default::default()
5203        }
5204
5205        /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
5206        pub fn set_state<
5207            T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
5208        >(
5209            mut self,
5210            v: T,
5211        ) -> Self {
5212            self.state = v.into();
5213            self
5214        }
5215
5216        /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
5217        pub fn set_effective_time<T>(mut self, v: T) -> Self
5218        where
5219            T: std::convert::Into<wkt::Timestamp>,
5220        {
5221            self.effective_time = std::option::Option::Some(v.into());
5222            self
5223        }
5224
5225        /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
5226        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
5227        where
5228            T: std::convert::Into<wkt::Timestamp>,
5229        {
5230            self.effective_time = v.map(|x| x.into());
5231            self
5232        }
5233    }
5234
5235    impl wkt::message::Message for StateMetadata {
5236        fn typename() -> &'static str {
5237            "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
5238        }
5239    }
5240
5241    /// Defines additional types related to [StateMetadata].
5242    pub mod state_metadata {
5243        #[allow(unused_imports)]
5244        use super::*;
5245
5246        /// The state of the resource.
5247        ///
5248        /// # Working with unknown values
5249        ///
5250        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5251        /// additional enum variants at any time. Adding new variants is not considered
5252        /// a breaking change. Applications should write their code in anticipation of:
5253        ///
5254        /// - New values appearing in future releases of the client library, **and**
5255        /// - New values received dynamically, without application changes.
5256        ///
5257        /// Please consult the [Working with enums] section in the user guide for some
5258        /// guidelines.
5259        ///
5260        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5261        #[derive(Clone, Debug, PartialEq)]
5262        #[non_exhaustive]
5263        pub enum State {
5264            /// An invalid state, which is the default case.
5265            Unspecified,
5266            /// The resource is being added.
5267            Adding,
5268            /// The resource is in use.
5269            Active,
5270            /// The resource is being deleted.
5271            Deleting,
5272            /// The resource is being suspended.
5273            Suspending,
5274            /// The resource is suspended and not in use.
5275            Suspended,
5276            /// If set, the enum was initialized with an unknown value.
5277            ///
5278            /// Applications can examine the value using [State::value] or
5279            /// [State::name].
5280            UnknownValue(state::UnknownValue),
5281        }
5282
5283        #[doc(hidden)]
5284        pub mod state {
5285            #[allow(unused_imports)]
5286            use super::*;
5287            #[derive(Clone, Debug, PartialEq)]
5288            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5289        }
5290
5291        impl State {
5292            /// Gets the enum value.
5293            ///
5294            /// Returns `None` if the enum contains an unknown value deserialized from
5295            /// the string representation of enums.
5296            pub fn value(&self) -> std::option::Option<i32> {
5297                match self {
5298                    Self::Unspecified => std::option::Option::Some(0),
5299                    Self::Adding => std::option::Option::Some(1),
5300                    Self::Active => std::option::Option::Some(2),
5301                    Self::Deleting => std::option::Option::Some(3),
5302                    Self::Suspending => std::option::Option::Some(4),
5303                    Self::Suspended => std::option::Option::Some(5),
5304                    Self::UnknownValue(u) => u.0.value(),
5305                }
5306            }
5307
5308            /// Gets the enum value as a string.
5309            ///
5310            /// Returns `None` if the enum contains an unknown value deserialized from
5311            /// the integer representation of enums.
5312            pub fn name(&self) -> std::option::Option<&str> {
5313                match self {
5314                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5315                    Self::Adding => std::option::Option::Some("ADDING"),
5316                    Self::Active => std::option::Option::Some("ACTIVE"),
5317                    Self::Deleting => std::option::Option::Some("DELETING"),
5318                    Self::Suspending => std::option::Option::Some("SUSPENDING"),
5319                    Self::Suspended => std::option::Option::Some("SUSPENDED"),
5320                    Self::UnknownValue(u) => u.0.name(),
5321                }
5322            }
5323        }
5324
5325        impl std::default::Default for State {
5326            fn default() -> Self {
5327                use std::convert::From;
5328                Self::from(0)
5329            }
5330        }
5331
5332        impl std::fmt::Display for State {
5333            fn fmt(
5334                &self,
5335                f: &mut std::fmt::Formatter<'_>,
5336            ) -> std::result::Result<(), std::fmt::Error> {
5337                wkt::internal::display_enum(f, self.name(), self.value())
5338            }
5339        }
5340
5341        impl std::convert::From<i32> for State {
5342            fn from(value: i32) -> Self {
5343                match value {
5344                    0 => Self::Unspecified,
5345                    1 => Self::Adding,
5346                    2 => Self::Active,
5347                    3 => Self::Deleting,
5348                    4 => Self::Suspending,
5349                    5 => Self::Suspended,
5350                    _ => Self::UnknownValue(state::UnknownValue(
5351                        wkt::internal::UnknownEnumValue::Integer(value),
5352                    )),
5353                }
5354            }
5355        }
5356
5357        impl std::convert::From<&str> for State {
5358            fn from(value: &str) -> Self {
5359                use std::string::ToString;
5360                match value {
5361                    "STATE_UNSPECIFIED" => Self::Unspecified,
5362                    "ADDING" => Self::Adding,
5363                    "ACTIVE" => Self::Active,
5364                    "DELETING" => Self::Deleting,
5365                    "SUSPENDING" => Self::Suspending,
5366                    "SUSPENDED" => Self::Suspended,
5367                    _ => Self::UnknownValue(state::UnknownValue(
5368                        wkt::internal::UnknownEnumValue::String(value.to_string()),
5369                    )),
5370                }
5371            }
5372        }
5373
5374        impl serde::ser::Serialize for State {
5375            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5376            where
5377                S: serde::Serializer,
5378            {
5379                match self {
5380                    Self::Unspecified => serializer.serialize_i32(0),
5381                    Self::Adding => serializer.serialize_i32(1),
5382                    Self::Active => serializer.serialize_i32(2),
5383                    Self::Deleting => serializer.serialize_i32(3),
5384                    Self::Suspending => serializer.serialize_i32(4),
5385                    Self::Suspended => serializer.serialize_i32(5),
5386                    Self::UnknownValue(u) => u.0.serialize(serializer),
5387                }
5388            }
5389        }
5390
5391        impl<'de> serde::de::Deserialize<'de> for State {
5392            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5393            where
5394                D: serde::Deserializer<'de>,
5395            {
5396                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5397                    ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
5398                ))
5399            }
5400        }
5401    }
5402}
5403
5404/// A service in your project in a region that is eligible for Data Transfer
5405/// Essentials configuration.
5406#[derive(Clone, Default, PartialEq)]
5407#[non_exhaustive]
5408pub struct MulticloudDataTransferSupportedService {
5409    /// Identifier. The name of the service.
5410    pub name: std::string::String,
5411
5412    /// Output only. The network service tier or regional endpoint supported for
5413    /// the service.
5414    pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
5415
5416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5417}
5418
5419impl MulticloudDataTransferSupportedService {
5420    pub fn new() -> Self {
5421        std::default::Default::default()
5422    }
5423
5424    /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
5425    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5426        self.name = v.into();
5427        self
5428    }
5429
5430    /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
5431    pub fn set_service_configs<T, V>(mut self, v: T) -> Self
5432    where
5433        T: std::iter::IntoIterator<Item = V>,
5434        V: std::convert::Into<crate::model::ServiceConfig>,
5435    {
5436        use std::iter::Iterator;
5437        self.service_configs = v.into_iter().map(|i| i.into()).collect();
5438        self
5439    }
5440}
5441
5442impl wkt::message::Message for MulticloudDataTransferSupportedService {
5443    fn typename() -> &'static str {
5444        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
5445    }
5446}
5447
5448/// Specifies eligibility information for the service.
5449#[derive(Clone, Default, PartialEq)]
5450#[non_exhaustive]
5451pub struct ServiceConfig {
5452    /// Output only. The eligibility criteria for the service.
5453    pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
5454
5455    /// Output only. The end time for eligibility criteria support. If not
5456    /// specified, no planned end time is set.
5457    pub support_end_time: std::option::Option<wkt::Timestamp>,
5458
5459    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5460}
5461
5462impl ServiceConfig {
5463    pub fn new() -> Self {
5464        std::default::Default::default()
5465    }
5466
5467    /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
5468    pub fn set_eligibility_criteria<
5469        T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
5470    >(
5471        mut self,
5472        v: T,
5473    ) -> Self {
5474        self.eligibility_criteria = v.into();
5475        self
5476    }
5477
5478    /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
5479    pub fn set_support_end_time<T>(mut self, v: T) -> Self
5480    where
5481        T: std::convert::Into<wkt::Timestamp>,
5482    {
5483        self.support_end_time = std::option::Option::Some(v.into());
5484        self
5485    }
5486
5487    /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
5488    pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5489    where
5490        T: std::convert::Into<wkt::Timestamp>,
5491    {
5492        self.support_end_time = v.map(|x| x.into());
5493        self
5494    }
5495}
5496
5497impl wkt::message::Message for ServiceConfig {
5498    fn typename() -> &'static str {
5499        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
5500    }
5501}
5502
5503/// Defines additional types related to [ServiceConfig].
5504pub mod service_config {
5505    #[allow(unused_imports)]
5506    use super::*;
5507
5508    /// The eligibility information for the service.
5509    ///
5510    /// # Working with unknown values
5511    ///
5512    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5513    /// additional enum variants at any time. Adding new variants is not considered
5514    /// a breaking change. Applications should write their code in anticipation of:
5515    ///
5516    /// - New values appearing in future releases of the client library, **and**
5517    /// - New values received dynamically, without application changes.
5518    ///
5519    /// Please consult the [Working with enums] section in the user guide for some
5520    /// guidelines.
5521    ///
5522    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5523    #[derive(Clone, Debug, PartialEq)]
5524    #[non_exhaustive]
5525    pub enum EligibilityCriteria {
5526        /// The service is not eligible for Data Transfer Essentials configuration.
5527        /// This is the default case.
5528        Unspecified,
5529        /// The service is eligible for Data Transfer Essentials configuration only
5530        /// for Premium Tier.
5531        NetworkServiceTierPremiumOnly,
5532        /// The service is eligible for Data Transfer Essentials configuration only
5533        /// for Standard Tier.
5534        NetworkServiceTierStandardOnly,
5535        /// The service is eligible for Data Transfer Essentials configuration only
5536        /// for the regional endpoint.
5537        RequestEndpointRegionalEndpointOnly,
5538        /// If set, the enum was initialized with an unknown value.
5539        ///
5540        /// Applications can examine the value using [EligibilityCriteria::value] or
5541        /// [EligibilityCriteria::name].
5542        UnknownValue(eligibility_criteria::UnknownValue),
5543    }
5544
5545    #[doc(hidden)]
5546    pub mod eligibility_criteria {
5547        #[allow(unused_imports)]
5548        use super::*;
5549        #[derive(Clone, Debug, PartialEq)]
5550        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5551    }
5552
5553    impl EligibilityCriteria {
5554        /// Gets the enum value.
5555        ///
5556        /// Returns `None` if the enum contains an unknown value deserialized from
5557        /// the string representation of enums.
5558        pub fn value(&self) -> std::option::Option<i32> {
5559            match self {
5560                Self::Unspecified => std::option::Option::Some(0),
5561                Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
5562                Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
5563                Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
5564                Self::UnknownValue(u) => u.0.value(),
5565            }
5566        }
5567
5568        /// Gets the enum value as a string.
5569        ///
5570        /// Returns `None` if the enum contains an unknown value deserialized from
5571        /// the integer representation of enums.
5572        pub fn name(&self) -> std::option::Option<&str> {
5573            match self {
5574                Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
5575                Self::NetworkServiceTierPremiumOnly => {
5576                    std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
5577                }
5578                Self::NetworkServiceTierStandardOnly => {
5579                    std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
5580                }
5581                Self::RequestEndpointRegionalEndpointOnly => {
5582                    std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
5583                }
5584                Self::UnknownValue(u) => u.0.name(),
5585            }
5586        }
5587    }
5588
5589    impl std::default::Default for EligibilityCriteria {
5590        fn default() -> Self {
5591            use std::convert::From;
5592            Self::from(0)
5593        }
5594    }
5595
5596    impl std::fmt::Display for EligibilityCriteria {
5597        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5598            wkt::internal::display_enum(f, self.name(), self.value())
5599        }
5600    }
5601
5602    impl std::convert::From<i32> for EligibilityCriteria {
5603        fn from(value: i32) -> Self {
5604            match value {
5605                0 => Self::Unspecified,
5606                1 => Self::NetworkServiceTierPremiumOnly,
5607                2 => Self::NetworkServiceTierStandardOnly,
5608                3 => Self::RequestEndpointRegionalEndpointOnly,
5609                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
5610                    wkt::internal::UnknownEnumValue::Integer(value),
5611                )),
5612            }
5613        }
5614    }
5615
5616    impl std::convert::From<&str> for EligibilityCriteria {
5617        fn from(value: &str) -> Self {
5618            use std::string::ToString;
5619            match value {
5620                "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
5621                "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
5622                "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
5623                "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
5624                    Self::RequestEndpointRegionalEndpointOnly
5625                }
5626                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
5627                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5628                )),
5629            }
5630        }
5631    }
5632
5633    impl serde::ser::Serialize for EligibilityCriteria {
5634        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5635        where
5636            S: serde::Serializer,
5637        {
5638            match self {
5639                Self::Unspecified => serializer.serialize_i32(0),
5640                Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
5641                Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
5642                Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
5643                Self::UnknownValue(u) => u.0.serialize(serializer),
5644            }
5645        }
5646    }
5647
5648    impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
5649        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5650        where
5651            D: serde::Deserializer<'de>,
5652        {
5653            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
5654                ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
5655            ))
5656        }
5657    }
5658}
5659
5660/// Request message to check if a service in your project in a region is
5661/// eligible for Data Transfer Essentials configuration.
5662#[derive(Clone, Default, PartialEq)]
5663#[non_exhaustive]
5664pub struct GetMulticloudDataTransferSupportedServiceRequest {
5665    /// Required. The name of the service.
5666    pub name: std::string::String,
5667
5668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl GetMulticloudDataTransferSupportedServiceRequest {
5672    pub fn new() -> Self {
5673        std::default::Default::default()
5674    }
5675
5676    /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
5677    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678        self.name = v.into();
5679        self
5680    }
5681}
5682
5683impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
5684    fn typename() -> &'static str {
5685        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
5686    }
5687}
5688
5689/// Request message to list the services in your project that are eligible for
5690/// Data Transfer Essentials configuration.
5691#[derive(Clone, Default, PartialEq)]
5692#[non_exhaustive]
5693pub struct ListMulticloudDataTransferSupportedServicesRequest {
5694    /// Required. The name of the parent resource.
5695    pub parent: std::string::String,
5696
5697    /// Optional. The maximum number of results listed per page.
5698    pub page_size: i32,
5699
5700    /// Optional. The page token.
5701    pub page_token: std::string::String,
5702
5703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5704}
5705
5706impl ListMulticloudDataTransferSupportedServicesRequest {
5707    pub fn new() -> Self {
5708        std::default::Default::default()
5709    }
5710
5711    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
5712    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5713        self.parent = v.into();
5714        self
5715    }
5716
5717    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
5718    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5719        self.page_size = v.into();
5720        self
5721    }
5722
5723    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
5724    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5725        self.page_token = v.into();
5726        self
5727    }
5728}
5729
5730impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
5731    fn typename() -> &'static str {
5732        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
5733    }
5734}
5735
5736/// Response message to list the services in your project in regions that are
5737/// eligible for Data Transfer Essentials configuration.
5738#[derive(Clone, Default, PartialEq)]
5739#[non_exhaustive]
5740pub struct ListMulticloudDataTransferSupportedServicesResponse {
5741    /// The list of supported services.
5742    pub multicloud_data_transfer_supported_services:
5743        std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
5744
5745    /// The next page token.
5746    pub next_page_token: std::string::String,
5747
5748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5749}
5750
5751impl ListMulticloudDataTransferSupportedServicesResponse {
5752    pub fn new() -> Self {
5753        std::default::Default::default()
5754    }
5755
5756    /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
5757    pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
5758    where
5759        T: std::iter::IntoIterator<Item = V>,
5760        V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
5761    {
5762        use std::iter::Iterator;
5763        self.multicloud_data_transfer_supported_services =
5764            v.into_iter().map(|i| i.into()).collect();
5765        self
5766    }
5767
5768    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
5769    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5770        self.next_page_token = v.into();
5771        self
5772    }
5773}
5774
5775impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
5776    fn typename() -> &'static str {
5777        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
5778    }
5779}
5780
5781#[doc(hidden)]
5782impl gax::paginator::internal::PageableResponse
5783    for ListMulticloudDataTransferSupportedServicesResponse
5784{
5785    type PageItem = crate::model::MulticloudDataTransferSupportedService;
5786
5787    fn items(self) -> std::vec::Vec<Self::PageItem> {
5788        self.multicloud_data_transfer_supported_services
5789    }
5790
5791    fn next_page_token(&self) -> std::string::String {
5792        use std::clone::Clone;
5793        self.next_page_token.clone()
5794    }
5795}
5796
5797/// A Network Connectivity Center hub is a global management resource to which
5798/// you attach spokes. A single hub can contain spokes from multiple regions.
5799/// However, if any of a hub's spokes use the site-to-site data transfer feature,
5800/// the resources associated with those spokes must all be in the same VPC
5801/// network. Spokes that do not use site-to-site data transfer can be associated
5802/// with any VPC network in your project.
5803#[derive(Clone, Default, PartialEq)]
5804#[non_exhaustive]
5805pub struct Hub {
5806    /// Immutable. The name of the hub. Hub names must be unique. They use the
5807    /// following form:
5808    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
5809    pub name: std::string::String,
5810
5811    /// Output only. The time the hub was created.
5812    pub create_time: std::option::Option<wkt::Timestamp>,
5813
5814    /// Output only. The time the hub was last updated.
5815    pub update_time: std::option::Option<wkt::Timestamp>,
5816
5817    /// Optional labels in key-value pair format. For more information about
5818    /// labels, see [Requirements for
5819    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
5820    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5821
5822    /// Optional. An optional description of the hub.
5823    pub description: std::string::String,
5824
5825    /// Output only. The Google-generated UUID for the hub. This value is unique
5826    /// across all hub resources. If a hub is deleted and another with the same
5827    /// name is created, the new hub is assigned a different unique_id.
5828    pub unique_id: std::string::String,
5829
5830    /// Output only. The current lifecycle state of this hub.
5831    pub state: crate::model::State,
5832
5833    /// The VPC networks associated with this hub's spokes.
5834    ///
5835    /// This field is read-only. Network Connectivity Center automatically
5836    /// populates it based on the set of spokes attached to the hub.
5837    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
5838
5839    /// Output only. The route tables that belong to this hub. They use the
5840    /// following form:
5841    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
5842    ///
5843    /// This field is read-only. Network Connectivity Center automatically
5844    /// populates it based on the route tables nested under the hub.
5845    pub route_tables: std::vec::Vec<std::string::String>,
5846
5847    /// Output only. A summary of the spokes associated with a hub. The
5848    /// summary includes a count of spokes according to type
5849    /// and according to state. If any spokes are inactive,
5850    /// the summary also lists the reasons they are inactive,
5851    /// including a count for each reason.
5852    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
5853
5854    /// Optional. The policy mode of this hub. This field can be either
5855    /// PRESET or CUSTOM. If unspecified, the
5856    /// policy_mode defaults to PRESET.
5857    pub policy_mode: crate::model::PolicyMode,
5858
5859    /// Optional. The topology implemented in this hub. Currently, this field is
5860    /// only used when policy_mode = PRESET. The available preset topologies are
5861    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
5862    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
5863    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
5864    pub preset_topology: crate::model::PresetTopology,
5865
5866    /// Optional. Whether Private Service Connect connection propagation is enabled
5867    /// for the hub. If true, Private Service Connect endpoints in VPC spokes
5868    /// attached to the hub are made accessible to other VPC spokes attached to the
5869    /// hub. The default value is false.
5870    pub export_psc: std::option::Option<bool>,
5871
5872    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5873}
5874
5875impl Hub {
5876    pub fn new() -> Self {
5877        std::default::Default::default()
5878    }
5879
5880    /// Sets the value of [name][crate::model::Hub::name].
5881    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5882        self.name = v.into();
5883        self
5884    }
5885
5886    /// Sets the value of [create_time][crate::model::Hub::create_time].
5887    pub fn set_create_time<T>(mut self, v: T) -> Self
5888    where
5889        T: std::convert::Into<wkt::Timestamp>,
5890    {
5891        self.create_time = std::option::Option::Some(v.into());
5892        self
5893    }
5894
5895    /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
5896    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5897    where
5898        T: std::convert::Into<wkt::Timestamp>,
5899    {
5900        self.create_time = v.map(|x| x.into());
5901        self
5902    }
5903
5904    /// Sets the value of [update_time][crate::model::Hub::update_time].
5905    pub fn set_update_time<T>(mut self, v: T) -> Self
5906    where
5907        T: std::convert::Into<wkt::Timestamp>,
5908    {
5909        self.update_time = std::option::Option::Some(v.into());
5910        self
5911    }
5912
5913    /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
5914    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5915    where
5916        T: std::convert::Into<wkt::Timestamp>,
5917    {
5918        self.update_time = v.map(|x| x.into());
5919        self
5920    }
5921
5922    /// Sets the value of [labels][crate::model::Hub::labels].
5923    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5924    where
5925        T: std::iter::IntoIterator<Item = (K, V)>,
5926        K: std::convert::Into<std::string::String>,
5927        V: std::convert::Into<std::string::String>,
5928    {
5929        use std::iter::Iterator;
5930        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5931        self
5932    }
5933
5934    /// Sets the value of [description][crate::model::Hub::description].
5935    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5936        self.description = v.into();
5937        self
5938    }
5939
5940    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
5941    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5942        self.unique_id = v.into();
5943        self
5944    }
5945
5946    /// Sets the value of [state][crate::model::Hub::state].
5947    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
5948        self.state = v.into();
5949        self
5950    }
5951
5952    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
5953    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
5954    where
5955        T: std::iter::IntoIterator<Item = V>,
5956        V: std::convert::Into<crate::model::RoutingVPC>,
5957    {
5958        use std::iter::Iterator;
5959        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
5960        self
5961    }
5962
5963    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
5964    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
5965    where
5966        T: std::iter::IntoIterator<Item = V>,
5967        V: std::convert::Into<std::string::String>,
5968    {
5969        use std::iter::Iterator;
5970        self.route_tables = v.into_iter().map(|i| i.into()).collect();
5971        self
5972    }
5973
5974    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
5975    pub fn set_spoke_summary<T>(mut self, v: T) -> Self
5976    where
5977        T: std::convert::Into<crate::model::SpokeSummary>,
5978    {
5979        self.spoke_summary = std::option::Option::Some(v.into());
5980        self
5981    }
5982
5983    /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
5984    pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
5985    where
5986        T: std::convert::Into<crate::model::SpokeSummary>,
5987    {
5988        self.spoke_summary = v.map(|x| x.into());
5989        self
5990    }
5991
5992    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
5993    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
5994        mut self,
5995        v: T,
5996    ) -> Self {
5997        self.policy_mode = v.into();
5998        self
5999    }
6000
6001    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
6002    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
6003        mut self,
6004        v: T,
6005    ) -> Self {
6006        self.preset_topology = v.into();
6007        self
6008    }
6009
6010    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
6011    pub fn set_export_psc<T>(mut self, v: T) -> Self
6012    where
6013        T: std::convert::Into<bool>,
6014    {
6015        self.export_psc = std::option::Option::Some(v.into());
6016        self
6017    }
6018
6019    /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
6020    pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
6021    where
6022        T: std::convert::Into<bool>,
6023    {
6024        self.export_psc = v.map(|x| x.into());
6025        self
6026    }
6027}
6028
6029impl wkt::message::Message for Hub {
6030    fn typename() -> &'static str {
6031        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
6032    }
6033}
6034
6035/// RoutingVPC contains information about the VPC networks associated
6036/// with the spokes of a Network Connectivity Center hub.
6037#[derive(Clone, Default, PartialEq)]
6038#[non_exhaustive]
6039pub struct RoutingVPC {
6040    /// The URI of the VPC network.
6041    pub uri: std::string::String,
6042
6043    /// Output only. If true, indicates that this VPC network is currently
6044    /// associated with spokes that use the data transfer feature (spokes where the
6045    /// site_to_site_data_transfer field is set to true). If you create new spokes
6046    /// that use data transfer, they must be associated with this VPC network. At
6047    /// most, one VPC network will have this field set to true.
6048    pub required_for_new_site_to_site_data_transfer_spokes: bool,
6049
6050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6051}
6052
6053impl RoutingVPC {
6054    pub fn new() -> Self {
6055        std::default::Default::default()
6056    }
6057
6058    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
6059    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6060        self.uri = v.into();
6061        self
6062    }
6063
6064    /// 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].
6065    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
6066        mut self,
6067        v: T,
6068    ) -> Self {
6069        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
6070        self
6071    }
6072}
6073
6074impl wkt::message::Message for RoutingVPC {
6075    fn typename() -> &'static str {
6076        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
6077    }
6078}
6079
6080/// A Network Connectivity Center spoke represents one or more network
6081/// connectivity resources.
6082///
6083/// When you create a spoke, you associate it with a hub. You must also
6084/// identify a value for exactly one of the following fields:
6085///
6086/// * linked_vpn_tunnels
6087/// * linked_interconnect_attachments
6088/// * linked_router_appliance_instances
6089/// * linked_vpc_network
6090#[derive(Clone, Default, PartialEq)]
6091#[non_exhaustive]
6092pub struct Spoke {
6093    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
6094    /// following form:
6095    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
6096    pub name: std::string::String,
6097
6098    /// Output only. The time the spoke was created.
6099    pub create_time: std::option::Option<wkt::Timestamp>,
6100
6101    /// Output only. The time the spoke was last updated.
6102    pub update_time: std::option::Option<wkt::Timestamp>,
6103
6104    /// Optional labels in key-value pair format. For more information about
6105    /// labels, see [Requirements for
6106    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
6107    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6108
6109    /// Optional. An optional description of the spoke.
6110    pub description: std::string::String,
6111
6112    /// Immutable. The name of the hub that this spoke is attached to.
6113    pub hub: std::string::String,
6114
6115    /// Optional. The name of the group that this spoke is associated with.
6116    pub group: std::string::String,
6117
6118    /// Optional. VPN tunnels that are associated with the spoke.
6119    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
6120
6121    /// Optional. VLAN attachments that are associated with the spoke.
6122    pub linked_interconnect_attachments:
6123        std::option::Option<crate::model::LinkedInterconnectAttachments>,
6124
6125    /// Optional. Router appliance instances that are associated with the spoke.
6126    pub linked_router_appliance_instances:
6127        std::option::Option<crate::model::LinkedRouterApplianceInstances>,
6128
6129    /// Optional. VPC network that is associated with the spoke.
6130    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
6131
6132    /// Optional. The linked producer VPC that is associated with the spoke.
6133    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
6134
6135    /// Output only. The Google-generated UUID for the spoke. This value is unique
6136    /// across all spoke resources. If a spoke is deleted and another with the same
6137    /// name is created, the new spoke is assigned a different `unique_id`.
6138    pub unique_id: std::string::String,
6139
6140    /// Output only. The current lifecycle state of this spoke.
6141    pub state: crate::model::State,
6142
6143    /// Output only. The reasons for current state of the spoke.
6144    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
6145
6146    /// Output only. The type of resource associated with the spoke.
6147    pub spoke_type: crate::model::SpokeType,
6148
6149    /// Optional. This checksum is computed by the server based on the value of
6150    /// other fields, and may be sent on update and delete requests to ensure the
6151    /// client has an up-to-date value before proceeding.
6152    pub etag: std::string::String,
6153
6154    /// Optional. The list of fields waiting for hub administration's approval.
6155    pub field_paths_pending_update: std::vec::Vec<std::string::String>,
6156
6157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6158}
6159
6160impl Spoke {
6161    pub fn new() -> Self {
6162        std::default::Default::default()
6163    }
6164
6165    /// Sets the value of [name][crate::model::Spoke::name].
6166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6167        self.name = v.into();
6168        self
6169    }
6170
6171    /// Sets the value of [create_time][crate::model::Spoke::create_time].
6172    pub fn set_create_time<T>(mut self, v: T) -> Self
6173    where
6174        T: std::convert::Into<wkt::Timestamp>,
6175    {
6176        self.create_time = std::option::Option::Some(v.into());
6177        self
6178    }
6179
6180    /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
6181    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6182    where
6183        T: std::convert::Into<wkt::Timestamp>,
6184    {
6185        self.create_time = v.map(|x| x.into());
6186        self
6187    }
6188
6189    /// Sets the value of [update_time][crate::model::Spoke::update_time].
6190    pub fn set_update_time<T>(mut self, v: T) -> Self
6191    where
6192        T: std::convert::Into<wkt::Timestamp>,
6193    {
6194        self.update_time = std::option::Option::Some(v.into());
6195        self
6196    }
6197
6198    /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
6199    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6200    where
6201        T: std::convert::Into<wkt::Timestamp>,
6202    {
6203        self.update_time = v.map(|x| x.into());
6204        self
6205    }
6206
6207    /// Sets the value of [labels][crate::model::Spoke::labels].
6208    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6209    where
6210        T: std::iter::IntoIterator<Item = (K, V)>,
6211        K: std::convert::Into<std::string::String>,
6212        V: std::convert::Into<std::string::String>,
6213    {
6214        use std::iter::Iterator;
6215        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6216        self
6217    }
6218
6219    /// Sets the value of [description][crate::model::Spoke::description].
6220    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6221        self.description = v.into();
6222        self
6223    }
6224
6225    /// Sets the value of [hub][crate::model::Spoke::hub].
6226    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6227        self.hub = v.into();
6228        self
6229    }
6230
6231    /// Sets the value of [group][crate::model::Spoke::group].
6232    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6233        self.group = v.into();
6234        self
6235    }
6236
6237    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
6238    pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
6239    where
6240        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
6241    {
6242        self.linked_vpn_tunnels = std::option::Option::Some(v.into());
6243        self
6244    }
6245
6246    /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
6247    pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
6248    where
6249        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
6250    {
6251        self.linked_vpn_tunnels = v.map(|x| x.into());
6252        self
6253    }
6254
6255    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
6256    pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
6257    where
6258        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
6259    {
6260        self.linked_interconnect_attachments = std::option::Option::Some(v.into());
6261        self
6262    }
6263
6264    /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
6265    pub fn set_or_clear_linked_interconnect_attachments<T>(
6266        mut self,
6267        v: std::option::Option<T>,
6268    ) -> Self
6269    where
6270        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
6271    {
6272        self.linked_interconnect_attachments = v.map(|x| x.into());
6273        self
6274    }
6275
6276    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
6277    pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
6278    where
6279        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
6280    {
6281        self.linked_router_appliance_instances = std::option::Option::Some(v.into());
6282        self
6283    }
6284
6285    /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
6286    pub fn set_or_clear_linked_router_appliance_instances<T>(
6287        mut self,
6288        v: std::option::Option<T>,
6289    ) -> Self
6290    where
6291        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
6292    {
6293        self.linked_router_appliance_instances = v.map(|x| x.into());
6294        self
6295    }
6296
6297    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
6298    pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
6299    where
6300        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
6301    {
6302        self.linked_vpc_network = std::option::Option::Some(v.into());
6303        self
6304    }
6305
6306    /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
6307    pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6308    where
6309        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
6310    {
6311        self.linked_vpc_network = v.map(|x| x.into());
6312        self
6313    }
6314
6315    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
6316    pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
6317    where
6318        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
6319    {
6320        self.linked_producer_vpc_network = std::option::Option::Some(v.into());
6321        self
6322    }
6323
6324    /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
6325    pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6326    where
6327        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
6328    {
6329        self.linked_producer_vpc_network = v.map(|x| x.into());
6330        self
6331    }
6332
6333    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
6334    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6335        self.unique_id = v.into();
6336        self
6337    }
6338
6339    /// Sets the value of [state][crate::model::Spoke::state].
6340    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6341        self.state = v.into();
6342        self
6343    }
6344
6345    /// Sets the value of [reasons][crate::model::Spoke::reasons].
6346    pub fn set_reasons<T, V>(mut self, v: T) -> Self
6347    where
6348        T: std::iter::IntoIterator<Item = V>,
6349        V: std::convert::Into<crate::model::spoke::StateReason>,
6350    {
6351        use std::iter::Iterator;
6352        self.reasons = v.into_iter().map(|i| i.into()).collect();
6353        self
6354    }
6355
6356    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
6357    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
6358        self.spoke_type = v.into();
6359        self
6360    }
6361
6362    /// Sets the value of [etag][crate::model::Spoke::etag].
6363    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6364        self.etag = v.into();
6365        self
6366    }
6367
6368    /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
6369    pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
6370    where
6371        T: std::iter::IntoIterator<Item = V>,
6372        V: std::convert::Into<std::string::String>,
6373    {
6374        use std::iter::Iterator;
6375        self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
6376        self
6377    }
6378}
6379
6380impl wkt::message::Message for Spoke {
6381    fn typename() -> &'static str {
6382        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
6383    }
6384}
6385
6386/// Defines additional types related to [Spoke].
6387pub mod spoke {
6388    #[allow(unused_imports)]
6389    use super::*;
6390
6391    /// The reason a spoke is inactive.
6392    #[derive(Clone, Default, PartialEq)]
6393    #[non_exhaustive]
6394    pub struct StateReason {
6395        /// The code associated with this reason.
6396        pub code: crate::model::spoke::state_reason::Code,
6397
6398        /// Human-readable details about this reason.
6399        pub message: std::string::String,
6400
6401        /// Additional information provided by the user in the RejectSpoke call.
6402        pub user_details: std::string::String,
6403
6404        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6405    }
6406
6407    impl StateReason {
6408        pub fn new() -> Self {
6409            std::default::Default::default()
6410        }
6411
6412        /// Sets the value of [code][crate::model::spoke::StateReason::code].
6413        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
6414            mut self,
6415            v: T,
6416        ) -> Self {
6417            self.code = v.into();
6418            self
6419        }
6420
6421        /// Sets the value of [message][crate::model::spoke::StateReason::message].
6422        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6423            self.message = v.into();
6424            self
6425        }
6426
6427        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
6428        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
6429            mut self,
6430            v: T,
6431        ) -> Self {
6432            self.user_details = v.into();
6433            self
6434        }
6435    }
6436
6437    impl wkt::message::Message for StateReason {
6438        fn typename() -> &'static str {
6439            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
6440        }
6441    }
6442
6443    /// Defines additional types related to [StateReason].
6444    pub mod state_reason {
6445        #[allow(unused_imports)]
6446        use super::*;
6447
6448        /// The Code enum represents the various reasons a state can be `INACTIVE`.
6449        ///
6450        /// # Working with unknown values
6451        ///
6452        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6453        /// additional enum variants at any time. Adding new variants is not considered
6454        /// a breaking change. Applications should write their code in anticipation of:
6455        ///
6456        /// - New values appearing in future releases of the client library, **and**
6457        /// - New values received dynamically, without application changes.
6458        ///
6459        /// Please consult the [Working with enums] section in the user guide for some
6460        /// guidelines.
6461        ///
6462        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6463        #[derive(Clone, Debug, PartialEq)]
6464        #[non_exhaustive]
6465        pub enum Code {
6466            /// No information available.
6467            Unspecified,
6468            /// The proposed spoke is pending review.
6469            PendingReview,
6470            /// The proposed spoke has been rejected by the hub administrator.
6471            Rejected,
6472            /// The spoke has been deactivated internally.
6473            Paused,
6474            /// Network Connectivity Center encountered errors while accepting
6475            /// the spoke.
6476            Failed,
6477            /// The proposed spoke update is pending review.
6478            UpdatePendingReview,
6479            /// The proposed spoke update has been rejected by the hub administrator.
6480            UpdateRejected,
6481            /// Network Connectivity Center encountered errors while accepting
6482            /// the spoke update.
6483            UpdateFailed,
6484            /// If set, the enum was initialized with an unknown value.
6485            ///
6486            /// Applications can examine the value using [Code::value] or
6487            /// [Code::name].
6488            UnknownValue(code::UnknownValue),
6489        }
6490
6491        #[doc(hidden)]
6492        pub mod code {
6493            #[allow(unused_imports)]
6494            use super::*;
6495            #[derive(Clone, Debug, PartialEq)]
6496            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6497        }
6498
6499        impl Code {
6500            /// Gets the enum value.
6501            ///
6502            /// Returns `None` if the enum contains an unknown value deserialized from
6503            /// the string representation of enums.
6504            pub fn value(&self) -> std::option::Option<i32> {
6505                match self {
6506                    Self::Unspecified => std::option::Option::Some(0),
6507                    Self::PendingReview => std::option::Option::Some(1),
6508                    Self::Rejected => std::option::Option::Some(2),
6509                    Self::Paused => std::option::Option::Some(3),
6510                    Self::Failed => std::option::Option::Some(4),
6511                    Self::UpdatePendingReview => std::option::Option::Some(5),
6512                    Self::UpdateRejected => std::option::Option::Some(6),
6513                    Self::UpdateFailed => std::option::Option::Some(7),
6514                    Self::UnknownValue(u) => u.0.value(),
6515                }
6516            }
6517
6518            /// Gets the enum value as a string.
6519            ///
6520            /// Returns `None` if the enum contains an unknown value deserialized from
6521            /// the integer representation of enums.
6522            pub fn name(&self) -> std::option::Option<&str> {
6523                match self {
6524                    Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
6525                    Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
6526                    Self::Rejected => std::option::Option::Some("REJECTED"),
6527                    Self::Paused => std::option::Option::Some("PAUSED"),
6528                    Self::Failed => std::option::Option::Some("FAILED"),
6529                    Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
6530                    Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
6531                    Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
6532                    Self::UnknownValue(u) => u.0.name(),
6533                }
6534            }
6535        }
6536
6537        impl std::default::Default for Code {
6538            fn default() -> Self {
6539                use std::convert::From;
6540                Self::from(0)
6541            }
6542        }
6543
6544        impl std::fmt::Display for Code {
6545            fn fmt(
6546                &self,
6547                f: &mut std::fmt::Formatter<'_>,
6548            ) -> std::result::Result<(), std::fmt::Error> {
6549                wkt::internal::display_enum(f, self.name(), self.value())
6550            }
6551        }
6552
6553        impl std::convert::From<i32> for Code {
6554            fn from(value: i32) -> Self {
6555                match value {
6556                    0 => Self::Unspecified,
6557                    1 => Self::PendingReview,
6558                    2 => Self::Rejected,
6559                    3 => Self::Paused,
6560                    4 => Self::Failed,
6561                    5 => Self::UpdatePendingReview,
6562                    6 => Self::UpdateRejected,
6563                    7 => Self::UpdateFailed,
6564                    _ => Self::UnknownValue(code::UnknownValue(
6565                        wkt::internal::UnknownEnumValue::Integer(value),
6566                    )),
6567                }
6568            }
6569        }
6570
6571        impl std::convert::From<&str> for Code {
6572            fn from(value: &str) -> Self {
6573                use std::string::ToString;
6574                match value {
6575                    "CODE_UNSPECIFIED" => Self::Unspecified,
6576                    "PENDING_REVIEW" => Self::PendingReview,
6577                    "REJECTED" => Self::Rejected,
6578                    "PAUSED" => Self::Paused,
6579                    "FAILED" => Self::Failed,
6580                    "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
6581                    "UPDATE_REJECTED" => Self::UpdateRejected,
6582                    "UPDATE_FAILED" => Self::UpdateFailed,
6583                    _ => Self::UnknownValue(code::UnknownValue(
6584                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6585                    )),
6586                }
6587            }
6588        }
6589
6590        impl serde::ser::Serialize for Code {
6591            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6592            where
6593                S: serde::Serializer,
6594            {
6595                match self {
6596                    Self::Unspecified => serializer.serialize_i32(0),
6597                    Self::PendingReview => serializer.serialize_i32(1),
6598                    Self::Rejected => serializer.serialize_i32(2),
6599                    Self::Paused => serializer.serialize_i32(3),
6600                    Self::Failed => serializer.serialize_i32(4),
6601                    Self::UpdatePendingReview => serializer.serialize_i32(5),
6602                    Self::UpdateRejected => serializer.serialize_i32(6),
6603                    Self::UpdateFailed => serializer.serialize_i32(7),
6604                    Self::UnknownValue(u) => u.0.serialize(serializer),
6605                }
6606            }
6607        }
6608
6609        impl<'de> serde::de::Deserialize<'de> for Code {
6610            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6611            where
6612                D: serde::Deserializer<'de>,
6613            {
6614                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
6615                    ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
6616                ))
6617            }
6618        }
6619    }
6620}
6621
6622#[derive(Clone, Default, PartialEq)]
6623#[non_exhaustive]
6624pub struct RouteTable {
6625    /// Immutable. The name of the route table. Route table names must be unique.
6626    /// They use the following form:
6627    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
6628    pub name: std::string::String,
6629
6630    /// Output only. The time the route table was created.
6631    pub create_time: std::option::Option<wkt::Timestamp>,
6632
6633    /// Output only. The time the route table was last updated.
6634    pub update_time: std::option::Option<wkt::Timestamp>,
6635
6636    /// Optional labels in key-value pair format. For more information about
6637    /// labels, see [Requirements for
6638    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
6639    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6640
6641    /// An optional description of the route table.
6642    pub description: std::string::String,
6643
6644    /// Output only. The Google-generated UUID for the route table. This value is
6645    /// unique across all route table resources. If a route table is deleted and
6646    /// another with the same name is created, the new route table is assigned
6647    /// a different `uid`.
6648    pub uid: std::string::String,
6649
6650    /// Output only. The current lifecycle state of this route table.
6651    pub state: crate::model::State,
6652
6653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl RouteTable {
6657    pub fn new() -> Self {
6658        std::default::Default::default()
6659    }
6660
6661    /// Sets the value of [name][crate::model::RouteTable::name].
6662    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.name = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
6668    pub fn set_create_time<T>(mut self, v: T) -> Self
6669    where
6670        T: std::convert::Into<wkt::Timestamp>,
6671    {
6672        self.create_time = std::option::Option::Some(v.into());
6673        self
6674    }
6675
6676    /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
6677    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6678    where
6679        T: std::convert::Into<wkt::Timestamp>,
6680    {
6681        self.create_time = v.map(|x| x.into());
6682        self
6683    }
6684
6685    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
6686    pub fn set_update_time<T>(mut self, v: T) -> Self
6687    where
6688        T: std::convert::Into<wkt::Timestamp>,
6689    {
6690        self.update_time = std::option::Option::Some(v.into());
6691        self
6692    }
6693
6694    /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
6695    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6696    where
6697        T: std::convert::Into<wkt::Timestamp>,
6698    {
6699        self.update_time = v.map(|x| x.into());
6700        self
6701    }
6702
6703    /// Sets the value of [labels][crate::model::RouteTable::labels].
6704    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6705    where
6706        T: std::iter::IntoIterator<Item = (K, V)>,
6707        K: std::convert::Into<std::string::String>,
6708        V: std::convert::Into<std::string::String>,
6709    {
6710        use std::iter::Iterator;
6711        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6712        self
6713    }
6714
6715    /// Sets the value of [description][crate::model::RouteTable::description].
6716    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6717        self.description = v.into();
6718        self
6719    }
6720
6721    /// Sets the value of [uid][crate::model::RouteTable::uid].
6722    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6723        self.uid = v.into();
6724        self
6725    }
6726
6727    /// Sets the value of [state][crate::model::RouteTable::state].
6728    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6729        self.state = v.into();
6730        self
6731    }
6732}
6733
6734impl wkt::message::Message for RouteTable {
6735    fn typename() -> &'static str {
6736        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
6737    }
6738}
6739
6740/// A route defines a path from VM instances within a spoke to a specific
6741/// destination resource. Only VPC spokes have routes.
6742#[derive(Clone, Default, PartialEq)]
6743#[non_exhaustive]
6744pub struct Route {
6745    /// Immutable. The name of the route. Route names must be unique. Route names
6746    /// use the following form:
6747    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
6748    pub name: std::string::String,
6749
6750    /// Output only. The time the route was created.
6751    pub create_time: std::option::Option<wkt::Timestamp>,
6752
6753    /// Output only. The time the route was last updated.
6754    pub update_time: std::option::Option<wkt::Timestamp>,
6755
6756    /// The destination IP address range.
6757    pub ip_cidr_range: std::string::String,
6758
6759    /// Output only. The route's type. Its type is determined by the properties of
6760    /// its IP address range.
6761    pub r#type: crate::model::RouteType,
6762
6763    /// Immutable. The destination VPC network for packets on this route.
6764    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
6765
6766    /// Optional labels in key-value pair format. For more information about
6767    /// labels, see [Requirements for
6768    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
6769    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6770
6771    /// An optional description of the route.
6772    pub description: std::string::String,
6773
6774    /// Output only. The Google-generated UUID for the route. This value is unique
6775    /// across all Network Connectivity Center route resources. If a
6776    /// route is deleted and another with the same name is created,
6777    /// the new route is assigned a different `uid`.
6778    pub uid: std::string::String,
6779
6780    /// Output only. The current lifecycle state of the route.
6781    pub state: crate::model::State,
6782
6783    /// Immutable. The spoke that this route leads to.
6784    /// Example: projects/12345/locations/global/spokes/SPOKE
6785    pub spoke: std::string::String,
6786
6787    /// Output only. The origin location of the route.
6788    /// Uses the following form: "projects/{project}/locations/{location}"
6789    /// Example: projects/1234/locations/us-central1
6790    pub location: std::string::String,
6791
6792    /// Output only. The priority of this route. Priority is used to break ties in
6793    /// cases where a destination matches more than one route. In these cases the
6794    /// route with the lowest-numbered priority value wins.
6795    pub priority: i64,
6796
6797    /// Immutable. The next-hop VPN tunnel for packets on this route.
6798    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
6799
6800    /// Immutable. The next-hop Router appliance instance for packets on this
6801    /// route.
6802    pub next_hop_router_appliance_instance:
6803        std::option::Option<crate::model::NextHopRouterApplianceInstance>,
6804
6805    /// Immutable. The next-hop VLAN attachment for packets on this route.
6806    pub next_hop_interconnect_attachment:
6807        std::option::Option<crate::model::NextHopInterconnectAttachment>,
6808
6809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6810}
6811
6812impl Route {
6813    pub fn new() -> Self {
6814        std::default::Default::default()
6815    }
6816
6817    /// Sets the value of [name][crate::model::Route::name].
6818    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6819        self.name = v.into();
6820        self
6821    }
6822
6823    /// Sets the value of [create_time][crate::model::Route::create_time].
6824    pub fn set_create_time<T>(mut self, v: T) -> Self
6825    where
6826        T: std::convert::Into<wkt::Timestamp>,
6827    {
6828        self.create_time = std::option::Option::Some(v.into());
6829        self
6830    }
6831
6832    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6833    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6834    where
6835        T: std::convert::Into<wkt::Timestamp>,
6836    {
6837        self.create_time = v.map(|x| x.into());
6838        self
6839    }
6840
6841    /// Sets the value of [update_time][crate::model::Route::update_time].
6842    pub fn set_update_time<T>(mut self, v: T) -> Self
6843    where
6844        T: std::convert::Into<wkt::Timestamp>,
6845    {
6846        self.update_time = std::option::Option::Some(v.into());
6847        self
6848    }
6849
6850    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6851    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6852    where
6853        T: std::convert::Into<wkt::Timestamp>,
6854    {
6855        self.update_time = v.map(|x| x.into());
6856        self
6857    }
6858
6859    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
6860    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6861        self.ip_cidr_range = v.into();
6862        self
6863    }
6864
6865    /// Sets the value of [r#type][crate::model::Route::type].
6866    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
6867        self.r#type = v.into();
6868        self
6869    }
6870
6871    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
6872    pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
6873    where
6874        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
6875    {
6876        self.next_hop_vpc_network = std::option::Option::Some(v.into());
6877        self
6878    }
6879
6880    /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
6881    pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6882    where
6883        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
6884    {
6885        self.next_hop_vpc_network = v.map(|x| x.into());
6886        self
6887    }
6888
6889    /// Sets the value of [labels][crate::model::Route::labels].
6890    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6891    where
6892        T: std::iter::IntoIterator<Item = (K, V)>,
6893        K: std::convert::Into<std::string::String>,
6894        V: std::convert::Into<std::string::String>,
6895    {
6896        use std::iter::Iterator;
6897        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6898        self
6899    }
6900
6901    /// Sets the value of [description][crate::model::Route::description].
6902    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6903        self.description = v.into();
6904        self
6905    }
6906
6907    /// Sets the value of [uid][crate::model::Route::uid].
6908    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6909        self.uid = v.into();
6910        self
6911    }
6912
6913    /// Sets the value of [state][crate::model::Route::state].
6914    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6915        self.state = v.into();
6916        self
6917    }
6918
6919    /// Sets the value of [spoke][crate::model::Route::spoke].
6920    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6921        self.spoke = v.into();
6922        self
6923    }
6924
6925    /// Sets the value of [location][crate::model::Route::location].
6926    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6927        self.location = v.into();
6928        self
6929    }
6930
6931    /// Sets the value of [priority][crate::model::Route::priority].
6932    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6933        self.priority = v.into();
6934        self
6935    }
6936
6937    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
6938    pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
6939    where
6940        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
6941    {
6942        self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
6943        self
6944    }
6945
6946    /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
6947    pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
6948    where
6949        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
6950    {
6951        self.next_hop_vpn_tunnel = v.map(|x| x.into());
6952        self
6953    }
6954
6955    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
6956    pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
6957    where
6958        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
6959    {
6960        self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
6961        self
6962    }
6963
6964    /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
6965    pub fn set_or_clear_next_hop_router_appliance_instance<T>(
6966        mut self,
6967        v: std::option::Option<T>,
6968    ) -> Self
6969    where
6970        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
6971    {
6972        self.next_hop_router_appliance_instance = v.map(|x| x.into());
6973        self
6974    }
6975
6976    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
6977    pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
6978    where
6979        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
6980    {
6981        self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
6982        self
6983    }
6984
6985    /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
6986    pub fn set_or_clear_next_hop_interconnect_attachment<T>(
6987        mut self,
6988        v: std::option::Option<T>,
6989    ) -> Self
6990    where
6991        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
6992    {
6993        self.next_hop_interconnect_attachment = v.map(|x| x.into());
6994        self
6995    }
6996}
6997
6998impl wkt::message::Message for Route {
6999    fn typename() -> &'static str {
7000        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
7001    }
7002}
7003
7004/// A group represents a subset of spokes attached to a hub.
7005#[derive(Clone, Default, PartialEq)]
7006#[non_exhaustive]
7007pub struct Group {
7008    /// Immutable. The name of the group. Group names must be unique. They
7009    /// use the following form:
7010    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
7011    pub name: std::string::String,
7012
7013    /// Output only. The time the group was created.
7014    pub create_time: std::option::Option<wkt::Timestamp>,
7015
7016    /// Output only. The time the group was last updated.
7017    pub update_time: std::option::Option<wkt::Timestamp>,
7018
7019    /// Optional. Labels in key-value pair format. For more information about
7020    /// labels, see [Requirements for
7021    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7022    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7023
7024    /// Optional. The description of the group.
7025    pub description: std::string::String,
7026
7027    /// Output only. The Google-generated UUID for the group. This value is unique
7028    /// across all group resources. If a group is deleted and
7029    /// another with the same name is created, the new route table is assigned
7030    /// a different unique_id.
7031    pub uid: std::string::String,
7032
7033    /// Output only. The current lifecycle state of this group.
7034    pub state: crate::model::State,
7035
7036    /// Optional. The auto-accept setting for this group.
7037    pub auto_accept: std::option::Option<crate::model::AutoAccept>,
7038
7039    /// Output only. The name of the route table that corresponds to this group.
7040    /// They use the following form:
7041    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7042    pub route_table: std::string::String,
7043
7044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7045}
7046
7047impl Group {
7048    pub fn new() -> Self {
7049        std::default::Default::default()
7050    }
7051
7052    /// Sets the value of [name][crate::model::Group::name].
7053    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7054        self.name = v.into();
7055        self
7056    }
7057
7058    /// Sets the value of [create_time][crate::model::Group::create_time].
7059    pub fn set_create_time<T>(mut self, v: T) -> Self
7060    where
7061        T: std::convert::Into<wkt::Timestamp>,
7062    {
7063        self.create_time = std::option::Option::Some(v.into());
7064        self
7065    }
7066
7067    /// Sets or clears the value of [create_time][crate::model::Group::create_time].
7068    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7069    where
7070        T: std::convert::Into<wkt::Timestamp>,
7071    {
7072        self.create_time = v.map(|x| x.into());
7073        self
7074    }
7075
7076    /// Sets the value of [update_time][crate::model::Group::update_time].
7077    pub fn set_update_time<T>(mut self, v: T) -> Self
7078    where
7079        T: std::convert::Into<wkt::Timestamp>,
7080    {
7081        self.update_time = std::option::Option::Some(v.into());
7082        self
7083    }
7084
7085    /// Sets or clears the value of [update_time][crate::model::Group::update_time].
7086    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7087    where
7088        T: std::convert::Into<wkt::Timestamp>,
7089    {
7090        self.update_time = v.map(|x| x.into());
7091        self
7092    }
7093
7094    /// Sets the value of [labels][crate::model::Group::labels].
7095    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7096    where
7097        T: std::iter::IntoIterator<Item = (K, V)>,
7098        K: std::convert::Into<std::string::String>,
7099        V: std::convert::Into<std::string::String>,
7100    {
7101        use std::iter::Iterator;
7102        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7103        self
7104    }
7105
7106    /// Sets the value of [description][crate::model::Group::description].
7107    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7108        self.description = v.into();
7109        self
7110    }
7111
7112    /// Sets the value of [uid][crate::model::Group::uid].
7113    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7114        self.uid = v.into();
7115        self
7116    }
7117
7118    /// Sets the value of [state][crate::model::Group::state].
7119    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
7120        self.state = v.into();
7121        self
7122    }
7123
7124    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
7125    pub fn set_auto_accept<T>(mut self, v: T) -> Self
7126    where
7127        T: std::convert::Into<crate::model::AutoAccept>,
7128    {
7129        self.auto_accept = std::option::Option::Some(v.into());
7130        self
7131    }
7132
7133    /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
7134    pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
7135    where
7136        T: std::convert::Into<crate::model::AutoAccept>,
7137    {
7138        self.auto_accept = v.map(|x| x.into());
7139        self
7140    }
7141
7142    /// Sets the value of [route_table][crate::model::Group::route_table].
7143    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7144        self.route_table = v.into();
7145        self
7146    }
7147}
7148
7149impl wkt::message::Message for Group {
7150    fn typename() -> &'static str {
7151        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
7152    }
7153}
7154
7155/// The auto-accept setting for a group controls whether
7156/// proposed spokes are automatically attached to the hub. If auto-accept is
7157/// enabled, the spoke immediately is attached to the hub and becomes part of the
7158/// group. In this case, the new spoke is in the ACTIVE state.
7159/// If auto-accept is disabled, the spoke goes to the INACTIVE
7160/// state, and it must be reviewed and accepted by a hub
7161/// administrator.
7162#[derive(Clone, Default, PartialEq)]
7163#[non_exhaustive]
7164pub struct AutoAccept {
7165    /// Optional. A list of project ids or project numbers for which you want
7166    /// to enable auto-accept. The auto-accept setting is applied to
7167    /// spokes being created or updated in these projects.
7168    pub auto_accept_projects: std::vec::Vec<std::string::String>,
7169
7170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7171}
7172
7173impl AutoAccept {
7174    pub fn new() -> Self {
7175        std::default::Default::default()
7176    }
7177
7178    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
7179    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
7180    where
7181        T: std::iter::IntoIterator<Item = V>,
7182        V: std::convert::Into<std::string::String>,
7183    {
7184        use std::iter::Iterator;
7185        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
7186        self
7187    }
7188}
7189
7190impl wkt::message::Message for AutoAccept {
7191    fn typename() -> &'static str {
7192        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
7193    }
7194}
7195
7196/// Request for
7197/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
7198/// method.
7199///
7200/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
7201#[derive(Clone, Default, PartialEq)]
7202#[non_exhaustive]
7203pub struct ListHubsRequest {
7204    /// Required. The parent resource's name.
7205    pub parent: std::string::String,
7206
7207    /// The maximum number of results per page to return.
7208    pub page_size: i32,
7209
7210    /// The page token.
7211    pub page_token: std::string::String,
7212
7213    /// An expression that filters the list of results.
7214    pub filter: std::string::String,
7215
7216    /// Sort the results by a certain order.
7217    pub order_by: std::string::String,
7218
7219    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7220}
7221
7222impl ListHubsRequest {
7223    pub fn new() -> Self {
7224        std::default::Default::default()
7225    }
7226
7227    /// Sets the value of [parent][crate::model::ListHubsRequest::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::ListHubsRequest::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::ListHubsRequest::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::ListHubsRequest::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::ListHubsRequest::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 ListHubsRequest {
7259    fn typename() -> &'static str {
7260        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
7261    }
7262}
7263
7264/// Response for
7265/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
7266/// method.
7267///
7268/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
7269#[derive(Clone, Default, PartialEq)]
7270#[non_exhaustive]
7271pub struct ListHubsResponse {
7272    /// The requested hubs.
7273    pub hubs: std::vec::Vec<crate::model::Hub>,
7274
7275    /// The token for the next page of the response. To see more results,
7276    /// use this value as the page_token for your next request. If this value
7277    /// is empty, there are no more results.
7278    pub next_page_token: std::string::String,
7279
7280    /// Locations that could not be reached.
7281    pub unreachable: std::vec::Vec<std::string::String>,
7282
7283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7284}
7285
7286impl ListHubsResponse {
7287    pub fn new() -> Self {
7288        std::default::Default::default()
7289    }
7290
7291    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
7292    pub fn set_hubs<T, V>(mut self, v: T) -> Self
7293    where
7294        T: std::iter::IntoIterator<Item = V>,
7295        V: std::convert::Into<crate::model::Hub>,
7296    {
7297        use std::iter::Iterator;
7298        self.hubs = v.into_iter().map(|i| i.into()).collect();
7299        self
7300    }
7301
7302    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
7303    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7304        self.next_page_token = v.into();
7305        self
7306    }
7307
7308    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
7309    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7310    where
7311        T: std::iter::IntoIterator<Item = V>,
7312        V: std::convert::Into<std::string::String>,
7313    {
7314        use std::iter::Iterator;
7315        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7316        self
7317    }
7318}
7319
7320impl wkt::message::Message for ListHubsResponse {
7321    fn typename() -> &'static str {
7322        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
7323    }
7324}
7325
7326#[doc(hidden)]
7327impl gax::paginator::internal::PageableResponse for ListHubsResponse {
7328    type PageItem = crate::model::Hub;
7329
7330    fn items(self) -> std::vec::Vec<Self::PageItem> {
7331        self.hubs
7332    }
7333
7334    fn next_page_token(&self) -> std::string::String {
7335        use std::clone::Clone;
7336        self.next_page_token.clone()
7337    }
7338}
7339
7340/// Request for
7341/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
7342/// method.
7343///
7344/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
7345#[derive(Clone, Default, PartialEq)]
7346#[non_exhaustive]
7347pub struct GetHubRequest {
7348    /// Required. The name of the hub resource to get.
7349    pub name: std::string::String,
7350
7351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7352}
7353
7354impl GetHubRequest {
7355    pub fn new() -> Self {
7356        std::default::Default::default()
7357    }
7358
7359    /// Sets the value of [name][crate::model::GetHubRequest::name].
7360    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7361        self.name = v.into();
7362        self
7363    }
7364}
7365
7366impl wkt::message::Message for GetHubRequest {
7367    fn typename() -> &'static str {
7368        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
7369    }
7370}
7371
7372/// Request for
7373/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
7374/// method.
7375///
7376/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
7377#[derive(Clone, Default, PartialEq)]
7378#[non_exhaustive]
7379pub struct CreateHubRequest {
7380    /// Required. The parent resource.
7381    pub parent: std::string::String,
7382
7383    /// Required. A unique identifier for the hub.
7384    pub hub_id: std::string::String,
7385
7386    /// Required. The initial values for a new hub.
7387    pub hub: std::option::Option<crate::model::Hub>,
7388
7389    /// Optional. A request ID to identify requests. Specify a unique request ID so
7390    /// that if you must retry your request, the server knows to ignore the request
7391    /// if it has already been completed. The server guarantees that a request
7392    /// doesn't result in creation of duplicate commitments for at least 60
7393    /// minutes.
7394    ///
7395    /// For example, consider a situation where you make an initial request and
7396    /// the request times out. If you make the request again with the same request
7397    /// ID, the server can check to see whether the original operation
7398    /// was received. If it was, the server ignores the second request. This
7399    /// behavior prevents clients from mistakenly creating duplicate commitments.
7400    ///
7401    /// The request ID must be a valid UUID, with the exception that zero UUID is
7402    /// not supported (00000000-0000-0000-0000-000000000000).
7403    pub request_id: std::string::String,
7404
7405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7406}
7407
7408impl CreateHubRequest {
7409    pub fn new() -> Self {
7410        std::default::Default::default()
7411    }
7412
7413    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
7414    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7415        self.parent = v.into();
7416        self
7417    }
7418
7419    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
7420    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7421        self.hub_id = v.into();
7422        self
7423    }
7424
7425    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
7426    pub fn set_hub<T>(mut self, v: T) -> Self
7427    where
7428        T: std::convert::Into<crate::model::Hub>,
7429    {
7430        self.hub = std::option::Option::Some(v.into());
7431        self
7432    }
7433
7434    /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
7435    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
7436    where
7437        T: std::convert::Into<crate::model::Hub>,
7438    {
7439        self.hub = v.map(|x| x.into());
7440        self
7441    }
7442
7443    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
7444    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7445        self.request_id = v.into();
7446        self
7447    }
7448}
7449
7450impl wkt::message::Message for CreateHubRequest {
7451    fn typename() -> &'static str {
7452        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
7453    }
7454}
7455
7456/// Request for
7457/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
7458/// method.
7459///
7460/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
7461#[derive(Clone, Default, PartialEq)]
7462#[non_exhaustive]
7463pub struct UpdateHubRequest {
7464    /// Optional. In the case of an update to an existing hub, field mask is used
7465    /// to specify the fields to be overwritten. The fields specified in the
7466    /// update_mask are relative to the resource, not the full request. A field is
7467    /// overwritten if it is in the mask. If the user does not provide a mask, then
7468    /// all fields are overwritten.
7469    pub update_mask: std::option::Option<wkt::FieldMask>,
7470
7471    /// Required. The state that the hub should be in after the update.
7472    pub hub: std::option::Option<crate::model::Hub>,
7473
7474    /// Optional. A request ID to identify requests. Specify a unique request ID so
7475    /// that if you must retry your request, the server knows to ignore the request
7476    /// if it has already been completed. The server guarantees that a request
7477    /// doesn't result in creation of duplicate commitments for at least 60
7478    /// minutes.
7479    ///
7480    /// For example, consider a situation where you make an initial request and
7481    /// the request times out. If you make the request again with the same request
7482    /// ID, the server can check to see whether the original operation
7483    /// was received. If it was, the server ignores the second request. This
7484    /// behavior prevents clients from mistakenly creating duplicate commitments.
7485    ///
7486    /// The request ID must be a valid UUID, with the exception that zero UUID is
7487    /// not supported (00000000-0000-0000-0000-000000000000).
7488    pub request_id: std::string::String,
7489
7490    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7491}
7492
7493impl UpdateHubRequest {
7494    pub fn new() -> Self {
7495        std::default::Default::default()
7496    }
7497
7498    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
7499    pub fn set_update_mask<T>(mut self, v: T) -> Self
7500    where
7501        T: std::convert::Into<wkt::FieldMask>,
7502    {
7503        self.update_mask = std::option::Option::Some(v.into());
7504        self
7505    }
7506
7507    /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
7508    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7509    where
7510        T: std::convert::Into<wkt::FieldMask>,
7511    {
7512        self.update_mask = v.map(|x| x.into());
7513        self
7514    }
7515
7516    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
7517    pub fn set_hub<T>(mut self, v: T) -> Self
7518    where
7519        T: std::convert::Into<crate::model::Hub>,
7520    {
7521        self.hub = std::option::Option::Some(v.into());
7522        self
7523    }
7524
7525    /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
7526    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
7527    where
7528        T: std::convert::Into<crate::model::Hub>,
7529    {
7530        self.hub = v.map(|x| x.into());
7531        self
7532    }
7533
7534    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
7535    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7536        self.request_id = v.into();
7537        self
7538    }
7539}
7540
7541impl wkt::message::Message for UpdateHubRequest {
7542    fn typename() -> &'static str {
7543        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
7544    }
7545}
7546
7547/// The request for
7548/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
7549///
7550/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
7551#[derive(Clone, Default, PartialEq)]
7552#[non_exhaustive]
7553pub struct DeleteHubRequest {
7554    /// Required. The name of the hub to delete.
7555    pub name: std::string::String,
7556
7557    /// Optional. A request ID to identify requests. Specify a unique request ID so
7558    /// that if you must retry your request, the server knows to ignore the request
7559    /// if it has already been completed. The server guarantees that a request
7560    /// doesn't result in creation of duplicate commitments for at least 60
7561    /// minutes.
7562    ///
7563    /// For example, consider a situation where you make an initial request and
7564    /// the request times out. If you make the request again with the same request
7565    /// ID, the server can check to see whether the original operation
7566    /// was received. If it was, the server ignores the second request. This
7567    /// behavior prevents clients from mistakenly creating duplicate commitments.
7568    ///
7569    /// The request ID must be a valid UUID, with the exception that zero UUID is
7570    /// not supported (00000000-0000-0000-0000-000000000000).
7571    pub request_id: std::string::String,
7572
7573    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7574}
7575
7576impl DeleteHubRequest {
7577    pub fn new() -> Self {
7578        std::default::Default::default()
7579    }
7580
7581    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
7582    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7583        self.name = v.into();
7584        self
7585    }
7586
7587    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
7588    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7589        self.request_id = v.into();
7590        self
7591    }
7592}
7593
7594impl wkt::message::Message for DeleteHubRequest {
7595    fn typename() -> &'static str {
7596        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
7597    }
7598}
7599
7600/// The request for
7601/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
7602///
7603/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
7604#[derive(Clone, Default, PartialEq)]
7605#[non_exhaustive]
7606pub struct ListHubSpokesRequest {
7607    /// Required. The name of the hub.
7608    pub name: std::string::String,
7609
7610    /// A list of locations.
7611    /// Specify one of the following: `[global]`, a single region (for
7612    /// example, `[us-central1]`), or a combination of
7613    /// values (for example, `[global, us-central1, us-west1]`).
7614    /// If the spoke_locations field is populated, the list of results
7615    /// includes only spokes in the specified location.
7616    /// If the spoke_locations field is not populated, the list of results
7617    /// includes spokes in all locations.
7618    pub spoke_locations: std::vec::Vec<std::string::String>,
7619
7620    /// The maximum number of results to return per page.
7621    pub page_size: i32,
7622
7623    /// The page token.
7624    pub page_token: std::string::String,
7625
7626    /// An expression that filters the list of results.
7627    pub filter: std::string::String,
7628
7629    /// Sort the results by name or create_time.
7630    pub order_by: std::string::String,
7631
7632    /// The view of the spoke to return.
7633    /// The view that you use determines which spoke fields are included in the
7634    /// response.
7635    pub view: crate::model::list_hub_spokes_request::SpokeView,
7636
7637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7638}
7639
7640impl ListHubSpokesRequest {
7641    pub fn new() -> Self {
7642        std::default::Default::default()
7643    }
7644
7645    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
7646    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7647        self.name = v.into();
7648        self
7649    }
7650
7651    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
7652    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
7653    where
7654        T: std::iter::IntoIterator<Item = V>,
7655        V: std::convert::Into<std::string::String>,
7656    {
7657        use std::iter::Iterator;
7658        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
7659        self
7660    }
7661
7662    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
7663    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7664        self.page_size = v.into();
7665        self
7666    }
7667
7668    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
7669    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7670        self.page_token = v.into();
7671        self
7672    }
7673
7674    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
7675    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7676        self.filter = v.into();
7677        self
7678    }
7679
7680    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
7681    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7682        self.order_by = v.into();
7683        self
7684    }
7685
7686    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
7687    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
7688        mut self,
7689        v: T,
7690    ) -> Self {
7691        self.view = v.into();
7692        self
7693    }
7694}
7695
7696impl wkt::message::Message for ListHubSpokesRequest {
7697    fn typename() -> &'static str {
7698        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
7699    }
7700}
7701
7702/// Defines additional types related to [ListHubSpokesRequest].
7703pub mod list_hub_spokes_request {
7704    #[allow(unused_imports)]
7705    use super::*;
7706
7707    /// Enum that controls which spoke fields are included in the response.
7708    ///
7709    /// # Working with unknown values
7710    ///
7711    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7712    /// additional enum variants at any time. Adding new variants is not considered
7713    /// a breaking change. Applications should write their code in anticipation of:
7714    ///
7715    /// - New values appearing in future releases of the client library, **and**
7716    /// - New values received dynamically, without application changes.
7717    ///
7718    /// Please consult the [Working with enums] section in the user guide for some
7719    /// guidelines.
7720    ///
7721    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7722    #[derive(Clone, Debug, PartialEq)]
7723    #[non_exhaustive]
7724    pub enum SpokeView {
7725        /// The spoke view is unspecified. When the spoke view is unspecified, the
7726        /// API returns the same fields as the `BASIC` view.
7727        Unspecified,
7728        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
7729        /// and `spoke_type`. This is the default value.
7730        Basic,
7731        /// Includes all spoke fields except `labels`.
7732        /// You can use the `DETAILED` view only when you set the `spoke_locations`
7733        /// field to `[global]`.
7734        Detailed,
7735        /// If set, the enum was initialized with an unknown value.
7736        ///
7737        /// Applications can examine the value using [SpokeView::value] or
7738        /// [SpokeView::name].
7739        UnknownValue(spoke_view::UnknownValue),
7740    }
7741
7742    #[doc(hidden)]
7743    pub mod spoke_view {
7744        #[allow(unused_imports)]
7745        use super::*;
7746        #[derive(Clone, Debug, PartialEq)]
7747        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7748    }
7749
7750    impl SpokeView {
7751        /// Gets the enum value.
7752        ///
7753        /// Returns `None` if the enum contains an unknown value deserialized from
7754        /// the string representation of enums.
7755        pub fn value(&self) -> std::option::Option<i32> {
7756            match self {
7757                Self::Unspecified => std::option::Option::Some(0),
7758                Self::Basic => std::option::Option::Some(1),
7759                Self::Detailed => std::option::Option::Some(2),
7760                Self::UnknownValue(u) => u.0.value(),
7761            }
7762        }
7763
7764        /// Gets the enum value as a string.
7765        ///
7766        /// Returns `None` if the enum contains an unknown value deserialized from
7767        /// the integer representation of enums.
7768        pub fn name(&self) -> std::option::Option<&str> {
7769            match self {
7770                Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
7771                Self::Basic => std::option::Option::Some("BASIC"),
7772                Self::Detailed => std::option::Option::Some("DETAILED"),
7773                Self::UnknownValue(u) => u.0.name(),
7774            }
7775        }
7776    }
7777
7778    impl std::default::Default for SpokeView {
7779        fn default() -> Self {
7780            use std::convert::From;
7781            Self::from(0)
7782        }
7783    }
7784
7785    impl std::fmt::Display for SpokeView {
7786        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7787            wkt::internal::display_enum(f, self.name(), self.value())
7788        }
7789    }
7790
7791    impl std::convert::From<i32> for SpokeView {
7792        fn from(value: i32) -> Self {
7793            match value {
7794                0 => Self::Unspecified,
7795                1 => Self::Basic,
7796                2 => Self::Detailed,
7797                _ => Self::UnknownValue(spoke_view::UnknownValue(
7798                    wkt::internal::UnknownEnumValue::Integer(value),
7799                )),
7800            }
7801        }
7802    }
7803
7804    impl std::convert::From<&str> for SpokeView {
7805        fn from(value: &str) -> Self {
7806            use std::string::ToString;
7807            match value {
7808                "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
7809                "BASIC" => Self::Basic,
7810                "DETAILED" => Self::Detailed,
7811                _ => Self::UnknownValue(spoke_view::UnknownValue(
7812                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7813                )),
7814            }
7815        }
7816    }
7817
7818    impl serde::ser::Serialize for SpokeView {
7819        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7820        where
7821            S: serde::Serializer,
7822        {
7823            match self {
7824                Self::Unspecified => serializer.serialize_i32(0),
7825                Self::Basic => serializer.serialize_i32(1),
7826                Self::Detailed => serializer.serialize_i32(2),
7827                Self::UnknownValue(u) => u.0.serialize(serializer),
7828            }
7829        }
7830    }
7831
7832    impl<'de> serde::de::Deserialize<'de> for SpokeView {
7833        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7834        where
7835            D: serde::Deserializer<'de>,
7836        {
7837            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
7838                ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
7839            ))
7840        }
7841    }
7842}
7843
7844/// The response for
7845/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
7846///
7847/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
7848#[derive(Clone, Default, PartialEq)]
7849#[non_exhaustive]
7850pub struct ListHubSpokesResponse {
7851    /// The requested spokes.
7852    /// The spoke fields can be partially populated based on the `view` field in
7853    /// the request message.
7854    pub spokes: std::vec::Vec<crate::model::Spoke>,
7855
7856    /// The token for the next page of the response. To see more results,
7857    /// use this value as the page_token for your next request. If this value
7858    /// is empty, there are no more results.
7859    pub next_page_token: std::string::String,
7860
7861    /// Locations that could not be reached.
7862    pub unreachable: std::vec::Vec<std::string::String>,
7863
7864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7865}
7866
7867impl ListHubSpokesResponse {
7868    pub fn new() -> Self {
7869        std::default::Default::default()
7870    }
7871
7872    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
7873    pub fn set_spokes<T, V>(mut self, v: T) -> Self
7874    where
7875        T: std::iter::IntoIterator<Item = V>,
7876        V: std::convert::Into<crate::model::Spoke>,
7877    {
7878        use std::iter::Iterator;
7879        self.spokes = v.into_iter().map(|i| i.into()).collect();
7880        self
7881    }
7882
7883    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
7884    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7885        self.next_page_token = v.into();
7886        self
7887    }
7888
7889    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
7890    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7891    where
7892        T: std::iter::IntoIterator<Item = V>,
7893        V: std::convert::Into<std::string::String>,
7894    {
7895        use std::iter::Iterator;
7896        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7897        self
7898    }
7899}
7900
7901impl wkt::message::Message for ListHubSpokesResponse {
7902    fn typename() -> &'static str {
7903        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
7904    }
7905}
7906
7907#[doc(hidden)]
7908impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
7909    type PageItem = crate::model::Spoke;
7910
7911    fn items(self) -> std::vec::Vec<Self::PageItem> {
7912        self.spokes
7913    }
7914
7915    fn next_page_token(&self) -> std::string::String {
7916        use std::clone::Clone;
7917        self.next_page_token.clone()
7918    }
7919}
7920
7921/// The request for
7922/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
7923///
7924/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
7925#[derive(Clone, Default, PartialEq)]
7926#[non_exhaustive]
7927pub struct QueryHubStatusRequest {
7928    /// Required. The name of the hub.
7929    pub name: std::string::String,
7930
7931    /// Optional. The maximum number of results to return per page.
7932    pub page_size: i32,
7933
7934    /// Optional. The page token.
7935    pub page_token: std::string::String,
7936
7937    /// Optional. An expression that filters the list of results.
7938    /// The filter can be used to filter the results by the following fields:
7939    ///
7940    /// * `psc_propagation_status.source_spoke`
7941    /// * `psc_propagation_status.source_group`
7942    /// * `psc_propagation_status.source_forwarding_rule`
7943    /// * `psc_propagation_status.target_spoke`
7944    /// * `psc_propagation_status.target_group`
7945    /// * `psc_propagation_status.code`
7946    /// * `psc_propagation_status.message`
7947    pub filter: std::string::String,
7948
7949    /// Optional. Sort the results in ascending order by the specified fields.
7950    /// A comma-separated list of any of these fields:
7951    ///
7952    /// * `psc_propagation_status.source_spoke`
7953    /// * `psc_propagation_status.source_group`
7954    /// * `psc_propagation_status.source_forwarding_rule`
7955    /// * `psc_propagation_status.target_spoke`
7956    /// * `psc_propagation_status.target_group`
7957    /// * `psc_propagation_status.code`
7958    ///   If `group_by` is set, the value of the `order_by` field must be the
7959    ///   same as or a subset of the `group_by` field.
7960    pub order_by: std::string::String,
7961
7962    /// Optional. Aggregate the results by the specified fields.
7963    /// A comma-separated list of any of these fields:
7964    ///
7965    /// * `psc_propagation_status.source_spoke`
7966    /// * `psc_propagation_status.source_group`
7967    /// * `psc_propagation_status.source_forwarding_rule`
7968    /// * `psc_propagation_status.target_spoke`
7969    /// * `psc_propagation_status.target_group`
7970    /// * `psc_propagation_status.code`
7971    pub group_by: std::string::String,
7972
7973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7974}
7975
7976impl QueryHubStatusRequest {
7977    pub fn new() -> Self {
7978        std::default::Default::default()
7979    }
7980
7981    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
7982    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7983        self.name = v.into();
7984        self
7985    }
7986
7987    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
7988    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7989        self.page_size = v.into();
7990        self
7991    }
7992
7993    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
7994    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7995        self.page_token = v.into();
7996        self
7997    }
7998
7999    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
8000    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8001        self.filter = v.into();
8002        self
8003    }
8004
8005    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
8006    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8007        self.order_by = v.into();
8008        self
8009    }
8010
8011    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
8012    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8013        self.group_by = v.into();
8014        self
8015    }
8016}
8017
8018impl wkt::message::Message for QueryHubStatusRequest {
8019    fn typename() -> &'static str {
8020        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
8021    }
8022}
8023
8024/// The response for
8025/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
8026///
8027/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
8028#[derive(Clone, Default, PartialEq)]
8029#[non_exhaustive]
8030pub struct QueryHubStatusResponse {
8031    /// The list of hub status.
8032    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
8033
8034    /// The token for the next page of the response. To see more results,
8035    /// use this value as the page_token for your next request. If this value
8036    /// is empty, there are no more results.
8037    pub next_page_token: std::string::String,
8038
8039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8040}
8041
8042impl QueryHubStatusResponse {
8043    pub fn new() -> Self {
8044        std::default::Default::default()
8045    }
8046
8047    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
8048    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
8049    where
8050        T: std::iter::IntoIterator<Item = V>,
8051        V: std::convert::Into<crate::model::HubStatusEntry>,
8052    {
8053        use std::iter::Iterator;
8054        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
8055        self
8056    }
8057
8058    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
8059    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8060        self.next_page_token = v.into();
8061        self
8062    }
8063}
8064
8065impl wkt::message::Message for QueryHubStatusResponse {
8066    fn typename() -> &'static str {
8067        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
8068    }
8069}
8070
8071#[doc(hidden)]
8072impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
8073    type PageItem = crate::model::HubStatusEntry;
8074
8075    fn items(self) -> std::vec::Vec<Self::PageItem> {
8076        self.hub_status_entries
8077    }
8078
8079    fn next_page_token(&self) -> std::string::String {
8080        use std::clone::Clone;
8081        self.next_page_token.clone()
8082    }
8083}
8084
8085/// A hub status entry represents the status of a set of propagated Private
8086/// Service Connect connections grouped by certain fields.
8087#[derive(Clone, Default, PartialEq)]
8088#[non_exhaustive]
8089pub struct HubStatusEntry {
8090    /// The number of propagated Private Service Connect connections with this
8091    /// status. If the `group_by` field was not set in the request message, the
8092    /// value of this field is 1.
8093    pub count: i32,
8094
8095    /// The fields that this entry is grouped by. This has the same value as the
8096    /// `group_by` field in the request message.
8097    pub group_by: std::string::String,
8098
8099    /// The Private Service Connect propagation status.
8100    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
8101
8102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8103}
8104
8105impl HubStatusEntry {
8106    pub fn new() -> Self {
8107        std::default::Default::default()
8108    }
8109
8110    /// Sets the value of [count][crate::model::HubStatusEntry::count].
8111    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8112        self.count = v.into();
8113        self
8114    }
8115
8116    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
8117    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8118        self.group_by = v.into();
8119        self
8120    }
8121
8122    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
8123    pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
8124    where
8125        T: std::convert::Into<crate::model::PscPropagationStatus>,
8126    {
8127        self.psc_propagation_status = std::option::Option::Some(v.into());
8128        self
8129    }
8130
8131    /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
8132    pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
8133    where
8134        T: std::convert::Into<crate::model::PscPropagationStatus>,
8135    {
8136        self.psc_propagation_status = v.map(|x| x.into());
8137        self
8138    }
8139}
8140
8141impl wkt::message::Message for HubStatusEntry {
8142    fn typename() -> &'static str {
8143        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
8144    }
8145}
8146
8147/// The status of one or more propagated Private Service Connect connections in a
8148/// hub.
8149#[derive(Clone, Default, PartialEq)]
8150#[non_exhaustive]
8151pub struct PscPropagationStatus {
8152    /// The name of the spoke that the source forwarding rule belongs to.
8153    pub source_spoke: std::string::String,
8154
8155    /// The name of the group that the source spoke belongs to.
8156    pub source_group: std::string::String,
8157
8158    /// The name of the forwarding rule exported to the hub.
8159    pub source_forwarding_rule: std::string::String,
8160
8161    /// The name of the spoke that the source forwarding rule propagates to.
8162    pub target_spoke: std::string::String,
8163
8164    /// The name of the group that the target spoke belongs to.
8165    pub target_group: std::string::String,
8166
8167    /// The propagation status.
8168    pub code: crate::model::psc_propagation_status::Code,
8169
8170    /// The human-readable summary of the Private Service Connect connection
8171    /// propagation status.
8172    pub message: std::string::String,
8173
8174    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8175}
8176
8177impl PscPropagationStatus {
8178    pub fn new() -> Self {
8179        std::default::Default::default()
8180    }
8181
8182    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
8183    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8184        self.source_spoke = v.into();
8185        self
8186    }
8187
8188    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
8189    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8190        self.source_group = v.into();
8191        self
8192    }
8193
8194    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
8195    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
8196        mut self,
8197        v: T,
8198    ) -> Self {
8199        self.source_forwarding_rule = v.into();
8200        self
8201    }
8202
8203    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
8204    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8205        self.target_spoke = v.into();
8206        self
8207    }
8208
8209    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
8210    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8211        self.target_group = v.into();
8212        self
8213    }
8214
8215    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
8216    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
8217        mut self,
8218        v: T,
8219    ) -> Self {
8220        self.code = v.into();
8221        self
8222    }
8223
8224    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
8225    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8226        self.message = v.into();
8227        self
8228    }
8229}
8230
8231impl wkt::message::Message for PscPropagationStatus {
8232    fn typename() -> &'static str {
8233        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
8234    }
8235}
8236
8237/// Defines additional types related to [PscPropagationStatus].
8238pub mod psc_propagation_status {
8239    #[allow(unused_imports)]
8240    use super::*;
8241
8242    /// The Code enum represents the state of the Private Service Connect
8243    /// propagation.
8244    ///
8245    /// # Working with unknown values
8246    ///
8247    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8248    /// additional enum variants at any time. Adding new variants is not considered
8249    /// a breaking change. Applications should write their code in anticipation of:
8250    ///
8251    /// - New values appearing in future releases of the client library, **and**
8252    /// - New values received dynamically, without application changes.
8253    ///
8254    /// Please consult the [Working with enums] section in the user guide for some
8255    /// guidelines.
8256    ///
8257    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8258    #[derive(Clone, Debug, PartialEq)]
8259    #[non_exhaustive]
8260    pub enum Code {
8261        /// The code is unspecified.
8262        Unspecified,
8263        /// The propagated Private Service Connect connection is ready.
8264        Ready,
8265        /// The Private Service Connect connection is propagating. This is a
8266        /// transient state.
8267        Propagating,
8268        /// The Private Service Connect connection propagation failed because the VPC
8269        /// network or the project of the target spoke has exceeded the connection
8270        /// limit set by the producer.
8271        ErrorProducerPropagatedConnectionLimitExceeded,
8272        /// The Private Service Connect connection propagation failed because the NAT
8273        /// IP subnet space has been exhausted. It is equivalent to the `Needs
8274        /// attention` status of the Private Service Connect connection. See
8275        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
8276        ErrorProducerNatIpSpaceExhausted,
8277        /// The Private Service Connect connection propagation failed because the
8278        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
8279        /// producer VPC network has been exceeded.
8280        ErrorProducerQuotaExceeded,
8281        /// The Private Service Connect connection propagation failed because the
8282        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
8283        /// VPC network has been exceeded.
8284        ErrorConsumerQuotaExceeded,
8285        /// If set, the enum was initialized with an unknown value.
8286        ///
8287        /// Applications can examine the value using [Code::value] or
8288        /// [Code::name].
8289        UnknownValue(code::UnknownValue),
8290    }
8291
8292    #[doc(hidden)]
8293    pub mod code {
8294        #[allow(unused_imports)]
8295        use super::*;
8296        #[derive(Clone, Debug, PartialEq)]
8297        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8298    }
8299
8300    impl Code {
8301        /// Gets the enum value.
8302        ///
8303        /// Returns `None` if the enum contains an unknown value deserialized from
8304        /// the string representation of enums.
8305        pub fn value(&self) -> std::option::Option<i32> {
8306            match self {
8307                Self::Unspecified => std::option::Option::Some(0),
8308                Self::Ready => std::option::Option::Some(1),
8309                Self::Propagating => std::option::Option::Some(2),
8310                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
8311                    std::option::Option::Some(3)
8312                }
8313                Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
8314                Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
8315                Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
8316                Self::UnknownValue(u) => u.0.value(),
8317            }
8318        }
8319
8320        /// Gets the enum value as a string.
8321        ///
8322        /// Returns `None` if the enum contains an unknown value deserialized from
8323        /// the integer representation of enums.
8324        pub fn name(&self) -> std::option::Option<&str> {
8325            match self {
8326                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8327                Self::Ready => std::option::Option::Some("READY"),
8328                Self::Propagating => std::option::Option::Some("PROPAGATING"),
8329                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
8330                    std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
8331                }
8332                Self::ErrorProducerNatIpSpaceExhausted => {
8333                    std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
8334                }
8335                Self::ErrorProducerQuotaExceeded => {
8336                    std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
8337                }
8338                Self::ErrorConsumerQuotaExceeded => {
8339                    std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
8340                }
8341                Self::UnknownValue(u) => u.0.name(),
8342            }
8343        }
8344    }
8345
8346    impl std::default::Default for Code {
8347        fn default() -> Self {
8348            use std::convert::From;
8349            Self::from(0)
8350        }
8351    }
8352
8353    impl std::fmt::Display for Code {
8354        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8355            wkt::internal::display_enum(f, self.name(), self.value())
8356        }
8357    }
8358
8359    impl std::convert::From<i32> for Code {
8360        fn from(value: i32) -> Self {
8361            match value {
8362                0 => Self::Unspecified,
8363                1 => Self::Ready,
8364                2 => Self::Propagating,
8365                3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
8366                4 => Self::ErrorProducerNatIpSpaceExhausted,
8367                5 => Self::ErrorProducerQuotaExceeded,
8368                6 => Self::ErrorConsumerQuotaExceeded,
8369                _ => Self::UnknownValue(code::UnknownValue(
8370                    wkt::internal::UnknownEnumValue::Integer(value),
8371                )),
8372            }
8373        }
8374    }
8375
8376    impl std::convert::From<&str> for Code {
8377        fn from(value: &str) -> Self {
8378            use std::string::ToString;
8379            match value {
8380                "CODE_UNSPECIFIED" => Self::Unspecified,
8381                "READY" => Self::Ready,
8382                "PROPAGATING" => Self::Propagating,
8383                "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
8384                    Self::ErrorProducerPropagatedConnectionLimitExceeded
8385                }
8386                "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
8387                "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
8388                "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
8389                _ => Self::UnknownValue(code::UnknownValue(
8390                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8391                )),
8392            }
8393        }
8394    }
8395
8396    impl serde::ser::Serialize for Code {
8397        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8398        where
8399            S: serde::Serializer,
8400        {
8401            match self {
8402                Self::Unspecified => serializer.serialize_i32(0),
8403                Self::Ready => serializer.serialize_i32(1),
8404                Self::Propagating => serializer.serialize_i32(2),
8405                Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
8406                Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
8407                Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
8408                Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
8409                Self::UnknownValue(u) => u.0.serialize(serializer),
8410            }
8411        }
8412    }
8413
8414    impl<'de> serde::de::Deserialize<'de> for Code {
8415        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8416        where
8417            D: serde::Deserializer<'de>,
8418        {
8419            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
8420                ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
8421            ))
8422        }
8423    }
8424}
8425
8426/// The request for
8427/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
8428///
8429/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
8430#[derive(Clone, Default, PartialEq)]
8431#[non_exhaustive]
8432pub struct ListSpokesRequest {
8433    /// Required. The parent resource.
8434    pub parent: std::string::String,
8435
8436    /// The maximum number of results to return per page.
8437    pub page_size: i32,
8438
8439    /// The page token.
8440    pub page_token: std::string::String,
8441
8442    /// An expression that filters the list of results.
8443    pub filter: std::string::String,
8444
8445    /// Sort the results by a certain order.
8446    pub order_by: std::string::String,
8447
8448    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8449}
8450
8451impl ListSpokesRequest {
8452    pub fn new() -> Self {
8453        std::default::Default::default()
8454    }
8455
8456    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
8457    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8458        self.parent = v.into();
8459        self
8460    }
8461
8462    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
8463    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8464        self.page_size = v.into();
8465        self
8466    }
8467
8468    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
8469    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8470        self.page_token = v.into();
8471        self
8472    }
8473
8474    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
8475    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8476        self.filter = v.into();
8477        self
8478    }
8479
8480    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
8481    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8482        self.order_by = v.into();
8483        self
8484    }
8485}
8486
8487impl wkt::message::Message for ListSpokesRequest {
8488    fn typename() -> &'static str {
8489        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
8490    }
8491}
8492
8493/// The response for
8494/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
8495///
8496/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
8497#[derive(Clone, Default, PartialEq)]
8498#[non_exhaustive]
8499pub struct ListSpokesResponse {
8500    /// The requested spokes.
8501    pub spokes: std::vec::Vec<crate::model::Spoke>,
8502
8503    /// The token for the next page of the response. To see more results,
8504    /// use this value as the page_token for your next request. If this value
8505    /// is empty, there are no more results.
8506    pub next_page_token: std::string::String,
8507
8508    /// Locations that could not be reached.
8509    pub unreachable: std::vec::Vec<std::string::String>,
8510
8511    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8512}
8513
8514impl ListSpokesResponse {
8515    pub fn new() -> Self {
8516        std::default::Default::default()
8517    }
8518
8519    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
8520    pub fn set_spokes<T, V>(mut self, v: T) -> Self
8521    where
8522        T: std::iter::IntoIterator<Item = V>,
8523        V: std::convert::Into<crate::model::Spoke>,
8524    {
8525        use std::iter::Iterator;
8526        self.spokes = v.into_iter().map(|i| i.into()).collect();
8527        self
8528    }
8529
8530    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
8531    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8532        self.next_page_token = v.into();
8533        self
8534    }
8535
8536    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
8537    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8538    where
8539        T: std::iter::IntoIterator<Item = V>,
8540        V: std::convert::Into<std::string::String>,
8541    {
8542        use std::iter::Iterator;
8543        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8544        self
8545    }
8546}
8547
8548impl wkt::message::Message for ListSpokesResponse {
8549    fn typename() -> &'static str {
8550        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
8551    }
8552}
8553
8554#[doc(hidden)]
8555impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
8556    type PageItem = crate::model::Spoke;
8557
8558    fn items(self) -> std::vec::Vec<Self::PageItem> {
8559        self.spokes
8560    }
8561
8562    fn next_page_token(&self) -> std::string::String {
8563        use std::clone::Clone;
8564        self.next_page_token.clone()
8565    }
8566}
8567
8568/// The request for
8569/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
8570///
8571/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
8572#[derive(Clone, Default, PartialEq)]
8573#[non_exhaustive]
8574pub struct GetSpokeRequest {
8575    /// Required. The name of the spoke resource.
8576    pub name: std::string::String,
8577
8578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8579}
8580
8581impl GetSpokeRequest {
8582    pub fn new() -> Self {
8583        std::default::Default::default()
8584    }
8585
8586    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
8587    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8588        self.name = v.into();
8589        self
8590    }
8591}
8592
8593impl wkt::message::Message for GetSpokeRequest {
8594    fn typename() -> &'static str {
8595        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
8596    }
8597}
8598
8599/// The request for
8600/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
8601///
8602/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
8603#[derive(Clone, Default, PartialEq)]
8604#[non_exhaustive]
8605pub struct CreateSpokeRequest {
8606    /// Required. The parent resource.
8607    pub parent: std::string::String,
8608
8609    /// Required. Unique id for the spoke to create.
8610    pub spoke_id: std::string::String,
8611
8612    /// Required. The initial values for a new spoke.
8613    pub spoke: std::option::Option<crate::model::Spoke>,
8614
8615    /// Optional. A request ID to identify requests. Specify a unique request ID so
8616    /// that if you must retry your request, the server knows to ignore the request
8617    /// if it has already been completed. The server guarantees that a request
8618    /// doesn't result in creation of duplicate commitments for at least 60
8619    /// minutes.
8620    ///
8621    /// For example, consider a situation where you make an initial request and
8622    /// the request times out. If you make the request again with the same request
8623    /// ID, the server can check to see whether the original operation
8624    /// was received. If it was, the server ignores the second request. This
8625    /// behavior prevents clients from mistakenly creating duplicate commitments.
8626    ///
8627    /// The request ID must be a valid UUID, with the exception that zero UUID is
8628    /// not supported (00000000-0000-0000-0000-000000000000).
8629    pub request_id: std::string::String,
8630
8631    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8632}
8633
8634impl CreateSpokeRequest {
8635    pub fn new() -> Self {
8636        std::default::Default::default()
8637    }
8638
8639    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
8640    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8641        self.parent = v.into();
8642        self
8643    }
8644
8645    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
8646    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8647        self.spoke_id = v.into();
8648        self
8649    }
8650
8651    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
8652    pub fn set_spoke<T>(mut self, v: T) -> Self
8653    where
8654        T: std::convert::Into<crate::model::Spoke>,
8655    {
8656        self.spoke = std::option::Option::Some(v.into());
8657        self
8658    }
8659
8660    /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
8661    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8662    where
8663        T: std::convert::Into<crate::model::Spoke>,
8664    {
8665        self.spoke = v.map(|x| x.into());
8666        self
8667    }
8668
8669    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
8670    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8671        self.request_id = v.into();
8672        self
8673    }
8674}
8675
8676impl wkt::message::Message for CreateSpokeRequest {
8677    fn typename() -> &'static str {
8678        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
8679    }
8680}
8681
8682/// Request for
8683/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
8684/// method.
8685///
8686/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
8687#[derive(Clone, Default, PartialEq)]
8688#[non_exhaustive]
8689pub struct UpdateSpokeRequest {
8690    /// Optional. In the case of an update to an existing spoke, field mask is used
8691    /// to specify the fields to be overwritten. The fields specified in the
8692    /// update_mask are relative to the resource, not the full request. A field is
8693    /// overwritten if it is in the mask. If the user does not provide a mask, then
8694    /// all fields are overwritten.
8695    pub update_mask: std::option::Option<wkt::FieldMask>,
8696
8697    /// Required. The state that the spoke should be in after the update.
8698    pub spoke: std::option::Option<crate::model::Spoke>,
8699
8700    /// Optional. A request ID to identify requests. Specify a unique request ID so
8701    /// that if you must retry your request, the server knows to ignore the request
8702    /// if it has already been completed. The server guarantees that a request
8703    /// doesn't result in creation of duplicate commitments for at least 60
8704    /// minutes.
8705    ///
8706    /// For example, consider a situation where you make an initial request and
8707    /// the request times out. If you make the request again with the same request
8708    /// ID, the server can check to see whether the original operation
8709    /// was received. If it was, the server ignores the second request. This
8710    /// behavior prevents clients from mistakenly creating duplicate commitments.
8711    ///
8712    /// The request ID must be a valid UUID, with the exception that zero UUID is
8713    /// not supported (00000000-0000-0000-0000-000000000000).
8714    pub request_id: std::string::String,
8715
8716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8717}
8718
8719impl UpdateSpokeRequest {
8720    pub fn new() -> Self {
8721        std::default::Default::default()
8722    }
8723
8724    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
8725    pub fn set_update_mask<T>(mut self, v: T) -> Self
8726    where
8727        T: std::convert::Into<wkt::FieldMask>,
8728    {
8729        self.update_mask = std::option::Option::Some(v.into());
8730        self
8731    }
8732
8733    /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
8734    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8735    where
8736        T: std::convert::Into<wkt::FieldMask>,
8737    {
8738        self.update_mask = v.map(|x| x.into());
8739        self
8740    }
8741
8742    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
8743    pub fn set_spoke<T>(mut self, v: T) -> Self
8744    where
8745        T: std::convert::Into<crate::model::Spoke>,
8746    {
8747        self.spoke = std::option::Option::Some(v.into());
8748        self
8749    }
8750
8751    /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
8752    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8753    where
8754        T: std::convert::Into<crate::model::Spoke>,
8755    {
8756        self.spoke = v.map(|x| x.into());
8757        self
8758    }
8759
8760    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
8761    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8762        self.request_id = v.into();
8763        self
8764    }
8765}
8766
8767impl wkt::message::Message for UpdateSpokeRequest {
8768    fn typename() -> &'static str {
8769        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
8770    }
8771}
8772
8773/// The request for
8774/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
8775///
8776/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
8777#[derive(Clone, Default, PartialEq)]
8778#[non_exhaustive]
8779pub struct DeleteSpokeRequest {
8780    /// Required. The name of the spoke to delete.
8781    pub name: std::string::String,
8782
8783    /// Optional. A request ID to identify requests. Specify a unique request ID so
8784    /// that if you must retry your request, the server knows to ignore the request
8785    /// if it has already been completed. The server guarantees that a request
8786    /// doesn't result in creation of duplicate commitments for at least 60
8787    /// minutes.
8788    ///
8789    /// For example, consider a situation where you make an initial request and
8790    /// the request times out. If you make the request again with the same request
8791    /// ID, the server can check to see whether the original operation
8792    /// was received. If it was, the server ignores the second request. This
8793    /// behavior prevents clients from mistakenly creating duplicate commitments.
8794    ///
8795    /// The request ID must be a valid UUID, with the exception that zero UUID is
8796    /// not supported (00000000-0000-0000-0000-000000000000).
8797    pub request_id: std::string::String,
8798
8799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8800}
8801
8802impl DeleteSpokeRequest {
8803    pub fn new() -> Self {
8804        std::default::Default::default()
8805    }
8806
8807    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
8808    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8809        self.name = v.into();
8810        self
8811    }
8812
8813    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
8814    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8815        self.request_id = v.into();
8816        self
8817    }
8818}
8819
8820impl wkt::message::Message for DeleteSpokeRequest {
8821    fn typename() -> &'static str {
8822        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
8823    }
8824}
8825
8826/// The request for
8827/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
8828///
8829/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
8830#[derive(Clone, Default, PartialEq)]
8831#[non_exhaustive]
8832pub struct AcceptHubSpokeRequest {
8833    /// Required. The name of the hub into which to accept the spoke.
8834    pub name: std::string::String,
8835
8836    /// Required. The URI of the spoke to accept into the hub.
8837    pub spoke_uri: std::string::String,
8838
8839    /// Optional. A request ID to identify requests. Specify a unique request ID so
8840    /// that if you must retry your request, the server knows to ignore the request
8841    /// if it has already been completed. The server guarantees that a request
8842    /// doesn't result in creation of duplicate commitments for at least 60
8843    /// minutes.
8844    ///
8845    /// For example, consider a situation where you make an initial request and
8846    /// the request times out. If you make the request again with the same request
8847    /// ID, the server can check to see whether the original operation
8848    /// was received. If it was, the server ignores the second request. This
8849    /// behavior prevents clients from mistakenly creating duplicate commitments.
8850    ///
8851    /// The request ID must be a valid UUID, with the exception that zero UUID is
8852    /// not supported (00000000-0000-0000-0000-000000000000).
8853    pub request_id: std::string::String,
8854
8855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8856}
8857
8858impl AcceptHubSpokeRequest {
8859    pub fn new() -> Self {
8860        std::default::Default::default()
8861    }
8862
8863    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
8864    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8865        self.name = v.into();
8866        self
8867    }
8868
8869    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
8870    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8871        self.spoke_uri = v.into();
8872        self
8873    }
8874
8875    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
8876    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8877        self.request_id = v.into();
8878        self
8879    }
8880}
8881
8882impl wkt::message::Message for AcceptHubSpokeRequest {
8883    fn typename() -> &'static str {
8884        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
8885    }
8886}
8887
8888/// The response for
8889/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
8890///
8891/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
8892#[derive(Clone, Default, PartialEq)]
8893#[non_exhaustive]
8894pub struct AcceptHubSpokeResponse {
8895    /// The spoke that was operated on.
8896    pub spoke: std::option::Option<crate::model::Spoke>,
8897
8898    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8899}
8900
8901impl AcceptHubSpokeResponse {
8902    pub fn new() -> Self {
8903        std::default::Default::default()
8904    }
8905
8906    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
8907    pub fn set_spoke<T>(mut self, v: T) -> Self
8908    where
8909        T: std::convert::Into<crate::model::Spoke>,
8910    {
8911        self.spoke = std::option::Option::Some(v.into());
8912        self
8913    }
8914
8915    /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
8916    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8917    where
8918        T: std::convert::Into<crate::model::Spoke>,
8919    {
8920        self.spoke = v.map(|x| x.into());
8921        self
8922    }
8923}
8924
8925impl wkt::message::Message for AcceptHubSpokeResponse {
8926    fn typename() -> &'static str {
8927        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
8928    }
8929}
8930
8931/// The request for
8932/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
8933///
8934/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
8935#[derive(Clone, Default, PartialEq)]
8936#[non_exhaustive]
8937pub struct RejectHubSpokeRequest {
8938    /// Required. The name of the hub from which to reject the spoke.
8939    pub name: std::string::String,
8940
8941    /// Required. The URI of the spoke to reject from the hub.
8942    pub spoke_uri: std::string::String,
8943
8944    /// Optional. A request ID to identify requests. Specify a unique request ID so
8945    /// that if you must retry your request, the server knows to ignore the request
8946    /// if it has already been completed. The server guarantees that a request
8947    /// doesn't result in creation of duplicate commitments for at least 60
8948    /// minutes.
8949    ///
8950    /// For example, consider a situation where you make an initial request and
8951    /// the request times out. If you make the request again with the same request
8952    /// ID, the server can check to see whether the original operation
8953    /// was received. If it was, the server ignores the second request. This
8954    /// behavior prevents clients from mistakenly creating duplicate commitments.
8955    ///
8956    /// The request ID must be a valid UUID, with the exception that zero UUID is
8957    /// not supported (00000000-0000-0000-0000-000000000000).
8958    pub request_id: std::string::String,
8959
8960    /// Optional. Additional information provided by the hub administrator.
8961    pub details: std::string::String,
8962
8963    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8964}
8965
8966impl RejectHubSpokeRequest {
8967    pub fn new() -> Self {
8968        std::default::Default::default()
8969    }
8970
8971    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
8972    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973        self.name = v.into();
8974        self
8975    }
8976
8977    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
8978    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8979        self.spoke_uri = v.into();
8980        self
8981    }
8982
8983    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
8984    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8985        self.request_id = v.into();
8986        self
8987    }
8988
8989    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
8990    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8991        self.details = v.into();
8992        self
8993    }
8994}
8995
8996impl wkt::message::Message for RejectHubSpokeRequest {
8997    fn typename() -> &'static str {
8998        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
8999    }
9000}
9001
9002/// The response for
9003/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
9004///
9005/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
9006#[derive(Clone, Default, PartialEq)]
9007#[non_exhaustive]
9008pub struct RejectHubSpokeResponse {
9009    /// The spoke that was operated on.
9010    pub spoke: std::option::Option<crate::model::Spoke>,
9011
9012    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9013}
9014
9015impl RejectHubSpokeResponse {
9016    pub fn new() -> Self {
9017        std::default::Default::default()
9018    }
9019
9020    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
9021    pub fn set_spoke<T>(mut self, v: T) -> Self
9022    where
9023        T: std::convert::Into<crate::model::Spoke>,
9024    {
9025        self.spoke = std::option::Option::Some(v.into());
9026        self
9027    }
9028
9029    /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
9030    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9031    where
9032        T: std::convert::Into<crate::model::Spoke>,
9033    {
9034        self.spoke = v.map(|x| x.into());
9035        self
9036    }
9037}
9038
9039impl wkt::message::Message for RejectHubSpokeResponse {
9040    fn typename() -> &'static str {
9041        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
9042    }
9043}
9044
9045/// The request for
9046/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
9047///
9048/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
9049#[derive(Clone, Default, PartialEq)]
9050#[non_exhaustive]
9051pub struct AcceptSpokeUpdateRequest {
9052    /// Required. The name of the hub to accept spoke update.
9053    pub name: std::string::String,
9054
9055    /// Required. The URI of the spoke to accept update.
9056    pub spoke_uri: std::string::String,
9057
9058    /// Required. The etag of the spoke to accept update.
9059    pub spoke_etag: std::string::String,
9060
9061    /// Optional. A request ID to identify requests. Specify a unique request ID so
9062    /// that if you must retry your request, the server knows to ignore the request
9063    /// if it has already been completed. The server guarantees that a request
9064    /// doesn't result in creation of duplicate commitments for at least 60
9065    /// minutes.
9066    ///
9067    /// For example, consider a situation where you make an initial request and
9068    /// the request times out. If you make the request again with the same request
9069    /// ID, the server can check to see whether the original operation
9070    /// was received. If it was, the server ignores the second request. This
9071    /// behavior prevents clients from mistakenly creating duplicate commitments.
9072    ///
9073    /// The request ID must be a valid UUID, with the exception that zero UUID is
9074    /// not supported (00000000-0000-0000-0000-000000000000).
9075    pub request_id: std::string::String,
9076
9077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9078}
9079
9080impl AcceptSpokeUpdateRequest {
9081    pub fn new() -> Self {
9082        std::default::Default::default()
9083    }
9084
9085    /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
9086    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9087        self.name = v.into();
9088        self
9089    }
9090
9091    /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
9092    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9093        self.spoke_uri = v.into();
9094        self
9095    }
9096
9097    /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
9098    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9099        self.spoke_etag = v.into();
9100        self
9101    }
9102
9103    /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
9104    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9105        self.request_id = v.into();
9106        self
9107    }
9108}
9109
9110impl wkt::message::Message for AcceptSpokeUpdateRequest {
9111    fn typename() -> &'static str {
9112        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
9113    }
9114}
9115
9116/// The response for
9117/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
9118///
9119/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
9120#[derive(Clone, Default, PartialEq)]
9121#[non_exhaustive]
9122pub struct AcceptSpokeUpdateResponse {
9123    /// The spoke that was operated on.
9124    pub spoke: std::option::Option<crate::model::Spoke>,
9125
9126    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9127}
9128
9129impl AcceptSpokeUpdateResponse {
9130    pub fn new() -> Self {
9131        std::default::Default::default()
9132    }
9133
9134    /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
9135    pub fn set_spoke<T>(mut self, v: T) -> Self
9136    where
9137        T: std::convert::Into<crate::model::Spoke>,
9138    {
9139        self.spoke = std::option::Option::Some(v.into());
9140        self
9141    }
9142
9143    /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
9144    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9145    where
9146        T: std::convert::Into<crate::model::Spoke>,
9147    {
9148        self.spoke = v.map(|x| x.into());
9149        self
9150    }
9151}
9152
9153impl wkt::message::Message for AcceptSpokeUpdateResponse {
9154    fn typename() -> &'static str {
9155        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
9156    }
9157}
9158
9159/// The request for
9160/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
9161///
9162/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
9163#[derive(Clone, Default, PartialEq)]
9164#[non_exhaustive]
9165pub struct RejectSpokeUpdateRequest {
9166    /// Required. The name of the hub to reject spoke update.
9167    pub name: std::string::String,
9168
9169    /// Required. The URI of the spoke to reject update.
9170    pub spoke_uri: std::string::String,
9171
9172    /// Required. The etag of the spoke to reject update.
9173    pub spoke_etag: std::string::String,
9174
9175    /// Optional. Additional information provided by the hub administrator.
9176    pub details: std::string::String,
9177
9178    /// Optional. A request ID to identify requests. Specify a unique request ID so
9179    /// that if you must retry your request, the server knows to ignore the request
9180    /// if it has already been completed. The server guarantees that a request
9181    /// doesn't result in creation of duplicate commitments for at least 60
9182    /// minutes.
9183    ///
9184    /// For example, consider a situation where you make an initial request and
9185    /// the request times out. If you make the request again with the same request
9186    /// ID, the server can check to see whether the original operation
9187    /// was received. If it was, the server ignores the second request. This
9188    /// behavior prevents clients from mistakenly creating duplicate commitments.
9189    ///
9190    /// The request ID must be a valid UUID, with the exception that zero UUID is
9191    /// not supported (00000000-0000-0000-0000-000000000000).
9192    pub request_id: std::string::String,
9193
9194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9195}
9196
9197impl RejectSpokeUpdateRequest {
9198    pub fn new() -> Self {
9199        std::default::Default::default()
9200    }
9201
9202    /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
9203    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9204        self.name = v.into();
9205        self
9206    }
9207
9208    /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
9209    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9210        self.spoke_uri = v.into();
9211        self
9212    }
9213
9214    /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
9215    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9216        self.spoke_etag = v.into();
9217        self
9218    }
9219
9220    /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
9221    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9222        self.details = v.into();
9223        self
9224    }
9225
9226    /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
9227    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9228        self.request_id = v.into();
9229        self
9230    }
9231}
9232
9233impl wkt::message::Message for RejectSpokeUpdateRequest {
9234    fn typename() -> &'static str {
9235        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
9236    }
9237}
9238
9239/// The response for
9240/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
9241///
9242/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
9243#[derive(Clone, Default, PartialEq)]
9244#[non_exhaustive]
9245pub struct RejectSpokeUpdateResponse {
9246    /// The spoke that was operated on.
9247    pub spoke: std::option::Option<crate::model::Spoke>,
9248
9249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9250}
9251
9252impl RejectSpokeUpdateResponse {
9253    pub fn new() -> Self {
9254        std::default::Default::default()
9255    }
9256
9257    /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
9258    pub fn set_spoke<T>(mut self, v: T) -> Self
9259    where
9260        T: std::convert::Into<crate::model::Spoke>,
9261    {
9262        self.spoke = std::option::Option::Some(v.into());
9263        self
9264    }
9265
9266    /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
9267    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9268    where
9269        T: std::convert::Into<crate::model::Spoke>,
9270    {
9271        self.spoke = v.map(|x| x.into());
9272        self
9273    }
9274}
9275
9276impl wkt::message::Message for RejectSpokeUpdateResponse {
9277    fn typename() -> &'static str {
9278        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
9279    }
9280}
9281
9282/// The request for
9283/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
9284///
9285/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
9286#[derive(Clone, Default, PartialEq)]
9287#[non_exhaustive]
9288pub struct GetRouteTableRequest {
9289    /// Required. The name of the route table resource.
9290    pub name: std::string::String,
9291
9292    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9293}
9294
9295impl GetRouteTableRequest {
9296    pub fn new() -> Self {
9297        std::default::Default::default()
9298    }
9299
9300    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
9301    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9302        self.name = v.into();
9303        self
9304    }
9305}
9306
9307impl wkt::message::Message for GetRouteTableRequest {
9308    fn typename() -> &'static str {
9309        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
9310    }
9311}
9312
9313/// The request for
9314/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
9315///
9316/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
9317#[derive(Clone, Default, PartialEq)]
9318#[non_exhaustive]
9319pub struct GetRouteRequest {
9320    /// Required. The name of the route resource.
9321    pub name: std::string::String,
9322
9323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9324}
9325
9326impl GetRouteRequest {
9327    pub fn new() -> Self {
9328        std::default::Default::default()
9329    }
9330
9331    /// Sets the value of [name][crate::model::GetRouteRequest::name].
9332    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9333        self.name = v.into();
9334        self
9335    }
9336}
9337
9338impl wkt::message::Message for GetRouteRequest {
9339    fn typename() -> &'static str {
9340        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
9341    }
9342}
9343
9344/// Request for
9345/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
9346/// method.
9347///
9348/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
9349#[derive(Clone, Default, PartialEq)]
9350#[non_exhaustive]
9351pub struct ListRoutesRequest {
9352    /// Required. The parent resource's name.
9353    pub parent: std::string::String,
9354
9355    /// The maximum number of results to return per page.
9356    pub page_size: i32,
9357
9358    /// The page token.
9359    pub page_token: std::string::String,
9360
9361    /// An expression that filters the list of results.
9362    pub filter: std::string::String,
9363
9364    /// Sort the results by a certain order.
9365    pub order_by: std::string::String,
9366
9367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9368}
9369
9370impl ListRoutesRequest {
9371    pub fn new() -> Self {
9372        std::default::Default::default()
9373    }
9374
9375    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
9376    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9377        self.parent = v.into();
9378        self
9379    }
9380
9381    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
9382    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9383        self.page_size = v.into();
9384        self
9385    }
9386
9387    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
9388    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9389        self.page_token = v.into();
9390        self
9391    }
9392
9393    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
9394    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9395        self.filter = v.into();
9396        self
9397    }
9398
9399    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
9400    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9401        self.order_by = v.into();
9402        self
9403    }
9404}
9405
9406impl wkt::message::Message for ListRoutesRequest {
9407    fn typename() -> &'static str {
9408        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
9409    }
9410}
9411
9412/// Response for
9413/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
9414/// method.
9415///
9416/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
9417#[derive(Clone, Default, PartialEq)]
9418#[non_exhaustive]
9419pub struct ListRoutesResponse {
9420    /// The requested routes.
9421    pub routes: std::vec::Vec<crate::model::Route>,
9422
9423    /// The token for the next page of the response. To see more results,
9424    /// use this value as the page_token for your next request. If this value
9425    /// is empty, there are no more results.
9426    pub next_page_token: std::string::String,
9427
9428    /// RouteTables that could not be reached.
9429    pub unreachable: std::vec::Vec<std::string::String>,
9430
9431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9432}
9433
9434impl ListRoutesResponse {
9435    pub fn new() -> Self {
9436        std::default::Default::default()
9437    }
9438
9439    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
9440    pub fn set_routes<T, V>(mut self, v: T) -> Self
9441    where
9442        T: std::iter::IntoIterator<Item = V>,
9443        V: std::convert::Into<crate::model::Route>,
9444    {
9445        use std::iter::Iterator;
9446        self.routes = v.into_iter().map(|i| i.into()).collect();
9447        self
9448    }
9449
9450    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
9451    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9452        self.next_page_token = v.into();
9453        self
9454    }
9455
9456    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
9457    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9458    where
9459        T: std::iter::IntoIterator<Item = V>,
9460        V: std::convert::Into<std::string::String>,
9461    {
9462        use std::iter::Iterator;
9463        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9464        self
9465    }
9466}
9467
9468impl wkt::message::Message for ListRoutesResponse {
9469    fn typename() -> &'static str {
9470        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
9471    }
9472}
9473
9474#[doc(hidden)]
9475impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
9476    type PageItem = crate::model::Route;
9477
9478    fn items(self) -> std::vec::Vec<Self::PageItem> {
9479        self.routes
9480    }
9481
9482    fn next_page_token(&self) -> std::string::String {
9483        use std::clone::Clone;
9484        self.next_page_token.clone()
9485    }
9486}
9487
9488/// Request for
9489/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
9490/// method.
9491///
9492/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
9493#[derive(Clone, Default, PartialEq)]
9494#[non_exhaustive]
9495pub struct ListRouteTablesRequest {
9496    /// Required. The parent resource's name.
9497    pub parent: std::string::String,
9498
9499    /// The maximum number of results to return per page.
9500    pub page_size: i32,
9501
9502    /// The page token.
9503    pub page_token: std::string::String,
9504
9505    /// An expression that filters the list of results.
9506    pub filter: std::string::String,
9507
9508    /// Sort the results by a certain order.
9509    pub order_by: std::string::String,
9510
9511    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9512}
9513
9514impl ListRouteTablesRequest {
9515    pub fn new() -> Self {
9516        std::default::Default::default()
9517    }
9518
9519    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
9520    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9521        self.parent = v.into();
9522        self
9523    }
9524
9525    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
9526    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9527        self.page_size = v.into();
9528        self
9529    }
9530
9531    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
9532    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9533        self.page_token = v.into();
9534        self
9535    }
9536
9537    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
9538    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9539        self.filter = v.into();
9540        self
9541    }
9542
9543    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
9544    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9545        self.order_by = v.into();
9546        self
9547    }
9548}
9549
9550impl wkt::message::Message for ListRouteTablesRequest {
9551    fn typename() -> &'static str {
9552        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
9553    }
9554}
9555
9556/// Response for
9557/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
9558/// method.
9559///
9560/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
9561#[derive(Clone, Default, PartialEq)]
9562#[non_exhaustive]
9563pub struct ListRouteTablesResponse {
9564    /// The requested route tables.
9565    pub route_tables: std::vec::Vec<crate::model::RouteTable>,
9566
9567    /// The token for the next page of the response. To see more results,
9568    /// use this value as the page_token for your next request. If this value
9569    /// is empty, there are no more results.
9570    pub next_page_token: std::string::String,
9571
9572    /// Hubs that could not be reached.
9573    pub unreachable: std::vec::Vec<std::string::String>,
9574
9575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9576}
9577
9578impl ListRouteTablesResponse {
9579    pub fn new() -> Self {
9580        std::default::Default::default()
9581    }
9582
9583    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
9584    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
9585    where
9586        T: std::iter::IntoIterator<Item = V>,
9587        V: std::convert::Into<crate::model::RouteTable>,
9588    {
9589        use std::iter::Iterator;
9590        self.route_tables = v.into_iter().map(|i| i.into()).collect();
9591        self
9592    }
9593
9594    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
9595    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9596        self.next_page_token = v.into();
9597        self
9598    }
9599
9600    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
9601    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9602    where
9603        T: std::iter::IntoIterator<Item = V>,
9604        V: std::convert::Into<std::string::String>,
9605    {
9606        use std::iter::Iterator;
9607        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9608        self
9609    }
9610}
9611
9612impl wkt::message::Message for ListRouteTablesResponse {
9613    fn typename() -> &'static str {
9614        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
9615    }
9616}
9617
9618#[doc(hidden)]
9619impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
9620    type PageItem = crate::model::RouteTable;
9621
9622    fn items(self) -> std::vec::Vec<Self::PageItem> {
9623        self.route_tables
9624    }
9625
9626    fn next_page_token(&self) -> std::string::String {
9627        use std::clone::Clone;
9628        self.next_page_token.clone()
9629    }
9630}
9631
9632/// Request for
9633/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
9634/// method.
9635///
9636/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
9637#[derive(Clone, Default, PartialEq)]
9638#[non_exhaustive]
9639pub struct ListGroupsRequest {
9640    /// Required. The parent resource's name.
9641    pub parent: std::string::String,
9642
9643    /// The maximum number of results to return per page.
9644    pub page_size: i32,
9645
9646    /// The page token.
9647    pub page_token: std::string::String,
9648
9649    /// An expression that filters the list of results.
9650    pub filter: std::string::String,
9651
9652    /// Sort the results by a certain order.
9653    pub order_by: std::string::String,
9654
9655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9656}
9657
9658impl ListGroupsRequest {
9659    pub fn new() -> Self {
9660        std::default::Default::default()
9661    }
9662
9663    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
9664    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9665        self.parent = v.into();
9666        self
9667    }
9668
9669    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
9670    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9671        self.page_size = v.into();
9672        self
9673    }
9674
9675    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
9676    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9677        self.page_token = v.into();
9678        self
9679    }
9680
9681    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
9682    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9683        self.filter = v.into();
9684        self
9685    }
9686
9687    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
9688    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9689        self.order_by = v.into();
9690        self
9691    }
9692}
9693
9694impl wkt::message::Message for ListGroupsRequest {
9695    fn typename() -> &'static str {
9696        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
9697    }
9698}
9699
9700/// Response for
9701/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
9702/// method.
9703///
9704/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
9705#[derive(Clone, Default, PartialEq)]
9706#[non_exhaustive]
9707pub struct ListGroupsResponse {
9708    /// The requested groups.
9709    pub groups: std::vec::Vec<crate::model::Group>,
9710
9711    /// The token for the next page of the response. To see more results,
9712    /// use this value as the page_token for your next request. If this value
9713    /// is empty, there are no more results.
9714    pub next_page_token: std::string::String,
9715
9716    /// Hubs that could not be reached.
9717    pub unreachable: std::vec::Vec<std::string::String>,
9718
9719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9720}
9721
9722impl ListGroupsResponse {
9723    pub fn new() -> Self {
9724        std::default::Default::default()
9725    }
9726
9727    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
9728    pub fn set_groups<T, V>(mut self, v: T) -> Self
9729    where
9730        T: std::iter::IntoIterator<Item = V>,
9731        V: std::convert::Into<crate::model::Group>,
9732    {
9733        use std::iter::Iterator;
9734        self.groups = v.into_iter().map(|i| i.into()).collect();
9735        self
9736    }
9737
9738    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
9739    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9740        self.next_page_token = v.into();
9741        self
9742    }
9743
9744    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
9745    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9746    where
9747        T: std::iter::IntoIterator<Item = V>,
9748        V: std::convert::Into<std::string::String>,
9749    {
9750        use std::iter::Iterator;
9751        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9752        self
9753    }
9754}
9755
9756impl wkt::message::Message for ListGroupsResponse {
9757    fn typename() -> &'static str {
9758        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
9759    }
9760}
9761
9762#[doc(hidden)]
9763impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
9764    type PageItem = crate::model::Group;
9765
9766    fn items(self) -> std::vec::Vec<Self::PageItem> {
9767        self.groups
9768    }
9769
9770    fn next_page_token(&self) -> std::string::String {
9771        use std::clone::Clone;
9772        self.next_page_token.clone()
9773    }
9774}
9775
9776/// A collection of Cloud VPN tunnel resources. These resources should be
9777/// redundant HA VPN tunnels that all advertise the same prefixes to Google
9778/// Cloud. Alternatively, in a passive/active configuration, all tunnels
9779/// should be capable of advertising the same prefixes.
9780#[derive(Clone, Default, PartialEq)]
9781#[non_exhaustive]
9782pub struct LinkedVpnTunnels {
9783    /// The URIs of linked VPN tunnel resources.
9784    pub uris: std::vec::Vec<std::string::String>,
9785
9786    /// A value that controls whether site-to-site data transfer is enabled for
9787    /// these resources. Data transfer is available only in [supported
9788    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
9789    pub site_to_site_data_transfer: bool,
9790
9791    /// Output only. The VPC network where these VPN tunnels are located.
9792    pub vpc_network: std::string::String,
9793
9794    /// Optional. IP ranges allowed to be included during import from hub (does not
9795    /// control transit connectivity). The only allowed value for now is
9796    /// "ALL_IPV4_RANGES".
9797    pub include_import_ranges: std::vec::Vec<std::string::String>,
9798
9799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9800}
9801
9802impl LinkedVpnTunnels {
9803    pub fn new() -> Self {
9804        std::default::Default::default()
9805    }
9806
9807    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
9808    pub fn set_uris<T, V>(mut self, v: T) -> Self
9809    where
9810        T: std::iter::IntoIterator<Item = V>,
9811        V: std::convert::Into<std::string::String>,
9812    {
9813        use std::iter::Iterator;
9814        self.uris = v.into_iter().map(|i| i.into()).collect();
9815        self
9816    }
9817
9818    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
9819    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9820        self.site_to_site_data_transfer = v.into();
9821        self
9822    }
9823
9824    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
9825    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9826        self.vpc_network = v.into();
9827        self
9828    }
9829
9830    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
9831    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9832    where
9833        T: std::iter::IntoIterator<Item = V>,
9834        V: std::convert::Into<std::string::String>,
9835    {
9836        use std::iter::Iterator;
9837        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9838        self
9839    }
9840}
9841
9842impl wkt::message::Message for LinkedVpnTunnels {
9843    fn typename() -> &'static str {
9844        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
9845    }
9846}
9847
9848/// A collection of VLAN attachment resources. These resources should
9849/// be redundant attachments that all advertise the same prefixes to Google
9850/// Cloud. Alternatively, in active/passive configurations, all attachments
9851/// should be capable of advertising the same prefixes.
9852#[derive(Clone, Default, PartialEq)]
9853#[non_exhaustive]
9854pub struct LinkedInterconnectAttachments {
9855    /// The URIs of linked interconnect attachment resources
9856    pub uris: std::vec::Vec<std::string::String>,
9857
9858    /// A value that controls whether site-to-site data transfer is enabled for
9859    /// these resources. Data transfer is available only in [supported
9860    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
9861    pub site_to_site_data_transfer: bool,
9862
9863    /// Output only. The VPC network where these VLAN attachments are located.
9864    pub vpc_network: std::string::String,
9865
9866    /// Optional. IP ranges allowed to be included during import from hub (does not
9867    /// control transit connectivity). The only allowed value for now is
9868    /// "ALL_IPV4_RANGES".
9869    pub include_import_ranges: std::vec::Vec<std::string::String>,
9870
9871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9872}
9873
9874impl LinkedInterconnectAttachments {
9875    pub fn new() -> Self {
9876        std::default::Default::default()
9877    }
9878
9879    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
9880    pub fn set_uris<T, V>(mut self, v: T) -> Self
9881    where
9882        T: std::iter::IntoIterator<Item = V>,
9883        V: std::convert::Into<std::string::String>,
9884    {
9885        use std::iter::Iterator;
9886        self.uris = v.into_iter().map(|i| i.into()).collect();
9887        self
9888    }
9889
9890    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
9891    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9892        self.site_to_site_data_transfer = v.into();
9893        self
9894    }
9895
9896    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
9897    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9898        self.vpc_network = v.into();
9899        self
9900    }
9901
9902    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
9903    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9904    where
9905        T: std::iter::IntoIterator<Item = V>,
9906        V: std::convert::Into<std::string::String>,
9907    {
9908        use std::iter::Iterator;
9909        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9910        self
9911    }
9912}
9913
9914impl wkt::message::Message for LinkedInterconnectAttachments {
9915    fn typename() -> &'static str {
9916        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
9917    }
9918}
9919
9920/// A collection of router appliance instances. If you configure multiple router
9921/// appliance instances to receive data from the same set of sites outside of
9922/// Google Cloud, we recommend that you associate those instances with the same
9923/// spoke.
9924#[derive(Clone, Default, PartialEq)]
9925#[non_exhaustive]
9926pub struct LinkedRouterApplianceInstances {
9927    /// The list of router appliance instances.
9928    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
9929
9930    /// A value that controls whether site-to-site data transfer is enabled for
9931    /// these resources. Data transfer is available only in [supported
9932    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
9933    pub site_to_site_data_transfer: bool,
9934
9935    /// Output only. The VPC network where these router appliance instances are
9936    /// located.
9937    pub vpc_network: std::string::String,
9938
9939    /// Optional. IP ranges allowed to be included during import from hub (does not
9940    /// control transit connectivity). The only allowed value for now is
9941    /// "ALL_IPV4_RANGES".
9942    pub include_import_ranges: std::vec::Vec<std::string::String>,
9943
9944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9945}
9946
9947impl LinkedRouterApplianceInstances {
9948    pub fn new() -> Self {
9949        std::default::Default::default()
9950    }
9951
9952    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
9953    pub fn set_instances<T, V>(mut self, v: T) -> Self
9954    where
9955        T: std::iter::IntoIterator<Item = V>,
9956        V: std::convert::Into<crate::model::RouterApplianceInstance>,
9957    {
9958        use std::iter::Iterator;
9959        self.instances = v.into_iter().map(|i| i.into()).collect();
9960        self
9961    }
9962
9963    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
9964    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9965        self.site_to_site_data_transfer = v.into();
9966        self
9967    }
9968
9969    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
9970    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9971        self.vpc_network = v.into();
9972        self
9973    }
9974
9975    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
9976    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9977    where
9978        T: std::iter::IntoIterator<Item = V>,
9979        V: std::convert::Into<std::string::String>,
9980    {
9981        use std::iter::Iterator;
9982        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9983        self
9984    }
9985}
9986
9987impl wkt::message::Message for LinkedRouterApplianceInstances {
9988    fn typename() -> &'static str {
9989        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
9990    }
9991}
9992
9993/// An existing VPC network.
9994#[derive(Clone, Default, PartialEq)]
9995#[non_exhaustive]
9996pub struct LinkedVpcNetwork {
9997    /// Required. The URI of the VPC network resource.
9998    pub uri: std::string::String,
9999
10000    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
10001    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
10002
10003    /// Optional. IP ranges allowed to be included from peering.
10004    pub include_export_ranges: std::vec::Vec<std::string::String>,
10005
10006    /// Optional. The proposed include export IP ranges waiting for hub
10007    /// administration's approval.
10008    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
10009
10010    /// Output only. The proposed exclude export IP ranges waiting for hub
10011    /// administration's approval.
10012    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
10013
10014    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
10015    /// service consumer VPC spoke for. These producer VPCs are connected through
10016    /// VPC peering to this spoke's backing VPC network. Because they are directly
10017    /// connected throuh VPC peering, NCC export filters do not apply between the
10018    /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
10019    /// spoke cannot be deleted as long as any of these producer VPC spokes are
10020    /// connected to the NCC Hub.
10021    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
10022
10023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10024}
10025
10026impl LinkedVpcNetwork {
10027    pub fn new() -> Self {
10028        std::default::Default::default()
10029    }
10030
10031    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
10032    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033        self.uri = v.into();
10034        self
10035    }
10036
10037    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
10038    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10039    where
10040        T: std::iter::IntoIterator<Item = V>,
10041        V: std::convert::Into<std::string::String>,
10042    {
10043        use std::iter::Iterator;
10044        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10045        self
10046    }
10047
10048    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
10049    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
10050    where
10051        T: std::iter::IntoIterator<Item = V>,
10052        V: std::convert::Into<std::string::String>,
10053    {
10054        use std::iter::Iterator;
10055        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10056        self
10057    }
10058
10059    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
10060    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
10061    where
10062        T: std::iter::IntoIterator<Item = V>,
10063        V: std::convert::Into<std::string::String>,
10064    {
10065        use std::iter::Iterator;
10066        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10067        self
10068    }
10069
10070    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
10071    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10072    where
10073        T: std::iter::IntoIterator<Item = V>,
10074        V: std::convert::Into<std::string::String>,
10075    {
10076        use std::iter::Iterator;
10077        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10078        self
10079    }
10080
10081    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
10082    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
10083    where
10084        T: std::iter::IntoIterator<Item = V>,
10085        V: std::convert::Into<std::string::String>,
10086    {
10087        use std::iter::Iterator;
10088        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
10089        self
10090    }
10091}
10092
10093impl wkt::message::Message for LinkedVpcNetwork {
10094    fn typename() -> &'static str {
10095        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
10096    }
10097}
10098
10099#[derive(Clone, Default, PartialEq)]
10100#[non_exhaustive]
10101pub struct LinkedProducerVpcNetwork {
10102    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
10103    /// peered with.
10104    pub network: std::string::String,
10105
10106    /// Output only. The Service Consumer Network spoke.
10107    pub service_consumer_vpc_spoke: std::string::String,
10108
10109    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
10110    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
10111    /// hub. This peering must be in ACTIVE state.
10112    pub peering: std::string::String,
10113
10114    /// Output only. The URI of the Producer VPC.
10115    pub producer_network: std::string::String,
10116
10117    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
10118    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
10119
10120    /// Optional. IP ranges allowed to be included from peering.
10121    pub include_export_ranges: std::vec::Vec<std::string::String>,
10122
10123    /// Optional. The proposed include export IP ranges waiting for hub
10124    /// administration's approval.
10125    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
10126
10127    /// Output only. The proposed exclude export IP ranges waiting for hub
10128    /// administration's approval.
10129    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
10130
10131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10132}
10133
10134impl LinkedProducerVpcNetwork {
10135    pub fn new() -> Self {
10136        std::default::Default::default()
10137    }
10138
10139    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
10140    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10141        self.network = v.into();
10142        self
10143    }
10144
10145    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
10146    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
10147        mut self,
10148        v: T,
10149    ) -> Self {
10150        self.service_consumer_vpc_spoke = v.into();
10151        self
10152    }
10153
10154    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
10155    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10156        self.peering = v.into();
10157        self
10158    }
10159
10160    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
10161    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
10162        mut self,
10163        v: T,
10164    ) -> Self {
10165        self.producer_network = v.into();
10166        self
10167    }
10168
10169    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
10170    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10171    where
10172        T: std::iter::IntoIterator<Item = V>,
10173        V: std::convert::Into<std::string::String>,
10174    {
10175        use std::iter::Iterator;
10176        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10177        self
10178    }
10179
10180    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
10181    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
10182    where
10183        T: std::iter::IntoIterator<Item = V>,
10184        V: std::convert::Into<std::string::String>,
10185    {
10186        use std::iter::Iterator;
10187        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10188        self
10189    }
10190
10191    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
10192    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
10193    where
10194        T: std::iter::IntoIterator<Item = V>,
10195        V: std::convert::Into<std::string::String>,
10196    {
10197        use std::iter::Iterator;
10198        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10199        self
10200    }
10201
10202    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
10203    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10204    where
10205        T: std::iter::IntoIterator<Item = V>,
10206        V: std::convert::Into<std::string::String>,
10207    {
10208        use std::iter::Iterator;
10209        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10210        self
10211    }
10212}
10213
10214impl wkt::message::Message for LinkedProducerVpcNetwork {
10215    fn typename() -> &'static str {
10216        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
10217    }
10218}
10219
10220/// A router appliance instance is a Compute Engine virtual machine (VM) instance
10221/// that acts as a BGP speaker. A router appliance instance is specified by the
10222/// URI of the VM and the internal IP address of one of the VM's network
10223/// interfaces.
10224#[derive(Clone, Default, PartialEq)]
10225#[non_exhaustive]
10226pub struct RouterApplianceInstance {
10227    /// The URI of the VM.
10228    pub virtual_machine: std::string::String,
10229
10230    /// The IP address on the VM to use for peering.
10231    pub ip_address: std::string::String,
10232
10233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10234}
10235
10236impl RouterApplianceInstance {
10237    pub fn new() -> Self {
10238        std::default::Default::default()
10239    }
10240
10241    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
10242    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10243        self.virtual_machine = v.into();
10244        self
10245    }
10246
10247    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
10248    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10249        self.ip_address = v.into();
10250        self
10251    }
10252}
10253
10254impl wkt::message::Message for RouterApplianceInstance {
10255    fn typename() -> &'static str {
10256        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
10257    }
10258}
10259
10260/// Metadata about locations
10261#[derive(Clone, Default, PartialEq)]
10262#[non_exhaustive]
10263pub struct LocationMetadata {
10264    /// List of supported features
10265    pub location_features: std::vec::Vec<crate::model::LocationFeature>,
10266
10267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10268}
10269
10270impl LocationMetadata {
10271    pub fn new() -> Self {
10272        std::default::Default::default()
10273    }
10274
10275    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
10276    pub fn set_location_features<T, V>(mut self, v: T) -> Self
10277    where
10278        T: std::iter::IntoIterator<Item = V>,
10279        V: std::convert::Into<crate::model::LocationFeature>,
10280    {
10281        use std::iter::Iterator;
10282        self.location_features = v.into_iter().map(|i| i.into()).collect();
10283        self
10284    }
10285}
10286
10287impl wkt::message::Message for LocationMetadata {
10288    fn typename() -> &'static str {
10289        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
10290    }
10291}
10292
10293#[derive(Clone, Default, PartialEq)]
10294#[non_exhaustive]
10295pub struct NextHopVpcNetwork {
10296    /// The URI of the VPC network resource
10297    pub uri: std::string::String,
10298
10299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10300}
10301
10302impl NextHopVpcNetwork {
10303    pub fn new() -> Self {
10304        std::default::Default::default()
10305    }
10306
10307    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
10308    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10309        self.uri = v.into();
10310        self
10311    }
10312}
10313
10314impl wkt::message::Message for NextHopVpcNetwork {
10315    fn typename() -> &'static str {
10316        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
10317    }
10318}
10319
10320/// A route next hop that leads to a VPN tunnel resource.
10321#[derive(Clone, Default, PartialEq)]
10322#[non_exhaustive]
10323pub struct NextHopVPNTunnel {
10324    /// The URI of the VPN tunnel resource.
10325    pub uri: std::string::String,
10326
10327    /// The VPC network where this VPN tunnel is located.
10328    pub vpc_network: std::string::String,
10329
10330    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
10331    /// resource. Data transfer is available only in [supported
10332    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
10333    pub site_to_site_data_transfer: bool,
10334
10335    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10336}
10337
10338impl NextHopVPNTunnel {
10339    pub fn new() -> Self {
10340        std::default::Default::default()
10341    }
10342
10343    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
10344    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10345        self.uri = v.into();
10346        self
10347    }
10348
10349    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
10350    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10351        self.vpc_network = v.into();
10352        self
10353    }
10354
10355    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
10356    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10357        self.site_to_site_data_transfer = v.into();
10358        self
10359    }
10360}
10361
10362impl wkt::message::Message for NextHopVPNTunnel {
10363    fn typename() -> &'static str {
10364        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
10365    }
10366}
10367
10368/// A route next hop that leads to a Router appliance instance.
10369#[derive(Clone, Default, PartialEq)]
10370#[non_exhaustive]
10371pub struct NextHopRouterApplianceInstance {
10372    /// The URI of the Router appliance instance.
10373    pub uri: std::string::String,
10374
10375    /// The VPC network where this VM is located.
10376    pub vpc_network: std::string::String,
10377
10378    /// Indicates whether site-to-site data transfer is allowed for this Router
10379    /// appliance instance resource. Data transfer is available only in [supported
10380    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
10381    pub site_to_site_data_transfer: bool,
10382
10383    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10384}
10385
10386impl NextHopRouterApplianceInstance {
10387    pub fn new() -> Self {
10388        std::default::Default::default()
10389    }
10390
10391    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
10392    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10393        self.uri = v.into();
10394        self
10395    }
10396
10397    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
10398    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10399        self.vpc_network = v.into();
10400        self
10401    }
10402
10403    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
10404    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10405        self.site_to_site_data_transfer = v.into();
10406        self
10407    }
10408}
10409
10410impl wkt::message::Message for NextHopRouterApplianceInstance {
10411    fn typename() -> &'static str {
10412        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
10413    }
10414}
10415
10416/// A route next hop that leads to an interconnect attachment resource.
10417#[derive(Clone, Default, PartialEq)]
10418#[non_exhaustive]
10419pub struct NextHopInterconnectAttachment {
10420    /// The URI of the interconnect attachment resource.
10421    pub uri: std::string::String,
10422
10423    /// The VPC network where this interconnect attachment is located.
10424    pub vpc_network: std::string::String,
10425
10426    /// Indicates whether site-to-site data transfer is allowed for this
10427    /// interconnect attachment resource. Data transfer is available only in
10428    /// [supported
10429    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
10430    pub site_to_site_data_transfer: bool,
10431
10432    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10433}
10434
10435impl NextHopInterconnectAttachment {
10436    pub fn new() -> Self {
10437        std::default::Default::default()
10438    }
10439
10440    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
10441    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10442        self.uri = v.into();
10443        self
10444    }
10445
10446    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
10447    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10448        self.vpc_network = v.into();
10449        self
10450    }
10451
10452    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
10453    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10454        self.site_to_site_data_transfer = v.into();
10455        self
10456    }
10457}
10458
10459impl wkt::message::Message for NextHopInterconnectAttachment {
10460    fn typename() -> &'static str {
10461        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
10462    }
10463}
10464
10465/// Summarizes information about the spokes associated with a hub.
10466/// The summary includes a count of spokes according to type
10467/// and according to state. If any spokes are inactive,
10468/// the summary also lists the reasons they are inactive,
10469/// including a count for each reason.
10470#[derive(Clone, Default, PartialEq)]
10471#[non_exhaustive]
10472pub struct SpokeSummary {
10473    /// Output only. Counts the number of spokes of each type that are
10474    /// associated with a specific hub.
10475    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
10476
10477    /// Output only. Counts the number of spokes that are in each state
10478    /// and associated with a given hub.
10479    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
10480
10481    /// Output only. Counts the number of spokes that are inactive for each
10482    /// possible reason and associated with a given hub.
10483    pub spoke_state_reason_counts:
10484        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
10485
10486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10487}
10488
10489impl SpokeSummary {
10490    pub fn new() -> Self {
10491        std::default::Default::default()
10492    }
10493
10494    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
10495    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
10496    where
10497        T: std::iter::IntoIterator<Item = V>,
10498        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
10499    {
10500        use std::iter::Iterator;
10501        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
10502        self
10503    }
10504
10505    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
10506    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
10507    where
10508        T: std::iter::IntoIterator<Item = V>,
10509        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
10510    {
10511        use std::iter::Iterator;
10512        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
10513        self
10514    }
10515
10516    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
10517    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
10518    where
10519        T: std::iter::IntoIterator<Item = V>,
10520        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
10521    {
10522        use std::iter::Iterator;
10523        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
10524        self
10525    }
10526}
10527
10528impl wkt::message::Message for SpokeSummary {
10529    fn typename() -> &'static str {
10530        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
10531    }
10532}
10533
10534/// Defines additional types related to [SpokeSummary].
10535pub mod spoke_summary {
10536    #[allow(unused_imports)]
10537    use super::*;
10538
10539    /// The number of spokes of a given type that are associated
10540    /// with a specific hub. The type indicates what kind of
10541    /// resource is associated with the spoke.
10542    #[derive(Clone, Default, PartialEq)]
10543    #[non_exhaustive]
10544    pub struct SpokeTypeCount {
10545        /// Output only. The type of the spokes.
10546        pub spoke_type: crate::model::SpokeType,
10547
10548        /// Output only. The total number of spokes of this type that are
10549        /// associated with the hub.
10550        pub count: i64,
10551
10552        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10553    }
10554
10555    impl SpokeTypeCount {
10556        pub fn new() -> Self {
10557            std::default::Default::default()
10558        }
10559
10560        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
10561        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
10562            mut self,
10563            v: T,
10564        ) -> Self {
10565            self.spoke_type = v.into();
10566            self
10567        }
10568
10569        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
10570        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10571            self.count = v.into();
10572            self
10573        }
10574    }
10575
10576    impl wkt::message::Message for SpokeTypeCount {
10577        fn typename() -> &'static str {
10578            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
10579        }
10580    }
10581
10582    /// The number of spokes that are in a particular state
10583    /// and associated with a given hub.
10584    #[derive(Clone, Default, PartialEq)]
10585    #[non_exhaustive]
10586    pub struct SpokeStateCount {
10587        /// Output only. The state of the spokes.
10588        pub state: crate::model::State,
10589
10590        /// Output only. The total number of spokes that are in this state
10591        /// and associated with a given hub.
10592        pub count: i64,
10593
10594        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10595    }
10596
10597    impl SpokeStateCount {
10598        pub fn new() -> Self {
10599            std::default::Default::default()
10600        }
10601
10602        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
10603        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
10604            self.state = v.into();
10605            self
10606        }
10607
10608        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
10609        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10610            self.count = v.into();
10611            self
10612        }
10613    }
10614
10615    impl wkt::message::Message for SpokeStateCount {
10616        fn typename() -> &'static str {
10617            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
10618        }
10619    }
10620
10621    /// The number of spokes in the hub that are inactive for this reason.
10622    #[derive(Clone, Default, PartialEq)]
10623    #[non_exhaustive]
10624    pub struct SpokeStateReasonCount {
10625        /// Output only. The reason that a spoke is inactive.
10626        pub state_reason_code: crate::model::spoke::state_reason::Code,
10627
10628        /// Output only. The total number of spokes that are inactive for a
10629        /// particular reason and associated with a given hub.
10630        pub count: i64,
10631
10632        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10633    }
10634
10635    impl SpokeStateReasonCount {
10636        pub fn new() -> Self {
10637            std::default::Default::default()
10638        }
10639
10640        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
10641        pub fn set_state_reason_code<
10642            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
10643        >(
10644            mut self,
10645            v: T,
10646        ) -> Self {
10647            self.state_reason_code = v.into();
10648            self
10649        }
10650
10651        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
10652        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10653            self.count = v.into();
10654            self
10655        }
10656    }
10657
10658    impl wkt::message::Message for SpokeStateReasonCount {
10659        fn typename() -> &'static str {
10660            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
10661        }
10662    }
10663}
10664
10665/// The request for
10666/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
10667///
10668/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
10669#[derive(Clone, Default, PartialEq)]
10670#[non_exhaustive]
10671pub struct GetGroupRequest {
10672    /// Required. The name of the route table resource.
10673    pub name: std::string::String,
10674
10675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10676}
10677
10678impl GetGroupRequest {
10679    pub fn new() -> Self {
10680        std::default::Default::default()
10681    }
10682
10683    /// Sets the value of [name][crate::model::GetGroupRequest::name].
10684    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10685        self.name = v.into();
10686        self
10687    }
10688}
10689
10690impl wkt::message::Message for GetGroupRequest {
10691    fn typename() -> &'static str {
10692        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
10693    }
10694}
10695
10696/// Request for
10697/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
10698/// method.
10699///
10700/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
10701#[derive(Clone, Default, PartialEq)]
10702#[non_exhaustive]
10703pub struct UpdateGroupRequest {
10704    /// Optional. In the case of an update to an existing group, field mask is used
10705    /// to specify the fields to be overwritten. The fields specified in the
10706    /// update_mask are relative to the resource, not the full request. A field is
10707    /// overwritten if it is in the mask. If the user does not provide a mask, then
10708    /// all fields are overwritten.
10709    pub update_mask: std::option::Option<wkt::FieldMask>,
10710
10711    /// Required. The state that the group should be in after the update.
10712    pub group: std::option::Option<crate::model::Group>,
10713
10714    /// Optional. A request ID to identify requests. Specify a unique request ID so
10715    /// that if you must retry your request, the server knows to ignore the request
10716    /// if it has already been completed. The server guarantees that a request
10717    /// doesn't result in creation of duplicate commitments for at least 60
10718    /// minutes.
10719    ///
10720    /// For example, consider a situation where you make an initial request and
10721    /// the request times out. If you make the request again with the same request
10722    /// ID, the server can check to see whether the original operation
10723    /// was received. If it was, the server ignores the second request. This
10724    /// behavior prevents clients from mistakenly creating duplicate commitments.
10725    ///
10726    /// The request ID must be a valid UUID, with the exception that zero UUID is
10727    /// not supported (00000000-0000-0000-0000-000000000000).
10728    pub request_id: std::string::String,
10729
10730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10731}
10732
10733impl UpdateGroupRequest {
10734    pub fn new() -> Self {
10735        std::default::Default::default()
10736    }
10737
10738    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
10739    pub fn set_update_mask<T>(mut self, v: T) -> Self
10740    where
10741        T: std::convert::Into<wkt::FieldMask>,
10742    {
10743        self.update_mask = std::option::Option::Some(v.into());
10744        self
10745    }
10746
10747    /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
10748    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10749    where
10750        T: std::convert::Into<wkt::FieldMask>,
10751    {
10752        self.update_mask = v.map(|x| x.into());
10753        self
10754    }
10755
10756    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
10757    pub fn set_group<T>(mut self, v: T) -> Self
10758    where
10759        T: std::convert::Into<crate::model::Group>,
10760    {
10761        self.group = std::option::Option::Some(v.into());
10762        self
10763    }
10764
10765    /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
10766    pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
10767    where
10768        T: std::convert::Into<crate::model::Group>,
10769    {
10770        self.group = v.map(|x| x.into());
10771        self
10772    }
10773
10774    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
10775    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10776        self.request_id = v.into();
10777        self
10778    }
10779}
10780
10781impl wkt::message::Message for UpdateGroupRequest {
10782    fn typename() -> &'static str {
10783        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
10784    }
10785}
10786
10787/// The internal range resource for IPAM operations within a VPC network.
10788/// Used to represent a private address range along with behavioral
10789/// characteristics of that range (its usage and peering behavior).
10790/// Networking resources can link to this range if they are created
10791/// as belonging to it.
10792#[derive(Clone, Default, PartialEq)]
10793#[non_exhaustive]
10794pub struct InternalRange {
10795    /// Identifier. The name of an internal range.
10796    /// Format:
10797    /// projects/{project}/locations/{location}/internalRanges/{internal_range}
10798    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
10799    pub name: std::string::String,
10800
10801    /// Time when the internal range was created.
10802    pub create_time: std::option::Option<wkt::Timestamp>,
10803
10804    /// Time when the internal range was updated.
10805    pub update_time: std::option::Option<wkt::Timestamp>,
10806
10807    /// User-defined labels.
10808    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10809
10810    /// Optional. A description of this resource.
10811    pub description: std::string::String,
10812
10813    /// Optional. The IP range that this internal range defines.
10814    /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
10815    /// peering=FOR_SELF.
10816    /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
10817    /// be specified explicitly.
10818    pub ip_cidr_range: std::string::String,
10819
10820    /// Immutable. The URL or resource ID of the network in which to reserve the
10821    /// internal range. The network cannot be deleted if there are any reserved
10822    /// internal ranges referring to it. Legacy networks are not supported. For
10823    /// example:
10824    /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
10825    /// projects/{project}/locations/global/networks/{network}
10826    /// {network}
10827    pub network: std::string::String,
10828
10829    /// Optional. The type of usage set for this InternalRange.
10830    pub usage: crate::model::internal_range::Usage,
10831
10832    /// Optional. The type of peering set for this internal range.
10833    pub peering: crate::model::internal_range::Peering,
10834
10835    /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
10836    /// an IPv4 reservation that automatically finds a free range of the given
10837    /// size. If both ip_cidr_range and prefix_length are set, there is an error if
10838    /// the range sizes do not match. Can also be used during updates to change the
10839    /// range size.
10840    /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
10841    /// both fields must match. In other words, with IPv6 this field only works as
10842    /// a redundant parameter.
10843    pub prefix_length: i32,
10844
10845    /// Optional. Can be set to narrow down or pick a different address space while
10846    /// searching for a free range. If not set, defaults to the "10.0.0.0/8"
10847    /// address space. This can be used to search in other rfc-1918 address
10848    /// spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918
10849    /// address spaces used in the VPC.
10850    pub target_cidr_range: std::vec::Vec<std::string::String>,
10851
10852    /// Output only. The list of resources that refer to this internal range.
10853    /// Resources that use the internal range for their range allocation
10854    /// are referred to as users of the range. Other resources mark themselves
10855    /// as users while doing so by creating a reference to this internal range.
10856    /// Having a user, based on this reference, prevents deletion of the
10857    /// internal range referred to. Can be empty.
10858    pub users: std::vec::Vec<std::string::String>,
10859
10860    /// Optional. Types of resources that are allowed to overlap with the current
10861    /// internal range.
10862    pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
10863
10864    /// Optional. Must be present if usage is set to FOR_MIGRATION.
10865    pub migration: std::option::Option<crate::model::internal_range::Migration>,
10866
10867    /// Optional. Immutable ranges cannot have their fields modified, except for
10868    /// labels and description.
10869    pub immutable: bool,
10870
10871    /// Optional. Range auto-allocation options, may be set only when
10872    /// auto-allocation is selected by not setting ip_cidr_range (and setting
10873    /// prefix_length).
10874    pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
10875
10876    /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
10877    /// allows exclusion of particular CIDR ranges from the auto-allocation
10878    /// process, without having to reserve these blocks
10879    pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
10880
10881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10882}
10883
10884impl InternalRange {
10885    pub fn new() -> Self {
10886        std::default::Default::default()
10887    }
10888
10889    /// Sets the value of [name][crate::model::InternalRange::name].
10890    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10891        self.name = v.into();
10892        self
10893    }
10894
10895    /// Sets the value of [create_time][crate::model::InternalRange::create_time].
10896    pub fn set_create_time<T>(mut self, v: T) -> Self
10897    where
10898        T: std::convert::Into<wkt::Timestamp>,
10899    {
10900        self.create_time = std::option::Option::Some(v.into());
10901        self
10902    }
10903
10904    /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
10905    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10906    where
10907        T: std::convert::Into<wkt::Timestamp>,
10908    {
10909        self.create_time = v.map(|x| x.into());
10910        self
10911    }
10912
10913    /// Sets the value of [update_time][crate::model::InternalRange::update_time].
10914    pub fn set_update_time<T>(mut self, v: T) -> Self
10915    where
10916        T: std::convert::Into<wkt::Timestamp>,
10917    {
10918        self.update_time = std::option::Option::Some(v.into());
10919        self
10920    }
10921
10922    /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
10923    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10924    where
10925        T: std::convert::Into<wkt::Timestamp>,
10926    {
10927        self.update_time = v.map(|x| x.into());
10928        self
10929    }
10930
10931    /// Sets the value of [labels][crate::model::InternalRange::labels].
10932    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10933    where
10934        T: std::iter::IntoIterator<Item = (K, V)>,
10935        K: std::convert::Into<std::string::String>,
10936        V: std::convert::Into<std::string::String>,
10937    {
10938        use std::iter::Iterator;
10939        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10940        self
10941    }
10942
10943    /// Sets the value of [description][crate::model::InternalRange::description].
10944    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10945        self.description = v.into();
10946        self
10947    }
10948
10949    /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
10950    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10951        self.ip_cidr_range = v.into();
10952        self
10953    }
10954
10955    /// Sets the value of [network][crate::model::InternalRange::network].
10956    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10957        self.network = v.into();
10958        self
10959    }
10960
10961    /// Sets the value of [usage][crate::model::InternalRange::usage].
10962    pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
10963        mut self,
10964        v: T,
10965    ) -> Self {
10966        self.usage = v.into();
10967        self
10968    }
10969
10970    /// Sets the value of [peering][crate::model::InternalRange::peering].
10971    pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
10972        mut self,
10973        v: T,
10974    ) -> Self {
10975        self.peering = v.into();
10976        self
10977    }
10978
10979    /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
10980    pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10981        self.prefix_length = v.into();
10982        self
10983    }
10984
10985    /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
10986    pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
10987    where
10988        T: std::iter::IntoIterator<Item = V>,
10989        V: std::convert::Into<std::string::String>,
10990    {
10991        use std::iter::Iterator;
10992        self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
10993        self
10994    }
10995
10996    /// Sets the value of [users][crate::model::InternalRange::users].
10997    pub fn set_users<T, V>(mut self, v: T) -> Self
10998    where
10999        T: std::iter::IntoIterator<Item = V>,
11000        V: std::convert::Into<std::string::String>,
11001    {
11002        use std::iter::Iterator;
11003        self.users = v.into_iter().map(|i| i.into()).collect();
11004        self
11005    }
11006
11007    /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
11008    pub fn set_overlaps<T, V>(mut self, v: T) -> Self
11009    where
11010        T: std::iter::IntoIterator<Item = V>,
11011        V: std::convert::Into<crate::model::internal_range::Overlap>,
11012    {
11013        use std::iter::Iterator;
11014        self.overlaps = v.into_iter().map(|i| i.into()).collect();
11015        self
11016    }
11017
11018    /// Sets the value of [migration][crate::model::InternalRange::migration].
11019    pub fn set_migration<T>(mut self, v: T) -> Self
11020    where
11021        T: std::convert::Into<crate::model::internal_range::Migration>,
11022    {
11023        self.migration = std::option::Option::Some(v.into());
11024        self
11025    }
11026
11027    /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
11028    pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
11029    where
11030        T: std::convert::Into<crate::model::internal_range::Migration>,
11031    {
11032        self.migration = v.map(|x| x.into());
11033        self
11034    }
11035
11036    /// Sets the value of [immutable][crate::model::InternalRange::immutable].
11037    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11038        self.immutable = v.into();
11039        self
11040    }
11041
11042    /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
11043    pub fn set_allocation_options<T>(mut self, v: T) -> Self
11044    where
11045        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
11046    {
11047        self.allocation_options = std::option::Option::Some(v.into());
11048        self
11049    }
11050
11051    /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
11052    pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
11053    where
11054        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
11055    {
11056        self.allocation_options = v.map(|x| x.into());
11057        self
11058    }
11059
11060    /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
11061    pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
11062    where
11063        T: std::iter::IntoIterator<Item = V>,
11064        V: std::convert::Into<std::string::String>,
11065    {
11066        use std::iter::Iterator;
11067        self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
11068        self
11069    }
11070}
11071
11072impl wkt::message::Message for InternalRange {
11073    fn typename() -> &'static str {
11074        "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
11075    }
11076}
11077
11078/// Defines additional types related to [InternalRange].
11079pub mod internal_range {
11080    #[allow(unused_imports)]
11081    use super::*;
11082
11083    /// Specification for migration with source and target resource names.
11084    #[derive(Clone, Default, PartialEq)]
11085    #[non_exhaustive]
11086    pub struct Migration {
11087        /// Immutable. Resource path as an URI of the source resource, for example a
11088        /// subnet. The project for the source resource should match the project for
11089        /// the InternalRange. An example:
11090        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
11091        pub source: std::string::String,
11092
11093        /// Immutable. Resource path of the target resource. The target project can
11094        /// be different, as in the cases when migrating to peer networks. For
11095        /// example:
11096        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
11097        pub target: std::string::String,
11098
11099        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11100    }
11101
11102    impl Migration {
11103        pub fn new() -> Self {
11104            std::default::Default::default()
11105        }
11106
11107        /// Sets the value of [source][crate::model::internal_range::Migration::source].
11108        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11109            self.source = v.into();
11110            self
11111        }
11112
11113        /// Sets the value of [target][crate::model::internal_range::Migration::target].
11114        pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11115            self.target = v.into();
11116            self
11117        }
11118    }
11119
11120    impl wkt::message::Message for Migration {
11121        fn typename() -> &'static str {
11122            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
11123        }
11124    }
11125
11126    /// Range auto-allocation options, to be optionally used when CIDR block is not
11127    /// explicitly set.
11128    #[derive(Clone, Default, PartialEq)]
11129    #[non_exhaustive]
11130    pub struct AllocationOptions {
11131        /// Optional. Allocation strategy Not setting this field when the allocation
11132        /// is requested means an implementation defined strategy is used.
11133        pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
11134
11135        /// Optional. This field must be set only when allocation_strategy is set to
11136        /// RANDOM_FIRST_N_AVAILABLE.
11137        /// The value should be the maximum expected parallelism of range creation
11138        /// requests issued to the same space of peered netwroks.
11139        pub first_available_ranges_lookup_size: i32,
11140
11141        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11142    }
11143
11144    impl AllocationOptions {
11145        pub fn new() -> Self {
11146            std::default::Default::default()
11147        }
11148
11149        /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
11150        pub fn set_allocation_strategy<
11151            T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
11152        >(
11153            mut self,
11154            v: T,
11155        ) -> Self {
11156            self.allocation_strategy = v.into();
11157            self
11158        }
11159
11160        /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
11161        pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
11162            mut self,
11163            v: T,
11164        ) -> Self {
11165            self.first_available_ranges_lookup_size = v.into();
11166            self
11167        }
11168    }
11169
11170    impl wkt::message::Message for AllocationOptions {
11171        fn typename() -> &'static str {
11172            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
11173        }
11174    }
11175
11176    /// Possible usage of an internal range.
11177    ///
11178    /// # Working with unknown values
11179    ///
11180    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11181    /// additional enum variants at any time. Adding new variants is not considered
11182    /// a breaking change. Applications should write their code in anticipation of:
11183    ///
11184    /// - New values appearing in future releases of the client library, **and**
11185    /// - New values received dynamically, without application changes.
11186    ///
11187    /// Please consult the [Working with enums] section in the user guide for some
11188    /// guidelines.
11189    ///
11190    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11191    #[derive(Clone, Debug, PartialEq)]
11192    #[non_exhaustive]
11193    pub enum Usage {
11194        /// Unspecified usage is allowed in calls which identify the resource by
11195        /// other fields and do not need Usage set to complete. These are, i.e.:
11196        /// GetInternalRange and DeleteInternalRange.
11197        /// Usage needs to be specified explicitly in CreateInternalRange
11198        /// or UpdateInternalRange calls.
11199        Unspecified,
11200        /// A VPC resource can use the reserved CIDR block by associating it with the
11201        /// internal range resource if usage is set to FOR_VPC.
11202        ForVpc,
11203        /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
11204        /// resources and are meant to block out address ranges for various use
11205        /// cases, like for example, usage on-prem, with dynamic route announcements
11206        /// via interconnect.
11207        ExternalToVpc,
11208        /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
11209        /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
11210        /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
11211        ForMigration,
11212        /// If set, the enum was initialized with an unknown value.
11213        ///
11214        /// Applications can examine the value using [Usage::value] or
11215        /// [Usage::name].
11216        UnknownValue(usage::UnknownValue),
11217    }
11218
11219    #[doc(hidden)]
11220    pub mod usage {
11221        #[allow(unused_imports)]
11222        use super::*;
11223        #[derive(Clone, Debug, PartialEq)]
11224        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11225    }
11226
11227    impl Usage {
11228        /// Gets the enum value.
11229        ///
11230        /// Returns `None` if the enum contains an unknown value deserialized from
11231        /// the string representation of enums.
11232        pub fn value(&self) -> std::option::Option<i32> {
11233            match self {
11234                Self::Unspecified => std::option::Option::Some(0),
11235                Self::ForVpc => std::option::Option::Some(1),
11236                Self::ExternalToVpc => std::option::Option::Some(2),
11237                Self::ForMigration => std::option::Option::Some(3),
11238                Self::UnknownValue(u) => u.0.value(),
11239            }
11240        }
11241
11242        /// Gets the enum value as a string.
11243        ///
11244        /// Returns `None` if the enum contains an unknown value deserialized from
11245        /// the integer representation of enums.
11246        pub fn name(&self) -> std::option::Option<&str> {
11247            match self {
11248                Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
11249                Self::ForVpc => std::option::Option::Some("FOR_VPC"),
11250                Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
11251                Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
11252                Self::UnknownValue(u) => u.0.name(),
11253            }
11254        }
11255    }
11256
11257    impl std::default::Default for Usage {
11258        fn default() -> Self {
11259            use std::convert::From;
11260            Self::from(0)
11261        }
11262    }
11263
11264    impl std::fmt::Display for Usage {
11265        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11266            wkt::internal::display_enum(f, self.name(), self.value())
11267        }
11268    }
11269
11270    impl std::convert::From<i32> for Usage {
11271        fn from(value: i32) -> Self {
11272            match value {
11273                0 => Self::Unspecified,
11274                1 => Self::ForVpc,
11275                2 => Self::ExternalToVpc,
11276                3 => Self::ForMigration,
11277                _ => Self::UnknownValue(usage::UnknownValue(
11278                    wkt::internal::UnknownEnumValue::Integer(value),
11279                )),
11280            }
11281        }
11282    }
11283
11284    impl std::convert::From<&str> for Usage {
11285        fn from(value: &str) -> Self {
11286            use std::string::ToString;
11287            match value {
11288                "USAGE_UNSPECIFIED" => Self::Unspecified,
11289                "FOR_VPC" => Self::ForVpc,
11290                "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
11291                "FOR_MIGRATION" => Self::ForMigration,
11292                _ => Self::UnknownValue(usage::UnknownValue(
11293                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11294                )),
11295            }
11296        }
11297    }
11298
11299    impl serde::ser::Serialize for Usage {
11300        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11301        where
11302            S: serde::Serializer,
11303        {
11304            match self {
11305                Self::Unspecified => serializer.serialize_i32(0),
11306                Self::ForVpc => serializer.serialize_i32(1),
11307                Self::ExternalToVpc => serializer.serialize_i32(2),
11308                Self::ForMigration => serializer.serialize_i32(3),
11309                Self::UnknownValue(u) => u.0.serialize(serializer),
11310            }
11311        }
11312    }
11313
11314    impl<'de> serde::de::Deserialize<'de> for Usage {
11315        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11316        where
11317            D: serde::Deserializer<'de>,
11318        {
11319            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
11320                ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
11321            ))
11322        }
11323    }
11324
11325    /// Peering type.
11326    ///
11327    /// # Working with unknown values
11328    ///
11329    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11330    /// additional enum variants at any time. Adding new variants is not considered
11331    /// a breaking change. Applications should write their code in anticipation of:
11332    ///
11333    /// - New values appearing in future releases of the client library, **and**
11334    /// - New values received dynamically, without application changes.
11335    ///
11336    /// Please consult the [Working with enums] section in the user guide for some
11337    /// guidelines.
11338    ///
11339    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11340    #[derive(Clone, Debug, PartialEq)]
11341    #[non_exhaustive]
11342    pub enum Peering {
11343        /// If Peering is left unspecified in CreateInternalRange or
11344        /// UpdateInternalRange, it will be defaulted to FOR_SELF.
11345        Unspecified,
11346        /// This is the default behavior and represents the case that this
11347        /// internal range is intended to be used in the VPC in which it is created
11348        /// and is accessible from its peers. This implies that peers or
11349        /// peers-of-peers cannot use this range.
11350        ForSelf,
11351        /// This behavior can be set when the internal range is being reserved for
11352        /// usage by peers. This means that no resource within the VPC in which
11353        /// it is being created can use this to associate with a VPC resource, but
11354        /// one of the peers can. This represents donating a range for peers to
11355        /// use.
11356        ForPeer,
11357        /// This behavior can be set when the internal range is being reserved for
11358        /// usage by the VPC in which it is created, but not shared with peers.
11359        /// In a sense, it is local to the VPC. This can be used to create internal
11360        /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
11361        /// Interconnect routes that are not shared with peers. This also implies
11362        /// that peers cannot use this range in a way that is visible to this VPC,
11363        /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
11364        /// too.
11365        NotShared,
11366        /// If set, the enum was initialized with an unknown value.
11367        ///
11368        /// Applications can examine the value using [Peering::value] or
11369        /// [Peering::name].
11370        UnknownValue(peering::UnknownValue),
11371    }
11372
11373    #[doc(hidden)]
11374    pub mod peering {
11375        #[allow(unused_imports)]
11376        use super::*;
11377        #[derive(Clone, Debug, PartialEq)]
11378        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11379    }
11380
11381    impl Peering {
11382        /// Gets the enum value.
11383        ///
11384        /// Returns `None` if the enum contains an unknown value deserialized from
11385        /// the string representation of enums.
11386        pub fn value(&self) -> std::option::Option<i32> {
11387            match self {
11388                Self::Unspecified => std::option::Option::Some(0),
11389                Self::ForSelf => std::option::Option::Some(1),
11390                Self::ForPeer => std::option::Option::Some(2),
11391                Self::NotShared => std::option::Option::Some(3),
11392                Self::UnknownValue(u) => u.0.value(),
11393            }
11394        }
11395
11396        /// Gets the enum value as a string.
11397        ///
11398        /// Returns `None` if the enum contains an unknown value deserialized from
11399        /// the integer representation of enums.
11400        pub fn name(&self) -> std::option::Option<&str> {
11401            match self {
11402                Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
11403                Self::ForSelf => std::option::Option::Some("FOR_SELF"),
11404                Self::ForPeer => std::option::Option::Some("FOR_PEER"),
11405                Self::NotShared => std::option::Option::Some("NOT_SHARED"),
11406                Self::UnknownValue(u) => u.0.name(),
11407            }
11408        }
11409    }
11410
11411    impl std::default::Default for Peering {
11412        fn default() -> Self {
11413            use std::convert::From;
11414            Self::from(0)
11415        }
11416    }
11417
11418    impl std::fmt::Display for Peering {
11419        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11420            wkt::internal::display_enum(f, self.name(), self.value())
11421        }
11422    }
11423
11424    impl std::convert::From<i32> for Peering {
11425        fn from(value: i32) -> Self {
11426            match value {
11427                0 => Self::Unspecified,
11428                1 => Self::ForSelf,
11429                2 => Self::ForPeer,
11430                3 => Self::NotShared,
11431                _ => Self::UnknownValue(peering::UnknownValue(
11432                    wkt::internal::UnknownEnumValue::Integer(value),
11433                )),
11434            }
11435        }
11436    }
11437
11438    impl std::convert::From<&str> for Peering {
11439        fn from(value: &str) -> Self {
11440            use std::string::ToString;
11441            match value {
11442                "PEERING_UNSPECIFIED" => Self::Unspecified,
11443                "FOR_SELF" => Self::ForSelf,
11444                "FOR_PEER" => Self::ForPeer,
11445                "NOT_SHARED" => Self::NotShared,
11446                _ => Self::UnknownValue(peering::UnknownValue(
11447                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11448                )),
11449            }
11450        }
11451    }
11452
11453    impl serde::ser::Serialize for Peering {
11454        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11455        where
11456            S: serde::Serializer,
11457        {
11458            match self {
11459                Self::Unspecified => serializer.serialize_i32(0),
11460                Self::ForSelf => serializer.serialize_i32(1),
11461                Self::ForPeer => serializer.serialize_i32(2),
11462                Self::NotShared => serializer.serialize_i32(3),
11463                Self::UnknownValue(u) => u.0.serialize(serializer),
11464            }
11465        }
11466    }
11467
11468    impl<'de> serde::de::Deserialize<'de> for Peering {
11469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11470        where
11471            D: serde::Deserializer<'de>,
11472        {
11473            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
11474                ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
11475            ))
11476        }
11477    }
11478
11479    /// Overlap specifications.
11480    ///
11481    /// # Working with unknown values
11482    ///
11483    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11484    /// additional enum variants at any time. Adding new variants is not considered
11485    /// a breaking change. Applications should write their code in anticipation of:
11486    ///
11487    /// - New values appearing in future releases of the client library, **and**
11488    /// - New values received dynamically, without application changes.
11489    ///
11490    /// Please consult the [Working with enums] section in the user guide for some
11491    /// guidelines.
11492    ///
11493    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11494    #[derive(Clone, Debug, PartialEq)]
11495    #[non_exhaustive]
11496    pub enum Overlap {
11497        /// No overlap overrides.
11498        Unspecified,
11499        /// Allow creation of static routes more specific that the current
11500        /// internal range.
11501        RouteRange,
11502        /// Allow creation of internal ranges that overlap with existing subnets.
11503        ExistingSubnetRange,
11504        /// If set, the enum was initialized with an unknown value.
11505        ///
11506        /// Applications can examine the value using [Overlap::value] or
11507        /// [Overlap::name].
11508        UnknownValue(overlap::UnknownValue),
11509    }
11510
11511    #[doc(hidden)]
11512    pub mod overlap {
11513        #[allow(unused_imports)]
11514        use super::*;
11515        #[derive(Clone, Debug, PartialEq)]
11516        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11517    }
11518
11519    impl Overlap {
11520        /// Gets the enum value.
11521        ///
11522        /// Returns `None` if the enum contains an unknown value deserialized from
11523        /// the string representation of enums.
11524        pub fn value(&self) -> std::option::Option<i32> {
11525            match self {
11526                Self::Unspecified => std::option::Option::Some(0),
11527                Self::RouteRange => std::option::Option::Some(1),
11528                Self::ExistingSubnetRange => std::option::Option::Some(2),
11529                Self::UnknownValue(u) => u.0.value(),
11530            }
11531        }
11532
11533        /// Gets the enum value as a string.
11534        ///
11535        /// Returns `None` if the enum contains an unknown value deserialized from
11536        /// the integer representation of enums.
11537        pub fn name(&self) -> std::option::Option<&str> {
11538            match self {
11539                Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
11540                Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
11541                Self::ExistingSubnetRange => {
11542                    std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
11543                }
11544                Self::UnknownValue(u) => u.0.name(),
11545            }
11546        }
11547    }
11548
11549    impl std::default::Default for Overlap {
11550        fn default() -> Self {
11551            use std::convert::From;
11552            Self::from(0)
11553        }
11554    }
11555
11556    impl std::fmt::Display for Overlap {
11557        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11558            wkt::internal::display_enum(f, self.name(), self.value())
11559        }
11560    }
11561
11562    impl std::convert::From<i32> for Overlap {
11563        fn from(value: i32) -> Self {
11564            match value {
11565                0 => Self::Unspecified,
11566                1 => Self::RouteRange,
11567                2 => Self::ExistingSubnetRange,
11568                _ => Self::UnknownValue(overlap::UnknownValue(
11569                    wkt::internal::UnknownEnumValue::Integer(value),
11570                )),
11571            }
11572        }
11573    }
11574
11575    impl std::convert::From<&str> for Overlap {
11576        fn from(value: &str) -> Self {
11577            use std::string::ToString;
11578            match value {
11579                "OVERLAP_UNSPECIFIED" => Self::Unspecified,
11580                "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
11581                "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
11582                _ => Self::UnknownValue(overlap::UnknownValue(
11583                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11584                )),
11585            }
11586        }
11587    }
11588
11589    impl serde::ser::Serialize for Overlap {
11590        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11591        where
11592            S: serde::Serializer,
11593        {
11594            match self {
11595                Self::Unspecified => serializer.serialize_i32(0),
11596                Self::RouteRange => serializer.serialize_i32(1),
11597                Self::ExistingSubnetRange => serializer.serialize_i32(2),
11598                Self::UnknownValue(u) => u.0.serialize(serializer),
11599            }
11600        }
11601    }
11602
11603    impl<'de> serde::de::Deserialize<'de> for Overlap {
11604        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11605        where
11606            D: serde::Deserializer<'de>,
11607        {
11608            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
11609                ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
11610            ))
11611        }
11612    }
11613
11614    /// Enumeration of range auto-allocation strategies
11615    ///
11616    /// # Working with unknown values
11617    ///
11618    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11619    /// additional enum variants at any time. Adding new variants is not considered
11620    /// a breaking change. Applications should write their code in anticipation of:
11621    ///
11622    /// - New values appearing in future releases of the client library, **and**
11623    /// - New values received dynamically, without application changes.
11624    ///
11625    /// Please consult the [Working with enums] section in the user guide for some
11626    /// guidelines.
11627    ///
11628    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11629    #[derive(Clone, Debug, PartialEq)]
11630    #[non_exhaustive]
11631    pub enum AllocationStrategy {
11632        /// Unspecified is the only valid option when the range is specified
11633        /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
11634        /// default strategy.
11635        Unspecified,
11636        /// Random strategy, the legacy algorithm, used for backwards compatibility.
11637        /// This allocation strategy remains efficient in the case of concurrent
11638        /// allocation requests in the same peered network space and doesn't require
11639        /// providing the level of concurrency in an explicit parameter, but it is
11640        /// prone to fragmenting available address space.
11641        Random,
11642        /// Pick the first available address range. This strategy is deterministic
11643        /// and the result is easy to predict.
11644        FirstAvailable,
11645        /// Pick an arbitrary range out of the first N available ones. The N will be
11646        /// set in the first_available_ranges_lookup_size field. This strategy should
11647        /// be used when concurrent allocation requests are made in the same space of
11648        /// peered networks while the fragmentation of the addrress space is reduced.
11649        RandomFirstNAvailable,
11650        /// Pick the smallest but fitting available range. This deterministic
11651        /// strategy minimizes fragmentation of the address space.
11652        FirstSmallestFitting,
11653        /// If set, the enum was initialized with an unknown value.
11654        ///
11655        /// Applications can examine the value using [AllocationStrategy::value] or
11656        /// [AllocationStrategy::name].
11657        UnknownValue(allocation_strategy::UnknownValue),
11658    }
11659
11660    #[doc(hidden)]
11661    pub mod allocation_strategy {
11662        #[allow(unused_imports)]
11663        use super::*;
11664        #[derive(Clone, Debug, PartialEq)]
11665        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11666    }
11667
11668    impl AllocationStrategy {
11669        /// Gets the enum value.
11670        ///
11671        /// Returns `None` if the enum contains an unknown value deserialized from
11672        /// the string representation of enums.
11673        pub fn value(&self) -> std::option::Option<i32> {
11674            match self {
11675                Self::Unspecified => std::option::Option::Some(0),
11676                Self::Random => std::option::Option::Some(1),
11677                Self::FirstAvailable => std::option::Option::Some(2),
11678                Self::RandomFirstNAvailable => std::option::Option::Some(3),
11679                Self::FirstSmallestFitting => std::option::Option::Some(4),
11680                Self::UnknownValue(u) => u.0.value(),
11681            }
11682        }
11683
11684        /// Gets the enum value as a string.
11685        ///
11686        /// Returns `None` if the enum contains an unknown value deserialized from
11687        /// the integer representation of enums.
11688        pub fn name(&self) -> std::option::Option<&str> {
11689            match self {
11690                Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
11691                Self::Random => std::option::Option::Some("RANDOM"),
11692                Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
11693                Self::RandomFirstNAvailable => {
11694                    std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
11695                }
11696                Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
11697                Self::UnknownValue(u) => u.0.name(),
11698            }
11699        }
11700    }
11701
11702    impl std::default::Default for AllocationStrategy {
11703        fn default() -> Self {
11704            use std::convert::From;
11705            Self::from(0)
11706        }
11707    }
11708
11709    impl std::fmt::Display for AllocationStrategy {
11710        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11711            wkt::internal::display_enum(f, self.name(), self.value())
11712        }
11713    }
11714
11715    impl std::convert::From<i32> for AllocationStrategy {
11716        fn from(value: i32) -> Self {
11717            match value {
11718                0 => Self::Unspecified,
11719                1 => Self::Random,
11720                2 => Self::FirstAvailable,
11721                3 => Self::RandomFirstNAvailable,
11722                4 => Self::FirstSmallestFitting,
11723                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
11724                    wkt::internal::UnknownEnumValue::Integer(value),
11725                )),
11726            }
11727        }
11728    }
11729
11730    impl std::convert::From<&str> for AllocationStrategy {
11731        fn from(value: &str) -> Self {
11732            use std::string::ToString;
11733            match value {
11734                "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
11735                "RANDOM" => Self::Random,
11736                "FIRST_AVAILABLE" => Self::FirstAvailable,
11737                "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
11738                "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
11739                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
11740                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11741                )),
11742            }
11743        }
11744    }
11745
11746    impl serde::ser::Serialize for AllocationStrategy {
11747        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11748        where
11749            S: serde::Serializer,
11750        {
11751            match self {
11752                Self::Unspecified => serializer.serialize_i32(0),
11753                Self::Random => serializer.serialize_i32(1),
11754                Self::FirstAvailable => serializer.serialize_i32(2),
11755                Self::RandomFirstNAvailable => serializer.serialize_i32(3),
11756                Self::FirstSmallestFitting => serializer.serialize_i32(4),
11757                Self::UnknownValue(u) => u.0.serialize(serializer),
11758            }
11759        }
11760    }
11761
11762    impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
11763        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11764        where
11765            D: serde::Deserializer<'de>,
11766        {
11767            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
11768                ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
11769            ))
11770        }
11771    }
11772}
11773
11774/// Request for InternalRangeService.ListInternalRanges
11775#[derive(Clone, Default, PartialEq)]
11776#[non_exhaustive]
11777pub struct ListInternalRangesRequest {
11778    /// Required. The parent resource's name.
11779    pub parent: std::string::String,
11780
11781    /// The maximum number of results per page that should be returned.
11782    pub page_size: i32,
11783
11784    /// The page token.
11785    pub page_token: std::string::String,
11786
11787    /// A filter expression that filters the results listed in the response.
11788    pub filter: std::string::String,
11789
11790    /// Sort the results by a certain order.
11791    pub order_by: std::string::String,
11792
11793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11794}
11795
11796impl ListInternalRangesRequest {
11797    pub fn new() -> Self {
11798        std::default::Default::default()
11799    }
11800
11801    /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
11802    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11803        self.parent = v.into();
11804        self
11805    }
11806
11807    /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
11808    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11809        self.page_size = v.into();
11810        self
11811    }
11812
11813    /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
11814    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11815        self.page_token = v.into();
11816        self
11817    }
11818
11819    /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
11820    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11821        self.filter = v.into();
11822        self
11823    }
11824
11825    /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
11826    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11827        self.order_by = v.into();
11828        self
11829    }
11830}
11831
11832impl wkt::message::Message for ListInternalRangesRequest {
11833    fn typename() -> &'static str {
11834        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
11835    }
11836}
11837
11838/// Response for InternalRange.ListInternalRanges
11839#[derive(Clone, Default, PartialEq)]
11840#[non_exhaustive]
11841pub struct ListInternalRangesResponse {
11842    /// Internal ranges to be returned.
11843    pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
11844
11845    /// The next pagination token in the List response. It should be used as
11846    /// page_token for the following request. An empty value means no more result.
11847    pub next_page_token: std::string::String,
11848
11849    /// Locations that could not be reached.
11850    pub unreachable: std::vec::Vec<std::string::String>,
11851
11852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11853}
11854
11855impl ListInternalRangesResponse {
11856    pub fn new() -> Self {
11857        std::default::Default::default()
11858    }
11859
11860    /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
11861    pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
11862    where
11863        T: std::iter::IntoIterator<Item = V>,
11864        V: std::convert::Into<crate::model::InternalRange>,
11865    {
11866        use std::iter::Iterator;
11867        self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
11868        self
11869    }
11870
11871    /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
11872    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11873        self.next_page_token = v.into();
11874        self
11875    }
11876
11877    /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
11878    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11879    where
11880        T: std::iter::IntoIterator<Item = V>,
11881        V: std::convert::Into<std::string::String>,
11882    {
11883        use std::iter::Iterator;
11884        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11885        self
11886    }
11887}
11888
11889impl wkt::message::Message for ListInternalRangesResponse {
11890    fn typename() -> &'static str {
11891        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
11892    }
11893}
11894
11895#[doc(hidden)]
11896impl gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
11897    type PageItem = crate::model::InternalRange;
11898
11899    fn items(self) -> std::vec::Vec<Self::PageItem> {
11900        self.internal_ranges
11901    }
11902
11903    fn next_page_token(&self) -> std::string::String {
11904        use std::clone::Clone;
11905        self.next_page_token.clone()
11906    }
11907}
11908
11909/// Request for InternalRangeService.GetInternalRange
11910#[derive(Clone, Default, PartialEq)]
11911#[non_exhaustive]
11912pub struct GetInternalRangeRequest {
11913    /// Required. Name of the InternalRange to get.
11914    pub name: std::string::String,
11915
11916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11917}
11918
11919impl GetInternalRangeRequest {
11920    pub fn new() -> Self {
11921        std::default::Default::default()
11922    }
11923
11924    /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
11925    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11926        self.name = v.into();
11927        self
11928    }
11929}
11930
11931impl wkt::message::Message for GetInternalRangeRequest {
11932    fn typename() -> &'static str {
11933        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
11934    }
11935}
11936
11937/// Request for InternalRangeService.CreateInternalRange
11938#[derive(Clone, Default, PartialEq)]
11939#[non_exhaustive]
11940pub struct CreateInternalRangeRequest {
11941    /// Required. The parent resource's name of the internal range.
11942    pub parent: std::string::String,
11943
11944    /// Optional. Resource ID
11945    /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
11946    /// See <https://google.aip.dev/122#resource-id-segments>
11947    /// Unique per location.
11948    pub internal_range_id: std::string::String,
11949
11950    /// Required. Initial values for a new internal range
11951    pub internal_range: std::option::Option<crate::model::InternalRange>,
11952
11953    /// Optional. An optional request ID to identify requests. Specify a unique
11954    /// request ID so that if you must retry your request, the server will know to
11955    /// ignore the request if it has already been completed. The server will
11956    /// guarantee that for at least 60 minutes since the first request.
11957    ///
11958    /// For example, consider a situation where you make an initial request and
11959    /// the request times out. If you make the request again with the same request
11960    /// ID, the server can check if original operation with the same request ID
11961    /// was received, and if so, will ignore the second request. This prevents
11962    /// clients from accidentally creating duplicate commitments.
11963    ///
11964    /// The request ID must be a valid UUID with the exception that zero UUID is
11965    /// not supported (00000000-0000-0000-0000-000000000000).
11966    pub request_id: std::string::String,
11967
11968    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11969}
11970
11971impl CreateInternalRangeRequest {
11972    pub fn new() -> Self {
11973        std::default::Default::default()
11974    }
11975
11976    /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
11977    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11978        self.parent = v.into();
11979        self
11980    }
11981
11982    /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
11983    pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
11984        mut self,
11985        v: T,
11986    ) -> Self {
11987        self.internal_range_id = v.into();
11988        self
11989    }
11990
11991    /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
11992    pub fn set_internal_range<T>(mut self, v: T) -> Self
11993    where
11994        T: std::convert::Into<crate::model::InternalRange>,
11995    {
11996        self.internal_range = std::option::Option::Some(v.into());
11997        self
11998    }
11999
12000    /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
12001    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
12002    where
12003        T: std::convert::Into<crate::model::InternalRange>,
12004    {
12005        self.internal_range = v.map(|x| x.into());
12006        self
12007    }
12008
12009    /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
12010    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12011        self.request_id = v.into();
12012        self
12013    }
12014}
12015
12016impl wkt::message::Message for CreateInternalRangeRequest {
12017    fn typename() -> &'static str {
12018        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
12019    }
12020}
12021
12022/// Request for InternalRangeService.UpdateInternalRange
12023#[derive(Clone, Default, PartialEq)]
12024#[non_exhaustive]
12025pub struct UpdateInternalRangeRequest {
12026    /// Optional. Field mask is used to specify the fields to be overwritten in the
12027    /// InternalRange resource by the update.
12028    /// The fields specified in the update_mask are relative to the resource, not
12029    /// the full request. A field will be overwritten if it is in the mask. If the
12030    /// user does not provide a mask then all fields will be overwritten.
12031    pub update_mask: std::option::Option<wkt::FieldMask>,
12032
12033    /// Required. New values to be patched into the resource.
12034    pub internal_range: std::option::Option<crate::model::InternalRange>,
12035
12036    /// Optional. An optional request ID to identify requests. Specify a unique
12037    /// request ID so that if you must retry your request, the server will know to
12038    /// ignore the request if it has already been completed. The server will
12039    /// guarantee that for at least 60 minutes since the first request.
12040    ///
12041    /// For example, consider a situation where you make an initial request and
12042    /// the request times out. If you make the request again with the same request
12043    /// ID, the server can check if original operation with the same request ID
12044    /// was received, and if so, will ignore the second request. This prevents
12045    /// clients from accidentally creating duplicate commitments.
12046    ///
12047    /// The request ID must be a valid UUID with the exception that zero UUID is
12048    /// not supported (00000000-0000-0000-0000-000000000000).
12049    pub request_id: std::string::String,
12050
12051    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12052}
12053
12054impl UpdateInternalRangeRequest {
12055    pub fn new() -> Self {
12056        std::default::Default::default()
12057    }
12058
12059    /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
12060    pub fn set_update_mask<T>(mut self, v: T) -> Self
12061    where
12062        T: std::convert::Into<wkt::FieldMask>,
12063    {
12064        self.update_mask = std::option::Option::Some(v.into());
12065        self
12066    }
12067
12068    /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
12069    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12070    where
12071        T: std::convert::Into<wkt::FieldMask>,
12072    {
12073        self.update_mask = v.map(|x| x.into());
12074        self
12075    }
12076
12077    /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
12078    pub fn set_internal_range<T>(mut self, v: T) -> Self
12079    where
12080        T: std::convert::Into<crate::model::InternalRange>,
12081    {
12082        self.internal_range = std::option::Option::Some(v.into());
12083        self
12084    }
12085
12086    /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
12087    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
12088    where
12089        T: std::convert::Into<crate::model::InternalRange>,
12090    {
12091        self.internal_range = v.map(|x| x.into());
12092        self
12093    }
12094
12095    /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
12096    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12097        self.request_id = v.into();
12098        self
12099    }
12100}
12101
12102impl wkt::message::Message for UpdateInternalRangeRequest {
12103    fn typename() -> &'static str {
12104        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
12105    }
12106}
12107
12108/// Request for InternalRangeService.DeleteInternalRange
12109#[derive(Clone, Default, PartialEq)]
12110#[non_exhaustive]
12111pub struct DeleteInternalRangeRequest {
12112    /// Required. The name of the internal range to delete.
12113    pub name: std::string::String,
12114
12115    /// Optional. An optional request ID to identify requests. Specify a unique
12116    /// request ID so that if you must retry your request, the server will know to
12117    /// ignore the request if it has already been completed. The server will
12118    /// guarantee that for at least 60 minutes after the first request.
12119    ///
12120    /// For example, consider a situation where you make an initial request and
12121    /// the request times out. If you make the request again with the same request
12122    /// ID, the server can check if original operation with the same request ID
12123    /// was received, and if so, will ignore the second request. This prevents
12124    /// clients from accidentally creating duplicate commitments.
12125    ///
12126    /// The request ID must be a valid UUID with the exception that zero UUID is
12127    /// not supported (00000000-0000-0000-0000-000000000000).
12128    pub request_id: std::string::String,
12129
12130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12131}
12132
12133impl DeleteInternalRangeRequest {
12134    pub fn new() -> Self {
12135        std::default::Default::default()
12136    }
12137
12138    /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
12139    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12140        self.name = v.into();
12141        self
12142    }
12143
12144    /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
12145    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12146        self.request_id = v.into();
12147        self
12148    }
12149}
12150
12151impl wkt::message::Message for DeleteInternalRangeRequest {
12152    fn typename() -> &'static str {
12153        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
12154    }
12155}
12156
12157/// Policy-based routes route L4 network traffic based on not just destination IP
12158/// address, but also source IP address, protocol, and more. If a policy-based
12159/// route conflicts with other types of routes, the policy-based route always
12160/// takes precedence.
12161#[derive(Clone, Default, PartialEq)]
12162#[non_exhaustive]
12163pub struct PolicyBasedRoute {
12164    /// Immutable. A unique name of the resource in the form of
12165    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
12166    pub name: std::string::String,
12167
12168    /// Output only. Time when the policy-based route was created.
12169    pub create_time: std::option::Option<wkt::Timestamp>,
12170
12171    /// Output only. Time when the policy-based route was updated.
12172    pub update_time: std::option::Option<wkt::Timestamp>,
12173
12174    /// User-defined labels.
12175    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12176
12177    /// Optional. An optional description of this resource. Provide this field when
12178    /// you create the resource.
12179    pub description: std::string::String,
12180
12181    /// Required. Fully-qualified URL of the network that this route applies to,
12182    /// for example: projects/my-project/global/networks/my-network.
12183    pub network: std::string::String,
12184
12185    /// Required. The filter to match L4 traffic.
12186    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
12187
12188    /// Optional. The priority of this policy-based route. Priority is used to
12189    /// break ties in cases where there are more than one matching policy-based
12190    /// routes found. In cases where multiple policy-based routes are matched, the
12191    /// one with the lowest-numbered priority value wins. The default value is
12192    /// 1000. The priority value must be from 1 to 65535, inclusive.
12193    pub priority: i32,
12194
12195    /// Output only. If potential misconfigurations are detected for this route,
12196    /// this field will be populated with warning messages.
12197    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
12198
12199    /// Output only. Server-defined fully-qualified URL for this resource.
12200    pub self_link: std::string::String,
12201
12202    /// Output only. Type of this resource. Always
12203    /// networkconnectivity#policyBasedRoute for policy-based Route resources.
12204    pub kind: std::string::String,
12205
12206    /// Target specifies network endpoints that this policy-based route applies to.
12207    /// If no target is specified, the PBR will be installed on all network
12208    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
12209    pub target: std::option::Option<crate::model::policy_based_route::Target>,
12210
12211    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
12212
12213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12214}
12215
12216impl PolicyBasedRoute {
12217    pub fn new() -> Self {
12218        std::default::Default::default()
12219    }
12220
12221    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
12222    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12223        self.name = v.into();
12224        self
12225    }
12226
12227    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
12228    pub fn set_create_time<T>(mut self, v: T) -> Self
12229    where
12230        T: std::convert::Into<wkt::Timestamp>,
12231    {
12232        self.create_time = std::option::Option::Some(v.into());
12233        self
12234    }
12235
12236    /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
12237    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12238    where
12239        T: std::convert::Into<wkt::Timestamp>,
12240    {
12241        self.create_time = v.map(|x| x.into());
12242        self
12243    }
12244
12245    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
12246    pub fn set_update_time<T>(mut self, v: T) -> Self
12247    where
12248        T: std::convert::Into<wkt::Timestamp>,
12249    {
12250        self.update_time = std::option::Option::Some(v.into());
12251        self
12252    }
12253
12254    /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
12255    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12256    where
12257        T: std::convert::Into<wkt::Timestamp>,
12258    {
12259        self.update_time = v.map(|x| x.into());
12260        self
12261    }
12262
12263    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
12264    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12265    where
12266        T: std::iter::IntoIterator<Item = (K, V)>,
12267        K: std::convert::Into<std::string::String>,
12268        V: std::convert::Into<std::string::String>,
12269    {
12270        use std::iter::Iterator;
12271        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12272        self
12273    }
12274
12275    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
12276    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12277        self.description = v.into();
12278        self
12279    }
12280
12281    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
12282    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12283        self.network = v.into();
12284        self
12285    }
12286
12287    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
12288    pub fn set_filter<T>(mut self, v: T) -> Self
12289    where
12290        T: std::convert::Into<crate::model::policy_based_route::Filter>,
12291    {
12292        self.filter = std::option::Option::Some(v.into());
12293        self
12294    }
12295
12296    /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
12297    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12298    where
12299        T: std::convert::Into<crate::model::policy_based_route::Filter>,
12300    {
12301        self.filter = v.map(|x| x.into());
12302        self
12303    }
12304
12305    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
12306    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12307        self.priority = v.into();
12308        self
12309    }
12310
12311    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
12312    pub fn set_warnings<T, V>(mut self, v: T) -> Self
12313    where
12314        T: std::iter::IntoIterator<Item = V>,
12315        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
12316    {
12317        use std::iter::Iterator;
12318        self.warnings = v.into_iter().map(|i| i.into()).collect();
12319        self
12320    }
12321
12322    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
12323    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12324        self.self_link = v.into();
12325        self
12326    }
12327
12328    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
12329    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12330        self.kind = v.into();
12331        self
12332    }
12333
12334    /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
12335    ///
12336    /// Note that all the setters affecting `target` are mutually
12337    /// exclusive.
12338    pub fn set_target<
12339        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
12340    >(
12341        mut self,
12342        v: T,
12343    ) -> Self {
12344        self.target = v.into();
12345        self
12346    }
12347
12348    /// The value of [target][crate::model::PolicyBasedRoute::target]
12349    /// if it holds a `VirtualMachine`, `None` if the field is not set or
12350    /// holds a different branch.
12351    pub fn virtual_machine(
12352        &self,
12353    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
12354    {
12355        #[allow(unreachable_patterns)]
12356        self.target.as_ref().and_then(|v| match v {
12357            crate::model::policy_based_route::Target::VirtualMachine(v) => {
12358                std::option::Option::Some(v)
12359            }
12360            _ => std::option::Option::None,
12361        })
12362    }
12363
12364    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
12365    /// to hold a `VirtualMachine`.
12366    ///
12367    /// Note that all the setters affecting `target` are
12368    /// mutually exclusive.
12369    pub fn set_virtual_machine<
12370        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
12371    >(
12372        mut self,
12373        v: T,
12374    ) -> Self {
12375        self.target = std::option::Option::Some(
12376            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
12377        );
12378        self
12379    }
12380
12381    /// The value of [target][crate::model::PolicyBasedRoute::target]
12382    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
12383    /// holds a different branch.
12384    pub fn interconnect_attachment(
12385        &self,
12386    ) -> std::option::Option<
12387        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
12388    > {
12389        #[allow(unreachable_patterns)]
12390        self.target.as_ref().and_then(|v| match v {
12391            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
12392                std::option::Option::Some(v)
12393            }
12394            _ => std::option::Option::None,
12395        })
12396    }
12397
12398    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
12399    /// to hold a `InterconnectAttachment`.
12400    ///
12401    /// Note that all the setters affecting `target` are
12402    /// mutually exclusive.
12403    pub fn set_interconnect_attachment<
12404        T: std::convert::Into<
12405                std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
12406            >,
12407    >(
12408        mut self,
12409        v: T,
12410    ) -> Self {
12411        self.target = std::option::Option::Some(
12412            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
12413        );
12414        self
12415    }
12416
12417    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
12418    ///
12419    /// Note that all the setters affecting `next_hop` are mutually
12420    /// exclusive.
12421    pub fn set_next_hop<
12422        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
12423    >(
12424        mut self,
12425        v: T,
12426    ) -> Self {
12427        self.next_hop = v.into();
12428        self
12429    }
12430
12431    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
12432    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
12433    /// holds a different branch.
12434    pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
12435        #[allow(unreachable_patterns)]
12436        self.next_hop.as_ref().and_then(|v| match v {
12437            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
12438                std::option::Option::Some(v)
12439            }
12440            _ => std::option::Option::None,
12441        })
12442    }
12443
12444    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
12445    /// to hold a `NextHopIlbIp`.
12446    ///
12447    /// Note that all the setters affecting `next_hop` are
12448    /// mutually exclusive.
12449    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12450        self.next_hop = std::option::Option::Some(
12451            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
12452        );
12453        self
12454    }
12455
12456    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
12457    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
12458    /// holds a different branch.
12459    pub fn next_hop_other_routes(
12460        &self,
12461    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
12462        #[allow(unreachable_patterns)]
12463        self.next_hop.as_ref().and_then(|v| match v {
12464            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
12465                std::option::Option::Some(v)
12466            }
12467            _ => std::option::Option::None,
12468        })
12469    }
12470
12471    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
12472    /// to hold a `NextHopOtherRoutes`.
12473    ///
12474    /// Note that all the setters affecting `next_hop` are
12475    /// mutually exclusive.
12476    pub fn set_next_hop_other_routes<
12477        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
12478    >(
12479        mut self,
12480        v: T,
12481    ) -> Self {
12482        self.next_hop = std::option::Option::Some(
12483            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
12484        );
12485        self
12486    }
12487}
12488
12489impl wkt::message::Message for PolicyBasedRoute {
12490    fn typename() -> &'static str {
12491        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
12492    }
12493}
12494
12495/// Defines additional types related to [PolicyBasedRoute].
12496pub mod policy_based_route {
12497    #[allow(unused_imports)]
12498    use super::*;
12499
12500    /// VM instances that this policy-based route applies to.
12501    #[derive(Clone, Default, PartialEq)]
12502    #[non_exhaustive]
12503    pub struct VirtualMachine {
12504        /// Optional. A list of VM instance tags that this policy-based route applies
12505        /// to. VM instances that have ANY of tags specified here installs this PBR.
12506        pub tags: std::vec::Vec<std::string::String>,
12507
12508        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12509    }
12510
12511    impl VirtualMachine {
12512        pub fn new() -> Self {
12513            std::default::Default::default()
12514        }
12515
12516        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
12517        pub fn set_tags<T, V>(mut self, v: T) -> Self
12518        where
12519            T: std::iter::IntoIterator<Item = V>,
12520            V: std::convert::Into<std::string::String>,
12521        {
12522            use std::iter::Iterator;
12523            self.tags = v.into_iter().map(|i| i.into()).collect();
12524            self
12525        }
12526    }
12527
12528    impl wkt::message::Message for VirtualMachine {
12529        fn typename() -> &'static str {
12530            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
12531        }
12532    }
12533
12534    /// InterconnectAttachment that this route applies to.
12535    #[derive(Clone, Default, PartialEq)]
12536    #[non_exhaustive]
12537    pub struct InterconnectAttachment {
12538        /// Optional. Cloud region to install this policy-based route on interconnect
12539        /// attachment. Use `all` to install it on all interconnect attachments.
12540        pub region: std::string::String,
12541
12542        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12543    }
12544
12545    impl InterconnectAttachment {
12546        pub fn new() -> Self {
12547            std::default::Default::default()
12548        }
12549
12550        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
12551        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552            self.region = v.into();
12553            self
12554        }
12555    }
12556
12557    impl wkt::message::Message for InterconnectAttachment {
12558        fn typename() -> &'static str {
12559            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
12560        }
12561    }
12562
12563    /// Filter matches L4 traffic.
12564    #[derive(Clone, Default, PartialEq)]
12565    #[non_exhaustive]
12566    pub struct Filter {
12567        /// Optional. The IP protocol that this policy-based route applies to. Valid
12568        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
12569        pub ip_protocol: std::string::String,
12570
12571        /// Optional. The source IP range of outgoing packets that this policy-based
12572        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
12573        pub src_range: std::string::String,
12574
12575        /// Optional. The destination IP range of outgoing packets that this
12576        /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
12577        /// is IPv4.
12578        pub dest_range: std::string::String,
12579
12580        /// Required. Internet protocol versions this policy-based route applies to.
12581        /// For this version, only IPV4 is supported. IPV6 is supported in preview.
12582        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
12583
12584        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12585    }
12586
12587    impl Filter {
12588        pub fn new() -> Self {
12589            std::default::Default::default()
12590        }
12591
12592        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
12593        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12594            self.ip_protocol = v.into();
12595            self
12596        }
12597
12598        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
12599        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12600            self.src_range = v.into();
12601            self
12602        }
12603
12604        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
12605        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12606            self.dest_range = v.into();
12607            self
12608        }
12609
12610        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
12611        pub fn set_protocol_version<
12612            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
12613        >(
12614            mut self,
12615            v: T,
12616        ) -> Self {
12617            self.protocol_version = v.into();
12618            self
12619        }
12620    }
12621
12622    impl wkt::message::Message for Filter {
12623        fn typename() -> &'static str {
12624            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
12625        }
12626    }
12627
12628    /// Defines additional types related to [Filter].
12629    pub mod filter {
12630        #[allow(unused_imports)]
12631        use super::*;
12632
12633        /// The internet protocol version.
12634        ///
12635        /// # Working with unknown values
12636        ///
12637        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12638        /// additional enum variants at any time. Adding new variants is not considered
12639        /// a breaking change. Applications should write their code in anticipation of:
12640        ///
12641        /// - New values appearing in future releases of the client library, **and**
12642        /// - New values received dynamically, without application changes.
12643        ///
12644        /// Please consult the [Working with enums] section in the user guide for some
12645        /// guidelines.
12646        ///
12647        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12648        #[derive(Clone, Debug, PartialEq)]
12649        #[non_exhaustive]
12650        pub enum ProtocolVersion {
12651            /// Default value.
12652            Unspecified,
12653            /// The PBR is for IPv4 internet protocol traffic.
12654            Ipv4,
12655            /// If set, the enum was initialized with an unknown value.
12656            ///
12657            /// Applications can examine the value using [ProtocolVersion::value] or
12658            /// [ProtocolVersion::name].
12659            UnknownValue(protocol_version::UnknownValue),
12660        }
12661
12662        #[doc(hidden)]
12663        pub mod protocol_version {
12664            #[allow(unused_imports)]
12665            use super::*;
12666            #[derive(Clone, Debug, PartialEq)]
12667            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12668        }
12669
12670        impl ProtocolVersion {
12671            /// Gets the enum value.
12672            ///
12673            /// Returns `None` if the enum contains an unknown value deserialized from
12674            /// the string representation of enums.
12675            pub fn value(&self) -> std::option::Option<i32> {
12676                match self {
12677                    Self::Unspecified => std::option::Option::Some(0),
12678                    Self::Ipv4 => std::option::Option::Some(1),
12679                    Self::UnknownValue(u) => u.0.value(),
12680                }
12681            }
12682
12683            /// Gets the enum value as a string.
12684            ///
12685            /// Returns `None` if the enum contains an unknown value deserialized from
12686            /// the integer representation of enums.
12687            pub fn name(&self) -> std::option::Option<&str> {
12688                match self {
12689                    Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
12690                    Self::Ipv4 => std::option::Option::Some("IPV4"),
12691                    Self::UnknownValue(u) => u.0.name(),
12692                }
12693            }
12694        }
12695
12696        impl std::default::Default for ProtocolVersion {
12697            fn default() -> Self {
12698                use std::convert::From;
12699                Self::from(0)
12700            }
12701        }
12702
12703        impl std::fmt::Display for ProtocolVersion {
12704            fn fmt(
12705                &self,
12706                f: &mut std::fmt::Formatter<'_>,
12707            ) -> std::result::Result<(), std::fmt::Error> {
12708                wkt::internal::display_enum(f, self.name(), self.value())
12709            }
12710        }
12711
12712        impl std::convert::From<i32> for ProtocolVersion {
12713            fn from(value: i32) -> Self {
12714                match value {
12715                    0 => Self::Unspecified,
12716                    1 => Self::Ipv4,
12717                    _ => Self::UnknownValue(protocol_version::UnknownValue(
12718                        wkt::internal::UnknownEnumValue::Integer(value),
12719                    )),
12720                }
12721            }
12722        }
12723
12724        impl std::convert::From<&str> for ProtocolVersion {
12725            fn from(value: &str) -> Self {
12726                use std::string::ToString;
12727                match value {
12728                    "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
12729                    "IPV4" => Self::Ipv4,
12730                    _ => Self::UnknownValue(protocol_version::UnknownValue(
12731                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12732                    )),
12733                }
12734            }
12735        }
12736
12737        impl serde::ser::Serialize for ProtocolVersion {
12738            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12739            where
12740                S: serde::Serializer,
12741            {
12742                match self {
12743                    Self::Unspecified => serializer.serialize_i32(0),
12744                    Self::Ipv4 => serializer.serialize_i32(1),
12745                    Self::UnknownValue(u) => u.0.serialize(serializer),
12746                }
12747            }
12748        }
12749
12750        impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
12751            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12752            where
12753                D: serde::Deserializer<'de>,
12754            {
12755                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
12756                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
12757                ))
12758            }
12759        }
12760    }
12761
12762    /// Informational warning message.
12763    #[derive(Clone, Default, PartialEq)]
12764    #[non_exhaustive]
12765    pub struct Warnings {
12766        /// Output only. A warning code, if applicable.
12767        pub code: crate::model::policy_based_route::warnings::Code,
12768
12769        /// Output only. Metadata about this warning in key: value format. The key
12770        /// should provides more detail on the warning being returned. For example,
12771        /// for warnings where there are no results in a list request for a
12772        /// particular zone, this key might be scope and the key value might be the
12773        /// zone name. Other examples might be a key indicating a deprecated resource
12774        /// and a suggested replacement.
12775        pub data: std::collections::HashMap<std::string::String, std::string::String>,
12776
12777        /// Output only. A human-readable description of the warning code.
12778        pub warning_message: std::string::String,
12779
12780        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12781    }
12782
12783    impl Warnings {
12784        pub fn new() -> Self {
12785            std::default::Default::default()
12786        }
12787
12788        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
12789        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
12790            mut self,
12791            v: T,
12792        ) -> Self {
12793            self.code = v.into();
12794            self
12795        }
12796
12797        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
12798        pub fn set_data<T, K, V>(mut self, v: T) -> Self
12799        where
12800            T: std::iter::IntoIterator<Item = (K, V)>,
12801            K: std::convert::Into<std::string::String>,
12802            V: std::convert::Into<std::string::String>,
12803        {
12804            use std::iter::Iterator;
12805            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12806            self
12807        }
12808
12809        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
12810        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
12811            mut self,
12812            v: T,
12813        ) -> Self {
12814            self.warning_message = v.into();
12815            self
12816        }
12817    }
12818
12819    impl wkt::message::Message for Warnings {
12820        fn typename() -> &'static str {
12821            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
12822        }
12823    }
12824
12825    /// Defines additional types related to [Warnings].
12826    pub mod warnings {
12827        #[allow(unused_imports)]
12828        use super::*;
12829
12830        /// Warning code for policy-based routing. Expect to add values in the
12831        /// future.
12832        ///
12833        /// # Working with unknown values
12834        ///
12835        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12836        /// additional enum variants at any time. Adding new variants is not considered
12837        /// a breaking change. Applications should write their code in anticipation of:
12838        ///
12839        /// - New values appearing in future releases of the client library, **and**
12840        /// - New values received dynamically, without application changes.
12841        ///
12842        /// Please consult the [Working with enums] section in the user guide for some
12843        /// guidelines.
12844        ///
12845        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12846        #[derive(Clone, Debug, PartialEq)]
12847        #[non_exhaustive]
12848        pub enum Code {
12849            /// Default value.
12850            WarningUnspecified,
12851            /// The policy-based route is not active and functioning. Common causes are
12852            /// that the dependent network was deleted or the resource project was
12853            /// turned off.
12854            ResourceNotActive,
12855            /// The policy-based route is being modified (e.g. created/deleted) at this
12856            /// time.
12857            ResourceBeingModified,
12858            /// If set, the enum was initialized with an unknown value.
12859            ///
12860            /// Applications can examine the value using [Code::value] or
12861            /// [Code::name].
12862            UnknownValue(code::UnknownValue),
12863        }
12864
12865        #[doc(hidden)]
12866        pub mod code {
12867            #[allow(unused_imports)]
12868            use super::*;
12869            #[derive(Clone, Debug, PartialEq)]
12870            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12871        }
12872
12873        impl Code {
12874            /// Gets the enum value.
12875            ///
12876            /// Returns `None` if the enum contains an unknown value deserialized from
12877            /// the string representation of enums.
12878            pub fn value(&self) -> std::option::Option<i32> {
12879                match self {
12880                    Self::WarningUnspecified => std::option::Option::Some(0),
12881                    Self::ResourceNotActive => std::option::Option::Some(1),
12882                    Self::ResourceBeingModified => std::option::Option::Some(2),
12883                    Self::UnknownValue(u) => u.0.value(),
12884                }
12885            }
12886
12887            /// Gets the enum value as a string.
12888            ///
12889            /// Returns `None` if the enum contains an unknown value deserialized from
12890            /// the integer representation of enums.
12891            pub fn name(&self) -> std::option::Option<&str> {
12892                match self {
12893                    Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
12894                    Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
12895                    Self::ResourceBeingModified => {
12896                        std::option::Option::Some("RESOURCE_BEING_MODIFIED")
12897                    }
12898                    Self::UnknownValue(u) => u.0.name(),
12899                }
12900            }
12901        }
12902
12903        impl std::default::Default for Code {
12904            fn default() -> Self {
12905                use std::convert::From;
12906                Self::from(0)
12907            }
12908        }
12909
12910        impl std::fmt::Display for Code {
12911            fn fmt(
12912                &self,
12913                f: &mut std::fmt::Formatter<'_>,
12914            ) -> std::result::Result<(), std::fmt::Error> {
12915                wkt::internal::display_enum(f, self.name(), self.value())
12916            }
12917        }
12918
12919        impl std::convert::From<i32> for Code {
12920            fn from(value: i32) -> Self {
12921                match value {
12922                    0 => Self::WarningUnspecified,
12923                    1 => Self::ResourceNotActive,
12924                    2 => Self::ResourceBeingModified,
12925                    _ => Self::UnknownValue(code::UnknownValue(
12926                        wkt::internal::UnknownEnumValue::Integer(value),
12927                    )),
12928                }
12929            }
12930        }
12931
12932        impl std::convert::From<&str> for Code {
12933            fn from(value: &str) -> Self {
12934                use std::string::ToString;
12935                match value {
12936                    "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
12937                    "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
12938                    "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
12939                    _ => Self::UnknownValue(code::UnknownValue(
12940                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12941                    )),
12942                }
12943            }
12944        }
12945
12946        impl serde::ser::Serialize for Code {
12947            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12948            where
12949                S: serde::Serializer,
12950            {
12951                match self {
12952                    Self::WarningUnspecified => serializer.serialize_i32(0),
12953                    Self::ResourceNotActive => serializer.serialize_i32(1),
12954                    Self::ResourceBeingModified => serializer.serialize_i32(2),
12955                    Self::UnknownValue(u) => u.0.serialize(serializer),
12956                }
12957            }
12958        }
12959
12960        impl<'de> serde::de::Deserialize<'de> for Code {
12961            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12962            where
12963                D: serde::Deserializer<'de>,
12964            {
12965                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
12966                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
12967                ))
12968            }
12969        }
12970    }
12971
12972    /// The other routing cases.
12973    ///
12974    /// # Working with unknown values
12975    ///
12976    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12977    /// additional enum variants at any time. Adding new variants is not considered
12978    /// a breaking change. Applications should write their code in anticipation of:
12979    ///
12980    /// - New values appearing in future releases of the client library, **and**
12981    /// - New values received dynamically, without application changes.
12982    ///
12983    /// Please consult the [Working with enums] section in the user guide for some
12984    /// guidelines.
12985    ///
12986    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12987    #[derive(Clone, Debug, PartialEq)]
12988    #[non_exhaustive]
12989    pub enum OtherRoutes {
12990        /// Default value.
12991        Unspecified,
12992        /// Use the routes from the default routing tables (system-generated routes,
12993        /// custom routes, peering route) to determine the next hop. This effectively
12994        /// excludes matching packets being applied on other PBRs with a lower
12995        /// priority.
12996        DefaultRouting,
12997        /// If set, the enum was initialized with an unknown value.
12998        ///
12999        /// Applications can examine the value using [OtherRoutes::value] or
13000        /// [OtherRoutes::name].
13001        UnknownValue(other_routes::UnknownValue),
13002    }
13003
13004    #[doc(hidden)]
13005    pub mod other_routes {
13006        #[allow(unused_imports)]
13007        use super::*;
13008        #[derive(Clone, Debug, PartialEq)]
13009        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13010    }
13011
13012    impl OtherRoutes {
13013        /// Gets the enum value.
13014        ///
13015        /// Returns `None` if the enum contains an unknown value deserialized from
13016        /// the string representation of enums.
13017        pub fn value(&self) -> std::option::Option<i32> {
13018            match self {
13019                Self::Unspecified => std::option::Option::Some(0),
13020                Self::DefaultRouting => std::option::Option::Some(1),
13021                Self::UnknownValue(u) => u.0.value(),
13022            }
13023        }
13024
13025        /// Gets the enum value as a string.
13026        ///
13027        /// Returns `None` if the enum contains an unknown value deserialized from
13028        /// the integer representation of enums.
13029        pub fn name(&self) -> std::option::Option<&str> {
13030            match self {
13031                Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
13032                Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
13033                Self::UnknownValue(u) => u.0.name(),
13034            }
13035        }
13036    }
13037
13038    impl std::default::Default for OtherRoutes {
13039        fn default() -> Self {
13040            use std::convert::From;
13041            Self::from(0)
13042        }
13043    }
13044
13045    impl std::fmt::Display for OtherRoutes {
13046        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13047            wkt::internal::display_enum(f, self.name(), self.value())
13048        }
13049    }
13050
13051    impl std::convert::From<i32> for OtherRoutes {
13052        fn from(value: i32) -> Self {
13053            match value {
13054                0 => Self::Unspecified,
13055                1 => Self::DefaultRouting,
13056                _ => Self::UnknownValue(other_routes::UnknownValue(
13057                    wkt::internal::UnknownEnumValue::Integer(value),
13058                )),
13059            }
13060        }
13061    }
13062
13063    impl std::convert::From<&str> for OtherRoutes {
13064        fn from(value: &str) -> Self {
13065            use std::string::ToString;
13066            match value {
13067                "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
13068                "DEFAULT_ROUTING" => Self::DefaultRouting,
13069                _ => Self::UnknownValue(other_routes::UnknownValue(
13070                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13071                )),
13072            }
13073        }
13074    }
13075
13076    impl serde::ser::Serialize for OtherRoutes {
13077        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13078        where
13079            S: serde::Serializer,
13080        {
13081            match self {
13082                Self::Unspecified => serializer.serialize_i32(0),
13083                Self::DefaultRouting => serializer.serialize_i32(1),
13084                Self::UnknownValue(u) => u.0.serialize(serializer),
13085            }
13086        }
13087    }
13088
13089    impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
13090        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13091        where
13092            D: serde::Deserializer<'de>,
13093        {
13094            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
13095                ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
13096            ))
13097        }
13098    }
13099
13100    /// Target specifies network endpoints that this policy-based route applies to.
13101    /// If no target is specified, the PBR will be installed on all network
13102    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
13103    #[derive(Clone, Debug, PartialEq)]
13104    #[non_exhaustive]
13105    pub enum Target {
13106        /// Optional. VM instances that this policy-based route applies to.
13107        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
13108        /// Optional. The interconnect attachments that this policy-based route
13109        /// applies to.
13110        InterconnectAttachment(
13111            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
13112        ),
13113    }
13114
13115    #[derive(Clone, Debug, PartialEq)]
13116    #[non_exhaustive]
13117    pub enum NextHop {
13118        /// Optional. The IP address of a global-access-enabled L4 ILB that is the
13119        /// next hop for matching packets. For this version, only nextHopIlbIp is
13120        /// supported.
13121        NextHopIlbIp(std::string::String),
13122        /// Optional. Other routes that will be referenced to determine the next hop
13123        /// of the packet.
13124        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
13125    }
13126}
13127
13128/// Request for
13129/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
13130/// method.
13131///
13132/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
13133#[derive(Clone, Default, PartialEq)]
13134#[non_exhaustive]
13135pub struct ListPolicyBasedRoutesRequest {
13136    /// Required. The parent resource's name.
13137    pub parent: std::string::String,
13138
13139    /// The maximum number of results per page that should be returned.
13140    pub page_size: i32,
13141
13142    /// The page token.
13143    pub page_token: std::string::String,
13144
13145    /// A filter expression that filters the results listed in the response.
13146    pub filter: std::string::String,
13147
13148    /// Sort the results by a certain order.
13149    pub order_by: std::string::String,
13150
13151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13152}
13153
13154impl ListPolicyBasedRoutesRequest {
13155    pub fn new() -> Self {
13156        std::default::Default::default()
13157    }
13158
13159    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
13160    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13161        self.parent = v.into();
13162        self
13163    }
13164
13165    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
13166    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13167        self.page_size = v.into();
13168        self
13169    }
13170
13171    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
13172    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13173        self.page_token = v.into();
13174        self
13175    }
13176
13177    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
13178    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13179        self.filter = v.into();
13180        self
13181    }
13182
13183    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
13184    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13185        self.order_by = v.into();
13186        self
13187    }
13188}
13189
13190impl wkt::message::Message for ListPolicyBasedRoutesRequest {
13191    fn typename() -> &'static str {
13192        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
13193    }
13194}
13195
13196/// Response for
13197/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
13198/// method.
13199///
13200/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
13201#[derive(Clone, Default, PartialEq)]
13202#[non_exhaustive]
13203pub struct ListPolicyBasedRoutesResponse {
13204    /// Policy-based routes to be returned.
13205    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
13206
13207    /// The next pagination token in the List response. It should be used as
13208    /// page_token for the following request. An empty value means no more result.
13209    pub next_page_token: std::string::String,
13210
13211    /// Locations that could not be reached.
13212    pub unreachable: std::vec::Vec<std::string::String>,
13213
13214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13215}
13216
13217impl ListPolicyBasedRoutesResponse {
13218    pub fn new() -> Self {
13219        std::default::Default::default()
13220    }
13221
13222    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
13223    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
13224    where
13225        T: std::iter::IntoIterator<Item = V>,
13226        V: std::convert::Into<crate::model::PolicyBasedRoute>,
13227    {
13228        use std::iter::Iterator;
13229        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
13230        self
13231    }
13232
13233    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
13234    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13235        self.next_page_token = v.into();
13236        self
13237    }
13238
13239    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
13240    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13241    where
13242        T: std::iter::IntoIterator<Item = V>,
13243        V: std::convert::Into<std::string::String>,
13244    {
13245        use std::iter::Iterator;
13246        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13247        self
13248    }
13249}
13250
13251impl wkt::message::Message for ListPolicyBasedRoutesResponse {
13252    fn typename() -> &'static str {
13253        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
13254    }
13255}
13256
13257#[doc(hidden)]
13258impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
13259    type PageItem = crate::model::PolicyBasedRoute;
13260
13261    fn items(self) -> std::vec::Vec<Self::PageItem> {
13262        self.policy_based_routes
13263    }
13264
13265    fn next_page_token(&self) -> std::string::String {
13266        use std::clone::Clone;
13267        self.next_page_token.clone()
13268    }
13269}
13270
13271/// Request for
13272/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
13273/// method.
13274///
13275/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
13276#[derive(Clone, Default, PartialEq)]
13277#[non_exhaustive]
13278pub struct GetPolicyBasedRouteRequest {
13279    /// Required. Name of the PolicyBasedRoute resource to get.
13280    pub name: std::string::String,
13281
13282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13283}
13284
13285impl GetPolicyBasedRouteRequest {
13286    pub fn new() -> Self {
13287        std::default::Default::default()
13288    }
13289
13290    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
13291    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13292        self.name = v.into();
13293        self
13294    }
13295}
13296
13297impl wkt::message::Message for GetPolicyBasedRouteRequest {
13298    fn typename() -> &'static str {
13299        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
13300    }
13301}
13302
13303/// Request for
13304/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
13305/// method.
13306///
13307/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
13308#[derive(Clone, Default, PartialEq)]
13309#[non_exhaustive]
13310pub struct CreatePolicyBasedRouteRequest {
13311    /// Required. The parent resource's name of the PolicyBasedRoute.
13312    pub parent: std::string::String,
13313
13314    /// Required. Unique id for the policy-based route to create. Provided by the
13315    /// client when the resource is created. The name must comply with
13316    /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
13317    /// must be 1-63 characters long and match the regular expression
13318    /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
13319    /// and all following characters (except for the last character) must be a
13320    /// dash, lowercase letter, or digit. The last character must be a lowercase
13321    /// letter or digit.
13322    pub policy_based_route_id: std::string::String,
13323
13324    /// Required. Initial values for a new policy-based route.
13325    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
13326
13327    /// Optional. An optional request ID to identify requests. Specify a unique
13328    /// request ID so that if you must retry your request, the server knows to
13329    /// ignore the request if it has already been completed. The server guarantees
13330    /// that for at least 60 minutes since the first request.
13331    ///
13332    /// For example, consider a situation where you make an initial request and
13333    /// the request times out. If you make the request again with the same request
13334    /// ID, the server can check if original operation with the same request ID
13335    /// was received, and if so, ignores the second request. This prevents clients
13336    /// from accidentally creating duplicate commitments.
13337    ///
13338    /// The request ID must be a valid UUID with the exception that zero UUID is
13339    /// not supported (00000000-0000-0000-0000-000000000000).
13340    pub request_id: std::string::String,
13341
13342    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13343}
13344
13345impl CreatePolicyBasedRouteRequest {
13346    pub fn new() -> Self {
13347        std::default::Default::default()
13348    }
13349
13350    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
13351    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13352        self.parent = v.into();
13353        self
13354    }
13355
13356    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
13357    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
13358        mut self,
13359        v: T,
13360    ) -> Self {
13361        self.policy_based_route_id = v.into();
13362        self
13363    }
13364
13365    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
13366    pub fn set_policy_based_route<T>(mut self, v: T) -> Self
13367    where
13368        T: std::convert::Into<crate::model::PolicyBasedRoute>,
13369    {
13370        self.policy_based_route = std::option::Option::Some(v.into());
13371        self
13372    }
13373
13374    /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
13375    pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
13376    where
13377        T: std::convert::Into<crate::model::PolicyBasedRoute>,
13378    {
13379        self.policy_based_route = v.map(|x| x.into());
13380        self
13381    }
13382
13383    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
13384    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13385        self.request_id = v.into();
13386        self
13387    }
13388}
13389
13390impl wkt::message::Message for CreatePolicyBasedRouteRequest {
13391    fn typename() -> &'static str {
13392        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
13393    }
13394}
13395
13396/// Request for
13397/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
13398/// method.
13399///
13400/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
13401#[derive(Clone, Default, PartialEq)]
13402#[non_exhaustive]
13403pub struct DeletePolicyBasedRouteRequest {
13404    /// Required. Name of the policy-based route resource to delete.
13405    pub name: std::string::String,
13406
13407    /// Optional. An optional request ID to identify requests. Specify a unique
13408    /// request ID so that if you must retry your request, the server knows to
13409    /// ignore the request if it has already been completed. The server guarantees
13410    /// that for at least 60 minutes after the first request.
13411    ///
13412    /// For example, consider a situation where you make an initial request and
13413    /// the request times out. If you make the request again with the same request
13414    /// ID, the server can check if original operation with the same request ID
13415    /// was received, and if so, ignores the second request. This prevents clients
13416    /// from accidentally creating duplicate commitments.
13417    ///
13418    /// The request ID must be a valid UUID with the exception that zero UUID is
13419    /// not supported (00000000-0000-0000-0000-000000000000).
13420    pub request_id: std::string::String,
13421
13422    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13423}
13424
13425impl DeletePolicyBasedRouteRequest {
13426    pub fn new() -> Self {
13427        std::default::Default::default()
13428    }
13429
13430    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
13431    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13432        self.name = v.into();
13433        self
13434    }
13435
13436    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
13437    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13438        self.request_id = v.into();
13439        self
13440    }
13441}
13442
13443impl wkt::message::Message for DeletePolicyBasedRouteRequest {
13444    fn typename() -> &'static str {
13445        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
13446    }
13447}
13448
13449/// The infrastructure used for connections between consumers/producers.
13450///
13451/// # Working with unknown values
13452///
13453/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13454/// additional enum variants at any time. Adding new variants is not considered
13455/// a breaking change. Applications should write their code in anticipation of:
13456///
13457/// - New values appearing in future releases of the client library, **and**
13458/// - New values received dynamically, without application changes.
13459///
13460/// Please consult the [Working with enums] section in the user guide for some
13461/// guidelines.
13462///
13463/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13464#[derive(Clone, Debug, PartialEq)]
13465#[non_exhaustive]
13466pub enum Infrastructure {
13467    /// An invalid infrastructure as the default case.
13468    Unspecified,
13469    /// Private Service Connect is used for connections.
13470    Psc,
13471    /// If set, the enum was initialized with an unknown value.
13472    ///
13473    /// Applications can examine the value using [Infrastructure::value] or
13474    /// [Infrastructure::name].
13475    UnknownValue(infrastructure::UnknownValue),
13476}
13477
13478#[doc(hidden)]
13479pub mod infrastructure {
13480    #[allow(unused_imports)]
13481    use super::*;
13482    #[derive(Clone, Debug, PartialEq)]
13483    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13484}
13485
13486impl Infrastructure {
13487    /// Gets the enum value.
13488    ///
13489    /// Returns `None` if the enum contains an unknown value deserialized from
13490    /// the string representation of enums.
13491    pub fn value(&self) -> std::option::Option<i32> {
13492        match self {
13493            Self::Unspecified => std::option::Option::Some(0),
13494            Self::Psc => std::option::Option::Some(1),
13495            Self::UnknownValue(u) => u.0.value(),
13496        }
13497    }
13498
13499    /// Gets the enum value as a string.
13500    ///
13501    /// Returns `None` if the enum contains an unknown value deserialized from
13502    /// the integer representation of enums.
13503    pub fn name(&self) -> std::option::Option<&str> {
13504        match self {
13505            Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
13506            Self::Psc => std::option::Option::Some("PSC"),
13507            Self::UnknownValue(u) => u.0.name(),
13508        }
13509    }
13510}
13511
13512impl std::default::Default for Infrastructure {
13513    fn default() -> Self {
13514        use std::convert::From;
13515        Self::from(0)
13516    }
13517}
13518
13519impl std::fmt::Display for Infrastructure {
13520    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13521        wkt::internal::display_enum(f, self.name(), self.value())
13522    }
13523}
13524
13525impl std::convert::From<i32> for Infrastructure {
13526    fn from(value: i32) -> Self {
13527        match value {
13528            0 => Self::Unspecified,
13529            1 => Self::Psc,
13530            _ => Self::UnknownValue(infrastructure::UnknownValue(
13531                wkt::internal::UnknownEnumValue::Integer(value),
13532            )),
13533        }
13534    }
13535}
13536
13537impl std::convert::From<&str> for Infrastructure {
13538    fn from(value: &str) -> Self {
13539        use std::string::ToString;
13540        match value {
13541            "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
13542            "PSC" => Self::Psc,
13543            _ => Self::UnknownValue(infrastructure::UnknownValue(
13544                wkt::internal::UnknownEnumValue::String(value.to_string()),
13545            )),
13546        }
13547    }
13548}
13549
13550impl serde::ser::Serialize for Infrastructure {
13551    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13552    where
13553        S: serde::Serializer,
13554    {
13555        match self {
13556            Self::Unspecified => serializer.serialize_i32(0),
13557            Self::Psc => serializer.serialize_i32(1),
13558            Self::UnknownValue(u) => u.0.serialize(serializer),
13559        }
13560    }
13561}
13562
13563impl<'de> serde::de::Deserialize<'de> for Infrastructure {
13564    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13565    where
13566        D: serde::Deserializer<'de>,
13567    {
13568        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
13569            ".google.cloud.networkconnectivity.v1.Infrastructure",
13570        ))
13571    }
13572}
13573
13574/// The error type indicates whether a connection error is consumer facing,
13575/// producer facing or system internal.
13576///
13577/// # Working with unknown values
13578///
13579/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13580/// additional enum variants at any time. Adding new variants is not considered
13581/// a breaking change. Applications should write their code in anticipation of:
13582///
13583/// - New values appearing in future releases of the client library, **and**
13584/// - New values received dynamically, without application changes.
13585///
13586/// Please consult the [Working with enums] section in the user guide for some
13587/// guidelines.
13588///
13589/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13590#[derive(Clone, Debug, PartialEq)]
13591#[non_exhaustive]
13592pub enum ConnectionErrorType {
13593    /// An invalid error type as the default case.
13594    Unspecified,
13595    /// The error is due to Service Automation system internal.
13596    ErrorInternal,
13597    /// The error is due to the setup on consumer side.
13598    ErrorConsumerSide,
13599    /// The error is due to the setup on producer side.
13600    ErrorProducerSide,
13601    /// If set, the enum was initialized with an unknown value.
13602    ///
13603    /// Applications can examine the value using [ConnectionErrorType::value] or
13604    /// [ConnectionErrorType::name].
13605    UnknownValue(connection_error_type::UnknownValue),
13606}
13607
13608#[doc(hidden)]
13609pub mod connection_error_type {
13610    #[allow(unused_imports)]
13611    use super::*;
13612    #[derive(Clone, Debug, PartialEq)]
13613    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13614}
13615
13616impl ConnectionErrorType {
13617    /// Gets the enum value.
13618    ///
13619    /// Returns `None` if the enum contains an unknown value deserialized from
13620    /// the string representation of enums.
13621    pub fn value(&self) -> std::option::Option<i32> {
13622        match self {
13623            Self::Unspecified => std::option::Option::Some(0),
13624            Self::ErrorInternal => std::option::Option::Some(1),
13625            Self::ErrorConsumerSide => std::option::Option::Some(2),
13626            Self::ErrorProducerSide => std::option::Option::Some(3),
13627            Self::UnknownValue(u) => u.0.value(),
13628        }
13629    }
13630
13631    /// Gets the enum value as a string.
13632    ///
13633    /// Returns `None` if the enum contains an unknown value deserialized from
13634    /// the integer representation of enums.
13635    pub fn name(&self) -> std::option::Option<&str> {
13636        match self {
13637            Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
13638            Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
13639            Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
13640            Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
13641            Self::UnknownValue(u) => u.0.name(),
13642        }
13643    }
13644}
13645
13646impl std::default::Default for ConnectionErrorType {
13647    fn default() -> Self {
13648        use std::convert::From;
13649        Self::from(0)
13650    }
13651}
13652
13653impl std::fmt::Display for ConnectionErrorType {
13654    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13655        wkt::internal::display_enum(f, self.name(), self.value())
13656    }
13657}
13658
13659impl std::convert::From<i32> for ConnectionErrorType {
13660    fn from(value: i32) -> Self {
13661        match value {
13662            0 => Self::Unspecified,
13663            1 => Self::ErrorInternal,
13664            2 => Self::ErrorConsumerSide,
13665            3 => Self::ErrorProducerSide,
13666            _ => Self::UnknownValue(connection_error_type::UnknownValue(
13667                wkt::internal::UnknownEnumValue::Integer(value),
13668            )),
13669        }
13670    }
13671}
13672
13673impl std::convert::From<&str> for ConnectionErrorType {
13674    fn from(value: &str) -> Self {
13675        use std::string::ToString;
13676        match value {
13677            "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
13678            "ERROR_INTERNAL" => Self::ErrorInternal,
13679            "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
13680            "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
13681            _ => Self::UnknownValue(connection_error_type::UnknownValue(
13682                wkt::internal::UnknownEnumValue::String(value.to_string()),
13683            )),
13684        }
13685    }
13686}
13687
13688impl serde::ser::Serialize for ConnectionErrorType {
13689    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13690    where
13691        S: serde::Serializer,
13692    {
13693        match self {
13694            Self::Unspecified => serializer.serialize_i32(0),
13695            Self::ErrorInternal => serializer.serialize_i32(1),
13696            Self::ErrorConsumerSide => serializer.serialize_i32(2),
13697            Self::ErrorProducerSide => serializer.serialize_i32(3),
13698            Self::UnknownValue(u) => u.0.serialize(serializer),
13699        }
13700    }
13701}
13702
13703impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
13704    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13705    where
13706        D: serde::Deserializer<'de>,
13707    {
13708        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
13709            ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
13710        ))
13711    }
13712}
13713
13714/// The requested IP version for the PSC connection.
13715///
13716/// # Working with unknown values
13717///
13718/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13719/// additional enum variants at any time. Adding new variants is not considered
13720/// a breaking change. Applications should write their code in anticipation of:
13721///
13722/// - New values appearing in future releases of the client library, **and**
13723/// - New values received dynamically, without application changes.
13724///
13725/// Please consult the [Working with enums] section in the user guide for some
13726/// guidelines.
13727///
13728/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13729#[derive(Clone, Debug, PartialEq)]
13730#[non_exhaustive]
13731pub enum IPVersion {
13732    /// Default value. We will use IPv4 or IPv6 depending on the IP version of
13733    /// first available subnetwork.
13734    Unspecified,
13735    /// Will use IPv4 only.
13736    Ipv4,
13737    /// Will use IPv6 only.
13738    Ipv6,
13739    /// If set, the enum was initialized with an unknown value.
13740    ///
13741    /// Applications can examine the value using [IPVersion::value] or
13742    /// [IPVersion::name].
13743    UnknownValue(ip_version::UnknownValue),
13744}
13745
13746#[doc(hidden)]
13747pub mod ip_version {
13748    #[allow(unused_imports)]
13749    use super::*;
13750    #[derive(Clone, Debug, PartialEq)]
13751    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13752}
13753
13754impl IPVersion {
13755    /// Gets the enum value.
13756    ///
13757    /// Returns `None` if the enum contains an unknown value deserialized from
13758    /// the string representation of enums.
13759    pub fn value(&self) -> std::option::Option<i32> {
13760        match self {
13761            Self::Unspecified => std::option::Option::Some(0),
13762            Self::Ipv4 => std::option::Option::Some(1),
13763            Self::Ipv6 => std::option::Option::Some(2),
13764            Self::UnknownValue(u) => u.0.value(),
13765        }
13766    }
13767
13768    /// Gets the enum value as a string.
13769    ///
13770    /// Returns `None` if the enum contains an unknown value deserialized from
13771    /// the integer representation of enums.
13772    pub fn name(&self) -> std::option::Option<&str> {
13773        match self {
13774            Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
13775            Self::Ipv4 => std::option::Option::Some("IPV4"),
13776            Self::Ipv6 => std::option::Option::Some("IPV6"),
13777            Self::UnknownValue(u) => u.0.name(),
13778        }
13779    }
13780}
13781
13782impl std::default::Default for IPVersion {
13783    fn default() -> Self {
13784        use std::convert::From;
13785        Self::from(0)
13786    }
13787}
13788
13789impl std::fmt::Display for IPVersion {
13790    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13791        wkt::internal::display_enum(f, self.name(), self.value())
13792    }
13793}
13794
13795impl std::convert::From<i32> for IPVersion {
13796    fn from(value: i32) -> Self {
13797        match value {
13798            0 => Self::Unspecified,
13799            1 => Self::Ipv4,
13800            2 => Self::Ipv6,
13801            _ => Self::UnknownValue(ip_version::UnknownValue(
13802                wkt::internal::UnknownEnumValue::Integer(value),
13803            )),
13804        }
13805    }
13806}
13807
13808impl std::convert::From<&str> for IPVersion {
13809    fn from(value: &str) -> Self {
13810        use std::string::ToString;
13811        match value {
13812            "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
13813            "IPV4" => Self::Ipv4,
13814            "IPV6" => Self::Ipv6,
13815            _ => Self::UnknownValue(ip_version::UnknownValue(
13816                wkt::internal::UnknownEnumValue::String(value.to_string()),
13817            )),
13818        }
13819    }
13820}
13821
13822impl serde::ser::Serialize for IPVersion {
13823    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13824    where
13825        S: serde::Serializer,
13826    {
13827        match self {
13828            Self::Unspecified => serializer.serialize_i32(0),
13829            Self::Ipv4 => serializer.serialize_i32(1),
13830            Self::Ipv6 => serializer.serialize_i32(2),
13831            Self::UnknownValue(u) => u.0.serialize(serializer),
13832        }
13833    }
13834}
13835
13836impl<'de> serde::de::Deserialize<'de> for IPVersion {
13837    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13838    where
13839        D: serde::Deserializer<'de>,
13840    {
13841        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
13842            ".google.cloud.networkconnectivity.v1.IPVersion",
13843        ))
13844    }
13845}
13846
13847/// Supported features for a location
13848///
13849/// # Working with unknown values
13850///
13851/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13852/// additional enum variants at any time. Adding new variants is not considered
13853/// a breaking change. Applications should write their code in anticipation of:
13854///
13855/// - New values appearing in future releases of the client library, **and**
13856/// - New values received dynamically, without application changes.
13857///
13858/// Please consult the [Working with enums] section in the user guide for some
13859/// guidelines.
13860///
13861/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13862#[derive(Clone, Debug, PartialEq)]
13863#[non_exhaustive]
13864pub enum LocationFeature {
13865    /// No publicly supported feature in this location
13866    Unspecified,
13867    /// Site-to-cloud spokes are supported in this location
13868    SiteToCloudSpokes,
13869    /// Site-to-site spokes are supported in this location
13870    SiteToSiteSpokes,
13871    /// If set, the enum was initialized with an unknown value.
13872    ///
13873    /// Applications can examine the value using [LocationFeature::value] or
13874    /// [LocationFeature::name].
13875    UnknownValue(location_feature::UnknownValue),
13876}
13877
13878#[doc(hidden)]
13879pub mod location_feature {
13880    #[allow(unused_imports)]
13881    use super::*;
13882    #[derive(Clone, Debug, PartialEq)]
13883    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13884}
13885
13886impl LocationFeature {
13887    /// Gets the enum value.
13888    ///
13889    /// Returns `None` if the enum contains an unknown value deserialized from
13890    /// the string representation of enums.
13891    pub fn value(&self) -> std::option::Option<i32> {
13892        match self {
13893            Self::Unspecified => std::option::Option::Some(0),
13894            Self::SiteToCloudSpokes => std::option::Option::Some(1),
13895            Self::SiteToSiteSpokes => std::option::Option::Some(2),
13896            Self::UnknownValue(u) => u.0.value(),
13897        }
13898    }
13899
13900    /// Gets the enum value as a string.
13901    ///
13902    /// Returns `None` if the enum contains an unknown value deserialized from
13903    /// the integer representation of enums.
13904    pub fn name(&self) -> std::option::Option<&str> {
13905        match self {
13906            Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
13907            Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
13908            Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
13909            Self::UnknownValue(u) => u.0.name(),
13910        }
13911    }
13912}
13913
13914impl std::default::Default for LocationFeature {
13915    fn default() -> Self {
13916        use std::convert::From;
13917        Self::from(0)
13918    }
13919}
13920
13921impl std::fmt::Display for LocationFeature {
13922    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13923        wkt::internal::display_enum(f, self.name(), self.value())
13924    }
13925}
13926
13927impl std::convert::From<i32> for LocationFeature {
13928    fn from(value: i32) -> Self {
13929        match value {
13930            0 => Self::Unspecified,
13931            1 => Self::SiteToCloudSpokes,
13932            2 => Self::SiteToSiteSpokes,
13933            _ => Self::UnknownValue(location_feature::UnknownValue(
13934                wkt::internal::UnknownEnumValue::Integer(value),
13935            )),
13936        }
13937    }
13938}
13939
13940impl std::convert::From<&str> for LocationFeature {
13941    fn from(value: &str) -> Self {
13942        use std::string::ToString;
13943        match value {
13944            "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
13945            "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
13946            "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
13947            _ => Self::UnknownValue(location_feature::UnknownValue(
13948                wkt::internal::UnknownEnumValue::String(value.to_string()),
13949            )),
13950        }
13951    }
13952}
13953
13954impl serde::ser::Serialize for LocationFeature {
13955    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13956    where
13957        S: serde::Serializer,
13958    {
13959        match self {
13960            Self::Unspecified => serializer.serialize_i32(0),
13961            Self::SiteToCloudSpokes => serializer.serialize_i32(1),
13962            Self::SiteToSiteSpokes => serializer.serialize_i32(2),
13963            Self::UnknownValue(u) => u.0.serialize(serializer),
13964        }
13965    }
13966}
13967
13968impl<'de> serde::de::Deserialize<'de> for LocationFeature {
13969    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13970    where
13971        D: serde::Deserializer<'de>,
13972    {
13973        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
13974            ".google.cloud.networkconnectivity.v1.LocationFeature",
13975        ))
13976    }
13977}
13978
13979/// The route's type
13980///
13981/// # Working with unknown values
13982///
13983/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13984/// additional enum variants at any time. Adding new variants is not considered
13985/// a breaking change. Applications should write their code in anticipation of:
13986///
13987/// - New values appearing in future releases of the client library, **and**
13988/// - New values received dynamically, without application changes.
13989///
13990/// Please consult the [Working with enums] section in the user guide for some
13991/// guidelines.
13992///
13993/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13994#[derive(Clone, Debug, PartialEq)]
13995#[non_exhaustive]
13996pub enum RouteType {
13997    /// No route type information specified
13998    Unspecified,
13999    /// The route leads to a destination within the primary address range of the
14000    /// VPC network's subnet.
14001    VpcPrimarySubnet,
14002    /// The route leads to a destination within the secondary address range of the
14003    /// VPC network's subnet.
14004    VpcSecondarySubnet,
14005    /// The route leads to a destination in a dynamic route. Dynamic routes are
14006    /// derived from Border Gateway Protocol (BGP) advertisements received from an
14007    /// NCC hybrid spoke.
14008    DynamicRoute,
14009    /// If set, the enum was initialized with an unknown value.
14010    ///
14011    /// Applications can examine the value using [RouteType::value] or
14012    /// [RouteType::name].
14013    UnknownValue(route_type::UnknownValue),
14014}
14015
14016#[doc(hidden)]
14017pub mod route_type {
14018    #[allow(unused_imports)]
14019    use super::*;
14020    #[derive(Clone, Debug, PartialEq)]
14021    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14022}
14023
14024impl RouteType {
14025    /// Gets the enum value.
14026    ///
14027    /// Returns `None` if the enum contains an unknown value deserialized from
14028    /// the string representation of enums.
14029    pub fn value(&self) -> std::option::Option<i32> {
14030        match self {
14031            Self::Unspecified => std::option::Option::Some(0),
14032            Self::VpcPrimarySubnet => std::option::Option::Some(1),
14033            Self::VpcSecondarySubnet => std::option::Option::Some(2),
14034            Self::DynamicRoute => std::option::Option::Some(3),
14035            Self::UnknownValue(u) => u.0.value(),
14036        }
14037    }
14038
14039    /// Gets the enum value as a string.
14040    ///
14041    /// Returns `None` if the enum contains an unknown value deserialized from
14042    /// the integer representation of enums.
14043    pub fn name(&self) -> std::option::Option<&str> {
14044        match self {
14045            Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
14046            Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
14047            Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
14048            Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
14049            Self::UnknownValue(u) => u.0.name(),
14050        }
14051    }
14052}
14053
14054impl std::default::Default for RouteType {
14055    fn default() -> Self {
14056        use std::convert::From;
14057        Self::from(0)
14058    }
14059}
14060
14061impl std::fmt::Display for RouteType {
14062    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14063        wkt::internal::display_enum(f, self.name(), self.value())
14064    }
14065}
14066
14067impl std::convert::From<i32> for RouteType {
14068    fn from(value: i32) -> Self {
14069        match value {
14070            0 => Self::Unspecified,
14071            1 => Self::VpcPrimarySubnet,
14072            2 => Self::VpcSecondarySubnet,
14073            3 => Self::DynamicRoute,
14074            _ => Self::UnknownValue(route_type::UnknownValue(
14075                wkt::internal::UnknownEnumValue::Integer(value),
14076            )),
14077        }
14078    }
14079}
14080
14081impl std::convert::From<&str> for RouteType {
14082    fn from(value: &str) -> Self {
14083        use std::string::ToString;
14084        match value {
14085            "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
14086            "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
14087            "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
14088            "DYNAMIC_ROUTE" => Self::DynamicRoute,
14089            _ => Self::UnknownValue(route_type::UnknownValue(
14090                wkt::internal::UnknownEnumValue::String(value.to_string()),
14091            )),
14092        }
14093    }
14094}
14095
14096impl serde::ser::Serialize for RouteType {
14097    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14098    where
14099        S: serde::Serializer,
14100    {
14101        match self {
14102            Self::Unspecified => serializer.serialize_i32(0),
14103            Self::VpcPrimarySubnet => serializer.serialize_i32(1),
14104            Self::VpcSecondarySubnet => serializer.serialize_i32(2),
14105            Self::DynamicRoute => serializer.serialize_i32(3),
14106            Self::UnknownValue(u) => u.0.serialize(serializer),
14107        }
14108    }
14109}
14110
14111impl<'de> serde::de::Deserialize<'de> for RouteType {
14112    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14113    where
14114        D: serde::Deserializer<'de>,
14115    {
14116        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
14117            ".google.cloud.networkconnectivity.v1.RouteType",
14118        ))
14119    }
14120}
14121
14122/// The State enum represents the lifecycle stage of a Network Connectivity
14123/// Center resource.
14124///
14125/// # Working with unknown values
14126///
14127/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14128/// additional enum variants at any time. Adding new variants is not considered
14129/// a breaking change. Applications should write their code in anticipation of:
14130///
14131/// - New values appearing in future releases of the client library, **and**
14132/// - New values received dynamically, without application changes.
14133///
14134/// Please consult the [Working with enums] section in the user guide for some
14135/// guidelines.
14136///
14137/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14138#[derive(Clone, Debug, PartialEq)]
14139#[non_exhaustive]
14140pub enum State {
14141    /// No state information available
14142    Unspecified,
14143    /// The resource's create operation is in progress.
14144    Creating,
14145    /// The resource is active
14146    Active,
14147    /// The resource's delete operation is in progress.
14148    Deleting,
14149    /// The resource's accept operation is in progress.
14150    Accepting,
14151    /// The resource's reject operation is in progress.
14152    Rejecting,
14153    /// The resource's update operation is in progress.
14154    Updating,
14155    /// The resource is inactive.
14156    Inactive,
14157    /// The hub associated with this spoke resource has been deleted.
14158    /// This state applies to spoke resources only.
14159    Obsolete,
14160    /// The resource is in an undefined state due to resource creation or deletion
14161    /// failure. You can try to delete the resource later or contact support for
14162    /// help.
14163    Failed,
14164    /// If set, the enum was initialized with an unknown value.
14165    ///
14166    /// Applications can examine the value using [State::value] or
14167    /// [State::name].
14168    UnknownValue(state::UnknownValue),
14169}
14170
14171#[doc(hidden)]
14172pub mod state {
14173    #[allow(unused_imports)]
14174    use super::*;
14175    #[derive(Clone, Debug, PartialEq)]
14176    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14177}
14178
14179impl State {
14180    /// Gets the enum value.
14181    ///
14182    /// Returns `None` if the enum contains an unknown value deserialized from
14183    /// the string representation of enums.
14184    pub fn value(&self) -> std::option::Option<i32> {
14185        match self {
14186            Self::Unspecified => std::option::Option::Some(0),
14187            Self::Creating => std::option::Option::Some(1),
14188            Self::Active => std::option::Option::Some(2),
14189            Self::Deleting => std::option::Option::Some(3),
14190            Self::Accepting => std::option::Option::Some(8),
14191            Self::Rejecting => std::option::Option::Some(9),
14192            Self::Updating => std::option::Option::Some(6),
14193            Self::Inactive => std::option::Option::Some(7),
14194            Self::Obsolete => std::option::Option::Some(10),
14195            Self::Failed => std::option::Option::Some(11),
14196            Self::UnknownValue(u) => u.0.value(),
14197        }
14198    }
14199
14200    /// Gets the enum value as a string.
14201    ///
14202    /// Returns `None` if the enum contains an unknown value deserialized from
14203    /// the integer representation of enums.
14204    pub fn name(&self) -> std::option::Option<&str> {
14205        match self {
14206            Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14207            Self::Creating => std::option::Option::Some("CREATING"),
14208            Self::Active => std::option::Option::Some("ACTIVE"),
14209            Self::Deleting => std::option::Option::Some("DELETING"),
14210            Self::Accepting => std::option::Option::Some("ACCEPTING"),
14211            Self::Rejecting => std::option::Option::Some("REJECTING"),
14212            Self::Updating => std::option::Option::Some("UPDATING"),
14213            Self::Inactive => std::option::Option::Some("INACTIVE"),
14214            Self::Obsolete => std::option::Option::Some("OBSOLETE"),
14215            Self::Failed => std::option::Option::Some("FAILED"),
14216            Self::UnknownValue(u) => u.0.name(),
14217        }
14218    }
14219}
14220
14221impl std::default::Default for State {
14222    fn default() -> Self {
14223        use std::convert::From;
14224        Self::from(0)
14225    }
14226}
14227
14228impl std::fmt::Display for State {
14229    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14230        wkt::internal::display_enum(f, self.name(), self.value())
14231    }
14232}
14233
14234impl std::convert::From<i32> for State {
14235    fn from(value: i32) -> Self {
14236        match value {
14237            0 => Self::Unspecified,
14238            1 => Self::Creating,
14239            2 => Self::Active,
14240            3 => Self::Deleting,
14241            6 => Self::Updating,
14242            7 => Self::Inactive,
14243            8 => Self::Accepting,
14244            9 => Self::Rejecting,
14245            10 => Self::Obsolete,
14246            11 => Self::Failed,
14247            _ => Self::UnknownValue(state::UnknownValue(
14248                wkt::internal::UnknownEnumValue::Integer(value),
14249            )),
14250        }
14251    }
14252}
14253
14254impl std::convert::From<&str> for State {
14255    fn from(value: &str) -> Self {
14256        use std::string::ToString;
14257        match value {
14258            "STATE_UNSPECIFIED" => Self::Unspecified,
14259            "CREATING" => Self::Creating,
14260            "ACTIVE" => Self::Active,
14261            "DELETING" => Self::Deleting,
14262            "ACCEPTING" => Self::Accepting,
14263            "REJECTING" => Self::Rejecting,
14264            "UPDATING" => Self::Updating,
14265            "INACTIVE" => Self::Inactive,
14266            "OBSOLETE" => Self::Obsolete,
14267            "FAILED" => Self::Failed,
14268            _ => Self::UnknownValue(state::UnknownValue(
14269                wkt::internal::UnknownEnumValue::String(value.to_string()),
14270            )),
14271        }
14272    }
14273}
14274
14275impl serde::ser::Serialize for State {
14276    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14277    where
14278        S: serde::Serializer,
14279    {
14280        match self {
14281            Self::Unspecified => serializer.serialize_i32(0),
14282            Self::Creating => serializer.serialize_i32(1),
14283            Self::Active => serializer.serialize_i32(2),
14284            Self::Deleting => serializer.serialize_i32(3),
14285            Self::Accepting => serializer.serialize_i32(8),
14286            Self::Rejecting => serializer.serialize_i32(9),
14287            Self::Updating => serializer.serialize_i32(6),
14288            Self::Inactive => serializer.serialize_i32(7),
14289            Self::Obsolete => serializer.serialize_i32(10),
14290            Self::Failed => serializer.serialize_i32(11),
14291            Self::UnknownValue(u) => u.0.serialize(serializer),
14292        }
14293    }
14294}
14295
14296impl<'de> serde::de::Deserialize<'de> for State {
14297    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14298    where
14299        D: serde::Deserializer<'de>,
14300    {
14301        deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14302            ".google.cloud.networkconnectivity.v1.State",
14303        ))
14304    }
14305}
14306
14307/// The SpokeType enum represents the type of spoke. The type
14308/// reflects the kind of resource that a spoke is associated with.
14309///
14310/// # Working with unknown values
14311///
14312/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14313/// additional enum variants at any time. Adding new variants is not considered
14314/// a breaking change. Applications should write their code in anticipation of:
14315///
14316/// - New values appearing in future releases of the client library, **and**
14317/// - New values received dynamically, without application changes.
14318///
14319/// Please consult the [Working with enums] section in the user guide for some
14320/// guidelines.
14321///
14322/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14323#[derive(Clone, Debug, PartialEq)]
14324#[non_exhaustive]
14325pub enum SpokeType {
14326    /// Unspecified spoke type.
14327    Unspecified,
14328    /// Spokes associated with VPN tunnels.
14329    VpnTunnel,
14330    /// Spokes associated with VLAN attachments.
14331    InterconnectAttachment,
14332    /// Spokes associated with router appliance instances.
14333    RouterAppliance,
14334    /// Spokes associated with VPC networks.
14335    VpcNetwork,
14336    /// Spokes that are backed by a producer VPC network.
14337    ProducerVpcNetwork,
14338    /// If set, the enum was initialized with an unknown value.
14339    ///
14340    /// Applications can examine the value using [SpokeType::value] or
14341    /// [SpokeType::name].
14342    UnknownValue(spoke_type::UnknownValue),
14343}
14344
14345#[doc(hidden)]
14346pub mod spoke_type {
14347    #[allow(unused_imports)]
14348    use super::*;
14349    #[derive(Clone, Debug, PartialEq)]
14350    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14351}
14352
14353impl SpokeType {
14354    /// Gets the enum value.
14355    ///
14356    /// Returns `None` if the enum contains an unknown value deserialized from
14357    /// the string representation of enums.
14358    pub fn value(&self) -> std::option::Option<i32> {
14359        match self {
14360            Self::Unspecified => std::option::Option::Some(0),
14361            Self::VpnTunnel => std::option::Option::Some(1),
14362            Self::InterconnectAttachment => std::option::Option::Some(2),
14363            Self::RouterAppliance => std::option::Option::Some(3),
14364            Self::VpcNetwork => std::option::Option::Some(4),
14365            Self::ProducerVpcNetwork => std::option::Option::Some(7),
14366            Self::UnknownValue(u) => u.0.value(),
14367        }
14368    }
14369
14370    /// Gets the enum value as a string.
14371    ///
14372    /// Returns `None` if the enum contains an unknown value deserialized from
14373    /// the integer representation of enums.
14374    pub fn name(&self) -> std::option::Option<&str> {
14375        match self {
14376            Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
14377            Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
14378            Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
14379            Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
14380            Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
14381            Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
14382            Self::UnknownValue(u) => u.0.name(),
14383        }
14384    }
14385}
14386
14387impl std::default::Default for SpokeType {
14388    fn default() -> Self {
14389        use std::convert::From;
14390        Self::from(0)
14391    }
14392}
14393
14394impl std::fmt::Display for SpokeType {
14395    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14396        wkt::internal::display_enum(f, self.name(), self.value())
14397    }
14398}
14399
14400impl std::convert::From<i32> for SpokeType {
14401    fn from(value: i32) -> Self {
14402        match value {
14403            0 => Self::Unspecified,
14404            1 => Self::VpnTunnel,
14405            2 => Self::InterconnectAttachment,
14406            3 => Self::RouterAppliance,
14407            4 => Self::VpcNetwork,
14408            7 => Self::ProducerVpcNetwork,
14409            _ => Self::UnknownValue(spoke_type::UnknownValue(
14410                wkt::internal::UnknownEnumValue::Integer(value),
14411            )),
14412        }
14413    }
14414}
14415
14416impl std::convert::From<&str> for SpokeType {
14417    fn from(value: &str) -> Self {
14418        use std::string::ToString;
14419        match value {
14420            "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
14421            "VPN_TUNNEL" => Self::VpnTunnel,
14422            "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
14423            "ROUTER_APPLIANCE" => Self::RouterAppliance,
14424            "VPC_NETWORK" => Self::VpcNetwork,
14425            "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
14426            _ => Self::UnknownValue(spoke_type::UnknownValue(
14427                wkt::internal::UnknownEnumValue::String(value.to_string()),
14428            )),
14429        }
14430    }
14431}
14432
14433impl serde::ser::Serialize for SpokeType {
14434    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14435    where
14436        S: serde::Serializer,
14437    {
14438        match self {
14439            Self::Unspecified => serializer.serialize_i32(0),
14440            Self::VpnTunnel => serializer.serialize_i32(1),
14441            Self::InterconnectAttachment => serializer.serialize_i32(2),
14442            Self::RouterAppliance => serializer.serialize_i32(3),
14443            Self::VpcNetwork => serializer.serialize_i32(4),
14444            Self::ProducerVpcNetwork => serializer.serialize_i32(7),
14445            Self::UnknownValue(u) => u.0.serialize(serializer),
14446        }
14447    }
14448}
14449
14450impl<'de> serde::de::Deserialize<'de> for SpokeType {
14451    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14452    where
14453        D: serde::Deserializer<'de>,
14454    {
14455        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
14456            ".google.cloud.networkconnectivity.v1.SpokeType",
14457        ))
14458    }
14459}
14460
14461/// This enum controls the policy mode used in a hub.
14462///
14463/// # Working with unknown values
14464///
14465/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14466/// additional enum variants at any time. Adding new variants is not considered
14467/// a breaking change. Applications should write their code in anticipation of:
14468///
14469/// - New values appearing in future releases of the client library, **and**
14470/// - New values received dynamically, without application changes.
14471///
14472/// Please consult the [Working with enums] section in the user guide for some
14473/// guidelines.
14474///
14475/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14476#[derive(Clone, Debug, PartialEq)]
14477#[non_exhaustive]
14478pub enum PolicyMode {
14479    /// Policy mode is unspecified. It defaults to PRESET
14480    /// with preset_topology = MESH.
14481    Unspecified,
14482    /// Hub uses one of the preset topologies.
14483    Preset,
14484    /// If set, the enum was initialized with an unknown value.
14485    ///
14486    /// Applications can examine the value using [PolicyMode::value] or
14487    /// [PolicyMode::name].
14488    UnknownValue(policy_mode::UnknownValue),
14489}
14490
14491#[doc(hidden)]
14492pub mod policy_mode {
14493    #[allow(unused_imports)]
14494    use super::*;
14495    #[derive(Clone, Debug, PartialEq)]
14496    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14497}
14498
14499impl PolicyMode {
14500    /// Gets the enum value.
14501    ///
14502    /// Returns `None` if the enum contains an unknown value deserialized from
14503    /// the string representation of enums.
14504    pub fn value(&self) -> std::option::Option<i32> {
14505        match self {
14506            Self::Unspecified => std::option::Option::Some(0),
14507            Self::Preset => std::option::Option::Some(1),
14508            Self::UnknownValue(u) => u.0.value(),
14509        }
14510    }
14511
14512    /// Gets the enum value as a string.
14513    ///
14514    /// Returns `None` if the enum contains an unknown value deserialized from
14515    /// the integer representation of enums.
14516    pub fn name(&self) -> std::option::Option<&str> {
14517        match self {
14518            Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
14519            Self::Preset => std::option::Option::Some("PRESET"),
14520            Self::UnknownValue(u) => u.0.name(),
14521        }
14522    }
14523}
14524
14525impl std::default::Default for PolicyMode {
14526    fn default() -> Self {
14527        use std::convert::From;
14528        Self::from(0)
14529    }
14530}
14531
14532impl std::fmt::Display for PolicyMode {
14533    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14534        wkt::internal::display_enum(f, self.name(), self.value())
14535    }
14536}
14537
14538impl std::convert::From<i32> for PolicyMode {
14539    fn from(value: i32) -> Self {
14540        match value {
14541            0 => Self::Unspecified,
14542            1 => Self::Preset,
14543            _ => Self::UnknownValue(policy_mode::UnknownValue(
14544                wkt::internal::UnknownEnumValue::Integer(value),
14545            )),
14546        }
14547    }
14548}
14549
14550impl std::convert::From<&str> for PolicyMode {
14551    fn from(value: &str) -> Self {
14552        use std::string::ToString;
14553        match value {
14554            "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
14555            "PRESET" => Self::Preset,
14556            _ => Self::UnknownValue(policy_mode::UnknownValue(
14557                wkt::internal::UnknownEnumValue::String(value.to_string()),
14558            )),
14559        }
14560    }
14561}
14562
14563impl serde::ser::Serialize for PolicyMode {
14564    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14565    where
14566        S: serde::Serializer,
14567    {
14568        match self {
14569            Self::Unspecified => serializer.serialize_i32(0),
14570            Self::Preset => serializer.serialize_i32(1),
14571            Self::UnknownValue(u) => u.0.serialize(serializer),
14572        }
14573    }
14574}
14575
14576impl<'de> serde::de::Deserialize<'de> for PolicyMode {
14577    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14578    where
14579        D: serde::Deserializer<'de>,
14580    {
14581        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
14582            ".google.cloud.networkconnectivity.v1.PolicyMode",
14583        ))
14584    }
14585}
14586
14587/// The list of available preset topologies.
14588///
14589/// # Working with unknown values
14590///
14591/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14592/// additional enum variants at any time. Adding new variants is not considered
14593/// a breaking change. Applications should write their code in anticipation of:
14594///
14595/// - New values appearing in future releases of the client library, **and**
14596/// - New values received dynamically, without application changes.
14597///
14598/// Please consult the [Working with enums] section in the user guide for some
14599/// guidelines.
14600///
14601/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14602#[derive(Clone, Debug, PartialEq)]
14603#[non_exhaustive]
14604pub enum PresetTopology {
14605    /// Preset topology is unspecified. When policy_mode = PRESET,
14606    /// it defaults to MESH.
14607    Unspecified,
14608    /// Mesh topology is implemented. Group `default` is automatically created.
14609    /// All spokes in the hub are added to group `default`.
14610    Mesh,
14611    /// Star topology is implemented. Two groups, `center` and `edge`, are
14612    /// automatically created along with hub creation. Spokes have to join one of
14613    /// the groups during creation.
14614    Star,
14615    /// If set, the enum was initialized with an unknown value.
14616    ///
14617    /// Applications can examine the value using [PresetTopology::value] or
14618    /// [PresetTopology::name].
14619    UnknownValue(preset_topology::UnknownValue),
14620}
14621
14622#[doc(hidden)]
14623pub mod preset_topology {
14624    #[allow(unused_imports)]
14625    use super::*;
14626    #[derive(Clone, Debug, PartialEq)]
14627    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14628}
14629
14630impl PresetTopology {
14631    /// Gets the enum value.
14632    ///
14633    /// Returns `None` if the enum contains an unknown value deserialized from
14634    /// the string representation of enums.
14635    pub fn value(&self) -> std::option::Option<i32> {
14636        match self {
14637            Self::Unspecified => std::option::Option::Some(0),
14638            Self::Mesh => std::option::Option::Some(2),
14639            Self::Star => std::option::Option::Some(3),
14640            Self::UnknownValue(u) => u.0.value(),
14641        }
14642    }
14643
14644    /// Gets the enum value as a string.
14645    ///
14646    /// Returns `None` if the enum contains an unknown value deserialized from
14647    /// the integer representation of enums.
14648    pub fn name(&self) -> std::option::Option<&str> {
14649        match self {
14650            Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
14651            Self::Mesh => std::option::Option::Some("MESH"),
14652            Self::Star => std::option::Option::Some("STAR"),
14653            Self::UnknownValue(u) => u.0.name(),
14654        }
14655    }
14656}
14657
14658impl std::default::Default for PresetTopology {
14659    fn default() -> Self {
14660        use std::convert::From;
14661        Self::from(0)
14662    }
14663}
14664
14665impl std::fmt::Display for PresetTopology {
14666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14667        wkt::internal::display_enum(f, self.name(), self.value())
14668    }
14669}
14670
14671impl std::convert::From<i32> for PresetTopology {
14672    fn from(value: i32) -> Self {
14673        match value {
14674            0 => Self::Unspecified,
14675            2 => Self::Mesh,
14676            3 => Self::Star,
14677            _ => Self::UnknownValue(preset_topology::UnknownValue(
14678                wkt::internal::UnknownEnumValue::Integer(value),
14679            )),
14680        }
14681    }
14682}
14683
14684impl std::convert::From<&str> for PresetTopology {
14685    fn from(value: &str) -> Self {
14686        use std::string::ToString;
14687        match value {
14688            "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
14689            "MESH" => Self::Mesh,
14690            "STAR" => Self::Star,
14691            _ => Self::UnknownValue(preset_topology::UnknownValue(
14692                wkt::internal::UnknownEnumValue::String(value.to_string()),
14693            )),
14694        }
14695    }
14696}
14697
14698impl serde::ser::Serialize for PresetTopology {
14699    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14700    where
14701        S: serde::Serializer,
14702    {
14703        match self {
14704            Self::Unspecified => serializer.serialize_i32(0),
14705            Self::Mesh => serializer.serialize_i32(2),
14706            Self::Star => serializer.serialize_i32(3),
14707            Self::UnknownValue(u) => u.0.serialize(serializer),
14708        }
14709    }
14710}
14711
14712impl<'de> serde::de::Deserialize<'de> for PresetTopology {
14713    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14714    where
14715        D: serde::Deserializer<'de>,
14716    {
14717        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
14718            ".google.cloud.networkconnectivity.v1.PresetTopology",
14719        ))
14720    }
14721}