Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Represents the metadata of the long-running operation.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct OperationMetadata {
44    /// Output only. The time the operation was created.
45    pub create_time: std::option::Option<wkt::Timestamp>,
46
47    /// Output only. The time the operation finished running.
48    pub end_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. Server-defined resource path for the target of the operation.
51    pub target: std::string::String,
52
53    /// Output only. Name of the verb executed by the operation.
54    pub verb: std::string::String,
55
56    /// Output only. Human-readable status of the operation, if any.
57    pub status_message: std::string::String,
58
59    /// Output only. Identifies whether the user has requested cancellation
60    /// of the operation. Operations that have been cancelled successfully
61    /// have
62    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
63    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
64    /// corresponding to `Code.CANCELLED`.
65    ///
66    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
67    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
68    pub requested_cancellation: bool,
69
70    /// Output only. API version used to start the operation.
71    pub api_version: std::string::String,
72
73    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
74}
75
76impl OperationMetadata {
77    /// Creates a new default instance.
78    pub fn new() -> Self {
79        std::default::Default::default()
80    }
81
82    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
83    ///
84    /// # Example
85    /// ```ignore,no_run
86    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
87    /// use wkt::Timestamp;
88    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
89    /// ```
90    pub fn set_create_time<T>(mut self, v: T) -> Self
91    where
92        T: std::convert::Into<wkt::Timestamp>,
93    {
94        self.create_time = std::option::Option::Some(v.into());
95        self
96    }
97
98    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
99    ///
100    /// # Example
101    /// ```ignore,no_run
102    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
103    /// use wkt::Timestamp;
104    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
105    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
106    /// ```
107    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
108    where
109        T: std::convert::Into<wkt::Timestamp>,
110    {
111        self.create_time = v.map(|x| x.into());
112        self
113    }
114
115    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
120    /// use wkt::Timestamp;
121    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
122    /// ```
123    pub fn set_end_time<T>(mut self, v: T) -> Self
124    where
125        T: std::convert::Into<wkt::Timestamp>,
126    {
127        self.end_time = std::option::Option::Some(v.into());
128        self
129    }
130
131    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
132    ///
133    /// # Example
134    /// ```ignore,no_run
135    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
136    /// use wkt::Timestamp;
137    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
138    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
139    /// ```
140    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
141    where
142        T: std::convert::Into<wkt::Timestamp>,
143    {
144        self.end_time = v.map(|x| x.into());
145        self
146    }
147
148    /// Sets the value of [target][crate::model::OperationMetadata::target].
149    ///
150    /// # Example
151    /// ```ignore,no_run
152    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
153    /// let x = OperationMetadata::new().set_target("example");
154    /// ```
155    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156        self.target = v.into();
157        self
158    }
159
160    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
165    /// let x = OperationMetadata::new().set_verb("example");
166    /// ```
167    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
168        self.verb = v.into();
169        self
170    }
171
172    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
173    ///
174    /// # Example
175    /// ```ignore,no_run
176    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
177    /// let x = OperationMetadata::new().set_status_message("example");
178    /// ```
179    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
180        self.status_message = v.into();
181        self
182    }
183
184    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
185    ///
186    /// # Example
187    /// ```ignore,no_run
188    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
189    /// let x = OperationMetadata::new().set_requested_cancellation(true);
190    /// ```
191    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
192        self.requested_cancellation = v.into();
193        self
194    }
195
196    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
197    ///
198    /// # Example
199    /// ```ignore,no_run
200    /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
201    /// let x = OperationMetadata::new().set_api_version("example");
202    /// ```
203    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
204        self.api_version = v.into();
205        self
206    }
207}
208
209impl wkt::message::Message for OperationMetadata {
210    fn typename() -> &'static str {
211        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
212    }
213}
214
215/// The ServiceConnectionMap resource.
216#[derive(Clone, Default, PartialEq)]
217#[non_exhaustive]
218pub struct ServiceConnectionMap {
219    /// Immutable. The name of a ServiceConnectionMap.
220    /// Format:
221    /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
222    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
223    pub name: std::string::String,
224
225    /// Output only. Time when the ServiceConnectionMap was created.
226    pub create_time: std::option::Option<wkt::Timestamp>,
227
228    /// Output only. Time when the ServiceConnectionMap was updated.
229    pub update_time: std::option::Option<wkt::Timestamp>,
230
231    /// User-defined labels.
232    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
233
234    /// A description of this resource.
235    pub description: std::string::String,
236
237    /// The service class identifier this ServiceConnectionMap is for.
238    /// The user of ServiceConnectionMap create API needs to have
239    /// networkconnecitivty.serviceclasses.use iam permission for the service
240    /// class.
241    pub service_class: std::string::String,
242
243    /// Output only. The service class uri this ServiceConnectionMap is for.
244    pub service_class_uri: std::string::String,
245
246    /// Output only. The infrastructure used for connections between
247    /// consumers/producers.
248    pub infrastructure: crate::model::Infrastructure,
249
250    /// The PSC configurations on producer side.
251    pub producer_psc_configs:
252        std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
253
254    /// The PSC configurations on consumer side.
255    pub consumer_psc_configs:
256        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
257
258    /// Output only. PSC connection details on consumer side.
259    pub consumer_psc_connections:
260        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
261
262    /// The token provided by the consumer. This token authenticates that the
263    /// consumer can create a connection within the specified project and network.
264    pub token: std::string::String,
265
266    /// Optional. The etag is computed by the server, and may be sent on update and
267    /// delete requests to ensure the client has an up-to-date value before
268    /// proceeding.
269    pub etag: std::option::Option<std::string::String>,
270
271    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
272}
273
274impl ServiceConnectionMap {
275    /// Creates a new default instance.
276    pub fn new() -> Self {
277        std::default::Default::default()
278    }
279
280    /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
281    ///
282    /// # Example
283    /// ```ignore,no_run
284    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
285    /// let x = ServiceConnectionMap::new().set_name("example");
286    /// ```
287    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
288        self.name = v.into();
289        self
290    }
291
292    /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
293    ///
294    /// # Example
295    /// ```ignore,no_run
296    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
297    /// use wkt::Timestamp;
298    /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
299    /// ```
300    pub fn set_create_time<T>(mut self, v: T) -> Self
301    where
302        T: std::convert::Into<wkt::Timestamp>,
303    {
304        self.create_time = std::option::Option::Some(v.into());
305        self
306    }
307
308    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
309    ///
310    /// # Example
311    /// ```ignore,no_run
312    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
313    /// use wkt::Timestamp;
314    /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
315    /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
316    /// ```
317    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
318    where
319        T: std::convert::Into<wkt::Timestamp>,
320    {
321        self.create_time = v.map(|x| x.into());
322        self
323    }
324
325    /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
326    ///
327    /// # Example
328    /// ```ignore,no_run
329    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
330    /// use wkt::Timestamp;
331    /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
332    /// ```
333    pub fn set_update_time<T>(mut self, v: T) -> Self
334    where
335        T: std::convert::Into<wkt::Timestamp>,
336    {
337        self.update_time = std::option::Option::Some(v.into());
338        self
339    }
340
341    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
342    ///
343    /// # Example
344    /// ```ignore,no_run
345    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
346    /// use wkt::Timestamp;
347    /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
348    /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
349    /// ```
350    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
351    where
352        T: std::convert::Into<wkt::Timestamp>,
353    {
354        self.update_time = v.map(|x| x.into());
355        self
356    }
357
358    /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
359    ///
360    /// # Example
361    /// ```ignore,no_run
362    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
363    /// let x = ServiceConnectionMap::new().set_labels([
364    ///     ("key0", "abc"),
365    ///     ("key1", "xyz"),
366    /// ]);
367    /// ```
368    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
369    where
370        T: std::iter::IntoIterator<Item = (K, V)>,
371        K: std::convert::Into<std::string::String>,
372        V: std::convert::Into<std::string::String>,
373    {
374        use std::iter::Iterator;
375        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
376        self
377    }
378
379    /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
380    ///
381    /// # Example
382    /// ```ignore,no_run
383    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
384    /// let x = ServiceConnectionMap::new().set_description("example");
385    /// ```
386    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387        self.description = v.into();
388        self
389    }
390
391    /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
392    ///
393    /// # Example
394    /// ```ignore,no_run
395    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
396    /// let x = ServiceConnectionMap::new().set_service_class("example");
397    /// ```
398    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
399        self.service_class = v.into();
400        self
401    }
402
403    /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
408    /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
409    /// ```
410    pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
411        mut self,
412        v: T,
413    ) -> Self {
414        self.service_class_uri = v.into();
415        self
416    }
417
418    /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
423    /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
424    /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
425    /// ```
426    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
427        mut self,
428        v: T,
429    ) -> Self {
430        self.infrastructure = v.into();
431        self
432    }
433
434    /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
439    /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
440    /// let x = ServiceConnectionMap::new()
441    ///     .set_producer_psc_configs([
442    ///         ProducerPscConfig::default()/* use setters */,
443    ///         ProducerPscConfig::default()/* use (different) setters */,
444    ///     ]);
445    /// ```
446    pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
447    where
448        T: std::iter::IntoIterator<Item = V>,
449        V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
450    {
451        use std::iter::Iterator;
452        self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
453        self
454    }
455
456    /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
457    ///
458    /// # Example
459    /// ```ignore,no_run
460    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
461    /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
462    /// let x = ServiceConnectionMap::new()
463    ///     .set_consumer_psc_configs([
464    ///         ConsumerPscConfig::default()/* use setters */,
465    ///         ConsumerPscConfig::default()/* use (different) setters */,
466    ///     ]);
467    /// ```
468    pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
469    where
470        T: std::iter::IntoIterator<Item = V>,
471        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
472    {
473        use std::iter::Iterator;
474        self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
475        self
476    }
477
478    /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
483    /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
484    /// let x = ServiceConnectionMap::new()
485    ///     .set_consumer_psc_connections([
486    ///         ConsumerPscConnection::default()/* use setters */,
487    ///         ConsumerPscConnection::default()/* use (different) setters */,
488    ///     ]);
489    /// ```
490    pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
491    where
492        T: std::iter::IntoIterator<Item = V>,
493        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
494    {
495        use std::iter::Iterator;
496        self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
497        self
498    }
499
500    /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
501    ///
502    /// # Example
503    /// ```ignore,no_run
504    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
505    /// let x = ServiceConnectionMap::new().set_token("example");
506    /// ```
507    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
508        self.token = v.into();
509        self
510    }
511
512    /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
513    ///
514    /// # Example
515    /// ```ignore,no_run
516    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
517    /// let x = ServiceConnectionMap::new().set_etag("example");
518    /// ```
519    pub fn set_etag<T>(mut self, v: T) -> Self
520    where
521        T: std::convert::Into<std::string::String>,
522    {
523        self.etag = std::option::Option::Some(v.into());
524        self
525    }
526
527    /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
528    ///
529    /// # Example
530    /// ```ignore,no_run
531    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
532    /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
533    /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
534    /// ```
535    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
536    where
537        T: std::convert::Into<std::string::String>,
538    {
539        self.etag = v.map(|x| x.into());
540        self
541    }
542}
543
544impl wkt::message::Message for ServiceConnectionMap {
545    fn typename() -> &'static str {
546        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
547    }
548}
549
550/// Defines additional types related to [ServiceConnectionMap].
551pub mod service_connection_map {
552    #[allow(unused_imports)]
553    use super::*;
554
555    /// The PSC configurations on producer side.
556    #[derive(Clone, Default, PartialEq)]
557    #[non_exhaustive]
558    pub struct ProducerPscConfig {
559        /// The resource path of a service attachment.
560        /// Example:
561        /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
562        pub service_attachment_uri: std::string::String,
563
564        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
565    }
566
567    impl ProducerPscConfig {
568        /// Creates a new default instance.
569        pub fn new() -> Self {
570            std::default::Default::default()
571        }
572
573        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
574        ///
575        /// # Example
576        /// ```ignore,no_run
577        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
578        /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
579        /// ```
580        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
581            mut self,
582            v: T,
583        ) -> Self {
584            self.service_attachment_uri = v.into();
585            self
586        }
587    }
588
589    impl wkt::message::Message for ProducerPscConfig {
590        fn typename() -> &'static str {
591            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
592        }
593    }
594
595    /// Allow the producer to specify which consumers can connect to it.
596    #[derive(Clone, Default, PartialEq)]
597    #[non_exhaustive]
598    pub struct ConsumerPscConfig {
599        /// The consumer project where PSC connections are allowed to be created in.
600        pub project: std::string::String,
601
602        /// The resource path of the consumer network where PSC connections are
603        /// allowed to be created in. Note, this network does not need be in the
604        /// ConsumerPscConfig.project in the case of SharedVPC.
605        /// Example:
606        /// projects/{projectNumOrId}/global/networks/{networkId}.
607        pub network: std::string::String,
608
609        /// This is used in PSC consumer ForwardingRule to control whether the PSC
610        /// endpoint can be accessed from another region.
611        pub disable_global_access: bool,
612
613        /// Output only. Overall state of PSC Connections management for this
614        /// consumer psc config.
615        pub state: crate::model::service_connection_map::consumer_psc_config::State,
616
617        /// Immutable. Deprecated. Use producer_instance_metadata instead.
618        /// An immutable identifier for the producer instance.
619        #[deprecated]
620        pub producer_instance_id: std::string::String,
621
622        /// Output only. A map to store mapping between customer vip and target
623        /// service attachment. Only service attachment with producer specified ip
624        /// addresses are stored here.
625        pub service_attachment_ip_address_map:
626            std::collections::HashMap<std::string::String, std::string::String>,
627
628        /// Required. The project ID or project number of the consumer project. This
629        /// project is the one that the consumer uses to interact with the producer
630        /// instance. From the perspective of a consumer who's created a producer
631        /// instance, this is the project of the producer instance. Format:
632        /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
633        /// 'projects/1234'
634        pub consumer_instance_project: std::string::String,
635
636        /// Immutable. An immutable map for the producer instance metadata.
637        pub producer_instance_metadata:
638            std::collections::HashMap<std::string::String, std::string::String>,
639
640        /// The requested IP version for the PSC connection.
641        pub ip_version: std::option::Option<crate::model::IPVersion>,
642
643        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
644    }
645
646    impl ConsumerPscConfig {
647        /// Creates a new default instance.
648        pub fn new() -> Self {
649            std::default::Default::default()
650        }
651
652        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
653        ///
654        /// # Example
655        /// ```ignore,no_run
656        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
657        /// let x = ConsumerPscConfig::new().set_project("example");
658        /// ```
659        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
660            self.project = v.into();
661            self
662        }
663
664        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
665        ///
666        /// # Example
667        /// ```ignore,no_run
668        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
669        /// let x = ConsumerPscConfig::new().set_network("example");
670        /// ```
671        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672            self.network = v.into();
673            self
674        }
675
676        /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
677        ///
678        /// # Example
679        /// ```ignore,no_run
680        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
681        /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
682        /// ```
683        pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
684            self.disable_global_access = v.into();
685            self
686        }
687
688        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
689        ///
690        /// # Example
691        /// ```ignore,no_run
692        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
693        /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
694        /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
695        /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
696        /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
697        /// ```
698        pub fn set_state<
699            T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
700        >(
701            mut self,
702            v: T,
703        ) -> Self {
704            self.state = v.into();
705            self
706        }
707
708        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
709        ///
710        /// # Example
711        /// ```ignore,no_run
712        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
713        /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
714        /// ```
715        #[deprecated]
716        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
717            mut self,
718            v: T,
719        ) -> Self {
720            self.producer_instance_id = v.into();
721            self
722        }
723
724        /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
725        ///
726        /// # Example
727        /// ```ignore,no_run
728        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
729        /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
730        ///     ("key0", "abc"),
731        ///     ("key1", "xyz"),
732        /// ]);
733        /// ```
734        pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
735        where
736            T: std::iter::IntoIterator<Item = (K, V)>,
737            K: std::convert::Into<std::string::String>,
738            V: std::convert::Into<std::string::String>,
739        {
740            use std::iter::Iterator;
741            self.service_attachment_ip_address_map =
742                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
743            self
744        }
745
746        /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
747        ///
748        /// # Example
749        /// ```ignore,no_run
750        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
751        /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
752        /// ```
753        pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
754            mut self,
755            v: T,
756        ) -> Self {
757            self.consumer_instance_project = v.into();
758            self
759        }
760
761        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
762        ///
763        /// # Example
764        /// ```ignore,no_run
765        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
766        /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
767        ///     ("key0", "abc"),
768        ///     ("key1", "xyz"),
769        /// ]);
770        /// ```
771        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
772        where
773            T: std::iter::IntoIterator<Item = (K, V)>,
774            K: std::convert::Into<std::string::String>,
775            V: std::convert::Into<std::string::String>,
776        {
777            use std::iter::Iterator;
778            self.producer_instance_metadata =
779                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
780            self
781        }
782
783        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
784        ///
785        /// # Example
786        /// ```ignore,no_run
787        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
788        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
789        /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
790        /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
791        /// ```
792        pub fn set_ip_version<T>(mut self, v: T) -> Self
793        where
794            T: std::convert::Into<crate::model::IPVersion>,
795        {
796            self.ip_version = std::option::Option::Some(v.into());
797            self
798        }
799
800        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
801        ///
802        /// # Example
803        /// ```ignore,no_run
804        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
805        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
806        /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
807        /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
808        /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
809        /// ```
810        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
811        where
812            T: std::convert::Into<crate::model::IPVersion>,
813        {
814            self.ip_version = v.map(|x| x.into());
815            self
816        }
817    }
818
819    impl wkt::message::Message for ConsumerPscConfig {
820        fn typename() -> &'static str {
821            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
822        }
823    }
824
825    /// Defines additional types related to [ConsumerPscConfig].
826    pub mod consumer_psc_config {
827        #[allow(unused_imports)]
828        use super::*;
829
830        /// PSC Consumer Config State.
831        ///
832        /// # Working with unknown values
833        ///
834        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
835        /// additional enum variants at any time. Adding new variants is not considered
836        /// a breaking change. Applications should write their code in anticipation of:
837        ///
838        /// - New values appearing in future releases of the client library, **and**
839        /// - New values received dynamically, without application changes.
840        ///
841        /// Please consult the [Working with enums] section in the user guide for some
842        /// guidelines.
843        ///
844        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
845        #[derive(Clone, Debug, PartialEq)]
846        #[non_exhaustive]
847        pub enum State {
848            /// Default state, when Connection Map is created initially.
849            Unspecified,
850            /// Set when policy and map configuration is valid,
851            /// and their matching can lead to allowing creation of PSC Connections
852            /// subject to other constraints like connections limit.
853            Valid,
854            /// No Service Connection Policy found for this network and Service
855            /// Class
856            ConnectionPolicyMissing,
857            /// Service Connection Policy limit reached for this network and Service
858            /// Class
859            PolicyLimitReached,
860            /// The consumer instance project is not in
861            /// AllowedGoogleProducersResourceHierarchyLevels of the matching
862            /// ServiceConnectionPolicy.
863            ConsumerInstanceProjectNotAllowlisted,
864            /// If set, the enum was initialized with an unknown value.
865            ///
866            /// Applications can examine the value using [State::value] or
867            /// [State::name].
868            UnknownValue(state::UnknownValue),
869        }
870
871        #[doc(hidden)]
872        pub mod state {
873            #[allow(unused_imports)]
874            use super::*;
875            #[derive(Clone, Debug, PartialEq)]
876            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
877        }
878
879        impl State {
880            /// Gets the enum value.
881            ///
882            /// Returns `None` if the enum contains an unknown value deserialized from
883            /// the string representation of enums.
884            pub fn value(&self) -> std::option::Option<i32> {
885                match self {
886                    Self::Unspecified => std::option::Option::Some(0),
887                    Self::Valid => std::option::Option::Some(1),
888                    Self::ConnectionPolicyMissing => std::option::Option::Some(2),
889                    Self::PolicyLimitReached => std::option::Option::Some(3),
890                    Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
891                    Self::UnknownValue(u) => u.0.value(),
892                }
893            }
894
895            /// Gets the enum value as a string.
896            ///
897            /// Returns `None` if the enum contains an unknown value deserialized from
898            /// the integer representation of enums.
899            pub fn name(&self) -> std::option::Option<&str> {
900                match self {
901                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
902                    Self::Valid => std::option::Option::Some("VALID"),
903                    Self::ConnectionPolicyMissing => {
904                        std::option::Option::Some("CONNECTION_POLICY_MISSING")
905                    }
906                    Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
907                    Self::ConsumerInstanceProjectNotAllowlisted => {
908                        std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
909                    }
910                    Self::UnknownValue(u) => u.0.name(),
911                }
912            }
913        }
914
915        impl std::default::Default for State {
916            fn default() -> Self {
917                use std::convert::From;
918                Self::from(0)
919            }
920        }
921
922        impl std::fmt::Display for State {
923            fn fmt(
924                &self,
925                f: &mut std::fmt::Formatter<'_>,
926            ) -> std::result::Result<(), std::fmt::Error> {
927                wkt::internal::display_enum(f, self.name(), self.value())
928            }
929        }
930
931        impl std::convert::From<i32> for State {
932            fn from(value: i32) -> Self {
933                match value {
934                    0 => Self::Unspecified,
935                    1 => Self::Valid,
936                    2 => Self::ConnectionPolicyMissing,
937                    3 => Self::PolicyLimitReached,
938                    4 => Self::ConsumerInstanceProjectNotAllowlisted,
939                    _ => Self::UnknownValue(state::UnknownValue(
940                        wkt::internal::UnknownEnumValue::Integer(value),
941                    )),
942                }
943            }
944        }
945
946        impl std::convert::From<&str> for State {
947            fn from(value: &str) -> Self {
948                use std::string::ToString;
949                match value {
950                    "STATE_UNSPECIFIED" => Self::Unspecified,
951                    "VALID" => Self::Valid,
952                    "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
953                    "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
954                    "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
955                        Self::ConsumerInstanceProjectNotAllowlisted
956                    }
957                    _ => Self::UnknownValue(state::UnknownValue(
958                        wkt::internal::UnknownEnumValue::String(value.to_string()),
959                    )),
960                }
961            }
962        }
963
964        impl serde::ser::Serialize for State {
965            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
966            where
967                S: serde::Serializer,
968            {
969                match self {
970                    Self::Unspecified => serializer.serialize_i32(0),
971                    Self::Valid => serializer.serialize_i32(1),
972                    Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
973                    Self::PolicyLimitReached => serializer.serialize_i32(3),
974                    Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
975                    Self::UnknownValue(u) => u.0.serialize(serializer),
976                }
977            }
978        }
979
980        impl<'de> serde::de::Deserialize<'de> for State {
981            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
982            where
983                D: serde::Deserializer<'de>,
984            {
985                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
986                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
987            }
988        }
989    }
990
991    /// PSC connection details on consumer side.
992    #[derive(Clone, Default, PartialEq)]
993    #[non_exhaustive]
994    pub struct ConsumerPscConnection {
995        /// The URI of a service attachment which is the target of the PSC
996        /// connection.
997        pub service_attachment_uri: std::string::String,
998
999        /// The state of the PSC connection.
1000        pub state: crate::model::service_connection_map::consumer_psc_connection::State,
1001
1002        /// The consumer project whose PSC forwarding rule is connected to the
1003        /// service attachments in this service connection map.
1004        pub project: std::string::String,
1005
1006        /// The consumer network whose PSC forwarding rule is connected to the
1007        /// service attachments in this service connection map.
1008        /// Note that the network could be on a different project (shared VPC).
1009        pub network: std::string::String,
1010
1011        /// The PSC connection id of the PSC forwarding rule connected
1012        /// to the service attachments in this service connection map.
1013        pub psc_connection_id: std::string::String,
1014
1015        /// The IP literal allocated on the consumer network for the PSC forwarding
1016        /// rule that is created to connect to the producer service attachment in
1017        /// this service connection map.
1018        pub ip: std::string::String,
1019
1020        /// The error type indicates whether the error is consumer facing, producer
1021        /// facing or system internal.
1022        #[deprecated]
1023        pub error_type: crate::model::ConnectionErrorType,
1024
1025        /// The most recent error during operating this connection.
1026        #[deprecated]
1027        pub error: std::option::Option<google_cloud_rpc::model::Status>,
1028
1029        /// The last Compute Engine operation to setup PSC connection.
1030        pub gce_operation: std::string::String,
1031
1032        /// The URI of the consumer forwarding rule created.
1033        /// Example:
1034        /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1035        pub forwarding_rule: std::string::String,
1036
1037        /// Output only. The error info for the latest error during operating this
1038        /// connection.
1039        pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1040
1041        /// Output only. The URI of the selected subnetwork selected to allocate IP
1042        /// address for this connection.
1043        pub selected_subnetwork: std::string::String,
1044
1045        /// Immutable. Deprecated. Use producer_instance_metadata instead.
1046        /// An immutable identifier for the producer instance.
1047        #[deprecated]
1048        pub producer_instance_id: std::string::String,
1049
1050        /// Immutable. An immutable map for the producer instance metadata.
1051        pub producer_instance_metadata:
1052            std::collections::HashMap<std::string::String, std::string::String>,
1053
1054        /// The requested IP version for the PSC connection.
1055        pub ip_version: std::option::Option<crate::model::IPVersion>,
1056
1057        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1058    }
1059
1060    impl ConsumerPscConnection {
1061        /// Creates a new default instance.
1062        pub fn new() -> Self {
1063            std::default::Default::default()
1064        }
1065
1066        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1067        ///
1068        /// # Example
1069        /// ```ignore,no_run
1070        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1071        /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1072        /// ```
1073        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1074            mut self,
1075            v: T,
1076        ) -> Self {
1077            self.service_attachment_uri = v.into();
1078            self
1079        }
1080
1081        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1082        ///
1083        /// # Example
1084        /// ```ignore,no_run
1085        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1086        /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1087        /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1088        /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1089        /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1090        /// ```
1091        pub fn set_state<
1092            T: std::convert::Into<
1093                    crate::model::service_connection_map::consumer_psc_connection::State,
1094                >,
1095        >(
1096            mut self,
1097            v: T,
1098        ) -> Self {
1099            self.state = v.into();
1100            self
1101        }
1102
1103        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1104        ///
1105        /// # Example
1106        /// ```ignore,no_run
1107        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1108        /// let x = ConsumerPscConnection::new().set_project("example");
1109        /// ```
1110        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1111            self.project = v.into();
1112            self
1113        }
1114
1115        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1116        ///
1117        /// # Example
1118        /// ```ignore,no_run
1119        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1120        /// let x = ConsumerPscConnection::new().set_network("example");
1121        /// ```
1122        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1123            self.network = v.into();
1124            self
1125        }
1126
1127        /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1128        ///
1129        /// # Example
1130        /// ```ignore,no_run
1131        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1132        /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1133        /// ```
1134        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1135            mut self,
1136            v: T,
1137        ) -> Self {
1138            self.psc_connection_id = v.into();
1139            self
1140        }
1141
1142        /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1143        ///
1144        /// # Example
1145        /// ```ignore,no_run
1146        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1147        /// let x = ConsumerPscConnection::new().set_ip("example");
1148        /// ```
1149        pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1150            self.ip = v.into();
1151            self
1152        }
1153
1154        /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1155        ///
1156        /// # Example
1157        /// ```ignore,no_run
1158        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1159        /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1160        /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1161        /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1162        /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1163        /// ```
1164        #[deprecated]
1165        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1166            mut self,
1167            v: T,
1168        ) -> Self {
1169            self.error_type = v.into();
1170            self
1171        }
1172
1173        /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1174        ///
1175        /// # Example
1176        /// ```ignore,no_run
1177        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1178        /// use google_cloud_rpc::model::Status;
1179        /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1180        /// ```
1181        #[deprecated]
1182        pub fn set_error<T>(mut self, v: T) -> Self
1183        where
1184            T: std::convert::Into<google_cloud_rpc::model::Status>,
1185        {
1186            self.error = std::option::Option::Some(v.into());
1187            self
1188        }
1189
1190        /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1191        ///
1192        /// # Example
1193        /// ```ignore,no_run
1194        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1195        /// use google_cloud_rpc::model::Status;
1196        /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1197        /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1198        /// ```
1199        #[deprecated]
1200        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1201        where
1202            T: std::convert::Into<google_cloud_rpc::model::Status>,
1203        {
1204            self.error = v.map(|x| x.into());
1205            self
1206        }
1207
1208        /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1209        ///
1210        /// # Example
1211        /// ```ignore,no_run
1212        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1213        /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1214        /// ```
1215        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1216            mut self,
1217            v: T,
1218        ) -> Self {
1219            self.gce_operation = v.into();
1220            self
1221        }
1222
1223        /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1224        ///
1225        /// # Example
1226        /// ```ignore,no_run
1227        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1228        /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1229        /// ```
1230        pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1231            mut self,
1232            v: T,
1233        ) -> Self {
1234            self.forwarding_rule = v.into();
1235            self
1236        }
1237
1238        /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1239        ///
1240        /// # Example
1241        /// ```ignore,no_run
1242        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1243        /// use google_cloud_rpc::model::ErrorInfo;
1244        /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1245        /// ```
1246        pub fn set_error_info<T>(mut self, v: T) -> Self
1247        where
1248            T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1249        {
1250            self.error_info = std::option::Option::Some(v.into());
1251            self
1252        }
1253
1254        /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1255        ///
1256        /// # Example
1257        /// ```ignore,no_run
1258        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1259        /// use google_cloud_rpc::model::ErrorInfo;
1260        /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1261        /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1262        /// ```
1263        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1264        where
1265            T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1266        {
1267            self.error_info = v.map(|x| x.into());
1268            self
1269        }
1270
1271        /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1272        ///
1273        /// # Example
1274        /// ```ignore,no_run
1275        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1276        /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1277        /// ```
1278        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1279            mut self,
1280            v: T,
1281        ) -> Self {
1282            self.selected_subnetwork = v.into();
1283            self
1284        }
1285
1286        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1287        ///
1288        /// # Example
1289        /// ```ignore,no_run
1290        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1291        /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1292        /// ```
1293        #[deprecated]
1294        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1295            mut self,
1296            v: T,
1297        ) -> Self {
1298            self.producer_instance_id = v.into();
1299            self
1300        }
1301
1302        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1303        ///
1304        /// # Example
1305        /// ```ignore,no_run
1306        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1307        /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1308        ///     ("key0", "abc"),
1309        ///     ("key1", "xyz"),
1310        /// ]);
1311        /// ```
1312        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1313        where
1314            T: std::iter::IntoIterator<Item = (K, V)>,
1315            K: std::convert::Into<std::string::String>,
1316            V: std::convert::Into<std::string::String>,
1317        {
1318            use std::iter::Iterator;
1319            self.producer_instance_metadata =
1320                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1321            self
1322        }
1323
1324        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1325        ///
1326        /// # Example
1327        /// ```ignore,no_run
1328        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1329        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1330        /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1331        /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1332        /// ```
1333        pub fn set_ip_version<T>(mut self, v: T) -> Self
1334        where
1335            T: std::convert::Into<crate::model::IPVersion>,
1336        {
1337            self.ip_version = std::option::Option::Some(v.into());
1338            self
1339        }
1340
1341        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1342        ///
1343        /// # Example
1344        /// ```ignore,no_run
1345        /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1346        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1347        /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1348        /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1349        /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1350        /// ```
1351        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1352        where
1353            T: std::convert::Into<crate::model::IPVersion>,
1354        {
1355            self.ip_version = v.map(|x| x.into());
1356            self
1357        }
1358    }
1359
1360    impl wkt::message::Message for ConsumerPscConnection {
1361        fn typename() -> &'static str {
1362            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1363        }
1364    }
1365
1366    /// Defines additional types related to [ConsumerPscConnection].
1367    pub mod consumer_psc_connection {
1368        #[allow(unused_imports)]
1369        use super::*;
1370
1371        /// The state of the PSC connection.
1372        /// We reserve the right to add more states without notice in the future.
1373        /// Users should not use exhaustive switch statements on this enum.
1374        /// See <https://google.aip.dev/216>.
1375        ///
1376        /// # Working with unknown values
1377        ///
1378        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1379        /// additional enum variants at any time. Adding new variants is not considered
1380        /// a breaking change. Applications should write their code in anticipation of:
1381        ///
1382        /// - New values appearing in future releases of the client library, **and**
1383        /// - New values received dynamically, without application changes.
1384        ///
1385        /// Please consult the [Working with enums] section in the user guide for some
1386        /// guidelines.
1387        ///
1388        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1389        #[derive(Clone, Debug, PartialEq)]
1390        #[non_exhaustive]
1391        pub enum State {
1392            /// An invalid state as the default case.
1393            Unspecified,
1394            /// The connection has been created successfully. However, for the
1395            /// up-to-date connection status, please use the service attachment's
1396            /// "ConnectedEndpoint.status" as the source of truth.
1397            Active,
1398            /// The connection is not functional since some resources on the connection
1399            /// fail to be created.
1400            Failed,
1401            /// The connection is being created.
1402            Creating,
1403            /// The connection is being deleted.
1404            Deleting,
1405            /// The connection is being repaired to complete creation.
1406            CreateRepairing,
1407            /// The connection is being repaired to complete deletion.
1408            DeleteRepairing,
1409            /// If set, the enum was initialized with an unknown value.
1410            ///
1411            /// Applications can examine the value using [State::value] or
1412            /// [State::name].
1413            UnknownValue(state::UnknownValue),
1414        }
1415
1416        #[doc(hidden)]
1417        pub mod state {
1418            #[allow(unused_imports)]
1419            use super::*;
1420            #[derive(Clone, Debug, PartialEq)]
1421            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1422        }
1423
1424        impl State {
1425            /// Gets the enum value.
1426            ///
1427            /// Returns `None` if the enum contains an unknown value deserialized from
1428            /// the string representation of enums.
1429            pub fn value(&self) -> std::option::Option<i32> {
1430                match self {
1431                    Self::Unspecified => std::option::Option::Some(0),
1432                    Self::Active => std::option::Option::Some(1),
1433                    Self::Failed => std::option::Option::Some(2),
1434                    Self::Creating => std::option::Option::Some(3),
1435                    Self::Deleting => std::option::Option::Some(4),
1436                    Self::CreateRepairing => std::option::Option::Some(5),
1437                    Self::DeleteRepairing => std::option::Option::Some(6),
1438                    Self::UnknownValue(u) => u.0.value(),
1439                }
1440            }
1441
1442            /// Gets the enum value as a string.
1443            ///
1444            /// Returns `None` if the enum contains an unknown value deserialized from
1445            /// the integer representation of enums.
1446            pub fn name(&self) -> std::option::Option<&str> {
1447                match self {
1448                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1449                    Self::Active => std::option::Option::Some("ACTIVE"),
1450                    Self::Failed => std::option::Option::Some("FAILED"),
1451                    Self::Creating => std::option::Option::Some("CREATING"),
1452                    Self::Deleting => std::option::Option::Some("DELETING"),
1453                    Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1454                    Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1455                    Self::UnknownValue(u) => u.0.name(),
1456                }
1457            }
1458        }
1459
1460        impl std::default::Default for State {
1461            fn default() -> Self {
1462                use std::convert::From;
1463                Self::from(0)
1464            }
1465        }
1466
1467        impl std::fmt::Display for State {
1468            fn fmt(
1469                &self,
1470                f: &mut std::fmt::Formatter<'_>,
1471            ) -> std::result::Result<(), std::fmt::Error> {
1472                wkt::internal::display_enum(f, self.name(), self.value())
1473            }
1474        }
1475
1476        impl std::convert::From<i32> for State {
1477            fn from(value: i32) -> Self {
1478                match value {
1479                    0 => Self::Unspecified,
1480                    1 => Self::Active,
1481                    2 => Self::Failed,
1482                    3 => Self::Creating,
1483                    4 => Self::Deleting,
1484                    5 => Self::CreateRepairing,
1485                    6 => Self::DeleteRepairing,
1486                    _ => Self::UnknownValue(state::UnknownValue(
1487                        wkt::internal::UnknownEnumValue::Integer(value),
1488                    )),
1489                }
1490            }
1491        }
1492
1493        impl std::convert::From<&str> for State {
1494            fn from(value: &str) -> Self {
1495                use std::string::ToString;
1496                match value {
1497                    "STATE_UNSPECIFIED" => Self::Unspecified,
1498                    "ACTIVE" => Self::Active,
1499                    "FAILED" => Self::Failed,
1500                    "CREATING" => Self::Creating,
1501                    "DELETING" => Self::Deleting,
1502                    "CREATE_REPAIRING" => Self::CreateRepairing,
1503                    "DELETE_REPAIRING" => Self::DeleteRepairing,
1504                    _ => Self::UnknownValue(state::UnknownValue(
1505                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1506                    )),
1507                }
1508            }
1509        }
1510
1511        impl serde::ser::Serialize for State {
1512            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1513            where
1514                S: serde::Serializer,
1515            {
1516                match self {
1517                    Self::Unspecified => serializer.serialize_i32(0),
1518                    Self::Active => serializer.serialize_i32(1),
1519                    Self::Failed => serializer.serialize_i32(2),
1520                    Self::Creating => serializer.serialize_i32(3),
1521                    Self::Deleting => serializer.serialize_i32(4),
1522                    Self::CreateRepairing => serializer.serialize_i32(5),
1523                    Self::DeleteRepairing => serializer.serialize_i32(6),
1524                    Self::UnknownValue(u) => u.0.serialize(serializer),
1525                }
1526            }
1527        }
1528
1529        impl<'de> serde::de::Deserialize<'de> for State {
1530            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1531            where
1532                D: serde::Deserializer<'de>,
1533            {
1534                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1535                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1536            }
1537        }
1538    }
1539}
1540
1541/// Request for ListServiceConnectionMaps.
1542#[derive(Clone, Default, PartialEq)]
1543#[non_exhaustive]
1544pub struct ListServiceConnectionMapsRequest {
1545    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1546    pub parent: std::string::String,
1547
1548    /// The maximum number of results per page that should be returned.
1549    pub page_size: i32,
1550
1551    /// The page token.
1552    pub page_token: std::string::String,
1553
1554    /// A filter expression that filters the results listed in the response.
1555    pub filter: std::string::String,
1556
1557    /// Sort the results by a certain order.
1558    pub order_by: std::string::String,
1559
1560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1561}
1562
1563impl ListServiceConnectionMapsRequest {
1564    /// Creates a new default instance.
1565    pub fn new() -> Self {
1566        std::default::Default::default()
1567    }
1568
1569    /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1570    ///
1571    /// # Example
1572    /// ```ignore,no_run
1573    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1574    /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1575    /// ```
1576    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1577        self.parent = v.into();
1578        self
1579    }
1580
1581    /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1582    ///
1583    /// # Example
1584    /// ```ignore,no_run
1585    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1586    /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1587    /// ```
1588    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1589        self.page_size = v.into();
1590        self
1591    }
1592
1593    /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1594    ///
1595    /// # Example
1596    /// ```ignore,no_run
1597    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1598    /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1599    /// ```
1600    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1601        self.page_token = v.into();
1602        self
1603    }
1604
1605    /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1606    ///
1607    /// # Example
1608    /// ```ignore,no_run
1609    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1610    /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1611    /// ```
1612    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1613        self.filter = v.into();
1614        self
1615    }
1616
1617    /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1618    ///
1619    /// # Example
1620    /// ```ignore,no_run
1621    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1622    /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1623    /// ```
1624    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1625        self.order_by = v.into();
1626        self
1627    }
1628}
1629
1630impl wkt::message::Message for ListServiceConnectionMapsRequest {
1631    fn typename() -> &'static str {
1632        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1633    }
1634}
1635
1636/// Response for ListServiceConnectionMaps.
1637#[derive(Clone, Default, PartialEq)]
1638#[non_exhaustive]
1639pub struct ListServiceConnectionMapsResponse {
1640    /// ServiceConnectionMaps to be returned.
1641    pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1642
1643    /// The next pagination token in the List response. It should be used as
1644    /// page_token for the following request. An empty value means no more result.
1645    pub next_page_token: std::string::String,
1646
1647    /// Locations that could not be reached.
1648    pub unreachable: std::vec::Vec<std::string::String>,
1649
1650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1651}
1652
1653impl ListServiceConnectionMapsResponse {
1654    /// Creates a new default instance.
1655    pub fn new() -> Self {
1656        std::default::Default::default()
1657    }
1658
1659    /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1660    ///
1661    /// # Example
1662    /// ```ignore,no_run
1663    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1664    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1665    /// let x = ListServiceConnectionMapsResponse::new()
1666    ///     .set_service_connection_maps([
1667    ///         ServiceConnectionMap::default()/* use setters */,
1668    ///         ServiceConnectionMap::default()/* use (different) setters */,
1669    ///     ]);
1670    /// ```
1671    pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1672    where
1673        T: std::iter::IntoIterator<Item = V>,
1674        V: std::convert::Into<crate::model::ServiceConnectionMap>,
1675    {
1676        use std::iter::Iterator;
1677        self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1678        self
1679    }
1680
1681    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1682    ///
1683    /// # Example
1684    /// ```ignore,no_run
1685    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1686    /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1687    /// ```
1688    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1689        self.next_page_token = v.into();
1690        self
1691    }
1692
1693    /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1694    ///
1695    /// # Example
1696    /// ```ignore,no_run
1697    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1698    /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1699    /// ```
1700    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1701    where
1702        T: std::iter::IntoIterator<Item = V>,
1703        V: std::convert::Into<std::string::String>,
1704    {
1705        use std::iter::Iterator;
1706        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1707        self
1708    }
1709}
1710
1711impl wkt::message::Message for ListServiceConnectionMapsResponse {
1712    fn typename() -> &'static str {
1713        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1714    }
1715}
1716
1717#[doc(hidden)]
1718impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1719    type PageItem = crate::model::ServiceConnectionMap;
1720
1721    fn items(self) -> std::vec::Vec<Self::PageItem> {
1722        self.service_connection_maps
1723    }
1724
1725    fn next_page_token(&self) -> std::string::String {
1726        use std::clone::Clone;
1727        self.next_page_token.clone()
1728    }
1729}
1730
1731/// Request for GetServiceConnectionMap.
1732#[derive(Clone, Default, PartialEq)]
1733#[non_exhaustive]
1734pub struct GetServiceConnectionMapRequest {
1735    /// Required. Name of the ServiceConnectionMap to get.
1736    pub name: std::string::String,
1737
1738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1739}
1740
1741impl GetServiceConnectionMapRequest {
1742    /// Creates a new default instance.
1743    pub fn new() -> Self {
1744        std::default::Default::default()
1745    }
1746
1747    /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1748    ///
1749    /// # Example
1750    /// ```ignore,no_run
1751    /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1752    /// let x = GetServiceConnectionMapRequest::new().set_name("example");
1753    /// ```
1754    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1755        self.name = v.into();
1756        self
1757    }
1758}
1759
1760impl wkt::message::Message for GetServiceConnectionMapRequest {
1761    fn typename() -> &'static str {
1762        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1763    }
1764}
1765
1766/// Request for CreateServiceConnectionMap.
1767#[derive(Clone, Default, PartialEq)]
1768#[non_exhaustive]
1769pub struct CreateServiceConnectionMapRequest {
1770    /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1771    /// projects/123/locations/us-east1
1772    pub parent: std::string::String,
1773
1774    /// Optional. Resource ID
1775    /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1776    /// See <https://google.aip.dev/122#resource-id-segments>
1777    /// Unique per location.
1778    /// If one is not provided, one will be generated.
1779    pub service_connection_map_id: std::string::String,
1780
1781    /// Required. Initial values for a new ServiceConnectionMaps
1782    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1783
1784    /// Optional. An optional request ID to identify requests. Specify a unique
1785    /// request ID so that if you must retry your request, the server will know to
1786    /// ignore the request if it has already been completed. The server will
1787    /// guarantee that for at least 60 minutes since the first request.
1788    ///
1789    /// For example, consider a situation where you make an initial request and
1790    /// the request times out. If you make the request again with the same request
1791    /// ID, the server can check if original operation with the same request ID
1792    /// was received, and if so, will ignore the second request. This prevents
1793    /// clients from accidentally creating duplicate commitments.
1794    ///
1795    /// The request ID must be a valid UUID with the exception that zero UUID is
1796    /// not supported (00000000-0000-0000-0000-000000000000).
1797    pub request_id: std::string::String,
1798
1799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1800}
1801
1802impl CreateServiceConnectionMapRequest {
1803    /// Creates a new default instance.
1804    pub fn new() -> Self {
1805        std::default::Default::default()
1806    }
1807
1808    /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1809    ///
1810    /// # Example
1811    /// ```ignore,no_run
1812    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1813    /// let x = CreateServiceConnectionMapRequest::new().set_parent("example");
1814    /// ```
1815    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1816        self.parent = v.into();
1817        self
1818    }
1819
1820    /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1821    ///
1822    /// # Example
1823    /// ```ignore,no_run
1824    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1825    /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1826    /// ```
1827    pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1828        mut self,
1829        v: T,
1830    ) -> Self {
1831        self.service_connection_map_id = v.into();
1832        self
1833    }
1834
1835    /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1836    ///
1837    /// # Example
1838    /// ```ignore,no_run
1839    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1840    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1841    /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1842    /// ```
1843    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1844    where
1845        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1846    {
1847        self.service_connection_map = std::option::Option::Some(v.into());
1848        self
1849    }
1850
1851    /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1852    ///
1853    /// # Example
1854    /// ```ignore,no_run
1855    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1856    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1857    /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1858    /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1859    /// ```
1860    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1861    where
1862        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1863    {
1864        self.service_connection_map = v.map(|x| x.into());
1865        self
1866    }
1867
1868    /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1869    ///
1870    /// # Example
1871    /// ```ignore,no_run
1872    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1873    /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1874    /// ```
1875    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1876        self.request_id = v.into();
1877        self
1878    }
1879}
1880
1881impl wkt::message::Message for CreateServiceConnectionMapRequest {
1882    fn typename() -> &'static str {
1883        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1884    }
1885}
1886
1887/// Request for UpdateServiceConnectionMap.
1888#[derive(Clone, Default, PartialEq)]
1889#[non_exhaustive]
1890pub struct UpdateServiceConnectionMapRequest {
1891    /// Optional. Field mask is used to specify the fields to be overwritten in the
1892    /// ServiceConnectionMap resource by the update.
1893    /// The fields specified in the update_mask are relative to the resource, not
1894    /// the full request. A field will be overwritten if it is in the mask. If the
1895    /// user does not provide a mask then all fields will be overwritten.
1896    pub update_mask: std::option::Option<wkt::FieldMask>,
1897
1898    /// Required. New values to be patched into the resource.
1899    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1900
1901    /// Optional. An optional request ID to identify requests. Specify a unique
1902    /// request ID so that if you must retry your request, the server will know to
1903    /// ignore the request if it has already been completed. The server will
1904    /// guarantee that for at least 60 minutes since the first request.
1905    ///
1906    /// For example, consider a situation where you make an initial request and
1907    /// the request times out. If you make the request again with the same request
1908    /// ID, the server can check if original operation with the same request ID
1909    /// was received, and if so, will ignore the second request. This prevents
1910    /// clients from accidentally creating duplicate commitments.
1911    ///
1912    /// The request ID must be a valid UUID with the exception that zero UUID is
1913    /// not supported (00000000-0000-0000-0000-000000000000).
1914    pub request_id: std::string::String,
1915
1916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1917}
1918
1919impl UpdateServiceConnectionMapRequest {
1920    /// Creates a new default instance.
1921    pub fn new() -> Self {
1922        std::default::Default::default()
1923    }
1924
1925    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1926    ///
1927    /// # Example
1928    /// ```ignore,no_run
1929    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1930    /// use wkt::FieldMask;
1931    /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1932    /// ```
1933    pub fn set_update_mask<T>(mut self, v: T) -> Self
1934    where
1935        T: std::convert::Into<wkt::FieldMask>,
1936    {
1937        self.update_mask = std::option::Option::Some(v.into());
1938        self
1939    }
1940
1941    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1942    ///
1943    /// # Example
1944    /// ```ignore,no_run
1945    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1946    /// use wkt::FieldMask;
1947    /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1948    /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1949    /// ```
1950    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1951    where
1952        T: std::convert::Into<wkt::FieldMask>,
1953    {
1954        self.update_mask = v.map(|x| x.into());
1955        self
1956    }
1957
1958    /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1959    ///
1960    /// # Example
1961    /// ```ignore,no_run
1962    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1963    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1964    /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1965    /// ```
1966    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1967    where
1968        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1969    {
1970        self.service_connection_map = std::option::Option::Some(v.into());
1971        self
1972    }
1973
1974    /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1975    ///
1976    /// # Example
1977    /// ```ignore,no_run
1978    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1979    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1980    /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1981    /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1982    /// ```
1983    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1984    where
1985        T: std::convert::Into<crate::model::ServiceConnectionMap>,
1986    {
1987        self.service_connection_map = v.map(|x| x.into());
1988        self
1989    }
1990
1991    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1992    ///
1993    /// # Example
1994    /// ```ignore,no_run
1995    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1996    /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
1997    /// ```
1998    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1999        self.request_id = v.into();
2000        self
2001    }
2002}
2003
2004impl wkt::message::Message for UpdateServiceConnectionMapRequest {
2005    fn typename() -> &'static str {
2006        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
2007    }
2008}
2009
2010/// Request for DeleteServiceConnectionMap.
2011#[derive(Clone, Default, PartialEq)]
2012#[non_exhaustive]
2013pub struct DeleteServiceConnectionMapRequest {
2014    /// Required. The name of the ServiceConnectionMap to delete.
2015    pub name: std::string::String,
2016
2017    /// Optional. An optional request ID to identify requests. Specify a unique
2018    /// request ID so that if you must retry your request, the server will know to
2019    /// ignore the request if it has already been completed. The server will
2020    /// guarantee that for at least 60 minutes after the first request.
2021    ///
2022    /// For example, consider a situation where you make an initial request and
2023    /// the request times out. If you make the request again with the same request
2024    /// ID, the server can check if original operation with the same request ID
2025    /// was received, and if so, will ignore the second request. This prevents
2026    /// clients from accidentally creating duplicate commitments.
2027    ///
2028    /// The request ID must be a valid UUID with the exception that zero UUID is
2029    /// not supported (00000000-0000-0000-0000-000000000000).
2030    pub request_id: std::string::String,
2031
2032    /// Optional. The etag is computed by the server, and may be sent on update and
2033    /// delete requests to ensure the client has an up-to-date value before
2034    /// proceeding.
2035    pub etag: std::option::Option<std::string::String>,
2036
2037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2038}
2039
2040impl DeleteServiceConnectionMapRequest {
2041    /// Creates a new default instance.
2042    pub fn new() -> Self {
2043        std::default::Default::default()
2044    }
2045
2046    /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2051    /// let x = DeleteServiceConnectionMapRequest::new().set_name("example");
2052    /// ```
2053    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054        self.name = v.into();
2055        self
2056    }
2057
2058    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2059    ///
2060    /// # Example
2061    /// ```ignore,no_run
2062    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2063    /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2064    /// ```
2065    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2066        self.request_id = v.into();
2067        self
2068    }
2069
2070    /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2071    ///
2072    /// # Example
2073    /// ```ignore,no_run
2074    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2075    /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2076    /// ```
2077    pub fn set_etag<T>(mut self, v: T) -> Self
2078    where
2079        T: std::convert::Into<std::string::String>,
2080    {
2081        self.etag = std::option::Option::Some(v.into());
2082        self
2083    }
2084
2085    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2086    ///
2087    /// # Example
2088    /// ```ignore,no_run
2089    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2090    /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2091    /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2092    /// ```
2093    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2094    where
2095        T: std::convert::Into<std::string::String>,
2096    {
2097        self.etag = v.map(|x| x.into());
2098        self
2099    }
2100}
2101
2102impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2103    fn typename() -> &'static str {
2104        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2105    }
2106}
2107
2108/// The ServiceConnectionPolicy resource.
2109#[derive(Clone, Default, PartialEq)]
2110#[non_exhaustive]
2111pub struct ServiceConnectionPolicy {
2112    /// Immutable. The name of a ServiceConnectionPolicy.
2113    /// Format:
2114    /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2115    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2116    pub name: std::string::String,
2117
2118    /// Output only. Time when the ServiceConnectionPolicy was created.
2119    pub create_time: std::option::Option<wkt::Timestamp>,
2120
2121    /// Output only. Time when the ServiceConnectionPolicy was updated.
2122    pub update_time: std::option::Option<wkt::Timestamp>,
2123
2124    /// User-defined labels.
2125    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2126
2127    /// A description of this resource.
2128    pub description: std::string::String,
2129
2130    /// The resource path of the consumer network.
2131    /// Example:
2132    ///
2133    /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2134    pub network: std::string::String,
2135
2136    /// The service class identifier for which this ServiceConnectionPolicy is for.
2137    /// The service class identifier is a unique, symbolic representation of a
2138    /// ServiceClass. It is provided by the Service Producer. Google services have
2139    /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2140    /// google-cloud-sql. 3rd party services do not. For example,
2141    /// test-service-a3dfcx.
2142    pub service_class: std::string::String,
2143
2144    /// Output only. The type of underlying resources used to create the
2145    /// connection.
2146    pub infrastructure: crate::model::Infrastructure,
2147
2148    /// Configuration used for Private Service Connect connections. Used when
2149    /// Infrastructure is PSC.
2150    pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2151
2152    /// Output only. [Output only] Information about each Private Service Connect
2153    /// connection.
2154    pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2155
2156    /// Optional. The etag is computed by the server, and may be sent on update and
2157    /// delete requests to ensure the client has an up-to-date value before
2158    /// proceeding.
2159    pub etag: std::option::Option<std::string::String>,
2160
2161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2162}
2163
2164impl ServiceConnectionPolicy {
2165    /// Creates a new default instance.
2166    pub fn new() -> Self {
2167        std::default::Default::default()
2168    }
2169
2170    /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2171    ///
2172    /// # Example
2173    /// ```ignore,no_run
2174    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2175    /// let x = ServiceConnectionPolicy::new().set_name("example");
2176    /// ```
2177    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2178        self.name = v.into();
2179        self
2180    }
2181
2182    /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2183    ///
2184    /// # Example
2185    /// ```ignore,no_run
2186    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2187    /// use wkt::Timestamp;
2188    /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2189    /// ```
2190    pub fn set_create_time<T>(mut self, v: T) -> Self
2191    where
2192        T: std::convert::Into<wkt::Timestamp>,
2193    {
2194        self.create_time = std::option::Option::Some(v.into());
2195        self
2196    }
2197
2198    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2199    ///
2200    /// # Example
2201    /// ```ignore,no_run
2202    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2203    /// use wkt::Timestamp;
2204    /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2205    /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2206    /// ```
2207    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2208    where
2209        T: std::convert::Into<wkt::Timestamp>,
2210    {
2211        self.create_time = v.map(|x| x.into());
2212        self
2213    }
2214
2215    /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2216    ///
2217    /// # Example
2218    /// ```ignore,no_run
2219    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2220    /// use wkt::Timestamp;
2221    /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2222    /// ```
2223    pub fn set_update_time<T>(mut self, v: T) -> Self
2224    where
2225        T: std::convert::Into<wkt::Timestamp>,
2226    {
2227        self.update_time = std::option::Option::Some(v.into());
2228        self
2229    }
2230
2231    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2232    ///
2233    /// # Example
2234    /// ```ignore,no_run
2235    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2236    /// use wkt::Timestamp;
2237    /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2238    /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2239    /// ```
2240    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2241    where
2242        T: std::convert::Into<wkt::Timestamp>,
2243    {
2244        self.update_time = v.map(|x| x.into());
2245        self
2246    }
2247
2248    /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2249    ///
2250    /// # Example
2251    /// ```ignore,no_run
2252    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2253    /// let x = ServiceConnectionPolicy::new().set_labels([
2254    ///     ("key0", "abc"),
2255    ///     ("key1", "xyz"),
2256    /// ]);
2257    /// ```
2258    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2259    where
2260        T: std::iter::IntoIterator<Item = (K, V)>,
2261        K: std::convert::Into<std::string::String>,
2262        V: std::convert::Into<std::string::String>,
2263    {
2264        use std::iter::Iterator;
2265        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2266        self
2267    }
2268
2269    /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2270    ///
2271    /// # Example
2272    /// ```ignore,no_run
2273    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2274    /// let x = ServiceConnectionPolicy::new().set_description("example");
2275    /// ```
2276    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277        self.description = v.into();
2278        self
2279    }
2280
2281    /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2282    ///
2283    /// # Example
2284    /// ```ignore,no_run
2285    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2286    /// let x = ServiceConnectionPolicy::new().set_network("example");
2287    /// ```
2288    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2289        self.network = v.into();
2290        self
2291    }
2292
2293    /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2294    ///
2295    /// # Example
2296    /// ```ignore,no_run
2297    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2298    /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2299    /// ```
2300    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2301        self.service_class = v.into();
2302        self
2303    }
2304
2305    /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2306    ///
2307    /// # Example
2308    /// ```ignore,no_run
2309    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2310    /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2311    /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2312    /// ```
2313    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2314        mut self,
2315        v: T,
2316    ) -> Self {
2317        self.infrastructure = v.into();
2318        self
2319    }
2320
2321    /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2322    ///
2323    /// # Example
2324    /// ```ignore,no_run
2325    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2326    /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2327    /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2328    /// ```
2329    pub fn set_psc_config<T>(mut self, v: T) -> Self
2330    where
2331        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2332    {
2333        self.psc_config = std::option::Option::Some(v.into());
2334        self
2335    }
2336
2337    /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2338    ///
2339    /// # Example
2340    /// ```ignore,no_run
2341    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2342    /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2343    /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2344    /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2345    /// ```
2346    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2347    where
2348        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2349    {
2350        self.psc_config = v.map(|x| x.into());
2351        self
2352    }
2353
2354    /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2355    ///
2356    /// # Example
2357    /// ```ignore,no_run
2358    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2359    /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2360    /// let x = ServiceConnectionPolicy::new()
2361    ///     .set_psc_connections([
2362    ///         PscConnection::default()/* use setters */,
2363    ///         PscConnection::default()/* use (different) setters */,
2364    ///     ]);
2365    /// ```
2366    pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2367    where
2368        T: std::iter::IntoIterator<Item = V>,
2369        V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2370    {
2371        use std::iter::Iterator;
2372        self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2373        self
2374    }
2375
2376    /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2377    ///
2378    /// # Example
2379    /// ```ignore,no_run
2380    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2381    /// let x = ServiceConnectionPolicy::new().set_etag("example");
2382    /// ```
2383    pub fn set_etag<T>(mut self, v: T) -> Self
2384    where
2385        T: std::convert::Into<std::string::String>,
2386    {
2387        self.etag = std::option::Option::Some(v.into());
2388        self
2389    }
2390
2391    /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2392    ///
2393    /// # Example
2394    /// ```ignore,no_run
2395    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2396    /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2397    /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2398    /// ```
2399    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2400    where
2401        T: std::convert::Into<std::string::String>,
2402    {
2403        self.etag = v.map(|x| x.into());
2404        self
2405    }
2406}
2407
2408impl wkt::message::Message for ServiceConnectionPolicy {
2409    fn typename() -> &'static str {
2410        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2411    }
2412}
2413
2414/// Defines additional types related to [ServiceConnectionPolicy].
2415pub mod service_connection_policy {
2416    #[allow(unused_imports)]
2417    use super::*;
2418
2419    /// Configuration used for Private Service Connect connections. Used when
2420    /// Infrastructure is PSC.
2421    #[derive(Clone, Default, PartialEq)]
2422    #[non_exhaustive]
2423    pub struct PscConfig {
2424        /// The resource paths of subnetworks to use for IP address management.
2425        /// Example:
2426        /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2427        pub subnetworks: std::vec::Vec<std::string::String>,
2428
2429        /// Optional. Max number of PSC connections for this policy.
2430        pub limit: std::option::Option<i64>,
2431
2432        /// Required. ProducerInstanceLocation is used to specify which authorization
2433        /// mechanism to use to determine which projects the Producer instance can be
2434        /// within.
2435        pub producer_instance_location:
2436            crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2437
2438        /// Optional. List of Projects, Folders, or Organizations from where the
2439        /// Producer instance can be within. For example, a network administrator can
2440        /// provide both 'organizations/foo' and 'projects/bar' as
2441        /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2442        /// network to connect with any Producer instance within the 'foo'
2443        /// organization or the 'bar' project. By default,
2444        /// allowed_google_producers_resource_hierarchy_level is empty. The format
2445        /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2446        /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2447        /// 'organizations' and \<id\> is either the ID or the number of the resource
2448        /// type. Format for each allowed_google_producers_resource_hierarchy_level
2449        /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2450        /// 'organizations/<organization_id>'
2451        /// Eg. [projects/my-project-id, projects/567, folders/891,
2452        /// organizations/123]
2453        pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2454
2455        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2456    }
2457
2458    impl PscConfig {
2459        /// Creates a new default instance.
2460        pub fn new() -> Self {
2461            std::default::Default::default()
2462        }
2463
2464        /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2465        ///
2466        /// # Example
2467        /// ```ignore,no_run
2468        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2469        /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2470        /// ```
2471        pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2472        where
2473            T: std::iter::IntoIterator<Item = V>,
2474            V: std::convert::Into<std::string::String>,
2475        {
2476            use std::iter::Iterator;
2477            self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2478            self
2479        }
2480
2481        /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2482        ///
2483        /// # Example
2484        /// ```ignore,no_run
2485        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2486        /// let x = PscConfig::new().set_limit(42);
2487        /// ```
2488        pub fn set_limit<T>(mut self, v: T) -> Self
2489        where
2490            T: std::convert::Into<i64>,
2491        {
2492            self.limit = std::option::Option::Some(v.into());
2493            self
2494        }
2495
2496        /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2497        ///
2498        /// # Example
2499        /// ```ignore,no_run
2500        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2501        /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2502        /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2503        /// ```
2504        pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2505        where
2506            T: std::convert::Into<i64>,
2507        {
2508            self.limit = v.map(|x| x.into());
2509            self
2510        }
2511
2512        /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2513        ///
2514        /// # Example
2515        /// ```ignore,no_run
2516        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2517        /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2518        /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2519        /// ```
2520        pub fn set_producer_instance_location<
2521            T: std::convert::Into<
2522                    crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2523                >,
2524        >(
2525            mut self,
2526            v: T,
2527        ) -> Self {
2528            self.producer_instance_location = v.into();
2529            self
2530        }
2531
2532        /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2533        ///
2534        /// # Example
2535        /// ```ignore,no_run
2536        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2537        /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2538        /// ```
2539        pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2540        where
2541            T: std::iter::IntoIterator<Item = V>,
2542            V: std::convert::Into<std::string::String>,
2543        {
2544            use std::iter::Iterator;
2545            self.allowed_google_producers_resource_hierarchy_level =
2546                v.into_iter().map(|i| i.into()).collect();
2547            self
2548        }
2549    }
2550
2551    impl wkt::message::Message for PscConfig {
2552        fn typename() -> &'static str {
2553            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2554        }
2555    }
2556
2557    /// Defines additional types related to [PscConfig].
2558    pub mod psc_config {
2559        #[allow(unused_imports)]
2560        use super::*;
2561
2562        /// ProducerInstanceLocation is used to specify which authorization mechanism
2563        /// to use to determine which projects the Producer instance can be within.
2564        ///
2565        /// # Working with unknown values
2566        ///
2567        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2568        /// additional enum variants at any time. Adding new variants is not considered
2569        /// a breaking change. Applications should write their code in anticipation of:
2570        ///
2571        /// - New values appearing in future releases of the client library, **and**
2572        /// - New values received dynamically, without application changes.
2573        ///
2574        /// Please consult the [Working with enums] section in the user guide for some
2575        /// guidelines.
2576        ///
2577        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2578        #[derive(Clone, Debug, PartialEq)]
2579        #[non_exhaustive]
2580        pub enum ProducerInstanceLocation {
2581            /// Producer instance location is not specified. When this option is
2582            /// chosen, then the PSC connections created by this
2583            /// ServiceConnectionPolicy must be within the same project as the Producer
2584            /// instance. This is the default ProducerInstanceLocation value.
2585            /// To allow for PSC connections from this network to other networks, use
2586            /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2587            Unspecified,
2588            /// Producer instance must be within one of the values provided in
2589            /// allowed_google_producers_resource_hierarchy_level.
2590            CustomResourceHierarchyLevels,
2591            /// If set, the enum was initialized with an unknown value.
2592            ///
2593            /// Applications can examine the value using [ProducerInstanceLocation::value] or
2594            /// [ProducerInstanceLocation::name].
2595            UnknownValue(producer_instance_location::UnknownValue),
2596        }
2597
2598        #[doc(hidden)]
2599        pub mod producer_instance_location {
2600            #[allow(unused_imports)]
2601            use super::*;
2602            #[derive(Clone, Debug, PartialEq)]
2603            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2604        }
2605
2606        impl ProducerInstanceLocation {
2607            /// Gets the enum value.
2608            ///
2609            /// Returns `None` if the enum contains an unknown value deserialized from
2610            /// the string representation of enums.
2611            pub fn value(&self) -> std::option::Option<i32> {
2612                match self {
2613                    Self::Unspecified => std::option::Option::Some(0),
2614                    Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2615                    Self::UnknownValue(u) => u.0.value(),
2616                }
2617            }
2618
2619            /// Gets the enum value as a string.
2620            ///
2621            /// Returns `None` if the enum contains an unknown value deserialized from
2622            /// the integer representation of enums.
2623            pub fn name(&self) -> std::option::Option<&str> {
2624                match self {
2625                    Self::Unspecified => {
2626                        std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2627                    }
2628                    Self::CustomResourceHierarchyLevels => {
2629                        std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2630                    }
2631                    Self::UnknownValue(u) => u.0.name(),
2632                }
2633            }
2634        }
2635
2636        impl std::default::Default for ProducerInstanceLocation {
2637            fn default() -> Self {
2638                use std::convert::From;
2639                Self::from(0)
2640            }
2641        }
2642
2643        impl std::fmt::Display for ProducerInstanceLocation {
2644            fn fmt(
2645                &self,
2646                f: &mut std::fmt::Formatter<'_>,
2647            ) -> std::result::Result<(), std::fmt::Error> {
2648                wkt::internal::display_enum(f, self.name(), self.value())
2649            }
2650        }
2651
2652        impl std::convert::From<i32> for ProducerInstanceLocation {
2653            fn from(value: i32) -> Self {
2654                match value {
2655                    0 => Self::Unspecified,
2656                    1 => Self::CustomResourceHierarchyLevels,
2657                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2658                        wkt::internal::UnknownEnumValue::Integer(value),
2659                    )),
2660                }
2661            }
2662        }
2663
2664        impl std::convert::From<&str> for ProducerInstanceLocation {
2665            fn from(value: &str) -> Self {
2666                use std::string::ToString;
2667                match value {
2668                    "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2669                    "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2670                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2671                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2672                    )),
2673                }
2674            }
2675        }
2676
2677        impl serde::ser::Serialize for ProducerInstanceLocation {
2678            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2679            where
2680                S: serde::Serializer,
2681            {
2682                match self {
2683                    Self::Unspecified => serializer.serialize_i32(0),
2684                    Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2685                    Self::UnknownValue(u) => u.0.serialize(serializer),
2686                }
2687            }
2688        }
2689
2690        impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2691            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2692            where
2693                D: serde::Deserializer<'de>,
2694            {
2695                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2696                    ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2697            }
2698        }
2699    }
2700
2701    /// Information about a specific Private Service Connect connection.
2702    #[derive(Clone, Default, PartialEq)]
2703    #[non_exhaustive]
2704    pub struct PscConnection {
2705        /// State of the PSC Connection
2706        pub state: crate::model::service_connection_policy::State,
2707
2708        /// The resource reference of the PSC Forwarding Rule within the consumer
2709        /// VPC.
2710        pub consumer_forwarding_rule: std::string::String,
2711
2712        /// The resource reference of the consumer address.
2713        pub consumer_address: std::string::String,
2714
2715        /// The error type indicates whether the error is consumer facing, producer
2716        /// facing or system internal.
2717        #[deprecated]
2718        pub error_type: crate::model::ConnectionErrorType,
2719
2720        /// The most recent error during operating this connection.
2721        /// Deprecated, please use error_info instead.
2722        #[deprecated]
2723        pub error: std::option::Option<google_cloud_rpc::model::Status>,
2724
2725        /// The last Compute Engine operation to setup PSC connection.
2726        pub gce_operation: std::string::String,
2727
2728        /// The project where the PSC connection is created.
2729        pub consumer_target_project: std::string::String,
2730
2731        /// The PSC connection id of the PSC forwarding rule.
2732        pub psc_connection_id: std::string::String,
2733
2734        /// Output only. The error info for the latest error during operating this
2735        /// connection.
2736        pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
2737
2738        /// Output only. The URI of the subnetwork selected to allocate IP address
2739        /// for this connection.
2740        pub selected_subnetwork: std::string::String,
2741
2742        /// Immutable. Deprecated. Use producer_instance_metadata instead.
2743        /// An immutable identifier for the producer instance.
2744        #[deprecated]
2745        pub producer_instance_id: std::string::String,
2746
2747        /// Immutable. An immutable map for the producer instance metadata.
2748        pub producer_instance_metadata:
2749            std::collections::HashMap<std::string::String, std::string::String>,
2750
2751        /// Output only. [Output only] The service class associated with this PSC
2752        /// Connection. The value is derived from the SCPolicy and matches the
2753        /// service class name provided by the customer.
2754        pub service_class: std::string::String,
2755
2756        /// The requested IP version for the PSC connection.
2757        pub ip_version: std::option::Option<crate::model::IPVersion>,
2758
2759        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2760    }
2761
2762    impl PscConnection {
2763        /// Creates a new default instance.
2764        pub fn new() -> Self {
2765            std::default::Default::default()
2766        }
2767
2768        /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2769        ///
2770        /// # Example
2771        /// ```ignore,no_run
2772        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2773        /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2774        /// let x0 = PscConnection::new().set_state(State::Active);
2775        /// let x1 = PscConnection::new().set_state(State::Failed);
2776        /// let x2 = PscConnection::new().set_state(State::Creating);
2777        /// ```
2778        pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2779            mut self,
2780            v: T,
2781        ) -> Self {
2782            self.state = v.into();
2783            self
2784        }
2785
2786        /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2787        ///
2788        /// # Example
2789        /// ```ignore,no_run
2790        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2791        /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2792        /// ```
2793        pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2794            mut self,
2795            v: T,
2796        ) -> Self {
2797            self.consumer_forwarding_rule = v.into();
2798            self
2799        }
2800
2801        /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2802        ///
2803        /// # Example
2804        /// ```ignore,no_run
2805        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2806        /// let x = PscConnection::new().set_consumer_address("example");
2807        /// ```
2808        pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2809            mut self,
2810            v: T,
2811        ) -> Self {
2812            self.consumer_address = v.into();
2813            self
2814        }
2815
2816        /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2817        ///
2818        /// # Example
2819        /// ```ignore,no_run
2820        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2821        /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2822        /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2823        /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2824        /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2825        /// ```
2826        #[deprecated]
2827        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2828            mut self,
2829            v: T,
2830        ) -> Self {
2831            self.error_type = v.into();
2832            self
2833        }
2834
2835        /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2836        ///
2837        /// # Example
2838        /// ```ignore,no_run
2839        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2840        /// use google_cloud_rpc::model::Status;
2841        /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2842        /// ```
2843        #[deprecated]
2844        pub fn set_error<T>(mut self, v: T) -> Self
2845        where
2846            T: std::convert::Into<google_cloud_rpc::model::Status>,
2847        {
2848            self.error = std::option::Option::Some(v.into());
2849            self
2850        }
2851
2852        /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2853        ///
2854        /// # Example
2855        /// ```ignore,no_run
2856        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2857        /// use google_cloud_rpc::model::Status;
2858        /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2859        /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2860        /// ```
2861        #[deprecated]
2862        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2863        where
2864            T: std::convert::Into<google_cloud_rpc::model::Status>,
2865        {
2866            self.error = v.map(|x| x.into());
2867            self
2868        }
2869
2870        /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2871        ///
2872        /// # Example
2873        /// ```ignore,no_run
2874        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2875        /// let x = PscConnection::new().set_gce_operation("example");
2876        /// ```
2877        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2878            mut self,
2879            v: T,
2880        ) -> Self {
2881            self.gce_operation = v.into();
2882            self
2883        }
2884
2885        /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2886        ///
2887        /// # Example
2888        /// ```ignore,no_run
2889        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2890        /// let x = PscConnection::new().set_consumer_target_project("example");
2891        /// ```
2892        pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2893            mut self,
2894            v: T,
2895        ) -> Self {
2896            self.consumer_target_project = v.into();
2897            self
2898        }
2899
2900        /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2901        ///
2902        /// # Example
2903        /// ```ignore,no_run
2904        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2905        /// let x = PscConnection::new().set_psc_connection_id("example");
2906        /// ```
2907        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2908            mut self,
2909            v: T,
2910        ) -> Self {
2911            self.psc_connection_id = v.into();
2912            self
2913        }
2914
2915        /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2916        ///
2917        /// # Example
2918        /// ```ignore,no_run
2919        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2920        /// use google_cloud_rpc::model::ErrorInfo;
2921        /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2922        /// ```
2923        pub fn set_error_info<T>(mut self, v: T) -> Self
2924        where
2925            T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2926        {
2927            self.error_info = std::option::Option::Some(v.into());
2928            self
2929        }
2930
2931        /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2932        ///
2933        /// # Example
2934        /// ```ignore,no_run
2935        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2936        /// use google_cloud_rpc::model::ErrorInfo;
2937        /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2938        /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2939        /// ```
2940        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2941        where
2942            T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2943        {
2944            self.error_info = v.map(|x| x.into());
2945            self
2946        }
2947
2948        /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2949        ///
2950        /// # Example
2951        /// ```ignore,no_run
2952        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2953        /// let x = PscConnection::new().set_selected_subnetwork("example");
2954        /// ```
2955        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2956            mut self,
2957            v: T,
2958        ) -> Self {
2959            self.selected_subnetwork = v.into();
2960            self
2961        }
2962
2963        /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2964        ///
2965        /// # Example
2966        /// ```ignore,no_run
2967        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2968        /// let x = PscConnection::new().set_producer_instance_id("example");
2969        /// ```
2970        #[deprecated]
2971        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2972            mut self,
2973            v: T,
2974        ) -> Self {
2975            self.producer_instance_id = v.into();
2976            self
2977        }
2978
2979        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2980        ///
2981        /// # Example
2982        /// ```ignore,no_run
2983        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2984        /// let x = PscConnection::new().set_producer_instance_metadata([
2985        ///     ("key0", "abc"),
2986        ///     ("key1", "xyz"),
2987        /// ]);
2988        /// ```
2989        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2990        where
2991            T: std::iter::IntoIterator<Item = (K, V)>,
2992            K: std::convert::Into<std::string::String>,
2993            V: std::convert::Into<std::string::String>,
2994        {
2995            use std::iter::Iterator;
2996            self.producer_instance_metadata =
2997                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2998            self
2999        }
3000
3001        /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
3002        ///
3003        /// # Example
3004        /// ```ignore,no_run
3005        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3006        /// let x = PscConnection::new().set_service_class("example");
3007        /// ```
3008        pub fn set_service_class<T: std::convert::Into<std::string::String>>(
3009            mut self,
3010            v: T,
3011        ) -> Self {
3012            self.service_class = v.into();
3013            self
3014        }
3015
3016        /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3017        ///
3018        /// # Example
3019        /// ```ignore,no_run
3020        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3021        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3022        /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3023        /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3024        /// ```
3025        pub fn set_ip_version<T>(mut self, v: T) -> Self
3026        where
3027            T: std::convert::Into<crate::model::IPVersion>,
3028        {
3029            self.ip_version = std::option::Option::Some(v.into());
3030            self
3031        }
3032
3033        /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3034        ///
3035        /// # Example
3036        /// ```ignore,no_run
3037        /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3038        /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3039        /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3040        /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3041        /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3042        /// ```
3043        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3044        where
3045            T: std::convert::Into<crate::model::IPVersion>,
3046        {
3047            self.ip_version = v.map(|x| x.into());
3048            self
3049        }
3050    }
3051
3052    impl wkt::message::Message for PscConnection {
3053        fn typename() -> &'static str {
3054            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3055        }
3056    }
3057
3058    /// The state of the PSC connection.
3059    /// We reserve the right to add more states without notice in the future.
3060    /// Users should not use exhaustive switch statements on this enum.
3061    /// See <https://google.aip.dev/216>.
3062    ///
3063    /// # Working with unknown values
3064    ///
3065    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3066    /// additional enum variants at any time. Adding new variants is not considered
3067    /// a breaking change. Applications should write their code in anticipation of:
3068    ///
3069    /// - New values appearing in future releases of the client library, **and**
3070    /// - New values received dynamically, without application changes.
3071    ///
3072    /// Please consult the [Working with enums] section in the user guide for some
3073    /// guidelines.
3074    ///
3075    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3076    #[derive(Clone, Debug, PartialEq)]
3077    #[non_exhaustive]
3078    pub enum State {
3079        /// An invalid state as the default case.
3080        Unspecified,
3081        /// The connection has been created successfully. However, for the
3082        /// up-to-date connection status, please use the created forwarding rule's
3083        /// "PscConnectionStatus" as the source of truth.
3084        Active,
3085        /// The connection is not functional since some resources on the connection
3086        /// fail to be created.
3087        Failed,
3088        /// The connection is being created.
3089        Creating,
3090        /// The connection is being deleted.
3091        Deleting,
3092        /// The connection is being repaired to complete creation.
3093        CreateRepairing,
3094        /// The connection is being repaired to complete deletion.
3095        DeleteRepairing,
3096        /// If set, the enum was initialized with an unknown value.
3097        ///
3098        /// Applications can examine the value using [State::value] or
3099        /// [State::name].
3100        UnknownValue(state::UnknownValue),
3101    }
3102
3103    #[doc(hidden)]
3104    pub mod state {
3105        #[allow(unused_imports)]
3106        use super::*;
3107        #[derive(Clone, Debug, PartialEq)]
3108        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3109    }
3110
3111    impl State {
3112        /// Gets the enum value.
3113        ///
3114        /// Returns `None` if the enum contains an unknown value deserialized from
3115        /// the string representation of enums.
3116        pub fn value(&self) -> std::option::Option<i32> {
3117            match self {
3118                Self::Unspecified => std::option::Option::Some(0),
3119                Self::Active => std::option::Option::Some(1),
3120                Self::Failed => std::option::Option::Some(2),
3121                Self::Creating => std::option::Option::Some(3),
3122                Self::Deleting => std::option::Option::Some(4),
3123                Self::CreateRepairing => std::option::Option::Some(5),
3124                Self::DeleteRepairing => std::option::Option::Some(6),
3125                Self::UnknownValue(u) => u.0.value(),
3126            }
3127        }
3128
3129        /// Gets the enum value as a string.
3130        ///
3131        /// Returns `None` if the enum contains an unknown value deserialized from
3132        /// the integer representation of enums.
3133        pub fn name(&self) -> std::option::Option<&str> {
3134            match self {
3135                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3136                Self::Active => std::option::Option::Some("ACTIVE"),
3137                Self::Failed => std::option::Option::Some("FAILED"),
3138                Self::Creating => std::option::Option::Some("CREATING"),
3139                Self::Deleting => std::option::Option::Some("DELETING"),
3140                Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3141                Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3142                Self::UnknownValue(u) => u.0.name(),
3143            }
3144        }
3145    }
3146
3147    impl std::default::Default for State {
3148        fn default() -> Self {
3149            use std::convert::From;
3150            Self::from(0)
3151        }
3152    }
3153
3154    impl std::fmt::Display for State {
3155        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3156            wkt::internal::display_enum(f, self.name(), self.value())
3157        }
3158    }
3159
3160    impl std::convert::From<i32> for State {
3161        fn from(value: i32) -> Self {
3162            match value {
3163                0 => Self::Unspecified,
3164                1 => Self::Active,
3165                2 => Self::Failed,
3166                3 => Self::Creating,
3167                4 => Self::Deleting,
3168                5 => Self::CreateRepairing,
3169                6 => Self::DeleteRepairing,
3170                _ => Self::UnknownValue(state::UnknownValue(
3171                    wkt::internal::UnknownEnumValue::Integer(value),
3172                )),
3173            }
3174        }
3175    }
3176
3177    impl std::convert::From<&str> for State {
3178        fn from(value: &str) -> Self {
3179            use std::string::ToString;
3180            match value {
3181                "STATE_UNSPECIFIED" => Self::Unspecified,
3182                "ACTIVE" => Self::Active,
3183                "FAILED" => Self::Failed,
3184                "CREATING" => Self::Creating,
3185                "DELETING" => Self::Deleting,
3186                "CREATE_REPAIRING" => Self::CreateRepairing,
3187                "DELETE_REPAIRING" => Self::DeleteRepairing,
3188                _ => Self::UnknownValue(state::UnknownValue(
3189                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3190                )),
3191            }
3192        }
3193    }
3194
3195    impl serde::ser::Serialize for State {
3196        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3197        where
3198            S: serde::Serializer,
3199        {
3200            match self {
3201                Self::Unspecified => serializer.serialize_i32(0),
3202                Self::Active => serializer.serialize_i32(1),
3203                Self::Failed => serializer.serialize_i32(2),
3204                Self::Creating => serializer.serialize_i32(3),
3205                Self::Deleting => serializer.serialize_i32(4),
3206                Self::CreateRepairing => serializer.serialize_i32(5),
3207                Self::DeleteRepairing => serializer.serialize_i32(6),
3208                Self::UnknownValue(u) => u.0.serialize(serializer),
3209            }
3210        }
3211    }
3212
3213    impl<'de> serde::de::Deserialize<'de> for State {
3214        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3215        where
3216            D: serde::Deserializer<'de>,
3217        {
3218            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3219                ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3220            ))
3221        }
3222    }
3223}
3224
3225/// Request for ListServiceConnectionPolicies.
3226#[derive(Clone, Default, PartialEq)]
3227#[non_exhaustive]
3228pub struct ListServiceConnectionPoliciesRequest {
3229    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3230    pub parent: std::string::String,
3231
3232    /// The maximum number of results per page that should be returned.
3233    pub page_size: i32,
3234
3235    /// The page token.
3236    pub page_token: std::string::String,
3237
3238    /// A filter expression that filters the results listed in the response.
3239    pub filter: std::string::String,
3240
3241    /// Sort the results by a certain order.
3242    pub order_by: std::string::String,
3243
3244    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3245}
3246
3247impl ListServiceConnectionPoliciesRequest {
3248    /// Creates a new default instance.
3249    pub fn new() -> Self {
3250        std::default::Default::default()
3251    }
3252
3253    /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3254    ///
3255    /// # Example
3256    /// ```ignore,no_run
3257    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3258    /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3259    /// ```
3260    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261        self.parent = v.into();
3262        self
3263    }
3264
3265    /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3266    ///
3267    /// # Example
3268    /// ```ignore,no_run
3269    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3270    /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3271    /// ```
3272    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3273        self.page_size = v.into();
3274        self
3275    }
3276
3277    /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3278    ///
3279    /// # Example
3280    /// ```ignore,no_run
3281    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3282    /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3283    /// ```
3284    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3285        self.page_token = v.into();
3286        self
3287    }
3288
3289    /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3290    ///
3291    /// # Example
3292    /// ```ignore,no_run
3293    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3294    /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3295    /// ```
3296    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3297        self.filter = v.into();
3298        self
3299    }
3300
3301    /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3302    ///
3303    /// # Example
3304    /// ```ignore,no_run
3305    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3306    /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3307    /// ```
3308    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3309        self.order_by = v.into();
3310        self
3311    }
3312}
3313
3314impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3315    fn typename() -> &'static str {
3316        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3317    }
3318}
3319
3320/// Response for ListServiceConnectionPolicies.
3321#[derive(Clone, Default, PartialEq)]
3322#[non_exhaustive]
3323pub struct ListServiceConnectionPoliciesResponse {
3324    /// ServiceConnectionPolicies to be returned.
3325    pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3326
3327    /// The next pagination token in the List response. It should be used as
3328    /// page_token for the following request. An empty value means no more result.
3329    pub next_page_token: std::string::String,
3330
3331    /// Locations that could not be reached.
3332    pub unreachable: std::vec::Vec<std::string::String>,
3333
3334    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3335}
3336
3337impl ListServiceConnectionPoliciesResponse {
3338    /// Creates a new default instance.
3339    pub fn new() -> Self {
3340        std::default::Default::default()
3341    }
3342
3343    /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3344    ///
3345    /// # Example
3346    /// ```ignore,no_run
3347    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3348    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3349    /// let x = ListServiceConnectionPoliciesResponse::new()
3350    ///     .set_service_connection_policies([
3351    ///         ServiceConnectionPolicy::default()/* use setters */,
3352    ///         ServiceConnectionPolicy::default()/* use (different) setters */,
3353    ///     ]);
3354    /// ```
3355    pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3356    where
3357        T: std::iter::IntoIterator<Item = V>,
3358        V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3359    {
3360        use std::iter::Iterator;
3361        self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3362        self
3363    }
3364
3365    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3366    ///
3367    /// # Example
3368    /// ```ignore,no_run
3369    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3370    /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3371    /// ```
3372    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3373        self.next_page_token = v.into();
3374        self
3375    }
3376
3377    /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3378    ///
3379    /// # Example
3380    /// ```ignore,no_run
3381    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3382    /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3383    /// ```
3384    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3385    where
3386        T: std::iter::IntoIterator<Item = V>,
3387        V: std::convert::Into<std::string::String>,
3388    {
3389        use std::iter::Iterator;
3390        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3391        self
3392    }
3393}
3394
3395impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3396    fn typename() -> &'static str {
3397        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3398    }
3399}
3400
3401#[doc(hidden)]
3402impl google_cloud_gax::paginator::internal::PageableResponse
3403    for ListServiceConnectionPoliciesResponse
3404{
3405    type PageItem = crate::model::ServiceConnectionPolicy;
3406
3407    fn items(self) -> std::vec::Vec<Self::PageItem> {
3408        self.service_connection_policies
3409    }
3410
3411    fn next_page_token(&self) -> std::string::String {
3412        use std::clone::Clone;
3413        self.next_page_token.clone()
3414    }
3415}
3416
3417/// Request for GetServiceConnectionPolicy.
3418#[derive(Clone, Default, PartialEq)]
3419#[non_exhaustive]
3420pub struct GetServiceConnectionPolicyRequest {
3421    /// Required. Name of the ServiceConnectionPolicy to get.
3422    pub name: std::string::String,
3423
3424    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3425}
3426
3427impl GetServiceConnectionPolicyRequest {
3428    /// Creates a new default instance.
3429    pub fn new() -> Self {
3430        std::default::Default::default()
3431    }
3432
3433    /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
3434    ///
3435    /// # Example
3436    /// ```ignore,no_run
3437    /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionPolicyRequest;
3438    /// let x = GetServiceConnectionPolicyRequest::new().set_name("example");
3439    /// ```
3440    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3441        self.name = v.into();
3442        self
3443    }
3444}
3445
3446impl wkt::message::Message for GetServiceConnectionPolicyRequest {
3447    fn typename() -> &'static str {
3448        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
3449    }
3450}
3451
3452/// Request for CreateServiceConnectionPolicy.
3453#[derive(Clone, Default, PartialEq)]
3454#[non_exhaustive]
3455pub struct CreateServiceConnectionPolicyRequest {
3456    /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
3457    /// projects/123/locations/us-east1
3458    pub parent: std::string::String,
3459
3460    /// Optional. Resource ID
3461    /// (i.e. 'foo' in
3462    /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
3463    /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
3464    pub service_connection_policy_id: std::string::String,
3465
3466    /// Required. Initial values for a new ServiceConnectionPolicies
3467    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3468
3469    /// Optional. An optional request ID to identify requests. Specify a unique
3470    /// request ID so that if you must retry your request, the server will know to
3471    /// ignore the request if it has already been completed. The server will
3472    /// guarantee that for at least 60 minutes since the first request.
3473    ///
3474    /// For example, consider a situation where you make an initial request and
3475    /// the request times out. If you make the request again with the same request
3476    /// ID, the server can check if original operation with the same request ID
3477    /// was received, and if so, will ignore the second request. This prevents
3478    /// clients from accidentally creating duplicate commitments.
3479    ///
3480    /// The request ID must be a valid UUID with the exception that zero UUID is
3481    /// not supported (00000000-0000-0000-0000-000000000000).
3482    pub request_id: std::string::String,
3483
3484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3485}
3486
3487impl CreateServiceConnectionPolicyRequest {
3488    /// Creates a new default instance.
3489    pub fn new() -> Self {
3490        std::default::Default::default()
3491    }
3492
3493    /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
3494    ///
3495    /// # Example
3496    /// ```ignore,no_run
3497    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3498    /// let x = CreateServiceConnectionPolicyRequest::new().set_parent("example");
3499    /// ```
3500    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3501        self.parent = v.into();
3502        self
3503    }
3504
3505    /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
3506    ///
3507    /// # Example
3508    /// ```ignore,no_run
3509    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3510    /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy_id("example");
3511    /// ```
3512    pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
3513        mut self,
3514        v: T,
3515    ) -> Self {
3516        self.service_connection_policy_id = v.into();
3517        self
3518    }
3519
3520    /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3521    ///
3522    /// # Example
3523    /// ```ignore,no_run
3524    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3525    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3526    /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3527    /// ```
3528    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3529    where
3530        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3531    {
3532        self.service_connection_policy = std::option::Option::Some(v.into());
3533        self
3534    }
3535
3536    /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3537    ///
3538    /// # Example
3539    /// ```ignore,no_run
3540    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3541    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3542    /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3543    /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3544    /// ```
3545    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3546    where
3547        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3548    {
3549        self.service_connection_policy = v.map(|x| x.into());
3550        self
3551    }
3552
3553    /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
3554    ///
3555    /// # Example
3556    /// ```ignore,no_run
3557    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3558    /// let x = CreateServiceConnectionPolicyRequest::new().set_request_id("example");
3559    /// ```
3560    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3561        self.request_id = v.into();
3562        self
3563    }
3564}
3565
3566impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
3567    fn typename() -> &'static str {
3568        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
3569    }
3570}
3571
3572/// Request for UpdateServiceConnectionPolicy.
3573#[derive(Clone, Default, PartialEq)]
3574#[non_exhaustive]
3575pub struct UpdateServiceConnectionPolicyRequest {
3576    /// Optional. Field mask is used to specify the fields to be overwritten in the
3577    /// ServiceConnectionPolicy resource by the update.
3578    /// The fields specified in the update_mask are relative to the resource, not
3579    /// the full request. A field will be overwritten if it is in the mask. If the
3580    /// user does not provide a mask then all fields will be overwritten.
3581    pub update_mask: std::option::Option<wkt::FieldMask>,
3582
3583    /// Required. New values to be patched into the resource.
3584    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3585
3586    /// Optional. An optional request ID to identify requests. Specify a unique
3587    /// request ID so that if you must retry your request, the server will know to
3588    /// ignore the request if it has already been completed. The server will
3589    /// guarantee that for at least 60 minutes since the first request.
3590    ///
3591    /// For example, consider a situation where you make an initial request and
3592    /// the request times out. If you make the request again with the same request
3593    /// ID, the server can check if original operation with the same request ID
3594    /// was received, and if so, will ignore the second request. This prevents
3595    /// clients from accidentally creating duplicate commitments.
3596    ///
3597    /// The request ID must be a valid UUID with the exception that zero UUID is
3598    /// not supported (00000000-0000-0000-0000-000000000000).
3599    pub request_id: std::string::String,
3600
3601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3602}
3603
3604impl UpdateServiceConnectionPolicyRequest {
3605    /// Creates a new default instance.
3606    pub fn new() -> Self {
3607        std::default::Default::default()
3608    }
3609
3610    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3611    ///
3612    /// # Example
3613    /// ```ignore,no_run
3614    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3615    /// use wkt::FieldMask;
3616    /// let x = UpdateServiceConnectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3617    /// ```
3618    pub fn set_update_mask<T>(mut self, v: T) -> Self
3619    where
3620        T: std::convert::Into<wkt::FieldMask>,
3621    {
3622        self.update_mask = std::option::Option::Some(v.into());
3623        self
3624    }
3625
3626    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3627    ///
3628    /// # Example
3629    /// ```ignore,no_run
3630    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3631    /// use wkt::FieldMask;
3632    /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3633    /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3634    /// ```
3635    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3636    where
3637        T: std::convert::Into<wkt::FieldMask>,
3638    {
3639        self.update_mask = v.map(|x| x.into());
3640        self
3641    }
3642
3643    /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3644    ///
3645    /// # Example
3646    /// ```ignore,no_run
3647    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3648    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3649    /// let x = UpdateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3650    /// ```
3651    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3652    where
3653        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3654    {
3655        self.service_connection_policy = std::option::Option::Some(v.into());
3656        self
3657    }
3658
3659    /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3660    ///
3661    /// # Example
3662    /// ```ignore,no_run
3663    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3664    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3665    /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3666    /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3667    /// ```
3668    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3669    where
3670        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3671    {
3672        self.service_connection_policy = v.map(|x| x.into());
3673        self
3674    }
3675
3676    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
3677    ///
3678    /// # Example
3679    /// ```ignore,no_run
3680    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3681    /// let x = UpdateServiceConnectionPolicyRequest::new().set_request_id("example");
3682    /// ```
3683    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684        self.request_id = v.into();
3685        self
3686    }
3687}
3688
3689impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
3690    fn typename() -> &'static str {
3691        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
3692    }
3693}
3694
3695/// Request for DeleteServiceConnectionPolicy.
3696#[derive(Clone, Default, PartialEq)]
3697#[non_exhaustive]
3698pub struct DeleteServiceConnectionPolicyRequest {
3699    /// Required. The name of the ServiceConnectionPolicy to delete.
3700    pub name: std::string::String,
3701
3702    /// Optional. An optional request ID to identify requests. Specify a unique
3703    /// request ID so that if you must retry your request, the server will know to
3704    /// ignore the request if it has already been completed. The server will
3705    /// guarantee that for at least 60 minutes after the first request.
3706    ///
3707    /// For example, consider a situation where you make an initial request and
3708    /// the request times out. If you make the request again with the same request
3709    /// ID, the server can check if original operation with the same request ID
3710    /// was received, and if so, will ignore the second request. This prevents
3711    /// clients from accidentally creating duplicate commitments.
3712    ///
3713    /// The request ID must be a valid UUID with the exception that zero UUID is
3714    /// not supported (00000000-0000-0000-0000-000000000000).
3715    pub request_id: std::string::String,
3716
3717    /// Optional. The etag is computed by the server, and may be sent on update and
3718    /// delete requests to ensure the client has an up-to-date value before
3719    /// proceeding.
3720    pub etag: std::option::Option<std::string::String>,
3721
3722    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3723}
3724
3725impl DeleteServiceConnectionPolicyRequest {
3726    /// Creates a new default instance.
3727    pub fn new() -> Self {
3728        std::default::Default::default()
3729    }
3730
3731    /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
3732    ///
3733    /// # Example
3734    /// ```ignore,no_run
3735    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3736    /// let x = DeleteServiceConnectionPolicyRequest::new().set_name("example");
3737    /// ```
3738    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3739        self.name = v.into();
3740        self
3741    }
3742
3743    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
3744    ///
3745    /// # Example
3746    /// ```ignore,no_run
3747    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3748    /// let x = DeleteServiceConnectionPolicyRequest::new().set_request_id("example");
3749    /// ```
3750    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3751        self.request_id = v.into();
3752        self
3753    }
3754
3755    /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3756    ///
3757    /// # Example
3758    /// ```ignore,no_run
3759    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3760    /// let x = DeleteServiceConnectionPolicyRequest::new().set_etag("example");
3761    /// ```
3762    pub fn set_etag<T>(mut self, v: T) -> Self
3763    where
3764        T: std::convert::Into<std::string::String>,
3765    {
3766        self.etag = std::option::Option::Some(v.into());
3767        self
3768    }
3769
3770    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3771    ///
3772    /// # Example
3773    /// ```ignore,no_run
3774    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3775    /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(Some("example"));
3776    /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(None::<String>);
3777    /// ```
3778    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3779    where
3780        T: std::convert::Into<std::string::String>,
3781    {
3782        self.etag = v.map(|x| x.into());
3783        self
3784    }
3785}
3786
3787impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
3788    fn typename() -> &'static str {
3789        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
3790    }
3791}
3792
3793/// The ServiceClass resource.
3794#[derive(Clone, Default, PartialEq)]
3795#[non_exhaustive]
3796pub struct ServiceClass {
3797    /// Immutable. The name of a ServiceClass resource.
3798    /// Format:
3799    /// projects/{project}/locations/{location}/serviceClasses/{service_class}
3800    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3801    pub name: std::string::String,
3802
3803    /// Output only. The generated service class name. Use this name to refer to
3804    /// the Service class in Service Connection Maps and Service Connection
3805    /// Policies.
3806    pub service_class: std::string::String,
3807
3808    /// Output only. Time when the ServiceClass was created.
3809    pub create_time: std::option::Option<wkt::Timestamp>,
3810
3811    /// Output only. Time when the ServiceClass was updated.
3812    pub update_time: std::option::Option<wkt::Timestamp>,
3813
3814    /// User-defined labels.
3815    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3816
3817    /// A description of this resource.
3818    pub description: std::string::String,
3819
3820    /// Optional. The etag is computed by the server, and may be sent on update and
3821    /// delete requests to ensure the client has an up-to-date value before
3822    /// proceeding.
3823    pub etag: std::option::Option<std::string::String>,
3824
3825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3826}
3827
3828impl ServiceClass {
3829    /// Creates a new default instance.
3830    pub fn new() -> Self {
3831        std::default::Default::default()
3832    }
3833
3834    /// Sets the value of [name][crate::model::ServiceClass::name].
3835    ///
3836    /// # Example
3837    /// ```ignore,no_run
3838    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3839    /// let x = ServiceClass::new().set_name("example");
3840    /// ```
3841    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3842        self.name = v.into();
3843        self
3844    }
3845
3846    /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
3847    ///
3848    /// # Example
3849    /// ```ignore,no_run
3850    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3851    /// let x = ServiceClass::new().set_service_class("example");
3852    /// ```
3853    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3854        self.service_class = v.into();
3855        self
3856    }
3857
3858    /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
3859    ///
3860    /// # Example
3861    /// ```ignore,no_run
3862    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3863    /// use wkt::Timestamp;
3864    /// let x = ServiceClass::new().set_create_time(Timestamp::default()/* use setters */);
3865    /// ```
3866    pub fn set_create_time<T>(mut self, v: T) -> Self
3867    where
3868        T: std::convert::Into<wkt::Timestamp>,
3869    {
3870        self.create_time = std::option::Option::Some(v.into());
3871        self
3872    }
3873
3874    /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
3875    ///
3876    /// # Example
3877    /// ```ignore,no_run
3878    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3879    /// use wkt::Timestamp;
3880    /// let x = ServiceClass::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3881    /// let x = ServiceClass::new().set_or_clear_create_time(None::<Timestamp>);
3882    /// ```
3883    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3884    where
3885        T: std::convert::Into<wkt::Timestamp>,
3886    {
3887        self.create_time = v.map(|x| x.into());
3888        self
3889    }
3890
3891    /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
3892    ///
3893    /// # Example
3894    /// ```ignore,no_run
3895    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3896    /// use wkt::Timestamp;
3897    /// let x = ServiceClass::new().set_update_time(Timestamp::default()/* use setters */);
3898    /// ```
3899    pub fn set_update_time<T>(mut self, v: T) -> Self
3900    where
3901        T: std::convert::Into<wkt::Timestamp>,
3902    {
3903        self.update_time = std::option::Option::Some(v.into());
3904        self
3905    }
3906
3907    /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
3908    ///
3909    /// # Example
3910    /// ```ignore,no_run
3911    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3912    /// use wkt::Timestamp;
3913    /// let x = ServiceClass::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3914    /// let x = ServiceClass::new().set_or_clear_update_time(None::<Timestamp>);
3915    /// ```
3916    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3917    where
3918        T: std::convert::Into<wkt::Timestamp>,
3919    {
3920        self.update_time = v.map(|x| x.into());
3921        self
3922    }
3923
3924    /// Sets the value of [labels][crate::model::ServiceClass::labels].
3925    ///
3926    /// # Example
3927    /// ```ignore,no_run
3928    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3929    /// let x = ServiceClass::new().set_labels([
3930    ///     ("key0", "abc"),
3931    ///     ("key1", "xyz"),
3932    /// ]);
3933    /// ```
3934    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3935    where
3936        T: std::iter::IntoIterator<Item = (K, V)>,
3937        K: std::convert::Into<std::string::String>,
3938        V: std::convert::Into<std::string::String>,
3939    {
3940        use std::iter::Iterator;
3941        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3942        self
3943    }
3944
3945    /// Sets the value of [description][crate::model::ServiceClass::description].
3946    ///
3947    /// # Example
3948    /// ```ignore,no_run
3949    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3950    /// let x = ServiceClass::new().set_description("example");
3951    /// ```
3952    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3953        self.description = v.into();
3954        self
3955    }
3956
3957    /// Sets the value of [etag][crate::model::ServiceClass::etag].
3958    ///
3959    /// # Example
3960    /// ```ignore,no_run
3961    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3962    /// let x = ServiceClass::new().set_etag("example");
3963    /// ```
3964    pub fn set_etag<T>(mut self, v: T) -> Self
3965    where
3966        T: std::convert::Into<std::string::String>,
3967    {
3968        self.etag = std::option::Option::Some(v.into());
3969        self
3970    }
3971
3972    /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
3973    ///
3974    /// # Example
3975    /// ```ignore,no_run
3976    /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3977    /// let x = ServiceClass::new().set_or_clear_etag(Some("example"));
3978    /// let x = ServiceClass::new().set_or_clear_etag(None::<String>);
3979    /// ```
3980    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3981    where
3982        T: std::convert::Into<std::string::String>,
3983    {
3984        self.etag = v.map(|x| x.into());
3985        self
3986    }
3987}
3988
3989impl wkt::message::Message for ServiceClass {
3990    fn typename() -> &'static str {
3991        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
3992    }
3993}
3994
3995/// Request for ListServiceClasses.
3996#[derive(Clone, Default, PartialEq)]
3997#[non_exhaustive]
3998pub struct ListServiceClassesRequest {
3999    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4000    pub parent: std::string::String,
4001
4002    /// The maximum number of results per page that should be returned.
4003    pub page_size: i32,
4004
4005    /// The page token.
4006    pub page_token: std::string::String,
4007
4008    /// A filter expression that filters the results listed in the response.
4009    pub filter: std::string::String,
4010
4011    /// Sort the results by a certain order.
4012    pub order_by: std::string::String,
4013
4014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4015}
4016
4017impl ListServiceClassesRequest {
4018    /// Creates a new default instance.
4019    pub fn new() -> Self {
4020        std::default::Default::default()
4021    }
4022
4023    /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
4024    ///
4025    /// # Example
4026    /// ```ignore,no_run
4027    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4028    /// let x = ListServiceClassesRequest::new().set_parent("example");
4029    /// ```
4030    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4031        self.parent = v.into();
4032        self
4033    }
4034
4035    /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
4036    ///
4037    /// # Example
4038    /// ```ignore,no_run
4039    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4040    /// let x = ListServiceClassesRequest::new().set_page_size(42);
4041    /// ```
4042    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4043        self.page_size = v.into();
4044        self
4045    }
4046
4047    /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
4048    ///
4049    /// # Example
4050    /// ```ignore,no_run
4051    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4052    /// let x = ListServiceClassesRequest::new().set_page_token("example");
4053    /// ```
4054    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4055        self.page_token = v.into();
4056        self
4057    }
4058
4059    /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
4060    ///
4061    /// # Example
4062    /// ```ignore,no_run
4063    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4064    /// let x = ListServiceClassesRequest::new().set_filter("example");
4065    /// ```
4066    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4067        self.filter = v.into();
4068        self
4069    }
4070
4071    /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
4072    ///
4073    /// # Example
4074    /// ```ignore,no_run
4075    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4076    /// let x = ListServiceClassesRequest::new().set_order_by("example");
4077    /// ```
4078    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079        self.order_by = v.into();
4080        self
4081    }
4082}
4083
4084impl wkt::message::Message for ListServiceClassesRequest {
4085    fn typename() -> &'static str {
4086        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
4087    }
4088}
4089
4090/// Response for ListServiceClasses.
4091#[derive(Clone, Default, PartialEq)]
4092#[non_exhaustive]
4093pub struct ListServiceClassesResponse {
4094    /// ServiceClasses to be returned.
4095    pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
4096
4097    /// The next pagination token in the List response. It should be used as
4098    /// page_token for the following request. An empty value means no more result.
4099    pub next_page_token: std::string::String,
4100
4101    /// Locations that could not be reached.
4102    pub unreachable: std::vec::Vec<std::string::String>,
4103
4104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4105}
4106
4107impl ListServiceClassesResponse {
4108    /// Creates a new default instance.
4109    pub fn new() -> Self {
4110        std::default::Default::default()
4111    }
4112
4113    /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
4114    ///
4115    /// # Example
4116    /// ```ignore,no_run
4117    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4118    /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4119    /// let x = ListServiceClassesResponse::new()
4120    ///     .set_service_classes([
4121    ///         ServiceClass::default()/* use setters */,
4122    ///         ServiceClass::default()/* use (different) setters */,
4123    ///     ]);
4124    /// ```
4125    pub fn set_service_classes<T, V>(mut self, v: T) -> Self
4126    where
4127        T: std::iter::IntoIterator<Item = V>,
4128        V: std::convert::Into<crate::model::ServiceClass>,
4129    {
4130        use std::iter::Iterator;
4131        self.service_classes = v.into_iter().map(|i| i.into()).collect();
4132        self
4133    }
4134
4135    /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
4136    ///
4137    /// # Example
4138    /// ```ignore,no_run
4139    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4140    /// let x = ListServiceClassesResponse::new().set_next_page_token("example");
4141    /// ```
4142    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4143        self.next_page_token = v.into();
4144        self
4145    }
4146
4147    /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
4148    ///
4149    /// # Example
4150    /// ```ignore,no_run
4151    /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4152    /// let x = ListServiceClassesResponse::new().set_unreachable(["a", "b", "c"]);
4153    /// ```
4154    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4155    where
4156        T: std::iter::IntoIterator<Item = V>,
4157        V: std::convert::Into<std::string::String>,
4158    {
4159        use std::iter::Iterator;
4160        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4161        self
4162    }
4163}
4164
4165impl wkt::message::Message for ListServiceClassesResponse {
4166    fn typename() -> &'static str {
4167        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
4168    }
4169}
4170
4171#[doc(hidden)]
4172impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
4173    type PageItem = crate::model::ServiceClass;
4174
4175    fn items(self) -> std::vec::Vec<Self::PageItem> {
4176        self.service_classes
4177    }
4178
4179    fn next_page_token(&self) -> std::string::String {
4180        use std::clone::Clone;
4181        self.next_page_token.clone()
4182    }
4183}
4184
4185/// Request for GetServiceClass.
4186#[derive(Clone, Default, PartialEq)]
4187#[non_exhaustive]
4188pub struct GetServiceClassRequest {
4189    /// Required. Name of the ServiceClass to get.
4190    pub name: std::string::String,
4191
4192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4193}
4194
4195impl GetServiceClassRequest {
4196    /// Creates a new default instance.
4197    pub fn new() -> Self {
4198        std::default::Default::default()
4199    }
4200
4201    /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
4202    ///
4203    /// # Example
4204    /// ```ignore,no_run
4205    /// # use google_cloud_networkconnectivity_v1::model::GetServiceClassRequest;
4206    /// let x = GetServiceClassRequest::new().set_name("example");
4207    /// ```
4208    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4209        self.name = v.into();
4210        self
4211    }
4212}
4213
4214impl wkt::message::Message for GetServiceClassRequest {
4215    fn typename() -> &'static str {
4216        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
4217    }
4218}
4219
4220/// Request for UpdateServiceClass.
4221#[derive(Clone, Default, PartialEq)]
4222#[non_exhaustive]
4223pub struct UpdateServiceClassRequest {
4224    /// Optional. Field mask is used to specify the fields to be overwritten in the
4225    /// ServiceClass resource by the update.
4226    /// The fields specified in the update_mask are relative to the resource, not
4227    /// the full request. A field will be overwritten if it is in the mask. If the
4228    /// user does not provide a mask then all fields will be overwritten.
4229    pub update_mask: std::option::Option<wkt::FieldMask>,
4230
4231    /// Required. New values to be patched into the resource.
4232    pub service_class: std::option::Option<crate::model::ServiceClass>,
4233
4234    /// Optional. An optional request ID to identify requests. Specify a unique
4235    /// request ID so that if you must retry your request, the server will know to
4236    /// ignore the request if it has already been completed. The server will
4237    /// guarantee that for at least 60 minutes since the first request.
4238    ///
4239    /// For example, consider a situation where you make an initial request and
4240    /// the request times out. If you make the request again with the same request
4241    /// ID, the server can check if original operation with the same request ID
4242    /// was received, and if so, will ignore the second request. This prevents
4243    /// clients from accidentally creating duplicate commitments.
4244    ///
4245    /// The request ID must be a valid UUID with the exception that zero UUID is
4246    /// not supported (00000000-0000-0000-0000-000000000000).
4247    pub request_id: std::string::String,
4248
4249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4250}
4251
4252impl UpdateServiceClassRequest {
4253    /// Creates a new default instance.
4254    pub fn new() -> Self {
4255        std::default::Default::default()
4256    }
4257
4258    /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4259    ///
4260    /// # Example
4261    /// ```ignore,no_run
4262    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4263    /// use wkt::FieldMask;
4264    /// let x = UpdateServiceClassRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4265    /// ```
4266    pub fn set_update_mask<T>(mut self, v: T) -> Self
4267    where
4268        T: std::convert::Into<wkt::FieldMask>,
4269    {
4270        self.update_mask = std::option::Option::Some(v.into());
4271        self
4272    }
4273
4274    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4275    ///
4276    /// # Example
4277    /// ```ignore,no_run
4278    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4279    /// use wkt::FieldMask;
4280    /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4281    /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4282    /// ```
4283    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4284    where
4285        T: std::convert::Into<wkt::FieldMask>,
4286    {
4287        self.update_mask = v.map(|x| x.into());
4288        self
4289    }
4290
4291    /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4292    ///
4293    /// # Example
4294    /// ```ignore,no_run
4295    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4296    /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4297    /// let x = UpdateServiceClassRequest::new().set_service_class(ServiceClass::default()/* use setters */);
4298    /// ```
4299    pub fn set_service_class<T>(mut self, v: T) -> Self
4300    where
4301        T: std::convert::Into<crate::model::ServiceClass>,
4302    {
4303        self.service_class = std::option::Option::Some(v.into());
4304        self
4305    }
4306
4307    /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4308    ///
4309    /// # Example
4310    /// ```ignore,no_run
4311    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4312    /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4313    /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(Some(ServiceClass::default()/* use setters */));
4314    /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(None::<ServiceClass>);
4315    /// ```
4316    pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
4317    where
4318        T: std::convert::Into<crate::model::ServiceClass>,
4319    {
4320        self.service_class = v.map(|x| x.into());
4321        self
4322    }
4323
4324    /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
4325    ///
4326    /// # Example
4327    /// ```ignore,no_run
4328    /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4329    /// let x = UpdateServiceClassRequest::new().set_request_id("example");
4330    /// ```
4331    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4332        self.request_id = v.into();
4333        self
4334    }
4335}
4336
4337impl wkt::message::Message for UpdateServiceClassRequest {
4338    fn typename() -> &'static str {
4339        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
4340    }
4341}
4342
4343/// Request for DeleteServiceClass.
4344#[derive(Clone, Default, PartialEq)]
4345#[non_exhaustive]
4346pub struct DeleteServiceClassRequest {
4347    /// Required. The name of the ServiceClass to delete.
4348    pub name: std::string::String,
4349
4350    /// Optional. An optional request ID to identify requests. Specify a unique
4351    /// request ID so that if you must retry your request, the server will know to
4352    /// ignore the request if it has already been completed. The server will
4353    /// guarantee that for at least 60 minutes after the first request.
4354    ///
4355    /// For example, consider a situation where you make an initial request and
4356    /// the request times out. If you make the request again with the same request
4357    /// ID, the server can check if original operation with the same request ID
4358    /// was received, and if so, will ignore the second request. This prevents
4359    /// clients from accidentally creating duplicate commitments.
4360    ///
4361    /// The request ID must be a valid UUID with the exception that zero UUID is
4362    /// not supported (00000000-0000-0000-0000-000000000000).
4363    pub request_id: std::string::String,
4364
4365    /// Optional. The etag is computed by the server, and may be sent on update and
4366    /// delete requests to ensure the client has an up-to-date value before
4367    /// proceeding.
4368    pub etag: std::option::Option<std::string::String>,
4369
4370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4371}
4372
4373impl DeleteServiceClassRequest {
4374    /// Creates a new default instance.
4375    pub fn new() -> Self {
4376        std::default::Default::default()
4377    }
4378
4379    /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
4380    ///
4381    /// # Example
4382    /// ```ignore,no_run
4383    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4384    /// let x = DeleteServiceClassRequest::new().set_name("example");
4385    /// ```
4386    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4387        self.name = v.into();
4388        self
4389    }
4390
4391    /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
4392    ///
4393    /// # Example
4394    /// ```ignore,no_run
4395    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4396    /// let x = DeleteServiceClassRequest::new().set_request_id("example");
4397    /// ```
4398    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4399        self.request_id = v.into();
4400        self
4401    }
4402
4403    /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4404    ///
4405    /// # Example
4406    /// ```ignore,no_run
4407    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4408    /// let x = DeleteServiceClassRequest::new().set_etag("example");
4409    /// ```
4410    pub fn set_etag<T>(mut self, v: T) -> Self
4411    where
4412        T: std::convert::Into<std::string::String>,
4413    {
4414        self.etag = std::option::Option::Some(v.into());
4415        self
4416    }
4417
4418    /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4419    ///
4420    /// # Example
4421    /// ```ignore,no_run
4422    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4423    /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(Some("example"));
4424    /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(None::<String>);
4425    /// ```
4426    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4427    where
4428        T: std::convert::Into<std::string::String>,
4429    {
4430        self.etag = v.map(|x| x.into());
4431        self
4432    }
4433}
4434
4435impl wkt::message::Message for DeleteServiceClassRequest {
4436    fn typename() -> &'static str {
4437        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
4438    }
4439}
4440
4441/// The ServiceConnectionToken resource.
4442#[derive(Clone, Default, PartialEq)]
4443#[non_exhaustive]
4444pub struct ServiceConnectionToken {
4445    /// Immutable. The name of a ServiceConnectionToken.
4446    /// Format:
4447    /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
4448    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
4449    pub name: std::string::String,
4450
4451    /// Output only. Time when the ServiceConnectionToken was created.
4452    pub create_time: std::option::Option<wkt::Timestamp>,
4453
4454    /// Output only. Time when the ServiceConnectionToken was updated.
4455    pub update_time: std::option::Option<wkt::Timestamp>,
4456
4457    /// User-defined labels.
4458    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4459
4460    /// A description of this resource.
4461    pub description: std::string::String,
4462
4463    /// The resource path of the network associated with this token.
4464    /// Example:
4465    /// projects/{projectNumOrId}/global/networks/{resourceId}.
4466    pub network: std::string::String,
4467
4468    /// Output only. The token generated by Automation.
4469    pub token: std::string::String,
4470
4471    /// Output only. The time to which this token is valid.
4472    pub expire_time: std::option::Option<wkt::Timestamp>,
4473
4474    /// Optional. The etag is computed by the server, and may be sent on update and
4475    /// delete requests to ensure the client has an up-to-date value before
4476    /// proceeding.
4477    pub etag: std::option::Option<std::string::String>,
4478
4479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl ServiceConnectionToken {
4483    /// Creates a new default instance.
4484    pub fn new() -> Self {
4485        std::default::Default::default()
4486    }
4487
4488    /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
4489    ///
4490    /// # Example
4491    /// ```ignore,no_run
4492    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4493    /// let x = ServiceConnectionToken::new().set_name("example");
4494    /// ```
4495    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4496        self.name = v.into();
4497        self
4498    }
4499
4500    /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4501    ///
4502    /// # Example
4503    /// ```ignore,no_run
4504    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4505    /// use wkt::Timestamp;
4506    /// let x = ServiceConnectionToken::new().set_create_time(Timestamp::default()/* use setters */);
4507    /// ```
4508    pub fn set_create_time<T>(mut self, v: T) -> Self
4509    where
4510        T: std::convert::Into<wkt::Timestamp>,
4511    {
4512        self.create_time = std::option::Option::Some(v.into());
4513        self
4514    }
4515
4516    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4517    ///
4518    /// # Example
4519    /// ```ignore,no_run
4520    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4521    /// use wkt::Timestamp;
4522    /// let x = ServiceConnectionToken::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4523    /// let x = ServiceConnectionToken::new().set_or_clear_create_time(None::<Timestamp>);
4524    /// ```
4525    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4526    where
4527        T: std::convert::Into<wkt::Timestamp>,
4528    {
4529        self.create_time = v.map(|x| x.into());
4530        self
4531    }
4532
4533    /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4534    ///
4535    /// # Example
4536    /// ```ignore,no_run
4537    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4538    /// use wkt::Timestamp;
4539    /// let x = ServiceConnectionToken::new().set_update_time(Timestamp::default()/* use setters */);
4540    /// ```
4541    pub fn set_update_time<T>(mut self, v: T) -> Self
4542    where
4543        T: std::convert::Into<wkt::Timestamp>,
4544    {
4545        self.update_time = std::option::Option::Some(v.into());
4546        self
4547    }
4548
4549    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4550    ///
4551    /// # Example
4552    /// ```ignore,no_run
4553    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4554    /// use wkt::Timestamp;
4555    /// let x = ServiceConnectionToken::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4556    /// let x = ServiceConnectionToken::new().set_or_clear_update_time(None::<Timestamp>);
4557    /// ```
4558    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4559    where
4560        T: std::convert::Into<wkt::Timestamp>,
4561    {
4562        self.update_time = v.map(|x| x.into());
4563        self
4564    }
4565
4566    /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
4567    ///
4568    /// # Example
4569    /// ```ignore,no_run
4570    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4571    /// let x = ServiceConnectionToken::new().set_labels([
4572    ///     ("key0", "abc"),
4573    ///     ("key1", "xyz"),
4574    /// ]);
4575    /// ```
4576    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4577    where
4578        T: std::iter::IntoIterator<Item = (K, V)>,
4579        K: std::convert::Into<std::string::String>,
4580        V: std::convert::Into<std::string::String>,
4581    {
4582        use std::iter::Iterator;
4583        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4584        self
4585    }
4586
4587    /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
4588    ///
4589    /// # Example
4590    /// ```ignore,no_run
4591    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4592    /// let x = ServiceConnectionToken::new().set_description("example");
4593    /// ```
4594    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595        self.description = v.into();
4596        self
4597    }
4598
4599    /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
4600    ///
4601    /// # Example
4602    /// ```ignore,no_run
4603    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4604    /// let x = ServiceConnectionToken::new().set_network("example");
4605    /// ```
4606    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4607        self.network = v.into();
4608        self
4609    }
4610
4611    /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
4612    ///
4613    /// # Example
4614    /// ```ignore,no_run
4615    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4616    /// let x = ServiceConnectionToken::new().set_token("example");
4617    /// ```
4618    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4619        self.token = v.into();
4620        self
4621    }
4622
4623    /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4624    ///
4625    /// # Example
4626    /// ```ignore,no_run
4627    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4628    /// use wkt::Timestamp;
4629    /// let x = ServiceConnectionToken::new().set_expire_time(Timestamp::default()/* use setters */);
4630    /// ```
4631    pub fn set_expire_time<T>(mut self, v: T) -> Self
4632    where
4633        T: std::convert::Into<wkt::Timestamp>,
4634    {
4635        self.expire_time = std::option::Option::Some(v.into());
4636        self
4637    }
4638
4639    /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4640    ///
4641    /// # Example
4642    /// ```ignore,no_run
4643    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4644    /// use wkt::Timestamp;
4645    /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4646    /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(None::<Timestamp>);
4647    /// ```
4648    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4649    where
4650        T: std::convert::Into<wkt::Timestamp>,
4651    {
4652        self.expire_time = v.map(|x| x.into());
4653        self
4654    }
4655
4656    /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
4657    ///
4658    /// # Example
4659    /// ```ignore,no_run
4660    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4661    /// let x = ServiceConnectionToken::new().set_etag("example");
4662    /// ```
4663    pub fn set_etag<T>(mut self, v: T) -> Self
4664    where
4665        T: std::convert::Into<std::string::String>,
4666    {
4667        self.etag = std::option::Option::Some(v.into());
4668        self
4669    }
4670
4671    /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
4672    ///
4673    /// # Example
4674    /// ```ignore,no_run
4675    /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4676    /// let x = ServiceConnectionToken::new().set_or_clear_etag(Some("example"));
4677    /// let x = ServiceConnectionToken::new().set_or_clear_etag(None::<String>);
4678    /// ```
4679    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4680    where
4681        T: std::convert::Into<std::string::String>,
4682    {
4683        self.etag = v.map(|x| x.into());
4684        self
4685    }
4686}
4687
4688impl wkt::message::Message for ServiceConnectionToken {
4689    fn typename() -> &'static str {
4690        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
4691    }
4692}
4693
4694/// Request for ListServiceConnectionTokens.
4695#[derive(Clone, Default, PartialEq)]
4696#[non_exhaustive]
4697pub struct ListServiceConnectionTokensRequest {
4698    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4699    pub parent: std::string::String,
4700
4701    /// The maximum number of results per page that should be returned.
4702    pub page_size: i32,
4703
4704    /// The page token.
4705    pub page_token: std::string::String,
4706
4707    /// A filter expression that filters the results listed in the response.
4708    pub filter: std::string::String,
4709
4710    /// Sort the results by a certain order.
4711    pub order_by: std::string::String,
4712
4713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4714}
4715
4716impl ListServiceConnectionTokensRequest {
4717    /// Creates a new default instance.
4718    pub fn new() -> Self {
4719        std::default::Default::default()
4720    }
4721
4722    /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
4723    ///
4724    /// # Example
4725    /// ```ignore,no_run
4726    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4727    /// let x = ListServiceConnectionTokensRequest::new().set_parent("example");
4728    /// ```
4729    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730        self.parent = v.into();
4731        self
4732    }
4733
4734    /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
4735    ///
4736    /// # Example
4737    /// ```ignore,no_run
4738    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4739    /// let x = ListServiceConnectionTokensRequest::new().set_page_size(42);
4740    /// ```
4741    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4742        self.page_size = v.into();
4743        self
4744    }
4745
4746    /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
4747    ///
4748    /// # Example
4749    /// ```ignore,no_run
4750    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4751    /// let x = ListServiceConnectionTokensRequest::new().set_page_token("example");
4752    /// ```
4753    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4754        self.page_token = v.into();
4755        self
4756    }
4757
4758    /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
4759    ///
4760    /// # Example
4761    /// ```ignore,no_run
4762    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4763    /// let x = ListServiceConnectionTokensRequest::new().set_filter("example");
4764    /// ```
4765    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4766        self.filter = v.into();
4767        self
4768    }
4769
4770    /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
4771    ///
4772    /// # Example
4773    /// ```ignore,no_run
4774    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4775    /// let x = ListServiceConnectionTokensRequest::new().set_order_by("example");
4776    /// ```
4777    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4778        self.order_by = v.into();
4779        self
4780    }
4781}
4782
4783impl wkt::message::Message for ListServiceConnectionTokensRequest {
4784    fn typename() -> &'static str {
4785        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
4786    }
4787}
4788
4789/// Response for ListServiceConnectionTokens.
4790#[derive(Clone, Default, PartialEq)]
4791#[non_exhaustive]
4792pub struct ListServiceConnectionTokensResponse {
4793    /// ServiceConnectionTokens to be returned.
4794    pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
4795
4796    /// The next pagination token in the List response. It should be used as
4797    /// page_token for the following request. An empty value means no more result.
4798    pub next_page_token: std::string::String,
4799
4800    /// Locations that could not be reached.
4801    pub unreachable: std::vec::Vec<std::string::String>,
4802
4803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4804}
4805
4806impl ListServiceConnectionTokensResponse {
4807    /// Creates a new default instance.
4808    pub fn new() -> Self {
4809        std::default::Default::default()
4810    }
4811
4812    /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
4813    ///
4814    /// # Example
4815    /// ```ignore,no_run
4816    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4817    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4818    /// let x = ListServiceConnectionTokensResponse::new()
4819    ///     .set_service_connection_tokens([
4820    ///         ServiceConnectionToken::default()/* use setters */,
4821    ///         ServiceConnectionToken::default()/* use (different) setters */,
4822    ///     ]);
4823    /// ```
4824    pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
4825    where
4826        T: std::iter::IntoIterator<Item = V>,
4827        V: std::convert::Into<crate::model::ServiceConnectionToken>,
4828    {
4829        use std::iter::Iterator;
4830        self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
4831        self
4832    }
4833
4834    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
4835    ///
4836    /// # Example
4837    /// ```ignore,no_run
4838    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4839    /// let x = ListServiceConnectionTokensResponse::new().set_next_page_token("example");
4840    /// ```
4841    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4842        self.next_page_token = v.into();
4843        self
4844    }
4845
4846    /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
4847    ///
4848    /// # Example
4849    /// ```ignore,no_run
4850    /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4851    /// let x = ListServiceConnectionTokensResponse::new().set_unreachable(["a", "b", "c"]);
4852    /// ```
4853    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4854    where
4855        T: std::iter::IntoIterator<Item = V>,
4856        V: std::convert::Into<std::string::String>,
4857    {
4858        use std::iter::Iterator;
4859        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4860        self
4861    }
4862}
4863
4864impl wkt::message::Message for ListServiceConnectionTokensResponse {
4865    fn typename() -> &'static str {
4866        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
4867    }
4868}
4869
4870#[doc(hidden)]
4871impl google_cloud_gax::paginator::internal::PageableResponse
4872    for ListServiceConnectionTokensResponse
4873{
4874    type PageItem = crate::model::ServiceConnectionToken;
4875
4876    fn items(self) -> std::vec::Vec<Self::PageItem> {
4877        self.service_connection_tokens
4878    }
4879
4880    fn next_page_token(&self) -> std::string::String {
4881        use std::clone::Clone;
4882        self.next_page_token.clone()
4883    }
4884}
4885
4886/// Request for GetServiceConnectionToken.
4887#[derive(Clone, Default, PartialEq)]
4888#[non_exhaustive]
4889pub struct GetServiceConnectionTokenRequest {
4890    /// Required. Name of the ServiceConnectionToken to get.
4891    pub name: std::string::String,
4892
4893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4894}
4895
4896impl GetServiceConnectionTokenRequest {
4897    /// Creates a new default instance.
4898    pub fn new() -> Self {
4899        std::default::Default::default()
4900    }
4901
4902    /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4903    ///
4904    /// # Example
4905    /// ```ignore,no_run
4906    /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4907    /// let x = GetServiceConnectionTokenRequest::new().set_name("example");
4908    /// ```
4909    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4910        self.name = v.into();
4911        self
4912    }
4913}
4914
4915impl wkt::message::Message for GetServiceConnectionTokenRequest {
4916    fn typename() -> &'static str {
4917        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4918    }
4919}
4920
4921/// Request for CreateServiceConnectionToken.
4922#[derive(Clone, Default, PartialEq)]
4923#[non_exhaustive]
4924pub struct CreateServiceConnectionTokenRequest {
4925    /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4926    /// projects/123/locations/us-east1
4927    pub parent: std::string::String,
4928
4929    /// Optional. Resource ID
4930    /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4931    /// See <https://google.aip.dev/122#resource-id-segments>
4932    /// Unique per location.
4933    /// If one is not provided, one will be generated.
4934    pub service_connection_token_id: std::string::String,
4935
4936    /// Required. Initial values for a new ServiceConnectionTokens
4937    pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4938
4939    /// Optional. An optional request ID to identify requests. Specify a unique
4940    /// request ID so that if you must retry your request, the server will know to
4941    /// ignore the request if it has already been completed. The server will
4942    /// guarantee that for at least 60 minutes since the first request.
4943    ///
4944    /// For example, consider a situation where you make an initial request and
4945    /// the request times out. If you make the request again with the same request
4946    /// ID, the server can check if original operation with the same request ID
4947    /// was received, and if so, will ignore the second request. This prevents
4948    /// clients from accidentally creating duplicate commitments.
4949    ///
4950    /// The request ID must be a valid UUID with the exception that zero UUID is
4951    /// not supported (00000000-0000-0000-0000-000000000000).
4952    pub request_id: std::string::String,
4953
4954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4955}
4956
4957impl CreateServiceConnectionTokenRequest {
4958    /// Creates a new default instance.
4959    pub fn new() -> Self {
4960        std::default::Default::default()
4961    }
4962
4963    /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
4964    ///
4965    /// # Example
4966    /// ```ignore,no_run
4967    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4968    /// let x = CreateServiceConnectionTokenRequest::new().set_parent("example");
4969    /// ```
4970    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4971        self.parent = v.into();
4972        self
4973    }
4974
4975    /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
4976    ///
4977    /// # Example
4978    /// ```ignore,no_run
4979    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4980    /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
4981    /// ```
4982    pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
4983        mut self,
4984        v: T,
4985    ) -> Self {
4986        self.service_connection_token_id = v.into();
4987        self
4988    }
4989
4990    /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4991    ///
4992    /// # Example
4993    /// ```ignore,no_run
4994    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4995    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4996    /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
4997    /// ```
4998    pub fn set_service_connection_token<T>(mut self, v: T) -> Self
4999    where
5000        T: std::convert::Into<crate::model::ServiceConnectionToken>,
5001    {
5002        self.service_connection_token = std::option::Option::Some(v.into());
5003        self
5004    }
5005
5006    /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
5007    ///
5008    /// # Example
5009    /// ```ignore,no_run
5010    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5011    /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
5012    /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
5013    /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
5014    /// ```
5015    pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
5016    where
5017        T: std::convert::Into<crate::model::ServiceConnectionToken>,
5018    {
5019        self.service_connection_token = v.map(|x| x.into());
5020        self
5021    }
5022
5023    /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
5024    ///
5025    /// # Example
5026    /// ```ignore,no_run
5027    /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5028    /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
5029    /// ```
5030    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5031        self.request_id = v.into();
5032        self
5033    }
5034}
5035
5036impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5037    fn typename() -> &'static str {
5038        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5039    }
5040}
5041
5042/// Request for DeleteServiceConnectionToken.
5043#[derive(Clone, Default, PartialEq)]
5044#[non_exhaustive]
5045pub struct DeleteServiceConnectionTokenRequest {
5046    /// Required. The name of the ServiceConnectionToken to delete.
5047    pub name: std::string::String,
5048
5049    /// Optional. An optional request ID to identify requests. Specify a unique
5050    /// request ID so that if you must retry your request, the server will know to
5051    /// ignore the request if it has already been completed. The server will
5052    /// guarantee that for at least 60 minutes after the first request.
5053    ///
5054    /// For example, consider a situation where you make an initial request and
5055    /// the request times out. If you make the request again with the same request
5056    /// ID, the server can check if original operation with the same request ID
5057    /// was received, and if so, will ignore the second request. This prevents
5058    /// clients from accidentally creating duplicate commitments.
5059    ///
5060    /// The request ID must be a valid UUID with the exception that zero UUID is
5061    /// not supported (00000000-0000-0000-0000-000000000000).
5062    pub request_id: std::string::String,
5063
5064    /// Optional. The etag is computed by the server, and may be sent on update and
5065    /// delete requests to ensure the client has an up-to-date value before
5066    /// proceeding.
5067    pub etag: std::option::Option<std::string::String>,
5068
5069    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5070}
5071
5072impl DeleteServiceConnectionTokenRequest {
5073    /// Creates a new default instance.
5074    pub fn new() -> Self {
5075        std::default::Default::default()
5076    }
5077
5078    /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5079    ///
5080    /// # Example
5081    /// ```ignore,no_run
5082    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5083    /// let x = DeleteServiceConnectionTokenRequest::new().set_name("example");
5084    /// ```
5085    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5086        self.name = v.into();
5087        self
5088    }
5089
5090    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5091    ///
5092    /// # Example
5093    /// ```ignore,no_run
5094    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5095    /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5096    /// ```
5097    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5098        self.request_id = v.into();
5099        self
5100    }
5101
5102    /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5103    ///
5104    /// # Example
5105    /// ```ignore,no_run
5106    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5107    /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5108    /// ```
5109    pub fn set_etag<T>(mut self, v: T) -> Self
5110    where
5111        T: std::convert::Into<std::string::String>,
5112    {
5113        self.etag = std::option::Option::Some(v.into());
5114        self
5115    }
5116
5117    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5118    ///
5119    /// # Example
5120    /// ```ignore,no_run
5121    /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5122    /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5123    /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5124    /// ```
5125    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5126    where
5127        T: std::convert::Into<std::string::String>,
5128    {
5129        self.etag = v.map(|x| x.into());
5130        self
5131    }
5132}
5133
5134impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5135    fn typename() -> &'static str {
5136        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5137    }
5138}
5139
5140/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5141/// configure for Data Transfer Essentials billing and metering.
5142#[derive(Clone, Default, PartialEq)]
5143#[non_exhaustive]
5144pub struct MulticloudDataTransferConfig {
5145    /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5146    /// Format:
5147    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5148    pub name: std::string::String,
5149
5150    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5151    /// created.
5152    pub create_time: std::option::Option<wkt::Timestamp>,
5153
5154    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5155    /// updated.
5156    pub update_time: std::option::Option<wkt::Timestamp>,
5157
5158    /// Optional. User-defined labels.
5159    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5160
5161    /// The etag is computed by the server, and might be sent with update and
5162    /// delete requests so that the client has an up-to-date value before
5163    /// proceeding.
5164    pub etag: std::string::String,
5165
5166    /// Optional. A description of this resource.
5167    pub description: std::string::String,
5168
5169    /// Output only. The number of `Destination` resources configured for the
5170    /// `MulticloudDataTransferConfig` resource.
5171    pub destinations_count: i32,
5172
5173    /// Output only. The number of `Destination` resources in use with the
5174    /// `MulticloudDataTransferConfig` resource.
5175    pub destinations_active_count: i32,
5176
5177    /// Optional. Maps services to their current or planned states. Service names
5178    /// are keys, and the associated values describe the state of the service. If a
5179    /// state change is expected, the value is either `ADDING` or `DELETING`,
5180    /// depending on the actions taken.
5181    ///
5182    /// Sample output:
5183    /// "services": {
5184    /// "big-query": {
5185    /// "states": [
5186    /// {
5187    /// "effectiveTime": "2024-12-12T08:00:00Z"
5188    /// "state": "ADDING",
5189    /// },
5190    /// ]
5191    /// },
5192    /// "cloud-storage": {
5193    /// "states": [
5194    /// {
5195    /// "state": "ACTIVE",
5196    /// }
5197    /// ]
5198    /// }
5199    /// }
5200    pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5201
5202    /// Output only. The Google-generated unique ID for the
5203    /// `MulticloudDataTransferConfig` resource. This value is unique across all
5204    /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5205    /// another with the same name is created, the new resource is assigned a
5206    /// different and unique ID.
5207    pub uid: std::string::String,
5208
5209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5210}
5211
5212impl MulticloudDataTransferConfig {
5213    /// Creates a new default instance.
5214    pub fn new() -> Self {
5215        std::default::Default::default()
5216    }
5217
5218    /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5219    ///
5220    /// # Example
5221    /// ```ignore,no_run
5222    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5223    /// let x = MulticloudDataTransferConfig::new().set_name("example");
5224    /// ```
5225    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5226        self.name = v.into();
5227        self
5228    }
5229
5230    /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5231    ///
5232    /// # Example
5233    /// ```ignore,no_run
5234    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5235    /// use wkt::Timestamp;
5236    /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5237    /// ```
5238    pub fn set_create_time<T>(mut self, v: T) -> Self
5239    where
5240        T: std::convert::Into<wkt::Timestamp>,
5241    {
5242        self.create_time = std::option::Option::Some(v.into());
5243        self
5244    }
5245
5246    /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5247    ///
5248    /// # Example
5249    /// ```ignore,no_run
5250    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5251    /// use wkt::Timestamp;
5252    /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5253    /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5254    /// ```
5255    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5256    where
5257        T: std::convert::Into<wkt::Timestamp>,
5258    {
5259        self.create_time = v.map(|x| x.into());
5260        self
5261    }
5262
5263    /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5264    ///
5265    /// # Example
5266    /// ```ignore,no_run
5267    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5268    /// use wkt::Timestamp;
5269    /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5270    /// ```
5271    pub fn set_update_time<T>(mut self, v: T) -> Self
5272    where
5273        T: std::convert::Into<wkt::Timestamp>,
5274    {
5275        self.update_time = std::option::Option::Some(v.into());
5276        self
5277    }
5278
5279    /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5280    ///
5281    /// # Example
5282    /// ```ignore,no_run
5283    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5284    /// use wkt::Timestamp;
5285    /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5286    /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5287    /// ```
5288    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5289    where
5290        T: std::convert::Into<wkt::Timestamp>,
5291    {
5292        self.update_time = v.map(|x| x.into());
5293        self
5294    }
5295
5296    /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5297    ///
5298    /// # Example
5299    /// ```ignore,no_run
5300    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5301    /// let x = MulticloudDataTransferConfig::new().set_labels([
5302    ///     ("key0", "abc"),
5303    ///     ("key1", "xyz"),
5304    /// ]);
5305    /// ```
5306    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5307    where
5308        T: std::iter::IntoIterator<Item = (K, V)>,
5309        K: std::convert::Into<std::string::String>,
5310        V: std::convert::Into<std::string::String>,
5311    {
5312        use std::iter::Iterator;
5313        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5314        self
5315    }
5316
5317    /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5318    ///
5319    /// # Example
5320    /// ```ignore,no_run
5321    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5322    /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5323    /// ```
5324    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5325        self.etag = v.into();
5326        self
5327    }
5328
5329    /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5330    ///
5331    /// # Example
5332    /// ```ignore,no_run
5333    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5334    /// let x = MulticloudDataTransferConfig::new().set_description("example");
5335    /// ```
5336    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5337        self.description = v.into();
5338        self
5339    }
5340
5341    /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5342    ///
5343    /// # Example
5344    /// ```ignore,no_run
5345    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5346    /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5347    /// ```
5348    pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5349        self.destinations_count = v.into();
5350        self
5351    }
5352
5353    /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5354    ///
5355    /// # Example
5356    /// ```ignore,no_run
5357    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5358    /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5359    /// ```
5360    pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5361        self.destinations_active_count = v.into();
5362        self
5363    }
5364
5365    /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5366    ///
5367    /// # Example
5368    /// ```ignore,no_run
5369    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5370    /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5371    /// let x = MulticloudDataTransferConfig::new().set_services([
5372    ///     ("key0", StateTimeline::default()/* use setters */),
5373    ///     ("key1", StateTimeline::default()/* use (different) setters */),
5374    /// ]);
5375    /// ```
5376    pub fn set_services<T, K, V>(mut self, v: T) -> Self
5377    where
5378        T: std::iter::IntoIterator<Item = (K, V)>,
5379        K: std::convert::Into<std::string::String>,
5380        V: std::convert::Into<crate::model::StateTimeline>,
5381    {
5382        use std::iter::Iterator;
5383        self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5384        self
5385    }
5386
5387    /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5388    ///
5389    /// # Example
5390    /// ```ignore,no_run
5391    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5392    /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5393    /// ```
5394    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5395        self.uid = v.into();
5396        self
5397    }
5398}
5399
5400impl wkt::message::Message for MulticloudDataTransferConfig {
5401    fn typename() -> &'static str {
5402        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5403    }
5404}
5405
5406/// Request message to list `MulticloudDataTransferConfig` resources.
5407#[derive(Clone, Default, PartialEq)]
5408#[non_exhaustive]
5409pub struct ListMulticloudDataTransferConfigsRequest {
5410    /// Required. The name of the parent resource.
5411    pub parent: std::string::String,
5412
5413    /// Optional. The maximum number of results listed per page.
5414    pub page_size: i32,
5415
5416    /// Optional. The page token.
5417    pub page_token: std::string::String,
5418
5419    /// Optional. An expression that filters the results listed in the response.
5420    pub filter: std::string::String,
5421
5422    /// Optional. The sort order of the results.
5423    pub order_by: std::string::String,
5424
5425    /// Optional. If `true`, allows partial responses for multi-regional aggregated
5426    /// list requests.
5427    pub return_partial_success: bool,
5428
5429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5430}
5431
5432impl ListMulticloudDataTransferConfigsRequest {
5433    /// Creates a new default instance.
5434    pub fn new() -> Self {
5435        std::default::Default::default()
5436    }
5437
5438    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5439    ///
5440    /// # Example
5441    /// ```ignore,no_run
5442    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5443    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5444    /// ```
5445    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446        self.parent = v.into();
5447        self
5448    }
5449
5450    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5451    ///
5452    /// # Example
5453    /// ```ignore,no_run
5454    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5455    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5456    /// ```
5457    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5458        self.page_size = v.into();
5459        self
5460    }
5461
5462    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5463    ///
5464    /// # Example
5465    /// ```ignore,no_run
5466    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5467    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5468    /// ```
5469    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5470        self.page_token = v.into();
5471        self
5472    }
5473
5474    /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5475    ///
5476    /// # Example
5477    /// ```ignore,no_run
5478    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5479    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5480    /// ```
5481    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5482        self.filter = v.into();
5483        self
5484    }
5485
5486    /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5487    ///
5488    /// # Example
5489    /// ```ignore,no_run
5490    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5491    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5492    /// ```
5493    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5494        self.order_by = v.into();
5495        self
5496    }
5497
5498    /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5499    ///
5500    /// # Example
5501    /// ```ignore,no_run
5502    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5503    /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5504    /// ```
5505    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5506        self.return_partial_success = v.into();
5507        self
5508    }
5509}
5510
5511impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5512    fn typename() -> &'static str {
5513        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5514    }
5515}
5516
5517/// Response message to list `MulticloudDataTransferConfig` resources.
5518#[derive(Clone, Default, PartialEq)]
5519#[non_exhaustive]
5520pub struct ListMulticloudDataTransferConfigsResponse {
5521    /// The list of `MulticloudDataTransferConfig` resources to be listed.
5522    pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5523
5524    /// The next page token.
5525    pub next_page_token: std::string::String,
5526
5527    /// Locations that could not be reached.
5528    pub unreachable: std::vec::Vec<std::string::String>,
5529
5530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5531}
5532
5533impl ListMulticloudDataTransferConfigsResponse {
5534    /// Creates a new default instance.
5535    pub fn new() -> Self {
5536        std::default::Default::default()
5537    }
5538
5539    /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5540    ///
5541    /// # Example
5542    /// ```ignore,no_run
5543    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5544    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5545    /// let x = ListMulticloudDataTransferConfigsResponse::new()
5546    ///     .set_multicloud_data_transfer_configs([
5547    ///         MulticloudDataTransferConfig::default()/* use setters */,
5548    ///         MulticloudDataTransferConfig::default()/* use (different) setters */,
5549    ///     ]);
5550    /// ```
5551    pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5552    where
5553        T: std::iter::IntoIterator<Item = V>,
5554        V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5555    {
5556        use std::iter::Iterator;
5557        self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5558        self
5559    }
5560
5561    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5562    ///
5563    /// # Example
5564    /// ```ignore,no_run
5565    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5566    /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5567    /// ```
5568    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5569        self.next_page_token = v.into();
5570        self
5571    }
5572
5573    /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5574    ///
5575    /// # Example
5576    /// ```ignore,no_run
5577    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5578    /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5579    /// ```
5580    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5581    where
5582        T: std::iter::IntoIterator<Item = V>,
5583        V: std::convert::Into<std::string::String>,
5584    {
5585        use std::iter::Iterator;
5586        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5587        self
5588    }
5589}
5590
5591impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5592    fn typename() -> &'static str {
5593        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5594    }
5595}
5596
5597#[doc(hidden)]
5598impl google_cloud_gax::paginator::internal::PageableResponse
5599    for ListMulticloudDataTransferConfigsResponse
5600{
5601    type PageItem = crate::model::MulticloudDataTransferConfig;
5602
5603    fn items(self) -> std::vec::Vec<Self::PageItem> {
5604        self.multicloud_data_transfer_configs
5605    }
5606
5607    fn next_page_token(&self) -> std::string::String {
5608        use std::clone::Clone;
5609        self.next_page_token.clone()
5610    }
5611}
5612
5613/// Request message to get the details of a `MulticloudDataTransferConfig`
5614/// resource.
5615#[derive(Clone, Default, PartialEq)]
5616#[non_exhaustive]
5617pub struct GetMulticloudDataTransferConfigRequest {
5618    /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5619    pub name: std::string::String,
5620
5621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5622}
5623
5624impl GetMulticloudDataTransferConfigRequest {
5625    /// Creates a new default instance.
5626    pub fn new() -> Self {
5627        std::default::Default::default()
5628    }
5629
5630    /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5631    ///
5632    /// # Example
5633    /// ```ignore,no_run
5634    /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5635    /// let x = GetMulticloudDataTransferConfigRequest::new().set_name("example");
5636    /// ```
5637    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5638        self.name = v.into();
5639        self
5640    }
5641}
5642
5643impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5644    fn typename() -> &'static str {
5645        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5646    }
5647}
5648
5649/// Request message to create a `MulticloudDataTransferConfig` resource.
5650#[derive(Clone, Default, PartialEq)]
5651#[non_exhaustive]
5652pub struct CreateMulticloudDataTransferConfigRequest {
5653    /// Required. The name of the parent resource.
5654    pub parent: std::string::String,
5655
5656    /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5657    /// which becomes the final component of the `MulticloudDataTransferConfig`
5658    /// resource name.
5659    pub multicloud_data_transfer_config_id: std::string::String,
5660
5661    /// Required. The `MulticloudDataTransferConfig` resource to create.
5662    pub multicloud_data_transfer_config:
5663        std::option::Option<crate::model::MulticloudDataTransferConfig>,
5664
5665    /// Optional. A request ID to identify requests. Specify a unique request ID
5666    /// so that if you must retry your request, the server can ignore
5667    /// the request if it has already been completed. The server waits
5668    /// for at least 60 minutes since the first request.
5669    ///
5670    /// For example, consider a situation where you make an initial request and
5671    /// the request times out. If you make the request again with the same request
5672    /// ID, the server can check if original operation with the same request ID
5673    /// was received, and if so, can ignore the second request. This prevents
5674    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5675    /// resources.
5676    ///
5677    /// The request ID must be a valid UUID with the exception that zero UUID
5678    /// (00000000-0000-0000-0000-000000000000) isn't supported.
5679    pub request_id: std::string::String,
5680
5681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5682}
5683
5684impl CreateMulticloudDataTransferConfigRequest {
5685    /// Creates a new default instance.
5686    pub fn new() -> Self {
5687        std::default::Default::default()
5688    }
5689
5690    /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5691    ///
5692    /// # Example
5693    /// ```ignore,no_run
5694    /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5695    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5696    /// ```
5697    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5698        self.parent = v.into();
5699        self
5700    }
5701
5702    /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5703    ///
5704    /// # Example
5705    /// ```ignore,no_run
5706    /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5707    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5708    /// ```
5709    pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5710        mut self,
5711        v: T,
5712    ) -> Self {
5713        self.multicloud_data_transfer_config_id = v.into();
5714        self
5715    }
5716
5717    /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5718    ///
5719    /// # Example
5720    /// ```ignore,no_run
5721    /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5722    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5723    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5724    /// ```
5725    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5726    where
5727        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5728    {
5729        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5730        self
5731    }
5732
5733    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5734    ///
5735    /// # Example
5736    /// ```ignore,no_run
5737    /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5738    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5739    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5740    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5741    /// ```
5742    pub fn set_or_clear_multicloud_data_transfer_config<T>(
5743        mut self,
5744        v: std::option::Option<T>,
5745    ) -> Self
5746    where
5747        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5748    {
5749        self.multicloud_data_transfer_config = v.map(|x| x.into());
5750        self
5751    }
5752
5753    /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5754    ///
5755    /// # Example
5756    /// ```ignore,no_run
5757    /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5758    /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5759    /// ```
5760    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761        self.request_id = v.into();
5762        self
5763    }
5764}
5765
5766impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5767    fn typename() -> &'static str {
5768        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5769    }
5770}
5771
5772/// Request message to update a `MulticloudDataTransferConfig` resource.
5773#[derive(Clone, Default, PartialEq)]
5774#[non_exhaustive]
5775pub struct UpdateMulticloudDataTransferConfigRequest {
5776    /// Optional. `FieldMask` is used to specify the fields in the
5777    /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5778    /// The fields specified in `update_mask` are relative to the resource, not
5779    /// the full request. A field is overwritten if it is in the mask. If you
5780    /// don't specify a mask, all fields are overwritten.
5781    pub update_mask: std::option::Option<wkt::FieldMask>,
5782
5783    /// Required. The `MulticloudDataTransferConfig` resource to update.
5784    pub multicloud_data_transfer_config:
5785        std::option::Option<crate::model::MulticloudDataTransferConfig>,
5786
5787    /// Optional. A request ID to identify requests. Specify a unique request ID
5788    /// so that if you must retry your request, the server can ignore
5789    /// the request if it has already been completed. The server waits
5790    /// for at least 60 minutes since the first request.
5791    ///
5792    /// For example, consider a situation where you make an initial request and
5793    /// the request times out. If you make the request again with the same request
5794    /// ID, the server can check if original operation with the same request ID
5795    /// was received, and if so, can ignore the second request. This prevents
5796    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5797    /// resources.
5798    ///
5799    /// The request ID must be a valid UUID with the exception that zero UUID
5800    /// (00000000-0000-0000-0000-000000000000) isn't supported.
5801    pub request_id: std::string::String,
5802
5803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5804}
5805
5806impl UpdateMulticloudDataTransferConfigRequest {
5807    /// Creates a new default instance.
5808    pub fn new() -> Self {
5809        std::default::Default::default()
5810    }
5811
5812    /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5813    ///
5814    /// # Example
5815    /// ```ignore,no_run
5816    /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5817    /// use wkt::FieldMask;
5818    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5819    /// ```
5820    pub fn set_update_mask<T>(mut self, v: T) -> Self
5821    where
5822        T: std::convert::Into<wkt::FieldMask>,
5823    {
5824        self.update_mask = std::option::Option::Some(v.into());
5825        self
5826    }
5827
5828    /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5829    ///
5830    /// # Example
5831    /// ```ignore,no_run
5832    /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5833    /// use wkt::FieldMask;
5834    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5835    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5836    /// ```
5837    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5838    where
5839        T: std::convert::Into<wkt::FieldMask>,
5840    {
5841        self.update_mask = v.map(|x| x.into());
5842        self
5843    }
5844
5845    /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5846    ///
5847    /// # Example
5848    /// ```ignore,no_run
5849    /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5850    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5851    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5852    /// ```
5853    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5854    where
5855        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5856    {
5857        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5858        self
5859    }
5860
5861    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5862    ///
5863    /// # Example
5864    /// ```ignore,no_run
5865    /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5866    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5867    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5868    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5869    /// ```
5870    pub fn set_or_clear_multicloud_data_transfer_config<T>(
5871        mut self,
5872        v: std::option::Option<T>,
5873    ) -> Self
5874    where
5875        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5876    {
5877        self.multicloud_data_transfer_config = v.map(|x| x.into());
5878        self
5879    }
5880
5881    /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5882    ///
5883    /// # Example
5884    /// ```ignore,no_run
5885    /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5886    /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5887    /// ```
5888    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5889        self.request_id = v.into();
5890        self
5891    }
5892}
5893
5894impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5895    fn typename() -> &'static str {
5896        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5897    }
5898}
5899
5900/// Request message to delete a `MulticloudDataTransferConfig` resource.
5901#[derive(Clone, Default, PartialEq)]
5902#[non_exhaustive]
5903pub struct DeleteMulticloudDataTransferConfigRequest {
5904    /// Required. The name of the `MulticloudDataTransferConfig` resource to
5905    /// delete.
5906    pub name: std::string::String,
5907
5908    /// Optional. A request ID to identify requests. Specify a unique request ID
5909    /// so that if you must retry your request, the server can ignore
5910    /// the request if it has already been completed. The server waits
5911    /// for at least 60 minutes since the first request.
5912    ///
5913    /// For example, consider a situation where you make an initial request and
5914    /// the request times out. If you make the request again with the same request
5915    /// ID, the server can check if original operation with the same request ID
5916    /// was received, and if so, can ignore the second request. This prevents
5917    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5918    /// resources.
5919    ///
5920    /// The request ID must be a valid UUID with the exception that zero UUID
5921    /// (00000000-0000-0000-0000-000000000000) isn't supported.
5922    pub request_id: std::string::String,
5923
5924    /// Optional. The etag is computed by the server, and might be sent with update
5925    /// and delete requests so that the client has an up-to-date value before
5926    /// proceeding.
5927    pub etag: std::string::String,
5928
5929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930}
5931
5932impl DeleteMulticloudDataTransferConfigRequest {
5933    /// Creates a new default instance.
5934    pub fn new() -> Self {
5935        std::default::Default::default()
5936    }
5937
5938    /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5939    ///
5940    /// # Example
5941    /// ```ignore,no_run
5942    /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5943    /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name("example");
5944    /// ```
5945    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946        self.name = v.into();
5947        self
5948    }
5949
5950    /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
5951    ///
5952    /// # Example
5953    /// ```ignore,no_run
5954    /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5955    /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
5956    /// ```
5957    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5958        self.request_id = v.into();
5959        self
5960    }
5961
5962    /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
5963    ///
5964    /// # Example
5965    /// ```ignore,no_run
5966    /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5967    /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
5968    /// ```
5969    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5970        self.etag = v.into();
5971        self
5972    }
5973}
5974
5975impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
5976    fn typename() -> &'static str {
5977        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
5978    }
5979}
5980
5981/// The `Destination` resource. It specifies the IP prefix and the associated
5982/// autonomous system numbers (ASN) that you want to include in a
5983/// `MulticloudDataTransferConfig` resource.
5984#[derive(Clone, Default, PartialEq)]
5985#[non_exhaustive]
5986pub struct Destination {
5987    /// Identifier. The name of the `Destination` resource.
5988    /// Format:
5989    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
5990    pub name: std::string::String,
5991
5992    /// Output only. Time when the `Destination` resource was created.
5993    pub create_time: std::option::Option<wkt::Timestamp>,
5994
5995    /// Output only. Time when the `Destination` resource was updated.
5996    pub update_time: std::option::Option<wkt::Timestamp>,
5997
5998    /// Optional. User-defined labels.
5999    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6000
6001    /// The etag is computed by the server, and might be sent with update and
6002    /// delete requests so that the client has an up-to-date value before
6003    /// proceeding.
6004    pub etag: std::string::String,
6005
6006    /// Optional. A description of this resource.
6007    pub description: std::string::String,
6008
6009    /// Required. Immutable. The IP prefix that represents your workload on another
6010    /// CSP.
6011    pub ip_prefix: std::string::String,
6012
6013    /// Required. Unordered list. The list of `DestinationEndpoint` resources
6014    /// configured for the IP prefix.
6015    pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
6016
6017    /// Output only. The timeline of the expected `Destination` states or the
6018    /// current rest state. If a state change is expected, the value is `ADDING`,
6019    /// `DELETING` or `SUSPENDING`, depending on the action specified.
6020    ///
6021    /// Example:
6022    /// "state_timeline": {
6023    /// "states": [
6024    /// {
6025    /// // The time when the `Destination` resource will be activated.
6026    /// "effectiveTime": "2024-12-01T08:00:00Z",
6027    /// "state": "ADDING"
6028    /// },
6029    /// {
6030    /// // The time when the `Destination` resource will be suspended.
6031    /// "effectiveTime": "2024-12-01T20:00:00Z",
6032    /// "state": "SUSPENDING"
6033    /// }
6034    /// ]
6035    /// }
6036    pub state_timeline: std::option::Option<crate::model::StateTimeline>,
6037
6038    /// Output only. The Google-generated unique ID for the `Destination` resource.
6039    /// This value is unique across all `Destination` resources.
6040    /// If a resource is deleted and another with the same name is
6041    /// created, the new resource is assigned a different and unique ID.
6042    pub uid: std::string::String,
6043
6044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6045}
6046
6047impl Destination {
6048    /// Creates a new default instance.
6049    pub fn new() -> Self {
6050        std::default::Default::default()
6051    }
6052
6053    /// Sets the value of [name][crate::model::Destination::name].
6054    ///
6055    /// # Example
6056    /// ```ignore,no_run
6057    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6058    /// let x = Destination::new().set_name("example");
6059    /// ```
6060    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6061        self.name = v.into();
6062        self
6063    }
6064
6065    /// Sets the value of [create_time][crate::model::Destination::create_time].
6066    ///
6067    /// # Example
6068    /// ```ignore,no_run
6069    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6070    /// use wkt::Timestamp;
6071    /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6072    /// ```
6073    pub fn set_create_time<T>(mut self, v: T) -> Self
6074    where
6075        T: std::convert::Into<wkt::Timestamp>,
6076    {
6077        self.create_time = std::option::Option::Some(v.into());
6078        self
6079    }
6080
6081    /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6082    ///
6083    /// # Example
6084    /// ```ignore,no_run
6085    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6086    /// use wkt::Timestamp;
6087    /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6088    /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6089    /// ```
6090    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6091    where
6092        T: std::convert::Into<wkt::Timestamp>,
6093    {
6094        self.create_time = v.map(|x| x.into());
6095        self
6096    }
6097
6098    /// Sets the value of [update_time][crate::model::Destination::update_time].
6099    ///
6100    /// # Example
6101    /// ```ignore,no_run
6102    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6103    /// use wkt::Timestamp;
6104    /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6105    /// ```
6106    pub fn set_update_time<T>(mut self, v: T) -> Self
6107    where
6108        T: std::convert::Into<wkt::Timestamp>,
6109    {
6110        self.update_time = std::option::Option::Some(v.into());
6111        self
6112    }
6113
6114    /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6115    ///
6116    /// # Example
6117    /// ```ignore,no_run
6118    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6119    /// use wkt::Timestamp;
6120    /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6121    /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6122    /// ```
6123    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6124    where
6125        T: std::convert::Into<wkt::Timestamp>,
6126    {
6127        self.update_time = v.map(|x| x.into());
6128        self
6129    }
6130
6131    /// Sets the value of [labels][crate::model::Destination::labels].
6132    ///
6133    /// # Example
6134    /// ```ignore,no_run
6135    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6136    /// let x = Destination::new().set_labels([
6137    ///     ("key0", "abc"),
6138    ///     ("key1", "xyz"),
6139    /// ]);
6140    /// ```
6141    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6142    where
6143        T: std::iter::IntoIterator<Item = (K, V)>,
6144        K: std::convert::Into<std::string::String>,
6145        V: std::convert::Into<std::string::String>,
6146    {
6147        use std::iter::Iterator;
6148        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6149        self
6150    }
6151
6152    /// Sets the value of [etag][crate::model::Destination::etag].
6153    ///
6154    /// # Example
6155    /// ```ignore,no_run
6156    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6157    /// let x = Destination::new().set_etag("example");
6158    /// ```
6159    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6160        self.etag = v.into();
6161        self
6162    }
6163
6164    /// Sets the value of [description][crate::model::Destination::description].
6165    ///
6166    /// # Example
6167    /// ```ignore,no_run
6168    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6169    /// let x = Destination::new().set_description("example");
6170    /// ```
6171    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6172        self.description = v.into();
6173        self
6174    }
6175
6176    /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6177    ///
6178    /// # Example
6179    /// ```ignore,no_run
6180    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6181    /// let x = Destination::new().set_ip_prefix("example");
6182    /// ```
6183    pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6184        self.ip_prefix = v.into();
6185        self
6186    }
6187
6188    /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6189    ///
6190    /// # Example
6191    /// ```ignore,no_run
6192    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6193    /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6194    /// let x = Destination::new()
6195    ///     .set_endpoints([
6196    ///         DestinationEndpoint::default()/* use setters */,
6197    ///         DestinationEndpoint::default()/* use (different) setters */,
6198    ///     ]);
6199    /// ```
6200    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6201    where
6202        T: std::iter::IntoIterator<Item = V>,
6203        V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6204    {
6205        use std::iter::Iterator;
6206        self.endpoints = v.into_iter().map(|i| i.into()).collect();
6207        self
6208    }
6209
6210    /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6211    ///
6212    /// # Example
6213    /// ```ignore,no_run
6214    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6215    /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6216    /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6217    /// ```
6218    pub fn set_state_timeline<T>(mut self, v: T) -> Self
6219    where
6220        T: std::convert::Into<crate::model::StateTimeline>,
6221    {
6222        self.state_timeline = std::option::Option::Some(v.into());
6223        self
6224    }
6225
6226    /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6227    ///
6228    /// # Example
6229    /// ```ignore,no_run
6230    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6231    /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6232    /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6233    /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6234    /// ```
6235    pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6236    where
6237        T: std::convert::Into<crate::model::StateTimeline>,
6238    {
6239        self.state_timeline = v.map(|x| x.into());
6240        self
6241    }
6242
6243    /// Sets the value of [uid][crate::model::Destination::uid].
6244    ///
6245    /// # Example
6246    /// ```ignore,no_run
6247    /// # use google_cloud_networkconnectivity_v1::model::Destination;
6248    /// let x = Destination::new().set_uid("example");
6249    /// ```
6250    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6251        self.uid = v.into();
6252        self
6253    }
6254}
6255
6256impl wkt::message::Message for Destination {
6257    fn typename() -> &'static str {
6258        "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6259    }
6260}
6261
6262/// Defines additional types related to [Destination].
6263pub mod destination {
6264    #[allow(unused_imports)]
6265    use super::*;
6266
6267    /// The metadata for a `DestinationEndpoint` resource.
6268    #[derive(Clone, Default, PartialEq)]
6269    #[non_exhaustive]
6270    pub struct DestinationEndpoint {
6271        /// Required. The ASN of the remote IP prefix.
6272        pub asn: i64,
6273
6274        /// Required. The CSP of the remote IP prefix.
6275        pub csp: std::string::String,
6276
6277        /// Output only. The state of the `DestinationEndpoint` resource.
6278        pub state: crate::model::destination::destination_endpoint::State,
6279
6280        /// Output only. Time when the `DestinationEndpoint` resource was updated.
6281        pub update_time: std::option::Option<wkt::Timestamp>,
6282
6283        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6284    }
6285
6286    impl DestinationEndpoint {
6287        /// Creates a new default instance.
6288        pub fn new() -> Self {
6289            std::default::Default::default()
6290        }
6291
6292        /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6293        ///
6294        /// # Example
6295        /// ```ignore,no_run
6296        /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6297        /// let x = DestinationEndpoint::new().set_asn(42);
6298        /// ```
6299        pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6300            self.asn = v.into();
6301            self
6302        }
6303
6304        /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6305        ///
6306        /// # Example
6307        /// ```ignore,no_run
6308        /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6309        /// let x = DestinationEndpoint::new().set_csp("example");
6310        /// ```
6311        pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6312            self.csp = v.into();
6313            self
6314        }
6315
6316        /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6317        ///
6318        /// # Example
6319        /// ```ignore,no_run
6320        /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6321        /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6322        /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6323        /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6324        /// ```
6325        pub fn set_state<
6326            T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6327        >(
6328            mut self,
6329            v: T,
6330        ) -> Self {
6331            self.state = v.into();
6332            self
6333        }
6334
6335        /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6336        ///
6337        /// # Example
6338        /// ```ignore,no_run
6339        /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6340        /// use wkt::Timestamp;
6341        /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6342        /// ```
6343        pub fn set_update_time<T>(mut self, v: T) -> Self
6344        where
6345            T: std::convert::Into<wkt::Timestamp>,
6346        {
6347            self.update_time = std::option::Option::Some(v.into());
6348            self
6349        }
6350
6351        /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6352        ///
6353        /// # Example
6354        /// ```ignore,no_run
6355        /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6356        /// use wkt::Timestamp;
6357        /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6358        /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6359        /// ```
6360        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6361        where
6362            T: std::convert::Into<wkt::Timestamp>,
6363        {
6364            self.update_time = v.map(|x| x.into());
6365            self
6366        }
6367    }
6368
6369    impl wkt::message::Message for DestinationEndpoint {
6370        fn typename() -> &'static str {
6371            "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6372        }
6373    }
6374
6375    /// Defines additional types related to [DestinationEndpoint].
6376    pub mod destination_endpoint {
6377        #[allow(unused_imports)]
6378        use super::*;
6379
6380        /// The state of the `DestinationEndpoint` resource.
6381        ///
6382        /// # Working with unknown values
6383        ///
6384        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6385        /// additional enum variants at any time. Adding new variants is not considered
6386        /// a breaking change. Applications should write their code in anticipation of:
6387        ///
6388        /// - New values appearing in future releases of the client library, **and**
6389        /// - New values received dynamically, without application changes.
6390        ///
6391        /// Please consult the [Working with enums] section in the user guide for some
6392        /// guidelines.
6393        ///
6394        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6395        #[derive(Clone, Debug, PartialEq)]
6396        #[non_exhaustive]
6397        pub enum State {
6398            /// An invalid state, which is the default case.
6399            Unspecified,
6400            /// The `DestinationEndpoint` resource is valid.
6401            Valid,
6402            /// The `DestinationEndpoint` resource is invalid.
6403            Invalid,
6404            /// If set, the enum was initialized with an unknown value.
6405            ///
6406            /// Applications can examine the value using [State::value] or
6407            /// [State::name].
6408            UnknownValue(state::UnknownValue),
6409        }
6410
6411        #[doc(hidden)]
6412        pub mod state {
6413            #[allow(unused_imports)]
6414            use super::*;
6415            #[derive(Clone, Debug, PartialEq)]
6416            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6417        }
6418
6419        impl State {
6420            /// Gets the enum value.
6421            ///
6422            /// Returns `None` if the enum contains an unknown value deserialized from
6423            /// the string representation of enums.
6424            pub fn value(&self) -> std::option::Option<i32> {
6425                match self {
6426                    Self::Unspecified => std::option::Option::Some(0),
6427                    Self::Valid => std::option::Option::Some(1),
6428                    Self::Invalid => std::option::Option::Some(2),
6429                    Self::UnknownValue(u) => u.0.value(),
6430                }
6431            }
6432
6433            /// Gets the enum value as a string.
6434            ///
6435            /// Returns `None` if the enum contains an unknown value deserialized from
6436            /// the integer representation of enums.
6437            pub fn name(&self) -> std::option::Option<&str> {
6438                match self {
6439                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6440                    Self::Valid => std::option::Option::Some("VALID"),
6441                    Self::Invalid => std::option::Option::Some("INVALID"),
6442                    Self::UnknownValue(u) => u.0.name(),
6443                }
6444            }
6445        }
6446
6447        impl std::default::Default for State {
6448            fn default() -> Self {
6449                use std::convert::From;
6450                Self::from(0)
6451            }
6452        }
6453
6454        impl std::fmt::Display for State {
6455            fn fmt(
6456                &self,
6457                f: &mut std::fmt::Formatter<'_>,
6458            ) -> std::result::Result<(), std::fmt::Error> {
6459                wkt::internal::display_enum(f, self.name(), self.value())
6460            }
6461        }
6462
6463        impl std::convert::From<i32> for State {
6464            fn from(value: i32) -> Self {
6465                match value {
6466                    0 => Self::Unspecified,
6467                    1 => Self::Valid,
6468                    2 => Self::Invalid,
6469                    _ => Self::UnknownValue(state::UnknownValue(
6470                        wkt::internal::UnknownEnumValue::Integer(value),
6471                    )),
6472                }
6473            }
6474        }
6475
6476        impl std::convert::From<&str> for State {
6477            fn from(value: &str) -> Self {
6478                use std::string::ToString;
6479                match value {
6480                    "STATE_UNSPECIFIED" => Self::Unspecified,
6481                    "VALID" => Self::Valid,
6482                    "INVALID" => Self::Invalid,
6483                    _ => Self::UnknownValue(state::UnknownValue(
6484                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6485                    )),
6486                }
6487            }
6488        }
6489
6490        impl serde::ser::Serialize for State {
6491            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6492            where
6493                S: serde::Serializer,
6494            {
6495                match self {
6496                    Self::Unspecified => serializer.serialize_i32(0),
6497                    Self::Valid => serializer.serialize_i32(1),
6498                    Self::Invalid => serializer.serialize_i32(2),
6499                    Self::UnknownValue(u) => u.0.serialize(serializer),
6500                }
6501            }
6502        }
6503
6504        impl<'de> serde::de::Deserialize<'de> for State {
6505            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6506            where
6507                D: serde::Deserializer<'de>,
6508            {
6509                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6510                    ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6511                ))
6512            }
6513        }
6514    }
6515}
6516
6517/// Request message to list `Destination` resources.
6518#[derive(Clone, Default, PartialEq)]
6519#[non_exhaustive]
6520pub struct ListDestinationsRequest {
6521    /// Required. The name of the parent resource.
6522    pub parent: std::string::String,
6523
6524    /// Optional. The maximum number of results listed per page.
6525    pub page_size: i32,
6526
6527    /// Optional. The page token.
6528    pub page_token: std::string::String,
6529
6530    /// Optional. An expression that filters the results listed in the response.
6531    pub filter: std::string::String,
6532
6533    /// Optional. The sort order of the results.
6534    pub order_by: std::string::String,
6535
6536    /// Optional. If `true`, allow partial responses for multi-regional aggregated
6537    /// list requests.
6538    pub return_partial_success: bool,
6539
6540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6541}
6542
6543impl ListDestinationsRequest {
6544    /// Creates a new default instance.
6545    pub fn new() -> Self {
6546        std::default::Default::default()
6547    }
6548
6549    /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6550    ///
6551    /// # Example
6552    /// ```ignore,no_run
6553    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6554    /// let x = ListDestinationsRequest::new().set_parent("example");
6555    /// ```
6556    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6557        self.parent = v.into();
6558        self
6559    }
6560
6561    /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6562    ///
6563    /// # Example
6564    /// ```ignore,no_run
6565    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6566    /// let x = ListDestinationsRequest::new().set_page_size(42);
6567    /// ```
6568    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6569        self.page_size = v.into();
6570        self
6571    }
6572
6573    /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6574    ///
6575    /// # Example
6576    /// ```ignore,no_run
6577    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6578    /// let x = ListDestinationsRequest::new().set_page_token("example");
6579    /// ```
6580    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6581        self.page_token = v.into();
6582        self
6583    }
6584
6585    /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6586    ///
6587    /// # Example
6588    /// ```ignore,no_run
6589    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6590    /// let x = ListDestinationsRequest::new().set_filter("example");
6591    /// ```
6592    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6593        self.filter = v.into();
6594        self
6595    }
6596
6597    /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6598    ///
6599    /// # Example
6600    /// ```ignore,no_run
6601    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6602    /// let x = ListDestinationsRequest::new().set_order_by("example");
6603    /// ```
6604    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6605        self.order_by = v.into();
6606        self
6607    }
6608
6609    /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6610    ///
6611    /// # Example
6612    /// ```ignore,no_run
6613    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6614    /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6615    /// ```
6616    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6617        self.return_partial_success = v.into();
6618        self
6619    }
6620}
6621
6622impl wkt::message::Message for ListDestinationsRequest {
6623    fn typename() -> &'static str {
6624        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6625    }
6626}
6627
6628/// Response message to list `Destination` resources.
6629#[derive(Clone, Default, PartialEq)]
6630#[non_exhaustive]
6631pub struct ListDestinationsResponse {
6632    /// The list of `Destination` resources to be listed.
6633    pub destinations: std::vec::Vec<crate::model::Destination>,
6634
6635    /// The next page token.
6636    pub next_page_token: std::string::String,
6637
6638    /// Locations that could not be reached.
6639    pub unreachable: std::vec::Vec<std::string::String>,
6640
6641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6642}
6643
6644impl ListDestinationsResponse {
6645    /// Creates a new default instance.
6646    pub fn new() -> Self {
6647        std::default::Default::default()
6648    }
6649
6650    /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6651    ///
6652    /// # Example
6653    /// ```ignore,no_run
6654    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6655    /// use google_cloud_networkconnectivity_v1::model::Destination;
6656    /// let x = ListDestinationsResponse::new()
6657    ///     .set_destinations([
6658    ///         Destination::default()/* use setters */,
6659    ///         Destination::default()/* use (different) setters */,
6660    ///     ]);
6661    /// ```
6662    pub fn set_destinations<T, V>(mut self, v: T) -> Self
6663    where
6664        T: std::iter::IntoIterator<Item = V>,
6665        V: std::convert::Into<crate::model::Destination>,
6666    {
6667        use std::iter::Iterator;
6668        self.destinations = v.into_iter().map(|i| i.into()).collect();
6669        self
6670    }
6671
6672    /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6673    ///
6674    /// # Example
6675    /// ```ignore,no_run
6676    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6677    /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6678    /// ```
6679    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6680        self.next_page_token = v.into();
6681        self
6682    }
6683
6684    /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6685    ///
6686    /// # Example
6687    /// ```ignore,no_run
6688    /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6689    /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6690    /// ```
6691    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6692    where
6693        T: std::iter::IntoIterator<Item = V>,
6694        V: std::convert::Into<std::string::String>,
6695    {
6696        use std::iter::Iterator;
6697        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6698        self
6699    }
6700}
6701
6702impl wkt::message::Message for ListDestinationsResponse {
6703    fn typename() -> &'static str {
6704        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6705    }
6706}
6707
6708#[doc(hidden)]
6709impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6710    type PageItem = crate::model::Destination;
6711
6712    fn items(self) -> std::vec::Vec<Self::PageItem> {
6713        self.destinations
6714    }
6715
6716    fn next_page_token(&self) -> std::string::String {
6717        use std::clone::Clone;
6718        self.next_page_token.clone()
6719    }
6720}
6721
6722/// Request message to get the details of a `Destination` resource.
6723#[derive(Clone, Default, PartialEq)]
6724#[non_exhaustive]
6725pub struct GetDestinationRequest {
6726    /// Required. The name of the `Destination` resource to get.
6727    pub name: std::string::String,
6728
6729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6730}
6731
6732impl GetDestinationRequest {
6733    /// Creates a new default instance.
6734    pub fn new() -> Self {
6735        std::default::Default::default()
6736    }
6737
6738    /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6739    ///
6740    /// # Example
6741    /// ```ignore,no_run
6742    /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6743    /// let x = GetDestinationRequest::new().set_name("example");
6744    /// ```
6745    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6746        self.name = v.into();
6747        self
6748    }
6749}
6750
6751impl wkt::message::Message for GetDestinationRequest {
6752    fn typename() -> &'static str {
6753        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6754    }
6755}
6756
6757/// Request message to create a `Destination` resource.
6758#[derive(Clone, Default, PartialEq)]
6759#[non_exhaustive]
6760pub struct CreateDestinationRequest {
6761    /// Required. The name of the parent resource.
6762    pub parent: std::string::String,
6763
6764    /// Required. The ID to use for the `Destination` resource, which becomes the
6765    /// final component of the `Destination` resource name.
6766    pub destination_id: std::string::String,
6767
6768    /// Required. The `Destination` resource to create.
6769    pub destination: std::option::Option<crate::model::Destination>,
6770
6771    /// Optional. A request ID to identify requests. Specify a unique request ID
6772    /// so that if you must retry your request, the server can ignore
6773    /// the request if it has already been completed. The server waits
6774    /// for at least 60 minutes since the first request.
6775    ///
6776    /// For example, consider a situation where you make an initial request and
6777    /// the request times out. If you make the request again with the same request
6778    /// ID, the server can check if original operation with the same request ID
6779    /// was received, and if so, can ignore the second request. This prevents
6780    /// clients from accidentally creating duplicate `Destination`
6781    /// resources.
6782    ///
6783    /// The request ID must be a valid UUID with the exception that zero UUID
6784    /// (00000000-0000-0000-0000-000000000000) isn't supported.
6785    pub request_id: std::string::String,
6786
6787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6788}
6789
6790impl CreateDestinationRequest {
6791    /// Creates a new default instance.
6792    pub fn new() -> Self {
6793        std::default::Default::default()
6794    }
6795
6796    /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6797    ///
6798    /// # Example
6799    /// ```ignore,no_run
6800    /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6801    /// let x = CreateDestinationRequest::new().set_parent("example");
6802    /// ```
6803    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6804        self.parent = v.into();
6805        self
6806    }
6807
6808    /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6809    ///
6810    /// # Example
6811    /// ```ignore,no_run
6812    /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6813    /// let x = CreateDestinationRequest::new().set_destination_id("example");
6814    /// ```
6815    pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6816        self.destination_id = v.into();
6817        self
6818    }
6819
6820    /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6821    ///
6822    /// # Example
6823    /// ```ignore,no_run
6824    /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6825    /// use google_cloud_networkconnectivity_v1::model::Destination;
6826    /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6827    /// ```
6828    pub fn set_destination<T>(mut self, v: T) -> Self
6829    where
6830        T: std::convert::Into<crate::model::Destination>,
6831    {
6832        self.destination = std::option::Option::Some(v.into());
6833        self
6834    }
6835
6836    /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6837    ///
6838    /// # Example
6839    /// ```ignore,no_run
6840    /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6841    /// use google_cloud_networkconnectivity_v1::model::Destination;
6842    /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6843    /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6844    /// ```
6845    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6846    where
6847        T: std::convert::Into<crate::model::Destination>,
6848    {
6849        self.destination = v.map(|x| x.into());
6850        self
6851    }
6852
6853    /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6854    ///
6855    /// # Example
6856    /// ```ignore,no_run
6857    /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6858    /// let x = CreateDestinationRequest::new().set_request_id("example");
6859    /// ```
6860    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6861        self.request_id = v.into();
6862        self
6863    }
6864}
6865
6866impl wkt::message::Message for CreateDestinationRequest {
6867    fn typename() -> &'static str {
6868        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6869    }
6870}
6871
6872/// Request message to update a `Destination` resource.
6873#[derive(Clone, Default, PartialEq)]
6874#[non_exhaustive]
6875pub struct UpdateDestinationRequest {
6876    /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6877    /// `Destination` resource by the update.
6878    /// The fields specified in `update_mask` are relative to the resource, not
6879    /// the full request. A field is overwritten if it is in the mask. If you
6880    /// don't specify a mask, all fields are overwritten.
6881    pub update_mask: std::option::Option<wkt::FieldMask>,
6882
6883    /// Required. The `Destination` resource to update.
6884    pub destination: std::option::Option<crate::model::Destination>,
6885
6886    /// Optional. A request ID to identify requests. Specify a unique request ID
6887    /// so that if you must retry your request, the server can ignore
6888    /// the request if it has already been completed. The server waits
6889    /// for at least 60 minutes since the first request.
6890    ///
6891    /// For example, consider a situation where you make an initial request and
6892    /// the request times out. If you make the request again with the same request
6893    /// ID, the server can check if original operation with the same request ID
6894    /// was received, and if so, can ignore the second request.
6895    ///
6896    /// The request ID must be a valid UUID with the exception that zero UUID
6897    /// (00000000-0000-0000-0000-000000000000) isn't supported.
6898    pub request_id: std::string::String,
6899
6900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6901}
6902
6903impl UpdateDestinationRequest {
6904    /// Creates a new default instance.
6905    pub fn new() -> Self {
6906        std::default::Default::default()
6907    }
6908
6909    /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6910    ///
6911    /// # Example
6912    /// ```ignore,no_run
6913    /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6914    /// use wkt::FieldMask;
6915    /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6916    /// ```
6917    pub fn set_update_mask<T>(mut self, v: T) -> Self
6918    where
6919        T: std::convert::Into<wkt::FieldMask>,
6920    {
6921        self.update_mask = std::option::Option::Some(v.into());
6922        self
6923    }
6924
6925    /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6926    ///
6927    /// # Example
6928    /// ```ignore,no_run
6929    /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6930    /// use wkt::FieldMask;
6931    /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6932    /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6933    /// ```
6934    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6935    where
6936        T: std::convert::Into<wkt::FieldMask>,
6937    {
6938        self.update_mask = v.map(|x| x.into());
6939        self
6940    }
6941
6942    /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
6943    ///
6944    /// # Example
6945    /// ```ignore,no_run
6946    /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6947    /// use google_cloud_networkconnectivity_v1::model::Destination;
6948    /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6949    /// ```
6950    pub fn set_destination<T>(mut self, v: T) -> Self
6951    where
6952        T: std::convert::Into<crate::model::Destination>,
6953    {
6954        self.destination = std::option::Option::Some(v.into());
6955        self
6956    }
6957
6958    /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
6959    ///
6960    /// # Example
6961    /// ```ignore,no_run
6962    /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6963    /// use google_cloud_networkconnectivity_v1::model::Destination;
6964    /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6965    /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6966    /// ```
6967    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6968    where
6969        T: std::convert::Into<crate::model::Destination>,
6970    {
6971        self.destination = v.map(|x| x.into());
6972        self
6973    }
6974
6975    /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
6976    ///
6977    /// # Example
6978    /// ```ignore,no_run
6979    /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6980    /// let x = UpdateDestinationRequest::new().set_request_id("example");
6981    /// ```
6982    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6983        self.request_id = v.into();
6984        self
6985    }
6986}
6987
6988impl wkt::message::Message for UpdateDestinationRequest {
6989    fn typename() -> &'static str {
6990        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
6991    }
6992}
6993
6994/// Request message to delete a `Destination` resource.
6995#[derive(Clone, Default, PartialEq)]
6996#[non_exhaustive]
6997pub struct DeleteDestinationRequest {
6998    /// Required. The name of the `Destination` resource to delete.
6999    pub name: std::string::String,
7000
7001    /// Optional. A request ID to identify requests. Specify a unique request ID
7002    /// so that if you must retry your request, the server can ignore
7003    /// the request if it has already been completed. The server waits
7004    /// for at least 60 minutes since the first request.
7005    ///
7006    /// For example, consider a situation where you make an initial request and
7007    /// the request times out. If you make the request again with the same request
7008    /// ID, the server can check if original operation with the same request ID
7009    /// was received, and if so, can ignore the second request.
7010    ///
7011    /// The request ID must be a valid UUID with the exception that zero UUID
7012    /// (00000000-0000-0000-0000-000000000000) isn't supported.
7013    pub request_id: std::string::String,
7014
7015    /// Optional. The etag is computed by the server, and might be sent with update
7016    /// and delete requests so that the client has an up-to-date value before
7017    /// proceeding.
7018    pub etag: std::string::String,
7019
7020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7021}
7022
7023impl DeleteDestinationRequest {
7024    /// Creates a new default instance.
7025    pub fn new() -> Self {
7026        std::default::Default::default()
7027    }
7028
7029    /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
7030    ///
7031    /// # Example
7032    /// ```ignore,no_run
7033    /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7034    /// let x = DeleteDestinationRequest::new().set_name("example");
7035    /// ```
7036    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7037        self.name = v.into();
7038        self
7039    }
7040
7041    /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
7042    ///
7043    /// # Example
7044    /// ```ignore,no_run
7045    /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7046    /// let x = DeleteDestinationRequest::new().set_request_id("example");
7047    /// ```
7048    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7049        self.request_id = v.into();
7050        self
7051    }
7052
7053    /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7054    ///
7055    /// # Example
7056    /// ```ignore,no_run
7057    /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7058    /// let x = DeleteDestinationRequest::new().set_etag("example");
7059    /// ```
7060    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7061        self.etag = v.into();
7062        self
7063    }
7064}
7065
7066impl wkt::message::Message for DeleteDestinationRequest {
7067    fn typename() -> &'static str {
7068        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7069    }
7070}
7071
7072/// The timeline of the pending states for a resource.
7073#[derive(Clone, Default, PartialEq)]
7074#[non_exhaustive]
7075pub struct StateTimeline {
7076    /// Output only. The state and activation time details of the resource state.
7077    pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7078
7079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7080}
7081
7082impl StateTimeline {
7083    /// Creates a new default instance.
7084    pub fn new() -> Self {
7085        std::default::Default::default()
7086    }
7087
7088    /// Sets the value of [states][crate::model::StateTimeline::states].
7089    ///
7090    /// # Example
7091    /// ```ignore,no_run
7092    /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7093    /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7094    /// let x = StateTimeline::new()
7095    ///     .set_states([
7096    ///         StateMetadata::default()/* use setters */,
7097    ///         StateMetadata::default()/* use (different) setters */,
7098    ///     ]);
7099    /// ```
7100    pub fn set_states<T, V>(mut self, v: T) -> Self
7101    where
7102        T: std::iter::IntoIterator<Item = V>,
7103        V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7104    {
7105        use std::iter::Iterator;
7106        self.states = v.into_iter().map(|i| i.into()).collect();
7107        self
7108    }
7109}
7110
7111impl wkt::message::Message for StateTimeline {
7112    fn typename() -> &'static str {
7113        "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7114    }
7115}
7116
7117/// Defines additional types related to [StateTimeline].
7118pub mod state_timeline {
7119    #[allow(unused_imports)]
7120    use super::*;
7121
7122    /// The state and activation time details of the resource state.
7123    #[derive(Clone, Default, PartialEq)]
7124    #[non_exhaustive]
7125    pub struct StateMetadata {
7126        /// Output only. The state of the resource.
7127        pub state: crate::model::state_timeline::state_metadata::State,
7128
7129        /// Output only. Accompanies only the transient states, which include
7130        /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7131        /// the transient state of the resource will be effective. For instance, if
7132        /// the state is `ADDING`, this field shows the time when the resource state
7133        /// transitions to `ACTIVE`.
7134        pub effective_time: std::option::Option<wkt::Timestamp>,
7135
7136        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7137    }
7138
7139    impl StateMetadata {
7140        /// Creates a new default instance.
7141        pub fn new() -> Self {
7142            std::default::Default::default()
7143        }
7144
7145        /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7146        ///
7147        /// # Example
7148        /// ```ignore,no_run
7149        /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7150        /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7151        /// let x0 = StateMetadata::new().set_state(State::Adding);
7152        /// let x1 = StateMetadata::new().set_state(State::Active);
7153        /// let x2 = StateMetadata::new().set_state(State::Deleting);
7154        /// ```
7155        pub fn set_state<
7156            T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7157        >(
7158            mut self,
7159            v: T,
7160        ) -> Self {
7161            self.state = v.into();
7162            self
7163        }
7164
7165        /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7166        ///
7167        /// # Example
7168        /// ```ignore,no_run
7169        /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7170        /// use wkt::Timestamp;
7171        /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7172        /// ```
7173        pub fn set_effective_time<T>(mut self, v: T) -> Self
7174        where
7175            T: std::convert::Into<wkt::Timestamp>,
7176        {
7177            self.effective_time = std::option::Option::Some(v.into());
7178            self
7179        }
7180
7181        /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7182        ///
7183        /// # Example
7184        /// ```ignore,no_run
7185        /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7186        /// use wkt::Timestamp;
7187        /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7188        /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7189        /// ```
7190        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7191        where
7192            T: std::convert::Into<wkt::Timestamp>,
7193        {
7194            self.effective_time = v.map(|x| x.into());
7195            self
7196        }
7197    }
7198
7199    impl wkt::message::Message for StateMetadata {
7200        fn typename() -> &'static str {
7201            "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7202        }
7203    }
7204
7205    /// Defines additional types related to [StateMetadata].
7206    pub mod state_metadata {
7207        #[allow(unused_imports)]
7208        use super::*;
7209
7210        /// The state of the resource.
7211        ///
7212        /// # Working with unknown values
7213        ///
7214        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7215        /// additional enum variants at any time. Adding new variants is not considered
7216        /// a breaking change. Applications should write their code in anticipation of:
7217        ///
7218        /// - New values appearing in future releases of the client library, **and**
7219        /// - New values received dynamically, without application changes.
7220        ///
7221        /// Please consult the [Working with enums] section in the user guide for some
7222        /// guidelines.
7223        ///
7224        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7225        #[derive(Clone, Debug, PartialEq)]
7226        #[non_exhaustive]
7227        pub enum State {
7228            /// An invalid state, which is the default case.
7229            Unspecified,
7230            /// The resource is being added.
7231            Adding,
7232            /// The resource is in use.
7233            Active,
7234            /// The resource is being deleted.
7235            Deleting,
7236            /// The resource is being suspended.
7237            Suspending,
7238            /// The resource is suspended and not in use.
7239            Suspended,
7240            /// If set, the enum was initialized with an unknown value.
7241            ///
7242            /// Applications can examine the value using [State::value] or
7243            /// [State::name].
7244            UnknownValue(state::UnknownValue),
7245        }
7246
7247        #[doc(hidden)]
7248        pub mod state {
7249            #[allow(unused_imports)]
7250            use super::*;
7251            #[derive(Clone, Debug, PartialEq)]
7252            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7253        }
7254
7255        impl State {
7256            /// Gets the enum value.
7257            ///
7258            /// Returns `None` if the enum contains an unknown value deserialized from
7259            /// the string representation of enums.
7260            pub fn value(&self) -> std::option::Option<i32> {
7261                match self {
7262                    Self::Unspecified => std::option::Option::Some(0),
7263                    Self::Adding => std::option::Option::Some(1),
7264                    Self::Active => std::option::Option::Some(2),
7265                    Self::Deleting => std::option::Option::Some(3),
7266                    Self::Suspending => std::option::Option::Some(4),
7267                    Self::Suspended => std::option::Option::Some(5),
7268                    Self::UnknownValue(u) => u.0.value(),
7269                }
7270            }
7271
7272            /// Gets the enum value as a string.
7273            ///
7274            /// Returns `None` if the enum contains an unknown value deserialized from
7275            /// the integer representation of enums.
7276            pub fn name(&self) -> std::option::Option<&str> {
7277                match self {
7278                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7279                    Self::Adding => std::option::Option::Some("ADDING"),
7280                    Self::Active => std::option::Option::Some("ACTIVE"),
7281                    Self::Deleting => std::option::Option::Some("DELETING"),
7282                    Self::Suspending => std::option::Option::Some("SUSPENDING"),
7283                    Self::Suspended => std::option::Option::Some("SUSPENDED"),
7284                    Self::UnknownValue(u) => u.0.name(),
7285                }
7286            }
7287        }
7288
7289        impl std::default::Default for State {
7290            fn default() -> Self {
7291                use std::convert::From;
7292                Self::from(0)
7293            }
7294        }
7295
7296        impl std::fmt::Display for State {
7297            fn fmt(
7298                &self,
7299                f: &mut std::fmt::Formatter<'_>,
7300            ) -> std::result::Result<(), std::fmt::Error> {
7301                wkt::internal::display_enum(f, self.name(), self.value())
7302            }
7303        }
7304
7305        impl std::convert::From<i32> for State {
7306            fn from(value: i32) -> Self {
7307                match value {
7308                    0 => Self::Unspecified,
7309                    1 => Self::Adding,
7310                    2 => Self::Active,
7311                    3 => Self::Deleting,
7312                    4 => Self::Suspending,
7313                    5 => Self::Suspended,
7314                    _ => Self::UnknownValue(state::UnknownValue(
7315                        wkt::internal::UnknownEnumValue::Integer(value),
7316                    )),
7317                }
7318            }
7319        }
7320
7321        impl std::convert::From<&str> for State {
7322            fn from(value: &str) -> Self {
7323                use std::string::ToString;
7324                match value {
7325                    "STATE_UNSPECIFIED" => Self::Unspecified,
7326                    "ADDING" => Self::Adding,
7327                    "ACTIVE" => Self::Active,
7328                    "DELETING" => Self::Deleting,
7329                    "SUSPENDING" => Self::Suspending,
7330                    "SUSPENDED" => Self::Suspended,
7331                    _ => Self::UnknownValue(state::UnknownValue(
7332                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7333                    )),
7334                }
7335            }
7336        }
7337
7338        impl serde::ser::Serialize for State {
7339            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7340            where
7341                S: serde::Serializer,
7342            {
7343                match self {
7344                    Self::Unspecified => serializer.serialize_i32(0),
7345                    Self::Adding => serializer.serialize_i32(1),
7346                    Self::Active => serializer.serialize_i32(2),
7347                    Self::Deleting => serializer.serialize_i32(3),
7348                    Self::Suspending => serializer.serialize_i32(4),
7349                    Self::Suspended => serializer.serialize_i32(5),
7350                    Self::UnknownValue(u) => u.0.serialize(serializer),
7351                }
7352            }
7353        }
7354
7355        impl<'de> serde::de::Deserialize<'de> for State {
7356            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7357            where
7358                D: serde::Deserializer<'de>,
7359            {
7360                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7361                    ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7362                ))
7363            }
7364        }
7365    }
7366}
7367
7368/// A service in your project in a region that is eligible for Data Transfer
7369/// Essentials configuration.
7370#[derive(Clone, Default, PartialEq)]
7371#[non_exhaustive]
7372pub struct MulticloudDataTransferSupportedService {
7373    /// Identifier. The name of the service.
7374    pub name: std::string::String,
7375
7376    /// Output only. The network service tier or regional endpoint supported for
7377    /// the service.
7378    pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7379
7380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7381}
7382
7383impl MulticloudDataTransferSupportedService {
7384    /// Creates a new default instance.
7385    pub fn new() -> Self {
7386        std::default::Default::default()
7387    }
7388
7389    /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7390    ///
7391    /// # Example
7392    /// ```ignore,no_run
7393    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7394    /// let x = MulticloudDataTransferSupportedService::new().set_name("example");
7395    /// ```
7396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7397        self.name = v.into();
7398        self
7399    }
7400
7401    /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7402    ///
7403    /// # Example
7404    /// ```ignore,no_run
7405    /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7406    /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7407    /// let x = MulticloudDataTransferSupportedService::new()
7408    ///     .set_service_configs([
7409    ///         ServiceConfig::default()/* use setters */,
7410    ///         ServiceConfig::default()/* use (different) setters */,
7411    ///     ]);
7412    /// ```
7413    pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7414    where
7415        T: std::iter::IntoIterator<Item = V>,
7416        V: std::convert::Into<crate::model::ServiceConfig>,
7417    {
7418        use std::iter::Iterator;
7419        self.service_configs = v.into_iter().map(|i| i.into()).collect();
7420        self
7421    }
7422}
7423
7424impl wkt::message::Message for MulticloudDataTransferSupportedService {
7425    fn typename() -> &'static str {
7426        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7427    }
7428}
7429
7430/// Specifies eligibility information for the service.
7431#[derive(Clone, Default, PartialEq)]
7432#[non_exhaustive]
7433pub struct ServiceConfig {
7434    /// Output only. The eligibility criteria for the service.
7435    pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7436
7437    /// Output only. The end time for eligibility criteria support. If not
7438    /// specified, no planned end time is set.
7439    pub support_end_time: std::option::Option<wkt::Timestamp>,
7440
7441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7442}
7443
7444impl ServiceConfig {
7445    /// Creates a new default instance.
7446    pub fn new() -> Self {
7447        std::default::Default::default()
7448    }
7449
7450    /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7451    ///
7452    /// # Example
7453    /// ```ignore,no_run
7454    /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7455    /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7456    /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7457    /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7458    /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7459    /// ```
7460    pub fn set_eligibility_criteria<
7461        T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7462    >(
7463        mut self,
7464        v: T,
7465    ) -> Self {
7466        self.eligibility_criteria = v.into();
7467        self
7468    }
7469
7470    /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7471    ///
7472    /// # Example
7473    /// ```ignore,no_run
7474    /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7475    /// use wkt::Timestamp;
7476    /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7477    /// ```
7478    pub fn set_support_end_time<T>(mut self, v: T) -> Self
7479    where
7480        T: std::convert::Into<wkt::Timestamp>,
7481    {
7482        self.support_end_time = std::option::Option::Some(v.into());
7483        self
7484    }
7485
7486    /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7487    ///
7488    /// # Example
7489    /// ```ignore,no_run
7490    /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7491    /// use wkt::Timestamp;
7492    /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7493    /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7494    /// ```
7495    pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7496    where
7497        T: std::convert::Into<wkt::Timestamp>,
7498    {
7499        self.support_end_time = v.map(|x| x.into());
7500        self
7501    }
7502}
7503
7504impl wkt::message::Message for ServiceConfig {
7505    fn typename() -> &'static str {
7506        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7507    }
7508}
7509
7510/// Defines additional types related to [ServiceConfig].
7511pub mod service_config {
7512    #[allow(unused_imports)]
7513    use super::*;
7514
7515    /// The eligibility information for the service.
7516    ///
7517    /// # Working with unknown values
7518    ///
7519    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7520    /// additional enum variants at any time. Adding new variants is not considered
7521    /// a breaking change. Applications should write their code in anticipation of:
7522    ///
7523    /// - New values appearing in future releases of the client library, **and**
7524    /// - New values received dynamically, without application changes.
7525    ///
7526    /// Please consult the [Working with enums] section in the user guide for some
7527    /// guidelines.
7528    ///
7529    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7530    #[derive(Clone, Debug, PartialEq)]
7531    #[non_exhaustive]
7532    pub enum EligibilityCriteria {
7533        /// The service is not eligible for Data Transfer Essentials configuration.
7534        /// This is the default case.
7535        Unspecified,
7536        /// The service is eligible for Data Transfer Essentials configuration only
7537        /// for Premium Tier.
7538        NetworkServiceTierPremiumOnly,
7539        /// The service is eligible for Data Transfer Essentials configuration only
7540        /// for Standard Tier.
7541        NetworkServiceTierStandardOnly,
7542        /// The service is eligible for Data Transfer Essentials configuration only
7543        /// for the regional endpoint.
7544        RequestEndpointRegionalEndpointOnly,
7545        /// If set, the enum was initialized with an unknown value.
7546        ///
7547        /// Applications can examine the value using [EligibilityCriteria::value] or
7548        /// [EligibilityCriteria::name].
7549        UnknownValue(eligibility_criteria::UnknownValue),
7550    }
7551
7552    #[doc(hidden)]
7553    pub mod eligibility_criteria {
7554        #[allow(unused_imports)]
7555        use super::*;
7556        #[derive(Clone, Debug, PartialEq)]
7557        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7558    }
7559
7560    impl EligibilityCriteria {
7561        /// Gets the enum value.
7562        ///
7563        /// Returns `None` if the enum contains an unknown value deserialized from
7564        /// the string representation of enums.
7565        pub fn value(&self) -> std::option::Option<i32> {
7566            match self {
7567                Self::Unspecified => std::option::Option::Some(0),
7568                Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7569                Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7570                Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7571                Self::UnknownValue(u) => u.0.value(),
7572            }
7573        }
7574
7575        /// Gets the enum value as a string.
7576        ///
7577        /// Returns `None` if the enum contains an unknown value deserialized from
7578        /// the integer representation of enums.
7579        pub fn name(&self) -> std::option::Option<&str> {
7580            match self {
7581                Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7582                Self::NetworkServiceTierPremiumOnly => {
7583                    std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7584                }
7585                Self::NetworkServiceTierStandardOnly => {
7586                    std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7587                }
7588                Self::RequestEndpointRegionalEndpointOnly => {
7589                    std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7590                }
7591                Self::UnknownValue(u) => u.0.name(),
7592            }
7593        }
7594    }
7595
7596    impl std::default::Default for EligibilityCriteria {
7597        fn default() -> Self {
7598            use std::convert::From;
7599            Self::from(0)
7600        }
7601    }
7602
7603    impl std::fmt::Display for EligibilityCriteria {
7604        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7605            wkt::internal::display_enum(f, self.name(), self.value())
7606        }
7607    }
7608
7609    impl std::convert::From<i32> for EligibilityCriteria {
7610        fn from(value: i32) -> Self {
7611            match value {
7612                0 => Self::Unspecified,
7613                1 => Self::NetworkServiceTierPremiumOnly,
7614                2 => Self::NetworkServiceTierStandardOnly,
7615                3 => Self::RequestEndpointRegionalEndpointOnly,
7616                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7617                    wkt::internal::UnknownEnumValue::Integer(value),
7618                )),
7619            }
7620        }
7621    }
7622
7623    impl std::convert::From<&str> for EligibilityCriteria {
7624        fn from(value: &str) -> Self {
7625            use std::string::ToString;
7626            match value {
7627                "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7628                "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7629                "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7630                "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7631                    Self::RequestEndpointRegionalEndpointOnly
7632                }
7633                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7634                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7635                )),
7636            }
7637        }
7638    }
7639
7640    impl serde::ser::Serialize for EligibilityCriteria {
7641        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7642        where
7643            S: serde::Serializer,
7644        {
7645            match self {
7646                Self::Unspecified => serializer.serialize_i32(0),
7647                Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7648                Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7649                Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7650                Self::UnknownValue(u) => u.0.serialize(serializer),
7651            }
7652        }
7653    }
7654
7655    impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7656        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7657        where
7658            D: serde::Deserializer<'de>,
7659        {
7660            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7661                ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7662            ))
7663        }
7664    }
7665}
7666
7667/// Request message to check if a service in your project in a region is
7668/// eligible for Data Transfer Essentials configuration.
7669#[derive(Clone, Default, PartialEq)]
7670#[non_exhaustive]
7671pub struct GetMulticloudDataTransferSupportedServiceRequest {
7672    /// Required. The name of the service.
7673    pub name: std::string::String,
7674
7675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7676}
7677
7678impl GetMulticloudDataTransferSupportedServiceRequest {
7679    /// Creates a new default instance.
7680    pub fn new() -> Self {
7681        std::default::Default::default()
7682    }
7683
7684    /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7685    ///
7686    /// # Example
7687    /// ```ignore,no_run
7688    /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7689    /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name("example");
7690    /// ```
7691    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7692        self.name = v.into();
7693        self
7694    }
7695}
7696
7697impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7698    fn typename() -> &'static str {
7699        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7700    }
7701}
7702
7703/// Request message to list the services in your project that are eligible for
7704/// Data Transfer Essentials configuration.
7705#[derive(Clone, Default, PartialEq)]
7706#[non_exhaustive]
7707pub struct ListMulticloudDataTransferSupportedServicesRequest {
7708    /// Required. The name of the parent resource.
7709    pub parent: std::string::String,
7710
7711    /// Optional. The maximum number of results listed per page.
7712    pub page_size: i32,
7713
7714    /// Optional. The page token.
7715    pub page_token: std::string::String,
7716
7717    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7718}
7719
7720impl ListMulticloudDataTransferSupportedServicesRequest {
7721    /// Creates a new default instance.
7722    pub fn new() -> Self {
7723        std::default::Default::default()
7724    }
7725
7726    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7727    ///
7728    /// # Example
7729    /// ```ignore,no_run
7730    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7731    /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7732    /// ```
7733    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7734        self.parent = v.into();
7735        self
7736    }
7737
7738    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7739    ///
7740    /// # Example
7741    /// ```ignore,no_run
7742    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7743    /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7744    /// ```
7745    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7746        self.page_size = v.into();
7747        self
7748    }
7749
7750    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7751    ///
7752    /// # Example
7753    /// ```ignore,no_run
7754    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7755    /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7756    /// ```
7757    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7758        self.page_token = v.into();
7759        self
7760    }
7761}
7762
7763impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7764    fn typename() -> &'static str {
7765        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7766    }
7767}
7768
7769/// Response message to list the services in your project in regions that are
7770/// eligible for Data Transfer Essentials configuration.
7771#[derive(Clone, Default, PartialEq)]
7772#[non_exhaustive]
7773pub struct ListMulticloudDataTransferSupportedServicesResponse {
7774    /// The list of supported services.
7775    pub multicloud_data_transfer_supported_services:
7776        std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7777
7778    /// The next page token.
7779    pub next_page_token: std::string::String,
7780
7781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7782}
7783
7784impl ListMulticloudDataTransferSupportedServicesResponse {
7785    /// Creates a new default instance.
7786    pub fn new() -> Self {
7787        std::default::Default::default()
7788    }
7789
7790    /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7791    ///
7792    /// # Example
7793    /// ```ignore,no_run
7794    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7795    /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7796    /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7797    ///     .set_multicloud_data_transfer_supported_services([
7798    ///         MulticloudDataTransferSupportedService::default()/* use setters */,
7799    ///         MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7800    ///     ]);
7801    /// ```
7802    pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7803    where
7804        T: std::iter::IntoIterator<Item = V>,
7805        V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7806    {
7807        use std::iter::Iterator;
7808        self.multicloud_data_transfer_supported_services =
7809            v.into_iter().map(|i| i.into()).collect();
7810        self
7811    }
7812
7813    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7814    ///
7815    /// # Example
7816    /// ```ignore,no_run
7817    /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7818    /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7819    /// ```
7820    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7821        self.next_page_token = v.into();
7822        self
7823    }
7824}
7825
7826impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7827    fn typename() -> &'static str {
7828        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7829    }
7830}
7831
7832#[doc(hidden)]
7833impl google_cloud_gax::paginator::internal::PageableResponse
7834    for ListMulticloudDataTransferSupportedServicesResponse
7835{
7836    type PageItem = crate::model::MulticloudDataTransferSupportedService;
7837
7838    fn items(self) -> std::vec::Vec<Self::PageItem> {
7839        self.multicloud_data_transfer_supported_services
7840    }
7841
7842    fn next_page_token(&self) -> std::string::String {
7843        use std::clone::Clone;
7844        self.next_page_token.clone()
7845    }
7846}
7847
7848/// A Network Connectivity Center hub is a global management resource to which
7849/// you attach spokes. A single hub can contain spokes from multiple regions.
7850/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7851/// the resources associated with those spokes must all be in the same VPC
7852/// network. Spokes that do not use site-to-site data transfer can be associated
7853/// with any VPC network in your project.
7854#[derive(Clone, Default, PartialEq)]
7855#[non_exhaustive]
7856pub struct Hub {
7857    /// Immutable. The name of the hub. Hub names must be unique. They use the
7858    /// following form:
7859    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7860    pub name: std::string::String,
7861
7862    /// Output only. The time the hub was created.
7863    pub create_time: std::option::Option<wkt::Timestamp>,
7864
7865    /// Output only. The time the hub was last updated.
7866    pub update_time: std::option::Option<wkt::Timestamp>,
7867
7868    /// Optional labels in key-value pair format. For more information about
7869    /// labels, see [Requirements for
7870    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7871    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7872
7873    /// Optional. An optional description of the hub.
7874    pub description: std::string::String,
7875
7876    /// Output only. The Google-generated UUID for the hub. This value is unique
7877    /// across all hub resources. If a hub is deleted and another with the same
7878    /// name is created, the new hub is assigned a different unique_id.
7879    pub unique_id: std::string::String,
7880
7881    /// Output only. The current lifecycle state of this hub.
7882    pub state: crate::model::State,
7883
7884    /// The VPC networks associated with this hub's spokes.
7885    ///
7886    /// This field is read-only. Network Connectivity Center automatically
7887    /// populates it based on the set of spokes attached to the hub.
7888    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7889
7890    /// Output only. The route tables that belong to this hub. They use the
7891    /// following form:
7892    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7893    ///
7894    /// This field is read-only. Network Connectivity Center automatically
7895    /// populates it based on the route tables nested under the hub.
7896    pub route_tables: std::vec::Vec<std::string::String>,
7897
7898    /// Output only. A summary of the spokes associated with a hub. The
7899    /// summary includes a count of spokes according to type
7900    /// and according to state. If any spokes are inactive,
7901    /// the summary also lists the reasons they are inactive,
7902    /// including a count for each reason.
7903    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7904
7905    /// Optional. The policy mode of this hub. This field can be either
7906    /// PRESET or CUSTOM. If unspecified, the
7907    /// policy_mode defaults to PRESET.
7908    pub policy_mode: crate::model::PolicyMode,
7909
7910    /// Optional. The topology implemented in this hub. Currently, this field is
7911    /// only used when policy_mode = PRESET. The available preset topologies are
7912    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7913    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7914    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7915    pub preset_topology: crate::model::PresetTopology,
7916
7917    /// Optional. Whether Private Service Connect connection propagation is enabled
7918    /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7919    /// attached to the hub are made accessible to other VPC spokes attached to the
7920    /// hub. The default value is false.
7921    pub export_psc: std::option::Option<bool>,
7922
7923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7924}
7925
7926impl Hub {
7927    /// Creates a new default instance.
7928    pub fn new() -> Self {
7929        std::default::Default::default()
7930    }
7931
7932    /// Sets the value of [name][crate::model::Hub::name].
7933    ///
7934    /// # Example
7935    /// ```ignore,no_run
7936    /// # use google_cloud_networkconnectivity_v1::model::Hub;
7937    /// let x = Hub::new().set_name("example");
7938    /// ```
7939    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7940        self.name = v.into();
7941        self
7942    }
7943
7944    /// Sets the value of [create_time][crate::model::Hub::create_time].
7945    ///
7946    /// # Example
7947    /// ```ignore,no_run
7948    /// # use google_cloud_networkconnectivity_v1::model::Hub;
7949    /// use wkt::Timestamp;
7950    /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
7951    /// ```
7952    pub fn set_create_time<T>(mut self, v: T) -> Self
7953    where
7954        T: std::convert::Into<wkt::Timestamp>,
7955    {
7956        self.create_time = std::option::Option::Some(v.into());
7957        self
7958    }
7959
7960    /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
7961    ///
7962    /// # Example
7963    /// ```ignore,no_run
7964    /// # use google_cloud_networkconnectivity_v1::model::Hub;
7965    /// use wkt::Timestamp;
7966    /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7967    /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
7968    /// ```
7969    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7970    where
7971        T: std::convert::Into<wkt::Timestamp>,
7972    {
7973        self.create_time = v.map(|x| x.into());
7974        self
7975    }
7976
7977    /// Sets the value of [update_time][crate::model::Hub::update_time].
7978    ///
7979    /// # Example
7980    /// ```ignore,no_run
7981    /// # use google_cloud_networkconnectivity_v1::model::Hub;
7982    /// use wkt::Timestamp;
7983    /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
7984    /// ```
7985    pub fn set_update_time<T>(mut self, v: T) -> Self
7986    where
7987        T: std::convert::Into<wkt::Timestamp>,
7988    {
7989        self.update_time = std::option::Option::Some(v.into());
7990        self
7991    }
7992
7993    /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
7994    ///
7995    /// # Example
7996    /// ```ignore,no_run
7997    /// # use google_cloud_networkconnectivity_v1::model::Hub;
7998    /// use wkt::Timestamp;
7999    /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8000    /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
8001    /// ```
8002    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8003    where
8004        T: std::convert::Into<wkt::Timestamp>,
8005    {
8006        self.update_time = v.map(|x| x.into());
8007        self
8008    }
8009
8010    /// Sets the value of [labels][crate::model::Hub::labels].
8011    ///
8012    /// # Example
8013    /// ```ignore,no_run
8014    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8015    /// let x = Hub::new().set_labels([
8016    ///     ("key0", "abc"),
8017    ///     ("key1", "xyz"),
8018    /// ]);
8019    /// ```
8020    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8021    where
8022        T: std::iter::IntoIterator<Item = (K, V)>,
8023        K: std::convert::Into<std::string::String>,
8024        V: std::convert::Into<std::string::String>,
8025    {
8026        use std::iter::Iterator;
8027        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8028        self
8029    }
8030
8031    /// Sets the value of [description][crate::model::Hub::description].
8032    ///
8033    /// # Example
8034    /// ```ignore,no_run
8035    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8036    /// let x = Hub::new().set_description("example");
8037    /// ```
8038    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8039        self.description = v.into();
8040        self
8041    }
8042
8043    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
8044    ///
8045    /// # Example
8046    /// ```ignore,no_run
8047    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8048    /// let x = Hub::new().set_unique_id("example");
8049    /// ```
8050    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8051        self.unique_id = v.into();
8052        self
8053    }
8054
8055    /// Sets the value of [state][crate::model::Hub::state].
8056    ///
8057    /// # Example
8058    /// ```ignore,no_run
8059    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8060    /// use google_cloud_networkconnectivity_v1::model::State;
8061    /// let x0 = Hub::new().set_state(State::Creating);
8062    /// let x1 = Hub::new().set_state(State::Active);
8063    /// let x2 = Hub::new().set_state(State::Deleting);
8064    /// ```
8065    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8066        self.state = v.into();
8067        self
8068    }
8069
8070    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8075    /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8076    /// let x = Hub::new()
8077    ///     .set_routing_vpcs([
8078    ///         RoutingVPC::default()/* use setters */,
8079    ///         RoutingVPC::default()/* use (different) setters */,
8080    ///     ]);
8081    /// ```
8082    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8083    where
8084        T: std::iter::IntoIterator<Item = V>,
8085        V: std::convert::Into<crate::model::RoutingVPC>,
8086    {
8087        use std::iter::Iterator;
8088        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8089        self
8090    }
8091
8092    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8093    ///
8094    /// # Example
8095    /// ```ignore,no_run
8096    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8097    /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8098    /// ```
8099    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8100    where
8101        T: std::iter::IntoIterator<Item = V>,
8102        V: std::convert::Into<std::string::String>,
8103    {
8104        use std::iter::Iterator;
8105        self.route_tables = v.into_iter().map(|i| i.into()).collect();
8106        self
8107    }
8108
8109    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8110    ///
8111    /// # Example
8112    /// ```ignore,no_run
8113    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8114    /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8115    /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8116    /// ```
8117    pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8118    where
8119        T: std::convert::Into<crate::model::SpokeSummary>,
8120    {
8121        self.spoke_summary = std::option::Option::Some(v.into());
8122        self
8123    }
8124
8125    /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8126    ///
8127    /// # Example
8128    /// ```ignore,no_run
8129    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8130    /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8131    /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8132    /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8133    /// ```
8134    pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8135    where
8136        T: std::convert::Into<crate::model::SpokeSummary>,
8137    {
8138        self.spoke_summary = v.map(|x| x.into());
8139        self
8140    }
8141
8142    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8143    ///
8144    /// # Example
8145    /// ```ignore,no_run
8146    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8147    /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8148    /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8149    /// ```
8150    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8151        mut self,
8152        v: T,
8153    ) -> Self {
8154        self.policy_mode = v.into();
8155        self
8156    }
8157
8158    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8159    ///
8160    /// # Example
8161    /// ```ignore,no_run
8162    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8163    /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8164    /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8165    /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8166    /// ```
8167    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8168        mut self,
8169        v: T,
8170    ) -> Self {
8171        self.preset_topology = v.into();
8172        self
8173    }
8174
8175    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8176    ///
8177    /// # Example
8178    /// ```ignore,no_run
8179    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8180    /// let x = Hub::new().set_export_psc(true);
8181    /// ```
8182    pub fn set_export_psc<T>(mut self, v: T) -> Self
8183    where
8184        T: std::convert::Into<bool>,
8185    {
8186        self.export_psc = std::option::Option::Some(v.into());
8187        self
8188    }
8189
8190    /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8191    ///
8192    /// # Example
8193    /// ```ignore,no_run
8194    /// # use google_cloud_networkconnectivity_v1::model::Hub;
8195    /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8196    /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8197    /// ```
8198    pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8199    where
8200        T: std::convert::Into<bool>,
8201    {
8202        self.export_psc = v.map(|x| x.into());
8203        self
8204    }
8205}
8206
8207impl wkt::message::Message for Hub {
8208    fn typename() -> &'static str {
8209        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8210    }
8211}
8212
8213/// RoutingVPC contains information about the VPC networks associated
8214/// with the spokes of a Network Connectivity Center hub.
8215#[derive(Clone, Default, PartialEq)]
8216#[non_exhaustive]
8217pub struct RoutingVPC {
8218    /// The URI of the VPC network.
8219    pub uri: std::string::String,
8220
8221    /// Output only. If true, indicates that this VPC network is currently
8222    /// associated with spokes that use the data transfer feature (spokes where the
8223    /// site_to_site_data_transfer field is set to true). If you create new spokes
8224    /// that use data transfer, they must be associated with this VPC network. At
8225    /// most, one VPC network will have this field set to true.
8226    pub required_for_new_site_to_site_data_transfer_spokes: bool,
8227
8228    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8229}
8230
8231impl RoutingVPC {
8232    /// Creates a new default instance.
8233    pub fn new() -> Self {
8234        std::default::Default::default()
8235    }
8236
8237    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8238    ///
8239    /// # Example
8240    /// ```ignore,no_run
8241    /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8242    /// let x = RoutingVPC::new().set_uri("example");
8243    /// ```
8244    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8245        self.uri = v.into();
8246        self
8247    }
8248
8249    /// 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].
8250    ///
8251    /// # Example
8252    /// ```ignore,no_run
8253    /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8254    /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8255    /// ```
8256    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8257        mut self,
8258        v: T,
8259    ) -> Self {
8260        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8261        self
8262    }
8263}
8264
8265impl wkt::message::Message for RoutingVPC {
8266    fn typename() -> &'static str {
8267        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8268    }
8269}
8270
8271/// A Network Connectivity Center spoke represents one or more network
8272/// connectivity resources.
8273///
8274/// When you create a spoke, you associate it with a hub. You must also
8275/// identify a value for exactly one of the following fields:
8276///
8277/// * linked_vpn_tunnels
8278/// * linked_interconnect_attachments
8279/// * linked_router_appliance_instances
8280/// * linked_vpc_network
8281#[derive(Clone, Default, PartialEq)]
8282#[non_exhaustive]
8283pub struct Spoke {
8284    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8285    /// following form:
8286    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8287    pub name: std::string::String,
8288
8289    /// Output only. The time the spoke was created.
8290    pub create_time: std::option::Option<wkt::Timestamp>,
8291
8292    /// Output only. The time the spoke was last updated.
8293    pub update_time: std::option::Option<wkt::Timestamp>,
8294
8295    /// Optional labels in key-value pair format. For more information about
8296    /// labels, see [Requirements for
8297    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8298    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8299
8300    /// Optional. An optional description of the spoke.
8301    pub description: std::string::String,
8302
8303    /// Immutable. The name of the hub that this spoke is attached to.
8304    pub hub: std::string::String,
8305
8306    /// Optional. The name of the group that this spoke is associated with.
8307    pub group: std::string::String,
8308
8309    /// Optional. VPN tunnels that are associated with the spoke.
8310    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8311
8312    /// Optional. VLAN attachments that are associated with the spoke.
8313    pub linked_interconnect_attachments:
8314        std::option::Option<crate::model::LinkedInterconnectAttachments>,
8315
8316    /// Optional. Router appliance instances that are associated with the spoke.
8317    pub linked_router_appliance_instances:
8318        std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8319
8320    /// Optional. VPC network that is associated with the spoke.
8321    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8322
8323    /// Optional. The linked producer VPC that is associated with the spoke.
8324    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8325
8326    /// Output only. The Google-generated UUID for the spoke. This value is unique
8327    /// across all spoke resources. If a spoke is deleted and another with the same
8328    /// name is created, the new spoke is assigned a different `unique_id`.
8329    pub unique_id: std::string::String,
8330
8331    /// Output only. The current lifecycle state of this spoke.
8332    pub state: crate::model::State,
8333
8334    /// Output only. The reasons for current state of the spoke.
8335    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8336
8337    /// Output only. The type of resource associated with the spoke.
8338    pub spoke_type: crate::model::SpokeType,
8339
8340    /// Optional. This checksum is computed by the server based on the value of
8341    /// other fields, and may be sent on update and delete requests to ensure the
8342    /// client has an up-to-date value before proceeding.
8343    pub etag: std::string::String,
8344
8345    /// Optional. The list of fields waiting for hub administration's approval.
8346    pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8347
8348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8349}
8350
8351impl Spoke {
8352    /// Creates a new default instance.
8353    pub fn new() -> Self {
8354        std::default::Default::default()
8355    }
8356
8357    /// Sets the value of [name][crate::model::Spoke::name].
8358    ///
8359    /// # Example
8360    /// ```ignore,no_run
8361    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8362    /// let x = Spoke::new().set_name("example");
8363    /// ```
8364    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8365        self.name = v.into();
8366        self
8367    }
8368
8369    /// Sets the value of [create_time][crate::model::Spoke::create_time].
8370    ///
8371    /// # Example
8372    /// ```ignore,no_run
8373    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8374    /// use wkt::Timestamp;
8375    /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8376    /// ```
8377    pub fn set_create_time<T>(mut self, v: T) -> Self
8378    where
8379        T: std::convert::Into<wkt::Timestamp>,
8380    {
8381        self.create_time = std::option::Option::Some(v.into());
8382        self
8383    }
8384
8385    /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8386    ///
8387    /// # Example
8388    /// ```ignore,no_run
8389    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8390    /// use wkt::Timestamp;
8391    /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8392    /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8393    /// ```
8394    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8395    where
8396        T: std::convert::Into<wkt::Timestamp>,
8397    {
8398        self.create_time = v.map(|x| x.into());
8399        self
8400    }
8401
8402    /// Sets the value of [update_time][crate::model::Spoke::update_time].
8403    ///
8404    /// # Example
8405    /// ```ignore,no_run
8406    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8407    /// use wkt::Timestamp;
8408    /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8409    /// ```
8410    pub fn set_update_time<T>(mut self, v: T) -> Self
8411    where
8412        T: std::convert::Into<wkt::Timestamp>,
8413    {
8414        self.update_time = std::option::Option::Some(v.into());
8415        self
8416    }
8417
8418    /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8419    ///
8420    /// # Example
8421    /// ```ignore,no_run
8422    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8423    /// use wkt::Timestamp;
8424    /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8425    /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8426    /// ```
8427    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8428    where
8429        T: std::convert::Into<wkt::Timestamp>,
8430    {
8431        self.update_time = v.map(|x| x.into());
8432        self
8433    }
8434
8435    /// Sets the value of [labels][crate::model::Spoke::labels].
8436    ///
8437    /// # Example
8438    /// ```ignore,no_run
8439    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8440    /// let x = Spoke::new().set_labels([
8441    ///     ("key0", "abc"),
8442    ///     ("key1", "xyz"),
8443    /// ]);
8444    /// ```
8445    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8446    where
8447        T: std::iter::IntoIterator<Item = (K, V)>,
8448        K: std::convert::Into<std::string::String>,
8449        V: std::convert::Into<std::string::String>,
8450    {
8451        use std::iter::Iterator;
8452        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8453        self
8454    }
8455
8456    /// Sets the value of [description][crate::model::Spoke::description].
8457    ///
8458    /// # Example
8459    /// ```ignore,no_run
8460    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8461    /// let x = Spoke::new().set_description("example");
8462    /// ```
8463    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8464        self.description = v.into();
8465        self
8466    }
8467
8468    /// Sets the value of [hub][crate::model::Spoke::hub].
8469    ///
8470    /// # Example
8471    /// ```ignore,no_run
8472    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8473    /// let x = Spoke::new().set_hub("example");
8474    /// ```
8475    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8476        self.hub = v.into();
8477        self
8478    }
8479
8480    /// Sets the value of [group][crate::model::Spoke::group].
8481    ///
8482    /// # Example
8483    /// ```ignore,no_run
8484    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8485    /// let x = Spoke::new().set_group("example");
8486    /// ```
8487    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8488        self.group = v.into();
8489        self
8490    }
8491
8492    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8493    ///
8494    /// # Example
8495    /// ```ignore,no_run
8496    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8497    /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8498    /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8499    /// ```
8500    pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8501    where
8502        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8503    {
8504        self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8505        self
8506    }
8507
8508    /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8509    ///
8510    /// # Example
8511    /// ```ignore,no_run
8512    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8513    /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8514    /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8515    /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8516    /// ```
8517    pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8518    where
8519        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8520    {
8521        self.linked_vpn_tunnels = v.map(|x| x.into());
8522        self
8523    }
8524
8525    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8526    ///
8527    /// # Example
8528    /// ```ignore,no_run
8529    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8530    /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8531    /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8532    /// ```
8533    pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8534    where
8535        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8536    {
8537        self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8538        self
8539    }
8540
8541    /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8542    ///
8543    /// # Example
8544    /// ```ignore,no_run
8545    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8546    /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8547    /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8548    /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8549    /// ```
8550    pub fn set_or_clear_linked_interconnect_attachments<T>(
8551        mut self,
8552        v: std::option::Option<T>,
8553    ) -> Self
8554    where
8555        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8556    {
8557        self.linked_interconnect_attachments = v.map(|x| x.into());
8558        self
8559    }
8560
8561    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8562    ///
8563    /// # Example
8564    /// ```ignore,no_run
8565    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8566    /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8567    /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8568    /// ```
8569    pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8570    where
8571        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8572    {
8573        self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8574        self
8575    }
8576
8577    /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8578    ///
8579    /// # Example
8580    /// ```ignore,no_run
8581    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8582    /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8583    /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8584    /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8585    /// ```
8586    pub fn set_or_clear_linked_router_appliance_instances<T>(
8587        mut self,
8588        v: std::option::Option<T>,
8589    ) -> Self
8590    where
8591        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8592    {
8593        self.linked_router_appliance_instances = v.map(|x| x.into());
8594        self
8595    }
8596
8597    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8598    ///
8599    /// # Example
8600    /// ```ignore,no_run
8601    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8602    /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8603    /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8604    /// ```
8605    pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8606    where
8607        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8608    {
8609        self.linked_vpc_network = std::option::Option::Some(v.into());
8610        self
8611    }
8612
8613    /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8614    ///
8615    /// # Example
8616    /// ```ignore,no_run
8617    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8618    /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8619    /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8620    /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8621    /// ```
8622    pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8623    where
8624        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8625    {
8626        self.linked_vpc_network = v.map(|x| x.into());
8627        self
8628    }
8629
8630    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8631    ///
8632    /// # Example
8633    /// ```ignore,no_run
8634    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8635    /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8636    /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8637    /// ```
8638    pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8639    where
8640        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8641    {
8642        self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8643        self
8644    }
8645
8646    /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8647    ///
8648    /// # Example
8649    /// ```ignore,no_run
8650    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8651    /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8652    /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8653    /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8654    /// ```
8655    pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8656    where
8657        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8658    {
8659        self.linked_producer_vpc_network = v.map(|x| x.into());
8660        self
8661    }
8662
8663    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8664    ///
8665    /// # Example
8666    /// ```ignore,no_run
8667    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8668    /// let x = Spoke::new().set_unique_id("example");
8669    /// ```
8670    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8671        self.unique_id = v.into();
8672        self
8673    }
8674
8675    /// Sets the value of [state][crate::model::Spoke::state].
8676    ///
8677    /// # Example
8678    /// ```ignore,no_run
8679    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8680    /// use google_cloud_networkconnectivity_v1::model::State;
8681    /// let x0 = Spoke::new().set_state(State::Creating);
8682    /// let x1 = Spoke::new().set_state(State::Active);
8683    /// let x2 = Spoke::new().set_state(State::Deleting);
8684    /// ```
8685    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8686        self.state = v.into();
8687        self
8688    }
8689
8690    /// Sets the value of [reasons][crate::model::Spoke::reasons].
8691    ///
8692    /// # Example
8693    /// ```ignore,no_run
8694    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8695    /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8696    /// let x = Spoke::new()
8697    ///     .set_reasons([
8698    ///         StateReason::default()/* use setters */,
8699    ///         StateReason::default()/* use (different) setters */,
8700    ///     ]);
8701    /// ```
8702    pub fn set_reasons<T, V>(mut self, v: T) -> Self
8703    where
8704        T: std::iter::IntoIterator<Item = V>,
8705        V: std::convert::Into<crate::model::spoke::StateReason>,
8706    {
8707        use std::iter::Iterator;
8708        self.reasons = v.into_iter().map(|i| i.into()).collect();
8709        self
8710    }
8711
8712    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8713    ///
8714    /// # Example
8715    /// ```ignore,no_run
8716    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8717    /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8718    /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8719    /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8720    /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8721    /// ```
8722    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8723        self.spoke_type = v.into();
8724        self
8725    }
8726
8727    /// Sets the value of [etag][crate::model::Spoke::etag].
8728    ///
8729    /// # Example
8730    /// ```ignore,no_run
8731    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8732    /// let x = Spoke::new().set_etag("example");
8733    /// ```
8734    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8735        self.etag = v.into();
8736        self
8737    }
8738
8739    /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8740    ///
8741    /// # Example
8742    /// ```ignore,no_run
8743    /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8744    /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8745    /// ```
8746    pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8747    where
8748        T: std::iter::IntoIterator<Item = V>,
8749        V: std::convert::Into<std::string::String>,
8750    {
8751        use std::iter::Iterator;
8752        self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8753        self
8754    }
8755}
8756
8757impl wkt::message::Message for Spoke {
8758    fn typename() -> &'static str {
8759        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8760    }
8761}
8762
8763/// Defines additional types related to [Spoke].
8764pub mod spoke {
8765    #[allow(unused_imports)]
8766    use super::*;
8767
8768    /// The reason a spoke is inactive.
8769    #[derive(Clone, Default, PartialEq)]
8770    #[non_exhaustive]
8771    pub struct StateReason {
8772        /// The code associated with this reason.
8773        pub code: crate::model::spoke::state_reason::Code,
8774
8775        /// Human-readable details about this reason.
8776        pub message: std::string::String,
8777
8778        /// Additional information provided by the user in the RejectSpoke call.
8779        pub user_details: std::string::String,
8780
8781        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8782    }
8783
8784    impl StateReason {
8785        /// Creates a new default instance.
8786        pub fn new() -> Self {
8787            std::default::Default::default()
8788        }
8789
8790        /// Sets the value of [code][crate::model::spoke::StateReason::code].
8791        ///
8792        /// # Example
8793        /// ```ignore,no_run
8794        /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8795        /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8796        /// let x0 = StateReason::new().set_code(Code::PendingReview);
8797        /// let x1 = StateReason::new().set_code(Code::Rejected);
8798        /// let x2 = StateReason::new().set_code(Code::Paused);
8799        /// ```
8800        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8801            mut self,
8802            v: T,
8803        ) -> Self {
8804            self.code = v.into();
8805            self
8806        }
8807
8808        /// Sets the value of [message][crate::model::spoke::StateReason::message].
8809        ///
8810        /// # Example
8811        /// ```ignore,no_run
8812        /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8813        /// let x = StateReason::new().set_message("example");
8814        /// ```
8815        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8816            self.message = v.into();
8817            self
8818        }
8819
8820        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8821        ///
8822        /// # Example
8823        /// ```ignore,no_run
8824        /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8825        /// let x = StateReason::new().set_user_details("example");
8826        /// ```
8827        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8828            mut self,
8829            v: T,
8830        ) -> Self {
8831            self.user_details = v.into();
8832            self
8833        }
8834    }
8835
8836    impl wkt::message::Message for StateReason {
8837        fn typename() -> &'static str {
8838            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8839        }
8840    }
8841
8842    /// Defines additional types related to [StateReason].
8843    pub mod state_reason {
8844        #[allow(unused_imports)]
8845        use super::*;
8846
8847        /// The Code enum represents the various reasons a state can be `INACTIVE`.
8848        ///
8849        /// # Working with unknown values
8850        ///
8851        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8852        /// additional enum variants at any time. Adding new variants is not considered
8853        /// a breaking change. Applications should write their code in anticipation of:
8854        ///
8855        /// - New values appearing in future releases of the client library, **and**
8856        /// - New values received dynamically, without application changes.
8857        ///
8858        /// Please consult the [Working with enums] section in the user guide for some
8859        /// guidelines.
8860        ///
8861        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8862        #[derive(Clone, Debug, PartialEq)]
8863        #[non_exhaustive]
8864        pub enum Code {
8865            /// No information available.
8866            Unspecified,
8867            /// The proposed spoke is pending review.
8868            PendingReview,
8869            /// The proposed spoke has been rejected by the hub administrator.
8870            Rejected,
8871            /// The spoke has been deactivated internally.
8872            Paused,
8873            /// Network Connectivity Center encountered errors while accepting
8874            /// the spoke.
8875            Failed,
8876            /// The proposed spoke update is pending review.
8877            UpdatePendingReview,
8878            /// The proposed spoke update has been rejected by the hub administrator.
8879            UpdateRejected,
8880            /// Network Connectivity Center encountered errors while accepting
8881            /// the spoke update.
8882            UpdateFailed,
8883            /// If set, the enum was initialized with an unknown value.
8884            ///
8885            /// Applications can examine the value using [Code::value] or
8886            /// [Code::name].
8887            UnknownValue(code::UnknownValue),
8888        }
8889
8890        #[doc(hidden)]
8891        pub mod code {
8892            #[allow(unused_imports)]
8893            use super::*;
8894            #[derive(Clone, Debug, PartialEq)]
8895            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8896        }
8897
8898        impl Code {
8899            /// Gets the enum value.
8900            ///
8901            /// Returns `None` if the enum contains an unknown value deserialized from
8902            /// the string representation of enums.
8903            pub fn value(&self) -> std::option::Option<i32> {
8904                match self {
8905                    Self::Unspecified => std::option::Option::Some(0),
8906                    Self::PendingReview => std::option::Option::Some(1),
8907                    Self::Rejected => std::option::Option::Some(2),
8908                    Self::Paused => std::option::Option::Some(3),
8909                    Self::Failed => std::option::Option::Some(4),
8910                    Self::UpdatePendingReview => std::option::Option::Some(5),
8911                    Self::UpdateRejected => std::option::Option::Some(6),
8912                    Self::UpdateFailed => std::option::Option::Some(7),
8913                    Self::UnknownValue(u) => u.0.value(),
8914                }
8915            }
8916
8917            /// Gets the enum value as a string.
8918            ///
8919            /// Returns `None` if the enum contains an unknown value deserialized from
8920            /// the integer representation of enums.
8921            pub fn name(&self) -> std::option::Option<&str> {
8922                match self {
8923                    Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8924                    Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
8925                    Self::Rejected => std::option::Option::Some("REJECTED"),
8926                    Self::Paused => std::option::Option::Some("PAUSED"),
8927                    Self::Failed => std::option::Option::Some("FAILED"),
8928                    Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
8929                    Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
8930                    Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
8931                    Self::UnknownValue(u) => u.0.name(),
8932                }
8933            }
8934        }
8935
8936        impl std::default::Default for Code {
8937            fn default() -> Self {
8938                use std::convert::From;
8939                Self::from(0)
8940            }
8941        }
8942
8943        impl std::fmt::Display for Code {
8944            fn fmt(
8945                &self,
8946                f: &mut std::fmt::Formatter<'_>,
8947            ) -> std::result::Result<(), std::fmt::Error> {
8948                wkt::internal::display_enum(f, self.name(), self.value())
8949            }
8950        }
8951
8952        impl std::convert::From<i32> for Code {
8953            fn from(value: i32) -> Self {
8954                match value {
8955                    0 => Self::Unspecified,
8956                    1 => Self::PendingReview,
8957                    2 => Self::Rejected,
8958                    3 => Self::Paused,
8959                    4 => Self::Failed,
8960                    5 => Self::UpdatePendingReview,
8961                    6 => Self::UpdateRejected,
8962                    7 => Self::UpdateFailed,
8963                    _ => Self::UnknownValue(code::UnknownValue(
8964                        wkt::internal::UnknownEnumValue::Integer(value),
8965                    )),
8966                }
8967            }
8968        }
8969
8970        impl std::convert::From<&str> for Code {
8971            fn from(value: &str) -> Self {
8972                use std::string::ToString;
8973                match value {
8974                    "CODE_UNSPECIFIED" => Self::Unspecified,
8975                    "PENDING_REVIEW" => Self::PendingReview,
8976                    "REJECTED" => Self::Rejected,
8977                    "PAUSED" => Self::Paused,
8978                    "FAILED" => Self::Failed,
8979                    "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
8980                    "UPDATE_REJECTED" => Self::UpdateRejected,
8981                    "UPDATE_FAILED" => Self::UpdateFailed,
8982                    _ => Self::UnknownValue(code::UnknownValue(
8983                        wkt::internal::UnknownEnumValue::String(value.to_string()),
8984                    )),
8985                }
8986            }
8987        }
8988
8989        impl serde::ser::Serialize for Code {
8990            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8991            where
8992                S: serde::Serializer,
8993            {
8994                match self {
8995                    Self::Unspecified => serializer.serialize_i32(0),
8996                    Self::PendingReview => serializer.serialize_i32(1),
8997                    Self::Rejected => serializer.serialize_i32(2),
8998                    Self::Paused => serializer.serialize_i32(3),
8999                    Self::Failed => serializer.serialize_i32(4),
9000                    Self::UpdatePendingReview => serializer.serialize_i32(5),
9001                    Self::UpdateRejected => serializer.serialize_i32(6),
9002                    Self::UpdateFailed => serializer.serialize_i32(7),
9003                    Self::UnknownValue(u) => u.0.serialize(serializer),
9004                }
9005            }
9006        }
9007
9008        impl<'de> serde::de::Deserialize<'de> for Code {
9009            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9010            where
9011                D: serde::Deserializer<'de>,
9012            {
9013                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
9014                    ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
9015                ))
9016            }
9017        }
9018    }
9019}
9020
9021#[allow(missing_docs)]
9022#[derive(Clone, Default, PartialEq)]
9023#[non_exhaustive]
9024pub struct RouteTable {
9025    /// Immutable. The name of the route table. Route table names must be unique.
9026    /// They use the following form:
9027    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
9028    pub name: std::string::String,
9029
9030    /// Output only. The time the route table was created.
9031    pub create_time: std::option::Option<wkt::Timestamp>,
9032
9033    /// Output only. The time the route table was last updated.
9034    pub update_time: std::option::Option<wkt::Timestamp>,
9035
9036    /// Optional labels in key-value pair format. For more information about
9037    /// labels, see [Requirements for
9038    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9039    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9040
9041    /// An optional description of the route table.
9042    pub description: std::string::String,
9043
9044    /// Output only. The Google-generated UUID for the route table. This value is
9045    /// unique across all route table resources. If a route table is deleted and
9046    /// another with the same name is created, the new route table is assigned
9047    /// a different `uid`.
9048    pub uid: std::string::String,
9049
9050    /// Output only. The current lifecycle state of this route table.
9051    pub state: crate::model::State,
9052
9053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9054}
9055
9056impl RouteTable {
9057    /// Creates a new default instance.
9058    pub fn new() -> Self {
9059        std::default::Default::default()
9060    }
9061
9062    /// Sets the value of [name][crate::model::RouteTable::name].
9063    ///
9064    /// # Example
9065    /// ```ignore,no_run
9066    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9067    /// let x = RouteTable::new().set_name("example");
9068    /// ```
9069    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9070        self.name = v.into();
9071        self
9072    }
9073
9074    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9075    ///
9076    /// # Example
9077    /// ```ignore,no_run
9078    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9079    /// use wkt::Timestamp;
9080    /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9081    /// ```
9082    pub fn set_create_time<T>(mut self, v: T) -> Self
9083    where
9084        T: std::convert::Into<wkt::Timestamp>,
9085    {
9086        self.create_time = std::option::Option::Some(v.into());
9087        self
9088    }
9089
9090    /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9091    ///
9092    /// # Example
9093    /// ```ignore,no_run
9094    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9095    /// use wkt::Timestamp;
9096    /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9097    /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9098    /// ```
9099    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9100    where
9101        T: std::convert::Into<wkt::Timestamp>,
9102    {
9103        self.create_time = v.map(|x| x.into());
9104        self
9105    }
9106
9107    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9108    ///
9109    /// # Example
9110    /// ```ignore,no_run
9111    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9112    /// use wkt::Timestamp;
9113    /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9114    /// ```
9115    pub fn set_update_time<T>(mut self, v: T) -> Self
9116    where
9117        T: std::convert::Into<wkt::Timestamp>,
9118    {
9119        self.update_time = std::option::Option::Some(v.into());
9120        self
9121    }
9122
9123    /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9124    ///
9125    /// # Example
9126    /// ```ignore,no_run
9127    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9128    /// use wkt::Timestamp;
9129    /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9130    /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9131    /// ```
9132    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9133    where
9134        T: std::convert::Into<wkt::Timestamp>,
9135    {
9136        self.update_time = v.map(|x| x.into());
9137        self
9138    }
9139
9140    /// Sets the value of [labels][crate::model::RouteTable::labels].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9145    /// let x = RouteTable::new().set_labels([
9146    ///     ("key0", "abc"),
9147    ///     ("key1", "xyz"),
9148    /// ]);
9149    /// ```
9150    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9151    where
9152        T: std::iter::IntoIterator<Item = (K, V)>,
9153        K: std::convert::Into<std::string::String>,
9154        V: std::convert::Into<std::string::String>,
9155    {
9156        use std::iter::Iterator;
9157        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9158        self
9159    }
9160
9161    /// Sets the value of [description][crate::model::RouteTable::description].
9162    ///
9163    /// # Example
9164    /// ```ignore,no_run
9165    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9166    /// let x = RouteTable::new().set_description("example");
9167    /// ```
9168    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9169        self.description = v.into();
9170        self
9171    }
9172
9173    /// Sets the value of [uid][crate::model::RouteTable::uid].
9174    ///
9175    /// # Example
9176    /// ```ignore,no_run
9177    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9178    /// let x = RouteTable::new().set_uid("example");
9179    /// ```
9180    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9181        self.uid = v.into();
9182        self
9183    }
9184
9185    /// Sets the value of [state][crate::model::RouteTable::state].
9186    ///
9187    /// # Example
9188    /// ```ignore,no_run
9189    /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9190    /// use google_cloud_networkconnectivity_v1::model::State;
9191    /// let x0 = RouteTable::new().set_state(State::Creating);
9192    /// let x1 = RouteTable::new().set_state(State::Active);
9193    /// let x2 = RouteTable::new().set_state(State::Deleting);
9194    /// ```
9195    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9196        self.state = v.into();
9197        self
9198    }
9199}
9200
9201impl wkt::message::Message for RouteTable {
9202    fn typename() -> &'static str {
9203        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9204    }
9205}
9206
9207/// A route defines a path from VM instances within a spoke to a specific
9208/// destination resource. Only VPC spokes have routes.
9209#[derive(Clone, Default, PartialEq)]
9210#[non_exhaustive]
9211pub struct Route {
9212    /// Immutable. The name of the route. Route names must be unique. Route names
9213    /// use the following form:
9214    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9215    pub name: std::string::String,
9216
9217    /// Output only. The time the route was created.
9218    pub create_time: std::option::Option<wkt::Timestamp>,
9219
9220    /// Output only. The time the route was last updated.
9221    pub update_time: std::option::Option<wkt::Timestamp>,
9222
9223    /// The destination IP address range.
9224    pub ip_cidr_range: std::string::String,
9225
9226    /// Output only. The route's type. Its type is determined by the properties of
9227    /// its IP address range.
9228    pub r#type: crate::model::RouteType,
9229
9230    /// Immutable. The destination VPC network for packets on this route.
9231    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9232
9233    /// Optional labels in key-value pair format. For more information about
9234    /// labels, see [Requirements for
9235    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9236    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9237
9238    /// An optional description of the route.
9239    pub description: std::string::String,
9240
9241    /// Output only. The Google-generated UUID for the route. This value is unique
9242    /// across all Network Connectivity Center route resources. If a
9243    /// route is deleted and another with the same name is created,
9244    /// the new route is assigned a different `uid`.
9245    pub uid: std::string::String,
9246
9247    /// Output only. The current lifecycle state of the route.
9248    pub state: crate::model::State,
9249
9250    /// Immutable. The spoke that this route leads to.
9251    /// Example: projects/12345/locations/global/spokes/SPOKE
9252    pub spoke: std::string::String,
9253
9254    /// Output only. The origin location of the route.
9255    /// Uses the following form: "projects/{project}/locations/{location}"
9256    /// Example: projects/1234/locations/us-central1
9257    pub location: std::string::String,
9258
9259    /// Output only. The priority of this route. Priority is used to break ties in
9260    /// cases where a destination matches more than one route. In these cases the
9261    /// route with the lowest-numbered priority value wins.
9262    pub priority: i64,
9263
9264    /// Immutable. The next-hop VPN tunnel for packets on this route.
9265    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9266
9267    /// Immutable. The next-hop Router appliance instance for packets on this
9268    /// route.
9269    pub next_hop_router_appliance_instance:
9270        std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9271
9272    /// Immutable. The next-hop VLAN attachment for packets on this route.
9273    pub next_hop_interconnect_attachment:
9274        std::option::Option<crate::model::NextHopInterconnectAttachment>,
9275
9276    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9277}
9278
9279impl Route {
9280    /// Creates a new default instance.
9281    pub fn new() -> Self {
9282        std::default::Default::default()
9283    }
9284
9285    /// Sets the value of [name][crate::model::Route::name].
9286    ///
9287    /// # Example
9288    /// ```ignore,no_run
9289    /// # use google_cloud_networkconnectivity_v1::model::Route;
9290    /// let x = Route::new().set_name("example");
9291    /// ```
9292    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9293        self.name = v.into();
9294        self
9295    }
9296
9297    /// Sets the value of [create_time][crate::model::Route::create_time].
9298    ///
9299    /// # Example
9300    /// ```ignore,no_run
9301    /// # use google_cloud_networkconnectivity_v1::model::Route;
9302    /// use wkt::Timestamp;
9303    /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9304    /// ```
9305    pub fn set_create_time<T>(mut self, v: T) -> Self
9306    where
9307        T: std::convert::Into<wkt::Timestamp>,
9308    {
9309        self.create_time = std::option::Option::Some(v.into());
9310        self
9311    }
9312
9313    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9314    ///
9315    /// # Example
9316    /// ```ignore,no_run
9317    /// # use google_cloud_networkconnectivity_v1::model::Route;
9318    /// use wkt::Timestamp;
9319    /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9320    /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9321    /// ```
9322    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9323    where
9324        T: std::convert::Into<wkt::Timestamp>,
9325    {
9326        self.create_time = v.map(|x| x.into());
9327        self
9328    }
9329
9330    /// Sets the value of [update_time][crate::model::Route::update_time].
9331    ///
9332    /// # Example
9333    /// ```ignore,no_run
9334    /// # use google_cloud_networkconnectivity_v1::model::Route;
9335    /// use wkt::Timestamp;
9336    /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9337    /// ```
9338    pub fn set_update_time<T>(mut self, v: T) -> Self
9339    where
9340        T: std::convert::Into<wkt::Timestamp>,
9341    {
9342        self.update_time = std::option::Option::Some(v.into());
9343        self
9344    }
9345
9346    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9347    ///
9348    /// # Example
9349    /// ```ignore,no_run
9350    /// # use google_cloud_networkconnectivity_v1::model::Route;
9351    /// use wkt::Timestamp;
9352    /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9353    /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9354    /// ```
9355    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9356    where
9357        T: std::convert::Into<wkt::Timestamp>,
9358    {
9359        self.update_time = v.map(|x| x.into());
9360        self
9361    }
9362
9363    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9364    ///
9365    /// # Example
9366    /// ```ignore,no_run
9367    /// # use google_cloud_networkconnectivity_v1::model::Route;
9368    /// let x = Route::new().set_ip_cidr_range("example");
9369    /// ```
9370    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9371        self.ip_cidr_range = v.into();
9372        self
9373    }
9374
9375    /// Sets the value of [r#type][crate::model::Route::type].
9376    ///
9377    /// # Example
9378    /// ```ignore,no_run
9379    /// # use google_cloud_networkconnectivity_v1::model::Route;
9380    /// use google_cloud_networkconnectivity_v1::model::RouteType;
9381    /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9382    /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9383    /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9384    /// ```
9385    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9386        self.r#type = v.into();
9387        self
9388    }
9389
9390    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9391    ///
9392    /// # Example
9393    /// ```ignore,no_run
9394    /// # use google_cloud_networkconnectivity_v1::model::Route;
9395    /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9396    /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9397    /// ```
9398    pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9399    where
9400        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9401    {
9402        self.next_hop_vpc_network = std::option::Option::Some(v.into());
9403        self
9404    }
9405
9406    /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9407    ///
9408    /// # Example
9409    /// ```ignore,no_run
9410    /// # use google_cloud_networkconnectivity_v1::model::Route;
9411    /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9412    /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9413    /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9414    /// ```
9415    pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9416    where
9417        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9418    {
9419        self.next_hop_vpc_network = v.map(|x| x.into());
9420        self
9421    }
9422
9423    /// Sets the value of [labels][crate::model::Route::labels].
9424    ///
9425    /// # Example
9426    /// ```ignore,no_run
9427    /// # use google_cloud_networkconnectivity_v1::model::Route;
9428    /// let x = Route::new().set_labels([
9429    ///     ("key0", "abc"),
9430    ///     ("key1", "xyz"),
9431    /// ]);
9432    /// ```
9433    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9434    where
9435        T: std::iter::IntoIterator<Item = (K, V)>,
9436        K: std::convert::Into<std::string::String>,
9437        V: std::convert::Into<std::string::String>,
9438    {
9439        use std::iter::Iterator;
9440        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9441        self
9442    }
9443
9444    /// Sets the value of [description][crate::model::Route::description].
9445    ///
9446    /// # Example
9447    /// ```ignore,no_run
9448    /// # use google_cloud_networkconnectivity_v1::model::Route;
9449    /// let x = Route::new().set_description("example");
9450    /// ```
9451    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9452        self.description = v.into();
9453        self
9454    }
9455
9456    /// Sets the value of [uid][crate::model::Route::uid].
9457    ///
9458    /// # Example
9459    /// ```ignore,no_run
9460    /// # use google_cloud_networkconnectivity_v1::model::Route;
9461    /// let x = Route::new().set_uid("example");
9462    /// ```
9463    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9464        self.uid = v.into();
9465        self
9466    }
9467
9468    /// Sets the value of [state][crate::model::Route::state].
9469    ///
9470    /// # Example
9471    /// ```ignore,no_run
9472    /// # use google_cloud_networkconnectivity_v1::model::Route;
9473    /// use google_cloud_networkconnectivity_v1::model::State;
9474    /// let x0 = Route::new().set_state(State::Creating);
9475    /// let x1 = Route::new().set_state(State::Active);
9476    /// let x2 = Route::new().set_state(State::Deleting);
9477    /// ```
9478    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9479        self.state = v.into();
9480        self
9481    }
9482
9483    /// Sets the value of [spoke][crate::model::Route::spoke].
9484    ///
9485    /// # Example
9486    /// ```ignore,no_run
9487    /// # use google_cloud_networkconnectivity_v1::model::Route;
9488    /// let x = Route::new().set_spoke("example");
9489    /// ```
9490    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9491        self.spoke = v.into();
9492        self
9493    }
9494
9495    /// Sets the value of [location][crate::model::Route::location].
9496    ///
9497    /// # Example
9498    /// ```ignore,no_run
9499    /// # use google_cloud_networkconnectivity_v1::model::Route;
9500    /// let x = Route::new().set_location("example");
9501    /// ```
9502    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9503        self.location = v.into();
9504        self
9505    }
9506
9507    /// Sets the value of [priority][crate::model::Route::priority].
9508    ///
9509    /// # Example
9510    /// ```ignore,no_run
9511    /// # use google_cloud_networkconnectivity_v1::model::Route;
9512    /// let x = Route::new().set_priority(42);
9513    /// ```
9514    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9515        self.priority = v.into();
9516        self
9517    }
9518
9519    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9520    ///
9521    /// # Example
9522    /// ```ignore,no_run
9523    /// # use google_cloud_networkconnectivity_v1::model::Route;
9524    /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9525    /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9526    /// ```
9527    pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9528    where
9529        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9530    {
9531        self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9532        self
9533    }
9534
9535    /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9536    ///
9537    /// # Example
9538    /// ```ignore,no_run
9539    /// # use google_cloud_networkconnectivity_v1::model::Route;
9540    /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9541    /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9542    /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9543    /// ```
9544    pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9545    where
9546        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9547    {
9548        self.next_hop_vpn_tunnel = v.map(|x| x.into());
9549        self
9550    }
9551
9552    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9553    ///
9554    /// # Example
9555    /// ```ignore,no_run
9556    /// # use google_cloud_networkconnectivity_v1::model::Route;
9557    /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9558    /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9559    /// ```
9560    pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9561    where
9562        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9563    {
9564        self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9565        self
9566    }
9567
9568    /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9569    ///
9570    /// # Example
9571    /// ```ignore,no_run
9572    /// # use google_cloud_networkconnectivity_v1::model::Route;
9573    /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9574    /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9575    /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9576    /// ```
9577    pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9578        mut self,
9579        v: std::option::Option<T>,
9580    ) -> Self
9581    where
9582        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9583    {
9584        self.next_hop_router_appliance_instance = v.map(|x| x.into());
9585        self
9586    }
9587
9588    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9589    ///
9590    /// # Example
9591    /// ```ignore,no_run
9592    /// # use google_cloud_networkconnectivity_v1::model::Route;
9593    /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9594    /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9595    /// ```
9596    pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9597    where
9598        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9599    {
9600        self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9601        self
9602    }
9603
9604    /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9605    ///
9606    /// # Example
9607    /// ```ignore,no_run
9608    /// # use google_cloud_networkconnectivity_v1::model::Route;
9609    /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9610    /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9611    /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9612    /// ```
9613    pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9614        mut self,
9615        v: std::option::Option<T>,
9616    ) -> Self
9617    where
9618        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9619    {
9620        self.next_hop_interconnect_attachment = v.map(|x| x.into());
9621        self
9622    }
9623}
9624
9625impl wkt::message::Message for Route {
9626    fn typename() -> &'static str {
9627        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9628    }
9629}
9630
9631/// A group represents a subset of spokes attached to a hub.
9632#[derive(Clone, Default, PartialEq)]
9633#[non_exhaustive]
9634pub struct Group {
9635    /// Immutable. The name of the group. Group names must be unique. They
9636    /// use the following form:
9637    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9638    pub name: std::string::String,
9639
9640    /// Output only. The time the group was created.
9641    pub create_time: std::option::Option<wkt::Timestamp>,
9642
9643    /// Output only. The time the group was last updated.
9644    pub update_time: std::option::Option<wkt::Timestamp>,
9645
9646    /// Optional. Labels in key-value pair format. For more information about
9647    /// labels, see [Requirements for
9648    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9649    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9650
9651    /// Optional. The description of the group.
9652    pub description: std::string::String,
9653
9654    /// Output only. The Google-generated UUID for the group. This value is unique
9655    /// across all group resources. If a group is deleted and
9656    /// another with the same name is created, the new route table is assigned
9657    /// a different unique_id.
9658    pub uid: std::string::String,
9659
9660    /// Output only. The current lifecycle state of this group.
9661    pub state: crate::model::State,
9662
9663    /// Optional. The auto-accept setting for this group.
9664    pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9665
9666    /// Output only. The name of the route table that corresponds to this group.
9667    /// They use the following form:
9668    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9669    pub route_table: std::string::String,
9670
9671    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9672}
9673
9674impl Group {
9675    /// Creates a new default instance.
9676    pub fn new() -> Self {
9677        std::default::Default::default()
9678    }
9679
9680    /// Sets the value of [name][crate::model::Group::name].
9681    ///
9682    /// # Example
9683    /// ```ignore,no_run
9684    /// # use google_cloud_networkconnectivity_v1::model::Group;
9685    /// let x = Group::new().set_name("example");
9686    /// ```
9687    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9688        self.name = v.into();
9689        self
9690    }
9691
9692    /// Sets the value of [create_time][crate::model::Group::create_time].
9693    ///
9694    /// # Example
9695    /// ```ignore,no_run
9696    /// # use google_cloud_networkconnectivity_v1::model::Group;
9697    /// use wkt::Timestamp;
9698    /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9699    /// ```
9700    pub fn set_create_time<T>(mut self, v: T) -> Self
9701    where
9702        T: std::convert::Into<wkt::Timestamp>,
9703    {
9704        self.create_time = std::option::Option::Some(v.into());
9705        self
9706    }
9707
9708    /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9709    ///
9710    /// # Example
9711    /// ```ignore,no_run
9712    /// # use google_cloud_networkconnectivity_v1::model::Group;
9713    /// use wkt::Timestamp;
9714    /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9715    /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9716    /// ```
9717    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9718    where
9719        T: std::convert::Into<wkt::Timestamp>,
9720    {
9721        self.create_time = v.map(|x| x.into());
9722        self
9723    }
9724
9725    /// Sets the value of [update_time][crate::model::Group::update_time].
9726    ///
9727    /// # Example
9728    /// ```ignore,no_run
9729    /// # use google_cloud_networkconnectivity_v1::model::Group;
9730    /// use wkt::Timestamp;
9731    /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9732    /// ```
9733    pub fn set_update_time<T>(mut self, v: T) -> Self
9734    where
9735        T: std::convert::Into<wkt::Timestamp>,
9736    {
9737        self.update_time = std::option::Option::Some(v.into());
9738        self
9739    }
9740
9741    /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9742    ///
9743    /// # Example
9744    /// ```ignore,no_run
9745    /// # use google_cloud_networkconnectivity_v1::model::Group;
9746    /// use wkt::Timestamp;
9747    /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9748    /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9749    /// ```
9750    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9751    where
9752        T: std::convert::Into<wkt::Timestamp>,
9753    {
9754        self.update_time = v.map(|x| x.into());
9755        self
9756    }
9757
9758    /// Sets the value of [labels][crate::model::Group::labels].
9759    ///
9760    /// # Example
9761    /// ```ignore,no_run
9762    /// # use google_cloud_networkconnectivity_v1::model::Group;
9763    /// let x = Group::new().set_labels([
9764    ///     ("key0", "abc"),
9765    ///     ("key1", "xyz"),
9766    /// ]);
9767    /// ```
9768    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9769    where
9770        T: std::iter::IntoIterator<Item = (K, V)>,
9771        K: std::convert::Into<std::string::String>,
9772        V: std::convert::Into<std::string::String>,
9773    {
9774        use std::iter::Iterator;
9775        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9776        self
9777    }
9778
9779    /// Sets the value of [description][crate::model::Group::description].
9780    ///
9781    /// # Example
9782    /// ```ignore,no_run
9783    /// # use google_cloud_networkconnectivity_v1::model::Group;
9784    /// let x = Group::new().set_description("example");
9785    /// ```
9786    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9787        self.description = v.into();
9788        self
9789    }
9790
9791    /// Sets the value of [uid][crate::model::Group::uid].
9792    ///
9793    /// # Example
9794    /// ```ignore,no_run
9795    /// # use google_cloud_networkconnectivity_v1::model::Group;
9796    /// let x = Group::new().set_uid("example");
9797    /// ```
9798    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9799        self.uid = v.into();
9800        self
9801    }
9802
9803    /// Sets the value of [state][crate::model::Group::state].
9804    ///
9805    /// # Example
9806    /// ```ignore,no_run
9807    /// # use google_cloud_networkconnectivity_v1::model::Group;
9808    /// use google_cloud_networkconnectivity_v1::model::State;
9809    /// let x0 = Group::new().set_state(State::Creating);
9810    /// let x1 = Group::new().set_state(State::Active);
9811    /// let x2 = Group::new().set_state(State::Deleting);
9812    /// ```
9813    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9814        self.state = v.into();
9815        self
9816    }
9817
9818    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9819    ///
9820    /// # Example
9821    /// ```ignore,no_run
9822    /// # use google_cloud_networkconnectivity_v1::model::Group;
9823    /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9824    /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9825    /// ```
9826    pub fn set_auto_accept<T>(mut self, v: T) -> Self
9827    where
9828        T: std::convert::Into<crate::model::AutoAccept>,
9829    {
9830        self.auto_accept = std::option::Option::Some(v.into());
9831        self
9832    }
9833
9834    /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9835    ///
9836    /// # Example
9837    /// ```ignore,no_run
9838    /// # use google_cloud_networkconnectivity_v1::model::Group;
9839    /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9840    /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9841    /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9842    /// ```
9843    pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9844    where
9845        T: std::convert::Into<crate::model::AutoAccept>,
9846    {
9847        self.auto_accept = v.map(|x| x.into());
9848        self
9849    }
9850
9851    /// Sets the value of [route_table][crate::model::Group::route_table].
9852    ///
9853    /// # Example
9854    /// ```ignore,no_run
9855    /// # use google_cloud_networkconnectivity_v1::model::Group;
9856    /// let x = Group::new().set_route_table("example");
9857    /// ```
9858    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9859        self.route_table = v.into();
9860        self
9861    }
9862}
9863
9864impl wkt::message::Message for Group {
9865    fn typename() -> &'static str {
9866        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9867    }
9868}
9869
9870/// The auto-accept setting for a group controls whether
9871/// proposed spokes are automatically attached to the hub. If auto-accept is
9872/// enabled, the spoke immediately is attached to the hub and becomes part of the
9873/// group. In this case, the new spoke is in the ACTIVE state.
9874/// If auto-accept is disabled, the spoke goes to the INACTIVE
9875/// state, and it must be reviewed and accepted by a hub
9876/// administrator.
9877#[derive(Clone, Default, PartialEq)]
9878#[non_exhaustive]
9879pub struct AutoAccept {
9880    /// Optional. A list of project ids or project numbers for which you want
9881    /// to enable auto-accept. The auto-accept setting is applied to
9882    /// spokes being created or updated in these projects.
9883    pub auto_accept_projects: std::vec::Vec<std::string::String>,
9884
9885    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9886}
9887
9888impl AutoAccept {
9889    /// Creates a new default instance.
9890    pub fn new() -> Self {
9891        std::default::Default::default()
9892    }
9893
9894    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9895    ///
9896    /// # Example
9897    /// ```ignore,no_run
9898    /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9899    /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
9900    /// ```
9901    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
9902    where
9903        T: std::iter::IntoIterator<Item = V>,
9904        V: std::convert::Into<std::string::String>,
9905    {
9906        use std::iter::Iterator;
9907        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
9908        self
9909    }
9910}
9911
9912impl wkt::message::Message for AutoAccept {
9913    fn typename() -> &'static str {
9914        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
9915    }
9916}
9917
9918/// Request for
9919/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9920/// method.
9921///
9922/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9923#[derive(Clone, Default, PartialEq)]
9924#[non_exhaustive]
9925pub struct ListHubsRequest {
9926    /// Required. The parent resource's name.
9927    pub parent: std::string::String,
9928
9929    /// The maximum number of results per page to return.
9930    pub page_size: i32,
9931
9932    /// The page token.
9933    pub page_token: std::string::String,
9934
9935    /// An expression that filters the list of results.
9936    pub filter: std::string::String,
9937
9938    /// Sort the results by a certain order.
9939    pub order_by: std::string::String,
9940
9941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9942}
9943
9944impl ListHubsRequest {
9945    /// Creates a new default instance.
9946    pub fn new() -> Self {
9947        std::default::Default::default()
9948    }
9949
9950    /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
9951    ///
9952    /// # Example
9953    /// ```ignore,no_run
9954    /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9955    /// let x = ListHubsRequest::new().set_parent("example");
9956    /// ```
9957    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9958        self.parent = v.into();
9959        self
9960    }
9961
9962    /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
9963    ///
9964    /// # Example
9965    /// ```ignore,no_run
9966    /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9967    /// let x = ListHubsRequest::new().set_page_size(42);
9968    /// ```
9969    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9970        self.page_size = v.into();
9971        self
9972    }
9973
9974    /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
9975    ///
9976    /// # Example
9977    /// ```ignore,no_run
9978    /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9979    /// let x = ListHubsRequest::new().set_page_token("example");
9980    /// ```
9981    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9982        self.page_token = v.into();
9983        self
9984    }
9985
9986    /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
9987    ///
9988    /// # Example
9989    /// ```ignore,no_run
9990    /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9991    /// let x = ListHubsRequest::new().set_filter("example");
9992    /// ```
9993    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9994        self.filter = v.into();
9995        self
9996    }
9997
9998    /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
9999    ///
10000    /// # Example
10001    /// ```ignore,no_run
10002    /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10003    /// let x = ListHubsRequest::new().set_order_by("example");
10004    /// ```
10005    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10006        self.order_by = v.into();
10007        self
10008    }
10009}
10010
10011impl wkt::message::Message for ListHubsRequest {
10012    fn typename() -> &'static str {
10013        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
10014    }
10015}
10016
10017/// Response for
10018/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
10019/// method.
10020///
10021/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
10022#[derive(Clone, Default, PartialEq)]
10023#[non_exhaustive]
10024pub struct ListHubsResponse {
10025    /// The requested hubs.
10026    pub hubs: std::vec::Vec<crate::model::Hub>,
10027
10028    /// The token for the next page of the response. To see more results,
10029    /// use this value as the page_token for your next request. If this value
10030    /// is empty, there are no more results.
10031    pub next_page_token: std::string::String,
10032
10033    /// Locations that could not be reached.
10034    pub unreachable: std::vec::Vec<std::string::String>,
10035
10036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10037}
10038
10039impl ListHubsResponse {
10040    /// Creates a new default instance.
10041    pub fn new() -> Self {
10042        std::default::Default::default()
10043    }
10044
10045    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
10046    ///
10047    /// # Example
10048    /// ```ignore,no_run
10049    /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10050    /// use google_cloud_networkconnectivity_v1::model::Hub;
10051    /// let x = ListHubsResponse::new()
10052    ///     .set_hubs([
10053    ///         Hub::default()/* use setters */,
10054    ///         Hub::default()/* use (different) setters */,
10055    ///     ]);
10056    /// ```
10057    pub fn set_hubs<T, V>(mut self, v: T) -> Self
10058    where
10059        T: std::iter::IntoIterator<Item = V>,
10060        V: std::convert::Into<crate::model::Hub>,
10061    {
10062        use std::iter::Iterator;
10063        self.hubs = v.into_iter().map(|i| i.into()).collect();
10064        self
10065    }
10066
10067    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
10068    ///
10069    /// # Example
10070    /// ```ignore,no_run
10071    /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10072    /// let x = ListHubsResponse::new().set_next_page_token("example");
10073    /// ```
10074    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10075        self.next_page_token = v.into();
10076        self
10077    }
10078
10079    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10080    ///
10081    /// # Example
10082    /// ```ignore,no_run
10083    /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10084    /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10085    /// ```
10086    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10087    where
10088        T: std::iter::IntoIterator<Item = V>,
10089        V: std::convert::Into<std::string::String>,
10090    {
10091        use std::iter::Iterator;
10092        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10093        self
10094    }
10095}
10096
10097impl wkt::message::Message for ListHubsResponse {
10098    fn typename() -> &'static str {
10099        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10100    }
10101}
10102
10103#[doc(hidden)]
10104impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
10105    type PageItem = crate::model::Hub;
10106
10107    fn items(self) -> std::vec::Vec<Self::PageItem> {
10108        self.hubs
10109    }
10110
10111    fn next_page_token(&self) -> std::string::String {
10112        use std::clone::Clone;
10113        self.next_page_token.clone()
10114    }
10115}
10116
10117/// Request for
10118/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10119/// method.
10120///
10121/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10122#[derive(Clone, Default, PartialEq)]
10123#[non_exhaustive]
10124pub struct GetHubRequest {
10125    /// Required. The name of the hub resource to get.
10126    pub name: std::string::String,
10127
10128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10129}
10130
10131impl GetHubRequest {
10132    /// Creates a new default instance.
10133    pub fn new() -> Self {
10134        std::default::Default::default()
10135    }
10136
10137    /// Sets the value of [name][crate::model::GetHubRequest::name].
10138    ///
10139    /// # Example
10140    /// ```ignore,no_run
10141    /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10142    /// let x = GetHubRequest::new().set_name("example");
10143    /// ```
10144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10145        self.name = v.into();
10146        self
10147    }
10148}
10149
10150impl wkt::message::Message for GetHubRequest {
10151    fn typename() -> &'static str {
10152        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10153    }
10154}
10155
10156/// Request for
10157/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10158/// method.
10159///
10160/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10161#[derive(Clone, Default, PartialEq)]
10162#[non_exhaustive]
10163pub struct CreateHubRequest {
10164    /// Required. The parent resource.
10165    pub parent: std::string::String,
10166
10167    /// Required. A unique identifier for the hub.
10168    pub hub_id: std::string::String,
10169
10170    /// Required. The initial values for a new hub.
10171    pub hub: std::option::Option<crate::model::Hub>,
10172
10173    /// Optional. A request ID to identify requests. Specify a unique request ID so
10174    /// that if you must retry your request, the server knows to ignore the request
10175    /// if it has already been completed. The server guarantees that a request
10176    /// doesn't result in creation of duplicate commitments for at least 60
10177    /// minutes.
10178    ///
10179    /// For example, consider a situation where you make an initial request and
10180    /// the request times out. If you make the request again with the same request
10181    /// ID, the server can check to see whether the original operation
10182    /// was received. If it was, the server ignores the second request. This
10183    /// behavior prevents clients from mistakenly creating duplicate commitments.
10184    ///
10185    /// The request ID must be a valid UUID, with the exception that zero UUID is
10186    /// not supported (00000000-0000-0000-0000-000000000000).
10187    pub request_id: std::string::String,
10188
10189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10190}
10191
10192impl CreateHubRequest {
10193    /// Creates a new default instance.
10194    pub fn new() -> Self {
10195        std::default::Default::default()
10196    }
10197
10198    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10199    ///
10200    /// # Example
10201    /// ```ignore,no_run
10202    /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10203    /// let x = CreateHubRequest::new().set_parent("example");
10204    /// ```
10205    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10206        self.parent = v.into();
10207        self
10208    }
10209
10210    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10211    ///
10212    /// # Example
10213    /// ```ignore,no_run
10214    /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10215    /// let x = CreateHubRequest::new().set_hub_id("example");
10216    /// ```
10217    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10218        self.hub_id = v.into();
10219        self
10220    }
10221
10222    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10223    ///
10224    /// # Example
10225    /// ```ignore,no_run
10226    /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10227    /// use google_cloud_networkconnectivity_v1::model::Hub;
10228    /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10229    /// ```
10230    pub fn set_hub<T>(mut self, v: T) -> Self
10231    where
10232        T: std::convert::Into<crate::model::Hub>,
10233    {
10234        self.hub = std::option::Option::Some(v.into());
10235        self
10236    }
10237
10238    /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10239    ///
10240    /// # Example
10241    /// ```ignore,no_run
10242    /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10243    /// use google_cloud_networkconnectivity_v1::model::Hub;
10244    /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10245    /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10246    /// ```
10247    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10248    where
10249        T: std::convert::Into<crate::model::Hub>,
10250    {
10251        self.hub = v.map(|x| x.into());
10252        self
10253    }
10254
10255    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10256    ///
10257    /// # Example
10258    /// ```ignore,no_run
10259    /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10260    /// let x = CreateHubRequest::new().set_request_id("example");
10261    /// ```
10262    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10263        self.request_id = v.into();
10264        self
10265    }
10266}
10267
10268impl wkt::message::Message for CreateHubRequest {
10269    fn typename() -> &'static str {
10270        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10271    }
10272}
10273
10274/// Request for
10275/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10276/// method.
10277///
10278/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10279#[derive(Clone, Default, PartialEq)]
10280#[non_exhaustive]
10281pub struct UpdateHubRequest {
10282    /// Optional. In the case of an update to an existing hub, field mask is used
10283    /// to specify the fields to be overwritten. The fields specified in the
10284    /// update_mask are relative to the resource, not the full request. A field is
10285    /// overwritten if it is in the mask. If the user does not provide a mask, then
10286    /// all fields are overwritten.
10287    pub update_mask: std::option::Option<wkt::FieldMask>,
10288
10289    /// Required. The state that the hub should be in after the update.
10290    pub hub: std::option::Option<crate::model::Hub>,
10291
10292    /// Optional. A request ID to identify requests. Specify a unique request ID so
10293    /// that if you must retry your request, the server knows to ignore the request
10294    /// if it has already been completed. The server guarantees that a request
10295    /// doesn't result in creation of duplicate commitments for at least 60
10296    /// minutes.
10297    ///
10298    /// For example, consider a situation where you make an initial request and
10299    /// the request times out. If you make the request again with the same request
10300    /// ID, the server can check to see whether the original operation
10301    /// was received. If it was, the server ignores the second request. This
10302    /// behavior prevents clients from mistakenly creating duplicate commitments.
10303    ///
10304    /// The request ID must be a valid UUID, with the exception that zero UUID is
10305    /// not supported (00000000-0000-0000-0000-000000000000).
10306    pub request_id: std::string::String,
10307
10308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10309}
10310
10311impl UpdateHubRequest {
10312    /// Creates a new default instance.
10313    pub fn new() -> Self {
10314        std::default::Default::default()
10315    }
10316
10317    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10318    ///
10319    /// # Example
10320    /// ```ignore,no_run
10321    /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10322    /// use wkt::FieldMask;
10323    /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10324    /// ```
10325    pub fn set_update_mask<T>(mut self, v: T) -> Self
10326    where
10327        T: std::convert::Into<wkt::FieldMask>,
10328    {
10329        self.update_mask = std::option::Option::Some(v.into());
10330        self
10331    }
10332
10333    /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10334    ///
10335    /// # Example
10336    /// ```ignore,no_run
10337    /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10338    /// use wkt::FieldMask;
10339    /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10340    /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10341    /// ```
10342    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10343    where
10344        T: std::convert::Into<wkt::FieldMask>,
10345    {
10346        self.update_mask = v.map(|x| x.into());
10347        self
10348    }
10349
10350    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10351    ///
10352    /// # Example
10353    /// ```ignore,no_run
10354    /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10355    /// use google_cloud_networkconnectivity_v1::model::Hub;
10356    /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10357    /// ```
10358    pub fn set_hub<T>(mut self, v: T) -> Self
10359    where
10360        T: std::convert::Into<crate::model::Hub>,
10361    {
10362        self.hub = std::option::Option::Some(v.into());
10363        self
10364    }
10365
10366    /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10367    ///
10368    /// # Example
10369    /// ```ignore,no_run
10370    /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10371    /// use google_cloud_networkconnectivity_v1::model::Hub;
10372    /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10373    /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10374    /// ```
10375    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10376    where
10377        T: std::convert::Into<crate::model::Hub>,
10378    {
10379        self.hub = v.map(|x| x.into());
10380        self
10381    }
10382
10383    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10384    ///
10385    /// # Example
10386    /// ```ignore,no_run
10387    /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10388    /// let x = UpdateHubRequest::new().set_request_id("example");
10389    /// ```
10390    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10391        self.request_id = v.into();
10392        self
10393    }
10394}
10395
10396impl wkt::message::Message for UpdateHubRequest {
10397    fn typename() -> &'static str {
10398        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10399    }
10400}
10401
10402/// The request for
10403/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10404///
10405/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10406#[derive(Clone, Default, PartialEq)]
10407#[non_exhaustive]
10408pub struct DeleteHubRequest {
10409    /// Required. The name of the hub to delete.
10410    pub name: std::string::String,
10411
10412    /// Optional. A request ID to identify requests. Specify a unique request ID so
10413    /// that if you must retry your request, the server knows to ignore the request
10414    /// if it has already been completed. The server guarantees that a request
10415    /// doesn't result in creation of duplicate commitments for at least 60
10416    /// minutes.
10417    ///
10418    /// For example, consider a situation where you make an initial request and
10419    /// the request times out. If you make the request again with the same request
10420    /// ID, the server can check to see whether the original operation
10421    /// was received. If it was, the server ignores the second request. This
10422    /// behavior prevents clients from mistakenly creating duplicate commitments.
10423    ///
10424    /// The request ID must be a valid UUID, with the exception that zero UUID is
10425    /// not supported (00000000-0000-0000-0000-000000000000).
10426    pub request_id: std::string::String,
10427
10428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10429}
10430
10431impl DeleteHubRequest {
10432    /// Creates a new default instance.
10433    pub fn new() -> Self {
10434        std::default::Default::default()
10435    }
10436
10437    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10438    ///
10439    /// # Example
10440    /// ```ignore,no_run
10441    /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10442    /// let x = DeleteHubRequest::new().set_name("example");
10443    /// ```
10444    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10445        self.name = v.into();
10446        self
10447    }
10448
10449    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10450    ///
10451    /// # Example
10452    /// ```ignore,no_run
10453    /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10454    /// let x = DeleteHubRequest::new().set_request_id("example");
10455    /// ```
10456    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10457        self.request_id = v.into();
10458        self
10459    }
10460}
10461
10462impl wkt::message::Message for DeleteHubRequest {
10463    fn typename() -> &'static str {
10464        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10465    }
10466}
10467
10468/// The request for
10469/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10470///
10471/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10472#[derive(Clone, Default, PartialEq)]
10473#[non_exhaustive]
10474pub struct ListHubSpokesRequest {
10475    /// Required. The name of the hub.
10476    pub name: std::string::String,
10477
10478    /// A list of locations.
10479    /// Specify one of the following: `[global]`, a single region (for
10480    /// example, `[us-central1]`), or a combination of
10481    /// values (for example, `[global, us-central1, us-west1]`).
10482    /// If the spoke_locations field is populated, the list of results
10483    /// includes only spokes in the specified location.
10484    /// If the spoke_locations field is not populated, the list of results
10485    /// includes spokes in all locations.
10486    pub spoke_locations: std::vec::Vec<std::string::String>,
10487
10488    /// The maximum number of results to return per page.
10489    pub page_size: i32,
10490
10491    /// The page token.
10492    pub page_token: std::string::String,
10493
10494    /// An expression that filters the list of results.
10495    pub filter: std::string::String,
10496
10497    /// Sort the results by name or create_time.
10498    pub order_by: std::string::String,
10499
10500    /// The view of the spoke to return.
10501    /// The view that you use determines which spoke fields are included in the
10502    /// response.
10503    pub view: crate::model::list_hub_spokes_request::SpokeView,
10504
10505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10506}
10507
10508impl ListHubSpokesRequest {
10509    /// Creates a new default instance.
10510    pub fn new() -> Self {
10511        std::default::Default::default()
10512    }
10513
10514    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10515    ///
10516    /// # Example
10517    /// ```ignore,no_run
10518    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10519    /// let x = ListHubSpokesRequest::new().set_name("example");
10520    /// ```
10521    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10522        self.name = v.into();
10523        self
10524    }
10525
10526    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10527    ///
10528    /// # Example
10529    /// ```ignore,no_run
10530    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10531    /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10532    /// ```
10533    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10534    where
10535        T: std::iter::IntoIterator<Item = V>,
10536        V: std::convert::Into<std::string::String>,
10537    {
10538        use std::iter::Iterator;
10539        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10540        self
10541    }
10542
10543    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10544    ///
10545    /// # Example
10546    /// ```ignore,no_run
10547    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10548    /// let x = ListHubSpokesRequest::new().set_page_size(42);
10549    /// ```
10550    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10551        self.page_size = v.into();
10552        self
10553    }
10554
10555    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10556    ///
10557    /// # Example
10558    /// ```ignore,no_run
10559    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10560    /// let x = ListHubSpokesRequest::new().set_page_token("example");
10561    /// ```
10562    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10563        self.page_token = v.into();
10564        self
10565    }
10566
10567    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10568    ///
10569    /// # Example
10570    /// ```ignore,no_run
10571    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10572    /// let x = ListHubSpokesRequest::new().set_filter("example");
10573    /// ```
10574    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10575        self.filter = v.into();
10576        self
10577    }
10578
10579    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10580    ///
10581    /// # Example
10582    /// ```ignore,no_run
10583    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10584    /// let x = ListHubSpokesRequest::new().set_order_by("example");
10585    /// ```
10586    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10587        self.order_by = v.into();
10588        self
10589    }
10590
10591    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10592    ///
10593    /// # Example
10594    /// ```ignore,no_run
10595    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10596    /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10597    /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10598    /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10599    /// ```
10600    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10601        mut self,
10602        v: T,
10603    ) -> Self {
10604        self.view = v.into();
10605        self
10606    }
10607}
10608
10609impl wkt::message::Message for ListHubSpokesRequest {
10610    fn typename() -> &'static str {
10611        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10612    }
10613}
10614
10615/// Defines additional types related to [ListHubSpokesRequest].
10616pub mod list_hub_spokes_request {
10617    #[allow(unused_imports)]
10618    use super::*;
10619
10620    /// Enum that controls which spoke fields are included in the response.
10621    ///
10622    /// # Working with unknown values
10623    ///
10624    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10625    /// additional enum variants at any time. Adding new variants is not considered
10626    /// a breaking change. Applications should write their code in anticipation of:
10627    ///
10628    /// - New values appearing in future releases of the client library, **and**
10629    /// - New values received dynamically, without application changes.
10630    ///
10631    /// Please consult the [Working with enums] section in the user guide for some
10632    /// guidelines.
10633    ///
10634    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10635    #[derive(Clone, Debug, PartialEq)]
10636    #[non_exhaustive]
10637    pub enum SpokeView {
10638        /// The spoke view is unspecified. When the spoke view is unspecified, the
10639        /// API returns the same fields as the `BASIC` view.
10640        Unspecified,
10641        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10642        /// and `spoke_type`. This is the default value.
10643        Basic,
10644        /// Includes all spoke fields except `labels`.
10645        /// You can use the `DETAILED` view only when you set the `spoke_locations`
10646        /// field to `[global]`.
10647        Detailed,
10648        /// If set, the enum was initialized with an unknown value.
10649        ///
10650        /// Applications can examine the value using [SpokeView::value] or
10651        /// [SpokeView::name].
10652        UnknownValue(spoke_view::UnknownValue),
10653    }
10654
10655    #[doc(hidden)]
10656    pub mod spoke_view {
10657        #[allow(unused_imports)]
10658        use super::*;
10659        #[derive(Clone, Debug, PartialEq)]
10660        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10661    }
10662
10663    impl SpokeView {
10664        /// Gets the enum value.
10665        ///
10666        /// Returns `None` if the enum contains an unknown value deserialized from
10667        /// the string representation of enums.
10668        pub fn value(&self) -> std::option::Option<i32> {
10669            match self {
10670                Self::Unspecified => std::option::Option::Some(0),
10671                Self::Basic => std::option::Option::Some(1),
10672                Self::Detailed => std::option::Option::Some(2),
10673                Self::UnknownValue(u) => u.0.value(),
10674            }
10675        }
10676
10677        /// Gets the enum value as a string.
10678        ///
10679        /// Returns `None` if the enum contains an unknown value deserialized from
10680        /// the integer representation of enums.
10681        pub fn name(&self) -> std::option::Option<&str> {
10682            match self {
10683                Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10684                Self::Basic => std::option::Option::Some("BASIC"),
10685                Self::Detailed => std::option::Option::Some("DETAILED"),
10686                Self::UnknownValue(u) => u.0.name(),
10687            }
10688        }
10689    }
10690
10691    impl std::default::Default for SpokeView {
10692        fn default() -> Self {
10693            use std::convert::From;
10694            Self::from(0)
10695        }
10696    }
10697
10698    impl std::fmt::Display for SpokeView {
10699        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10700            wkt::internal::display_enum(f, self.name(), self.value())
10701        }
10702    }
10703
10704    impl std::convert::From<i32> for SpokeView {
10705        fn from(value: i32) -> Self {
10706            match value {
10707                0 => Self::Unspecified,
10708                1 => Self::Basic,
10709                2 => Self::Detailed,
10710                _ => Self::UnknownValue(spoke_view::UnknownValue(
10711                    wkt::internal::UnknownEnumValue::Integer(value),
10712                )),
10713            }
10714        }
10715    }
10716
10717    impl std::convert::From<&str> for SpokeView {
10718        fn from(value: &str) -> Self {
10719            use std::string::ToString;
10720            match value {
10721                "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10722                "BASIC" => Self::Basic,
10723                "DETAILED" => Self::Detailed,
10724                _ => Self::UnknownValue(spoke_view::UnknownValue(
10725                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10726                )),
10727            }
10728        }
10729    }
10730
10731    impl serde::ser::Serialize for SpokeView {
10732        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10733        where
10734            S: serde::Serializer,
10735        {
10736            match self {
10737                Self::Unspecified => serializer.serialize_i32(0),
10738                Self::Basic => serializer.serialize_i32(1),
10739                Self::Detailed => serializer.serialize_i32(2),
10740                Self::UnknownValue(u) => u.0.serialize(serializer),
10741            }
10742        }
10743    }
10744
10745    impl<'de> serde::de::Deserialize<'de> for SpokeView {
10746        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10747        where
10748            D: serde::Deserializer<'de>,
10749        {
10750            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10751                ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10752            ))
10753        }
10754    }
10755}
10756
10757/// The response for
10758/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10759///
10760/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10761#[derive(Clone, Default, PartialEq)]
10762#[non_exhaustive]
10763pub struct ListHubSpokesResponse {
10764    /// The requested spokes.
10765    /// The spoke fields can be partially populated based on the `view` field in
10766    /// the request message.
10767    pub spokes: std::vec::Vec<crate::model::Spoke>,
10768
10769    /// The token for the next page of the response. To see more results,
10770    /// use this value as the page_token for your next request. If this value
10771    /// is empty, there are no more results.
10772    pub next_page_token: std::string::String,
10773
10774    /// Locations that could not be reached.
10775    pub unreachable: std::vec::Vec<std::string::String>,
10776
10777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10778}
10779
10780impl ListHubSpokesResponse {
10781    /// Creates a new default instance.
10782    pub fn new() -> Self {
10783        std::default::Default::default()
10784    }
10785
10786    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10787    ///
10788    /// # Example
10789    /// ```ignore,no_run
10790    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10791    /// use google_cloud_networkconnectivity_v1::model::Spoke;
10792    /// let x = ListHubSpokesResponse::new()
10793    ///     .set_spokes([
10794    ///         Spoke::default()/* use setters */,
10795    ///         Spoke::default()/* use (different) setters */,
10796    ///     ]);
10797    /// ```
10798    pub fn set_spokes<T, V>(mut self, v: T) -> Self
10799    where
10800        T: std::iter::IntoIterator<Item = V>,
10801        V: std::convert::Into<crate::model::Spoke>,
10802    {
10803        use std::iter::Iterator;
10804        self.spokes = v.into_iter().map(|i| i.into()).collect();
10805        self
10806    }
10807
10808    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10809    ///
10810    /// # Example
10811    /// ```ignore,no_run
10812    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10813    /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10814    /// ```
10815    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10816        self.next_page_token = v.into();
10817        self
10818    }
10819
10820    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10821    ///
10822    /// # Example
10823    /// ```ignore,no_run
10824    /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10825    /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10826    /// ```
10827    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10828    where
10829        T: std::iter::IntoIterator<Item = V>,
10830        V: std::convert::Into<std::string::String>,
10831    {
10832        use std::iter::Iterator;
10833        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10834        self
10835    }
10836}
10837
10838impl wkt::message::Message for ListHubSpokesResponse {
10839    fn typename() -> &'static str {
10840        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10841    }
10842}
10843
10844#[doc(hidden)]
10845impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10846    type PageItem = crate::model::Spoke;
10847
10848    fn items(self) -> std::vec::Vec<Self::PageItem> {
10849        self.spokes
10850    }
10851
10852    fn next_page_token(&self) -> std::string::String {
10853        use std::clone::Clone;
10854        self.next_page_token.clone()
10855    }
10856}
10857
10858/// The request for
10859/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10860///
10861/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10862#[derive(Clone, Default, PartialEq)]
10863#[non_exhaustive]
10864pub struct QueryHubStatusRequest {
10865    /// Required. The name of the hub.
10866    pub name: std::string::String,
10867
10868    /// Optional. The maximum number of results to return per page.
10869    pub page_size: i32,
10870
10871    /// Optional. The page token.
10872    pub page_token: std::string::String,
10873
10874    /// Optional. An expression that filters the list of results.
10875    /// The filter can be used to filter the results by the following fields:
10876    ///
10877    /// * `psc_propagation_status.source_spoke`
10878    /// * `psc_propagation_status.source_group`
10879    /// * `psc_propagation_status.source_forwarding_rule`
10880    /// * `psc_propagation_status.target_spoke`
10881    /// * `psc_propagation_status.target_group`
10882    /// * `psc_propagation_status.code`
10883    /// * `psc_propagation_status.message`
10884    pub filter: std::string::String,
10885
10886    /// Optional. Sort the results in ascending order by the specified fields.
10887    /// A comma-separated list of any of these fields:
10888    ///
10889    /// * `psc_propagation_status.source_spoke`
10890    /// * `psc_propagation_status.source_group`
10891    /// * `psc_propagation_status.source_forwarding_rule`
10892    /// * `psc_propagation_status.target_spoke`
10893    /// * `psc_propagation_status.target_group`
10894    /// * `psc_propagation_status.code`
10895    ///   If `group_by` is set, the value of the `order_by` field must be the
10896    ///   same as or a subset of the `group_by` field.
10897    pub order_by: std::string::String,
10898
10899    /// Optional. Aggregate the results by the specified fields.
10900    /// A comma-separated list of any of these fields:
10901    ///
10902    /// * `psc_propagation_status.source_spoke`
10903    /// * `psc_propagation_status.source_group`
10904    /// * `psc_propagation_status.source_forwarding_rule`
10905    /// * `psc_propagation_status.target_spoke`
10906    /// * `psc_propagation_status.target_group`
10907    /// * `psc_propagation_status.code`
10908    pub group_by: std::string::String,
10909
10910    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10911}
10912
10913impl QueryHubStatusRequest {
10914    /// Creates a new default instance.
10915    pub fn new() -> Self {
10916        std::default::Default::default()
10917    }
10918
10919    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
10920    ///
10921    /// # Example
10922    /// ```ignore,no_run
10923    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10924    /// let x = QueryHubStatusRequest::new().set_name("example");
10925    /// ```
10926    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10927        self.name = v.into();
10928        self
10929    }
10930
10931    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
10932    ///
10933    /// # Example
10934    /// ```ignore,no_run
10935    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10936    /// let x = QueryHubStatusRequest::new().set_page_size(42);
10937    /// ```
10938    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10939        self.page_size = v.into();
10940        self
10941    }
10942
10943    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
10944    ///
10945    /// # Example
10946    /// ```ignore,no_run
10947    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10948    /// let x = QueryHubStatusRequest::new().set_page_token("example");
10949    /// ```
10950    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10951        self.page_token = v.into();
10952        self
10953    }
10954
10955    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
10956    ///
10957    /// # Example
10958    /// ```ignore,no_run
10959    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10960    /// let x = QueryHubStatusRequest::new().set_filter("example");
10961    /// ```
10962    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10963        self.filter = v.into();
10964        self
10965    }
10966
10967    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
10968    ///
10969    /// # Example
10970    /// ```ignore,no_run
10971    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10972    /// let x = QueryHubStatusRequest::new().set_order_by("example");
10973    /// ```
10974    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10975        self.order_by = v.into();
10976        self
10977    }
10978
10979    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
10980    ///
10981    /// # Example
10982    /// ```ignore,no_run
10983    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10984    /// let x = QueryHubStatusRequest::new().set_group_by("example");
10985    /// ```
10986    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10987        self.group_by = v.into();
10988        self
10989    }
10990}
10991
10992impl wkt::message::Message for QueryHubStatusRequest {
10993    fn typename() -> &'static str {
10994        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
10995    }
10996}
10997
10998/// The response for
10999/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
11000///
11001/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
11002#[derive(Clone, Default, PartialEq)]
11003#[non_exhaustive]
11004pub struct QueryHubStatusResponse {
11005    /// The list of hub status.
11006    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
11007
11008    /// The token for the next page of the response. To see more results,
11009    /// use this value as the page_token for your next request. If this value
11010    /// is empty, there are no more results.
11011    pub next_page_token: std::string::String,
11012
11013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11014}
11015
11016impl QueryHubStatusResponse {
11017    /// Creates a new default instance.
11018    pub fn new() -> Self {
11019        std::default::Default::default()
11020    }
11021
11022    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
11023    ///
11024    /// # Example
11025    /// ```ignore,no_run
11026    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11027    /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11028    /// let x = QueryHubStatusResponse::new()
11029    ///     .set_hub_status_entries([
11030    ///         HubStatusEntry::default()/* use setters */,
11031    ///         HubStatusEntry::default()/* use (different) setters */,
11032    ///     ]);
11033    /// ```
11034    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
11035    where
11036        T: std::iter::IntoIterator<Item = V>,
11037        V: std::convert::Into<crate::model::HubStatusEntry>,
11038    {
11039        use std::iter::Iterator;
11040        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
11041        self
11042    }
11043
11044    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
11045    ///
11046    /// # Example
11047    /// ```ignore,no_run
11048    /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11049    /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
11050    /// ```
11051    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11052        self.next_page_token = v.into();
11053        self
11054    }
11055}
11056
11057impl wkt::message::Message for QueryHubStatusResponse {
11058    fn typename() -> &'static str {
11059        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
11060    }
11061}
11062
11063#[doc(hidden)]
11064impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
11065    type PageItem = crate::model::HubStatusEntry;
11066
11067    fn items(self) -> std::vec::Vec<Self::PageItem> {
11068        self.hub_status_entries
11069    }
11070
11071    fn next_page_token(&self) -> std::string::String {
11072        use std::clone::Clone;
11073        self.next_page_token.clone()
11074    }
11075}
11076
11077/// A hub status entry represents the status of a set of propagated Private
11078/// Service Connect connections grouped by certain fields.
11079#[derive(Clone, Default, PartialEq)]
11080#[non_exhaustive]
11081pub struct HubStatusEntry {
11082    /// The number of propagated Private Service Connect connections with this
11083    /// status. If the `group_by` field was not set in the request message, the
11084    /// value of this field is 1.
11085    pub count: i32,
11086
11087    /// The fields that this entry is grouped by. This has the same value as the
11088    /// `group_by` field in the request message.
11089    pub group_by: std::string::String,
11090
11091    /// The Private Service Connect propagation status.
11092    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11093
11094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11095}
11096
11097impl HubStatusEntry {
11098    /// Creates a new default instance.
11099    pub fn new() -> Self {
11100        std::default::Default::default()
11101    }
11102
11103    /// Sets the value of [count][crate::model::HubStatusEntry::count].
11104    ///
11105    /// # Example
11106    /// ```ignore,no_run
11107    /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11108    /// let x = HubStatusEntry::new().set_count(42);
11109    /// ```
11110    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11111        self.count = v.into();
11112        self
11113    }
11114
11115    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11116    ///
11117    /// # Example
11118    /// ```ignore,no_run
11119    /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11120    /// let x = HubStatusEntry::new().set_group_by("example");
11121    /// ```
11122    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11123        self.group_by = v.into();
11124        self
11125    }
11126
11127    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11128    ///
11129    /// # Example
11130    /// ```ignore,no_run
11131    /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11132    /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11133    /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11134    /// ```
11135    pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11136    where
11137        T: std::convert::Into<crate::model::PscPropagationStatus>,
11138    {
11139        self.psc_propagation_status = std::option::Option::Some(v.into());
11140        self
11141    }
11142
11143    /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11144    ///
11145    /// # Example
11146    /// ```ignore,no_run
11147    /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11148    /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11149    /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11150    /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11151    /// ```
11152    pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11153    where
11154        T: std::convert::Into<crate::model::PscPropagationStatus>,
11155    {
11156        self.psc_propagation_status = v.map(|x| x.into());
11157        self
11158    }
11159}
11160
11161impl wkt::message::Message for HubStatusEntry {
11162    fn typename() -> &'static str {
11163        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11164    }
11165}
11166
11167/// The status of one or more propagated Private Service Connect connections in a
11168/// hub.
11169#[derive(Clone, Default, PartialEq)]
11170#[non_exhaustive]
11171pub struct PscPropagationStatus {
11172    /// The name of the spoke that the source forwarding rule belongs to.
11173    pub source_spoke: std::string::String,
11174
11175    /// The name of the group that the source spoke belongs to.
11176    pub source_group: std::string::String,
11177
11178    /// The name of the forwarding rule exported to the hub.
11179    pub source_forwarding_rule: std::string::String,
11180
11181    /// The name of the spoke that the source forwarding rule propagates to.
11182    pub target_spoke: std::string::String,
11183
11184    /// The name of the group that the target spoke belongs to.
11185    pub target_group: std::string::String,
11186
11187    /// The propagation status.
11188    pub code: crate::model::psc_propagation_status::Code,
11189
11190    /// The human-readable summary of the Private Service Connect connection
11191    /// propagation status.
11192    pub message: std::string::String,
11193
11194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11195}
11196
11197impl PscPropagationStatus {
11198    /// Creates a new default instance.
11199    pub fn new() -> Self {
11200        std::default::Default::default()
11201    }
11202
11203    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11204    ///
11205    /// # Example
11206    /// ```ignore,no_run
11207    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11208    /// let x = PscPropagationStatus::new().set_source_spoke("example");
11209    /// ```
11210    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11211        self.source_spoke = v.into();
11212        self
11213    }
11214
11215    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11216    ///
11217    /// # Example
11218    /// ```ignore,no_run
11219    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11220    /// let x = PscPropagationStatus::new().set_source_group("example");
11221    /// ```
11222    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11223        self.source_group = v.into();
11224        self
11225    }
11226
11227    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11228    ///
11229    /// # Example
11230    /// ```ignore,no_run
11231    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11232    /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11233    /// ```
11234    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11235        mut self,
11236        v: T,
11237    ) -> Self {
11238        self.source_forwarding_rule = v.into();
11239        self
11240    }
11241
11242    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11243    ///
11244    /// # Example
11245    /// ```ignore,no_run
11246    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11247    /// let x = PscPropagationStatus::new().set_target_spoke("example");
11248    /// ```
11249    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11250        self.target_spoke = v.into();
11251        self
11252    }
11253
11254    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11255    ///
11256    /// # Example
11257    /// ```ignore,no_run
11258    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11259    /// let x = PscPropagationStatus::new().set_target_group("example");
11260    /// ```
11261    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11262        self.target_group = v.into();
11263        self
11264    }
11265
11266    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11267    ///
11268    /// # Example
11269    /// ```ignore,no_run
11270    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11271    /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11272    /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11273    /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11274    /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11275    /// ```
11276    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11277        mut self,
11278        v: T,
11279    ) -> Self {
11280        self.code = v.into();
11281        self
11282    }
11283
11284    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11285    ///
11286    /// # Example
11287    /// ```ignore,no_run
11288    /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11289    /// let x = PscPropagationStatus::new().set_message("example");
11290    /// ```
11291    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11292        self.message = v.into();
11293        self
11294    }
11295}
11296
11297impl wkt::message::Message for PscPropagationStatus {
11298    fn typename() -> &'static str {
11299        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11300    }
11301}
11302
11303/// Defines additional types related to [PscPropagationStatus].
11304pub mod psc_propagation_status {
11305    #[allow(unused_imports)]
11306    use super::*;
11307
11308    /// The Code enum represents the state of the Private Service Connect
11309    /// propagation.
11310    ///
11311    /// # Working with unknown values
11312    ///
11313    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11314    /// additional enum variants at any time. Adding new variants is not considered
11315    /// a breaking change. Applications should write their code in anticipation of:
11316    ///
11317    /// - New values appearing in future releases of the client library, **and**
11318    /// - New values received dynamically, without application changes.
11319    ///
11320    /// Please consult the [Working with enums] section in the user guide for some
11321    /// guidelines.
11322    ///
11323    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11324    #[derive(Clone, Debug, PartialEq)]
11325    #[non_exhaustive]
11326    pub enum Code {
11327        /// The code is unspecified.
11328        Unspecified,
11329        /// The propagated Private Service Connect connection is ready.
11330        Ready,
11331        /// The Private Service Connect connection is propagating. This is a
11332        /// transient state.
11333        Propagating,
11334        /// The Private Service Connect connection propagation failed because the VPC
11335        /// network or the project of the target spoke has exceeded the connection
11336        /// limit set by the producer.
11337        ErrorProducerPropagatedConnectionLimitExceeded,
11338        /// The Private Service Connect connection propagation failed because the NAT
11339        /// IP subnet space has been exhausted. It is equivalent to the `Needs
11340        /// attention` status of the Private Service Connect connection. See
11341        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11342        ErrorProducerNatIpSpaceExhausted,
11343        /// The Private Service Connect connection propagation failed because the
11344        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11345        /// producer VPC network has been exceeded.
11346        ErrorProducerQuotaExceeded,
11347        /// The Private Service Connect connection propagation failed because the
11348        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11349        /// VPC network has been exceeded.
11350        ErrorConsumerQuotaExceeded,
11351        /// If set, the enum was initialized with an unknown value.
11352        ///
11353        /// Applications can examine the value using [Code::value] or
11354        /// [Code::name].
11355        UnknownValue(code::UnknownValue),
11356    }
11357
11358    #[doc(hidden)]
11359    pub mod code {
11360        #[allow(unused_imports)]
11361        use super::*;
11362        #[derive(Clone, Debug, PartialEq)]
11363        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11364    }
11365
11366    impl Code {
11367        /// Gets the enum value.
11368        ///
11369        /// Returns `None` if the enum contains an unknown value deserialized from
11370        /// the string representation of enums.
11371        pub fn value(&self) -> std::option::Option<i32> {
11372            match self {
11373                Self::Unspecified => std::option::Option::Some(0),
11374                Self::Ready => std::option::Option::Some(1),
11375                Self::Propagating => std::option::Option::Some(2),
11376                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11377                    std::option::Option::Some(3)
11378                }
11379                Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11380                Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11381                Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11382                Self::UnknownValue(u) => u.0.value(),
11383            }
11384        }
11385
11386        /// Gets the enum value as a string.
11387        ///
11388        /// Returns `None` if the enum contains an unknown value deserialized from
11389        /// the integer representation of enums.
11390        pub fn name(&self) -> std::option::Option<&str> {
11391            match self {
11392                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11393                Self::Ready => std::option::Option::Some("READY"),
11394                Self::Propagating => std::option::Option::Some("PROPAGATING"),
11395                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11396                    std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11397                }
11398                Self::ErrorProducerNatIpSpaceExhausted => {
11399                    std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11400                }
11401                Self::ErrorProducerQuotaExceeded => {
11402                    std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11403                }
11404                Self::ErrorConsumerQuotaExceeded => {
11405                    std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11406                }
11407                Self::UnknownValue(u) => u.0.name(),
11408            }
11409        }
11410    }
11411
11412    impl std::default::Default for Code {
11413        fn default() -> Self {
11414            use std::convert::From;
11415            Self::from(0)
11416        }
11417    }
11418
11419    impl std::fmt::Display for Code {
11420        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11421            wkt::internal::display_enum(f, self.name(), self.value())
11422        }
11423    }
11424
11425    impl std::convert::From<i32> for Code {
11426        fn from(value: i32) -> Self {
11427            match value {
11428                0 => Self::Unspecified,
11429                1 => Self::Ready,
11430                2 => Self::Propagating,
11431                3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11432                4 => Self::ErrorProducerNatIpSpaceExhausted,
11433                5 => Self::ErrorProducerQuotaExceeded,
11434                6 => Self::ErrorConsumerQuotaExceeded,
11435                _ => Self::UnknownValue(code::UnknownValue(
11436                    wkt::internal::UnknownEnumValue::Integer(value),
11437                )),
11438            }
11439        }
11440    }
11441
11442    impl std::convert::From<&str> for Code {
11443        fn from(value: &str) -> Self {
11444            use std::string::ToString;
11445            match value {
11446                "CODE_UNSPECIFIED" => Self::Unspecified,
11447                "READY" => Self::Ready,
11448                "PROPAGATING" => Self::Propagating,
11449                "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11450                    Self::ErrorProducerPropagatedConnectionLimitExceeded
11451                }
11452                "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11453                "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11454                "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11455                _ => Self::UnknownValue(code::UnknownValue(
11456                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11457                )),
11458            }
11459        }
11460    }
11461
11462    impl serde::ser::Serialize for Code {
11463        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11464        where
11465            S: serde::Serializer,
11466        {
11467            match self {
11468                Self::Unspecified => serializer.serialize_i32(0),
11469                Self::Ready => serializer.serialize_i32(1),
11470                Self::Propagating => serializer.serialize_i32(2),
11471                Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11472                Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11473                Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11474                Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11475                Self::UnknownValue(u) => u.0.serialize(serializer),
11476            }
11477        }
11478    }
11479
11480    impl<'de> serde::de::Deserialize<'de> for Code {
11481        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11482        where
11483            D: serde::Deserializer<'de>,
11484        {
11485            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11486                ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11487            ))
11488        }
11489    }
11490}
11491
11492/// The request for
11493/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11494///
11495/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11496#[derive(Clone, Default, PartialEq)]
11497#[non_exhaustive]
11498pub struct ListSpokesRequest {
11499    /// Required. The parent resource.
11500    pub parent: std::string::String,
11501
11502    /// The maximum number of results to return per page.
11503    pub page_size: i32,
11504
11505    /// The page token.
11506    pub page_token: std::string::String,
11507
11508    /// An expression that filters the list of results.
11509    pub filter: std::string::String,
11510
11511    /// Sort the results by a certain order.
11512    pub order_by: std::string::String,
11513
11514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11515}
11516
11517impl ListSpokesRequest {
11518    /// Creates a new default instance.
11519    pub fn new() -> Self {
11520        std::default::Default::default()
11521    }
11522
11523    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11524    ///
11525    /// # Example
11526    /// ```ignore,no_run
11527    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11528    /// let x = ListSpokesRequest::new().set_parent("example");
11529    /// ```
11530    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11531        self.parent = v.into();
11532        self
11533    }
11534
11535    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11536    ///
11537    /// # Example
11538    /// ```ignore,no_run
11539    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11540    /// let x = ListSpokesRequest::new().set_page_size(42);
11541    /// ```
11542    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11543        self.page_size = v.into();
11544        self
11545    }
11546
11547    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11548    ///
11549    /// # Example
11550    /// ```ignore,no_run
11551    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11552    /// let x = ListSpokesRequest::new().set_page_token("example");
11553    /// ```
11554    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11555        self.page_token = v.into();
11556        self
11557    }
11558
11559    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11560    ///
11561    /// # Example
11562    /// ```ignore,no_run
11563    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11564    /// let x = ListSpokesRequest::new().set_filter("example");
11565    /// ```
11566    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11567        self.filter = v.into();
11568        self
11569    }
11570
11571    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11572    ///
11573    /// # Example
11574    /// ```ignore,no_run
11575    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11576    /// let x = ListSpokesRequest::new().set_order_by("example");
11577    /// ```
11578    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11579        self.order_by = v.into();
11580        self
11581    }
11582}
11583
11584impl wkt::message::Message for ListSpokesRequest {
11585    fn typename() -> &'static str {
11586        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11587    }
11588}
11589
11590/// The response for
11591/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11592///
11593/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11594#[derive(Clone, Default, PartialEq)]
11595#[non_exhaustive]
11596pub struct ListSpokesResponse {
11597    /// The requested spokes.
11598    pub spokes: std::vec::Vec<crate::model::Spoke>,
11599
11600    /// The token for the next page of the response. To see more results,
11601    /// use this value as the page_token for your next request. If this value
11602    /// is empty, there are no more results.
11603    pub next_page_token: std::string::String,
11604
11605    /// Locations that could not be reached.
11606    pub unreachable: std::vec::Vec<std::string::String>,
11607
11608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11609}
11610
11611impl ListSpokesResponse {
11612    /// Creates a new default instance.
11613    pub fn new() -> Self {
11614        std::default::Default::default()
11615    }
11616
11617    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11618    ///
11619    /// # Example
11620    /// ```ignore,no_run
11621    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11622    /// use google_cloud_networkconnectivity_v1::model::Spoke;
11623    /// let x = ListSpokesResponse::new()
11624    ///     .set_spokes([
11625    ///         Spoke::default()/* use setters */,
11626    ///         Spoke::default()/* use (different) setters */,
11627    ///     ]);
11628    /// ```
11629    pub fn set_spokes<T, V>(mut self, v: T) -> Self
11630    where
11631        T: std::iter::IntoIterator<Item = V>,
11632        V: std::convert::Into<crate::model::Spoke>,
11633    {
11634        use std::iter::Iterator;
11635        self.spokes = v.into_iter().map(|i| i.into()).collect();
11636        self
11637    }
11638
11639    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11640    ///
11641    /// # Example
11642    /// ```ignore,no_run
11643    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11644    /// let x = ListSpokesResponse::new().set_next_page_token("example");
11645    /// ```
11646    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11647        self.next_page_token = v.into();
11648        self
11649    }
11650
11651    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11652    ///
11653    /// # Example
11654    /// ```ignore,no_run
11655    /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11656    /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11657    /// ```
11658    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11659    where
11660        T: std::iter::IntoIterator<Item = V>,
11661        V: std::convert::Into<std::string::String>,
11662    {
11663        use std::iter::Iterator;
11664        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11665        self
11666    }
11667}
11668
11669impl wkt::message::Message for ListSpokesResponse {
11670    fn typename() -> &'static str {
11671        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11672    }
11673}
11674
11675#[doc(hidden)]
11676impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
11677    type PageItem = crate::model::Spoke;
11678
11679    fn items(self) -> std::vec::Vec<Self::PageItem> {
11680        self.spokes
11681    }
11682
11683    fn next_page_token(&self) -> std::string::String {
11684        use std::clone::Clone;
11685        self.next_page_token.clone()
11686    }
11687}
11688
11689/// The request for
11690/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11691///
11692/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11693#[derive(Clone, Default, PartialEq)]
11694#[non_exhaustive]
11695pub struct GetSpokeRequest {
11696    /// Required. The name of the spoke resource.
11697    pub name: std::string::String,
11698
11699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11700}
11701
11702impl GetSpokeRequest {
11703    /// Creates a new default instance.
11704    pub fn new() -> Self {
11705        std::default::Default::default()
11706    }
11707
11708    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11709    ///
11710    /// # Example
11711    /// ```ignore,no_run
11712    /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11713    /// let x = GetSpokeRequest::new().set_name("example");
11714    /// ```
11715    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11716        self.name = v.into();
11717        self
11718    }
11719}
11720
11721impl wkt::message::Message for GetSpokeRequest {
11722    fn typename() -> &'static str {
11723        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11724    }
11725}
11726
11727/// The request for
11728/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11729///
11730/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11731#[derive(Clone, Default, PartialEq)]
11732#[non_exhaustive]
11733pub struct CreateSpokeRequest {
11734    /// Required. The parent resource.
11735    pub parent: std::string::String,
11736
11737    /// Required. Unique id for the spoke to create.
11738    pub spoke_id: std::string::String,
11739
11740    /// Required. The initial values for a new spoke.
11741    pub spoke: std::option::Option<crate::model::Spoke>,
11742
11743    /// Optional. A request ID to identify requests. Specify a unique request ID so
11744    /// that if you must retry your request, the server knows to ignore the request
11745    /// if it has already been completed. The server guarantees that a request
11746    /// doesn't result in creation of duplicate commitments for at least 60
11747    /// minutes.
11748    ///
11749    /// For example, consider a situation where you make an initial request and
11750    /// the request times out. If you make the request again with the same request
11751    /// ID, the server can check to see whether the original operation
11752    /// was received. If it was, the server ignores the second request. This
11753    /// behavior prevents clients from mistakenly creating duplicate commitments.
11754    ///
11755    /// The request ID must be a valid UUID, with the exception that zero UUID is
11756    /// not supported (00000000-0000-0000-0000-000000000000).
11757    pub request_id: std::string::String,
11758
11759    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11760}
11761
11762impl CreateSpokeRequest {
11763    /// Creates a new default instance.
11764    pub fn new() -> Self {
11765        std::default::Default::default()
11766    }
11767
11768    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11769    ///
11770    /// # Example
11771    /// ```ignore,no_run
11772    /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11773    /// let x = CreateSpokeRequest::new().set_parent("example");
11774    /// ```
11775    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11776        self.parent = v.into();
11777        self
11778    }
11779
11780    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11781    ///
11782    /// # Example
11783    /// ```ignore,no_run
11784    /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11785    /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11786    /// ```
11787    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11788        self.spoke_id = v.into();
11789        self
11790    }
11791
11792    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11793    ///
11794    /// # Example
11795    /// ```ignore,no_run
11796    /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11797    /// use google_cloud_networkconnectivity_v1::model::Spoke;
11798    /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11799    /// ```
11800    pub fn set_spoke<T>(mut self, v: T) -> Self
11801    where
11802        T: std::convert::Into<crate::model::Spoke>,
11803    {
11804        self.spoke = std::option::Option::Some(v.into());
11805        self
11806    }
11807
11808    /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11809    ///
11810    /// # Example
11811    /// ```ignore,no_run
11812    /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11813    /// use google_cloud_networkconnectivity_v1::model::Spoke;
11814    /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11815    /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11816    /// ```
11817    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11818    where
11819        T: std::convert::Into<crate::model::Spoke>,
11820    {
11821        self.spoke = v.map(|x| x.into());
11822        self
11823    }
11824
11825    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11826    ///
11827    /// # Example
11828    /// ```ignore,no_run
11829    /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11830    /// let x = CreateSpokeRequest::new().set_request_id("example");
11831    /// ```
11832    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11833        self.request_id = v.into();
11834        self
11835    }
11836}
11837
11838impl wkt::message::Message for CreateSpokeRequest {
11839    fn typename() -> &'static str {
11840        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11841    }
11842}
11843
11844/// Request for
11845/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11846/// method.
11847///
11848/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11849#[derive(Clone, Default, PartialEq)]
11850#[non_exhaustive]
11851pub struct UpdateSpokeRequest {
11852    /// Optional. In the case of an update to an existing spoke, field mask is used
11853    /// to specify the fields to be overwritten. The fields specified in the
11854    /// update_mask are relative to the resource, not the full request. A field is
11855    /// overwritten if it is in the mask. If the user does not provide a mask, then
11856    /// all fields are overwritten.
11857    pub update_mask: std::option::Option<wkt::FieldMask>,
11858
11859    /// Required. The state that the spoke should be in after the update.
11860    pub spoke: std::option::Option<crate::model::Spoke>,
11861
11862    /// Optional. A request ID to identify requests. Specify a unique request ID so
11863    /// that if you must retry your request, the server knows to ignore the request
11864    /// if it has already been completed. The server guarantees that a request
11865    /// doesn't result in creation of duplicate commitments for at least 60
11866    /// minutes.
11867    ///
11868    /// For example, consider a situation where you make an initial request and
11869    /// the request times out. If you make the request again with the same request
11870    /// ID, the server can check to see whether the original operation
11871    /// was received. If it was, the server ignores the second request. This
11872    /// behavior prevents clients from mistakenly creating duplicate commitments.
11873    ///
11874    /// The request ID must be a valid UUID, with the exception that zero UUID is
11875    /// not supported (00000000-0000-0000-0000-000000000000).
11876    pub request_id: std::string::String,
11877
11878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11879}
11880
11881impl UpdateSpokeRequest {
11882    /// Creates a new default instance.
11883    pub fn new() -> Self {
11884        std::default::Default::default()
11885    }
11886
11887    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11888    ///
11889    /// # Example
11890    /// ```ignore,no_run
11891    /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11892    /// use wkt::FieldMask;
11893    /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11894    /// ```
11895    pub fn set_update_mask<T>(mut self, v: T) -> Self
11896    where
11897        T: std::convert::Into<wkt::FieldMask>,
11898    {
11899        self.update_mask = std::option::Option::Some(v.into());
11900        self
11901    }
11902
11903    /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11904    ///
11905    /// # Example
11906    /// ```ignore,no_run
11907    /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11908    /// use wkt::FieldMask;
11909    /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11910    /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11911    /// ```
11912    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11913    where
11914        T: std::convert::Into<wkt::FieldMask>,
11915    {
11916        self.update_mask = v.map(|x| x.into());
11917        self
11918    }
11919
11920    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11921    ///
11922    /// # Example
11923    /// ```ignore,no_run
11924    /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11925    /// use google_cloud_networkconnectivity_v1::model::Spoke;
11926    /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11927    /// ```
11928    pub fn set_spoke<T>(mut self, v: T) -> Self
11929    where
11930        T: std::convert::Into<crate::model::Spoke>,
11931    {
11932        self.spoke = std::option::Option::Some(v.into());
11933        self
11934    }
11935
11936    /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11937    ///
11938    /// # Example
11939    /// ```ignore,no_run
11940    /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11941    /// use google_cloud_networkconnectivity_v1::model::Spoke;
11942    /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11943    /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11944    /// ```
11945    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11946    where
11947        T: std::convert::Into<crate::model::Spoke>,
11948    {
11949        self.spoke = v.map(|x| x.into());
11950        self
11951    }
11952
11953    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
11954    ///
11955    /// # Example
11956    /// ```ignore,no_run
11957    /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11958    /// let x = UpdateSpokeRequest::new().set_request_id("example");
11959    /// ```
11960    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11961        self.request_id = v.into();
11962        self
11963    }
11964}
11965
11966impl wkt::message::Message for UpdateSpokeRequest {
11967    fn typename() -> &'static str {
11968        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
11969    }
11970}
11971
11972/// The request for
11973/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
11974///
11975/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
11976#[derive(Clone, Default, PartialEq)]
11977#[non_exhaustive]
11978pub struct DeleteSpokeRequest {
11979    /// Required. The name of the spoke to delete.
11980    pub name: std::string::String,
11981
11982    /// Optional. A request ID to identify requests. Specify a unique request ID so
11983    /// that if you must retry your request, the server knows to ignore the request
11984    /// if it has already been completed. The server guarantees that a request
11985    /// doesn't result in creation of duplicate commitments for at least 60
11986    /// minutes.
11987    ///
11988    /// For example, consider a situation where you make an initial request and
11989    /// the request times out. If you make the request again with the same request
11990    /// ID, the server can check to see whether the original operation
11991    /// was received. If it was, the server ignores the second request. This
11992    /// behavior prevents clients from mistakenly creating duplicate commitments.
11993    ///
11994    /// The request ID must be a valid UUID, with the exception that zero UUID is
11995    /// not supported (00000000-0000-0000-0000-000000000000).
11996    pub request_id: std::string::String,
11997
11998    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11999}
12000
12001impl DeleteSpokeRequest {
12002    /// Creates a new default instance.
12003    pub fn new() -> Self {
12004        std::default::Default::default()
12005    }
12006
12007    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
12008    ///
12009    /// # Example
12010    /// ```ignore,no_run
12011    /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12012    /// let x = DeleteSpokeRequest::new().set_name("example");
12013    /// ```
12014    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12015        self.name = v.into();
12016        self
12017    }
12018
12019    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
12020    ///
12021    /// # Example
12022    /// ```ignore,no_run
12023    /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12024    /// let x = DeleteSpokeRequest::new().set_request_id("example");
12025    /// ```
12026    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12027        self.request_id = v.into();
12028        self
12029    }
12030}
12031
12032impl wkt::message::Message for DeleteSpokeRequest {
12033    fn typename() -> &'static str {
12034        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
12035    }
12036}
12037
12038/// The request for
12039/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12040///
12041/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12042#[derive(Clone, Default, PartialEq)]
12043#[non_exhaustive]
12044pub struct AcceptHubSpokeRequest {
12045    /// Required. The name of the hub into which to accept the spoke.
12046    pub name: std::string::String,
12047
12048    /// Required. The URI of the spoke to accept into the hub.
12049    pub spoke_uri: std::string::String,
12050
12051    /// Optional. A request ID to identify requests. Specify a unique request ID so
12052    /// that if you must retry your request, the server knows to ignore the request
12053    /// if it has already been completed. The server guarantees that a request
12054    /// doesn't result in creation of duplicate commitments for at least 60
12055    /// minutes.
12056    ///
12057    /// For example, consider a situation where you make an initial request and
12058    /// the request times out. If you make the request again with the same request
12059    /// ID, the server can check to see whether the original operation
12060    /// was received. If it was, the server ignores the second request. This
12061    /// behavior prevents clients from mistakenly creating duplicate commitments.
12062    ///
12063    /// The request ID must be a valid UUID, with the exception that zero UUID is
12064    /// not supported (00000000-0000-0000-0000-000000000000).
12065    pub request_id: std::string::String,
12066
12067    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12068}
12069
12070impl AcceptHubSpokeRequest {
12071    /// Creates a new default instance.
12072    pub fn new() -> Self {
12073        std::default::Default::default()
12074    }
12075
12076    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
12077    ///
12078    /// # Example
12079    /// ```ignore,no_run
12080    /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12081    /// let x = AcceptHubSpokeRequest::new().set_name("example");
12082    /// ```
12083    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12084        self.name = v.into();
12085        self
12086    }
12087
12088    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12089    ///
12090    /// # Example
12091    /// ```ignore,no_run
12092    /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12093    /// let x = AcceptHubSpokeRequest::new().set_spoke_uri("example");
12094    /// ```
12095    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12096        self.spoke_uri = v.into();
12097        self
12098    }
12099
12100    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12101    ///
12102    /// # Example
12103    /// ```ignore,no_run
12104    /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12105    /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12106    /// ```
12107    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12108        self.request_id = v.into();
12109        self
12110    }
12111}
12112
12113impl wkt::message::Message for AcceptHubSpokeRequest {
12114    fn typename() -> &'static str {
12115        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12116    }
12117}
12118
12119/// The response for
12120/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12121///
12122/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12123#[derive(Clone, Default, PartialEq)]
12124#[non_exhaustive]
12125pub struct AcceptHubSpokeResponse {
12126    /// The spoke that was operated on.
12127    pub spoke: std::option::Option<crate::model::Spoke>,
12128
12129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12130}
12131
12132impl AcceptHubSpokeResponse {
12133    /// Creates a new default instance.
12134    pub fn new() -> Self {
12135        std::default::Default::default()
12136    }
12137
12138    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12139    ///
12140    /// # Example
12141    /// ```ignore,no_run
12142    /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12143    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12144    /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12145    /// ```
12146    pub fn set_spoke<T>(mut self, v: T) -> Self
12147    where
12148        T: std::convert::Into<crate::model::Spoke>,
12149    {
12150        self.spoke = std::option::Option::Some(v.into());
12151        self
12152    }
12153
12154    /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12155    ///
12156    /// # Example
12157    /// ```ignore,no_run
12158    /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12159    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12160    /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12161    /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12162    /// ```
12163    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12164    where
12165        T: std::convert::Into<crate::model::Spoke>,
12166    {
12167        self.spoke = v.map(|x| x.into());
12168        self
12169    }
12170}
12171
12172impl wkt::message::Message for AcceptHubSpokeResponse {
12173    fn typename() -> &'static str {
12174        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12175    }
12176}
12177
12178/// The request for
12179/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12180///
12181/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12182#[derive(Clone, Default, PartialEq)]
12183#[non_exhaustive]
12184pub struct RejectHubSpokeRequest {
12185    /// Required. The name of the hub from which to reject the spoke.
12186    pub name: std::string::String,
12187
12188    /// Required. The URI of the spoke to reject from the hub.
12189    pub spoke_uri: std::string::String,
12190
12191    /// Optional. A request ID to identify requests. Specify a unique request ID so
12192    /// that if you must retry your request, the server knows to ignore the request
12193    /// if it has already been completed. The server guarantees that a request
12194    /// doesn't result in creation of duplicate commitments for at least 60
12195    /// minutes.
12196    ///
12197    /// For example, consider a situation where you make an initial request and
12198    /// the request times out. If you make the request again with the same request
12199    /// ID, the server can check to see whether the original operation
12200    /// was received. If it was, the server ignores the second request. This
12201    /// behavior prevents clients from mistakenly creating duplicate commitments.
12202    ///
12203    /// The request ID must be a valid UUID, with the exception that zero UUID is
12204    /// not supported (00000000-0000-0000-0000-000000000000).
12205    pub request_id: std::string::String,
12206
12207    /// Optional. Additional information provided by the hub administrator.
12208    pub details: std::string::String,
12209
12210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12211}
12212
12213impl RejectHubSpokeRequest {
12214    /// Creates a new default instance.
12215    pub fn new() -> Self {
12216        std::default::Default::default()
12217    }
12218
12219    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12220    ///
12221    /// # Example
12222    /// ```ignore,no_run
12223    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12224    /// let x = RejectHubSpokeRequest::new().set_name("example");
12225    /// ```
12226    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12227        self.name = v.into();
12228        self
12229    }
12230
12231    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12232    ///
12233    /// # Example
12234    /// ```ignore,no_run
12235    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12236    /// let x = RejectHubSpokeRequest::new().set_spoke_uri("example");
12237    /// ```
12238    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12239        self.spoke_uri = v.into();
12240        self
12241    }
12242
12243    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12244    ///
12245    /// # Example
12246    /// ```ignore,no_run
12247    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12248    /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12249    /// ```
12250    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12251        self.request_id = v.into();
12252        self
12253    }
12254
12255    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12256    ///
12257    /// # Example
12258    /// ```ignore,no_run
12259    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12260    /// let x = RejectHubSpokeRequest::new().set_details("example");
12261    /// ```
12262    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12263        self.details = v.into();
12264        self
12265    }
12266}
12267
12268impl wkt::message::Message for RejectHubSpokeRequest {
12269    fn typename() -> &'static str {
12270        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12271    }
12272}
12273
12274/// The response for
12275/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12276///
12277/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12278#[derive(Clone, Default, PartialEq)]
12279#[non_exhaustive]
12280pub struct RejectHubSpokeResponse {
12281    /// The spoke that was operated on.
12282    pub spoke: std::option::Option<crate::model::Spoke>,
12283
12284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12285}
12286
12287impl RejectHubSpokeResponse {
12288    /// Creates a new default instance.
12289    pub fn new() -> Self {
12290        std::default::Default::default()
12291    }
12292
12293    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12294    ///
12295    /// # Example
12296    /// ```ignore,no_run
12297    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12298    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12299    /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12300    /// ```
12301    pub fn set_spoke<T>(mut self, v: T) -> Self
12302    where
12303        T: std::convert::Into<crate::model::Spoke>,
12304    {
12305        self.spoke = std::option::Option::Some(v.into());
12306        self
12307    }
12308
12309    /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12310    ///
12311    /// # Example
12312    /// ```ignore,no_run
12313    /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12314    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12315    /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12316    /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12317    /// ```
12318    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12319    where
12320        T: std::convert::Into<crate::model::Spoke>,
12321    {
12322        self.spoke = v.map(|x| x.into());
12323        self
12324    }
12325}
12326
12327impl wkt::message::Message for RejectHubSpokeResponse {
12328    fn typename() -> &'static str {
12329        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12330    }
12331}
12332
12333/// The request for
12334/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12335///
12336/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12337#[derive(Clone, Default, PartialEq)]
12338#[non_exhaustive]
12339pub struct AcceptSpokeUpdateRequest {
12340    /// Required. The name of the hub to accept spoke update.
12341    pub name: std::string::String,
12342
12343    /// Required. The URI of the spoke to accept update.
12344    pub spoke_uri: std::string::String,
12345
12346    /// Required. The etag of the spoke to accept update.
12347    pub spoke_etag: std::string::String,
12348
12349    /// Optional. A request ID to identify requests. Specify a unique request ID so
12350    /// that if you must retry your request, the server knows to ignore the request
12351    /// if it has already been completed. The server guarantees that a request
12352    /// doesn't result in creation of duplicate commitments for at least 60
12353    /// minutes.
12354    ///
12355    /// For example, consider a situation where you make an initial request and
12356    /// the request times out. If you make the request again with the same request
12357    /// ID, the server can check to see whether the original operation
12358    /// was received. If it was, the server ignores the second request. This
12359    /// behavior prevents clients from mistakenly creating duplicate commitments.
12360    ///
12361    /// The request ID must be a valid UUID, with the exception that zero UUID is
12362    /// not supported (00000000-0000-0000-0000-000000000000).
12363    pub request_id: std::string::String,
12364
12365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12366}
12367
12368impl AcceptSpokeUpdateRequest {
12369    /// Creates a new default instance.
12370    pub fn new() -> Self {
12371        std::default::Default::default()
12372    }
12373
12374    /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12375    ///
12376    /// # Example
12377    /// ```ignore,no_run
12378    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12379    /// let x = AcceptSpokeUpdateRequest::new().set_name("example");
12380    /// ```
12381    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12382        self.name = v.into();
12383        self
12384    }
12385
12386    /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12387    ///
12388    /// # Example
12389    /// ```ignore,no_run
12390    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12391    /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri("example");
12392    /// ```
12393    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12394        self.spoke_uri = v.into();
12395        self
12396    }
12397
12398    /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12399    ///
12400    /// # Example
12401    /// ```ignore,no_run
12402    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12403    /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12404    /// ```
12405    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12406        self.spoke_etag = v.into();
12407        self
12408    }
12409
12410    /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12411    ///
12412    /// # Example
12413    /// ```ignore,no_run
12414    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12415    /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12416    /// ```
12417    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12418        self.request_id = v.into();
12419        self
12420    }
12421}
12422
12423impl wkt::message::Message for AcceptSpokeUpdateRequest {
12424    fn typename() -> &'static str {
12425        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12426    }
12427}
12428
12429/// The response for
12430/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12431///
12432/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12433#[derive(Clone, Default, PartialEq)]
12434#[non_exhaustive]
12435pub struct AcceptSpokeUpdateResponse {
12436    /// The spoke that was operated on.
12437    pub spoke: std::option::Option<crate::model::Spoke>,
12438
12439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12440}
12441
12442impl AcceptSpokeUpdateResponse {
12443    /// Creates a new default instance.
12444    pub fn new() -> Self {
12445        std::default::Default::default()
12446    }
12447
12448    /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12449    ///
12450    /// # Example
12451    /// ```ignore,no_run
12452    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12453    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12454    /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12455    /// ```
12456    pub fn set_spoke<T>(mut self, v: T) -> Self
12457    where
12458        T: std::convert::Into<crate::model::Spoke>,
12459    {
12460        self.spoke = std::option::Option::Some(v.into());
12461        self
12462    }
12463
12464    /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12465    ///
12466    /// # Example
12467    /// ```ignore,no_run
12468    /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12469    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12470    /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12471    /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12472    /// ```
12473    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12474    where
12475        T: std::convert::Into<crate::model::Spoke>,
12476    {
12477        self.spoke = v.map(|x| x.into());
12478        self
12479    }
12480}
12481
12482impl wkt::message::Message for AcceptSpokeUpdateResponse {
12483    fn typename() -> &'static str {
12484        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12485    }
12486}
12487
12488/// The request for
12489/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12490///
12491/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12492#[derive(Clone, Default, PartialEq)]
12493#[non_exhaustive]
12494pub struct RejectSpokeUpdateRequest {
12495    /// Required. The name of the hub to reject spoke update.
12496    pub name: std::string::String,
12497
12498    /// Required. The URI of the spoke to reject update.
12499    pub spoke_uri: std::string::String,
12500
12501    /// Required. The etag of the spoke to reject update.
12502    pub spoke_etag: std::string::String,
12503
12504    /// Optional. Additional information provided by the hub administrator.
12505    pub details: std::string::String,
12506
12507    /// Optional. A request ID to identify requests. Specify a unique request ID so
12508    /// that if you must retry your request, the server knows to ignore the request
12509    /// if it has already been completed. The server guarantees that a request
12510    /// doesn't result in creation of duplicate commitments for at least 60
12511    /// minutes.
12512    ///
12513    /// For example, consider a situation where you make an initial request and
12514    /// the request times out. If you make the request again with the same request
12515    /// ID, the server can check to see whether the original operation
12516    /// was received. If it was, the server ignores the second request. This
12517    /// behavior prevents clients from mistakenly creating duplicate commitments.
12518    ///
12519    /// The request ID must be a valid UUID, with the exception that zero UUID is
12520    /// not supported (00000000-0000-0000-0000-000000000000).
12521    pub request_id: std::string::String,
12522
12523    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12524}
12525
12526impl RejectSpokeUpdateRequest {
12527    /// Creates a new default instance.
12528    pub fn new() -> Self {
12529        std::default::Default::default()
12530    }
12531
12532    /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12533    ///
12534    /// # Example
12535    /// ```ignore,no_run
12536    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12537    /// let x = RejectSpokeUpdateRequest::new().set_name("example");
12538    /// ```
12539    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12540        self.name = v.into();
12541        self
12542    }
12543
12544    /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12545    ///
12546    /// # Example
12547    /// ```ignore,no_run
12548    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12549    /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri("example");
12550    /// ```
12551    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552        self.spoke_uri = v.into();
12553        self
12554    }
12555
12556    /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12557    ///
12558    /// # Example
12559    /// ```ignore,no_run
12560    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12561    /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12562    /// ```
12563    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12564        self.spoke_etag = v.into();
12565        self
12566    }
12567
12568    /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12569    ///
12570    /// # Example
12571    /// ```ignore,no_run
12572    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12573    /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12574    /// ```
12575    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12576        self.details = v.into();
12577        self
12578    }
12579
12580    /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12581    ///
12582    /// # Example
12583    /// ```ignore,no_run
12584    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12585    /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12586    /// ```
12587    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12588        self.request_id = v.into();
12589        self
12590    }
12591}
12592
12593impl wkt::message::Message for RejectSpokeUpdateRequest {
12594    fn typename() -> &'static str {
12595        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12596    }
12597}
12598
12599/// The response for
12600/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12601///
12602/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12603#[derive(Clone, Default, PartialEq)]
12604#[non_exhaustive]
12605pub struct RejectSpokeUpdateResponse {
12606    /// The spoke that was operated on.
12607    pub spoke: std::option::Option<crate::model::Spoke>,
12608
12609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12610}
12611
12612impl RejectSpokeUpdateResponse {
12613    /// Creates a new default instance.
12614    pub fn new() -> Self {
12615        std::default::Default::default()
12616    }
12617
12618    /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12619    ///
12620    /// # Example
12621    /// ```ignore,no_run
12622    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12623    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12624    /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12625    /// ```
12626    pub fn set_spoke<T>(mut self, v: T) -> Self
12627    where
12628        T: std::convert::Into<crate::model::Spoke>,
12629    {
12630        self.spoke = std::option::Option::Some(v.into());
12631        self
12632    }
12633
12634    /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12635    ///
12636    /// # Example
12637    /// ```ignore,no_run
12638    /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12639    /// use google_cloud_networkconnectivity_v1::model::Spoke;
12640    /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12641    /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12642    /// ```
12643    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12644    where
12645        T: std::convert::Into<crate::model::Spoke>,
12646    {
12647        self.spoke = v.map(|x| x.into());
12648        self
12649    }
12650}
12651
12652impl wkt::message::Message for RejectSpokeUpdateResponse {
12653    fn typename() -> &'static str {
12654        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12655    }
12656}
12657
12658/// The request for
12659/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12660///
12661/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12662#[derive(Clone, Default, PartialEq)]
12663#[non_exhaustive]
12664pub struct GetRouteTableRequest {
12665    /// Required. The name of the route table resource.
12666    pub name: std::string::String,
12667
12668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12669}
12670
12671impl GetRouteTableRequest {
12672    /// Creates a new default instance.
12673    pub fn new() -> Self {
12674        std::default::Default::default()
12675    }
12676
12677    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12678    ///
12679    /// # Example
12680    /// ```ignore,no_run
12681    /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12682    /// let x = GetRouteTableRequest::new().set_name("example");
12683    /// ```
12684    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12685        self.name = v.into();
12686        self
12687    }
12688}
12689
12690impl wkt::message::Message for GetRouteTableRequest {
12691    fn typename() -> &'static str {
12692        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12693    }
12694}
12695
12696/// The request for
12697/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12698///
12699/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12700#[derive(Clone, Default, PartialEq)]
12701#[non_exhaustive]
12702pub struct GetRouteRequest {
12703    /// Required. The name of the route resource.
12704    pub name: std::string::String,
12705
12706    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12707}
12708
12709impl GetRouteRequest {
12710    /// Creates a new default instance.
12711    pub fn new() -> Self {
12712        std::default::Default::default()
12713    }
12714
12715    /// Sets the value of [name][crate::model::GetRouteRequest::name].
12716    ///
12717    /// # Example
12718    /// ```ignore,no_run
12719    /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12720    /// let x = GetRouteRequest::new().set_name("example");
12721    /// ```
12722    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12723        self.name = v.into();
12724        self
12725    }
12726}
12727
12728impl wkt::message::Message for GetRouteRequest {
12729    fn typename() -> &'static str {
12730        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12731    }
12732}
12733
12734/// Request for
12735/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12736/// method.
12737///
12738/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12739#[derive(Clone, Default, PartialEq)]
12740#[non_exhaustive]
12741pub struct ListRoutesRequest {
12742    /// Required. The parent resource's name.
12743    pub parent: std::string::String,
12744
12745    /// The maximum number of results to return per page.
12746    pub page_size: i32,
12747
12748    /// The page token.
12749    pub page_token: std::string::String,
12750
12751    /// An expression that filters the list of results.
12752    pub filter: std::string::String,
12753
12754    /// Sort the results by a certain order.
12755    pub order_by: std::string::String,
12756
12757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12758}
12759
12760impl ListRoutesRequest {
12761    /// Creates a new default instance.
12762    pub fn new() -> Self {
12763        std::default::Default::default()
12764    }
12765
12766    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12767    ///
12768    /// # Example
12769    /// ```ignore,no_run
12770    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12771    /// let x = ListRoutesRequest::new().set_parent("example");
12772    /// ```
12773    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12774        self.parent = v.into();
12775        self
12776    }
12777
12778    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12779    ///
12780    /// # Example
12781    /// ```ignore,no_run
12782    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12783    /// let x = ListRoutesRequest::new().set_page_size(42);
12784    /// ```
12785    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12786        self.page_size = v.into();
12787        self
12788    }
12789
12790    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12791    ///
12792    /// # Example
12793    /// ```ignore,no_run
12794    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12795    /// let x = ListRoutesRequest::new().set_page_token("example");
12796    /// ```
12797    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12798        self.page_token = v.into();
12799        self
12800    }
12801
12802    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12803    ///
12804    /// # Example
12805    /// ```ignore,no_run
12806    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12807    /// let x = ListRoutesRequest::new().set_filter("example");
12808    /// ```
12809    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12810        self.filter = v.into();
12811        self
12812    }
12813
12814    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12815    ///
12816    /// # Example
12817    /// ```ignore,no_run
12818    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12819    /// let x = ListRoutesRequest::new().set_order_by("example");
12820    /// ```
12821    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12822        self.order_by = v.into();
12823        self
12824    }
12825}
12826
12827impl wkt::message::Message for ListRoutesRequest {
12828    fn typename() -> &'static str {
12829        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12830    }
12831}
12832
12833/// Response for
12834/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12835/// method.
12836///
12837/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12838#[derive(Clone, Default, PartialEq)]
12839#[non_exhaustive]
12840pub struct ListRoutesResponse {
12841    /// The requested routes.
12842    pub routes: std::vec::Vec<crate::model::Route>,
12843
12844    /// The token for the next page of the response. To see more results,
12845    /// use this value as the page_token for your next request. If this value
12846    /// is empty, there are no more results.
12847    pub next_page_token: std::string::String,
12848
12849    /// RouteTables that could not be reached.
12850    pub unreachable: std::vec::Vec<std::string::String>,
12851
12852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12853}
12854
12855impl ListRoutesResponse {
12856    /// Creates a new default instance.
12857    pub fn new() -> Self {
12858        std::default::Default::default()
12859    }
12860
12861    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
12862    ///
12863    /// # Example
12864    /// ```ignore,no_run
12865    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12866    /// use google_cloud_networkconnectivity_v1::model::Route;
12867    /// let x = ListRoutesResponse::new()
12868    ///     .set_routes([
12869    ///         Route::default()/* use setters */,
12870    ///         Route::default()/* use (different) setters */,
12871    ///     ]);
12872    /// ```
12873    pub fn set_routes<T, V>(mut self, v: T) -> Self
12874    where
12875        T: std::iter::IntoIterator<Item = V>,
12876        V: std::convert::Into<crate::model::Route>,
12877    {
12878        use std::iter::Iterator;
12879        self.routes = v.into_iter().map(|i| i.into()).collect();
12880        self
12881    }
12882
12883    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
12884    ///
12885    /// # Example
12886    /// ```ignore,no_run
12887    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12888    /// let x = ListRoutesResponse::new().set_next_page_token("example");
12889    /// ```
12890    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12891        self.next_page_token = v.into();
12892        self
12893    }
12894
12895    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
12896    ///
12897    /// # Example
12898    /// ```ignore,no_run
12899    /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12900    /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
12901    /// ```
12902    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12903    where
12904        T: std::iter::IntoIterator<Item = V>,
12905        V: std::convert::Into<std::string::String>,
12906    {
12907        use std::iter::Iterator;
12908        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12909        self
12910    }
12911}
12912
12913impl wkt::message::Message for ListRoutesResponse {
12914    fn typename() -> &'static str {
12915        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
12916    }
12917}
12918
12919#[doc(hidden)]
12920impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
12921    type PageItem = crate::model::Route;
12922
12923    fn items(self) -> std::vec::Vec<Self::PageItem> {
12924        self.routes
12925    }
12926
12927    fn next_page_token(&self) -> std::string::String {
12928        use std::clone::Clone;
12929        self.next_page_token.clone()
12930    }
12931}
12932
12933/// Request for
12934/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12935/// method.
12936///
12937/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12938#[derive(Clone, Default, PartialEq)]
12939#[non_exhaustive]
12940pub struct ListRouteTablesRequest {
12941    /// Required. The parent resource's name.
12942    pub parent: std::string::String,
12943
12944    /// The maximum number of results to return per page.
12945    pub page_size: i32,
12946
12947    /// The page token.
12948    pub page_token: std::string::String,
12949
12950    /// An expression that filters the list of results.
12951    pub filter: std::string::String,
12952
12953    /// Sort the results by a certain order.
12954    pub order_by: std::string::String,
12955
12956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12957}
12958
12959impl ListRouteTablesRequest {
12960    /// Creates a new default instance.
12961    pub fn new() -> Self {
12962        std::default::Default::default()
12963    }
12964
12965    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
12966    ///
12967    /// # Example
12968    /// ```ignore,no_run
12969    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12970    /// let x = ListRouteTablesRequest::new().set_parent("example");
12971    /// ```
12972    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12973        self.parent = v.into();
12974        self
12975    }
12976
12977    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
12978    ///
12979    /// # Example
12980    /// ```ignore,no_run
12981    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12982    /// let x = ListRouteTablesRequest::new().set_page_size(42);
12983    /// ```
12984    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12985        self.page_size = v.into();
12986        self
12987    }
12988
12989    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
12990    ///
12991    /// # Example
12992    /// ```ignore,no_run
12993    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12994    /// let x = ListRouteTablesRequest::new().set_page_token("example");
12995    /// ```
12996    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12997        self.page_token = v.into();
12998        self
12999    }
13000
13001    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
13002    ///
13003    /// # Example
13004    /// ```ignore,no_run
13005    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13006    /// let x = ListRouteTablesRequest::new().set_filter("example");
13007    /// ```
13008    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13009        self.filter = v.into();
13010        self
13011    }
13012
13013    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
13014    ///
13015    /// # Example
13016    /// ```ignore,no_run
13017    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13018    /// let x = ListRouteTablesRequest::new().set_order_by("example");
13019    /// ```
13020    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13021        self.order_by = v.into();
13022        self
13023    }
13024}
13025
13026impl wkt::message::Message for ListRouteTablesRequest {
13027    fn typename() -> &'static str {
13028        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
13029    }
13030}
13031
13032/// Response for
13033/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
13034/// method.
13035///
13036/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
13037#[derive(Clone, Default, PartialEq)]
13038#[non_exhaustive]
13039pub struct ListRouteTablesResponse {
13040    /// The requested route tables.
13041    pub route_tables: std::vec::Vec<crate::model::RouteTable>,
13042
13043    /// The token for the next page of the response. To see more results,
13044    /// use this value as the page_token for your next request. If this value
13045    /// is empty, there are no more results.
13046    pub next_page_token: std::string::String,
13047
13048    /// Hubs that could not be reached.
13049    pub unreachable: std::vec::Vec<std::string::String>,
13050
13051    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13052}
13053
13054impl ListRouteTablesResponse {
13055    /// Creates a new default instance.
13056    pub fn new() -> Self {
13057        std::default::Default::default()
13058    }
13059
13060    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
13061    ///
13062    /// # Example
13063    /// ```ignore,no_run
13064    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13065    /// use google_cloud_networkconnectivity_v1::model::RouteTable;
13066    /// let x = ListRouteTablesResponse::new()
13067    ///     .set_route_tables([
13068    ///         RouteTable::default()/* use setters */,
13069    ///         RouteTable::default()/* use (different) setters */,
13070    ///     ]);
13071    /// ```
13072    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
13073    where
13074        T: std::iter::IntoIterator<Item = V>,
13075        V: std::convert::Into<crate::model::RouteTable>,
13076    {
13077        use std::iter::Iterator;
13078        self.route_tables = v.into_iter().map(|i| i.into()).collect();
13079        self
13080    }
13081
13082    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
13083    ///
13084    /// # Example
13085    /// ```ignore,no_run
13086    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13087    /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
13088    /// ```
13089    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13090        self.next_page_token = v.into();
13091        self
13092    }
13093
13094    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
13095    ///
13096    /// # Example
13097    /// ```ignore,no_run
13098    /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13099    /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13100    /// ```
13101    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13102    where
13103        T: std::iter::IntoIterator<Item = V>,
13104        V: std::convert::Into<std::string::String>,
13105    {
13106        use std::iter::Iterator;
13107        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13108        self
13109    }
13110}
13111
13112impl wkt::message::Message for ListRouteTablesResponse {
13113    fn typename() -> &'static str {
13114        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13115    }
13116}
13117
13118#[doc(hidden)]
13119impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13120    type PageItem = crate::model::RouteTable;
13121
13122    fn items(self) -> std::vec::Vec<Self::PageItem> {
13123        self.route_tables
13124    }
13125
13126    fn next_page_token(&self) -> std::string::String {
13127        use std::clone::Clone;
13128        self.next_page_token.clone()
13129    }
13130}
13131
13132/// Request for
13133/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13134/// method.
13135///
13136/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13137#[derive(Clone, Default, PartialEq)]
13138#[non_exhaustive]
13139pub struct ListGroupsRequest {
13140    /// Required. The parent resource's name.
13141    pub parent: std::string::String,
13142
13143    /// The maximum number of results to return per page.
13144    pub page_size: i32,
13145
13146    /// The page token.
13147    pub page_token: std::string::String,
13148
13149    /// An expression that filters the list of results.
13150    pub filter: std::string::String,
13151
13152    /// Sort the results by a certain order.
13153    pub order_by: std::string::String,
13154
13155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13156}
13157
13158impl ListGroupsRequest {
13159    /// Creates a new default instance.
13160    pub fn new() -> Self {
13161        std::default::Default::default()
13162    }
13163
13164    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13165    ///
13166    /// # Example
13167    /// ```ignore,no_run
13168    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13169    /// let x = ListGroupsRequest::new().set_parent("example");
13170    /// ```
13171    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13172        self.parent = v.into();
13173        self
13174    }
13175
13176    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13177    ///
13178    /// # Example
13179    /// ```ignore,no_run
13180    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13181    /// let x = ListGroupsRequest::new().set_page_size(42);
13182    /// ```
13183    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13184        self.page_size = v.into();
13185        self
13186    }
13187
13188    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13189    ///
13190    /// # Example
13191    /// ```ignore,no_run
13192    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13193    /// let x = ListGroupsRequest::new().set_page_token("example");
13194    /// ```
13195    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13196        self.page_token = v.into();
13197        self
13198    }
13199
13200    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13201    ///
13202    /// # Example
13203    /// ```ignore,no_run
13204    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13205    /// let x = ListGroupsRequest::new().set_filter("example");
13206    /// ```
13207    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13208        self.filter = v.into();
13209        self
13210    }
13211
13212    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13213    ///
13214    /// # Example
13215    /// ```ignore,no_run
13216    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13217    /// let x = ListGroupsRequest::new().set_order_by("example");
13218    /// ```
13219    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13220        self.order_by = v.into();
13221        self
13222    }
13223}
13224
13225impl wkt::message::Message for ListGroupsRequest {
13226    fn typename() -> &'static str {
13227        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13228    }
13229}
13230
13231/// Response for
13232/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13233/// method.
13234///
13235/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13236#[derive(Clone, Default, PartialEq)]
13237#[non_exhaustive]
13238pub struct ListGroupsResponse {
13239    /// The requested groups.
13240    pub groups: std::vec::Vec<crate::model::Group>,
13241
13242    /// The token for the next page of the response. To see more results,
13243    /// use this value as the page_token for your next request. If this value
13244    /// is empty, there are no more results.
13245    pub next_page_token: std::string::String,
13246
13247    /// Hubs that could not be reached.
13248    pub unreachable: std::vec::Vec<std::string::String>,
13249
13250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13251}
13252
13253impl ListGroupsResponse {
13254    /// Creates a new default instance.
13255    pub fn new() -> Self {
13256        std::default::Default::default()
13257    }
13258
13259    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13260    ///
13261    /// # Example
13262    /// ```ignore,no_run
13263    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13264    /// use google_cloud_networkconnectivity_v1::model::Group;
13265    /// let x = ListGroupsResponse::new()
13266    ///     .set_groups([
13267    ///         Group::default()/* use setters */,
13268    ///         Group::default()/* use (different) setters */,
13269    ///     ]);
13270    /// ```
13271    pub fn set_groups<T, V>(mut self, v: T) -> Self
13272    where
13273        T: std::iter::IntoIterator<Item = V>,
13274        V: std::convert::Into<crate::model::Group>,
13275    {
13276        use std::iter::Iterator;
13277        self.groups = v.into_iter().map(|i| i.into()).collect();
13278        self
13279    }
13280
13281    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13282    ///
13283    /// # Example
13284    /// ```ignore,no_run
13285    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13286    /// let x = ListGroupsResponse::new().set_next_page_token("example");
13287    /// ```
13288    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13289        self.next_page_token = v.into();
13290        self
13291    }
13292
13293    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13294    ///
13295    /// # Example
13296    /// ```ignore,no_run
13297    /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13298    /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13299    /// ```
13300    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13301    where
13302        T: std::iter::IntoIterator<Item = V>,
13303        V: std::convert::Into<std::string::String>,
13304    {
13305        use std::iter::Iterator;
13306        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13307        self
13308    }
13309}
13310
13311impl wkt::message::Message for ListGroupsResponse {
13312    fn typename() -> &'static str {
13313        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13314    }
13315}
13316
13317#[doc(hidden)]
13318impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
13319    type PageItem = crate::model::Group;
13320
13321    fn items(self) -> std::vec::Vec<Self::PageItem> {
13322        self.groups
13323    }
13324
13325    fn next_page_token(&self) -> std::string::String {
13326        use std::clone::Clone;
13327        self.next_page_token.clone()
13328    }
13329}
13330
13331/// A collection of Cloud VPN tunnel resources. These resources should be
13332/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13333/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13334/// should be capable of advertising the same prefixes.
13335#[derive(Clone, Default, PartialEq)]
13336#[non_exhaustive]
13337pub struct LinkedVpnTunnels {
13338    /// The URIs of linked VPN tunnel resources.
13339    pub uris: std::vec::Vec<std::string::String>,
13340
13341    /// A value that controls whether site-to-site data transfer is enabled for
13342    /// these resources. Data transfer is available only in [supported
13343    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13344    pub site_to_site_data_transfer: bool,
13345
13346    /// Output only. The VPC network where these VPN tunnels are located.
13347    pub vpc_network: std::string::String,
13348
13349    /// Optional. IP ranges allowed to be included during import from hub (does not
13350    /// control transit connectivity). The only allowed value for now is
13351    /// "ALL_IPV4_RANGES".
13352    pub include_import_ranges: std::vec::Vec<std::string::String>,
13353
13354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13355}
13356
13357impl LinkedVpnTunnels {
13358    /// Creates a new default instance.
13359    pub fn new() -> Self {
13360        std::default::Default::default()
13361    }
13362
13363    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13364    ///
13365    /// # Example
13366    /// ```ignore,no_run
13367    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13368    /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13369    /// ```
13370    pub fn set_uris<T, V>(mut self, v: T) -> Self
13371    where
13372        T: std::iter::IntoIterator<Item = V>,
13373        V: std::convert::Into<std::string::String>,
13374    {
13375        use std::iter::Iterator;
13376        self.uris = v.into_iter().map(|i| i.into()).collect();
13377        self
13378    }
13379
13380    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13381    ///
13382    /// # Example
13383    /// ```ignore,no_run
13384    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13385    /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13386    /// ```
13387    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13388        self.site_to_site_data_transfer = v.into();
13389        self
13390    }
13391
13392    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13393    ///
13394    /// # Example
13395    /// ```ignore,no_run
13396    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13397    /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13398    /// ```
13399    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13400        self.vpc_network = v.into();
13401        self
13402    }
13403
13404    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13405    ///
13406    /// # Example
13407    /// ```ignore,no_run
13408    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13409    /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13410    /// ```
13411    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13412    where
13413        T: std::iter::IntoIterator<Item = V>,
13414        V: std::convert::Into<std::string::String>,
13415    {
13416        use std::iter::Iterator;
13417        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13418        self
13419    }
13420}
13421
13422impl wkt::message::Message for LinkedVpnTunnels {
13423    fn typename() -> &'static str {
13424        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13425    }
13426}
13427
13428/// A collection of VLAN attachment resources. These resources should
13429/// be redundant attachments that all advertise the same prefixes to Google
13430/// Cloud. Alternatively, in active/passive configurations, all attachments
13431/// should be capable of advertising the same prefixes.
13432#[derive(Clone, Default, PartialEq)]
13433#[non_exhaustive]
13434pub struct LinkedInterconnectAttachments {
13435    /// The URIs of linked interconnect attachment resources
13436    pub uris: std::vec::Vec<std::string::String>,
13437
13438    /// A value that controls whether site-to-site data transfer is enabled for
13439    /// these resources. Data transfer is available only in [supported
13440    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13441    pub site_to_site_data_transfer: bool,
13442
13443    /// Output only. The VPC network where these VLAN attachments are located.
13444    pub vpc_network: std::string::String,
13445
13446    /// Optional. IP ranges allowed to be included during import from hub (does not
13447    /// control transit connectivity). The only allowed value for now is
13448    /// "ALL_IPV4_RANGES".
13449    pub include_import_ranges: std::vec::Vec<std::string::String>,
13450
13451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13452}
13453
13454impl LinkedInterconnectAttachments {
13455    /// Creates a new default instance.
13456    pub fn new() -> Self {
13457        std::default::Default::default()
13458    }
13459
13460    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13461    ///
13462    /// # Example
13463    /// ```ignore,no_run
13464    /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13465    /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13466    /// ```
13467    pub fn set_uris<T, V>(mut self, v: T) -> Self
13468    where
13469        T: std::iter::IntoIterator<Item = V>,
13470        V: std::convert::Into<std::string::String>,
13471    {
13472        use std::iter::Iterator;
13473        self.uris = v.into_iter().map(|i| i.into()).collect();
13474        self
13475    }
13476
13477    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13478    ///
13479    /// # Example
13480    /// ```ignore,no_run
13481    /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13482    /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13483    /// ```
13484    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13485        self.site_to_site_data_transfer = v.into();
13486        self
13487    }
13488
13489    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13490    ///
13491    /// # Example
13492    /// ```ignore,no_run
13493    /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13494    /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13495    /// ```
13496    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13497        self.vpc_network = v.into();
13498        self
13499    }
13500
13501    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13502    ///
13503    /// # Example
13504    /// ```ignore,no_run
13505    /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13506    /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13507    /// ```
13508    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13509    where
13510        T: std::iter::IntoIterator<Item = V>,
13511        V: std::convert::Into<std::string::String>,
13512    {
13513        use std::iter::Iterator;
13514        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13515        self
13516    }
13517}
13518
13519impl wkt::message::Message for LinkedInterconnectAttachments {
13520    fn typename() -> &'static str {
13521        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13522    }
13523}
13524
13525/// A collection of router appliance instances. If you configure multiple router
13526/// appliance instances to receive data from the same set of sites outside of
13527/// Google Cloud, we recommend that you associate those instances with the same
13528/// spoke.
13529#[derive(Clone, Default, PartialEq)]
13530#[non_exhaustive]
13531pub struct LinkedRouterApplianceInstances {
13532    /// The list of router appliance instances.
13533    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13534
13535    /// A value that controls whether site-to-site data transfer is enabled for
13536    /// these resources. Data transfer is available only in [supported
13537    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13538    pub site_to_site_data_transfer: bool,
13539
13540    /// Output only. The VPC network where these router appliance instances are
13541    /// located.
13542    pub vpc_network: std::string::String,
13543
13544    /// Optional. IP ranges allowed to be included during import from hub (does not
13545    /// control transit connectivity). The only allowed value for now is
13546    /// "ALL_IPV4_RANGES".
13547    pub include_import_ranges: std::vec::Vec<std::string::String>,
13548
13549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13550}
13551
13552impl LinkedRouterApplianceInstances {
13553    /// Creates a new default instance.
13554    pub fn new() -> Self {
13555        std::default::Default::default()
13556    }
13557
13558    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13559    ///
13560    /// # Example
13561    /// ```ignore,no_run
13562    /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13563    /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13564    /// let x = LinkedRouterApplianceInstances::new()
13565    ///     .set_instances([
13566    ///         RouterApplianceInstance::default()/* use setters */,
13567    ///         RouterApplianceInstance::default()/* use (different) setters */,
13568    ///     ]);
13569    /// ```
13570    pub fn set_instances<T, V>(mut self, v: T) -> Self
13571    where
13572        T: std::iter::IntoIterator<Item = V>,
13573        V: std::convert::Into<crate::model::RouterApplianceInstance>,
13574    {
13575        use std::iter::Iterator;
13576        self.instances = v.into_iter().map(|i| i.into()).collect();
13577        self
13578    }
13579
13580    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13581    ///
13582    /// # Example
13583    /// ```ignore,no_run
13584    /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13585    /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13586    /// ```
13587    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13588        self.site_to_site_data_transfer = v.into();
13589        self
13590    }
13591
13592    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13593    ///
13594    /// # Example
13595    /// ```ignore,no_run
13596    /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13597    /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13598    /// ```
13599    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13600        self.vpc_network = v.into();
13601        self
13602    }
13603
13604    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13605    ///
13606    /// # Example
13607    /// ```ignore,no_run
13608    /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13609    /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13610    /// ```
13611    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13612    where
13613        T: std::iter::IntoIterator<Item = V>,
13614        V: std::convert::Into<std::string::String>,
13615    {
13616        use std::iter::Iterator;
13617        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13618        self
13619    }
13620}
13621
13622impl wkt::message::Message for LinkedRouterApplianceInstances {
13623    fn typename() -> &'static str {
13624        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13625    }
13626}
13627
13628/// An existing VPC network.
13629#[derive(Clone, Default, PartialEq)]
13630#[non_exhaustive]
13631pub struct LinkedVpcNetwork {
13632    /// Required. The URI of the VPC network resource.
13633    pub uri: std::string::String,
13634
13635    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13636    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13637
13638    /// Optional. IP ranges allowed to be included from peering.
13639    pub include_export_ranges: std::vec::Vec<std::string::String>,
13640
13641    /// Optional. The proposed include export IP ranges waiting for hub
13642    /// administration's approval.
13643    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13644
13645    /// Output only. The proposed exclude export IP ranges waiting for hub
13646    /// administration's approval.
13647    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13648
13649    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13650    /// service consumer VPC spoke for. These producer VPCs are connected through
13651    /// VPC peering to this spoke's backing VPC network. Because they are directly
13652    /// connected throuh VPC peering, NCC export filters do not apply between the
13653    /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13654    /// spoke cannot be deleted as long as any of these producer VPC spokes are
13655    /// connected to the NCC Hub.
13656    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13657
13658    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13659}
13660
13661impl LinkedVpcNetwork {
13662    /// Creates a new default instance.
13663    pub fn new() -> Self {
13664        std::default::Default::default()
13665    }
13666
13667    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13668    ///
13669    /// # Example
13670    /// ```ignore,no_run
13671    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13672    /// let x = LinkedVpcNetwork::new().set_uri("example");
13673    /// ```
13674    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13675        self.uri = v.into();
13676        self
13677    }
13678
13679    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13680    ///
13681    /// # Example
13682    /// ```ignore,no_run
13683    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13684    /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13685    /// ```
13686    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13687    where
13688        T: std::iter::IntoIterator<Item = V>,
13689        V: std::convert::Into<std::string::String>,
13690    {
13691        use std::iter::Iterator;
13692        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13693        self
13694    }
13695
13696    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13697    ///
13698    /// # Example
13699    /// ```ignore,no_run
13700    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13701    /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13702    /// ```
13703    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13704    where
13705        T: std::iter::IntoIterator<Item = V>,
13706        V: std::convert::Into<std::string::String>,
13707    {
13708        use std::iter::Iterator;
13709        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13710        self
13711    }
13712
13713    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13714    ///
13715    /// # Example
13716    /// ```ignore,no_run
13717    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13718    /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13719    /// ```
13720    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13721    where
13722        T: std::iter::IntoIterator<Item = V>,
13723        V: std::convert::Into<std::string::String>,
13724    {
13725        use std::iter::Iterator;
13726        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13727        self
13728    }
13729
13730    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13731    ///
13732    /// # Example
13733    /// ```ignore,no_run
13734    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13735    /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13736    /// ```
13737    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13738    where
13739        T: std::iter::IntoIterator<Item = V>,
13740        V: std::convert::Into<std::string::String>,
13741    {
13742        use std::iter::Iterator;
13743        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13744        self
13745    }
13746
13747    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13748    ///
13749    /// # Example
13750    /// ```ignore,no_run
13751    /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13752    /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13753    /// ```
13754    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13755    where
13756        T: std::iter::IntoIterator<Item = V>,
13757        V: std::convert::Into<std::string::String>,
13758    {
13759        use std::iter::Iterator;
13760        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13761        self
13762    }
13763}
13764
13765impl wkt::message::Message for LinkedVpcNetwork {
13766    fn typename() -> &'static str {
13767        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13768    }
13769}
13770
13771#[allow(missing_docs)]
13772#[derive(Clone, Default, PartialEq)]
13773#[non_exhaustive]
13774pub struct LinkedProducerVpcNetwork {
13775    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13776    /// peered with.
13777    pub network: std::string::String,
13778
13779    /// Output only. The Service Consumer Network spoke.
13780    pub service_consumer_vpc_spoke: std::string::String,
13781
13782    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13783    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13784    /// hub. This peering must be in ACTIVE state.
13785    pub peering: std::string::String,
13786
13787    /// Output only. The URI of the Producer VPC.
13788    pub producer_network: std::string::String,
13789
13790    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13791    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13792
13793    /// Optional. IP ranges allowed to be included from peering.
13794    pub include_export_ranges: std::vec::Vec<std::string::String>,
13795
13796    /// Optional. The proposed include export IP ranges waiting for hub
13797    /// administration's approval.
13798    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13799
13800    /// Output only. The proposed exclude export IP ranges waiting for hub
13801    /// administration's approval.
13802    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13803
13804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13805}
13806
13807impl LinkedProducerVpcNetwork {
13808    /// Creates a new default instance.
13809    pub fn new() -> Self {
13810        std::default::Default::default()
13811    }
13812
13813    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13814    ///
13815    /// # Example
13816    /// ```ignore,no_run
13817    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13818    /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13819    /// ```
13820    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13821        self.network = v.into();
13822        self
13823    }
13824
13825    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13826    ///
13827    /// # Example
13828    /// ```ignore,no_run
13829    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13830    /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke("example");
13831    /// ```
13832    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13833        mut self,
13834        v: T,
13835    ) -> Self {
13836        self.service_consumer_vpc_spoke = v.into();
13837        self
13838    }
13839
13840    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13841    ///
13842    /// # Example
13843    /// ```ignore,no_run
13844    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13845    /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13846    /// ```
13847    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13848        self.peering = v.into();
13849        self
13850    }
13851
13852    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
13853    ///
13854    /// # Example
13855    /// ```ignore,no_run
13856    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13857    /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
13858    /// ```
13859    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
13860        mut self,
13861        v: T,
13862    ) -> Self {
13863        self.producer_network = v.into();
13864        self
13865    }
13866
13867    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
13868    ///
13869    /// # Example
13870    /// ```ignore,no_run
13871    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13872    /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13873    /// ```
13874    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13875    where
13876        T: std::iter::IntoIterator<Item = V>,
13877        V: std::convert::Into<std::string::String>,
13878    {
13879        use std::iter::Iterator;
13880        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13881        self
13882    }
13883
13884    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
13885    ///
13886    /// # Example
13887    /// ```ignore,no_run
13888    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13889    /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13890    /// ```
13891    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13892    where
13893        T: std::iter::IntoIterator<Item = V>,
13894        V: std::convert::Into<std::string::String>,
13895    {
13896        use std::iter::Iterator;
13897        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13898        self
13899    }
13900
13901    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
13902    ///
13903    /// # Example
13904    /// ```ignore,no_run
13905    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13906    /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13907    /// ```
13908    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13909    where
13910        T: std::iter::IntoIterator<Item = V>,
13911        V: std::convert::Into<std::string::String>,
13912    {
13913        use std::iter::Iterator;
13914        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13915        self
13916    }
13917
13918    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
13919    ///
13920    /// # Example
13921    /// ```ignore,no_run
13922    /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13923    /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13924    /// ```
13925    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13926    where
13927        T: std::iter::IntoIterator<Item = V>,
13928        V: std::convert::Into<std::string::String>,
13929    {
13930        use std::iter::Iterator;
13931        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13932        self
13933    }
13934}
13935
13936impl wkt::message::Message for LinkedProducerVpcNetwork {
13937    fn typename() -> &'static str {
13938        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
13939    }
13940}
13941
13942/// A router appliance instance is a Compute Engine virtual machine (VM) instance
13943/// that acts as a BGP speaker. A router appliance instance is specified by the
13944/// URI of the VM and the internal IP address of one of the VM's network
13945/// interfaces.
13946#[derive(Clone, Default, PartialEq)]
13947#[non_exhaustive]
13948pub struct RouterApplianceInstance {
13949    /// The URI of the VM.
13950    pub virtual_machine: std::string::String,
13951
13952    /// The IP address on the VM to use for peering.
13953    pub ip_address: std::string::String,
13954
13955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13956}
13957
13958impl RouterApplianceInstance {
13959    /// Creates a new default instance.
13960    pub fn new() -> Self {
13961        std::default::Default::default()
13962    }
13963
13964    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
13965    ///
13966    /// # Example
13967    /// ```ignore,no_run
13968    /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13969    /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
13970    /// ```
13971    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13972        self.virtual_machine = v.into();
13973        self
13974    }
13975
13976    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
13977    ///
13978    /// # Example
13979    /// ```ignore,no_run
13980    /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13981    /// let x = RouterApplianceInstance::new().set_ip_address("example");
13982    /// ```
13983    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13984        self.ip_address = v.into();
13985        self
13986    }
13987}
13988
13989impl wkt::message::Message for RouterApplianceInstance {
13990    fn typename() -> &'static str {
13991        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
13992    }
13993}
13994
13995/// Metadata about locations
13996#[derive(Clone, Default, PartialEq)]
13997#[non_exhaustive]
13998pub struct LocationMetadata {
13999    /// List of supported features
14000    pub location_features: std::vec::Vec<crate::model::LocationFeature>,
14001
14002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14003}
14004
14005impl LocationMetadata {
14006    /// Creates a new default instance.
14007    pub fn new() -> Self {
14008        std::default::Default::default()
14009    }
14010
14011    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
14012    ///
14013    /// # Example
14014    /// ```ignore,no_run
14015    /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
14016    /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
14017    /// let x = LocationMetadata::new().set_location_features([
14018    ///     LocationFeature::SiteToCloudSpokes,
14019    ///     LocationFeature::SiteToSiteSpokes,
14020    /// ]);
14021    /// ```
14022    pub fn set_location_features<T, V>(mut self, v: T) -> Self
14023    where
14024        T: std::iter::IntoIterator<Item = V>,
14025        V: std::convert::Into<crate::model::LocationFeature>,
14026    {
14027        use std::iter::Iterator;
14028        self.location_features = v.into_iter().map(|i| i.into()).collect();
14029        self
14030    }
14031}
14032
14033impl wkt::message::Message for LocationMetadata {
14034    fn typename() -> &'static str {
14035        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
14036    }
14037}
14038
14039#[allow(missing_docs)]
14040#[derive(Clone, Default, PartialEq)]
14041#[non_exhaustive]
14042pub struct NextHopVpcNetwork {
14043    /// The URI of the VPC network resource
14044    pub uri: std::string::String,
14045
14046    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14047}
14048
14049impl NextHopVpcNetwork {
14050    /// Creates a new default instance.
14051    pub fn new() -> Self {
14052        std::default::Default::default()
14053    }
14054
14055    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
14056    ///
14057    /// # Example
14058    /// ```ignore,no_run
14059    /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
14060    /// let x = NextHopVpcNetwork::new().set_uri("example");
14061    /// ```
14062    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14063        self.uri = v.into();
14064        self
14065    }
14066}
14067
14068impl wkt::message::Message for NextHopVpcNetwork {
14069    fn typename() -> &'static str {
14070        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
14071    }
14072}
14073
14074/// A route next hop that leads to a VPN tunnel resource.
14075#[derive(Clone, Default, PartialEq)]
14076#[non_exhaustive]
14077pub struct NextHopVPNTunnel {
14078    /// The URI of the VPN tunnel resource.
14079    pub uri: std::string::String,
14080
14081    /// The VPC network where this VPN tunnel is located.
14082    pub vpc_network: std::string::String,
14083
14084    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
14085    /// resource. Data transfer is available only in [supported
14086    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14087    pub site_to_site_data_transfer: bool,
14088
14089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14090}
14091
14092impl NextHopVPNTunnel {
14093    /// Creates a new default instance.
14094    pub fn new() -> Self {
14095        std::default::Default::default()
14096    }
14097
14098    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
14099    ///
14100    /// # Example
14101    /// ```ignore,no_run
14102    /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14103    /// let x = NextHopVPNTunnel::new().set_uri("example");
14104    /// ```
14105    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14106        self.uri = v.into();
14107        self
14108    }
14109
14110    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
14111    ///
14112    /// # Example
14113    /// ```ignore,no_run
14114    /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14115    /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14116    /// ```
14117    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14118        self.vpc_network = v.into();
14119        self
14120    }
14121
14122    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14123    ///
14124    /// # Example
14125    /// ```ignore,no_run
14126    /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14127    /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14128    /// ```
14129    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14130        self.site_to_site_data_transfer = v.into();
14131        self
14132    }
14133}
14134
14135impl wkt::message::Message for NextHopVPNTunnel {
14136    fn typename() -> &'static str {
14137        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14138    }
14139}
14140
14141/// A route next hop that leads to a Router appliance instance.
14142#[derive(Clone, Default, PartialEq)]
14143#[non_exhaustive]
14144pub struct NextHopRouterApplianceInstance {
14145    /// The URI of the Router appliance instance.
14146    pub uri: std::string::String,
14147
14148    /// The VPC network where this VM is located.
14149    pub vpc_network: std::string::String,
14150
14151    /// Indicates whether site-to-site data transfer is allowed for this Router
14152    /// appliance instance resource. Data transfer is available only in [supported
14153    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14154    pub site_to_site_data_transfer: bool,
14155
14156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14157}
14158
14159impl NextHopRouterApplianceInstance {
14160    /// Creates a new default instance.
14161    pub fn new() -> Self {
14162        std::default::Default::default()
14163    }
14164
14165    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14166    ///
14167    /// # Example
14168    /// ```ignore,no_run
14169    /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14170    /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14171    /// ```
14172    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14173        self.uri = v.into();
14174        self
14175    }
14176
14177    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14178    ///
14179    /// # Example
14180    /// ```ignore,no_run
14181    /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14182    /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14183    /// ```
14184    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14185        self.vpc_network = v.into();
14186        self
14187    }
14188
14189    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14190    ///
14191    /// # Example
14192    /// ```ignore,no_run
14193    /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14194    /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14195    /// ```
14196    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14197        self.site_to_site_data_transfer = v.into();
14198        self
14199    }
14200}
14201
14202impl wkt::message::Message for NextHopRouterApplianceInstance {
14203    fn typename() -> &'static str {
14204        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14205    }
14206}
14207
14208/// A route next hop that leads to an interconnect attachment resource.
14209#[derive(Clone, Default, PartialEq)]
14210#[non_exhaustive]
14211pub struct NextHopInterconnectAttachment {
14212    /// The URI of the interconnect attachment resource.
14213    pub uri: std::string::String,
14214
14215    /// The VPC network where this interconnect attachment is located.
14216    pub vpc_network: std::string::String,
14217
14218    /// Indicates whether site-to-site data transfer is allowed for this
14219    /// interconnect attachment resource. Data transfer is available only in
14220    /// [supported
14221    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14222    pub site_to_site_data_transfer: bool,
14223
14224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14225}
14226
14227impl NextHopInterconnectAttachment {
14228    /// Creates a new default instance.
14229    pub fn new() -> Self {
14230        std::default::Default::default()
14231    }
14232
14233    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14234    ///
14235    /// # Example
14236    /// ```ignore,no_run
14237    /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14238    /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14239    /// ```
14240    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14241        self.uri = v.into();
14242        self
14243    }
14244
14245    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14246    ///
14247    /// # Example
14248    /// ```ignore,no_run
14249    /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14250    /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14251    /// ```
14252    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14253        self.vpc_network = v.into();
14254        self
14255    }
14256
14257    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14258    ///
14259    /// # Example
14260    /// ```ignore,no_run
14261    /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14262    /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14263    /// ```
14264    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14265        self.site_to_site_data_transfer = v.into();
14266        self
14267    }
14268}
14269
14270impl wkt::message::Message for NextHopInterconnectAttachment {
14271    fn typename() -> &'static str {
14272        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14273    }
14274}
14275
14276/// Summarizes information about the spokes associated with a hub.
14277/// The summary includes a count of spokes according to type
14278/// and according to state. If any spokes are inactive,
14279/// the summary also lists the reasons they are inactive,
14280/// including a count for each reason.
14281#[derive(Clone, Default, PartialEq)]
14282#[non_exhaustive]
14283pub struct SpokeSummary {
14284    /// Output only. Counts the number of spokes of each type that are
14285    /// associated with a specific hub.
14286    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14287
14288    /// Output only. Counts the number of spokes that are in each state
14289    /// and associated with a given hub.
14290    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14291
14292    /// Output only. Counts the number of spokes that are inactive for each
14293    /// possible reason and associated with a given hub.
14294    pub spoke_state_reason_counts:
14295        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14296
14297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14298}
14299
14300impl SpokeSummary {
14301    /// Creates a new default instance.
14302    pub fn new() -> Self {
14303        std::default::Default::default()
14304    }
14305
14306    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14307    ///
14308    /// # Example
14309    /// ```ignore,no_run
14310    /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14311    /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14312    /// let x = SpokeSummary::new()
14313    ///     .set_spoke_type_counts([
14314    ///         SpokeTypeCount::default()/* use setters */,
14315    ///         SpokeTypeCount::default()/* use (different) setters */,
14316    ///     ]);
14317    /// ```
14318    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14319    where
14320        T: std::iter::IntoIterator<Item = V>,
14321        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14322    {
14323        use std::iter::Iterator;
14324        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14325        self
14326    }
14327
14328    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14329    ///
14330    /// # Example
14331    /// ```ignore,no_run
14332    /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14333    /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14334    /// let x = SpokeSummary::new()
14335    ///     .set_spoke_state_counts([
14336    ///         SpokeStateCount::default()/* use setters */,
14337    ///         SpokeStateCount::default()/* use (different) setters */,
14338    ///     ]);
14339    /// ```
14340    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14341    where
14342        T: std::iter::IntoIterator<Item = V>,
14343        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14344    {
14345        use std::iter::Iterator;
14346        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14347        self
14348    }
14349
14350    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14351    ///
14352    /// # Example
14353    /// ```ignore,no_run
14354    /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14355    /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14356    /// let x = SpokeSummary::new()
14357    ///     .set_spoke_state_reason_counts([
14358    ///         SpokeStateReasonCount::default()/* use setters */,
14359    ///         SpokeStateReasonCount::default()/* use (different) setters */,
14360    ///     ]);
14361    /// ```
14362    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14363    where
14364        T: std::iter::IntoIterator<Item = V>,
14365        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14366    {
14367        use std::iter::Iterator;
14368        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14369        self
14370    }
14371}
14372
14373impl wkt::message::Message for SpokeSummary {
14374    fn typename() -> &'static str {
14375        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14376    }
14377}
14378
14379/// Defines additional types related to [SpokeSummary].
14380pub mod spoke_summary {
14381    #[allow(unused_imports)]
14382    use super::*;
14383
14384    /// The number of spokes of a given type that are associated
14385    /// with a specific hub. The type indicates what kind of
14386    /// resource is associated with the spoke.
14387    #[derive(Clone, Default, PartialEq)]
14388    #[non_exhaustive]
14389    pub struct SpokeTypeCount {
14390        /// Output only. The type of the spokes.
14391        pub spoke_type: crate::model::SpokeType,
14392
14393        /// Output only. The total number of spokes of this type that are
14394        /// associated with the hub.
14395        pub count: i64,
14396
14397        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14398    }
14399
14400    impl SpokeTypeCount {
14401        /// Creates a new default instance.
14402        pub fn new() -> Self {
14403            std::default::Default::default()
14404        }
14405
14406        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14407        ///
14408        /// # Example
14409        /// ```ignore,no_run
14410        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14411        /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14412        /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14413        /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14414        /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14415        /// ```
14416        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14417            mut self,
14418            v: T,
14419        ) -> Self {
14420            self.spoke_type = v.into();
14421            self
14422        }
14423
14424        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14425        ///
14426        /// # Example
14427        /// ```ignore,no_run
14428        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14429        /// let x = SpokeTypeCount::new().set_count(42);
14430        /// ```
14431        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14432            self.count = v.into();
14433            self
14434        }
14435    }
14436
14437    impl wkt::message::Message for SpokeTypeCount {
14438        fn typename() -> &'static str {
14439            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14440        }
14441    }
14442
14443    /// The number of spokes that are in a particular state
14444    /// and associated with a given hub.
14445    #[derive(Clone, Default, PartialEq)]
14446    #[non_exhaustive]
14447    pub struct SpokeStateCount {
14448        /// Output only. The state of the spokes.
14449        pub state: crate::model::State,
14450
14451        /// Output only. The total number of spokes that are in this state
14452        /// and associated with a given hub.
14453        pub count: i64,
14454
14455        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14456    }
14457
14458    impl SpokeStateCount {
14459        /// Creates a new default instance.
14460        pub fn new() -> Self {
14461            std::default::Default::default()
14462        }
14463
14464        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14465        ///
14466        /// # Example
14467        /// ```ignore,no_run
14468        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14469        /// use google_cloud_networkconnectivity_v1::model::State;
14470        /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14471        /// let x1 = SpokeStateCount::new().set_state(State::Active);
14472        /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14473        /// ```
14474        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14475            self.state = v.into();
14476            self
14477        }
14478
14479        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14480        ///
14481        /// # Example
14482        /// ```ignore,no_run
14483        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14484        /// let x = SpokeStateCount::new().set_count(42);
14485        /// ```
14486        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14487            self.count = v.into();
14488            self
14489        }
14490    }
14491
14492    impl wkt::message::Message for SpokeStateCount {
14493        fn typename() -> &'static str {
14494            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14495        }
14496    }
14497
14498    /// The number of spokes in the hub that are inactive for this reason.
14499    #[derive(Clone, Default, PartialEq)]
14500    #[non_exhaustive]
14501    pub struct SpokeStateReasonCount {
14502        /// Output only. The reason that a spoke is inactive.
14503        pub state_reason_code: crate::model::spoke::state_reason::Code,
14504
14505        /// Output only. The total number of spokes that are inactive for a
14506        /// particular reason and associated with a given hub.
14507        pub count: i64,
14508
14509        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14510    }
14511
14512    impl SpokeStateReasonCount {
14513        /// Creates a new default instance.
14514        pub fn new() -> Self {
14515            std::default::Default::default()
14516        }
14517
14518        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14519        ///
14520        /// # Example
14521        /// ```ignore,no_run
14522        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14523        /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14524        /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14525        /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14526        /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14527        /// ```
14528        pub fn set_state_reason_code<
14529            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14530        >(
14531            mut self,
14532            v: T,
14533        ) -> Self {
14534            self.state_reason_code = v.into();
14535            self
14536        }
14537
14538        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14539        ///
14540        /// # Example
14541        /// ```ignore,no_run
14542        /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14543        /// let x = SpokeStateReasonCount::new().set_count(42);
14544        /// ```
14545        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14546            self.count = v.into();
14547            self
14548        }
14549    }
14550
14551    impl wkt::message::Message for SpokeStateReasonCount {
14552        fn typename() -> &'static str {
14553            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14554        }
14555    }
14556}
14557
14558/// The request for
14559/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14560///
14561/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14562#[derive(Clone, Default, PartialEq)]
14563#[non_exhaustive]
14564pub struct GetGroupRequest {
14565    /// Required. The name of the route table resource.
14566    pub name: std::string::String,
14567
14568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14569}
14570
14571impl GetGroupRequest {
14572    /// Creates a new default instance.
14573    pub fn new() -> Self {
14574        std::default::Default::default()
14575    }
14576
14577    /// Sets the value of [name][crate::model::GetGroupRequest::name].
14578    ///
14579    /// # Example
14580    /// ```ignore,no_run
14581    /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14582    /// let x = GetGroupRequest::new().set_name("example");
14583    /// ```
14584    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14585        self.name = v.into();
14586        self
14587    }
14588}
14589
14590impl wkt::message::Message for GetGroupRequest {
14591    fn typename() -> &'static str {
14592        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14593    }
14594}
14595
14596/// Request for
14597/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14598/// method.
14599///
14600/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14601#[derive(Clone, Default, PartialEq)]
14602#[non_exhaustive]
14603pub struct UpdateGroupRequest {
14604    /// Optional. In the case of an update to an existing group, field mask is used
14605    /// to specify the fields to be overwritten. The fields specified in the
14606    /// update_mask are relative to the resource, not the full request. A field is
14607    /// overwritten if it is in the mask. If the user does not provide a mask, then
14608    /// all fields are overwritten.
14609    pub update_mask: std::option::Option<wkt::FieldMask>,
14610
14611    /// Required. The state that the group should be in after the update.
14612    pub group: std::option::Option<crate::model::Group>,
14613
14614    /// Optional. A request ID to identify requests. Specify a unique request ID so
14615    /// that if you must retry your request, the server knows to ignore the request
14616    /// if it has already been completed. The server guarantees that a request
14617    /// doesn't result in creation of duplicate commitments for at least 60
14618    /// minutes.
14619    ///
14620    /// For example, consider a situation where you make an initial request and
14621    /// the request times out. If you make the request again with the same request
14622    /// ID, the server can check to see whether the original operation
14623    /// was received. If it was, the server ignores the second request. This
14624    /// behavior prevents clients from mistakenly creating duplicate commitments.
14625    ///
14626    /// The request ID must be a valid UUID, with the exception that zero UUID is
14627    /// not supported (00000000-0000-0000-0000-000000000000).
14628    pub request_id: std::string::String,
14629
14630    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14631}
14632
14633impl UpdateGroupRequest {
14634    /// Creates a new default instance.
14635    pub fn new() -> Self {
14636        std::default::Default::default()
14637    }
14638
14639    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14640    ///
14641    /// # Example
14642    /// ```ignore,no_run
14643    /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14644    /// use wkt::FieldMask;
14645    /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14646    /// ```
14647    pub fn set_update_mask<T>(mut self, v: T) -> Self
14648    where
14649        T: std::convert::Into<wkt::FieldMask>,
14650    {
14651        self.update_mask = std::option::Option::Some(v.into());
14652        self
14653    }
14654
14655    /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14656    ///
14657    /// # Example
14658    /// ```ignore,no_run
14659    /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14660    /// use wkt::FieldMask;
14661    /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14662    /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14663    /// ```
14664    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14665    where
14666        T: std::convert::Into<wkt::FieldMask>,
14667    {
14668        self.update_mask = v.map(|x| x.into());
14669        self
14670    }
14671
14672    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14673    ///
14674    /// # Example
14675    /// ```ignore,no_run
14676    /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14677    /// use google_cloud_networkconnectivity_v1::model::Group;
14678    /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14679    /// ```
14680    pub fn set_group<T>(mut self, v: T) -> Self
14681    where
14682        T: std::convert::Into<crate::model::Group>,
14683    {
14684        self.group = std::option::Option::Some(v.into());
14685        self
14686    }
14687
14688    /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14689    ///
14690    /// # Example
14691    /// ```ignore,no_run
14692    /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14693    /// use google_cloud_networkconnectivity_v1::model::Group;
14694    /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14695    /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14696    /// ```
14697    pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14698    where
14699        T: std::convert::Into<crate::model::Group>,
14700    {
14701        self.group = v.map(|x| x.into());
14702        self
14703    }
14704
14705    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14706    ///
14707    /// # Example
14708    /// ```ignore,no_run
14709    /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14710    /// let x = UpdateGroupRequest::new().set_request_id("example");
14711    /// ```
14712    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14713        self.request_id = v.into();
14714        self
14715    }
14716}
14717
14718impl wkt::message::Message for UpdateGroupRequest {
14719    fn typename() -> &'static str {
14720        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14721    }
14722}
14723
14724/// The internal range resource for IPAM operations within a VPC network.
14725/// Used to represent a private address range along with behavioral
14726/// characteristics of that range (its usage and peering behavior).
14727/// Networking resources can link to this range if they are created
14728/// as belonging to it.
14729#[derive(Clone, Default, PartialEq)]
14730#[non_exhaustive]
14731pub struct InternalRange {
14732    /// Identifier. The name of an internal range.
14733    /// Format:
14734    /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14735    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14736    pub name: std::string::String,
14737
14738    /// Output only. Time when the internal range was created.
14739    pub create_time: std::option::Option<wkt::Timestamp>,
14740
14741    /// Output only. Time when the internal range was updated.
14742    pub update_time: std::option::Option<wkt::Timestamp>,
14743
14744    /// User-defined labels.
14745    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14746
14747    /// Optional. A description of this resource.
14748    pub description: std::string::String,
14749
14750    /// Optional. The IP range that this internal range defines.
14751    /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14752    /// peering=FOR_SELF.
14753    /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14754    /// be specified explicitly.
14755    pub ip_cidr_range: std::string::String,
14756
14757    /// Immutable. The URL or resource ID of the network in which to reserve the
14758    /// internal range. The network cannot be deleted if there are any reserved
14759    /// internal ranges referring to it. Legacy networks are not supported. For
14760    /// example:
14761    /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14762    /// projects/{project}/locations/global/networks/{network}
14763    /// {network}
14764    pub network: std::string::String,
14765
14766    /// Optional. The type of usage set for this InternalRange.
14767    pub usage: crate::model::internal_range::Usage,
14768
14769    /// Optional. The type of peering set for this internal range.
14770    pub peering: crate::model::internal_range::Peering,
14771
14772    /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14773    /// an IPv4 reservation that automatically finds a free range of the given
14774    /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14775    /// the range sizes do not match. Can also be used during updates to change the
14776    /// range size.
14777    /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14778    /// both fields must match. In other words, with IPv6 this field only works as
14779    /// a redundant parameter.
14780    pub prefix_length: i32,
14781
14782    /// Optional. Can be set to narrow down or pick a different address space while
14783    /// searching for a free range. If not set, defaults to the ["10.0.0.0/8",
14784    /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14785    /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14786    /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14787    /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14788    pub target_cidr_range: std::vec::Vec<std::string::String>,
14789
14790    /// Output only. The list of resources that refer to this internal range.
14791    /// Resources that use the internal range for their range allocation
14792    /// are referred to as users of the range. Other resources mark themselves
14793    /// as users while doing so by creating a reference to this internal range.
14794    /// Having a user, based on this reference, prevents deletion of the
14795    /// internal range referred to. Can be empty.
14796    pub users: std::vec::Vec<std::string::String>,
14797
14798    /// Optional. Types of resources that are allowed to overlap with the current
14799    /// internal range.
14800    pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14801
14802    /// Optional. Must be present if usage is set to FOR_MIGRATION.
14803    pub migration: std::option::Option<crate::model::internal_range::Migration>,
14804
14805    /// Optional. Immutable ranges cannot have their fields modified, except for
14806    /// labels and description.
14807    pub immutable: bool,
14808
14809    /// Optional. Range auto-allocation options, may be set only when
14810    /// auto-allocation is selected by not setting ip_cidr_range (and setting
14811    /// prefix_length).
14812    pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14813
14814    /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14815    /// allows exclusion of particular CIDR ranges from the auto-allocation
14816    /// process, without having to reserve these blocks
14817    pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14818
14819    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14820}
14821
14822impl InternalRange {
14823    /// Creates a new default instance.
14824    pub fn new() -> Self {
14825        std::default::Default::default()
14826    }
14827
14828    /// Sets the value of [name][crate::model::InternalRange::name].
14829    ///
14830    /// # Example
14831    /// ```ignore,no_run
14832    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14833    /// let x = InternalRange::new().set_name("example");
14834    /// ```
14835    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14836        self.name = v.into();
14837        self
14838    }
14839
14840    /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14841    ///
14842    /// # Example
14843    /// ```ignore,no_run
14844    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14845    /// use wkt::Timestamp;
14846    /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
14847    /// ```
14848    pub fn set_create_time<T>(mut self, v: T) -> Self
14849    where
14850        T: std::convert::Into<wkt::Timestamp>,
14851    {
14852        self.create_time = std::option::Option::Some(v.into());
14853        self
14854    }
14855
14856    /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
14857    ///
14858    /// # Example
14859    /// ```ignore,no_run
14860    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14861    /// use wkt::Timestamp;
14862    /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14863    /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
14864    /// ```
14865    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14866    where
14867        T: std::convert::Into<wkt::Timestamp>,
14868    {
14869        self.create_time = v.map(|x| x.into());
14870        self
14871    }
14872
14873    /// Sets the value of [update_time][crate::model::InternalRange::update_time].
14874    ///
14875    /// # Example
14876    /// ```ignore,no_run
14877    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14878    /// use wkt::Timestamp;
14879    /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
14880    /// ```
14881    pub fn set_update_time<T>(mut self, v: T) -> Self
14882    where
14883        T: std::convert::Into<wkt::Timestamp>,
14884    {
14885        self.update_time = std::option::Option::Some(v.into());
14886        self
14887    }
14888
14889    /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
14890    ///
14891    /// # Example
14892    /// ```ignore,no_run
14893    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14894    /// use wkt::Timestamp;
14895    /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14896    /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
14897    /// ```
14898    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14899    where
14900        T: std::convert::Into<wkt::Timestamp>,
14901    {
14902        self.update_time = v.map(|x| x.into());
14903        self
14904    }
14905
14906    /// Sets the value of [labels][crate::model::InternalRange::labels].
14907    ///
14908    /// # Example
14909    /// ```ignore,no_run
14910    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14911    /// let x = InternalRange::new().set_labels([
14912    ///     ("key0", "abc"),
14913    ///     ("key1", "xyz"),
14914    /// ]);
14915    /// ```
14916    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14917    where
14918        T: std::iter::IntoIterator<Item = (K, V)>,
14919        K: std::convert::Into<std::string::String>,
14920        V: std::convert::Into<std::string::String>,
14921    {
14922        use std::iter::Iterator;
14923        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14924        self
14925    }
14926
14927    /// Sets the value of [description][crate::model::InternalRange::description].
14928    ///
14929    /// # Example
14930    /// ```ignore,no_run
14931    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14932    /// let x = InternalRange::new().set_description("example");
14933    /// ```
14934    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14935        self.description = v.into();
14936        self
14937    }
14938
14939    /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
14940    ///
14941    /// # Example
14942    /// ```ignore,no_run
14943    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14944    /// let x = InternalRange::new().set_ip_cidr_range("example");
14945    /// ```
14946    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14947        self.ip_cidr_range = v.into();
14948        self
14949    }
14950
14951    /// Sets the value of [network][crate::model::InternalRange::network].
14952    ///
14953    /// # Example
14954    /// ```ignore,no_run
14955    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14956    /// let x = InternalRange::new().set_network("example");
14957    /// ```
14958    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14959        self.network = v.into();
14960        self
14961    }
14962
14963    /// Sets the value of [usage][crate::model::InternalRange::usage].
14964    ///
14965    /// # Example
14966    /// ```ignore,no_run
14967    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14968    /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
14969    /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
14970    /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
14971    /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
14972    /// ```
14973    pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
14974        mut self,
14975        v: T,
14976    ) -> Self {
14977        self.usage = v.into();
14978        self
14979    }
14980
14981    /// Sets the value of [peering][crate::model::InternalRange::peering].
14982    ///
14983    /// # Example
14984    /// ```ignore,no_run
14985    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14986    /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
14987    /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
14988    /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
14989    /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
14990    /// ```
14991    pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
14992        mut self,
14993        v: T,
14994    ) -> Self {
14995        self.peering = v.into();
14996        self
14997    }
14998
14999    /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
15000    ///
15001    /// # Example
15002    /// ```ignore,no_run
15003    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15004    /// let x = InternalRange::new().set_prefix_length(42);
15005    /// ```
15006    pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15007        self.prefix_length = v.into();
15008        self
15009    }
15010
15011    /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
15012    ///
15013    /// # Example
15014    /// ```ignore,no_run
15015    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15016    /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
15017    /// ```
15018    pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
15019    where
15020        T: std::iter::IntoIterator<Item = V>,
15021        V: std::convert::Into<std::string::String>,
15022    {
15023        use std::iter::Iterator;
15024        self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
15025        self
15026    }
15027
15028    /// Sets the value of [users][crate::model::InternalRange::users].
15029    ///
15030    /// # Example
15031    /// ```ignore,no_run
15032    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15033    /// let x = InternalRange::new().set_users(["a", "b", "c"]);
15034    /// ```
15035    pub fn set_users<T, V>(mut self, v: T) -> Self
15036    where
15037        T: std::iter::IntoIterator<Item = V>,
15038        V: std::convert::Into<std::string::String>,
15039    {
15040        use std::iter::Iterator;
15041        self.users = v.into_iter().map(|i| i.into()).collect();
15042        self
15043    }
15044
15045    /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
15046    ///
15047    /// # Example
15048    /// ```ignore,no_run
15049    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15050    /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
15051    /// let x = InternalRange::new().set_overlaps([
15052    ///     Overlap::RouteRange,
15053    ///     Overlap::ExistingSubnetRange,
15054    /// ]);
15055    /// ```
15056    pub fn set_overlaps<T, V>(mut self, v: T) -> Self
15057    where
15058        T: std::iter::IntoIterator<Item = V>,
15059        V: std::convert::Into<crate::model::internal_range::Overlap>,
15060    {
15061        use std::iter::Iterator;
15062        self.overlaps = v.into_iter().map(|i| i.into()).collect();
15063        self
15064    }
15065
15066    /// Sets the value of [migration][crate::model::InternalRange::migration].
15067    ///
15068    /// # Example
15069    /// ```ignore,no_run
15070    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15071    /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15072    /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
15073    /// ```
15074    pub fn set_migration<T>(mut self, v: T) -> Self
15075    where
15076        T: std::convert::Into<crate::model::internal_range::Migration>,
15077    {
15078        self.migration = std::option::Option::Some(v.into());
15079        self
15080    }
15081
15082    /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
15083    ///
15084    /// # Example
15085    /// ```ignore,no_run
15086    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15087    /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15088    /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
15089    /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
15090    /// ```
15091    pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
15092    where
15093        T: std::convert::Into<crate::model::internal_range::Migration>,
15094    {
15095        self.migration = v.map(|x| x.into());
15096        self
15097    }
15098
15099    /// Sets the value of [immutable][crate::model::InternalRange::immutable].
15100    ///
15101    /// # Example
15102    /// ```ignore,no_run
15103    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15104    /// let x = InternalRange::new().set_immutable(true);
15105    /// ```
15106    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15107        self.immutable = v.into();
15108        self
15109    }
15110
15111    /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
15112    ///
15113    /// # Example
15114    /// ```ignore,no_run
15115    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15116    /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15117    /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
15118    /// ```
15119    pub fn set_allocation_options<T>(mut self, v: T) -> Self
15120    where
15121        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15122    {
15123        self.allocation_options = std::option::Option::Some(v.into());
15124        self
15125    }
15126
15127    /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15128    ///
15129    /// # Example
15130    /// ```ignore,no_run
15131    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15132    /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15133    /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15134    /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15135    /// ```
15136    pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15137    where
15138        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15139    {
15140        self.allocation_options = v.map(|x| x.into());
15141        self
15142    }
15143
15144    /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15145    ///
15146    /// # Example
15147    /// ```ignore,no_run
15148    /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15149    /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15150    /// ```
15151    pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15152    where
15153        T: std::iter::IntoIterator<Item = V>,
15154        V: std::convert::Into<std::string::String>,
15155    {
15156        use std::iter::Iterator;
15157        self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15158        self
15159    }
15160}
15161
15162impl wkt::message::Message for InternalRange {
15163    fn typename() -> &'static str {
15164        "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15165    }
15166}
15167
15168/// Defines additional types related to [InternalRange].
15169pub mod internal_range {
15170    #[allow(unused_imports)]
15171    use super::*;
15172
15173    /// Specification for migration with source and target resource names.
15174    #[derive(Clone, Default, PartialEq)]
15175    #[non_exhaustive]
15176    pub struct Migration {
15177        /// Immutable. Resource path as an URI of the source resource, for example a
15178        /// subnet. The project for the source resource should match the project for
15179        /// the InternalRange. An example:
15180        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15181        pub source: std::string::String,
15182
15183        /// Immutable. Resource path of the target resource. The target project can
15184        /// be different, as in the cases when migrating to peer networks. For
15185        /// example:
15186        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15187        pub target: std::string::String,
15188
15189        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15190    }
15191
15192    impl Migration {
15193        /// Creates a new default instance.
15194        pub fn new() -> Self {
15195            std::default::Default::default()
15196        }
15197
15198        /// Sets the value of [source][crate::model::internal_range::Migration::source].
15199        ///
15200        /// # Example
15201        /// ```ignore,no_run
15202        /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15203        /// let x = Migration::new().set_source("example");
15204        /// ```
15205        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15206            self.source = v.into();
15207            self
15208        }
15209
15210        /// Sets the value of [target][crate::model::internal_range::Migration::target].
15211        ///
15212        /// # Example
15213        /// ```ignore,no_run
15214        /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15215        /// let x = Migration::new().set_target("example");
15216        /// ```
15217        pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15218            self.target = v.into();
15219            self
15220        }
15221    }
15222
15223    impl wkt::message::Message for Migration {
15224        fn typename() -> &'static str {
15225            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15226        }
15227    }
15228
15229    /// Range auto-allocation options, to be optionally used when CIDR block is not
15230    /// explicitly set.
15231    #[derive(Clone, Default, PartialEq)]
15232    #[non_exhaustive]
15233    pub struct AllocationOptions {
15234        /// Optional. Allocation strategy Not setting this field when the allocation
15235        /// is requested means an implementation defined strategy is used.
15236        pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15237
15238        /// Optional. This field must be set only when allocation_strategy is set to
15239        /// RANDOM_FIRST_N_AVAILABLE.
15240        /// The value should be the maximum expected parallelism of range creation
15241        /// requests issued to the same space of peered netwroks.
15242        pub first_available_ranges_lookup_size: i32,
15243
15244        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15245    }
15246
15247    impl AllocationOptions {
15248        /// Creates a new default instance.
15249        pub fn new() -> Self {
15250            std::default::Default::default()
15251        }
15252
15253        /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15254        ///
15255        /// # Example
15256        /// ```ignore,no_run
15257        /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15258        /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15259        /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15260        /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15261        /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15262        /// ```
15263        pub fn set_allocation_strategy<
15264            T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15265        >(
15266            mut self,
15267            v: T,
15268        ) -> Self {
15269            self.allocation_strategy = v.into();
15270            self
15271        }
15272
15273        /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15274        ///
15275        /// # Example
15276        /// ```ignore,no_run
15277        /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15278        /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15279        /// ```
15280        pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15281            mut self,
15282            v: T,
15283        ) -> Self {
15284            self.first_available_ranges_lookup_size = v.into();
15285            self
15286        }
15287    }
15288
15289    impl wkt::message::Message for AllocationOptions {
15290        fn typename() -> &'static str {
15291            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15292        }
15293    }
15294
15295    /// Possible usage of an internal range.
15296    ///
15297    /// # Working with unknown values
15298    ///
15299    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15300    /// additional enum variants at any time. Adding new variants is not considered
15301    /// a breaking change. Applications should write their code in anticipation of:
15302    ///
15303    /// - New values appearing in future releases of the client library, **and**
15304    /// - New values received dynamically, without application changes.
15305    ///
15306    /// Please consult the [Working with enums] section in the user guide for some
15307    /// guidelines.
15308    ///
15309    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15310    #[derive(Clone, Debug, PartialEq)]
15311    #[non_exhaustive]
15312    pub enum Usage {
15313        /// Unspecified usage is allowed in calls which identify the resource by
15314        /// other fields and do not need Usage set to complete. These are, i.e.:
15315        /// GetInternalRange and DeleteInternalRange.
15316        /// Usage needs to be specified explicitly in CreateInternalRange
15317        /// or UpdateInternalRange calls.
15318        Unspecified,
15319        /// A VPC resource can use the reserved CIDR block by associating it with the
15320        /// internal range resource if usage is set to FOR_VPC.
15321        ForVpc,
15322        /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15323        /// resources and are meant to block out address ranges for various use
15324        /// cases, like for example, usage on-prem, with dynamic route announcements
15325        /// via interconnect.
15326        ExternalToVpc,
15327        /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15328        /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15329        /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15330        ForMigration,
15331        /// If set, the enum was initialized with an unknown value.
15332        ///
15333        /// Applications can examine the value using [Usage::value] or
15334        /// [Usage::name].
15335        UnknownValue(usage::UnknownValue),
15336    }
15337
15338    #[doc(hidden)]
15339    pub mod usage {
15340        #[allow(unused_imports)]
15341        use super::*;
15342        #[derive(Clone, Debug, PartialEq)]
15343        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15344    }
15345
15346    impl Usage {
15347        /// Gets the enum value.
15348        ///
15349        /// Returns `None` if the enum contains an unknown value deserialized from
15350        /// the string representation of enums.
15351        pub fn value(&self) -> std::option::Option<i32> {
15352            match self {
15353                Self::Unspecified => std::option::Option::Some(0),
15354                Self::ForVpc => std::option::Option::Some(1),
15355                Self::ExternalToVpc => std::option::Option::Some(2),
15356                Self::ForMigration => std::option::Option::Some(3),
15357                Self::UnknownValue(u) => u.0.value(),
15358            }
15359        }
15360
15361        /// Gets the enum value as a string.
15362        ///
15363        /// Returns `None` if the enum contains an unknown value deserialized from
15364        /// the integer representation of enums.
15365        pub fn name(&self) -> std::option::Option<&str> {
15366            match self {
15367                Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15368                Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15369                Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15370                Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15371                Self::UnknownValue(u) => u.0.name(),
15372            }
15373        }
15374    }
15375
15376    impl std::default::Default for Usage {
15377        fn default() -> Self {
15378            use std::convert::From;
15379            Self::from(0)
15380        }
15381    }
15382
15383    impl std::fmt::Display for Usage {
15384        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15385            wkt::internal::display_enum(f, self.name(), self.value())
15386        }
15387    }
15388
15389    impl std::convert::From<i32> for Usage {
15390        fn from(value: i32) -> Self {
15391            match value {
15392                0 => Self::Unspecified,
15393                1 => Self::ForVpc,
15394                2 => Self::ExternalToVpc,
15395                3 => Self::ForMigration,
15396                _ => Self::UnknownValue(usage::UnknownValue(
15397                    wkt::internal::UnknownEnumValue::Integer(value),
15398                )),
15399            }
15400        }
15401    }
15402
15403    impl std::convert::From<&str> for Usage {
15404        fn from(value: &str) -> Self {
15405            use std::string::ToString;
15406            match value {
15407                "USAGE_UNSPECIFIED" => Self::Unspecified,
15408                "FOR_VPC" => Self::ForVpc,
15409                "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15410                "FOR_MIGRATION" => Self::ForMigration,
15411                _ => Self::UnknownValue(usage::UnknownValue(
15412                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15413                )),
15414            }
15415        }
15416    }
15417
15418    impl serde::ser::Serialize for Usage {
15419        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15420        where
15421            S: serde::Serializer,
15422        {
15423            match self {
15424                Self::Unspecified => serializer.serialize_i32(0),
15425                Self::ForVpc => serializer.serialize_i32(1),
15426                Self::ExternalToVpc => serializer.serialize_i32(2),
15427                Self::ForMigration => serializer.serialize_i32(3),
15428                Self::UnknownValue(u) => u.0.serialize(serializer),
15429            }
15430        }
15431    }
15432
15433    impl<'de> serde::de::Deserialize<'de> for Usage {
15434        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15435        where
15436            D: serde::Deserializer<'de>,
15437        {
15438            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15439                ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15440            ))
15441        }
15442    }
15443
15444    /// Peering type.
15445    ///
15446    /// # Working with unknown values
15447    ///
15448    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15449    /// additional enum variants at any time. Adding new variants is not considered
15450    /// a breaking change. Applications should write their code in anticipation of:
15451    ///
15452    /// - New values appearing in future releases of the client library, **and**
15453    /// - New values received dynamically, without application changes.
15454    ///
15455    /// Please consult the [Working with enums] section in the user guide for some
15456    /// guidelines.
15457    ///
15458    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15459    #[derive(Clone, Debug, PartialEq)]
15460    #[non_exhaustive]
15461    pub enum Peering {
15462        /// If Peering is left unspecified in CreateInternalRange or
15463        /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15464        Unspecified,
15465        /// This is the default behavior and represents the case that this
15466        /// internal range is intended to be used in the VPC in which it is created
15467        /// and is accessible from its peers. This implies that peers or
15468        /// peers-of-peers cannot use this range.
15469        ForSelf,
15470        /// This behavior can be set when the internal range is being reserved for
15471        /// usage by peers. This means that no resource within the VPC in which
15472        /// it is being created can use this to associate with a VPC resource, but
15473        /// one of the peers can. This represents donating a range for peers to
15474        /// use.
15475        ForPeer,
15476        /// This behavior can be set when the internal range is being reserved for
15477        /// usage by the VPC in which it is created, but not shared with peers.
15478        /// In a sense, it is local to the VPC. This can be used to create internal
15479        /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15480        /// Interconnect routes that are not shared with peers. This also implies
15481        /// that peers cannot use this range in a way that is visible to this VPC,
15482        /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15483        /// too.
15484        NotShared,
15485        /// If set, the enum was initialized with an unknown value.
15486        ///
15487        /// Applications can examine the value using [Peering::value] or
15488        /// [Peering::name].
15489        UnknownValue(peering::UnknownValue),
15490    }
15491
15492    #[doc(hidden)]
15493    pub mod peering {
15494        #[allow(unused_imports)]
15495        use super::*;
15496        #[derive(Clone, Debug, PartialEq)]
15497        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15498    }
15499
15500    impl Peering {
15501        /// Gets the enum value.
15502        ///
15503        /// Returns `None` if the enum contains an unknown value deserialized from
15504        /// the string representation of enums.
15505        pub fn value(&self) -> std::option::Option<i32> {
15506            match self {
15507                Self::Unspecified => std::option::Option::Some(0),
15508                Self::ForSelf => std::option::Option::Some(1),
15509                Self::ForPeer => std::option::Option::Some(2),
15510                Self::NotShared => std::option::Option::Some(3),
15511                Self::UnknownValue(u) => u.0.value(),
15512            }
15513        }
15514
15515        /// Gets the enum value as a string.
15516        ///
15517        /// Returns `None` if the enum contains an unknown value deserialized from
15518        /// the integer representation of enums.
15519        pub fn name(&self) -> std::option::Option<&str> {
15520            match self {
15521                Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15522                Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15523                Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15524                Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15525                Self::UnknownValue(u) => u.0.name(),
15526            }
15527        }
15528    }
15529
15530    impl std::default::Default for Peering {
15531        fn default() -> Self {
15532            use std::convert::From;
15533            Self::from(0)
15534        }
15535    }
15536
15537    impl std::fmt::Display for Peering {
15538        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15539            wkt::internal::display_enum(f, self.name(), self.value())
15540        }
15541    }
15542
15543    impl std::convert::From<i32> for Peering {
15544        fn from(value: i32) -> Self {
15545            match value {
15546                0 => Self::Unspecified,
15547                1 => Self::ForSelf,
15548                2 => Self::ForPeer,
15549                3 => Self::NotShared,
15550                _ => Self::UnknownValue(peering::UnknownValue(
15551                    wkt::internal::UnknownEnumValue::Integer(value),
15552                )),
15553            }
15554        }
15555    }
15556
15557    impl std::convert::From<&str> for Peering {
15558        fn from(value: &str) -> Self {
15559            use std::string::ToString;
15560            match value {
15561                "PEERING_UNSPECIFIED" => Self::Unspecified,
15562                "FOR_SELF" => Self::ForSelf,
15563                "FOR_PEER" => Self::ForPeer,
15564                "NOT_SHARED" => Self::NotShared,
15565                _ => Self::UnknownValue(peering::UnknownValue(
15566                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15567                )),
15568            }
15569        }
15570    }
15571
15572    impl serde::ser::Serialize for Peering {
15573        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15574        where
15575            S: serde::Serializer,
15576        {
15577            match self {
15578                Self::Unspecified => serializer.serialize_i32(0),
15579                Self::ForSelf => serializer.serialize_i32(1),
15580                Self::ForPeer => serializer.serialize_i32(2),
15581                Self::NotShared => serializer.serialize_i32(3),
15582                Self::UnknownValue(u) => u.0.serialize(serializer),
15583            }
15584        }
15585    }
15586
15587    impl<'de> serde::de::Deserialize<'de> for Peering {
15588        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15589        where
15590            D: serde::Deserializer<'de>,
15591        {
15592            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15593                ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15594            ))
15595        }
15596    }
15597
15598    /// Overlap specifications.
15599    ///
15600    /// # Working with unknown values
15601    ///
15602    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15603    /// additional enum variants at any time. Adding new variants is not considered
15604    /// a breaking change. Applications should write their code in anticipation of:
15605    ///
15606    /// - New values appearing in future releases of the client library, **and**
15607    /// - New values received dynamically, without application changes.
15608    ///
15609    /// Please consult the [Working with enums] section in the user guide for some
15610    /// guidelines.
15611    ///
15612    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15613    #[derive(Clone, Debug, PartialEq)]
15614    #[non_exhaustive]
15615    pub enum Overlap {
15616        /// No overlap overrides.
15617        Unspecified,
15618        /// Allow creation of static routes more specific that the current
15619        /// internal range.
15620        RouteRange,
15621        /// Allow creation of internal ranges that overlap with existing subnets.
15622        ExistingSubnetRange,
15623        /// If set, the enum was initialized with an unknown value.
15624        ///
15625        /// Applications can examine the value using [Overlap::value] or
15626        /// [Overlap::name].
15627        UnknownValue(overlap::UnknownValue),
15628    }
15629
15630    #[doc(hidden)]
15631    pub mod overlap {
15632        #[allow(unused_imports)]
15633        use super::*;
15634        #[derive(Clone, Debug, PartialEq)]
15635        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15636    }
15637
15638    impl Overlap {
15639        /// Gets the enum value.
15640        ///
15641        /// Returns `None` if the enum contains an unknown value deserialized from
15642        /// the string representation of enums.
15643        pub fn value(&self) -> std::option::Option<i32> {
15644            match self {
15645                Self::Unspecified => std::option::Option::Some(0),
15646                Self::RouteRange => std::option::Option::Some(1),
15647                Self::ExistingSubnetRange => std::option::Option::Some(2),
15648                Self::UnknownValue(u) => u.0.value(),
15649            }
15650        }
15651
15652        /// Gets the enum value as a string.
15653        ///
15654        /// Returns `None` if the enum contains an unknown value deserialized from
15655        /// the integer representation of enums.
15656        pub fn name(&self) -> std::option::Option<&str> {
15657            match self {
15658                Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15659                Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15660                Self::ExistingSubnetRange => {
15661                    std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15662                }
15663                Self::UnknownValue(u) => u.0.name(),
15664            }
15665        }
15666    }
15667
15668    impl std::default::Default for Overlap {
15669        fn default() -> Self {
15670            use std::convert::From;
15671            Self::from(0)
15672        }
15673    }
15674
15675    impl std::fmt::Display for Overlap {
15676        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15677            wkt::internal::display_enum(f, self.name(), self.value())
15678        }
15679    }
15680
15681    impl std::convert::From<i32> for Overlap {
15682        fn from(value: i32) -> Self {
15683            match value {
15684                0 => Self::Unspecified,
15685                1 => Self::RouteRange,
15686                2 => Self::ExistingSubnetRange,
15687                _ => Self::UnknownValue(overlap::UnknownValue(
15688                    wkt::internal::UnknownEnumValue::Integer(value),
15689                )),
15690            }
15691        }
15692    }
15693
15694    impl std::convert::From<&str> for Overlap {
15695        fn from(value: &str) -> Self {
15696            use std::string::ToString;
15697            match value {
15698                "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15699                "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15700                "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15701                _ => Self::UnknownValue(overlap::UnknownValue(
15702                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15703                )),
15704            }
15705        }
15706    }
15707
15708    impl serde::ser::Serialize for Overlap {
15709        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15710        where
15711            S: serde::Serializer,
15712        {
15713            match self {
15714                Self::Unspecified => serializer.serialize_i32(0),
15715                Self::RouteRange => serializer.serialize_i32(1),
15716                Self::ExistingSubnetRange => serializer.serialize_i32(2),
15717                Self::UnknownValue(u) => u.0.serialize(serializer),
15718            }
15719        }
15720    }
15721
15722    impl<'de> serde::de::Deserialize<'de> for Overlap {
15723        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15724        where
15725            D: serde::Deserializer<'de>,
15726        {
15727            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15728                ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15729            ))
15730        }
15731    }
15732
15733    /// Enumeration of range auto-allocation strategies
15734    ///
15735    /// # Working with unknown values
15736    ///
15737    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15738    /// additional enum variants at any time. Adding new variants is not considered
15739    /// a breaking change. Applications should write their code in anticipation of:
15740    ///
15741    /// - New values appearing in future releases of the client library, **and**
15742    /// - New values received dynamically, without application changes.
15743    ///
15744    /// Please consult the [Working with enums] section in the user guide for some
15745    /// guidelines.
15746    ///
15747    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15748    #[derive(Clone, Debug, PartialEq)]
15749    #[non_exhaustive]
15750    pub enum AllocationStrategy {
15751        /// Unspecified is the only valid option when the range is specified
15752        /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15753        /// default strategy.
15754        Unspecified,
15755        /// Random strategy, the legacy algorithm, used for backwards compatibility.
15756        /// This allocation strategy remains efficient in the case of concurrent
15757        /// allocation requests in the same peered network space and doesn't require
15758        /// providing the level of concurrency in an explicit parameter, but it is
15759        /// prone to fragmenting available address space.
15760        Random,
15761        /// Pick the first available address range. This strategy is deterministic
15762        /// and the result is easy to predict.
15763        FirstAvailable,
15764        /// Pick an arbitrary range out of the first N available ones. The N will be
15765        /// set in the first_available_ranges_lookup_size field. This strategy should
15766        /// be used when concurrent allocation requests are made in the same space of
15767        /// peered networks while the fragmentation of the addrress space is reduced.
15768        RandomFirstNAvailable,
15769        /// Pick the smallest but fitting available range. This deterministic
15770        /// strategy minimizes fragmentation of the address space.
15771        FirstSmallestFitting,
15772        /// If set, the enum was initialized with an unknown value.
15773        ///
15774        /// Applications can examine the value using [AllocationStrategy::value] or
15775        /// [AllocationStrategy::name].
15776        UnknownValue(allocation_strategy::UnknownValue),
15777    }
15778
15779    #[doc(hidden)]
15780    pub mod allocation_strategy {
15781        #[allow(unused_imports)]
15782        use super::*;
15783        #[derive(Clone, Debug, PartialEq)]
15784        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15785    }
15786
15787    impl AllocationStrategy {
15788        /// Gets the enum value.
15789        ///
15790        /// Returns `None` if the enum contains an unknown value deserialized from
15791        /// the string representation of enums.
15792        pub fn value(&self) -> std::option::Option<i32> {
15793            match self {
15794                Self::Unspecified => std::option::Option::Some(0),
15795                Self::Random => std::option::Option::Some(1),
15796                Self::FirstAvailable => std::option::Option::Some(2),
15797                Self::RandomFirstNAvailable => std::option::Option::Some(3),
15798                Self::FirstSmallestFitting => std::option::Option::Some(4),
15799                Self::UnknownValue(u) => u.0.value(),
15800            }
15801        }
15802
15803        /// Gets the enum value as a string.
15804        ///
15805        /// Returns `None` if the enum contains an unknown value deserialized from
15806        /// the integer representation of enums.
15807        pub fn name(&self) -> std::option::Option<&str> {
15808            match self {
15809                Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15810                Self::Random => std::option::Option::Some("RANDOM"),
15811                Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15812                Self::RandomFirstNAvailable => {
15813                    std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15814                }
15815                Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15816                Self::UnknownValue(u) => u.0.name(),
15817            }
15818        }
15819    }
15820
15821    impl std::default::Default for AllocationStrategy {
15822        fn default() -> Self {
15823            use std::convert::From;
15824            Self::from(0)
15825        }
15826    }
15827
15828    impl std::fmt::Display for AllocationStrategy {
15829        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15830            wkt::internal::display_enum(f, self.name(), self.value())
15831        }
15832    }
15833
15834    impl std::convert::From<i32> for AllocationStrategy {
15835        fn from(value: i32) -> Self {
15836            match value {
15837                0 => Self::Unspecified,
15838                1 => Self::Random,
15839                2 => Self::FirstAvailable,
15840                3 => Self::RandomFirstNAvailable,
15841                4 => Self::FirstSmallestFitting,
15842                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15843                    wkt::internal::UnknownEnumValue::Integer(value),
15844                )),
15845            }
15846        }
15847    }
15848
15849    impl std::convert::From<&str> for AllocationStrategy {
15850        fn from(value: &str) -> Self {
15851            use std::string::ToString;
15852            match value {
15853                "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
15854                "RANDOM" => Self::Random,
15855                "FIRST_AVAILABLE" => Self::FirstAvailable,
15856                "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
15857                "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
15858                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15859                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15860                )),
15861            }
15862        }
15863    }
15864
15865    impl serde::ser::Serialize for AllocationStrategy {
15866        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15867        where
15868            S: serde::Serializer,
15869        {
15870            match self {
15871                Self::Unspecified => serializer.serialize_i32(0),
15872                Self::Random => serializer.serialize_i32(1),
15873                Self::FirstAvailable => serializer.serialize_i32(2),
15874                Self::RandomFirstNAvailable => serializer.serialize_i32(3),
15875                Self::FirstSmallestFitting => serializer.serialize_i32(4),
15876                Self::UnknownValue(u) => u.0.serialize(serializer),
15877            }
15878        }
15879    }
15880
15881    impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
15882        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15883        where
15884            D: serde::Deserializer<'de>,
15885        {
15886            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
15887                ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
15888            ))
15889        }
15890    }
15891}
15892
15893/// Request for InternalRangeService.ListInternalRanges
15894#[derive(Clone, Default, PartialEq)]
15895#[non_exhaustive]
15896pub struct ListInternalRangesRequest {
15897    /// Required. The parent resource's name.
15898    pub parent: std::string::String,
15899
15900    /// The maximum number of results per page that should be returned.
15901    pub page_size: i32,
15902
15903    /// The page token.
15904    pub page_token: std::string::String,
15905
15906    /// A filter expression that filters the results listed in the response.
15907    pub filter: std::string::String,
15908
15909    /// Sort the results by a certain order.
15910    pub order_by: std::string::String,
15911
15912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15913}
15914
15915impl ListInternalRangesRequest {
15916    /// Creates a new default instance.
15917    pub fn new() -> Self {
15918        std::default::Default::default()
15919    }
15920
15921    /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
15922    ///
15923    /// # Example
15924    /// ```ignore,no_run
15925    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15926    /// let x = ListInternalRangesRequest::new().set_parent("example");
15927    /// ```
15928    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15929        self.parent = v.into();
15930        self
15931    }
15932
15933    /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
15934    ///
15935    /// # Example
15936    /// ```ignore,no_run
15937    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15938    /// let x = ListInternalRangesRequest::new().set_page_size(42);
15939    /// ```
15940    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15941        self.page_size = v.into();
15942        self
15943    }
15944
15945    /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
15946    ///
15947    /// # Example
15948    /// ```ignore,no_run
15949    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15950    /// let x = ListInternalRangesRequest::new().set_page_token("example");
15951    /// ```
15952    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15953        self.page_token = v.into();
15954        self
15955    }
15956
15957    /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
15958    ///
15959    /// # Example
15960    /// ```ignore,no_run
15961    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15962    /// let x = ListInternalRangesRequest::new().set_filter("example");
15963    /// ```
15964    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15965        self.filter = v.into();
15966        self
15967    }
15968
15969    /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
15970    ///
15971    /// # Example
15972    /// ```ignore,no_run
15973    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15974    /// let x = ListInternalRangesRequest::new().set_order_by("example");
15975    /// ```
15976    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15977        self.order_by = v.into();
15978        self
15979    }
15980}
15981
15982impl wkt::message::Message for ListInternalRangesRequest {
15983    fn typename() -> &'static str {
15984        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
15985    }
15986}
15987
15988/// Response for InternalRange.ListInternalRanges
15989#[derive(Clone, Default, PartialEq)]
15990#[non_exhaustive]
15991pub struct ListInternalRangesResponse {
15992    /// Internal ranges to be returned.
15993    pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
15994
15995    /// The next pagination token in the List response. It should be used as
15996    /// page_token for the following request. An empty value means no more result.
15997    pub next_page_token: std::string::String,
15998
15999    /// Locations that could not be reached.
16000    pub unreachable: std::vec::Vec<std::string::String>,
16001
16002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16003}
16004
16005impl ListInternalRangesResponse {
16006    /// Creates a new default instance.
16007    pub fn new() -> Self {
16008        std::default::Default::default()
16009    }
16010
16011    /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
16012    ///
16013    /// # Example
16014    /// ```ignore,no_run
16015    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16016    /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16017    /// let x = ListInternalRangesResponse::new()
16018    ///     .set_internal_ranges([
16019    ///         InternalRange::default()/* use setters */,
16020    ///         InternalRange::default()/* use (different) setters */,
16021    ///     ]);
16022    /// ```
16023    pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
16024    where
16025        T: std::iter::IntoIterator<Item = V>,
16026        V: std::convert::Into<crate::model::InternalRange>,
16027    {
16028        use std::iter::Iterator;
16029        self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
16030        self
16031    }
16032
16033    /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
16034    ///
16035    /// # Example
16036    /// ```ignore,no_run
16037    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16038    /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
16039    /// ```
16040    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16041        self.next_page_token = v.into();
16042        self
16043    }
16044
16045    /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
16046    ///
16047    /// # Example
16048    /// ```ignore,no_run
16049    /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16050    /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
16051    /// ```
16052    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16053    where
16054        T: std::iter::IntoIterator<Item = V>,
16055        V: std::convert::Into<std::string::String>,
16056    {
16057        use std::iter::Iterator;
16058        self.unreachable = v.into_iter().map(|i| i.into()).collect();
16059        self
16060    }
16061}
16062
16063impl wkt::message::Message for ListInternalRangesResponse {
16064    fn typename() -> &'static str {
16065        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
16066    }
16067}
16068
16069#[doc(hidden)]
16070impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
16071    type PageItem = crate::model::InternalRange;
16072
16073    fn items(self) -> std::vec::Vec<Self::PageItem> {
16074        self.internal_ranges
16075    }
16076
16077    fn next_page_token(&self) -> std::string::String {
16078        use std::clone::Clone;
16079        self.next_page_token.clone()
16080    }
16081}
16082
16083/// Request for InternalRangeService.GetInternalRange
16084#[derive(Clone, Default, PartialEq)]
16085#[non_exhaustive]
16086pub struct GetInternalRangeRequest {
16087    /// Required. Name of the InternalRange to get.
16088    pub name: std::string::String,
16089
16090    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16091}
16092
16093impl GetInternalRangeRequest {
16094    /// Creates a new default instance.
16095    pub fn new() -> Self {
16096        std::default::Default::default()
16097    }
16098
16099    /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
16100    ///
16101    /// # Example
16102    /// ```ignore,no_run
16103    /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
16104    /// let x = GetInternalRangeRequest::new().set_name("example");
16105    /// ```
16106    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16107        self.name = v.into();
16108        self
16109    }
16110}
16111
16112impl wkt::message::Message for GetInternalRangeRequest {
16113    fn typename() -> &'static str {
16114        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
16115    }
16116}
16117
16118/// Request for InternalRangeService.CreateInternalRange
16119#[derive(Clone, Default, PartialEq)]
16120#[non_exhaustive]
16121pub struct CreateInternalRangeRequest {
16122    /// Required. The parent resource's name of the internal range.
16123    pub parent: std::string::String,
16124
16125    /// Optional. Resource ID
16126    /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16127    /// See <https://google.aip.dev/122#resource-id-segments>
16128    /// Unique per location.
16129    pub internal_range_id: std::string::String,
16130
16131    /// Required. Initial values for a new internal range
16132    pub internal_range: std::option::Option<crate::model::InternalRange>,
16133
16134    /// Optional. An optional request ID to identify requests. Specify a unique
16135    /// request ID so that if you must retry your request, the server will know to
16136    /// ignore the request if it has already been completed. The server will
16137    /// guarantee that for at least 60 minutes since the first request.
16138    ///
16139    /// For example, consider a situation where you make an initial request and
16140    /// the request times out. If you make the request again with the same request
16141    /// ID, the server can check if original operation with the same request ID
16142    /// was received, and if so, will ignore the second request. This prevents
16143    /// clients from accidentally creating duplicate commitments.
16144    ///
16145    /// The request ID must be a valid UUID with the exception that zero UUID is
16146    /// not supported (00000000-0000-0000-0000-000000000000).
16147    pub request_id: std::string::String,
16148
16149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16150}
16151
16152impl CreateInternalRangeRequest {
16153    /// Creates a new default instance.
16154    pub fn new() -> Self {
16155        std::default::Default::default()
16156    }
16157
16158    /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16159    ///
16160    /// # Example
16161    /// ```ignore,no_run
16162    /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16163    /// let x = CreateInternalRangeRequest::new().set_parent("example");
16164    /// ```
16165    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16166        self.parent = v.into();
16167        self
16168    }
16169
16170    /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16171    ///
16172    /// # Example
16173    /// ```ignore,no_run
16174    /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16175    /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16176    /// ```
16177    pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16178        mut self,
16179        v: T,
16180    ) -> Self {
16181        self.internal_range_id = v.into();
16182        self
16183    }
16184
16185    /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16186    ///
16187    /// # Example
16188    /// ```ignore,no_run
16189    /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16190    /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16191    /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16192    /// ```
16193    pub fn set_internal_range<T>(mut self, v: T) -> Self
16194    where
16195        T: std::convert::Into<crate::model::InternalRange>,
16196    {
16197        self.internal_range = std::option::Option::Some(v.into());
16198        self
16199    }
16200
16201    /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16202    ///
16203    /// # Example
16204    /// ```ignore,no_run
16205    /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16206    /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16207    /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16208    /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16209    /// ```
16210    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16211    where
16212        T: std::convert::Into<crate::model::InternalRange>,
16213    {
16214        self.internal_range = v.map(|x| x.into());
16215        self
16216    }
16217
16218    /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16219    ///
16220    /// # Example
16221    /// ```ignore,no_run
16222    /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16223    /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16224    /// ```
16225    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16226        self.request_id = v.into();
16227        self
16228    }
16229}
16230
16231impl wkt::message::Message for CreateInternalRangeRequest {
16232    fn typename() -> &'static str {
16233        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16234    }
16235}
16236
16237/// Request for InternalRangeService.UpdateInternalRange
16238#[derive(Clone, Default, PartialEq)]
16239#[non_exhaustive]
16240pub struct UpdateInternalRangeRequest {
16241    /// Optional. Field mask is used to specify the fields to be overwritten in the
16242    /// InternalRange resource by the update.
16243    /// The fields specified in the update_mask are relative to the resource, not
16244    /// the full request. A field will be overwritten if it is in the mask. If the
16245    /// user does not provide a mask then all fields will be overwritten.
16246    pub update_mask: std::option::Option<wkt::FieldMask>,
16247
16248    /// Required. New values to be patched into the resource.
16249    pub internal_range: std::option::Option<crate::model::InternalRange>,
16250
16251    /// Optional. An optional request ID to identify requests. Specify a unique
16252    /// request ID so that if you must retry your request, the server will know to
16253    /// ignore the request if it has already been completed. The server will
16254    /// guarantee that for at least 60 minutes since the first request.
16255    ///
16256    /// For example, consider a situation where you make an initial request and
16257    /// the request times out. If you make the request again with the same request
16258    /// ID, the server can check if original operation with the same request ID
16259    /// was received, and if so, will ignore the second request. This prevents
16260    /// clients from accidentally creating duplicate commitments.
16261    ///
16262    /// The request ID must be a valid UUID with the exception that zero UUID is
16263    /// not supported (00000000-0000-0000-0000-000000000000).
16264    pub request_id: std::string::String,
16265
16266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16267}
16268
16269impl UpdateInternalRangeRequest {
16270    /// Creates a new default instance.
16271    pub fn new() -> Self {
16272        std::default::Default::default()
16273    }
16274
16275    /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16276    ///
16277    /// # Example
16278    /// ```ignore,no_run
16279    /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16280    /// use wkt::FieldMask;
16281    /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16282    /// ```
16283    pub fn set_update_mask<T>(mut self, v: T) -> Self
16284    where
16285        T: std::convert::Into<wkt::FieldMask>,
16286    {
16287        self.update_mask = std::option::Option::Some(v.into());
16288        self
16289    }
16290
16291    /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16292    ///
16293    /// # Example
16294    /// ```ignore,no_run
16295    /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16296    /// use wkt::FieldMask;
16297    /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16298    /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16299    /// ```
16300    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16301    where
16302        T: std::convert::Into<wkt::FieldMask>,
16303    {
16304        self.update_mask = v.map(|x| x.into());
16305        self
16306    }
16307
16308    /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16309    ///
16310    /// # Example
16311    /// ```ignore,no_run
16312    /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16313    /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16314    /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16315    /// ```
16316    pub fn set_internal_range<T>(mut self, v: T) -> Self
16317    where
16318        T: std::convert::Into<crate::model::InternalRange>,
16319    {
16320        self.internal_range = std::option::Option::Some(v.into());
16321        self
16322    }
16323
16324    /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16325    ///
16326    /// # Example
16327    /// ```ignore,no_run
16328    /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16329    /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16330    /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16331    /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16332    /// ```
16333    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16334    where
16335        T: std::convert::Into<crate::model::InternalRange>,
16336    {
16337        self.internal_range = v.map(|x| x.into());
16338        self
16339    }
16340
16341    /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16342    ///
16343    /// # Example
16344    /// ```ignore,no_run
16345    /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16346    /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16347    /// ```
16348    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16349        self.request_id = v.into();
16350        self
16351    }
16352}
16353
16354impl wkt::message::Message for UpdateInternalRangeRequest {
16355    fn typename() -> &'static str {
16356        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16357    }
16358}
16359
16360/// Request for InternalRangeService.DeleteInternalRange
16361#[derive(Clone, Default, PartialEq)]
16362#[non_exhaustive]
16363pub struct DeleteInternalRangeRequest {
16364    /// Required. The name of the internal range to delete.
16365    pub name: std::string::String,
16366
16367    /// Optional. An optional request ID to identify requests. Specify a unique
16368    /// request ID so that if you must retry your request, the server will know to
16369    /// ignore the request if it has already been completed. The server will
16370    /// guarantee that for at least 60 minutes after the first request.
16371    ///
16372    /// For example, consider a situation where you make an initial request and
16373    /// the request times out. If you make the request again with the same request
16374    /// ID, the server can check if original operation with the same request ID
16375    /// was received, and if so, will ignore the second request. This prevents
16376    /// clients from accidentally creating duplicate commitments.
16377    ///
16378    /// The request ID must be a valid UUID with the exception that zero UUID is
16379    /// not supported (00000000-0000-0000-0000-000000000000).
16380    pub request_id: std::string::String,
16381
16382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16383}
16384
16385impl DeleteInternalRangeRequest {
16386    /// Creates a new default instance.
16387    pub fn new() -> Self {
16388        std::default::Default::default()
16389    }
16390
16391    /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16392    ///
16393    /// # Example
16394    /// ```ignore,no_run
16395    /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16396    /// let x = DeleteInternalRangeRequest::new().set_name("example");
16397    /// ```
16398    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16399        self.name = v.into();
16400        self
16401    }
16402
16403    /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16404    ///
16405    /// # Example
16406    /// ```ignore,no_run
16407    /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16408    /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16409    /// ```
16410    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16411        self.request_id = v.into();
16412        self
16413    }
16414}
16415
16416impl wkt::message::Message for DeleteInternalRangeRequest {
16417    fn typename() -> &'static str {
16418        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16419    }
16420}
16421
16422/// Policy-based routes route L4 network traffic based on not just destination IP
16423/// address, but also source IP address, protocol, and more. If a policy-based
16424/// route conflicts with other types of routes, the policy-based route always
16425/// takes precedence.
16426#[derive(Clone, Default, PartialEq)]
16427#[non_exhaustive]
16428pub struct PolicyBasedRoute {
16429    /// Immutable. A unique name of the resource in the form of
16430    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16431    pub name: std::string::String,
16432
16433    /// Output only. Time when the policy-based route was created.
16434    pub create_time: std::option::Option<wkt::Timestamp>,
16435
16436    /// Output only. Time when the policy-based route was updated.
16437    pub update_time: std::option::Option<wkt::Timestamp>,
16438
16439    /// User-defined labels.
16440    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16441
16442    /// Optional. An optional description of this resource. Provide this field when
16443    /// you create the resource.
16444    pub description: std::string::String,
16445
16446    /// Required. Fully-qualified URL of the network that this route applies to,
16447    /// for example: projects/my-project/global/networks/my-network.
16448    pub network: std::string::String,
16449
16450    /// Required. The filter to match L4 traffic.
16451    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16452
16453    /// Optional. The priority of this policy-based route. Priority is used to
16454    /// break ties in cases where there are more than one matching policy-based
16455    /// routes found. In cases where multiple policy-based routes are matched, the
16456    /// one with the lowest-numbered priority value wins. The default value is
16457    /// 1000. The priority value must be from 1 to 65535, inclusive.
16458    pub priority: i32,
16459
16460    /// Output only. If potential misconfigurations are detected for this route,
16461    /// this field will be populated with warning messages.
16462    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16463
16464    /// Output only. Server-defined fully-qualified URL for this resource.
16465    pub self_link: std::string::String,
16466
16467    /// Output only. Type of this resource. Always
16468    /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16469    pub kind: std::string::String,
16470
16471    /// Target specifies network endpoints that this policy-based route applies to.
16472    /// If no target is specified, the PBR will be installed on all network
16473    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16474    pub target: std::option::Option<crate::model::policy_based_route::Target>,
16475
16476    #[allow(missing_docs)]
16477    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16478
16479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16480}
16481
16482impl PolicyBasedRoute {
16483    /// Creates a new default instance.
16484    pub fn new() -> Self {
16485        std::default::Default::default()
16486    }
16487
16488    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16489    ///
16490    /// # Example
16491    /// ```ignore,no_run
16492    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16493    /// let x = PolicyBasedRoute::new().set_name("example");
16494    /// ```
16495    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16496        self.name = v.into();
16497        self
16498    }
16499
16500    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16501    ///
16502    /// # Example
16503    /// ```ignore,no_run
16504    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16505    /// use wkt::Timestamp;
16506    /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16507    /// ```
16508    pub fn set_create_time<T>(mut self, v: T) -> Self
16509    where
16510        T: std::convert::Into<wkt::Timestamp>,
16511    {
16512        self.create_time = std::option::Option::Some(v.into());
16513        self
16514    }
16515
16516    /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16517    ///
16518    /// # Example
16519    /// ```ignore,no_run
16520    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16521    /// use wkt::Timestamp;
16522    /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16523    /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16524    /// ```
16525    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16526    where
16527        T: std::convert::Into<wkt::Timestamp>,
16528    {
16529        self.create_time = v.map(|x| x.into());
16530        self
16531    }
16532
16533    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16534    ///
16535    /// # Example
16536    /// ```ignore,no_run
16537    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16538    /// use wkt::Timestamp;
16539    /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16540    /// ```
16541    pub fn set_update_time<T>(mut self, v: T) -> Self
16542    where
16543        T: std::convert::Into<wkt::Timestamp>,
16544    {
16545        self.update_time = std::option::Option::Some(v.into());
16546        self
16547    }
16548
16549    /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16550    ///
16551    /// # Example
16552    /// ```ignore,no_run
16553    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16554    /// use wkt::Timestamp;
16555    /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16556    /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16557    /// ```
16558    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16559    where
16560        T: std::convert::Into<wkt::Timestamp>,
16561    {
16562        self.update_time = v.map(|x| x.into());
16563        self
16564    }
16565
16566    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16567    ///
16568    /// # Example
16569    /// ```ignore,no_run
16570    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16571    /// let x = PolicyBasedRoute::new().set_labels([
16572    ///     ("key0", "abc"),
16573    ///     ("key1", "xyz"),
16574    /// ]);
16575    /// ```
16576    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16577    where
16578        T: std::iter::IntoIterator<Item = (K, V)>,
16579        K: std::convert::Into<std::string::String>,
16580        V: std::convert::Into<std::string::String>,
16581    {
16582        use std::iter::Iterator;
16583        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16584        self
16585    }
16586
16587    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16588    ///
16589    /// # Example
16590    /// ```ignore,no_run
16591    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16592    /// let x = PolicyBasedRoute::new().set_description("example");
16593    /// ```
16594    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16595        self.description = v.into();
16596        self
16597    }
16598
16599    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16600    ///
16601    /// # Example
16602    /// ```ignore,no_run
16603    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16604    /// let x = PolicyBasedRoute::new().set_network("example");
16605    /// ```
16606    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16607        self.network = v.into();
16608        self
16609    }
16610
16611    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16612    ///
16613    /// # Example
16614    /// ```ignore,no_run
16615    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16616    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16617    /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16618    /// ```
16619    pub fn set_filter<T>(mut self, v: T) -> Self
16620    where
16621        T: std::convert::Into<crate::model::policy_based_route::Filter>,
16622    {
16623        self.filter = std::option::Option::Some(v.into());
16624        self
16625    }
16626
16627    /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16628    ///
16629    /// # Example
16630    /// ```ignore,no_run
16631    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16632    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16633    /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16634    /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16635    /// ```
16636    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16637    where
16638        T: std::convert::Into<crate::model::policy_based_route::Filter>,
16639    {
16640        self.filter = v.map(|x| x.into());
16641        self
16642    }
16643
16644    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16645    ///
16646    /// # Example
16647    /// ```ignore,no_run
16648    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16649    /// let x = PolicyBasedRoute::new().set_priority(42);
16650    /// ```
16651    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16652        self.priority = v.into();
16653        self
16654    }
16655
16656    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16657    ///
16658    /// # Example
16659    /// ```ignore,no_run
16660    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16661    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16662    /// let x = PolicyBasedRoute::new()
16663    ///     .set_warnings([
16664    ///         Warnings::default()/* use setters */,
16665    ///         Warnings::default()/* use (different) setters */,
16666    ///     ]);
16667    /// ```
16668    pub fn set_warnings<T, V>(mut self, v: T) -> Self
16669    where
16670        T: std::iter::IntoIterator<Item = V>,
16671        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16672    {
16673        use std::iter::Iterator;
16674        self.warnings = v.into_iter().map(|i| i.into()).collect();
16675        self
16676    }
16677
16678    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16679    ///
16680    /// # Example
16681    /// ```ignore,no_run
16682    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16683    /// let x = PolicyBasedRoute::new().set_self_link("example");
16684    /// ```
16685    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16686        self.self_link = v.into();
16687        self
16688    }
16689
16690    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16691    ///
16692    /// # Example
16693    /// ```ignore,no_run
16694    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16695    /// let x = PolicyBasedRoute::new().set_kind("example");
16696    /// ```
16697    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16698        self.kind = v.into();
16699        self
16700    }
16701
16702    /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16703    ///
16704    /// Note that all the setters affecting `target` are mutually
16705    /// exclusive.
16706    ///
16707    /// # Example
16708    /// ```ignore,no_run
16709    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16710    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16711    /// let x = PolicyBasedRoute::new().set_target(Some(
16712    ///     google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16713    /// ```
16714    pub fn set_target<
16715        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16716    >(
16717        mut self,
16718        v: T,
16719    ) -> Self {
16720        self.target = v.into();
16721        self
16722    }
16723
16724    /// The value of [target][crate::model::PolicyBasedRoute::target]
16725    /// if it holds a `VirtualMachine`, `None` if the field is not set or
16726    /// holds a different branch.
16727    pub fn virtual_machine(
16728        &self,
16729    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16730    {
16731        #[allow(unreachable_patterns)]
16732        self.target.as_ref().and_then(|v| match v {
16733            crate::model::policy_based_route::Target::VirtualMachine(v) => {
16734                std::option::Option::Some(v)
16735            }
16736            _ => std::option::Option::None,
16737        })
16738    }
16739
16740    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16741    /// to hold a `VirtualMachine`.
16742    ///
16743    /// Note that all the setters affecting `target` are
16744    /// mutually exclusive.
16745    ///
16746    /// # Example
16747    /// ```ignore,no_run
16748    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16749    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16750    /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16751    /// assert!(x.virtual_machine().is_some());
16752    /// assert!(x.interconnect_attachment().is_none());
16753    /// ```
16754    pub fn set_virtual_machine<
16755        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16756    >(
16757        mut self,
16758        v: T,
16759    ) -> Self {
16760        self.target = std::option::Option::Some(
16761            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16762        );
16763        self
16764    }
16765
16766    /// The value of [target][crate::model::PolicyBasedRoute::target]
16767    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16768    /// holds a different branch.
16769    pub fn interconnect_attachment(
16770        &self,
16771    ) -> std::option::Option<
16772        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16773    > {
16774        #[allow(unreachable_patterns)]
16775        self.target.as_ref().and_then(|v| match v {
16776            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16777                std::option::Option::Some(v)
16778            }
16779            _ => std::option::Option::None,
16780        })
16781    }
16782
16783    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16784    /// to hold a `InterconnectAttachment`.
16785    ///
16786    /// Note that all the setters affecting `target` are
16787    /// mutually exclusive.
16788    ///
16789    /// # Example
16790    /// ```ignore,no_run
16791    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16792    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16793    /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16794    /// assert!(x.interconnect_attachment().is_some());
16795    /// assert!(x.virtual_machine().is_none());
16796    /// ```
16797    pub fn set_interconnect_attachment<
16798        T: std::convert::Into<
16799                std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16800            >,
16801    >(
16802        mut self,
16803        v: T,
16804    ) -> Self {
16805        self.target = std::option::Option::Some(
16806            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16807        );
16808        self
16809    }
16810
16811    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16812    ///
16813    /// Note that all the setters affecting `next_hop` are mutually
16814    /// exclusive.
16815    ///
16816    /// # Example
16817    /// ```ignore,no_run
16818    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16819    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16820    /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16821    /// ```
16822    pub fn set_next_hop<
16823        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16824    >(
16825        mut self,
16826        v: T,
16827    ) -> Self {
16828        self.next_hop = v.into();
16829        self
16830    }
16831
16832    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16833    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16834    /// holds a different branch.
16835    pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
16836        #[allow(unreachable_patterns)]
16837        self.next_hop.as_ref().and_then(|v| match v {
16838            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
16839                std::option::Option::Some(v)
16840            }
16841            _ => std::option::Option::None,
16842        })
16843    }
16844
16845    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16846    /// to hold a `NextHopIlbIp`.
16847    ///
16848    /// Note that all the setters affecting `next_hop` are
16849    /// mutually exclusive.
16850    ///
16851    /// # Example
16852    /// ```ignore,no_run
16853    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16854    /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
16855    /// assert!(x.next_hop_ilb_ip().is_some());
16856    /// assert!(x.next_hop_other_routes().is_none());
16857    /// ```
16858    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16859        self.next_hop = std::option::Option::Some(
16860            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
16861        );
16862        self
16863    }
16864
16865    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16866    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
16867    /// holds a different branch.
16868    pub fn next_hop_other_routes(
16869        &self,
16870    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
16871        #[allow(unreachable_patterns)]
16872        self.next_hop.as_ref().and_then(|v| match v {
16873            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
16874                std::option::Option::Some(v)
16875            }
16876            _ => std::option::Option::None,
16877        })
16878    }
16879
16880    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16881    /// to hold a `NextHopOtherRoutes`.
16882    ///
16883    /// Note that all the setters affecting `next_hop` are
16884    /// mutually exclusive.
16885    ///
16886    /// # Example
16887    /// ```ignore,no_run
16888    /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16889    /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
16890    /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
16891    /// assert!(x0.next_hop_other_routes().is_some());
16892    /// assert!(x0.next_hop_ilb_ip().is_none());
16893    /// ```
16894    pub fn set_next_hop_other_routes<
16895        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
16896    >(
16897        mut self,
16898        v: T,
16899    ) -> Self {
16900        self.next_hop = std::option::Option::Some(
16901            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
16902        );
16903        self
16904    }
16905}
16906
16907impl wkt::message::Message for PolicyBasedRoute {
16908    fn typename() -> &'static str {
16909        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
16910    }
16911}
16912
16913/// Defines additional types related to [PolicyBasedRoute].
16914pub mod policy_based_route {
16915    #[allow(unused_imports)]
16916    use super::*;
16917
16918    /// VM instances that this policy-based route applies to.
16919    #[derive(Clone, Default, PartialEq)]
16920    #[non_exhaustive]
16921    pub struct VirtualMachine {
16922        /// Optional. A list of VM instance tags that this policy-based route applies
16923        /// to. VM instances that have ANY of tags specified here installs this PBR.
16924        pub tags: std::vec::Vec<std::string::String>,
16925
16926        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16927    }
16928
16929    impl VirtualMachine {
16930        /// Creates a new default instance.
16931        pub fn new() -> Self {
16932            std::default::Default::default()
16933        }
16934
16935        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
16936        ///
16937        /// # Example
16938        /// ```ignore,no_run
16939        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16940        /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
16941        /// ```
16942        pub fn set_tags<T, V>(mut self, v: T) -> Self
16943        where
16944            T: std::iter::IntoIterator<Item = V>,
16945            V: std::convert::Into<std::string::String>,
16946        {
16947            use std::iter::Iterator;
16948            self.tags = v.into_iter().map(|i| i.into()).collect();
16949            self
16950        }
16951    }
16952
16953    impl wkt::message::Message for VirtualMachine {
16954        fn typename() -> &'static str {
16955            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
16956        }
16957    }
16958
16959    /// InterconnectAttachment that this route applies to.
16960    #[derive(Clone, Default, PartialEq)]
16961    #[non_exhaustive]
16962    pub struct InterconnectAttachment {
16963        /// Optional. Cloud region to install this policy-based route on interconnect
16964        /// attachment. Use `all` to install it on all interconnect attachments.
16965        pub region: std::string::String,
16966
16967        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16968    }
16969
16970    impl InterconnectAttachment {
16971        /// Creates a new default instance.
16972        pub fn new() -> Self {
16973            std::default::Default::default()
16974        }
16975
16976        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
16977        ///
16978        /// # Example
16979        /// ```ignore,no_run
16980        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16981        /// let x = InterconnectAttachment::new().set_region("example");
16982        /// ```
16983        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16984            self.region = v.into();
16985            self
16986        }
16987    }
16988
16989    impl wkt::message::Message for InterconnectAttachment {
16990        fn typename() -> &'static str {
16991            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
16992        }
16993    }
16994
16995    /// Filter matches L4 traffic.
16996    #[derive(Clone, Default, PartialEq)]
16997    #[non_exhaustive]
16998    pub struct Filter {
16999        /// Optional. The IP protocol that this policy-based route applies to. Valid
17000        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
17001        pub ip_protocol: std::string::String,
17002
17003        /// Optional. The source IP range of outgoing packets that this policy-based
17004        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
17005        pub src_range: std::string::String,
17006
17007        /// Optional. The destination IP range of outgoing packets that this
17008        /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
17009        /// is IPv4.
17010        pub dest_range: std::string::String,
17011
17012        /// Required. Internet protocol versions this policy-based route applies to.
17013        /// For this version, only IPV4 is supported. IPV6 is supported in preview.
17014        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
17015
17016        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17017    }
17018
17019    impl Filter {
17020        /// Creates a new default instance.
17021        pub fn new() -> Self {
17022            std::default::Default::default()
17023        }
17024
17025        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
17026        ///
17027        /// # Example
17028        /// ```ignore,no_run
17029        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17030        /// let x = Filter::new().set_ip_protocol("example");
17031        /// ```
17032        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17033            self.ip_protocol = v.into();
17034            self
17035        }
17036
17037        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
17038        ///
17039        /// # Example
17040        /// ```ignore,no_run
17041        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17042        /// let x = Filter::new().set_src_range("example");
17043        /// ```
17044        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17045            self.src_range = v.into();
17046            self
17047        }
17048
17049        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
17050        ///
17051        /// # Example
17052        /// ```ignore,no_run
17053        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17054        /// let x = Filter::new().set_dest_range("example");
17055        /// ```
17056        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17057            self.dest_range = v.into();
17058            self
17059        }
17060
17061        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
17062        ///
17063        /// # Example
17064        /// ```ignore,no_run
17065        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17066        /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
17067        /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
17068        /// ```
17069        pub fn set_protocol_version<
17070            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
17071        >(
17072            mut self,
17073            v: T,
17074        ) -> Self {
17075            self.protocol_version = v.into();
17076            self
17077        }
17078    }
17079
17080    impl wkt::message::Message for Filter {
17081        fn typename() -> &'static str {
17082            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
17083        }
17084    }
17085
17086    /// Defines additional types related to [Filter].
17087    pub mod filter {
17088        #[allow(unused_imports)]
17089        use super::*;
17090
17091        /// The internet protocol version.
17092        ///
17093        /// # Working with unknown values
17094        ///
17095        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17096        /// additional enum variants at any time. Adding new variants is not considered
17097        /// a breaking change. Applications should write their code in anticipation of:
17098        ///
17099        /// - New values appearing in future releases of the client library, **and**
17100        /// - New values received dynamically, without application changes.
17101        ///
17102        /// Please consult the [Working with enums] section in the user guide for some
17103        /// guidelines.
17104        ///
17105        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17106        #[derive(Clone, Debug, PartialEq)]
17107        #[non_exhaustive]
17108        pub enum ProtocolVersion {
17109            /// Default value.
17110            Unspecified,
17111            /// The PBR is for IPv4 internet protocol traffic.
17112            Ipv4,
17113            /// If set, the enum was initialized with an unknown value.
17114            ///
17115            /// Applications can examine the value using [ProtocolVersion::value] or
17116            /// [ProtocolVersion::name].
17117            UnknownValue(protocol_version::UnknownValue),
17118        }
17119
17120        #[doc(hidden)]
17121        pub mod protocol_version {
17122            #[allow(unused_imports)]
17123            use super::*;
17124            #[derive(Clone, Debug, PartialEq)]
17125            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17126        }
17127
17128        impl ProtocolVersion {
17129            /// Gets the enum value.
17130            ///
17131            /// Returns `None` if the enum contains an unknown value deserialized from
17132            /// the string representation of enums.
17133            pub fn value(&self) -> std::option::Option<i32> {
17134                match self {
17135                    Self::Unspecified => std::option::Option::Some(0),
17136                    Self::Ipv4 => std::option::Option::Some(1),
17137                    Self::UnknownValue(u) => u.0.value(),
17138                }
17139            }
17140
17141            /// Gets the enum value as a string.
17142            ///
17143            /// Returns `None` if the enum contains an unknown value deserialized from
17144            /// the integer representation of enums.
17145            pub fn name(&self) -> std::option::Option<&str> {
17146                match self {
17147                    Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17148                    Self::Ipv4 => std::option::Option::Some("IPV4"),
17149                    Self::UnknownValue(u) => u.0.name(),
17150                }
17151            }
17152        }
17153
17154        impl std::default::Default for ProtocolVersion {
17155            fn default() -> Self {
17156                use std::convert::From;
17157                Self::from(0)
17158            }
17159        }
17160
17161        impl std::fmt::Display for ProtocolVersion {
17162            fn fmt(
17163                &self,
17164                f: &mut std::fmt::Formatter<'_>,
17165            ) -> std::result::Result<(), std::fmt::Error> {
17166                wkt::internal::display_enum(f, self.name(), self.value())
17167            }
17168        }
17169
17170        impl std::convert::From<i32> for ProtocolVersion {
17171            fn from(value: i32) -> Self {
17172                match value {
17173                    0 => Self::Unspecified,
17174                    1 => Self::Ipv4,
17175                    _ => Self::UnknownValue(protocol_version::UnknownValue(
17176                        wkt::internal::UnknownEnumValue::Integer(value),
17177                    )),
17178                }
17179            }
17180        }
17181
17182        impl std::convert::From<&str> for ProtocolVersion {
17183            fn from(value: &str) -> Self {
17184                use std::string::ToString;
17185                match value {
17186                    "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17187                    "IPV4" => Self::Ipv4,
17188                    _ => Self::UnknownValue(protocol_version::UnknownValue(
17189                        wkt::internal::UnknownEnumValue::String(value.to_string()),
17190                    )),
17191                }
17192            }
17193        }
17194
17195        impl serde::ser::Serialize for ProtocolVersion {
17196            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17197            where
17198                S: serde::Serializer,
17199            {
17200                match self {
17201                    Self::Unspecified => serializer.serialize_i32(0),
17202                    Self::Ipv4 => serializer.serialize_i32(1),
17203                    Self::UnknownValue(u) => u.0.serialize(serializer),
17204                }
17205            }
17206        }
17207
17208        impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17209            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17210            where
17211                D: serde::Deserializer<'de>,
17212            {
17213                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17214                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17215                ))
17216            }
17217        }
17218    }
17219
17220    /// Informational warning message.
17221    #[derive(Clone, Default, PartialEq)]
17222    #[non_exhaustive]
17223    pub struct Warnings {
17224        /// Output only. A warning code, if applicable.
17225        pub code: crate::model::policy_based_route::warnings::Code,
17226
17227        /// Output only. Metadata about this warning in key: value format. The key
17228        /// should provides more detail on the warning being returned. For example,
17229        /// for warnings where there are no results in a list request for a
17230        /// particular zone, this key might be scope and the key value might be the
17231        /// zone name. Other examples might be a key indicating a deprecated resource
17232        /// and a suggested replacement.
17233        pub data: std::collections::HashMap<std::string::String, std::string::String>,
17234
17235        /// Output only. A human-readable description of the warning code.
17236        pub warning_message: std::string::String,
17237
17238        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17239    }
17240
17241    impl Warnings {
17242        /// Creates a new default instance.
17243        pub fn new() -> Self {
17244            std::default::Default::default()
17245        }
17246
17247        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17248        ///
17249        /// # Example
17250        /// ```ignore,no_run
17251        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17252        /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17253        /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17254        /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17255        /// ```
17256        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17257            mut self,
17258            v: T,
17259        ) -> Self {
17260            self.code = v.into();
17261            self
17262        }
17263
17264        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17265        ///
17266        /// # Example
17267        /// ```ignore,no_run
17268        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17269        /// let x = Warnings::new().set_data([
17270        ///     ("key0", "abc"),
17271        ///     ("key1", "xyz"),
17272        /// ]);
17273        /// ```
17274        pub fn set_data<T, K, V>(mut self, v: T) -> Self
17275        where
17276            T: std::iter::IntoIterator<Item = (K, V)>,
17277            K: std::convert::Into<std::string::String>,
17278            V: std::convert::Into<std::string::String>,
17279        {
17280            use std::iter::Iterator;
17281            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17282            self
17283        }
17284
17285        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17286        ///
17287        /// # Example
17288        /// ```ignore,no_run
17289        /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17290        /// let x = Warnings::new().set_warning_message("example");
17291        /// ```
17292        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17293            mut self,
17294            v: T,
17295        ) -> Self {
17296            self.warning_message = v.into();
17297            self
17298        }
17299    }
17300
17301    impl wkt::message::Message for Warnings {
17302        fn typename() -> &'static str {
17303            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17304        }
17305    }
17306
17307    /// Defines additional types related to [Warnings].
17308    pub mod warnings {
17309        #[allow(unused_imports)]
17310        use super::*;
17311
17312        /// Warning code for policy-based routing. Expect to add values in the
17313        /// future.
17314        ///
17315        /// # Working with unknown values
17316        ///
17317        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17318        /// additional enum variants at any time. Adding new variants is not considered
17319        /// a breaking change. Applications should write their code in anticipation of:
17320        ///
17321        /// - New values appearing in future releases of the client library, **and**
17322        /// - New values received dynamically, without application changes.
17323        ///
17324        /// Please consult the [Working with enums] section in the user guide for some
17325        /// guidelines.
17326        ///
17327        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17328        #[derive(Clone, Debug, PartialEq)]
17329        #[non_exhaustive]
17330        pub enum Code {
17331            /// Default value.
17332            WarningUnspecified,
17333            /// The policy-based route is not active and functioning. Common causes are
17334            /// that the dependent network was deleted or the resource project was
17335            /// turned off.
17336            ResourceNotActive,
17337            /// The policy-based route is being modified (e.g. created/deleted) at this
17338            /// time.
17339            ResourceBeingModified,
17340            /// If set, the enum was initialized with an unknown value.
17341            ///
17342            /// Applications can examine the value using [Code::value] or
17343            /// [Code::name].
17344            UnknownValue(code::UnknownValue),
17345        }
17346
17347        #[doc(hidden)]
17348        pub mod code {
17349            #[allow(unused_imports)]
17350            use super::*;
17351            #[derive(Clone, Debug, PartialEq)]
17352            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17353        }
17354
17355        impl Code {
17356            /// Gets the enum value.
17357            ///
17358            /// Returns `None` if the enum contains an unknown value deserialized from
17359            /// the string representation of enums.
17360            pub fn value(&self) -> std::option::Option<i32> {
17361                match self {
17362                    Self::WarningUnspecified => std::option::Option::Some(0),
17363                    Self::ResourceNotActive => std::option::Option::Some(1),
17364                    Self::ResourceBeingModified => std::option::Option::Some(2),
17365                    Self::UnknownValue(u) => u.0.value(),
17366                }
17367            }
17368
17369            /// Gets the enum value as a string.
17370            ///
17371            /// Returns `None` if the enum contains an unknown value deserialized from
17372            /// the integer representation of enums.
17373            pub fn name(&self) -> std::option::Option<&str> {
17374                match self {
17375                    Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17376                    Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17377                    Self::ResourceBeingModified => {
17378                        std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17379                    }
17380                    Self::UnknownValue(u) => u.0.name(),
17381                }
17382            }
17383        }
17384
17385        impl std::default::Default for Code {
17386            fn default() -> Self {
17387                use std::convert::From;
17388                Self::from(0)
17389            }
17390        }
17391
17392        impl std::fmt::Display for Code {
17393            fn fmt(
17394                &self,
17395                f: &mut std::fmt::Formatter<'_>,
17396            ) -> std::result::Result<(), std::fmt::Error> {
17397                wkt::internal::display_enum(f, self.name(), self.value())
17398            }
17399        }
17400
17401        impl std::convert::From<i32> for Code {
17402            fn from(value: i32) -> Self {
17403                match value {
17404                    0 => Self::WarningUnspecified,
17405                    1 => Self::ResourceNotActive,
17406                    2 => Self::ResourceBeingModified,
17407                    _ => Self::UnknownValue(code::UnknownValue(
17408                        wkt::internal::UnknownEnumValue::Integer(value),
17409                    )),
17410                }
17411            }
17412        }
17413
17414        impl std::convert::From<&str> for Code {
17415            fn from(value: &str) -> Self {
17416                use std::string::ToString;
17417                match value {
17418                    "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17419                    "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17420                    "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17421                    _ => Self::UnknownValue(code::UnknownValue(
17422                        wkt::internal::UnknownEnumValue::String(value.to_string()),
17423                    )),
17424                }
17425            }
17426        }
17427
17428        impl serde::ser::Serialize for Code {
17429            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17430            where
17431                S: serde::Serializer,
17432            {
17433                match self {
17434                    Self::WarningUnspecified => serializer.serialize_i32(0),
17435                    Self::ResourceNotActive => serializer.serialize_i32(1),
17436                    Self::ResourceBeingModified => serializer.serialize_i32(2),
17437                    Self::UnknownValue(u) => u.0.serialize(serializer),
17438                }
17439            }
17440        }
17441
17442        impl<'de> serde::de::Deserialize<'de> for Code {
17443            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17444            where
17445                D: serde::Deserializer<'de>,
17446            {
17447                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17448                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17449                ))
17450            }
17451        }
17452    }
17453
17454    /// The other routing cases.
17455    ///
17456    /// # Working with unknown values
17457    ///
17458    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17459    /// additional enum variants at any time. Adding new variants is not considered
17460    /// a breaking change. Applications should write their code in anticipation of:
17461    ///
17462    /// - New values appearing in future releases of the client library, **and**
17463    /// - New values received dynamically, without application changes.
17464    ///
17465    /// Please consult the [Working with enums] section in the user guide for some
17466    /// guidelines.
17467    ///
17468    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17469    #[derive(Clone, Debug, PartialEq)]
17470    #[non_exhaustive]
17471    pub enum OtherRoutes {
17472        /// Default value.
17473        Unspecified,
17474        /// Use the routes from the default routing tables (system-generated routes,
17475        /// custom routes, peering route) to determine the next hop. This effectively
17476        /// excludes matching packets being applied on other PBRs with a lower
17477        /// priority.
17478        DefaultRouting,
17479        /// If set, the enum was initialized with an unknown value.
17480        ///
17481        /// Applications can examine the value using [OtherRoutes::value] or
17482        /// [OtherRoutes::name].
17483        UnknownValue(other_routes::UnknownValue),
17484    }
17485
17486    #[doc(hidden)]
17487    pub mod other_routes {
17488        #[allow(unused_imports)]
17489        use super::*;
17490        #[derive(Clone, Debug, PartialEq)]
17491        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17492    }
17493
17494    impl OtherRoutes {
17495        /// Gets the enum value.
17496        ///
17497        /// Returns `None` if the enum contains an unknown value deserialized from
17498        /// the string representation of enums.
17499        pub fn value(&self) -> std::option::Option<i32> {
17500            match self {
17501                Self::Unspecified => std::option::Option::Some(0),
17502                Self::DefaultRouting => std::option::Option::Some(1),
17503                Self::UnknownValue(u) => u.0.value(),
17504            }
17505        }
17506
17507        /// Gets the enum value as a string.
17508        ///
17509        /// Returns `None` if the enum contains an unknown value deserialized from
17510        /// the integer representation of enums.
17511        pub fn name(&self) -> std::option::Option<&str> {
17512            match self {
17513                Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17514                Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17515                Self::UnknownValue(u) => u.0.name(),
17516            }
17517        }
17518    }
17519
17520    impl std::default::Default for OtherRoutes {
17521        fn default() -> Self {
17522            use std::convert::From;
17523            Self::from(0)
17524        }
17525    }
17526
17527    impl std::fmt::Display for OtherRoutes {
17528        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17529            wkt::internal::display_enum(f, self.name(), self.value())
17530        }
17531    }
17532
17533    impl std::convert::From<i32> for OtherRoutes {
17534        fn from(value: i32) -> Self {
17535            match value {
17536                0 => Self::Unspecified,
17537                1 => Self::DefaultRouting,
17538                _ => Self::UnknownValue(other_routes::UnknownValue(
17539                    wkt::internal::UnknownEnumValue::Integer(value),
17540                )),
17541            }
17542        }
17543    }
17544
17545    impl std::convert::From<&str> for OtherRoutes {
17546        fn from(value: &str) -> Self {
17547            use std::string::ToString;
17548            match value {
17549                "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17550                "DEFAULT_ROUTING" => Self::DefaultRouting,
17551                _ => Self::UnknownValue(other_routes::UnknownValue(
17552                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17553                )),
17554            }
17555        }
17556    }
17557
17558    impl serde::ser::Serialize for OtherRoutes {
17559        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17560        where
17561            S: serde::Serializer,
17562        {
17563            match self {
17564                Self::Unspecified => serializer.serialize_i32(0),
17565                Self::DefaultRouting => serializer.serialize_i32(1),
17566                Self::UnknownValue(u) => u.0.serialize(serializer),
17567            }
17568        }
17569    }
17570
17571    impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17572        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17573        where
17574            D: serde::Deserializer<'de>,
17575        {
17576            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17577                ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17578            ))
17579        }
17580    }
17581
17582    /// Target specifies network endpoints that this policy-based route applies to.
17583    /// If no target is specified, the PBR will be installed on all network
17584    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17585    #[derive(Clone, Debug, PartialEq)]
17586    #[non_exhaustive]
17587    pub enum Target {
17588        /// Optional. VM instances that this policy-based route applies to.
17589        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17590        /// Optional. The interconnect attachments that this policy-based route
17591        /// applies to.
17592        InterconnectAttachment(
17593            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17594        ),
17595    }
17596
17597    #[allow(missing_docs)]
17598    #[derive(Clone, Debug, PartialEq)]
17599    #[non_exhaustive]
17600    pub enum NextHop {
17601        /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17602        /// next hop for matching packets. For this version, only nextHopIlbIp is
17603        /// supported.
17604        NextHopIlbIp(std::string::String),
17605        /// Optional. Other routes that will be referenced to determine the next hop
17606        /// of the packet.
17607        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17608    }
17609}
17610
17611/// Request for
17612/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17613/// method.
17614///
17615/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17616#[derive(Clone, Default, PartialEq)]
17617#[non_exhaustive]
17618pub struct ListPolicyBasedRoutesRequest {
17619    /// Required. The parent resource's name.
17620    pub parent: std::string::String,
17621
17622    /// The maximum number of results per page that should be returned.
17623    pub page_size: i32,
17624
17625    /// The page token.
17626    pub page_token: std::string::String,
17627
17628    /// A filter expression that filters the results listed in the response.
17629    pub filter: std::string::String,
17630
17631    /// Sort the results by a certain order.
17632    pub order_by: std::string::String,
17633
17634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17635}
17636
17637impl ListPolicyBasedRoutesRequest {
17638    /// Creates a new default instance.
17639    pub fn new() -> Self {
17640        std::default::Default::default()
17641    }
17642
17643    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17644    ///
17645    /// # Example
17646    /// ```ignore,no_run
17647    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17648    /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17649    /// ```
17650    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17651        self.parent = v.into();
17652        self
17653    }
17654
17655    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17656    ///
17657    /// # Example
17658    /// ```ignore,no_run
17659    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17660    /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17661    /// ```
17662    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17663        self.page_size = v.into();
17664        self
17665    }
17666
17667    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17668    ///
17669    /// # Example
17670    /// ```ignore,no_run
17671    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17672    /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17673    /// ```
17674    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17675        self.page_token = v.into();
17676        self
17677    }
17678
17679    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17680    ///
17681    /// # Example
17682    /// ```ignore,no_run
17683    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17684    /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17685    /// ```
17686    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17687        self.filter = v.into();
17688        self
17689    }
17690
17691    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17692    ///
17693    /// # Example
17694    /// ```ignore,no_run
17695    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17696    /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17697    /// ```
17698    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17699        self.order_by = v.into();
17700        self
17701    }
17702}
17703
17704impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17705    fn typename() -> &'static str {
17706        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17707    }
17708}
17709
17710/// Response for
17711/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17712/// method.
17713///
17714/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17715#[derive(Clone, Default, PartialEq)]
17716#[non_exhaustive]
17717pub struct ListPolicyBasedRoutesResponse {
17718    /// Policy-based routes to be returned.
17719    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17720
17721    /// The next pagination token in the List response. It should be used as
17722    /// page_token for the following request. An empty value means no more result.
17723    pub next_page_token: std::string::String,
17724
17725    /// Locations that could not be reached.
17726    pub unreachable: std::vec::Vec<std::string::String>,
17727
17728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17729}
17730
17731impl ListPolicyBasedRoutesResponse {
17732    /// Creates a new default instance.
17733    pub fn new() -> Self {
17734        std::default::Default::default()
17735    }
17736
17737    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17738    ///
17739    /// # Example
17740    /// ```ignore,no_run
17741    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17742    /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17743    /// let x = ListPolicyBasedRoutesResponse::new()
17744    ///     .set_policy_based_routes([
17745    ///         PolicyBasedRoute::default()/* use setters */,
17746    ///         PolicyBasedRoute::default()/* use (different) setters */,
17747    ///     ]);
17748    /// ```
17749    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17750    where
17751        T: std::iter::IntoIterator<Item = V>,
17752        V: std::convert::Into<crate::model::PolicyBasedRoute>,
17753    {
17754        use std::iter::Iterator;
17755        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17756        self
17757    }
17758
17759    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17760    ///
17761    /// # Example
17762    /// ```ignore,no_run
17763    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17764    /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17765    /// ```
17766    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17767        self.next_page_token = v.into();
17768        self
17769    }
17770
17771    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17772    ///
17773    /// # Example
17774    /// ```ignore,no_run
17775    /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17776    /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17777    /// ```
17778    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17779    where
17780        T: std::iter::IntoIterator<Item = V>,
17781        V: std::convert::Into<std::string::String>,
17782    {
17783        use std::iter::Iterator;
17784        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17785        self
17786    }
17787}
17788
17789impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17790    fn typename() -> &'static str {
17791        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17792    }
17793}
17794
17795#[doc(hidden)]
17796impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17797    type PageItem = crate::model::PolicyBasedRoute;
17798
17799    fn items(self) -> std::vec::Vec<Self::PageItem> {
17800        self.policy_based_routes
17801    }
17802
17803    fn next_page_token(&self) -> std::string::String {
17804        use std::clone::Clone;
17805        self.next_page_token.clone()
17806    }
17807}
17808
17809/// Request for
17810/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17811/// method.
17812///
17813/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17814#[derive(Clone, Default, PartialEq)]
17815#[non_exhaustive]
17816pub struct GetPolicyBasedRouteRequest {
17817    /// Required. Name of the PolicyBasedRoute resource to get.
17818    pub name: std::string::String,
17819
17820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17821}
17822
17823impl GetPolicyBasedRouteRequest {
17824    /// Creates a new default instance.
17825    pub fn new() -> Self {
17826        std::default::Default::default()
17827    }
17828
17829    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17830    ///
17831    /// # Example
17832    /// ```ignore,no_run
17833    /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17834    /// let x = GetPolicyBasedRouteRequest::new().set_name("example");
17835    /// ```
17836    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17837        self.name = v.into();
17838        self
17839    }
17840}
17841
17842impl wkt::message::Message for GetPolicyBasedRouteRequest {
17843    fn typename() -> &'static str {
17844        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
17845    }
17846}
17847
17848/// Request for
17849/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
17850/// method.
17851///
17852/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
17853#[derive(Clone, Default, PartialEq)]
17854#[non_exhaustive]
17855pub struct CreatePolicyBasedRouteRequest {
17856    /// Required. The parent resource's name of the PolicyBasedRoute.
17857    pub parent: std::string::String,
17858
17859    /// Required. Unique id for the policy-based route to create. Provided by the
17860    /// client when the resource is created. The name must comply with
17861    /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
17862    /// must be 1-63 characters long and match the regular expression
17863    /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
17864    /// and all following characters (except for the last character) must be a
17865    /// dash, lowercase letter, or digit. The last character must be a lowercase
17866    /// letter or digit.
17867    pub policy_based_route_id: std::string::String,
17868
17869    /// Required. Initial values for a new policy-based route.
17870    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
17871
17872    /// Optional. An optional request ID to identify requests. Specify a unique
17873    /// request ID so that if you must retry your request, the server knows to
17874    /// ignore the request if it has already been completed. The server guarantees
17875    /// that for at least 60 minutes since the first request.
17876    ///
17877    /// For example, consider a situation where you make an initial request and
17878    /// the request times out. If you make the request again with the same request
17879    /// ID, the server can check if original operation with the same request ID
17880    /// was received, and if so, ignores the second request. This prevents clients
17881    /// from accidentally creating duplicate commitments.
17882    ///
17883    /// The request ID must be a valid UUID with the exception that zero UUID is
17884    /// not supported (00000000-0000-0000-0000-000000000000).
17885    pub request_id: std::string::String,
17886
17887    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17888}
17889
17890impl CreatePolicyBasedRouteRequest {
17891    /// Creates a new default instance.
17892    pub fn new() -> Self {
17893        std::default::Default::default()
17894    }
17895
17896    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
17897    ///
17898    /// # Example
17899    /// ```ignore,no_run
17900    /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17901    /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
17902    /// ```
17903    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17904        self.parent = v.into();
17905        self
17906    }
17907
17908    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
17909    ///
17910    /// # Example
17911    /// ```ignore,no_run
17912    /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17913    /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
17914    /// ```
17915    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
17916        mut self,
17917        v: T,
17918    ) -> Self {
17919        self.policy_based_route_id = v.into();
17920        self
17921    }
17922
17923    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17924    ///
17925    /// # Example
17926    /// ```ignore,no_run
17927    /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17928    /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17929    /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
17930    /// ```
17931    pub fn set_policy_based_route<T>(mut self, v: T) -> Self
17932    where
17933        T: std::convert::Into<crate::model::PolicyBasedRoute>,
17934    {
17935        self.policy_based_route = std::option::Option::Some(v.into());
17936        self
17937    }
17938
17939    /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17940    ///
17941    /// # Example
17942    /// ```ignore,no_run
17943    /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17944    /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17945    /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
17946    /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
17947    /// ```
17948    pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
17949    where
17950        T: std::convert::Into<crate::model::PolicyBasedRoute>,
17951    {
17952        self.policy_based_route = v.map(|x| x.into());
17953        self
17954    }
17955
17956    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
17957    ///
17958    /// # Example
17959    /// ```ignore,no_run
17960    /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17961    /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
17962    /// ```
17963    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17964        self.request_id = v.into();
17965        self
17966    }
17967}
17968
17969impl wkt::message::Message for CreatePolicyBasedRouteRequest {
17970    fn typename() -> &'static str {
17971        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
17972    }
17973}
17974
17975/// Request for
17976/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
17977/// method.
17978///
17979/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
17980#[derive(Clone, Default, PartialEq)]
17981#[non_exhaustive]
17982pub struct DeletePolicyBasedRouteRequest {
17983    /// Required. Name of the policy-based route resource to delete.
17984    pub name: std::string::String,
17985
17986    /// Optional. An optional request ID to identify requests. Specify a unique
17987    /// request ID so that if you must retry your request, the server knows to
17988    /// ignore the request if it has already been completed. The server guarantees
17989    /// that for at least 60 minutes after the first request.
17990    ///
17991    /// For example, consider a situation where you make an initial request and
17992    /// the request times out. If you make the request again with the same request
17993    /// ID, the server can check if original operation with the same request ID
17994    /// was received, and if so, ignores the second request. This prevents clients
17995    /// from accidentally creating duplicate commitments.
17996    ///
17997    /// The request ID must be a valid UUID with the exception that zero UUID is
17998    /// not supported (00000000-0000-0000-0000-000000000000).
17999    pub request_id: std::string::String,
18000
18001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18002}
18003
18004impl DeletePolicyBasedRouteRequest {
18005    /// Creates a new default instance.
18006    pub fn new() -> Self {
18007        std::default::Default::default()
18008    }
18009
18010    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
18011    ///
18012    /// # Example
18013    /// ```ignore,no_run
18014    /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18015    /// let x = DeletePolicyBasedRouteRequest::new().set_name("example");
18016    /// ```
18017    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18018        self.name = v.into();
18019        self
18020    }
18021
18022    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
18023    ///
18024    /// # Example
18025    /// ```ignore,no_run
18026    /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18027    /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
18028    /// ```
18029    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18030        self.request_id = v.into();
18031        self
18032    }
18033}
18034
18035impl wkt::message::Message for DeletePolicyBasedRouteRequest {
18036    fn typename() -> &'static str {
18037        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
18038    }
18039}
18040
18041/// The infrastructure used for connections between consumers/producers.
18042///
18043/// # Working with unknown values
18044///
18045/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18046/// additional enum variants at any time. Adding new variants is not considered
18047/// a breaking change. Applications should write their code in anticipation of:
18048///
18049/// - New values appearing in future releases of the client library, **and**
18050/// - New values received dynamically, without application changes.
18051///
18052/// Please consult the [Working with enums] section in the user guide for some
18053/// guidelines.
18054///
18055/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18056#[derive(Clone, Debug, PartialEq)]
18057#[non_exhaustive]
18058pub enum Infrastructure {
18059    /// An invalid infrastructure as the default case.
18060    Unspecified,
18061    /// Private Service Connect is used for connections.
18062    Psc,
18063    /// If set, the enum was initialized with an unknown value.
18064    ///
18065    /// Applications can examine the value using [Infrastructure::value] or
18066    /// [Infrastructure::name].
18067    UnknownValue(infrastructure::UnknownValue),
18068}
18069
18070#[doc(hidden)]
18071pub mod infrastructure {
18072    #[allow(unused_imports)]
18073    use super::*;
18074    #[derive(Clone, Debug, PartialEq)]
18075    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18076}
18077
18078impl Infrastructure {
18079    /// Gets the enum value.
18080    ///
18081    /// Returns `None` if the enum contains an unknown value deserialized from
18082    /// the string representation of enums.
18083    pub fn value(&self) -> std::option::Option<i32> {
18084        match self {
18085            Self::Unspecified => std::option::Option::Some(0),
18086            Self::Psc => std::option::Option::Some(1),
18087            Self::UnknownValue(u) => u.0.value(),
18088        }
18089    }
18090
18091    /// Gets the enum value as a string.
18092    ///
18093    /// Returns `None` if the enum contains an unknown value deserialized from
18094    /// the integer representation of enums.
18095    pub fn name(&self) -> std::option::Option<&str> {
18096        match self {
18097            Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
18098            Self::Psc => std::option::Option::Some("PSC"),
18099            Self::UnknownValue(u) => u.0.name(),
18100        }
18101    }
18102}
18103
18104impl std::default::Default for Infrastructure {
18105    fn default() -> Self {
18106        use std::convert::From;
18107        Self::from(0)
18108    }
18109}
18110
18111impl std::fmt::Display for Infrastructure {
18112    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18113        wkt::internal::display_enum(f, self.name(), self.value())
18114    }
18115}
18116
18117impl std::convert::From<i32> for Infrastructure {
18118    fn from(value: i32) -> Self {
18119        match value {
18120            0 => Self::Unspecified,
18121            1 => Self::Psc,
18122            _ => Self::UnknownValue(infrastructure::UnknownValue(
18123                wkt::internal::UnknownEnumValue::Integer(value),
18124            )),
18125        }
18126    }
18127}
18128
18129impl std::convert::From<&str> for Infrastructure {
18130    fn from(value: &str) -> Self {
18131        use std::string::ToString;
18132        match value {
18133            "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
18134            "PSC" => Self::Psc,
18135            _ => Self::UnknownValue(infrastructure::UnknownValue(
18136                wkt::internal::UnknownEnumValue::String(value.to_string()),
18137            )),
18138        }
18139    }
18140}
18141
18142impl serde::ser::Serialize for Infrastructure {
18143    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18144    where
18145        S: serde::Serializer,
18146    {
18147        match self {
18148            Self::Unspecified => serializer.serialize_i32(0),
18149            Self::Psc => serializer.serialize_i32(1),
18150            Self::UnknownValue(u) => u.0.serialize(serializer),
18151        }
18152    }
18153}
18154
18155impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18156    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18157    where
18158        D: serde::Deserializer<'de>,
18159    {
18160        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18161            ".google.cloud.networkconnectivity.v1.Infrastructure",
18162        ))
18163    }
18164}
18165
18166/// The error type indicates whether a connection error is consumer facing,
18167/// producer facing or system internal.
18168///
18169/// # Working with unknown values
18170///
18171/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18172/// additional enum variants at any time. Adding new variants is not considered
18173/// a breaking change. Applications should write their code in anticipation of:
18174///
18175/// - New values appearing in future releases of the client library, **and**
18176/// - New values received dynamically, without application changes.
18177///
18178/// Please consult the [Working with enums] section in the user guide for some
18179/// guidelines.
18180///
18181/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18182#[derive(Clone, Debug, PartialEq)]
18183#[non_exhaustive]
18184pub enum ConnectionErrorType {
18185    /// An invalid error type as the default case.
18186    Unspecified,
18187    /// The error is due to Service Automation system internal.
18188    ErrorInternal,
18189    /// The error is due to the setup on consumer side.
18190    ErrorConsumerSide,
18191    /// The error is due to the setup on producer side.
18192    ErrorProducerSide,
18193    /// If set, the enum was initialized with an unknown value.
18194    ///
18195    /// Applications can examine the value using [ConnectionErrorType::value] or
18196    /// [ConnectionErrorType::name].
18197    UnknownValue(connection_error_type::UnknownValue),
18198}
18199
18200#[doc(hidden)]
18201pub mod connection_error_type {
18202    #[allow(unused_imports)]
18203    use super::*;
18204    #[derive(Clone, Debug, PartialEq)]
18205    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18206}
18207
18208impl ConnectionErrorType {
18209    /// Gets the enum value.
18210    ///
18211    /// Returns `None` if the enum contains an unknown value deserialized from
18212    /// the string representation of enums.
18213    pub fn value(&self) -> std::option::Option<i32> {
18214        match self {
18215            Self::Unspecified => std::option::Option::Some(0),
18216            Self::ErrorInternal => std::option::Option::Some(1),
18217            Self::ErrorConsumerSide => std::option::Option::Some(2),
18218            Self::ErrorProducerSide => std::option::Option::Some(3),
18219            Self::UnknownValue(u) => u.0.value(),
18220        }
18221    }
18222
18223    /// Gets the enum value as a string.
18224    ///
18225    /// Returns `None` if the enum contains an unknown value deserialized from
18226    /// the integer representation of enums.
18227    pub fn name(&self) -> std::option::Option<&str> {
18228        match self {
18229            Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18230            Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18231            Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18232            Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18233            Self::UnknownValue(u) => u.0.name(),
18234        }
18235    }
18236}
18237
18238impl std::default::Default for ConnectionErrorType {
18239    fn default() -> Self {
18240        use std::convert::From;
18241        Self::from(0)
18242    }
18243}
18244
18245impl std::fmt::Display for ConnectionErrorType {
18246    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18247        wkt::internal::display_enum(f, self.name(), self.value())
18248    }
18249}
18250
18251impl std::convert::From<i32> for ConnectionErrorType {
18252    fn from(value: i32) -> Self {
18253        match value {
18254            0 => Self::Unspecified,
18255            1 => Self::ErrorInternal,
18256            2 => Self::ErrorConsumerSide,
18257            3 => Self::ErrorProducerSide,
18258            _ => Self::UnknownValue(connection_error_type::UnknownValue(
18259                wkt::internal::UnknownEnumValue::Integer(value),
18260            )),
18261        }
18262    }
18263}
18264
18265impl std::convert::From<&str> for ConnectionErrorType {
18266    fn from(value: &str) -> Self {
18267        use std::string::ToString;
18268        match value {
18269            "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18270            "ERROR_INTERNAL" => Self::ErrorInternal,
18271            "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18272            "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18273            _ => Self::UnknownValue(connection_error_type::UnknownValue(
18274                wkt::internal::UnknownEnumValue::String(value.to_string()),
18275            )),
18276        }
18277    }
18278}
18279
18280impl serde::ser::Serialize for ConnectionErrorType {
18281    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18282    where
18283        S: serde::Serializer,
18284    {
18285        match self {
18286            Self::Unspecified => serializer.serialize_i32(0),
18287            Self::ErrorInternal => serializer.serialize_i32(1),
18288            Self::ErrorConsumerSide => serializer.serialize_i32(2),
18289            Self::ErrorProducerSide => serializer.serialize_i32(3),
18290            Self::UnknownValue(u) => u.0.serialize(serializer),
18291        }
18292    }
18293}
18294
18295impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18296    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18297    where
18298        D: serde::Deserializer<'de>,
18299    {
18300        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18301            ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18302        ))
18303    }
18304}
18305
18306/// The requested IP version for the PSC connection.
18307///
18308/// # Working with unknown values
18309///
18310/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18311/// additional enum variants at any time. Adding new variants is not considered
18312/// a breaking change. Applications should write their code in anticipation of:
18313///
18314/// - New values appearing in future releases of the client library, **and**
18315/// - New values received dynamically, without application changes.
18316///
18317/// Please consult the [Working with enums] section in the user guide for some
18318/// guidelines.
18319///
18320/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18321#[derive(Clone, Debug, PartialEq)]
18322#[non_exhaustive]
18323pub enum IPVersion {
18324    /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18325    /// first available subnetwork.
18326    Unspecified,
18327    /// Will use IPv4 only.
18328    Ipv4,
18329    /// Will use IPv6 only.
18330    Ipv6,
18331    /// If set, the enum was initialized with an unknown value.
18332    ///
18333    /// Applications can examine the value using [IPVersion::value] or
18334    /// [IPVersion::name].
18335    UnknownValue(ip_version::UnknownValue),
18336}
18337
18338#[doc(hidden)]
18339pub mod ip_version {
18340    #[allow(unused_imports)]
18341    use super::*;
18342    #[derive(Clone, Debug, PartialEq)]
18343    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18344}
18345
18346impl IPVersion {
18347    /// Gets the enum value.
18348    ///
18349    /// Returns `None` if the enum contains an unknown value deserialized from
18350    /// the string representation of enums.
18351    pub fn value(&self) -> std::option::Option<i32> {
18352        match self {
18353            Self::Unspecified => std::option::Option::Some(0),
18354            Self::Ipv4 => std::option::Option::Some(1),
18355            Self::Ipv6 => std::option::Option::Some(2),
18356            Self::UnknownValue(u) => u.0.value(),
18357        }
18358    }
18359
18360    /// Gets the enum value as a string.
18361    ///
18362    /// Returns `None` if the enum contains an unknown value deserialized from
18363    /// the integer representation of enums.
18364    pub fn name(&self) -> std::option::Option<&str> {
18365        match self {
18366            Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18367            Self::Ipv4 => std::option::Option::Some("IPV4"),
18368            Self::Ipv6 => std::option::Option::Some("IPV6"),
18369            Self::UnknownValue(u) => u.0.name(),
18370        }
18371    }
18372}
18373
18374impl std::default::Default for IPVersion {
18375    fn default() -> Self {
18376        use std::convert::From;
18377        Self::from(0)
18378    }
18379}
18380
18381impl std::fmt::Display for IPVersion {
18382    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18383        wkt::internal::display_enum(f, self.name(), self.value())
18384    }
18385}
18386
18387impl std::convert::From<i32> for IPVersion {
18388    fn from(value: i32) -> Self {
18389        match value {
18390            0 => Self::Unspecified,
18391            1 => Self::Ipv4,
18392            2 => Self::Ipv6,
18393            _ => Self::UnknownValue(ip_version::UnknownValue(
18394                wkt::internal::UnknownEnumValue::Integer(value),
18395            )),
18396        }
18397    }
18398}
18399
18400impl std::convert::From<&str> for IPVersion {
18401    fn from(value: &str) -> Self {
18402        use std::string::ToString;
18403        match value {
18404            "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18405            "IPV4" => Self::Ipv4,
18406            "IPV6" => Self::Ipv6,
18407            _ => Self::UnknownValue(ip_version::UnknownValue(
18408                wkt::internal::UnknownEnumValue::String(value.to_string()),
18409            )),
18410        }
18411    }
18412}
18413
18414impl serde::ser::Serialize for IPVersion {
18415    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18416    where
18417        S: serde::Serializer,
18418    {
18419        match self {
18420            Self::Unspecified => serializer.serialize_i32(0),
18421            Self::Ipv4 => serializer.serialize_i32(1),
18422            Self::Ipv6 => serializer.serialize_i32(2),
18423            Self::UnknownValue(u) => u.0.serialize(serializer),
18424        }
18425    }
18426}
18427
18428impl<'de> serde::de::Deserialize<'de> for IPVersion {
18429    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18430    where
18431        D: serde::Deserializer<'de>,
18432    {
18433        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18434            ".google.cloud.networkconnectivity.v1.IPVersion",
18435        ))
18436    }
18437}
18438
18439/// Supported features for a location
18440///
18441/// # Working with unknown values
18442///
18443/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18444/// additional enum variants at any time. Adding new variants is not considered
18445/// a breaking change. Applications should write their code in anticipation of:
18446///
18447/// - New values appearing in future releases of the client library, **and**
18448/// - New values received dynamically, without application changes.
18449///
18450/// Please consult the [Working with enums] section in the user guide for some
18451/// guidelines.
18452///
18453/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18454#[derive(Clone, Debug, PartialEq)]
18455#[non_exhaustive]
18456pub enum LocationFeature {
18457    /// No publicly supported feature in this location
18458    Unspecified,
18459    /// Site-to-cloud spokes are supported in this location
18460    SiteToCloudSpokes,
18461    /// Site-to-site spokes are supported in this location
18462    SiteToSiteSpokes,
18463    /// If set, the enum was initialized with an unknown value.
18464    ///
18465    /// Applications can examine the value using [LocationFeature::value] or
18466    /// [LocationFeature::name].
18467    UnknownValue(location_feature::UnknownValue),
18468}
18469
18470#[doc(hidden)]
18471pub mod location_feature {
18472    #[allow(unused_imports)]
18473    use super::*;
18474    #[derive(Clone, Debug, PartialEq)]
18475    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18476}
18477
18478impl LocationFeature {
18479    /// Gets the enum value.
18480    ///
18481    /// Returns `None` if the enum contains an unknown value deserialized from
18482    /// the string representation of enums.
18483    pub fn value(&self) -> std::option::Option<i32> {
18484        match self {
18485            Self::Unspecified => std::option::Option::Some(0),
18486            Self::SiteToCloudSpokes => std::option::Option::Some(1),
18487            Self::SiteToSiteSpokes => std::option::Option::Some(2),
18488            Self::UnknownValue(u) => u.0.value(),
18489        }
18490    }
18491
18492    /// Gets the enum value as a string.
18493    ///
18494    /// Returns `None` if the enum contains an unknown value deserialized from
18495    /// the integer representation of enums.
18496    pub fn name(&self) -> std::option::Option<&str> {
18497        match self {
18498            Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18499            Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18500            Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18501            Self::UnknownValue(u) => u.0.name(),
18502        }
18503    }
18504}
18505
18506impl std::default::Default for LocationFeature {
18507    fn default() -> Self {
18508        use std::convert::From;
18509        Self::from(0)
18510    }
18511}
18512
18513impl std::fmt::Display for LocationFeature {
18514    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18515        wkt::internal::display_enum(f, self.name(), self.value())
18516    }
18517}
18518
18519impl std::convert::From<i32> for LocationFeature {
18520    fn from(value: i32) -> Self {
18521        match value {
18522            0 => Self::Unspecified,
18523            1 => Self::SiteToCloudSpokes,
18524            2 => Self::SiteToSiteSpokes,
18525            _ => Self::UnknownValue(location_feature::UnknownValue(
18526                wkt::internal::UnknownEnumValue::Integer(value),
18527            )),
18528        }
18529    }
18530}
18531
18532impl std::convert::From<&str> for LocationFeature {
18533    fn from(value: &str) -> Self {
18534        use std::string::ToString;
18535        match value {
18536            "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18537            "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18538            "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18539            _ => Self::UnknownValue(location_feature::UnknownValue(
18540                wkt::internal::UnknownEnumValue::String(value.to_string()),
18541            )),
18542        }
18543    }
18544}
18545
18546impl serde::ser::Serialize for LocationFeature {
18547    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18548    where
18549        S: serde::Serializer,
18550    {
18551        match self {
18552            Self::Unspecified => serializer.serialize_i32(0),
18553            Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18554            Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18555            Self::UnknownValue(u) => u.0.serialize(serializer),
18556        }
18557    }
18558}
18559
18560impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18561    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18562    where
18563        D: serde::Deserializer<'de>,
18564    {
18565        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18566            ".google.cloud.networkconnectivity.v1.LocationFeature",
18567        ))
18568    }
18569}
18570
18571/// The route's type
18572///
18573/// # Working with unknown values
18574///
18575/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18576/// additional enum variants at any time. Adding new variants is not considered
18577/// a breaking change. Applications should write their code in anticipation of:
18578///
18579/// - New values appearing in future releases of the client library, **and**
18580/// - New values received dynamically, without application changes.
18581///
18582/// Please consult the [Working with enums] section in the user guide for some
18583/// guidelines.
18584///
18585/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18586#[derive(Clone, Debug, PartialEq)]
18587#[non_exhaustive]
18588pub enum RouteType {
18589    /// No route type information specified
18590    Unspecified,
18591    /// The route leads to a destination within the primary address range of the
18592    /// VPC network's subnet.
18593    VpcPrimarySubnet,
18594    /// The route leads to a destination within the secondary address range of the
18595    /// VPC network's subnet.
18596    VpcSecondarySubnet,
18597    /// The route leads to a destination in a dynamic route. Dynamic routes are
18598    /// derived from Border Gateway Protocol (BGP) advertisements received from an
18599    /// NCC hybrid spoke.
18600    DynamicRoute,
18601    /// If set, the enum was initialized with an unknown value.
18602    ///
18603    /// Applications can examine the value using [RouteType::value] or
18604    /// [RouteType::name].
18605    UnknownValue(route_type::UnknownValue),
18606}
18607
18608#[doc(hidden)]
18609pub mod route_type {
18610    #[allow(unused_imports)]
18611    use super::*;
18612    #[derive(Clone, Debug, PartialEq)]
18613    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18614}
18615
18616impl RouteType {
18617    /// Gets the enum value.
18618    ///
18619    /// Returns `None` if the enum contains an unknown value deserialized from
18620    /// the string representation of enums.
18621    pub fn value(&self) -> std::option::Option<i32> {
18622        match self {
18623            Self::Unspecified => std::option::Option::Some(0),
18624            Self::VpcPrimarySubnet => std::option::Option::Some(1),
18625            Self::VpcSecondarySubnet => std::option::Option::Some(2),
18626            Self::DynamicRoute => std::option::Option::Some(3),
18627            Self::UnknownValue(u) => u.0.value(),
18628        }
18629    }
18630
18631    /// Gets the enum value as a string.
18632    ///
18633    /// Returns `None` if the enum contains an unknown value deserialized from
18634    /// the integer representation of enums.
18635    pub fn name(&self) -> std::option::Option<&str> {
18636        match self {
18637            Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18638            Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18639            Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18640            Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18641            Self::UnknownValue(u) => u.0.name(),
18642        }
18643    }
18644}
18645
18646impl std::default::Default for RouteType {
18647    fn default() -> Self {
18648        use std::convert::From;
18649        Self::from(0)
18650    }
18651}
18652
18653impl std::fmt::Display for RouteType {
18654    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18655        wkt::internal::display_enum(f, self.name(), self.value())
18656    }
18657}
18658
18659impl std::convert::From<i32> for RouteType {
18660    fn from(value: i32) -> Self {
18661        match value {
18662            0 => Self::Unspecified,
18663            1 => Self::VpcPrimarySubnet,
18664            2 => Self::VpcSecondarySubnet,
18665            3 => Self::DynamicRoute,
18666            _ => Self::UnknownValue(route_type::UnknownValue(
18667                wkt::internal::UnknownEnumValue::Integer(value),
18668            )),
18669        }
18670    }
18671}
18672
18673impl std::convert::From<&str> for RouteType {
18674    fn from(value: &str) -> Self {
18675        use std::string::ToString;
18676        match value {
18677            "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18678            "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18679            "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18680            "DYNAMIC_ROUTE" => Self::DynamicRoute,
18681            _ => Self::UnknownValue(route_type::UnknownValue(
18682                wkt::internal::UnknownEnumValue::String(value.to_string()),
18683            )),
18684        }
18685    }
18686}
18687
18688impl serde::ser::Serialize for RouteType {
18689    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18690    where
18691        S: serde::Serializer,
18692    {
18693        match self {
18694            Self::Unspecified => serializer.serialize_i32(0),
18695            Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18696            Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18697            Self::DynamicRoute => serializer.serialize_i32(3),
18698            Self::UnknownValue(u) => u.0.serialize(serializer),
18699        }
18700    }
18701}
18702
18703impl<'de> serde::de::Deserialize<'de> for RouteType {
18704    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18705    where
18706        D: serde::Deserializer<'de>,
18707    {
18708        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18709            ".google.cloud.networkconnectivity.v1.RouteType",
18710        ))
18711    }
18712}
18713
18714/// The State enum represents the lifecycle stage of a Network Connectivity
18715/// Center resource.
18716///
18717/// # Working with unknown values
18718///
18719/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18720/// additional enum variants at any time. Adding new variants is not considered
18721/// a breaking change. Applications should write their code in anticipation of:
18722///
18723/// - New values appearing in future releases of the client library, **and**
18724/// - New values received dynamically, without application changes.
18725///
18726/// Please consult the [Working with enums] section in the user guide for some
18727/// guidelines.
18728///
18729/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18730#[derive(Clone, Debug, PartialEq)]
18731#[non_exhaustive]
18732pub enum State {
18733    /// No state information available
18734    Unspecified,
18735    /// The resource's create operation is in progress.
18736    Creating,
18737    /// The resource is active
18738    Active,
18739    /// The resource's delete operation is in progress.
18740    Deleting,
18741    /// The resource's accept operation is in progress.
18742    Accepting,
18743    /// The resource's reject operation is in progress.
18744    Rejecting,
18745    /// The resource's update operation is in progress.
18746    Updating,
18747    /// The resource is inactive.
18748    Inactive,
18749    /// The hub associated with this spoke resource has been deleted.
18750    /// This state applies to spoke resources only.
18751    Obsolete,
18752    /// The resource is in an undefined state due to resource creation or deletion
18753    /// failure. You can try to delete the resource later or contact support for
18754    /// help.
18755    Failed,
18756    /// If set, the enum was initialized with an unknown value.
18757    ///
18758    /// Applications can examine the value using [State::value] or
18759    /// [State::name].
18760    UnknownValue(state::UnknownValue),
18761}
18762
18763#[doc(hidden)]
18764pub mod state {
18765    #[allow(unused_imports)]
18766    use super::*;
18767    #[derive(Clone, Debug, PartialEq)]
18768    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18769}
18770
18771impl State {
18772    /// Gets the enum value.
18773    ///
18774    /// Returns `None` if the enum contains an unknown value deserialized from
18775    /// the string representation of enums.
18776    pub fn value(&self) -> std::option::Option<i32> {
18777        match self {
18778            Self::Unspecified => std::option::Option::Some(0),
18779            Self::Creating => std::option::Option::Some(1),
18780            Self::Active => std::option::Option::Some(2),
18781            Self::Deleting => std::option::Option::Some(3),
18782            Self::Accepting => std::option::Option::Some(8),
18783            Self::Rejecting => std::option::Option::Some(9),
18784            Self::Updating => std::option::Option::Some(6),
18785            Self::Inactive => std::option::Option::Some(7),
18786            Self::Obsolete => std::option::Option::Some(10),
18787            Self::Failed => std::option::Option::Some(11),
18788            Self::UnknownValue(u) => u.0.value(),
18789        }
18790    }
18791
18792    /// Gets the enum value as a string.
18793    ///
18794    /// Returns `None` if the enum contains an unknown value deserialized from
18795    /// the integer representation of enums.
18796    pub fn name(&self) -> std::option::Option<&str> {
18797        match self {
18798            Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18799            Self::Creating => std::option::Option::Some("CREATING"),
18800            Self::Active => std::option::Option::Some("ACTIVE"),
18801            Self::Deleting => std::option::Option::Some("DELETING"),
18802            Self::Accepting => std::option::Option::Some("ACCEPTING"),
18803            Self::Rejecting => std::option::Option::Some("REJECTING"),
18804            Self::Updating => std::option::Option::Some("UPDATING"),
18805            Self::Inactive => std::option::Option::Some("INACTIVE"),
18806            Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18807            Self::Failed => std::option::Option::Some("FAILED"),
18808            Self::UnknownValue(u) => u.0.name(),
18809        }
18810    }
18811}
18812
18813impl std::default::Default for State {
18814    fn default() -> Self {
18815        use std::convert::From;
18816        Self::from(0)
18817    }
18818}
18819
18820impl std::fmt::Display for State {
18821    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18822        wkt::internal::display_enum(f, self.name(), self.value())
18823    }
18824}
18825
18826impl std::convert::From<i32> for State {
18827    fn from(value: i32) -> Self {
18828        match value {
18829            0 => Self::Unspecified,
18830            1 => Self::Creating,
18831            2 => Self::Active,
18832            3 => Self::Deleting,
18833            6 => Self::Updating,
18834            7 => Self::Inactive,
18835            8 => Self::Accepting,
18836            9 => Self::Rejecting,
18837            10 => Self::Obsolete,
18838            11 => Self::Failed,
18839            _ => Self::UnknownValue(state::UnknownValue(
18840                wkt::internal::UnknownEnumValue::Integer(value),
18841            )),
18842        }
18843    }
18844}
18845
18846impl std::convert::From<&str> for State {
18847    fn from(value: &str) -> Self {
18848        use std::string::ToString;
18849        match value {
18850            "STATE_UNSPECIFIED" => Self::Unspecified,
18851            "CREATING" => Self::Creating,
18852            "ACTIVE" => Self::Active,
18853            "DELETING" => Self::Deleting,
18854            "ACCEPTING" => Self::Accepting,
18855            "REJECTING" => Self::Rejecting,
18856            "UPDATING" => Self::Updating,
18857            "INACTIVE" => Self::Inactive,
18858            "OBSOLETE" => Self::Obsolete,
18859            "FAILED" => Self::Failed,
18860            _ => Self::UnknownValue(state::UnknownValue(
18861                wkt::internal::UnknownEnumValue::String(value.to_string()),
18862            )),
18863        }
18864    }
18865}
18866
18867impl serde::ser::Serialize for State {
18868    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18869    where
18870        S: serde::Serializer,
18871    {
18872        match self {
18873            Self::Unspecified => serializer.serialize_i32(0),
18874            Self::Creating => serializer.serialize_i32(1),
18875            Self::Active => serializer.serialize_i32(2),
18876            Self::Deleting => serializer.serialize_i32(3),
18877            Self::Accepting => serializer.serialize_i32(8),
18878            Self::Rejecting => serializer.serialize_i32(9),
18879            Self::Updating => serializer.serialize_i32(6),
18880            Self::Inactive => serializer.serialize_i32(7),
18881            Self::Obsolete => serializer.serialize_i32(10),
18882            Self::Failed => serializer.serialize_i32(11),
18883            Self::UnknownValue(u) => u.0.serialize(serializer),
18884        }
18885    }
18886}
18887
18888impl<'de> serde::de::Deserialize<'de> for State {
18889    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18890    where
18891        D: serde::Deserializer<'de>,
18892    {
18893        deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18894            ".google.cloud.networkconnectivity.v1.State",
18895        ))
18896    }
18897}
18898
18899/// The SpokeType enum represents the type of spoke. The type
18900/// reflects the kind of resource that a spoke is associated with.
18901///
18902/// # Working with unknown values
18903///
18904/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18905/// additional enum variants at any time. Adding new variants is not considered
18906/// a breaking change. Applications should write their code in anticipation of:
18907///
18908/// - New values appearing in future releases of the client library, **and**
18909/// - New values received dynamically, without application changes.
18910///
18911/// Please consult the [Working with enums] section in the user guide for some
18912/// guidelines.
18913///
18914/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18915#[derive(Clone, Debug, PartialEq)]
18916#[non_exhaustive]
18917pub enum SpokeType {
18918    /// Unspecified spoke type.
18919    Unspecified,
18920    /// Spokes associated with VPN tunnels.
18921    VpnTunnel,
18922    /// Spokes associated with VLAN attachments.
18923    InterconnectAttachment,
18924    /// Spokes associated with router appliance instances.
18925    RouterAppliance,
18926    /// Spokes associated with VPC networks.
18927    VpcNetwork,
18928    /// Spokes that are backed by a producer VPC network.
18929    ProducerVpcNetwork,
18930    /// If set, the enum was initialized with an unknown value.
18931    ///
18932    /// Applications can examine the value using [SpokeType::value] or
18933    /// [SpokeType::name].
18934    UnknownValue(spoke_type::UnknownValue),
18935}
18936
18937#[doc(hidden)]
18938pub mod spoke_type {
18939    #[allow(unused_imports)]
18940    use super::*;
18941    #[derive(Clone, Debug, PartialEq)]
18942    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18943}
18944
18945impl SpokeType {
18946    /// Gets the enum value.
18947    ///
18948    /// Returns `None` if the enum contains an unknown value deserialized from
18949    /// the string representation of enums.
18950    pub fn value(&self) -> std::option::Option<i32> {
18951        match self {
18952            Self::Unspecified => std::option::Option::Some(0),
18953            Self::VpnTunnel => std::option::Option::Some(1),
18954            Self::InterconnectAttachment => std::option::Option::Some(2),
18955            Self::RouterAppliance => std::option::Option::Some(3),
18956            Self::VpcNetwork => std::option::Option::Some(4),
18957            Self::ProducerVpcNetwork => std::option::Option::Some(7),
18958            Self::UnknownValue(u) => u.0.value(),
18959        }
18960    }
18961
18962    /// Gets the enum value as a string.
18963    ///
18964    /// Returns `None` if the enum contains an unknown value deserialized from
18965    /// the integer representation of enums.
18966    pub fn name(&self) -> std::option::Option<&str> {
18967        match self {
18968            Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
18969            Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18970            Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
18971            Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
18972            Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
18973            Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
18974            Self::UnknownValue(u) => u.0.name(),
18975        }
18976    }
18977}
18978
18979impl std::default::Default for SpokeType {
18980    fn default() -> Self {
18981        use std::convert::From;
18982        Self::from(0)
18983    }
18984}
18985
18986impl std::fmt::Display for SpokeType {
18987    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18988        wkt::internal::display_enum(f, self.name(), self.value())
18989    }
18990}
18991
18992impl std::convert::From<i32> for SpokeType {
18993    fn from(value: i32) -> Self {
18994        match value {
18995            0 => Self::Unspecified,
18996            1 => Self::VpnTunnel,
18997            2 => Self::InterconnectAttachment,
18998            3 => Self::RouterAppliance,
18999            4 => Self::VpcNetwork,
19000            7 => Self::ProducerVpcNetwork,
19001            _ => Self::UnknownValue(spoke_type::UnknownValue(
19002                wkt::internal::UnknownEnumValue::Integer(value),
19003            )),
19004        }
19005    }
19006}
19007
19008impl std::convert::From<&str> for SpokeType {
19009    fn from(value: &str) -> Self {
19010        use std::string::ToString;
19011        match value {
19012            "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
19013            "VPN_TUNNEL" => Self::VpnTunnel,
19014            "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19015            "ROUTER_APPLIANCE" => Self::RouterAppliance,
19016            "VPC_NETWORK" => Self::VpcNetwork,
19017            "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
19018            _ => Self::UnknownValue(spoke_type::UnknownValue(
19019                wkt::internal::UnknownEnumValue::String(value.to_string()),
19020            )),
19021        }
19022    }
19023}
19024
19025impl serde::ser::Serialize for SpokeType {
19026    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19027    where
19028        S: serde::Serializer,
19029    {
19030        match self {
19031            Self::Unspecified => serializer.serialize_i32(0),
19032            Self::VpnTunnel => serializer.serialize_i32(1),
19033            Self::InterconnectAttachment => serializer.serialize_i32(2),
19034            Self::RouterAppliance => serializer.serialize_i32(3),
19035            Self::VpcNetwork => serializer.serialize_i32(4),
19036            Self::ProducerVpcNetwork => serializer.serialize_i32(7),
19037            Self::UnknownValue(u) => u.0.serialize(serializer),
19038        }
19039    }
19040}
19041
19042impl<'de> serde::de::Deserialize<'de> for SpokeType {
19043    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19044    where
19045        D: serde::Deserializer<'de>,
19046    {
19047        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
19048            ".google.cloud.networkconnectivity.v1.SpokeType",
19049        ))
19050    }
19051}
19052
19053/// This enum controls the policy mode used in a hub.
19054///
19055/// # Working with unknown values
19056///
19057/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19058/// additional enum variants at any time. Adding new variants is not considered
19059/// a breaking change. Applications should write their code in anticipation of:
19060///
19061/// - New values appearing in future releases of the client library, **and**
19062/// - New values received dynamically, without application changes.
19063///
19064/// Please consult the [Working with enums] section in the user guide for some
19065/// guidelines.
19066///
19067/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19068#[derive(Clone, Debug, PartialEq)]
19069#[non_exhaustive]
19070pub enum PolicyMode {
19071    /// Policy mode is unspecified. It defaults to PRESET
19072    /// with preset_topology = MESH.
19073    Unspecified,
19074    /// Hub uses one of the preset topologies.
19075    Preset,
19076    /// If set, the enum was initialized with an unknown value.
19077    ///
19078    /// Applications can examine the value using [PolicyMode::value] or
19079    /// [PolicyMode::name].
19080    UnknownValue(policy_mode::UnknownValue),
19081}
19082
19083#[doc(hidden)]
19084pub mod policy_mode {
19085    #[allow(unused_imports)]
19086    use super::*;
19087    #[derive(Clone, Debug, PartialEq)]
19088    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19089}
19090
19091impl PolicyMode {
19092    /// Gets the enum value.
19093    ///
19094    /// Returns `None` if the enum contains an unknown value deserialized from
19095    /// the string representation of enums.
19096    pub fn value(&self) -> std::option::Option<i32> {
19097        match self {
19098            Self::Unspecified => std::option::Option::Some(0),
19099            Self::Preset => std::option::Option::Some(1),
19100            Self::UnknownValue(u) => u.0.value(),
19101        }
19102    }
19103
19104    /// Gets the enum value as a string.
19105    ///
19106    /// Returns `None` if the enum contains an unknown value deserialized from
19107    /// the integer representation of enums.
19108    pub fn name(&self) -> std::option::Option<&str> {
19109        match self {
19110            Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
19111            Self::Preset => std::option::Option::Some("PRESET"),
19112            Self::UnknownValue(u) => u.0.name(),
19113        }
19114    }
19115}
19116
19117impl std::default::Default for PolicyMode {
19118    fn default() -> Self {
19119        use std::convert::From;
19120        Self::from(0)
19121    }
19122}
19123
19124impl std::fmt::Display for PolicyMode {
19125    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19126        wkt::internal::display_enum(f, self.name(), self.value())
19127    }
19128}
19129
19130impl std::convert::From<i32> for PolicyMode {
19131    fn from(value: i32) -> Self {
19132        match value {
19133            0 => Self::Unspecified,
19134            1 => Self::Preset,
19135            _ => Self::UnknownValue(policy_mode::UnknownValue(
19136                wkt::internal::UnknownEnumValue::Integer(value),
19137            )),
19138        }
19139    }
19140}
19141
19142impl std::convert::From<&str> for PolicyMode {
19143    fn from(value: &str) -> Self {
19144        use std::string::ToString;
19145        match value {
19146            "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19147            "PRESET" => Self::Preset,
19148            _ => Self::UnknownValue(policy_mode::UnknownValue(
19149                wkt::internal::UnknownEnumValue::String(value.to_string()),
19150            )),
19151        }
19152    }
19153}
19154
19155impl serde::ser::Serialize for PolicyMode {
19156    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19157    where
19158        S: serde::Serializer,
19159    {
19160        match self {
19161            Self::Unspecified => serializer.serialize_i32(0),
19162            Self::Preset => serializer.serialize_i32(1),
19163            Self::UnknownValue(u) => u.0.serialize(serializer),
19164        }
19165    }
19166}
19167
19168impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19169    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19170    where
19171        D: serde::Deserializer<'de>,
19172    {
19173        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19174            ".google.cloud.networkconnectivity.v1.PolicyMode",
19175        ))
19176    }
19177}
19178
19179/// The list of available preset topologies.
19180///
19181/// # Working with unknown values
19182///
19183/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19184/// additional enum variants at any time. Adding new variants is not considered
19185/// a breaking change. Applications should write their code in anticipation of:
19186///
19187/// - New values appearing in future releases of the client library, **and**
19188/// - New values received dynamically, without application changes.
19189///
19190/// Please consult the [Working with enums] section in the user guide for some
19191/// guidelines.
19192///
19193/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19194#[derive(Clone, Debug, PartialEq)]
19195#[non_exhaustive]
19196pub enum PresetTopology {
19197    /// Preset topology is unspecified. When policy_mode = PRESET,
19198    /// it defaults to MESH.
19199    Unspecified,
19200    /// Mesh topology is implemented. Group `default` is automatically created.
19201    /// All spokes in the hub are added to group `default`.
19202    Mesh,
19203    /// Star topology is implemented. Two groups, `center` and `edge`, are
19204    /// automatically created along with hub creation. Spokes have to join one of
19205    /// the groups during creation.
19206    Star,
19207    /// If set, the enum was initialized with an unknown value.
19208    ///
19209    /// Applications can examine the value using [PresetTopology::value] or
19210    /// [PresetTopology::name].
19211    UnknownValue(preset_topology::UnknownValue),
19212}
19213
19214#[doc(hidden)]
19215pub mod preset_topology {
19216    #[allow(unused_imports)]
19217    use super::*;
19218    #[derive(Clone, Debug, PartialEq)]
19219    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19220}
19221
19222impl PresetTopology {
19223    /// Gets the enum value.
19224    ///
19225    /// Returns `None` if the enum contains an unknown value deserialized from
19226    /// the string representation of enums.
19227    pub fn value(&self) -> std::option::Option<i32> {
19228        match self {
19229            Self::Unspecified => std::option::Option::Some(0),
19230            Self::Mesh => std::option::Option::Some(2),
19231            Self::Star => std::option::Option::Some(3),
19232            Self::UnknownValue(u) => u.0.value(),
19233        }
19234    }
19235
19236    /// Gets the enum value as a string.
19237    ///
19238    /// Returns `None` if the enum contains an unknown value deserialized from
19239    /// the integer representation of enums.
19240    pub fn name(&self) -> std::option::Option<&str> {
19241        match self {
19242            Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19243            Self::Mesh => std::option::Option::Some("MESH"),
19244            Self::Star => std::option::Option::Some("STAR"),
19245            Self::UnknownValue(u) => u.0.name(),
19246        }
19247    }
19248}
19249
19250impl std::default::Default for PresetTopology {
19251    fn default() -> Self {
19252        use std::convert::From;
19253        Self::from(0)
19254    }
19255}
19256
19257impl std::fmt::Display for PresetTopology {
19258    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19259        wkt::internal::display_enum(f, self.name(), self.value())
19260    }
19261}
19262
19263impl std::convert::From<i32> for PresetTopology {
19264    fn from(value: i32) -> Self {
19265        match value {
19266            0 => Self::Unspecified,
19267            2 => Self::Mesh,
19268            3 => Self::Star,
19269            _ => Self::UnknownValue(preset_topology::UnknownValue(
19270                wkt::internal::UnknownEnumValue::Integer(value),
19271            )),
19272        }
19273    }
19274}
19275
19276impl std::convert::From<&str> for PresetTopology {
19277    fn from(value: &str) -> Self {
19278        use std::string::ToString;
19279        match value {
19280            "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19281            "MESH" => Self::Mesh,
19282            "STAR" => Self::Star,
19283            _ => Self::UnknownValue(preset_topology::UnknownValue(
19284                wkt::internal::UnknownEnumValue::String(value.to_string()),
19285            )),
19286        }
19287    }
19288}
19289
19290impl serde::ser::Serialize for PresetTopology {
19291    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19292    where
19293        S: serde::Serializer,
19294    {
19295        match self {
19296            Self::Unspecified => serializer.serialize_i32(0),
19297            Self::Mesh => serializer.serialize_i32(2),
19298            Self::Star => serializer.serialize_i32(3),
19299            Self::UnknownValue(u) => u.0.serialize(serializer),
19300        }
19301    }
19302}
19303
19304impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19305    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19306    where
19307        D: serde::Deserializer<'de>,
19308    {
19309        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19310            ".google.cloud.networkconnectivity.v1.PresetTopology",
19311        ))
19312    }
19313}