google_cloud_networkconnectivity_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38/// Represents the metadata of the long-running operation.
39#[serde_with::serde_as]
40#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(default, rename_all = "camelCase")]
42#[non_exhaustive]
43pub struct OperationMetadata {
44    /// Output only. The time the operation was created.
45    #[serde(skip_serializing_if = "std::option::Option::is_none")]
46    pub create_time: std::option::Option<wkt::Timestamp>,
47
48    /// Output only. The time the operation finished running.
49    #[serde(skip_serializing_if = "std::option::Option::is_none")]
50    pub end_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Server-defined resource path for the target of the operation.
53    #[serde(skip_serializing_if = "std::string::String::is_empty")]
54    pub target: std::string::String,
55
56    /// Output only. Name of the verb executed by the operation.
57    #[serde(skip_serializing_if = "std::string::String::is_empty")]
58    pub verb: std::string::String,
59
60    /// Output only. Human-readable status of the operation, if any.
61    #[serde(skip_serializing_if = "std::string::String::is_empty")]
62    pub status_message: std::string::String,
63
64    /// Output only. Identifies whether the user has requested cancellation
65    /// of the operation. Operations that have been cancelled successfully
66    /// have
67    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
68    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
69    /// corresponding to `Code.CANCELLED`.
70    ///
71    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
72    /// [google.rpc.Status.code]: rpc::model::Status::code
73    pub requested_cancellation: bool,
74
75    /// Output only. API version used to start the operation.
76    #[serde(skip_serializing_if = "std::string::String::is_empty")]
77    pub api_version: std::string::String,
78
79    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
80    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
81}
82
83impl OperationMetadata {
84    pub fn new() -> Self {
85        std::default::Default::default()
86    }
87
88    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
89    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
90        mut self,
91        v: T,
92    ) -> Self {
93        self.create_time = v.into();
94        self
95    }
96
97    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
98    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
99        mut self,
100        v: T,
101    ) -> Self {
102        self.end_time = v.into();
103        self
104    }
105
106    /// Sets the value of [target][crate::model::OperationMetadata::target].
107    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108        self.target = v.into();
109        self
110    }
111
112    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
113    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114        self.verb = v.into();
115        self
116    }
117
118    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
119    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.status_message = v.into();
121        self
122    }
123
124    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
125    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
126        self.requested_cancellation = v.into();
127        self
128    }
129
130    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
131    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132        self.api_version = v.into();
133        self
134    }
135}
136
137impl wkt::message::Message for OperationMetadata {
138    fn typename() -> &'static str {
139        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
140    }
141}
142
143/// The ServiceConnectionMap resource.
144#[serde_with::serde_as]
145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
146#[serde(default, rename_all = "camelCase")]
147#[non_exhaustive]
148pub struct ServiceConnectionMap {
149    /// Immutable. The name of a ServiceConnectionMap.
150    /// Format:
151    /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
152    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
153    #[serde(skip_serializing_if = "std::string::String::is_empty")]
154    pub name: std::string::String,
155
156    /// Output only. Time when the ServiceConnectionMap was created.
157    #[serde(skip_serializing_if = "std::option::Option::is_none")]
158    pub create_time: std::option::Option<wkt::Timestamp>,
159
160    /// Output only. Time when the ServiceConnectionMap was updated.
161    #[serde(skip_serializing_if = "std::option::Option::is_none")]
162    pub update_time: std::option::Option<wkt::Timestamp>,
163
164    /// User-defined labels.
165    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
166    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
167
168    /// A description of this resource.
169    #[serde(skip_serializing_if = "std::string::String::is_empty")]
170    pub description: std::string::String,
171
172    /// The service class identifier this ServiceConnectionMap is for.
173    /// The user of ServiceConnectionMap create API needs to have
174    /// networkconnecitivty.serviceclasses.use iam permission for the service
175    /// class.
176    #[serde(skip_serializing_if = "std::string::String::is_empty")]
177    pub service_class: std::string::String,
178
179    /// Output only. The service class uri this ServiceConnectionMap is for.
180    #[serde(skip_serializing_if = "std::string::String::is_empty")]
181    pub service_class_uri: std::string::String,
182
183    /// Output only. The infrastructure used for connections between
184    /// consumers/producers.
185    pub infrastructure: crate::model::Infrastructure,
186
187    /// The PSC configurations on producer side.
188    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
189    pub producer_psc_configs:
190        std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
191
192    /// The PSC configurations on consumer side.
193    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
194    pub consumer_psc_configs:
195        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
196
197    /// Output only. PSC connection details on consumer side.
198    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
199    pub consumer_psc_connections:
200        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
201
202    /// The token provided by the consumer. This token authenticates that the
203    /// consumer can create a connection within the specified project and network.
204    #[serde(skip_serializing_if = "std::string::String::is_empty")]
205    pub token: std::string::String,
206
207    /// Optional. The etag is computed by the server, and may be sent on update and
208    /// delete requests to ensure the client has an up-to-date value before
209    /// proceeding.
210    #[serde(skip_serializing_if = "std::option::Option::is_none")]
211    pub etag: std::option::Option<std::string::String>,
212
213    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
214    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
215}
216
217impl ServiceConnectionMap {
218    pub fn new() -> Self {
219        std::default::Default::default()
220    }
221
222    /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
223    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
224        self.name = v.into();
225        self
226    }
227
228    /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
229    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
230        mut self,
231        v: T,
232    ) -> Self {
233        self.create_time = v.into();
234        self
235    }
236
237    /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
238    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
239        mut self,
240        v: T,
241    ) -> Self {
242        self.update_time = v.into();
243        self
244    }
245
246    /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
247    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
248        self.description = v.into();
249        self
250    }
251
252    /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
253    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254        self.service_class = v.into();
255        self
256    }
257
258    /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
259    pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
260        mut self,
261        v: T,
262    ) -> Self {
263        self.service_class_uri = v.into();
264        self
265    }
266
267    /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
268    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
269        mut self,
270        v: T,
271    ) -> Self {
272        self.infrastructure = v.into();
273        self
274    }
275
276    /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
277    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
278        self.token = v.into();
279        self
280    }
281
282    /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
283    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
284        mut self,
285        v: T,
286    ) -> Self {
287        self.etag = v.into();
288        self
289    }
290
291    /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
292    pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
293    where
294        T: std::iter::IntoIterator<Item = V>,
295        V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
296    {
297        use std::iter::Iterator;
298        self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
299        self
300    }
301
302    /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
303    pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
304    where
305        T: std::iter::IntoIterator<Item = V>,
306        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
307    {
308        use std::iter::Iterator;
309        self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
310        self
311    }
312
313    /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
314    pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
315    where
316        T: std::iter::IntoIterator<Item = V>,
317        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
318    {
319        use std::iter::Iterator;
320        self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
321        self
322    }
323
324    /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
325    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
326    where
327        T: std::iter::IntoIterator<Item = (K, V)>,
328        K: std::convert::Into<std::string::String>,
329        V: std::convert::Into<std::string::String>,
330    {
331        use std::iter::Iterator;
332        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
333        self
334    }
335}
336
337impl wkt::message::Message for ServiceConnectionMap {
338    fn typename() -> &'static str {
339        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
340    }
341}
342
343/// Defines additional types related to [ServiceConnectionMap].
344pub mod service_connection_map {
345    #[allow(unused_imports)]
346    use super::*;
347
348    /// The PSC configurations on producer side.
349    #[serde_with::serde_as]
350    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
351    #[serde(default, rename_all = "camelCase")]
352    #[non_exhaustive]
353    pub struct ProducerPscConfig {
354        /// The resource path of a service attachment.
355        /// Example:
356        /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
357        #[serde(skip_serializing_if = "std::string::String::is_empty")]
358        pub service_attachment_uri: std::string::String,
359
360        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
361        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
362    }
363
364    impl ProducerPscConfig {
365        pub fn new() -> Self {
366            std::default::Default::default()
367        }
368
369        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
370        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
371            mut self,
372            v: T,
373        ) -> Self {
374            self.service_attachment_uri = v.into();
375            self
376        }
377    }
378
379    impl wkt::message::Message for ProducerPscConfig {
380        fn typename() -> &'static str {
381            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
382        }
383    }
384
385    /// Allow the producer to specify which consumers can connect to it.
386    #[serde_with::serde_as]
387    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
388    #[serde(default, rename_all = "camelCase")]
389    #[non_exhaustive]
390    pub struct ConsumerPscConfig {
391        /// The consumer project where PSC connections are allowed to be created in.
392        #[serde(skip_serializing_if = "std::string::String::is_empty")]
393        pub project: std::string::String,
394
395        /// The resource path of the consumer network where PSC connections are
396        /// allowed to be created in. Note, this network does not need be in the
397        /// ConsumerPscConfig.project in the case of SharedVPC.
398        /// Example:
399        /// projects/{projectNumOrId}/global/networks/{networkId}.
400        #[serde(skip_serializing_if = "std::string::String::is_empty")]
401        pub network: std::string::String,
402
403        /// This is used in PSC consumer ForwardingRule to control whether the PSC
404        /// endpoint can be accessed from another region.
405        pub disable_global_access: bool,
406
407        /// Output only. Overall state of PSC Connections management for this
408        /// consumer psc config.
409        pub state: crate::model::service_connection_map::consumer_psc_config::State,
410
411        /// Immutable. Deprecated. Use producer_instance_metadata instead.
412        /// An immutable identifier for the producer instance.
413        #[serde(skip_serializing_if = "std::string::String::is_empty")]
414        pub producer_instance_id: std::string::String,
415
416        /// Output only. A map to store mapping between customer vip and target
417        /// service attachment. Only service attachment with producer specified ip
418        /// addresses are stored here.
419        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
420        pub service_attachment_ip_address_map:
421            std::collections::HashMap<std::string::String, std::string::String>,
422
423        /// Required. The project ID or project number of the consumer project. This
424        /// project is the one that the consumer uses to interact with the producer
425        /// instance. From the perspective of a consumer who's created a producer
426        /// instance, this is the project of the producer instance. Format:
427        /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
428        /// 'projects/1234'
429        #[serde(skip_serializing_if = "std::string::String::is_empty")]
430        pub consumer_instance_project: std::string::String,
431
432        /// Immutable. An immutable map for the producer instance metadata.
433        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
434        pub producer_instance_metadata:
435            std::collections::HashMap<std::string::String, std::string::String>,
436
437        /// The requested IP version for the PSC connection.
438        #[serde(skip_serializing_if = "std::option::Option::is_none")]
439        pub ip_version: std::option::Option<crate::model::IPVersion>,
440
441        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
442        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
443    }
444
445    impl ConsumerPscConfig {
446        pub fn new() -> Self {
447            std::default::Default::default()
448        }
449
450        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
451        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452            self.project = v.into();
453            self
454        }
455
456        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
457        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
458            self.network = v.into();
459            self
460        }
461
462        /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
463        pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
464            self.disable_global_access = v.into();
465            self
466        }
467
468        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
469        pub fn set_state<
470            T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
471        >(
472            mut self,
473            v: T,
474        ) -> Self {
475            self.state = v.into();
476            self
477        }
478
479        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
480        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
481            mut self,
482            v: T,
483        ) -> Self {
484            self.producer_instance_id = v.into();
485            self
486        }
487
488        /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
489        pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
490            mut self,
491            v: T,
492        ) -> Self {
493            self.consumer_instance_project = v.into();
494            self
495        }
496
497        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
498        pub fn set_ip_version<
499            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
500        >(
501            mut self,
502            v: T,
503        ) -> Self {
504            self.ip_version = v.into();
505            self
506        }
507
508        /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
509        pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
510        where
511            T: std::iter::IntoIterator<Item = (K, V)>,
512            K: std::convert::Into<std::string::String>,
513            V: std::convert::Into<std::string::String>,
514        {
515            use std::iter::Iterator;
516            self.service_attachment_ip_address_map =
517                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
518            self
519        }
520
521        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
522        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
523        where
524            T: std::iter::IntoIterator<Item = (K, V)>,
525            K: std::convert::Into<std::string::String>,
526            V: std::convert::Into<std::string::String>,
527        {
528            use std::iter::Iterator;
529            self.producer_instance_metadata =
530                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
531            self
532        }
533    }
534
535    impl wkt::message::Message for ConsumerPscConfig {
536        fn typename() -> &'static str {
537            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
538        }
539    }
540
541    /// Defines additional types related to [ConsumerPscConfig].
542    pub mod consumer_psc_config {
543        #[allow(unused_imports)]
544        use super::*;
545
546        /// PSC Consumer Config State.
547        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
548        pub struct State(i32);
549
550        impl State {
551            /// Default state, when Connection Map is created initially.
552            pub const STATE_UNSPECIFIED: State = State::new(0);
553
554            /// Set when policy and map configuration is valid,
555            /// and their matching can lead to allowing creation of PSC Connections
556            /// subject to other constraints like connections limit.
557            pub const VALID: State = State::new(1);
558
559            /// No Service Connection Policy found for this network and Service
560            /// Class
561            pub const CONNECTION_POLICY_MISSING: State = State::new(2);
562
563            /// Service Connection Policy limit reached for this network and Service
564            /// Class
565            pub const POLICY_LIMIT_REACHED: State = State::new(3);
566
567            /// The consumer instance project is not in
568            /// AllowedGoogleProducersResourceHierarchyLevels of the matching
569            /// ServiceConnectionPolicy.
570            pub const CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED: State = State::new(4);
571
572            /// Creates a new State instance.
573            pub(crate) const fn new(value: i32) -> Self {
574                Self(value)
575            }
576
577            /// Gets the enum value.
578            pub fn value(&self) -> i32 {
579                self.0
580            }
581
582            /// Gets the enum value as a string.
583            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
584                match self.0 {
585                    0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
586                    1 => std::borrow::Cow::Borrowed("VALID"),
587                    2 => std::borrow::Cow::Borrowed("CONNECTION_POLICY_MISSING"),
588                    3 => std::borrow::Cow::Borrowed("POLICY_LIMIT_REACHED"),
589                    4 => std::borrow::Cow::Borrowed("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED"),
590                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
591                }
592            }
593
594            /// Creates an enum value from the value name.
595            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
596                match name {
597                    "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
598                    "VALID" => std::option::Option::Some(Self::VALID),
599                    "CONNECTION_POLICY_MISSING" => {
600                        std::option::Option::Some(Self::CONNECTION_POLICY_MISSING)
601                    }
602                    "POLICY_LIMIT_REACHED" => std::option::Option::Some(Self::POLICY_LIMIT_REACHED),
603                    "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
604                        std::option::Option::Some(Self::CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED)
605                    }
606                    _ => std::option::Option::None,
607                }
608            }
609        }
610
611        impl std::convert::From<i32> for State {
612            fn from(value: i32) -> Self {
613                Self::new(value)
614            }
615        }
616
617        impl std::default::Default for State {
618            fn default() -> Self {
619                Self::new(0)
620            }
621        }
622    }
623
624    /// PSC connection details on consumer side.
625    #[serde_with::serde_as]
626    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
627    #[serde(default, rename_all = "camelCase")]
628    #[non_exhaustive]
629    pub struct ConsumerPscConnection {
630        /// The URI of a service attachment which is the target of the PSC
631        /// connection.
632        #[serde(skip_serializing_if = "std::string::String::is_empty")]
633        pub service_attachment_uri: std::string::String,
634
635        /// The state of the PSC connection.
636        pub state: crate::model::service_connection_map::consumer_psc_connection::State,
637
638        /// The consumer project whose PSC forwarding rule is connected to the
639        /// service attachments in this service connection map.
640        #[serde(skip_serializing_if = "std::string::String::is_empty")]
641        pub project: std::string::String,
642
643        /// The consumer network whose PSC forwarding rule is connected to the
644        /// service attachments in this service connection map.
645        /// Note that the network could be on a different project (shared VPC).
646        #[serde(skip_serializing_if = "std::string::String::is_empty")]
647        pub network: std::string::String,
648
649        /// The PSC connection id of the PSC forwarding rule connected
650        /// to the service attachments in this service connection map.
651        #[serde(skip_serializing_if = "std::string::String::is_empty")]
652        pub psc_connection_id: std::string::String,
653
654        /// The IP literal allocated on the consumer network for the PSC forwarding
655        /// rule that is created to connect to the producer service attachment in
656        /// this service connection map.
657        #[serde(skip_serializing_if = "std::string::String::is_empty")]
658        pub ip: std::string::String,
659
660        /// The error type indicates whether the error is consumer facing, producer
661        /// facing or system internal.
662        pub error_type: crate::model::ConnectionErrorType,
663
664        /// The most recent error during operating this connection.
665        #[serde(skip_serializing_if = "std::option::Option::is_none")]
666        pub error: std::option::Option<rpc::model::Status>,
667
668        /// The last Compute Engine operation to setup PSC connection.
669        #[serde(skip_serializing_if = "std::string::String::is_empty")]
670        pub gce_operation: std::string::String,
671
672        /// The URI of the consumer forwarding rule created.
673        /// Example:
674        /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
675        #[serde(skip_serializing_if = "std::string::String::is_empty")]
676        pub forwarding_rule: std::string::String,
677
678        /// Output only. The error info for the latest error during operating this
679        /// connection.
680        #[serde(skip_serializing_if = "std::option::Option::is_none")]
681        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
682
683        /// Output only. The URI of the selected subnetwork selected to allocate IP
684        /// address for this connection.
685        #[serde(skip_serializing_if = "std::string::String::is_empty")]
686        pub selected_subnetwork: std::string::String,
687
688        /// Immutable. Deprecated. Use producer_instance_metadata instead.
689        /// An immutable identifier for the producer instance.
690        #[serde(skip_serializing_if = "std::string::String::is_empty")]
691        pub producer_instance_id: std::string::String,
692
693        /// Immutable. An immutable map for the producer instance metadata.
694        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
695        pub producer_instance_metadata:
696            std::collections::HashMap<std::string::String, std::string::String>,
697
698        /// The requested IP version for the PSC connection.
699        #[serde(skip_serializing_if = "std::option::Option::is_none")]
700        pub ip_version: std::option::Option<crate::model::IPVersion>,
701
702        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
703        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
704    }
705
706    impl ConsumerPscConnection {
707        pub fn new() -> Self {
708            std::default::Default::default()
709        }
710
711        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
712        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
713            mut self,
714            v: T,
715        ) -> Self {
716            self.service_attachment_uri = v.into();
717            self
718        }
719
720        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
721        pub fn set_state<
722            T: std::convert::Into<
723                    crate::model::service_connection_map::consumer_psc_connection::State,
724                >,
725        >(
726            mut self,
727            v: T,
728        ) -> Self {
729            self.state = v.into();
730            self
731        }
732
733        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
734        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735            self.project = v.into();
736            self
737        }
738
739        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
740        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741            self.network = v.into();
742            self
743        }
744
745        /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
746        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
747            mut self,
748            v: T,
749        ) -> Self {
750            self.psc_connection_id = v.into();
751            self
752        }
753
754        /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
755        pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
756            self.ip = v.into();
757            self
758        }
759
760        /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
761        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
762            mut self,
763            v: T,
764        ) -> Self {
765            self.error_type = v.into();
766            self
767        }
768
769        /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
770        pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
771            mut self,
772            v: T,
773        ) -> Self {
774            self.error = v.into();
775            self
776        }
777
778        /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
779        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
780            mut self,
781            v: T,
782        ) -> Self {
783            self.gce_operation = v.into();
784            self
785        }
786
787        /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
788        pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
789            mut self,
790            v: T,
791        ) -> Self {
792            self.forwarding_rule = v.into();
793            self
794        }
795
796        /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
797        pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
798            mut self,
799            v: T,
800        ) -> Self {
801            self.error_info = v.into();
802            self
803        }
804
805        /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
806        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
807            mut self,
808            v: T,
809        ) -> Self {
810            self.selected_subnetwork = v.into();
811            self
812        }
813
814        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
815        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
816            mut self,
817            v: T,
818        ) -> Self {
819            self.producer_instance_id = v.into();
820            self
821        }
822
823        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
824        pub fn set_ip_version<
825            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
826        >(
827            mut self,
828            v: T,
829        ) -> Self {
830            self.ip_version = v.into();
831            self
832        }
833
834        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
835        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
836        where
837            T: std::iter::IntoIterator<Item = (K, V)>,
838            K: std::convert::Into<std::string::String>,
839            V: std::convert::Into<std::string::String>,
840        {
841            use std::iter::Iterator;
842            self.producer_instance_metadata =
843                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
844            self
845        }
846    }
847
848    impl wkt::message::Message for ConsumerPscConnection {
849        fn typename() -> &'static str {
850            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
851        }
852    }
853
854    /// Defines additional types related to [ConsumerPscConnection].
855    pub mod consumer_psc_connection {
856        #[allow(unused_imports)]
857        use super::*;
858
859        /// The state of the PSC connection.
860        /// We reserve the right to add more states without notice in the future.
861        /// Users should not use exhaustive switch statements on this enum.
862        /// See <https://google.aip.dev/216>.
863        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
864        pub struct State(i32);
865
866        impl State {
867            /// An invalid state as the default case.
868            pub const STATE_UNSPECIFIED: State = State::new(0);
869
870            /// The connection has been created successfully. However, for the
871            /// up-to-date connection status, please use the service attachment's
872            /// "ConnectedEndpoint.status" as the source of truth.
873            pub const ACTIVE: State = State::new(1);
874
875            /// The connection is not functional since some resources on the connection
876            /// fail to be created.
877            pub const FAILED: State = State::new(2);
878
879            /// The connection is being created.
880            pub const CREATING: State = State::new(3);
881
882            /// The connection is being deleted.
883            pub const DELETING: State = State::new(4);
884
885            /// The connection is being repaired to complete creation.
886            pub const CREATE_REPAIRING: State = State::new(5);
887
888            /// The connection is being repaired to complete deletion.
889            pub const DELETE_REPAIRING: State = State::new(6);
890
891            /// Creates a new State instance.
892            pub(crate) const fn new(value: i32) -> Self {
893                Self(value)
894            }
895
896            /// Gets the enum value.
897            pub fn value(&self) -> i32 {
898                self.0
899            }
900
901            /// Gets the enum value as a string.
902            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
903                match self.0 {
904                    0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
905                    1 => std::borrow::Cow::Borrowed("ACTIVE"),
906                    2 => std::borrow::Cow::Borrowed("FAILED"),
907                    3 => std::borrow::Cow::Borrowed("CREATING"),
908                    4 => std::borrow::Cow::Borrowed("DELETING"),
909                    5 => std::borrow::Cow::Borrowed("CREATE_REPAIRING"),
910                    6 => std::borrow::Cow::Borrowed("DELETE_REPAIRING"),
911                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
912                }
913            }
914
915            /// Creates an enum value from the value name.
916            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
917                match name {
918                    "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
919                    "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
920                    "FAILED" => std::option::Option::Some(Self::FAILED),
921                    "CREATING" => std::option::Option::Some(Self::CREATING),
922                    "DELETING" => std::option::Option::Some(Self::DELETING),
923                    "CREATE_REPAIRING" => std::option::Option::Some(Self::CREATE_REPAIRING),
924                    "DELETE_REPAIRING" => std::option::Option::Some(Self::DELETE_REPAIRING),
925                    _ => std::option::Option::None,
926                }
927            }
928        }
929
930        impl std::convert::From<i32> for State {
931            fn from(value: i32) -> Self {
932                Self::new(value)
933            }
934        }
935
936        impl std::default::Default for State {
937            fn default() -> Self {
938                Self::new(0)
939            }
940        }
941    }
942}
943
944/// Request for ListServiceConnectionMaps.
945#[serde_with::serde_as]
946#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
947#[serde(default, rename_all = "camelCase")]
948#[non_exhaustive]
949pub struct ListServiceConnectionMapsRequest {
950    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
951    #[serde(skip_serializing_if = "std::string::String::is_empty")]
952    pub parent: std::string::String,
953
954    /// The maximum number of results per page that should be returned.
955    pub page_size: i32,
956
957    /// The page token.
958    #[serde(skip_serializing_if = "std::string::String::is_empty")]
959    pub page_token: std::string::String,
960
961    /// A filter expression that filters the results listed in the response.
962    #[serde(skip_serializing_if = "std::string::String::is_empty")]
963    pub filter: std::string::String,
964
965    /// Sort the results by a certain order.
966    #[serde(skip_serializing_if = "std::string::String::is_empty")]
967    pub order_by: std::string::String,
968
969    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
970    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
971}
972
973impl ListServiceConnectionMapsRequest {
974    pub fn new() -> Self {
975        std::default::Default::default()
976    }
977
978    /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
979    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
980        self.parent = v.into();
981        self
982    }
983
984    /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
985    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
986        self.page_size = v.into();
987        self
988    }
989
990    /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
991    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
992        self.page_token = v.into();
993        self
994    }
995
996    /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
997    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
998        self.filter = v.into();
999        self
1000    }
1001
1002    /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1003    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1004        self.order_by = v.into();
1005        self
1006    }
1007}
1008
1009impl wkt::message::Message for ListServiceConnectionMapsRequest {
1010    fn typename() -> &'static str {
1011        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1012    }
1013}
1014
1015/// Response for ListServiceConnectionMaps.
1016#[serde_with::serde_as]
1017#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1018#[serde(default, rename_all = "camelCase")]
1019#[non_exhaustive]
1020pub struct ListServiceConnectionMapsResponse {
1021    /// ServiceConnectionMaps to be returned.
1022    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1023    pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1024
1025    /// The next pagination token in the List response. It should be used as
1026    /// page_token for the following request. An empty value means no more result.
1027    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1028    pub next_page_token: std::string::String,
1029
1030    /// Locations that could not be reached.
1031    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1032    pub unreachable: std::vec::Vec<std::string::String>,
1033
1034    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1035    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1036}
1037
1038impl ListServiceConnectionMapsResponse {
1039    pub fn new() -> Self {
1040        std::default::Default::default()
1041    }
1042
1043    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1044    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045        self.next_page_token = v.into();
1046        self
1047    }
1048
1049    /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1050    pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1051    where
1052        T: std::iter::IntoIterator<Item = V>,
1053        V: std::convert::Into<crate::model::ServiceConnectionMap>,
1054    {
1055        use std::iter::Iterator;
1056        self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1057        self
1058    }
1059
1060    /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1061    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1062    where
1063        T: std::iter::IntoIterator<Item = V>,
1064        V: std::convert::Into<std::string::String>,
1065    {
1066        use std::iter::Iterator;
1067        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1068        self
1069    }
1070}
1071
1072impl wkt::message::Message for ListServiceConnectionMapsResponse {
1073    fn typename() -> &'static str {
1074        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1075    }
1076}
1077
1078#[doc(hidden)]
1079impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1080    type PageItem = crate::model::ServiceConnectionMap;
1081
1082    fn items(self) -> std::vec::Vec<Self::PageItem> {
1083        self.service_connection_maps
1084    }
1085
1086    fn next_page_token(&self) -> std::string::String {
1087        use std::clone::Clone;
1088        self.next_page_token.clone()
1089    }
1090}
1091
1092/// Request for GetServiceConnectionMap.
1093#[serde_with::serde_as]
1094#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1095#[serde(default, rename_all = "camelCase")]
1096#[non_exhaustive]
1097pub struct GetServiceConnectionMapRequest {
1098    /// Required. Name of the ServiceConnectionMap to get.
1099    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1100    pub name: std::string::String,
1101
1102    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1103    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104}
1105
1106impl GetServiceConnectionMapRequest {
1107    pub fn new() -> Self {
1108        std::default::Default::default()
1109    }
1110
1111    /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1112    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113        self.name = v.into();
1114        self
1115    }
1116}
1117
1118impl wkt::message::Message for GetServiceConnectionMapRequest {
1119    fn typename() -> &'static str {
1120        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1121    }
1122}
1123
1124/// Request for CreateServiceConnectionMap.
1125#[serde_with::serde_as]
1126#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1127#[serde(default, rename_all = "camelCase")]
1128#[non_exhaustive]
1129pub struct CreateServiceConnectionMapRequest {
1130    /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1131    /// projects/123/locations/us-east1
1132    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1133    pub parent: std::string::String,
1134
1135    /// Optional. Resource ID
1136    /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1137    /// See <https://google.aip.dev/122#resource-id-segments>
1138    /// Unique per location.
1139    /// If one is not provided, one will be generated.
1140    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1141    pub service_connection_map_id: std::string::String,
1142
1143    /// Required. Initial values for a new ServiceConnectionMaps
1144    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1145    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1146
1147    /// Optional. An optional request ID to identify requests. Specify a unique
1148    /// request ID so that if you must retry your request, the server will know to
1149    /// ignore the request if it has already been completed. The server will
1150    /// guarantee that for at least 60 minutes since the first request.
1151    ///
1152    /// For example, consider a situation where you make an initial request and
1153    /// the request times out. If you make the request again with the same request
1154    /// ID, the server can check if original operation with the same request ID
1155    /// was received, and if so, will ignore the second request. This prevents
1156    /// clients from accidentally creating duplicate commitments.
1157    ///
1158    /// The request ID must be a valid UUID with the exception that zero UUID is
1159    /// not supported (00000000-0000-0000-0000-000000000000).
1160    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1161    pub request_id: std::string::String,
1162
1163    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1164    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1165}
1166
1167impl CreateServiceConnectionMapRequest {
1168    pub fn new() -> Self {
1169        std::default::Default::default()
1170    }
1171
1172    /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1173    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1174        self.parent = v.into();
1175        self
1176    }
1177
1178    /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1179    pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1180        mut self,
1181        v: T,
1182    ) -> Self {
1183        self.service_connection_map_id = v.into();
1184        self
1185    }
1186
1187    /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1188    pub fn set_service_connection_map<
1189        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1190    >(
1191        mut self,
1192        v: T,
1193    ) -> Self {
1194        self.service_connection_map = v.into();
1195        self
1196    }
1197
1198    /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1199    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200        self.request_id = v.into();
1201        self
1202    }
1203}
1204
1205impl wkt::message::Message for CreateServiceConnectionMapRequest {
1206    fn typename() -> &'static str {
1207        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1208    }
1209}
1210
1211/// Request for UpdateServiceConnectionMap.
1212#[serde_with::serde_as]
1213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1214#[serde(default, rename_all = "camelCase")]
1215#[non_exhaustive]
1216pub struct UpdateServiceConnectionMapRequest {
1217    /// Optional. Field mask is used to specify the fields to be overwritten in the
1218    /// ServiceConnectionMap resource by the update.
1219    /// The fields specified in the update_mask are relative to the resource, not
1220    /// the full request. A field will be overwritten if it is in the mask. If the
1221    /// user does not provide a mask then all fields will be overwritten.
1222    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1223    pub update_mask: std::option::Option<wkt::FieldMask>,
1224
1225    /// Required. New values to be patched into the resource.
1226    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1227    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1228
1229    /// Optional. An optional request ID to identify requests. Specify a unique
1230    /// request ID so that if you must retry your request, the server will know to
1231    /// ignore the request if it has already been completed. The server will
1232    /// guarantee that for at least 60 minutes since the first request.
1233    ///
1234    /// For example, consider a situation where you make an initial request and
1235    /// the request times out. If you make the request again with the same request
1236    /// ID, the server can check if original operation with the same request ID
1237    /// was received, and if so, will ignore the second request. This prevents
1238    /// clients from accidentally creating duplicate commitments.
1239    ///
1240    /// The request ID must be a valid UUID with the exception that zero UUID is
1241    /// not supported (00000000-0000-0000-0000-000000000000).
1242    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1243    pub request_id: std::string::String,
1244
1245    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1246    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1247}
1248
1249impl UpdateServiceConnectionMapRequest {
1250    pub fn new() -> Self {
1251        std::default::Default::default()
1252    }
1253
1254    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1255    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1256        mut self,
1257        v: T,
1258    ) -> Self {
1259        self.update_mask = v.into();
1260        self
1261    }
1262
1263    /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1264    pub fn set_service_connection_map<
1265        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1266    >(
1267        mut self,
1268        v: T,
1269    ) -> Self {
1270        self.service_connection_map = v.into();
1271        self
1272    }
1273
1274    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1275    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276        self.request_id = v.into();
1277        self
1278    }
1279}
1280
1281impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1282    fn typename() -> &'static str {
1283        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1284    }
1285}
1286
1287/// Request for DeleteServiceConnectionMap.
1288#[serde_with::serde_as]
1289#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1290#[serde(default, rename_all = "camelCase")]
1291#[non_exhaustive]
1292pub struct DeleteServiceConnectionMapRequest {
1293    /// Required. The name of the ServiceConnectionMap to delete.
1294    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1295    pub name: std::string::String,
1296
1297    /// Optional. An optional request ID to identify requests. Specify a unique
1298    /// request ID so that if you must retry your request, the server will know to
1299    /// ignore the request if it has already been completed. The server will
1300    /// guarantee that for at least 60 minutes after the first request.
1301    ///
1302    /// For example, consider a situation where you make an initial request and
1303    /// the request times out. If you make the request again with the same request
1304    /// ID, the server can check if original operation with the same request ID
1305    /// was received, and if so, will ignore the second request. This prevents
1306    /// clients from accidentally creating duplicate commitments.
1307    ///
1308    /// The request ID must be a valid UUID with the exception that zero UUID is
1309    /// not supported (00000000-0000-0000-0000-000000000000).
1310    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1311    pub request_id: std::string::String,
1312
1313    /// Optional. The etag is computed by the server, and may be sent on update and
1314    /// delete requests to ensure the client has an up-to-date value before
1315    /// proceeding.
1316    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1317    pub etag: std::option::Option<std::string::String>,
1318
1319    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1320    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1321}
1322
1323impl DeleteServiceConnectionMapRequest {
1324    pub fn new() -> Self {
1325        std::default::Default::default()
1326    }
1327
1328    /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
1329    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330        self.name = v.into();
1331        self
1332    }
1333
1334    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
1335    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336        self.request_id = v.into();
1337        self
1338    }
1339
1340    /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
1341    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1342        mut self,
1343        v: T,
1344    ) -> Self {
1345        self.etag = v.into();
1346        self
1347    }
1348}
1349
1350impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1351    fn typename() -> &'static str {
1352        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1353    }
1354}
1355
1356/// The ServiceConnectionPolicy resource.
1357#[serde_with::serde_as]
1358#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1359#[serde(default, rename_all = "camelCase")]
1360#[non_exhaustive]
1361pub struct ServiceConnectionPolicy {
1362    /// Immutable. The name of a ServiceConnectionPolicy.
1363    /// Format:
1364    /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
1365    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
1366    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1367    pub name: std::string::String,
1368
1369    /// Output only. Time when the ServiceConnectionPolicy was created.
1370    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1371    pub create_time: std::option::Option<wkt::Timestamp>,
1372
1373    /// Output only. Time when the ServiceConnectionPolicy was updated.
1374    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1375    pub update_time: std::option::Option<wkt::Timestamp>,
1376
1377    /// User-defined labels.
1378    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1379    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1380
1381    /// A description of this resource.
1382    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1383    pub description: std::string::String,
1384
1385    /// The resource path of the consumer network.
1386    /// Example:
1387    ///
1388    /// - projects/{projectNumOrId}/global/networks/{resourceId}.
1389    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1390    pub network: std::string::String,
1391
1392    /// The service class identifier for which this ServiceConnectionPolicy is for.
1393    /// The service class identifier is a unique, symbolic representation of a
1394    /// ServiceClass. It is provided by the Service Producer. Google services have
1395    /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
1396    /// google-cloud-sql. 3rd party services do not. For example,
1397    /// test-service-a3dfcx.
1398    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399    pub service_class: std::string::String,
1400
1401    /// Output only. The type of underlying resources used to create the
1402    /// connection.
1403    pub infrastructure: crate::model::Infrastructure,
1404
1405    /// Configuration used for Private Service Connect connections. Used when
1406    /// Infrastructure is PSC.
1407    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1408    pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1409
1410    /// Output only. [Output only] Information about each Private Service Connect
1411    /// connection.
1412    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1413    pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1414
1415    /// Optional. The etag is computed by the server, and may be sent on update and
1416    /// delete requests to ensure the client has an up-to-date value before
1417    /// proceeding.
1418    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1419    pub etag: std::option::Option<std::string::String>,
1420
1421    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1422    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1423}
1424
1425impl ServiceConnectionPolicy {
1426    pub fn new() -> Self {
1427        std::default::Default::default()
1428    }
1429
1430    /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
1431    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1432        self.name = v.into();
1433        self
1434    }
1435
1436    /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
1437    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1438        mut self,
1439        v: T,
1440    ) -> Self {
1441        self.create_time = v.into();
1442        self
1443    }
1444
1445    /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
1446    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1447        mut self,
1448        v: T,
1449    ) -> Self {
1450        self.update_time = v.into();
1451        self
1452    }
1453
1454    /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
1455    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1456        self.description = v.into();
1457        self
1458    }
1459
1460    /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
1461    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1462        self.network = v.into();
1463        self
1464    }
1465
1466    /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
1467    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1468        self.service_class = v.into();
1469        self
1470    }
1471
1472    /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
1473    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1474        mut self,
1475        v: T,
1476    ) -> Self {
1477        self.infrastructure = v.into();
1478        self
1479    }
1480
1481    /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
1482    pub fn set_psc_config<
1483        T: std::convert::Into<std::option::Option<crate::model::service_connection_policy::PscConfig>>,
1484    >(
1485        mut self,
1486        v: T,
1487    ) -> Self {
1488        self.psc_config = v.into();
1489        self
1490    }
1491
1492    /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
1493    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1494        mut self,
1495        v: T,
1496    ) -> Self {
1497        self.etag = v.into();
1498        self
1499    }
1500
1501    /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
1502    pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1503    where
1504        T: std::iter::IntoIterator<Item = V>,
1505        V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1506    {
1507        use std::iter::Iterator;
1508        self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1509        self
1510    }
1511
1512    /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
1513    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1514    where
1515        T: std::iter::IntoIterator<Item = (K, V)>,
1516        K: std::convert::Into<std::string::String>,
1517        V: std::convert::Into<std::string::String>,
1518    {
1519        use std::iter::Iterator;
1520        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1521        self
1522    }
1523}
1524
1525impl wkt::message::Message for ServiceConnectionPolicy {
1526    fn typename() -> &'static str {
1527        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1528    }
1529}
1530
1531/// Defines additional types related to [ServiceConnectionPolicy].
1532pub mod service_connection_policy {
1533    #[allow(unused_imports)]
1534    use super::*;
1535
1536    /// Configuration used for Private Service Connect connections. Used when
1537    /// Infrastructure is PSC.
1538    #[serde_with::serde_as]
1539    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1540    #[serde(default, rename_all = "camelCase")]
1541    #[non_exhaustive]
1542    pub struct PscConfig {
1543        /// The resource paths of subnetworks to use for IP address management.
1544        /// Example:
1545        /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
1546        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1547        pub subnetworks: std::vec::Vec<std::string::String>,
1548
1549        /// Optional. Max number of PSC connections for this policy.
1550        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1551        #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1552        pub limit: std::option::Option<i64>,
1553
1554        /// Required. ProducerInstanceLocation is used to specify which authorization
1555        /// mechanism to use to determine which projects the Producer instance can be
1556        /// within.
1557        pub producer_instance_location:
1558            crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1559
1560        /// Optional. List of Projects, Folders, or Organizations from where the
1561        /// Producer instance can be within. For example, a network administrator can
1562        /// provide both 'organizations/foo' and 'projects/bar' as
1563        /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
1564        /// network to connect with any Producer instance within the 'foo'
1565        /// organization or the 'bar' project. By default,
1566        /// allowed_google_producers_resource_hierarchy_level is empty. The format
1567        /// for each allowed_google_producers_resource_hierarchy_level is \<resource
1568        /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
1569        /// 'organizations' and \<id\> is either the ID or the number of the resource
1570        /// type. Format for each allowed_google_producers_resource_hierarchy_level
1571        /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
1572        /// 'organizations/<organization_id>'
1573        /// Eg. [projects/my-project-id, projects/567, folders/891,
1574        /// organizations/123]
1575        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1576        pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1577
1578        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1579        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1580    }
1581
1582    impl PscConfig {
1583        pub fn new() -> Self {
1584            std::default::Default::default()
1585        }
1586
1587        /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
1588        pub fn set_limit<T: std::convert::Into<std::option::Option<i64>>>(mut self, v: T) -> Self {
1589            self.limit = v.into();
1590            self
1591        }
1592
1593        /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
1594        pub fn set_producer_instance_location<
1595            T: std::convert::Into<
1596                    crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1597                >,
1598        >(
1599            mut self,
1600            v: T,
1601        ) -> Self {
1602            self.producer_instance_location = v.into();
1603            self
1604        }
1605
1606        /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
1607        pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1608        where
1609            T: std::iter::IntoIterator<Item = V>,
1610            V: std::convert::Into<std::string::String>,
1611        {
1612            use std::iter::Iterator;
1613            self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1614            self
1615        }
1616
1617        /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
1618        pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1619        where
1620            T: std::iter::IntoIterator<Item = V>,
1621            V: std::convert::Into<std::string::String>,
1622        {
1623            use std::iter::Iterator;
1624            self.allowed_google_producers_resource_hierarchy_level =
1625                v.into_iter().map(|i| i.into()).collect();
1626            self
1627        }
1628    }
1629
1630    impl wkt::message::Message for PscConfig {
1631        fn typename() -> &'static str {
1632            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1633        }
1634    }
1635
1636    /// Defines additional types related to [PscConfig].
1637    pub mod psc_config {
1638        #[allow(unused_imports)]
1639        use super::*;
1640
1641        /// ProducerInstanceLocation is used to specify which authorization mechanism
1642        /// to use to determine which projects the Producer instance can be within.
1643        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1644        pub struct ProducerInstanceLocation(i32);
1645
1646        impl ProducerInstanceLocation {
1647            /// Producer instance location is not specified. When this option is
1648            /// chosen, then the PSC connections created by this
1649            /// ServiceConnectionPolicy must be within the same project as the Producer
1650            /// instance. This is the default ProducerInstanceLocation value.
1651            /// To allow for PSC connections from this network to other networks, use
1652            /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
1653            pub const PRODUCER_INSTANCE_LOCATION_UNSPECIFIED: ProducerInstanceLocation =
1654                ProducerInstanceLocation::new(0);
1655
1656            /// Producer instance must be within one of the values provided in
1657            /// allowed_google_producers_resource_hierarchy_level.
1658            pub const CUSTOM_RESOURCE_HIERARCHY_LEVELS: ProducerInstanceLocation =
1659                ProducerInstanceLocation::new(1);
1660
1661            /// Creates a new ProducerInstanceLocation instance.
1662            pub(crate) const fn new(value: i32) -> Self {
1663                Self(value)
1664            }
1665
1666            /// Gets the enum value.
1667            pub fn value(&self) -> i32 {
1668                self.0
1669            }
1670
1671            /// Gets the enum value as a string.
1672            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1673                match self.0 {
1674                    0 => std::borrow::Cow::Borrowed("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED"),
1675                    1 => std::borrow::Cow::Borrowed("CUSTOM_RESOURCE_HIERARCHY_LEVELS"),
1676                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1677                }
1678            }
1679
1680            /// Creates an enum value from the value name.
1681            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1682                match name {
1683                    "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => {
1684                        std::option::Option::Some(Self::PRODUCER_INSTANCE_LOCATION_UNSPECIFIED)
1685                    }
1686                    "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => {
1687                        std::option::Option::Some(Self::CUSTOM_RESOURCE_HIERARCHY_LEVELS)
1688                    }
1689                    _ => std::option::Option::None,
1690                }
1691            }
1692        }
1693
1694        impl std::convert::From<i32> for ProducerInstanceLocation {
1695            fn from(value: i32) -> Self {
1696                Self::new(value)
1697            }
1698        }
1699
1700        impl std::default::Default for ProducerInstanceLocation {
1701            fn default() -> Self {
1702                Self::new(0)
1703            }
1704        }
1705    }
1706
1707    /// Information about a specific Private Service Connect connection.
1708    #[serde_with::serde_as]
1709    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1710    #[serde(default, rename_all = "camelCase")]
1711    #[non_exhaustive]
1712    pub struct PscConnection {
1713        /// State of the PSC Connection
1714        pub state: crate::model::service_connection_policy::State,
1715
1716        /// The resource reference of the PSC Forwarding Rule within the consumer
1717        /// VPC.
1718        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1719        pub consumer_forwarding_rule: std::string::String,
1720
1721        /// The resource reference of the consumer address.
1722        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1723        pub consumer_address: std::string::String,
1724
1725        /// The error type indicates whether the error is consumer facing, producer
1726        /// facing or system internal.
1727        pub error_type: crate::model::ConnectionErrorType,
1728
1729        /// The most recent error during operating this connection.
1730        /// Deprecated, please use error_info instead.
1731        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1732        pub error: std::option::Option<rpc::model::Status>,
1733
1734        /// The last Compute Engine operation to setup PSC connection.
1735        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1736        pub gce_operation: std::string::String,
1737
1738        /// The project where the PSC connection is created.
1739        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1740        pub consumer_target_project: std::string::String,
1741
1742        /// The PSC connection id of the PSC forwarding rule.
1743        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1744        pub psc_connection_id: std::string::String,
1745
1746        /// Output only. The error info for the latest error during operating this
1747        /// connection.
1748        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1749        pub error_info: std::option::Option<rpc::model::ErrorInfo>,
1750
1751        /// Output only. The URI of the subnetwork selected to allocate IP address
1752        /// for this connection.
1753        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1754        pub selected_subnetwork: std::string::String,
1755
1756        /// Immutable. Deprecated. Use producer_instance_metadata instead.
1757        /// An immutable identifier for the producer instance.
1758        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1759        pub producer_instance_id: std::string::String,
1760
1761        /// Immutable. An immutable map for the producer instance metadata.
1762        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1763        pub producer_instance_metadata:
1764            std::collections::HashMap<std::string::String, std::string::String>,
1765
1766        /// Output only. [Output only] The service class associated with this PSC
1767        /// Connection. The value is derived from the SCPolicy and matches the
1768        /// service class name provided by the customer.
1769        #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770        pub service_class: std::string::String,
1771
1772        /// The requested IP version for the PSC connection.
1773        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1774        pub ip_version: std::option::Option<crate::model::IPVersion>,
1775
1776        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1777        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778    }
1779
1780    impl PscConnection {
1781        pub fn new() -> Self {
1782            std::default::Default::default()
1783        }
1784
1785        /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
1786        pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
1787            mut self,
1788            v: T,
1789        ) -> Self {
1790            self.state = v.into();
1791            self
1792        }
1793
1794        /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
1795        pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
1796            mut self,
1797            v: T,
1798        ) -> Self {
1799            self.consumer_forwarding_rule = v.into();
1800            self
1801        }
1802
1803        /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
1804        pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
1805            mut self,
1806            v: T,
1807        ) -> Self {
1808            self.consumer_address = v.into();
1809            self
1810        }
1811
1812        /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
1813        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1814            mut self,
1815            v: T,
1816        ) -> Self {
1817            self.error_type = v.into();
1818            self
1819        }
1820
1821        /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
1822        pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
1823            mut self,
1824            v: T,
1825        ) -> Self {
1826            self.error = v.into();
1827            self
1828        }
1829
1830        /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
1831        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1832            mut self,
1833            v: T,
1834        ) -> Self {
1835            self.gce_operation = v.into();
1836            self
1837        }
1838
1839        /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
1840        pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
1841            mut self,
1842            v: T,
1843        ) -> Self {
1844            self.consumer_target_project = v.into();
1845            self
1846        }
1847
1848        /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
1849        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1850            mut self,
1851            v: T,
1852        ) -> Self {
1853            self.psc_connection_id = v.into();
1854            self
1855        }
1856
1857        /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
1858        pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
1859            mut self,
1860            v: T,
1861        ) -> Self {
1862            self.error_info = v.into();
1863            self
1864        }
1865
1866        /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
1867        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1868            mut self,
1869            v: T,
1870        ) -> Self {
1871            self.selected_subnetwork = v.into();
1872            self
1873        }
1874
1875        /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
1876        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1877            mut self,
1878            v: T,
1879        ) -> Self {
1880            self.producer_instance_id = v.into();
1881            self
1882        }
1883
1884        /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
1885        pub fn set_service_class<T: std::convert::Into<std::string::String>>(
1886            mut self,
1887            v: T,
1888        ) -> Self {
1889            self.service_class = v.into();
1890            self
1891        }
1892
1893        /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
1894        pub fn set_ip_version<
1895            T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
1896        >(
1897            mut self,
1898            v: T,
1899        ) -> Self {
1900            self.ip_version = v.into();
1901            self
1902        }
1903
1904        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
1905        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1906        where
1907            T: std::iter::IntoIterator<Item = (K, V)>,
1908            K: std::convert::Into<std::string::String>,
1909            V: std::convert::Into<std::string::String>,
1910        {
1911            use std::iter::Iterator;
1912            self.producer_instance_metadata =
1913                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1914            self
1915        }
1916    }
1917
1918    impl wkt::message::Message for PscConnection {
1919        fn typename() -> &'static str {
1920            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
1921        }
1922    }
1923
1924    /// The state of the PSC connection.
1925    /// We reserve the right to add more states without notice in the future.
1926    /// Users should not use exhaustive switch statements on this enum.
1927    /// See <https://google.aip.dev/216>.
1928    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1929    pub struct State(i32);
1930
1931    impl State {
1932        /// An invalid state as the default case.
1933        pub const STATE_UNSPECIFIED: State = State::new(0);
1934
1935        /// The connection has been created successfully. However, for the
1936        /// up-to-date connection status, please use the created forwarding rule's
1937        /// "PscConnectionStatus" as the source of truth.
1938        pub const ACTIVE: State = State::new(1);
1939
1940        /// The connection is not functional since some resources on the connection
1941        /// fail to be created.
1942        pub const FAILED: State = State::new(2);
1943
1944        /// The connection is being created.
1945        pub const CREATING: State = State::new(3);
1946
1947        /// The connection is being deleted.
1948        pub const DELETING: State = State::new(4);
1949
1950        /// The connection is being repaired to complete creation.
1951        pub const CREATE_REPAIRING: State = State::new(5);
1952
1953        /// The connection is being repaired to complete deletion.
1954        pub const DELETE_REPAIRING: State = State::new(6);
1955
1956        /// Creates a new State instance.
1957        pub(crate) const fn new(value: i32) -> Self {
1958            Self(value)
1959        }
1960
1961        /// Gets the enum value.
1962        pub fn value(&self) -> i32 {
1963            self.0
1964        }
1965
1966        /// Gets the enum value as a string.
1967        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1968            match self.0 {
1969                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1970                1 => std::borrow::Cow::Borrowed("ACTIVE"),
1971                2 => std::borrow::Cow::Borrowed("FAILED"),
1972                3 => std::borrow::Cow::Borrowed("CREATING"),
1973                4 => std::borrow::Cow::Borrowed("DELETING"),
1974                5 => std::borrow::Cow::Borrowed("CREATE_REPAIRING"),
1975                6 => std::borrow::Cow::Borrowed("DELETE_REPAIRING"),
1976                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1977            }
1978        }
1979
1980        /// Creates an enum value from the value name.
1981        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1982            match name {
1983                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
1984                "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
1985                "FAILED" => std::option::Option::Some(Self::FAILED),
1986                "CREATING" => std::option::Option::Some(Self::CREATING),
1987                "DELETING" => std::option::Option::Some(Self::DELETING),
1988                "CREATE_REPAIRING" => std::option::Option::Some(Self::CREATE_REPAIRING),
1989                "DELETE_REPAIRING" => std::option::Option::Some(Self::DELETE_REPAIRING),
1990                _ => std::option::Option::None,
1991            }
1992        }
1993    }
1994
1995    impl std::convert::From<i32> for State {
1996        fn from(value: i32) -> Self {
1997            Self::new(value)
1998        }
1999    }
2000
2001    impl std::default::Default for State {
2002        fn default() -> Self {
2003            Self::new(0)
2004        }
2005    }
2006}
2007
2008/// Request for ListServiceConnectionPolicies.
2009#[serde_with::serde_as]
2010#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2011#[serde(default, rename_all = "camelCase")]
2012#[non_exhaustive]
2013pub struct ListServiceConnectionPoliciesRequest {
2014    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2015    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2016    pub parent: std::string::String,
2017
2018    /// The maximum number of results per page that should be returned.
2019    pub page_size: i32,
2020
2021    /// The page token.
2022    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2023    pub page_token: std::string::String,
2024
2025    /// A filter expression that filters the results listed in the response.
2026    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2027    pub filter: std::string::String,
2028
2029    /// Sort the results by a certain order.
2030    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2031    pub order_by: std::string::String,
2032
2033    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2034    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2035}
2036
2037impl ListServiceConnectionPoliciesRequest {
2038    pub fn new() -> Self {
2039        std::default::Default::default()
2040    }
2041
2042    /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
2043    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2044        self.parent = v.into();
2045        self
2046    }
2047
2048    /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
2049    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2050        self.page_size = v.into();
2051        self
2052    }
2053
2054    /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
2055    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056        self.page_token = v.into();
2057        self
2058    }
2059
2060    /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
2061    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2062        self.filter = v.into();
2063        self
2064    }
2065
2066    /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
2067    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2068        self.order_by = v.into();
2069        self
2070    }
2071}
2072
2073impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2074    fn typename() -> &'static str {
2075        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2076    }
2077}
2078
2079/// Response for ListServiceConnectionPolicies.
2080#[serde_with::serde_as]
2081#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2082#[serde(default, rename_all = "camelCase")]
2083#[non_exhaustive]
2084pub struct ListServiceConnectionPoliciesResponse {
2085    /// ServiceConnectionPolicies to be returned.
2086    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2087    pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2088
2089    /// The next pagination token in the List response. It should be used as
2090    /// page_token for the following request. An empty value means no more result.
2091    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2092    pub next_page_token: std::string::String,
2093
2094    /// Locations that could not be reached.
2095    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2096    pub unreachable: std::vec::Vec<std::string::String>,
2097
2098    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2099    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2100}
2101
2102impl ListServiceConnectionPoliciesResponse {
2103    pub fn new() -> Self {
2104        std::default::Default::default()
2105    }
2106
2107    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
2108    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2109        self.next_page_token = v.into();
2110        self
2111    }
2112
2113    /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
2114    pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2115    where
2116        T: std::iter::IntoIterator<Item = V>,
2117        V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2118    {
2119        use std::iter::Iterator;
2120        self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2121        self
2122    }
2123
2124    /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
2125    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2126    where
2127        T: std::iter::IntoIterator<Item = V>,
2128        V: std::convert::Into<std::string::String>,
2129    {
2130        use std::iter::Iterator;
2131        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2132        self
2133    }
2134}
2135
2136impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2137    fn typename() -> &'static str {
2138        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2139    }
2140}
2141
2142#[doc(hidden)]
2143impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2144    type PageItem = crate::model::ServiceConnectionPolicy;
2145
2146    fn items(self) -> std::vec::Vec<Self::PageItem> {
2147        self.service_connection_policies
2148    }
2149
2150    fn next_page_token(&self) -> std::string::String {
2151        use std::clone::Clone;
2152        self.next_page_token.clone()
2153    }
2154}
2155
2156/// Request for GetServiceConnectionPolicy.
2157#[serde_with::serde_as]
2158#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2159#[serde(default, rename_all = "camelCase")]
2160#[non_exhaustive]
2161pub struct GetServiceConnectionPolicyRequest {
2162    /// Required. Name of the ServiceConnectionPolicy to get.
2163    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2164    pub name: std::string::String,
2165
2166    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2167    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2168}
2169
2170impl GetServiceConnectionPolicyRequest {
2171    pub fn new() -> Self {
2172        std::default::Default::default()
2173    }
2174
2175    /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
2176    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2177        self.name = v.into();
2178        self
2179    }
2180}
2181
2182impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2183    fn typename() -> &'static str {
2184        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2185    }
2186}
2187
2188/// Request for CreateServiceConnectionPolicy.
2189#[serde_with::serde_as]
2190#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2191#[serde(default, rename_all = "camelCase")]
2192#[non_exhaustive]
2193pub struct CreateServiceConnectionPolicyRequest {
2194    /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
2195    /// projects/123/locations/us-east1
2196    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2197    pub parent: std::string::String,
2198
2199    /// Optional. Resource ID
2200    /// (i.e. 'foo' in
2201    /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
2202    /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
2203    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2204    pub service_connection_policy_id: std::string::String,
2205
2206    /// Required. Initial values for a new ServiceConnectionPolicies
2207    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2208    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2209
2210    /// Optional. An optional request ID to identify requests. Specify a unique
2211    /// request ID so that if you must retry your request, the server will know to
2212    /// ignore the request if it has already been completed. The server will
2213    /// guarantee that for at least 60 minutes since the first request.
2214    ///
2215    /// For example, consider a situation where you make an initial request and
2216    /// the request times out. If you make the request again with the same request
2217    /// ID, the server can check if original operation with the same request ID
2218    /// was received, and if so, will ignore the second request. This prevents
2219    /// clients from accidentally creating duplicate commitments.
2220    ///
2221    /// The request ID must be a valid UUID with the exception that zero UUID is
2222    /// not supported (00000000-0000-0000-0000-000000000000).
2223    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2224    pub request_id: std::string::String,
2225
2226    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2227    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2228}
2229
2230impl CreateServiceConnectionPolicyRequest {
2231    pub fn new() -> Self {
2232        std::default::Default::default()
2233    }
2234
2235    /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
2236    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2237        self.parent = v.into();
2238        self
2239    }
2240
2241    /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
2242    pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2243        mut self,
2244        v: T,
2245    ) -> Self {
2246        self.service_connection_policy_id = v.into();
2247        self
2248    }
2249
2250    /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
2251    pub fn set_service_connection_policy<
2252        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2253    >(
2254        mut self,
2255        v: T,
2256    ) -> Self {
2257        self.service_connection_policy = v.into();
2258        self
2259    }
2260
2261    /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
2262    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2263        self.request_id = v.into();
2264        self
2265    }
2266}
2267
2268impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2269    fn typename() -> &'static str {
2270        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2271    }
2272}
2273
2274/// Request for UpdateServiceConnectionPolicy.
2275#[serde_with::serde_as]
2276#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2277#[serde(default, rename_all = "camelCase")]
2278#[non_exhaustive]
2279pub struct UpdateServiceConnectionPolicyRequest {
2280    /// Optional. Field mask is used to specify the fields to be overwritten in the
2281    /// ServiceConnectionPolicy resource by the update.
2282    /// The fields specified in the update_mask are relative to the resource, not
2283    /// the full request. A field will be overwritten if it is in the mask. If the
2284    /// user does not provide a mask then all fields will be overwritten.
2285    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2286    pub update_mask: std::option::Option<wkt::FieldMask>,
2287
2288    /// Required. New values to be patched into the resource.
2289    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2290    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2291
2292    /// Optional. An optional request ID to identify requests. Specify a unique
2293    /// request ID so that if you must retry your request, the server will know to
2294    /// ignore the request if it has already been completed. The server will
2295    /// guarantee that for at least 60 minutes since the first request.
2296    ///
2297    /// For example, consider a situation where you make an initial request and
2298    /// the request times out. If you make the request again with the same request
2299    /// ID, the server can check if original operation with the same request ID
2300    /// was received, and if so, will ignore the second request. This prevents
2301    /// clients from accidentally creating duplicate commitments.
2302    ///
2303    /// The request ID must be a valid UUID with the exception that zero UUID is
2304    /// not supported (00000000-0000-0000-0000-000000000000).
2305    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2306    pub request_id: std::string::String,
2307
2308    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2309    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2310}
2311
2312impl UpdateServiceConnectionPolicyRequest {
2313    pub fn new() -> Self {
2314        std::default::Default::default()
2315    }
2316
2317    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
2318    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2319        mut self,
2320        v: T,
2321    ) -> Self {
2322        self.update_mask = v.into();
2323        self
2324    }
2325
2326    /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
2327    pub fn set_service_connection_policy<
2328        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2329    >(
2330        mut self,
2331        v: T,
2332    ) -> Self {
2333        self.service_connection_policy = v.into();
2334        self
2335    }
2336
2337    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
2338    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2339        self.request_id = v.into();
2340        self
2341    }
2342}
2343
2344impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2345    fn typename() -> &'static str {
2346        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2347    }
2348}
2349
2350/// Request for DeleteServiceConnectionPolicy.
2351#[serde_with::serde_as]
2352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2353#[serde(default, rename_all = "camelCase")]
2354#[non_exhaustive]
2355pub struct DeleteServiceConnectionPolicyRequest {
2356    /// Required. The name of the ServiceConnectionPolicy to delete.
2357    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2358    pub name: std::string::String,
2359
2360    /// Optional. An optional request ID to identify requests. Specify a unique
2361    /// request ID so that if you must retry your request, the server will know to
2362    /// ignore the request if it has already been completed. The server will
2363    /// guarantee that for at least 60 minutes after the first request.
2364    ///
2365    /// For example, consider a situation where you make an initial request and
2366    /// the request times out. If you make the request again with the same request
2367    /// ID, the server can check if original operation with the same request ID
2368    /// was received, and if so, will ignore the second request. This prevents
2369    /// clients from accidentally creating duplicate commitments.
2370    ///
2371    /// The request ID must be a valid UUID with the exception that zero UUID is
2372    /// not supported (00000000-0000-0000-0000-000000000000).
2373    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2374    pub request_id: std::string::String,
2375
2376    /// Optional. The etag is computed by the server, and may be sent on update and
2377    /// delete requests to ensure the client has an up-to-date value before
2378    /// proceeding.
2379    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2380    pub etag: std::option::Option<std::string::String>,
2381
2382    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2383    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2384}
2385
2386impl DeleteServiceConnectionPolicyRequest {
2387    pub fn new() -> Self {
2388        std::default::Default::default()
2389    }
2390
2391    /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
2392    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2393        self.name = v.into();
2394        self
2395    }
2396
2397    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
2398    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2399        self.request_id = v.into();
2400        self
2401    }
2402
2403    /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
2404    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2405        mut self,
2406        v: T,
2407    ) -> Self {
2408        self.etag = v.into();
2409        self
2410    }
2411}
2412
2413impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2414    fn typename() -> &'static str {
2415        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2416    }
2417}
2418
2419/// The ServiceClass resource.
2420#[serde_with::serde_as]
2421#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2422#[serde(default, rename_all = "camelCase")]
2423#[non_exhaustive]
2424pub struct ServiceClass {
2425    /// Immutable. The name of a ServiceClass resource.
2426    /// Format:
2427    /// projects/{project}/locations/{location}/serviceClasses/{service_class}
2428    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2429    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2430    pub name: std::string::String,
2431
2432    /// Output only. The generated service class name. Use this name to refer to
2433    /// the Service class in Service Connection Maps and Service Connection
2434    /// Policies.
2435    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2436    pub service_class: std::string::String,
2437
2438    /// Output only. Time when the ServiceClass was created.
2439    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2440    pub create_time: std::option::Option<wkt::Timestamp>,
2441
2442    /// Output only. Time when the ServiceClass was updated.
2443    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2444    pub update_time: std::option::Option<wkt::Timestamp>,
2445
2446    /// User-defined labels.
2447    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2448    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2449
2450    /// A description of this resource.
2451    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2452    pub description: std::string::String,
2453
2454    /// Optional. The etag is computed by the server, and may be sent on update and
2455    /// delete requests to ensure the client has an up-to-date value before
2456    /// proceeding.
2457    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2458    pub etag: std::option::Option<std::string::String>,
2459
2460    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2461    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2462}
2463
2464impl ServiceClass {
2465    pub fn new() -> Self {
2466        std::default::Default::default()
2467    }
2468
2469    /// Sets the value of [name][crate::model::ServiceClass::name].
2470    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2471        self.name = v.into();
2472        self
2473    }
2474
2475    /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
2476    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477        self.service_class = v.into();
2478        self
2479    }
2480
2481    /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
2482    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2483        mut self,
2484        v: T,
2485    ) -> Self {
2486        self.create_time = v.into();
2487        self
2488    }
2489
2490    /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
2491    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2492        mut self,
2493        v: T,
2494    ) -> Self {
2495        self.update_time = v.into();
2496        self
2497    }
2498
2499    /// Sets the value of [description][crate::model::ServiceClass::description].
2500    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2501        self.description = v.into();
2502        self
2503    }
2504
2505    /// Sets the value of [etag][crate::model::ServiceClass::etag].
2506    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2507        mut self,
2508        v: T,
2509    ) -> Self {
2510        self.etag = v.into();
2511        self
2512    }
2513
2514    /// Sets the value of [labels][crate::model::ServiceClass::labels].
2515    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2516    where
2517        T: std::iter::IntoIterator<Item = (K, V)>,
2518        K: std::convert::Into<std::string::String>,
2519        V: std::convert::Into<std::string::String>,
2520    {
2521        use std::iter::Iterator;
2522        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2523        self
2524    }
2525}
2526
2527impl wkt::message::Message for ServiceClass {
2528    fn typename() -> &'static str {
2529        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2530    }
2531}
2532
2533/// Request for ListServiceClasses.
2534#[serde_with::serde_as]
2535#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2536#[serde(default, rename_all = "camelCase")]
2537#[non_exhaustive]
2538pub struct ListServiceClassesRequest {
2539    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
2540    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2541    pub parent: std::string::String,
2542
2543    /// The maximum number of results per page that should be returned.
2544    pub page_size: i32,
2545
2546    /// The page token.
2547    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2548    pub page_token: std::string::String,
2549
2550    /// A filter expression that filters the results listed in the response.
2551    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2552    pub filter: std::string::String,
2553
2554    /// Sort the results by a certain order.
2555    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2556    pub order_by: std::string::String,
2557
2558    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2559    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2560}
2561
2562impl ListServiceClassesRequest {
2563    pub fn new() -> Self {
2564        std::default::Default::default()
2565    }
2566
2567    /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
2568    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2569        self.parent = v.into();
2570        self
2571    }
2572
2573    /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
2574    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2575        self.page_size = v.into();
2576        self
2577    }
2578
2579    /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
2580    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581        self.page_token = v.into();
2582        self
2583    }
2584
2585    /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
2586    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2587        self.filter = v.into();
2588        self
2589    }
2590
2591    /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
2592    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2593        self.order_by = v.into();
2594        self
2595    }
2596}
2597
2598impl wkt::message::Message for ListServiceClassesRequest {
2599    fn typename() -> &'static str {
2600        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
2601    }
2602}
2603
2604/// Response for ListServiceClasses.
2605#[serde_with::serde_as]
2606#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2607#[serde(default, rename_all = "camelCase")]
2608#[non_exhaustive]
2609pub struct ListServiceClassesResponse {
2610    /// ServiceClasses to be returned.
2611    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2612    pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
2613
2614    /// The next pagination token in the List response. It should be used as
2615    /// page_token for the following request. An empty value means no more result.
2616    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2617    pub next_page_token: std::string::String,
2618
2619    /// Locations that could not be reached.
2620    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2621    pub unreachable: std::vec::Vec<std::string::String>,
2622
2623    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2624    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2625}
2626
2627impl ListServiceClassesResponse {
2628    pub fn new() -> Self {
2629        std::default::Default::default()
2630    }
2631
2632    /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
2633    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2634        self.next_page_token = v.into();
2635        self
2636    }
2637
2638    /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
2639    pub fn set_service_classes<T, V>(mut self, v: T) -> Self
2640    where
2641        T: std::iter::IntoIterator<Item = V>,
2642        V: std::convert::Into<crate::model::ServiceClass>,
2643    {
2644        use std::iter::Iterator;
2645        self.service_classes = v.into_iter().map(|i| i.into()).collect();
2646        self
2647    }
2648
2649    /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
2650    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2651    where
2652        T: std::iter::IntoIterator<Item = V>,
2653        V: std::convert::Into<std::string::String>,
2654    {
2655        use std::iter::Iterator;
2656        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2657        self
2658    }
2659}
2660
2661impl wkt::message::Message for ListServiceClassesResponse {
2662    fn typename() -> &'static str {
2663        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
2664    }
2665}
2666
2667#[doc(hidden)]
2668impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
2669    type PageItem = crate::model::ServiceClass;
2670
2671    fn items(self) -> std::vec::Vec<Self::PageItem> {
2672        self.service_classes
2673    }
2674
2675    fn next_page_token(&self) -> std::string::String {
2676        use std::clone::Clone;
2677        self.next_page_token.clone()
2678    }
2679}
2680
2681/// Request for GetServiceClass.
2682#[serde_with::serde_as]
2683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2684#[serde(default, rename_all = "camelCase")]
2685#[non_exhaustive]
2686pub struct GetServiceClassRequest {
2687    /// Required. Name of the ServiceClass to get.
2688    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2689    pub name: std::string::String,
2690
2691    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2692    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2693}
2694
2695impl GetServiceClassRequest {
2696    pub fn new() -> Self {
2697        std::default::Default::default()
2698    }
2699
2700    /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
2701    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2702        self.name = v.into();
2703        self
2704    }
2705}
2706
2707impl wkt::message::Message for GetServiceClassRequest {
2708    fn typename() -> &'static str {
2709        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
2710    }
2711}
2712
2713/// Request for UpdateServiceClass.
2714#[serde_with::serde_as]
2715#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2716#[serde(default, rename_all = "camelCase")]
2717#[non_exhaustive]
2718pub struct UpdateServiceClassRequest {
2719    /// Optional. Field mask is used to specify the fields to be overwritten in the
2720    /// ServiceClass resource by the update.
2721    /// The fields specified in the update_mask are relative to the resource, not
2722    /// the full request. A field will be overwritten if it is in the mask. If the
2723    /// user does not provide a mask then all fields will be overwritten.
2724    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2725    pub update_mask: std::option::Option<wkt::FieldMask>,
2726
2727    /// Required. New values to be patched into the resource.
2728    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2729    pub service_class: std::option::Option<crate::model::ServiceClass>,
2730
2731    /// Optional. An optional request ID to identify requests. Specify a unique
2732    /// request ID so that if you must retry your request, the server will know to
2733    /// ignore the request if it has already been completed. The server will
2734    /// guarantee that for at least 60 minutes since the first request.
2735    ///
2736    /// For example, consider a situation where you make an initial request and
2737    /// the request times out. If you make the request again with the same request
2738    /// ID, the server can check if original operation with the same request ID
2739    /// was received, and if so, will ignore the second request. This prevents
2740    /// clients from accidentally creating duplicate commitments.
2741    ///
2742    /// The request ID must be a valid UUID with the exception that zero UUID is
2743    /// not supported (00000000-0000-0000-0000-000000000000).
2744    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2745    pub request_id: std::string::String,
2746
2747    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2748    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl UpdateServiceClassRequest {
2752    pub fn new() -> Self {
2753        std::default::Default::default()
2754    }
2755
2756    /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
2757    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2758        mut self,
2759        v: T,
2760    ) -> Self {
2761        self.update_mask = v.into();
2762        self
2763    }
2764
2765    /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
2766    pub fn set_service_class<
2767        T: std::convert::Into<std::option::Option<crate::model::ServiceClass>>,
2768    >(
2769        mut self,
2770        v: T,
2771    ) -> Self {
2772        self.service_class = v.into();
2773        self
2774    }
2775
2776    /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
2777    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2778        self.request_id = v.into();
2779        self
2780    }
2781}
2782
2783impl wkt::message::Message for UpdateServiceClassRequest {
2784    fn typename() -> &'static str {
2785        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
2786    }
2787}
2788
2789/// Request for DeleteServiceClass.
2790#[serde_with::serde_as]
2791#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2792#[serde(default, rename_all = "camelCase")]
2793#[non_exhaustive]
2794pub struct DeleteServiceClassRequest {
2795    /// Required. The name of the ServiceClass to delete.
2796    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2797    pub name: std::string::String,
2798
2799    /// Optional. An optional request ID to identify requests. Specify a unique
2800    /// request ID so that if you must retry your request, the server will know to
2801    /// ignore the request if it has already been completed. The server will
2802    /// guarantee that for at least 60 minutes after the first request.
2803    ///
2804    /// For example, consider a situation where you make an initial request and
2805    /// the request times out. If you make the request again with the same request
2806    /// ID, the server can check if original operation with the same request ID
2807    /// was received, and if so, will ignore the second request. This prevents
2808    /// clients from accidentally creating duplicate commitments.
2809    ///
2810    /// The request ID must be a valid UUID with the exception that zero UUID is
2811    /// not supported (00000000-0000-0000-0000-000000000000).
2812    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2813    pub request_id: std::string::String,
2814
2815    /// Optional. The etag is computed by the server, and may be sent on update and
2816    /// delete requests to ensure the client has an up-to-date value before
2817    /// proceeding.
2818    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2819    pub etag: std::option::Option<std::string::String>,
2820
2821    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2822    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl DeleteServiceClassRequest {
2826    pub fn new() -> Self {
2827        std::default::Default::default()
2828    }
2829
2830    /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
2831    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832        self.name = v.into();
2833        self
2834    }
2835
2836    /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
2837    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2838        self.request_id = v.into();
2839        self
2840    }
2841
2842    /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
2843    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2844        mut self,
2845        v: T,
2846    ) -> Self {
2847        self.etag = v.into();
2848        self
2849    }
2850}
2851
2852impl wkt::message::Message for DeleteServiceClassRequest {
2853    fn typename() -> &'static str {
2854        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
2855    }
2856}
2857
2858/// The ServiceConnectionToken resource.
2859#[serde_with::serde_as]
2860#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2861#[serde(default, rename_all = "camelCase")]
2862#[non_exhaustive]
2863pub struct ServiceConnectionToken {
2864    /// Immutable. The name of a ServiceConnectionToken.
2865    /// Format:
2866    /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
2867    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2868    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2869    pub name: std::string::String,
2870
2871    /// Output only. Time when the ServiceConnectionToken was created.
2872    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2873    pub create_time: std::option::Option<wkt::Timestamp>,
2874
2875    /// Output only. Time when the ServiceConnectionToken was updated.
2876    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2877    pub update_time: std::option::Option<wkt::Timestamp>,
2878
2879    /// User-defined labels.
2880    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2881    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2882
2883    /// A description of this resource.
2884    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2885    pub description: std::string::String,
2886
2887    /// The resource path of the network associated with this token.
2888    /// Example:
2889    /// projects/{projectNumOrId}/global/networks/{resourceId}.
2890    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2891    pub network: std::string::String,
2892
2893    /// Output only. The token generated by Automation.
2894    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2895    pub token: std::string::String,
2896
2897    /// Output only. The time to which this token is valid.
2898    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2899    pub expire_time: std::option::Option<wkt::Timestamp>,
2900
2901    /// Optional. The etag is computed by the server, and may be sent on update and
2902    /// delete requests to ensure the client has an up-to-date value before
2903    /// proceeding.
2904    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2905    pub etag: std::option::Option<std::string::String>,
2906
2907    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2908    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2909}
2910
2911impl ServiceConnectionToken {
2912    pub fn new() -> Self {
2913        std::default::Default::default()
2914    }
2915
2916    /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
2917    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2918        self.name = v.into();
2919        self
2920    }
2921
2922    /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
2923    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2924        mut self,
2925        v: T,
2926    ) -> Self {
2927        self.create_time = v.into();
2928        self
2929    }
2930
2931    /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
2932    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2933        mut self,
2934        v: T,
2935    ) -> Self {
2936        self.update_time = v.into();
2937        self
2938    }
2939
2940    /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
2941    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2942        self.description = v.into();
2943        self
2944    }
2945
2946    /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
2947    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948        self.network = v.into();
2949        self
2950    }
2951
2952    /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
2953    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2954        self.token = v.into();
2955        self
2956    }
2957
2958    /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
2959    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2960        mut self,
2961        v: T,
2962    ) -> Self {
2963        self.expire_time = v.into();
2964        self
2965    }
2966
2967    /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
2968    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2969        mut self,
2970        v: T,
2971    ) -> Self {
2972        self.etag = v.into();
2973        self
2974    }
2975
2976    /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
2977    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2978    where
2979        T: std::iter::IntoIterator<Item = (K, V)>,
2980        K: std::convert::Into<std::string::String>,
2981        V: std::convert::Into<std::string::String>,
2982    {
2983        use std::iter::Iterator;
2984        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2985        self
2986    }
2987}
2988
2989impl wkt::message::Message for ServiceConnectionToken {
2990    fn typename() -> &'static str {
2991        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
2992    }
2993}
2994
2995/// Request for ListServiceConnectionTokens.
2996#[serde_with::serde_as]
2997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2998#[serde(default, rename_all = "camelCase")]
2999#[non_exhaustive]
3000pub struct ListServiceConnectionTokensRequest {
3001    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3002    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3003    pub parent: std::string::String,
3004
3005    /// The maximum number of results per page that should be returned.
3006    pub page_size: i32,
3007
3008    /// The page token.
3009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3010    pub page_token: std::string::String,
3011
3012    /// A filter expression that filters the results listed in the response.
3013    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3014    pub filter: std::string::String,
3015
3016    /// Sort the results by a certain order.
3017    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3018    pub order_by: std::string::String,
3019
3020    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3021    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3022}
3023
3024impl ListServiceConnectionTokensRequest {
3025    pub fn new() -> Self {
3026        std::default::Default::default()
3027    }
3028
3029    /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
3030    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3031        self.parent = v.into();
3032        self
3033    }
3034
3035    /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
3036    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3037        self.page_size = v.into();
3038        self
3039    }
3040
3041    /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
3042    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3043        self.page_token = v.into();
3044        self
3045    }
3046
3047    /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
3048    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3049        self.filter = v.into();
3050        self
3051    }
3052
3053    /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
3054    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3055        self.order_by = v.into();
3056        self
3057    }
3058}
3059
3060impl wkt::message::Message for ListServiceConnectionTokensRequest {
3061    fn typename() -> &'static str {
3062        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3063    }
3064}
3065
3066/// Response for ListServiceConnectionTokens.
3067#[serde_with::serde_as]
3068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3069#[serde(default, rename_all = "camelCase")]
3070#[non_exhaustive]
3071pub struct ListServiceConnectionTokensResponse {
3072    /// ServiceConnectionTokens to be returned.
3073    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3074    pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3075
3076    /// The next pagination token in the List response. It should be used as
3077    /// page_token for the following request. An empty value means no more result.
3078    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3079    pub next_page_token: std::string::String,
3080
3081    /// Locations that could not be reached.
3082    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3083    pub unreachable: std::vec::Vec<std::string::String>,
3084
3085    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3086    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3087}
3088
3089impl ListServiceConnectionTokensResponse {
3090    pub fn new() -> Self {
3091        std::default::Default::default()
3092    }
3093
3094    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
3095    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3096        self.next_page_token = v.into();
3097        self
3098    }
3099
3100    /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
3101    pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3102    where
3103        T: std::iter::IntoIterator<Item = V>,
3104        V: std::convert::Into<crate::model::ServiceConnectionToken>,
3105    {
3106        use std::iter::Iterator;
3107        self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3108        self
3109    }
3110
3111    /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
3112    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3113    where
3114        T: std::iter::IntoIterator<Item = V>,
3115        V: std::convert::Into<std::string::String>,
3116    {
3117        use std::iter::Iterator;
3118        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3119        self
3120    }
3121}
3122
3123impl wkt::message::Message for ListServiceConnectionTokensResponse {
3124    fn typename() -> &'static str {
3125        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3126    }
3127}
3128
3129#[doc(hidden)]
3130impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3131    type PageItem = crate::model::ServiceConnectionToken;
3132
3133    fn items(self) -> std::vec::Vec<Self::PageItem> {
3134        self.service_connection_tokens
3135    }
3136
3137    fn next_page_token(&self) -> std::string::String {
3138        use std::clone::Clone;
3139        self.next_page_token.clone()
3140    }
3141}
3142
3143/// Request for GetServiceConnectionToken.
3144#[serde_with::serde_as]
3145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3146#[serde(default, rename_all = "camelCase")]
3147#[non_exhaustive]
3148pub struct GetServiceConnectionTokenRequest {
3149    /// Required. Name of the ServiceConnectionToken to get.
3150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3151    pub name: std::string::String,
3152
3153    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3154    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3155}
3156
3157impl GetServiceConnectionTokenRequest {
3158    pub fn new() -> Self {
3159        std::default::Default::default()
3160    }
3161
3162    /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
3163    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3164        self.name = v.into();
3165        self
3166    }
3167}
3168
3169impl wkt::message::Message for GetServiceConnectionTokenRequest {
3170    fn typename() -> &'static str {
3171        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3172    }
3173}
3174
3175/// Request for CreateServiceConnectionToken.
3176#[serde_with::serde_as]
3177#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3178#[serde(default, rename_all = "camelCase")]
3179#[non_exhaustive]
3180pub struct CreateServiceConnectionTokenRequest {
3181    /// Required. The parent resource's name of the ServiceConnectionToken. ex.
3182    /// projects/123/locations/us-east1
3183    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3184    pub parent: std::string::String,
3185
3186    /// Optional. Resource ID
3187    /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
3188    /// See <https://google.aip.dev/122#resource-id-segments>
3189    /// Unique per location.
3190    /// If one is not provided, one will be generated.
3191    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3192    pub service_connection_token_id: std::string::String,
3193
3194    /// Required. Initial values for a new ServiceConnectionTokens
3195    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3196    pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3197
3198    /// Optional. An optional request ID to identify requests. Specify a unique
3199    /// request ID so that if you must retry your request, the server will know to
3200    /// ignore the request if it has already been completed. The server will
3201    /// guarantee that for at least 60 minutes since the first request.
3202    ///
3203    /// For example, consider a situation where you make an initial request and
3204    /// the request times out. If you make the request again with the same request
3205    /// ID, the server can check if original operation with the same request ID
3206    /// was received, and if so, will ignore the second request. This prevents
3207    /// clients from accidentally creating duplicate commitments.
3208    ///
3209    /// The request ID must be a valid UUID with the exception that zero UUID is
3210    /// not supported (00000000-0000-0000-0000-000000000000).
3211    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3212    pub request_id: std::string::String,
3213
3214    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3215    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3216}
3217
3218impl CreateServiceConnectionTokenRequest {
3219    pub fn new() -> Self {
3220        std::default::Default::default()
3221    }
3222
3223    /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
3224    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3225        self.parent = v.into();
3226        self
3227    }
3228
3229    /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
3230    pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3231        mut self,
3232        v: T,
3233    ) -> Self {
3234        self.service_connection_token_id = v.into();
3235        self
3236    }
3237
3238    /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
3239    pub fn set_service_connection_token<
3240        T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionToken>>,
3241    >(
3242        mut self,
3243        v: T,
3244    ) -> Self {
3245        self.service_connection_token = v.into();
3246        self
3247    }
3248
3249    /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
3250    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3251        self.request_id = v.into();
3252        self
3253    }
3254}
3255
3256impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3257    fn typename() -> &'static str {
3258        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3259    }
3260}
3261
3262/// Request for DeleteServiceConnectionToken.
3263#[serde_with::serde_as]
3264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3265#[serde(default, rename_all = "camelCase")]
3266#[non_exhaustive]
3267pub struct DeleteServiceConnectionTokenRequest {
3268    /// Required. The name of the ServiceConnectionToken to delete.
3269    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3270    pub name: std::string::String,
3271
3272    /// Optional. An optional request ID to identify requests. Specify a unique
3273    /// request ID so that if you must retry your request, the server will know to
3274    /// ignore the request if it has already been completed. The server will
3275    /// guarantee that for at least 60 minutes after the first request.
3276    ///
3277    /// For example, consider a situation where you make an initial request and
3278    /// the request times out. If you make the request again with the same request
3279    /// ID, the server can check if original operation with the same request ID
3280    /// was received, and if so, will ignore the second request. This prevents
3281    /// clients from accidentally creating duplicate commitments.
3282    ///
3283    /// The request ID must be a valid UUID with the exception that zero UUID is
3284    /// not supported (00000000-0000-0000-0000-000000000000).
3285    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3286    pub request_id: std::string::String,
3287
3288    /// Optional. The etag is computed by the server, and may be sent on update and
3289    /// delete requests to ensure the client has an up-to-date value before
3290    /// proceeding.
3291    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3292    pub etag: std::option::Option<std::string::String>,
3293
3294    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3295    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3296}
3297
3298impl DeleteServiceConnectionTokenRequest {
3299    pub fn new() -> Self {
3300        std::default::Default::default()
3301    }
3302
3303    /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
3304    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3305        self.name = v.into();
3306        self
3307    }
3308
3309    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
3310    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3311        self.request_id = v.into();
3312        self
3313    }
3314
3315    /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
3316    pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3317        mut self,
3318        v: T,
3319    ) -> Self {
3320        self.etag = v.into();
3321        self
3322    }
3323}
3324
3325impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3326    fn typename() -> &'static str {
3327        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3328    }
3329}
3330
3331/// A Network Connectivity Center hub is a global management resource to which
3332/// you attach spokes. A single hub can contain spokes from multiple regions.
3333/// However, if any of a hub's spokes use the site-to-site data transfer feature,
3334/// the resources associated with those spokes must all be in the same VPC
3335/// network. Spokes that do not use site-to-site data transfer can be associated
3336/// with any VPC network in your project.
3337#[serde_with::serde_as]
3338#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3339#[serde(default, rename_all = "camelCase")]
3340#[non_exhaustive]
3341pub struct Hub {
3342    /// Immutable. The name of the hub. Hub names must be unique. They use the
3343    /// following form:
3344    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
3345    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3346    pub name: std::string::String,
3347
3348    /// Output only. The time the hub was created.
3349    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3350    pub create_time: std::option::Option<wkt::Timestamp>,
3351
3352    /// Output only. The time the hub was last updated.
3353    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3354    pub update_time: std::option::Option<wkt::Timestamp>,
3355
3356    /// Optional labels in key-value pair format. For more information about
3357    /// labels, see [Requirements for
3358    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
3359    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3360    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3361
3362    /// Optional. An optional description of the hub.
3363    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3364    pub description: std::string::String,
3365
3366    /// Output only. The Google-generated UUID for the hub. This value is unique
3367    /// across all hub resources. If a hub is deleted and another with the same
3368    /// name is created, the new hub is assigned a different unique_id.
3369    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3370    pub unique_id: std::string::String,
3371
3372    /// Output only. The current lifecycle state of this hub.
3373    pub state: crate::model::State,
3374
3375    /// The VPC networks associated with this hub's spokes.
3376    ///
3377    /// This field is read-only. Network Connectivity Center automatically
3378    /// populates it based on the set of spokes attached to the hub.
3379    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3380    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
3381
3382    /// Output only. The route tables that belong to this hub. They use the
3383    /// following form:
3384    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
3385    ///
3386    /// This field is read-only. Network Connectivity Center automatically
3387    /// populates it based on the route tables nested under the hub.
3388    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3389    pub route_tables: std::vec::Vec<std::string::String>,
3390
3391    /// Output only. A summary of the spokes associated with a hub. The
3392    /// summary includes a count of spokes according to type
3393    /// and according to state. If any spokes are inactive,
3394    /// the summary also lists the reasons they are inactive,
3395    /// including a count for each reason.
3396    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3397    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
3398
3399    /// Optional. The policy mode of this hub. This field can be either
3400    /// PRESET or CUSTOM. If unspecified, the
3401    /// policy_mode defaults to PRESET.
3402    pub policy_mode: crate::model::PolicyMode,
3403
3404    /// Optional. The topology implemented in this hub. Currently, this field is
3405    /// only used when policy_mode = PRESET. The available preset topologies are
3406    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
3407    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
3408    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
3409    pub preset_topology: crate::model::PresetTopology,
3410
3411    /// Optional. Whether Private Service Connect connection propagation is enabled
3412    /// for the hub. If true, Private Service Connect endpoints in VPC spokes
3413    /// attached to the hub are made accessible to other VPC spokes attached to the
3414    /// hub. The default value is false.
3415    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3416    pub export_psc: std::option::Option<bool>,
3417
3418    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3419    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3420}
3421
3422impl Hub {
3423    pub fn new() -> Self {
3424        std::default::Default::default()
3425    }
3426
3427    /// Sets the value of [name][crate::model::Hub::name].
3428    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3429        self.name = v.into();
3430        self
3431    }
3432
3433    /// Sets the value of [create_time][crate::model::Hub::create_time].
3434    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3435        mut self,
3436        v: T,
3437    ) -> Self {
3438        self.create_time = v.into();
3439        self
3440    }
3441
3442    /// Sets the value of [update_time][crate::model::Hub::update_time].
3443    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3444        mut self,
3445        v: T,
3446    ) -> Self {
3447        self.update_time = v.into();
3448        self
3449    }
3450
3451    /// Sets the value of [description][crate::model::Hub::description].
3452    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3453        self.description = v.into();
3454        self
3455    }
3456
3457    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
3458    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459        self.unique_id = v.into();
3460        self
3461    }
3462
3463    /// Sets the value of [state][crate::model::Hub::state].
3464    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3465        self.state = v.into();
3466        self
3467    }
3468
3469    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
3470    pub fn set_spoke_summary<
3471        T: std::convert::Into<std::option::Option<crate::model::SpokeSummary>>,
3472    >(
3473        mut self,
3474        v: T,
3475    ) -> Self {
3476        self.spoke_summary = v.into();
3477        self
3478    }
3479
3480    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
3481    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
3482        mut self,
3483        v: T,
3484    ) -> Self {
3485        self.policy_mode = v.into();
3486        self
3487    }
3488
3489    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
3490    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
3491        mut self,
3492        v: T,
3493    ) -> Self {
3494        self.preset_topology = v.into();
3495        self
3496    }
3497
3498    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
3499    pub fn set_export_psc<T: std::convert::Into<std::option::Option<bool>>>(
3500        mut self,
3501        v: T,
3502    ) -> Self {
3503        self.export_psc = v.into();
3504        self
3505    }
3506
3507    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
3508    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
3509    where
3510        T: std::iter::IntoIterator<Item = V>,
3511        V: std::convert::Into<crate::model::RoutingVPC>,
3512    {
3513        use std::iter::Iterator;
3514        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
3515        self
3516    }
3517
3518    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
3519    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
3520    where
3521        T: std::iter::IntoIterator<Item = V>,
3522        V: std::convert::Into<std::string::String>,
3523    {
3524        use std::iter::Iterator;
3525        self.route_tables = v.into_iter().map(|i| i.into()).collect();
3526        self
3527    }
3528
3529    /// Sets the value of [labels][crate::model::Hub::labels].
3530    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3531    where
3532        T: std::iter::IntoIterator<Item = (K, V)>,
3533        K: std::convert::Into<std::string::String>,
3534        V: std::convert::Into<std::string::String>,
3535    {
3536        use std::iter::Iterator;
3537        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3538        self
3539    }
3540}
3541
3542impl wkt::message::Message for Hub {
3543    fn typename() -> &'static str {
3544        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
3545    }
3546}
3547
3548/// RoutingVPC contains information about the VPC networks associated
3549/// with the spokes of a Network Connectivity Center hub.
3550#[serde_with::serde_as]
3551#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3552#[serde(default, rename_all = "camelCase")]
3553#[non_exhaustive]
3554pub struct RoutingVPC {
3555    /// The URI of the VPC network.
3556    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3557    pub uri: std::string::String,
3558
3559    /// Output only. If true, indicates that this VPC network is currently
3560    /// associated with spokes that use the data transfer feature (spokes where the
3561    /// site_to_site_data_transfer field is set to true). If you create new spokes
3562    /// that use data transfer, they must be associated with this VPC network. At
3563    /// most, one VPC network will have this field set to true.
3564    pub required_for_new_site_to_site_data_transfer_spokes: bool,
3565
3566    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3567    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3568}
3569
3570impl RoutingVPC {
3571    pub fn new() -> Self {
3572        std::default::Default::default()
3573    }
3574
3575    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
3576    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3577        self.uri = v.into();
3578        self
3579    }
3580
3581    /// 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].
3582    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
3583        mut self,
3584        v: T,
3585    ) -> Self {
3586        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
3587        self
3588    }
3589}
3590
3591impl wkt::message::Message for RoutingVPC {
3592    fn typename() -> &'static str {
3593        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
3594    }
3595}
3596
3597/// A Network Connectivity Center spoke represents one or more network
3598/// connectivity resources.
3599///
3600/// When you create a spoke, you associate it with a hub. You must also
3601/// identify a value for exactly one of the following fields:
3602///
3603/// * linked_vpn_tunnels
3604/// * linked_interconnect_attachments
3605/// * linked_router_appliance_instances
3606/// * linked_vpc_network
3607#[serde_with::serde_as]
3608#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3609#[serde(default, rename_all = "camelCase")]
3610#[non_exhaustive]
3611pub struct Spoke {
3612    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
3613    /// following form:
3614    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
3615    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3616    pub name: std::string::String,
3617
3618    /// Output only. The time the spoke was created.
3619    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3620    pub create_time: std::option::Option<wkt::Timestamp>,
3621
3622    /// Output only. The time the spoke was last updated.
3623    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3624    pub update_time: std::option::Option<wkt::Timestamp>,
3625
3626    /// Optional labels in key-value pair format. For more information about
3627    /// labels, see [Requirements for
3628    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
3629    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3630    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3631
3632    /// Optional. An optional description of the spoke.
3633    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3634    pub description: std::string::String,
3635
3636    /// Immutable. The name of the hub that this spoke is attached to.
3637    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3638    pub hub: std::string::String,
3639
3640    /// Optional. The name of the group that this spoke is associated with.
3641    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3642    pub group: std::string::String,
3643
3644    /// Optional. VPN tunnels that are associated with the spoke.
3645    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3646    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
3647
3648    /// Optional. VLAN attachments that are associated with the spoke.
3649    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3650    pub linked_interconnect_attachments:
3651        std::option::Option<crate::model::LinkedInterconnectAttachments>,
3652
3653    /// Optional. Router appliance instances that are associated with the spoke.
3654    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3655    pub linked_router_appliance_instances:
3656        std::option::Option<crate::model::LinkedRouterApplianceInstances>,
3657
3658    /// Optional. VPC network that is associated with the spoke.
3659    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3660    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
3661
3662    /// Optional. The linked producer VPC that is associated with the spoke.
3663    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3664    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
3665
3666    /// Output only. The Google-generated UUID for the spoke. This value is unique
3667    /// across all spoke resources. If a spoke is deleted and another with the same
3668    /// name is created, the new spoke is assigned a different `unique_id`.
3669    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3670    pub unique_id: std::string::String,
3671
3672    /// Output only. The current lifecycle state of this spoke.
3673    pub state: crate::model::State,
3674
3675    /// Output only. The reasons for current state of the spoke.
3676    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3677    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
3678
3679    /// Output only. The type of resource associated with the spoke.
3680    pub spoke_type: crate::model::SpokeType,
3681
3682    /// Optional. This checksum is computed by the server based on the value of
3683    /// other fields, and may be sent on update and delete requests to ensure the
3684    /// client has an up-to-date value before proceeding.
3685    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3686    pub etag: std::string::String,
3687
3688    /// Optional. The list of fields waiting for hub administration's approval.
3689    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3690    pub field_paths_pending_update: std::vec::Vec<std::string::String>,
3691
3692    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3693    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3694}
3695
3696impl Spoke {
3697    pub fn new() -> Self {
3698        std::default::Default::default()
3699    }
3700
3701    /// Sets the value of [name][crate::model::Spoke::name].
3702    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3703        self.name = v.into();
3704        self
3705    }
3706
3707    /// Sets the value of [create_time][crate::model::Spoke::create_time].
3708    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3709        mut self,
3710        v: T,
3711    ) -> Self {
3712        self.create_time = v.into();
3713        self
3714    }
3715
3716    /// Sets the value of [update_time][crate::model::Spoke::update_time].
3717    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3718        mut self,
3719        v: T,
3720    ) -> Self {
3721        self.update_time = v.into();
3722        self
3723    }
3724
3725    /// Sets the value of [description][crate::model::Spoke::description].
3726    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3727        self.description = v.into();
3728        self
3729    }
3730
3731    /// Sets the value of [hub][crate::model::Spoke::hub].
3732    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3733        self.hub = v.into();
3734        self
3735    }
3736
3737    /// Sets the value of [group][crate::model::Spoke::group].
3738    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3739        self.group = v.into();
3740        self
3741    }
3742
3743    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
3744    pub fn set_linked_vpn_tunnels<
3745        T: std::convert::Into<std::option::Option<crate::model::LinkedVpnTunnels>>,
3746    >(
3747        mut self,
3748        v: T,
3749    ) -> Self {
3750        self.linked_vpn_tunnels = v.into();
3751        self
3752    }
3753
3754    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
3755    pub fn set_linked_interconnect_attachments<
3756        T: std::convert::Into<std::option::Option<crate::model::LinkedInterconnectAttachments>>,
3757    >(
3758        mut self,
3759        v: T,
3760    ) -> Self {
3761        self.linked_interconnect_attachments = v.into();
3762        self
3763    }
3764
3765    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
3766    pub fn set_linked_router_appliance_instances<
3767        T: std::convert::Into<std::option::Option<crate::model::LinkedRouterApplianceInstances>>,
3768    >(
3769        mut self,
3770        v: T,
3771    ) -> Self {
3772        self.linked_router_appliance_instances = v.into();
3773        self
3774    }
3775
3776    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
3777    pub fn set_linked_vpc_network<
3778        T: std::convert::Into<std::option::Option<crate::model::LinkedVpcNetwork>>,
3779    >(
3780        mut self,
3781        v: T,
3782    ) -> Self {
3783        self.linked_vpc_network = v.into();
3784        self
3785    }
3786
3787    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
3788    pub fn set_linked_producer_vpc_network<
3789        T: std::convert::Into<std::option::Option<crate::model::LinkedProducerVpcNetwork>>,
3790    >(
3791        mut self,
3792        v: T,
3793    ) -> Self {
3794        self.linked_producer_vpc_network = v.into();
3795        self
3796    }
3797
3798    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
3799    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3800        self.unique_id = v.into();
3801        self
3802    }
3803
3804    /// Sets the value of [state][crate::model::Spoke::state].
3805    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3806        self.state = v.into();
3807        self
3808    }
3809
3810    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
3811    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
3812        self.spoke_type = v.into();
3813        self
3814    }
3815
3816    /// Sets the value of [etag][crate::model::Spoke::etag].
3817    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3818        self.etag = v.into();
3819        self
3820    }
3821
3822    /// Sets the value of [reasons][crate::model::Spoke::reasons].
3823    pub fn set_reasons<T, V>(mut self, v: T) -> Self
3824    where
3825        T: std::iter::IntoIterator<Item = V>,
3826        V: std::convert::Into<crate::model::spoke::StateReason>,
3827    {
3828        use std::iter::Iterator;
3829        self.reasons = v.into_iter().map(|i| i.into()).collect();
3830        self
3831    }
3832
3833    /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
3834    pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
3835    where
3836        T: std::iter::IntoIterator<Item = V>,
3837        V: std::convert::Into<std::string::String>,
3838    {
3839        use std::iter::Iterator;
3840        self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
3841        self
3842    }
3843
3844    /// Sets the value of [labels][crate::model::Spoke::labels].
3845    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3846    where
3847        T: std::iter::IntoIterator<Item = (K, V)>,
3848        K: std::convert::Into<std::string::String>,
3849        V: std::convert::Into<std::string::String>,
3850    {
3851        use std::iter::Iterator;
3852        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3853        self
3854    }
3855}
3856
3857impl wkt::message::Message for Spoke {
3858    fn typename() -> &'static str {
3859        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
3860    }
3861}
3862
3863/// Defines additional types related to [Spoke].
3864pub mod spoke {
3865    #[allow(unused_imports)]
3866    use super::*;
3867
3868    /// The reason a spoke is inactive.
3869    #[serde_with::serde_as]
3870    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3871    #[serde(default, rename_all = "camelCase")]
3872    #[non_exhaustive]
3873    pub struct StateReason {
3874        /// The code associated with this reason.
3875        pub code: crate::model::spoke::state_reason::Code,
3876
3877        /// Human-readable details about this reason.
3878        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3879        pub message: std::string::String,
3880
3881        /// Additional information provided by the user in the RejectSpoke call.
3882        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3883        pub user_details: std::string::String,
3884
3885        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3886        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3887    }
3888
3889    impl StateReason {
3890        pub fn new() -> Self {
3891            std::default::Default::default()
3892        }
3893
3894        /// Sets the value of [code][crate::model::spoke::StateReason::code].
3895        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
3896            mut self,
3897            v: T,
3898        ) -> Self {
3899            self.code = v.into();
3900            self
3901        }
3902
3903        /// Sets the value of [message][crate::model::spoke::StateReason::message].
3904        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905            self.message = v.into();
3906            self
3907        }
3908
3909        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
3910        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
3911            mut self,
3912            v: T,
3913        ) -> Self {
3914            self.user_details = v.into();
3915            self
3916        }
3917    }
3918
3919    impl wkt::message::Message for StateReason {
3920        fn typename() -> &'static str {
3921            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
3922        }
3923    }
3924
3925    /// Defines additional types related to [StateReason].
3926    pub mod state_reason {
3927        #[allow(unused_imports)]
3928        use super::*;
3929
3930        /// The Code enum represents the various reasons a state can be `INACTIVE`.
3931        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3932        pub struct Code(i32);
3933
3934        impl Code {
3935            /// No information available.
3936            pub const CODE_UNSPECIFIED: Code = Code::new(0);
3937
3938            /// The proposed spoke is pending review.
3939            pub const PENDING_REVIEW: Code = Code::new(1);
3940
3941            /// The proposed spoke has been rejected by the hub administrator.
3942            pub const REJECTED: Code = Code::new(2);
3943
3944            /// The spoke has been deactivated internally.
3945            pub const PAUSED: Code = Code::new(3);
3946
3947            /// Network Connectivity Center encountered errors while accepting
3948            /// the spoke.
3949            pub const FAILED: Code = Code::new(4);
3950
3951            /// The proposed spoke update is pending review.
3952            pub const UPDATE_PENDING_REVIEW: Code = Code::new(5);
3953
3954            /// The proposed spoke update has been rejected by the hub administrator.
3955            pub const UPDATE_REJECTED: Code = Code::new(6);
3956
3957            /// Network Connectivity Center encountered errors while accepting
3958            /// the spoke update.
3959            pub const UPDATE_FAILED: Code = Code::new(7);
3960
3961            /// Creates a new Code instance.
3962            pub(crate) const fn new(value: i32) -> Self {
3963                Self(value)
3964            }
3965
3966            /// Gets the enum value.
3967            pub fn value(&self) -> i32 {
3968                self.0
3969            }
3970
3971            /// Gets the enum value as a string.
3972            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3973                match self.0 {
3974                    0 => std::borrow::Cow::Borrowed("CODE_UNSPECIFIED"),
3975                    1 => std::borrow::Cow::Borrowed("PENDING_REVIEW"),
3976                    2 => std::borrow::Cow::Borrowed("REJECTED"),
3977                    3 => std::borrow::Cow::Borrowed("PAUSED"),
3978                    4 => std::borrow::Cow::Borrowed("FAILED"),
3979                    5 => std::borrow::Cow::Borrowed("UPDATE_PENDING_REVIEW"),
3980                    6 => std::borrow::Cow::Borrowed("UPDATE_REJECTED"),
3981                    7 => std::borrow::Cow::Borrowed("UPDATE_FAILED"),
3982                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3983                }
3984            }
3985
3986            /// Creates an enum value from the value name.
3987            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3988                match name {
3989                    "CODE_UNSPECIFIED" => std::option::Option::Some(Self::CODE_UNSPECIFIED),
3990                    "PENDING_REVIEW" => std::option::Option::Some(Self::PENDING_REVIEW),
3991                    "REJECTED" => std::option::Option::Some(Self::REJECTED),
3992                    "PAUSED" => std::option::Option::Some(Self::PAUSED),
3993                    "FAILED" => std::option::Option::Some(Self::FAILED),
3994                    "UPDATE_PENDING_REVIEW" => {
3995                        std::option::Option::Some(Self::UPDATE_PENDING_REVIEW)
3996                    }
3997                    "UPDATE_REJECTED" => std::option::Option::Some(Self::UPDATE_REJECTED),
3998                    "UPDATE_FAILED" => std::option::Option::Some(Self::UPDATE_FAILED),
3999                    _ => std::option::Option::None,
4000                }
4001            }
4002        }
4003
4004        impl std::convert::From<i32> for Code {
4005            fn from(value: i32) -> Self {
4006                Self::new(value)
4007            }
4008        }
4009
4010        impl std::default::Default for Code {
4011            fn default() -> Self {
4012                Self::new(0)
4013            }
4014        }
4015    }
4016}
4017
4018#[serde_with::serde_as]
4019#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4020#[serde(default, rename_all = "camelCase")]
4021#[non_exhaustive]
4022pub struct RouteTable {
4023    /// Immutable. The name of the route table. Route table names must be unique.
4024    /// They use the following form:
4025    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
4026    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4027    pub name: std::string::String,
4028
4029    /// Output only. The time the route table was created.
4030    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4031    pub create_time: std::option::Option<wkt::Timestamp>,
4032
4033    /// Output only. The time the route table was last updated.
4034    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4035    pub update_time: std::option::Option<wkt::Timestamp>,
4036
4037    /// Optional labels in key-value pair format. For more information about
4038    /// labels, see [Requirements for
4039    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4040    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4041    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4042
4043    /// An optional description of the route table.
4044    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4045    pub description: std::string::String,
4046
4047    /// Output only. The Google-generated UUID for the route table. This value is
4048    /// unique across all route table resources. If a route table is deleted and
4049    /// another with the same name is created, the new route table is assigned
4050    /// a different `uid`.
4051    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4052    pub uid: std::string::String,
4053
4054    /// Output only. The current lifecycle state of this route table.
4055    pub state: crate::model::State,
4056
4057    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4058    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4059}
4060
4061impl RouteTable {
4062    pub fn new() -> Self {
4063        std::default::Default::default()
4064    }
4065
4066    /// Sets the value of [name][crate::model::RouteTable::name].
4067    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068        self.name = v.into();
4069        self
4070    }
4071
4072    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
4073    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4074        mut self,
4075        v: T,
4076    ) -> Self {
4077        self.create_time = v.into();
4078        self
4079    }
4080
4081    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
4082    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4083        mut self,
4084        v: T,
4085    ) -> Self {
4086        self.update_time = v.into();
4087        self
4088    }
4089
4090    /// Sets the value of [description][crate::model::RouteTable::description].
4091    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092        self.description = v.into();
4093        self
4094    }
4095
4096    /// Sets the value of [uid][crate::model::RouteTable::uid].
4097    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4098        self.uid = v.into();
4099        self
4100    }
4101
4102    /// Sets the value of [state][crate::model::RouteTable::state].
4103    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4104        self.state = v.into();
4105        self
4106    }
4107
4108    /// Sets the value of [labels][crate::model::RouteTable::labels].
4109    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4110    where
4111        T: std::iter::IntoIterator<Item = (K, V)>,
4112        K: std::convert::Into<std::string::String>,
4113        V: std::convert::Into<std::string::String>,
4114    {
4115        use std::iter::Iterator;
4116        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4117        self
4118    }
4119}
4120
4121impl wkt::message::Message for RouteTable {
4122    fn typename() -> &'static str {
4123        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
4124    }
4125}
4126
4127/// A route defines a path from VM instances within a spoke to a specific
4128/// destination resource. Only VPC spokes have routes.
4129#[serde_with::serde_as]
4130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4131#[serde(default, rename_all = "camelCase")]
4132#[non_exhaustive]
4133pub struct Route {
4134    /// Immutable. The name of the route. Route names must be unique. Route names
4135    /// use the following form:
4136    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
4137    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4138    pub name: std::string::String,
4139
4140    /// Output only. The time the route was created.
4141    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4142    pub create_time: std::option::Option<wkt::Timestamp>,
4143
4144    /// Output only. The time the route was last updated.
4145    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4146    pub update_time: std::option::Option<wkt::Timestamp>,
4147
4148    /// The destination IP address range.
4149    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4150    pub ip_cidr_range: std::string::String,
4151
4152    /// Output only. The route's type. Its type is determined by the properties of
4153    /// its IP address range.
4154    #[serde(rename = "type")]
4155    pub r#type: crate::model::RouteType,
4156
4157    /// Immutable. The destination VPC network for packets on this route.
4158    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4159    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
4160
4161    /// Optional labels in key-value pair format. For more information about
4162    /// labels, see [Requirements for
4163    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4164    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4165    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4166
4167    /// An optional description of the route.
4168    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4169    pub description: std::string::String,
4170
4171    /// Output only. The Google-generated UUID for the route. This value is unique
4172    /// across all Network Connectivity Center route resources. If a
4173    /// route is deleted and another with the same name is created,
4174    /// the new route is assigned a different `uid`.
4175    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4176    pub uid: std::string::String,
4177
4178    /// Output only. The current lifecycle state of the route.
4179    pub state: crate::model::State,
4180
4181    /// Immutable. The spoke that this route leads to.
4182    /// Example: projects/12345/locations/global/spokes/SPOKE
4183    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4184    pub spoke: std::string::String,
4185
4186    /// Output only. The origin location of the route.
4187    /// Uses the following form: "projects/{project}/locations/{location}"
4188    /// Example: projects/1234/locations/us-central1
4189    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4190    pub location: std::string::String,
4191
4192    /// Output only. The priority of this route. Priority is used to break ties in
4193    /// cases where a destination matches more than one route. In these cases the
4194    /// route with the lowest-numbered priority value wins.
4195    #[serde_as(as = "serde_with::DisplayFromStr")]
4196    pub priority: i64,
4197
4198    /// Immutable. The next-hop VPN tunnel for packets on this route.
4199    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4200    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
4201
4202    /// Immutable. The next-hop Router appliance instance for packets on this
4203    /// route.
4204    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4205    pub next_hop_router_appliance_instance:
4206        std::option::Option<crate::model::NextHopRouterApplianceInstance>,
4207
4208    /// Immutable. The next-hop VLAN attachment for packets on this route.
4209    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4210    pub next_hop_interconnect_attachment:
4211        std::option::Option<crate::model::NextHopInterconnectAttachment>,
4212
4213    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4214    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4215}
4216
4217impl Route {
4218    pub fn new() -> Self {
4219        std::default::Default::default()
4220    }
4221
4222    /// Sets the value of [name][crate::model::Route::name].
4223    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4224        self.name = v.into();
4225        self
4226    }
4227
4228    /// Sets the value of [create_time][crate::model::Route::create_time].
4229    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4230        mut self,
4231        v: T,
4232    ) -> Self {
4233        self.create_time = v.into();
4234        self
4235    }
4236
4237    /// Sets the value of [update_time][crate::model::Route::update_time].
4238    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4239        mut self,
4240        v: T,
4241    ) -> Self {
4242        self.update_time = v.into();
4243        self
4244    }
4245
4246    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
4247    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4248        self.ip_cidr_range = v.into();
4249        self
4250    }
4251
4252    /// Sets the value of [r#type][crate::model::Route::type].
4253    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
4254        self.r#type = v.into();
4255        self
4256    }
4257
4258    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
4259    pub fn set_next_hop_vpc_network<
4260        T: std::convert::Into<std::option::Option<crate::model::NextHopVpcNetwork>>,
4261    >(
4262        mut self,
4263        v: T,
4264    ) -> Self {
4265        self.next_hop_vpc_network = v.into();
4266        self
4267    }
4268
4269    /// Sets the value of [description][crate::model::Route::description].
4270    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4271        self.description = v.into();
4272        self
4273    }
4274
4275    /// Sets the value of [uid][crate::model::Route::uid].
4276    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4277        self.uid = v.into();
4278        self
4279    }
4280
4281    /// Sets the value of [state][crate::model::Route::state].
4282    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4283        self.state = v.into();
4284        self
4285    }
4286
4287    /// Sets the value of [spoke][crate::model::Route::spoke].
4288    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289        self.spoke = v.into();
4290        self
4291    }
4292
4293    /// Sets the value of [location][crate::model::Route::location].
4294    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4295        self.location = v.into();
4296        self
4297    }
4298
4299    /// Sets the value of [priority][crate::model::Route::priority].
4300    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4301        self.priority = v.into();
4302        self
4303    }
4304
4305    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
4306    pub fn set_next_hop_vpn_tunnel<
4307        T: std::convert::Into<std::option::Option<crate::model::NextHopVPNTunnel>>,
4308    >(
4309        mut self,
4310        v: T,
4311    ) -> Self {
4312        self.next_hop_vpn_tunnel = v.into();
4313        self
4314    }
4315
4316    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
4317    pub fn set_next_hop_router_appliance_instance<
4318        T: std::convert::Into<std::option::Option<crate::model::NextHopRouterApplianceInstance>>,
4319    >(
4320        mut self,
4321        v: T,
4322    ) -> Self {
4323        self.next_hop_router_appliance_instance = v.into();
4324        self
4325    }
4326
4327    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
4328    pub fn set_next_hop_interconnect_attachment<
4329        T: std::convert::Into<std::option::Option<crate::model::NextHopInterconnectAttachment>>,
4330    >(
4331        mut self,
4332        v: T,
4333    ) -> Self {
4334        self.next_hop_interconnect_attachment = v.into();
4335        self
4336    }
4337
4338    /// Sets the value of [labels][crate::model::Route::labels].
4339    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4340    where
4341        T: std::iter::IntoIterator<Item = (K, V)>,
4342        K: std::convert::Into<std::string::String>,
4343        V: std::convert::Into<std::string::String>,
4344    {
4345        use std::iter::Iterator;
4346        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4347        self
4348    }
4349}
4350
4351impl wkt::message::Message for Route {
4352    fn typename() -> &'static str {
4353        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
4354    }
4355}
4356
4357/// A group represents a subset of spokes attached to a hub.
4358#[serde_with::serde_as]
4359#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4360#[serde(default, rename_all = "camelCase")]
4361#[non_exhaustive]
4362pub struct Group {
4363    /// Immutable. The name of the group. Group names must be unique. They
4364    /// use the following form:
4365    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
4366    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4367    pub name: std::string::String,
4368
4369    /// Output only. The time the group was created.
4370    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4371    pub create_time: std::option::Option<wkt::Timestamp>,
4372
4373    /// Output only. The time the group was last updated.
4374    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4375    pub update_time: std::option::Option<wkt::Timestamp>,
4376
4377    /// Optional. Labels in key-value pair format. For more information about
4378    /// labels, see [Requirements for
4379    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
4380    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4381    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4382
4383    /// Optional. The description of the group.
4384    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4385    pub description: std::string::String,
4386
4387    /// Output only. The Google-generated UUID for the group. This value is unique
4388    /// across all group resources. If a group is deleted and
4389    /// another with the same name is created, the new route table is assigned
4390    /// a different unique_id.
4391    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4392    pub uid: std::string::String,
4393
4394    /// Output only. The current lifecycle state of this group.
4395    pub state: crate::model::State,
4396
4397    /// Optional. The auto-accept setting for this group.
4398    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4399    pub auto_accept: std::option::Option<crate::model::AutoAccept>,
4400
4401    /// Output only. The name of the route table that corresponds to this group.
4402    /// They use the following form:
4403    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
4404    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4405    pub route_table: std::string::String,
4406
4407    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4408    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4409}
4410
4411impl Group {
4412    pub fn new() -> Self {
4413        std::default::Default::default()
4414    }
4415
4416    /// Sets the value of [name][crate::model::Group::name].
4417    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4418        self.name = v.into();
4419        self
4420    }
4421
4422    /// Sets the value of [create_time][crate::model::Group::create_time].
4423    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4424        mut self,
4425        v: T,
4426    ) -> Self {
4427        self.create_time = v.into();
4428        self
4429    }
4430
4431    /// Sets the value of [update_time][crate::model::Group::update_time].
4432    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4433        mut self,
4434        v: T,
4435    ) -> Self {
4436        self.update_time = v.into();
4437        self
4438    }
4439
4440    /// Sets the value of [description][crate::model::Group::description].
4441    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442        self.description = v.into();
4443        self
4444    }
4445
4446    /// Sets the value of [uid][crate::model::Group::uid].
4447    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4448        self.uid = v.into();
4449        self
4450    }
4451
4452    /// Sets the value of [state][crate::model::Group::state].
4453    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4454        self.state = v.into();
4455        self
4456    }
4457
4458    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
4459    pub fn set_auto_accept<T: std::convert::Into<std::option::Option<crate::model::AutoAccept>>>(
4460        mut self,
4461        v: T,
4462    ) -> Self {
4463        self.auto_accept = v.into();
4464        self
4465    }
4466
4467    /// Sets the value of [route_table][crate::model::Group::route_table].
4468    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469        self.route_table = v.into();
4470        self
4471    }
4472
4473    /// Sets the value of [labels][crate::model::Group::labels].
4474    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4475    where
4476        T: std::iter::IntoIterator<Item = (K, V)>,
4477        K: std::convert::Into<std::string::String>,
4478        V: std::convert::Into<std::string::String>,
4479    {
4480        use std::iter::Iterator;
4481        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4482        self
4483    }
4484}
4485
4486impl wkt::message::Message for Group {
4487    fn typename() -> &'static str {
4488        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
4489    }
4490}
4491
4492/// The auto-accept setting for a group controls whether
4493/// proposed spokes are automatically attached to the hub. If auto-accept is
4494/// enabled, the spoke immediately is attached to the hub and becomes part of the
4495/// group. In this case, the new spoke is in the ACTIVE state.
4496/// If auto-accept is disabled, the spoke goes to the INACTIVE
4497/// state, and it must be reviewed and accepted by a hub
4498/// administrator.
4499#[serde_with::serde_as]
4500#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4501#[serde(default, rename_all = "camelCase")]
4502#[non_exhaustive]
4503pub struct AutoAccept {
4504    /// Optional. A list of project ids or project numbers for which you want
4505    /// to enable auto-accept. The auto-accept setting is applied to
4506    /// spokes being created or updated in these projects.
4507    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4508    pub auto_accept_projects: std::vec::Vec<std::string::String>,
4509
4510    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4511    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4512}
4513
4514impl AutoAccept {
4515    pub fn new() -> Self {
4516        std::default::Default::default()
4517    }
4518
4519    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
4520    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
4521    where
4522        T: std::iter::IntoIterator<Item = V>,
4523        V: std::convert::Into<std::string::String>,
4524    {
4525        use std::iter::Iterator;
4526        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
4527        self
4528    }
4529}
4530
4531impl wkt::message::Message for AutoAccept {
4532    fn typename() -> &'static str {
4533        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
4534    }
4535}
4536
4537/// Request for
4538/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
4539/// method.
4540///
4541/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
4542#[serde_with::serde_as]
4543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4544#[serde(default, rename_all = "camelCase")]
4545#[non_exhaustive]
4546pub struct ListHubsRequest {
4547    /// Required. The parent resource's name.
4548    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4549    pub parent: std::string::String,
4550
4551    /// The maximum number of results per page to return.
4552    pub page_size: i32,
4553
4554    /// The page token.
4555    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4556    pub page_token: std::string::String,
4557
4558    /// An expression that filters the list of results.
4559    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4560    pub filter: std::string::String,
4561
4562    /// Sort the results by a certain order.
4563    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4564    pub order_by: std::string::String,
4565
4566    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4567    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4568}
4569
4570impl ListHubsRequest {
4571    pub fn new() -> Self {
4572        std::default::Default::default()
4573    }
4574
4575    /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
4576    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4577        self.parent = v.into();
4578        self
4579    }
4580
4581    /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
4582    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4583        self.page_size = v.into();
4584        self
4585    }
4586
4587    /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
4588    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4589        self.page_token = v.into();
4590        self
4591    }
4592
4593    /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
4594    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595        self.filter = v.into();
4596        self
4597    }
4598
4599    /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
4600    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4601        self.order_by = v.into();
4602        self
4603    }
4604}
4605
4606impl wkt::message::Message for ListHubsRequest {
4607    fn typename() -> &'static str {
4608        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
4609    }
4610}
4611
4612/// Response for
4613/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
4614/// method.
4615///
4616/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
4617#[serde_with::serde_as]
4618#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4619#[serde(default, rename_all = "camelCase")]
4620#[non_exhaustive]
4621pub struct ListHubsResponse {
4622    /// The requested hubs.
4623    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4624    pub hubs: std::vec::Vec<crate::model::Hub>,
4625
4626    /// The token for the next page of the response. To see more results,
4627    /// use this value as the page_token for your next request. If this value
4628    /// is empty, there are no more results.
4629    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4630    pub next_page_token: std::string::String,
4631
4632    /// Locations that could not be reached.
4633    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4634    pub unreachable: std::vec::Vec<std::string::String>,
4635
4636    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4637    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4638}
4639
4640impl ListHubsResponse {
4641    pub fn new() -> Self {
4642        std::default::Default::default()
4643    }
4644
4645    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
4646    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4647        self.next_page_token = v.into();
4648        self
4649    }
4650
4651    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
4652    pub fn set_hubs<T, V>(mut self, v: T) -> Self
4653    where
4654        T: std::iter::IntoIterator<Item = V>,
4655        V: std::convert::Into<crate::model::Hub>,
4656    {
4657        use std::iter::Iterator;
4658        self.hubs = v.into_iter().map(|i| i.into()).collect();
4659        self
4660    }
4661
4662    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
4663    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4664    where
4665        T: std::iter::IntoIterator<Item = V>,
4666        V: std::convert::Into<std::string::String>,
4667    {
4668        use std::iter::Iterator;
4669        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4670        self
4671    }
4672}
4673
4674impl wkt::message::Message for ListHubsResponse {
4675    fn typename() -> &'static str {
4676        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
4677    }
4678}
4679
4680#[doc(hidden)]
4681impl gax::paginator::internal::PageableResponse for ListHubsResponse {
4682    type PageItem = crate::model::Hub;
4683
4684    fn items(self) -> std::vec::Vec<Self::PageItem> {
4685        self.hubs
4686    }
4687
4688    fn next_page_token(&self) -> std::string::String {
4689        use std::clone::Clone;
4690        self.next_page_token.clone()
4691    }
4692}
4693
4694/// Request for
4695/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
4696/// method.
4697///
4698/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
4699#[serde_with::serde_as]
4700#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4701#[serde(default, rename_all = "camelCase")]
4702#[non_exhaustive]
4703pub struct GetHubRequest {
4704    /// Required. The name of the hub resource to get.
4705    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4706    pub name: std::string::String,
4707
4708    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4709    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4710}
4711
4712impl GetHubRequest {
4713    pub fn new() -> Self {
4714        std::default::Default::default()
4715    }
4716
4717    /// Sets the value of [name][crate::model::GetHubRequest::name].
4718    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4719        self.name = v.into();
4720        self
4721    }
4722}
4723
4724impl wkt::message::Message for GetHubRequest {
4725    fn typename() -> &'static str {
4726        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
4727    }
4728}
4729
4730/// Request for
4731/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
4732/// method.
4733///
4734/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
4735#[serde_with::serde_as]
4736#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4737#[serde(default, rename_all = "camelCase")]
4738#[non_exhaustive]
4739pub struct CreateHubRequest {
4740    /// Required. The parent resource.
4741    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4742    pub parent: std::string::String,
4743
4744    /// Required. A unique identifier for the hub.
4745    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4746    pub hub_id: std::string::String,
4747
4748    /// Required. The initial values for a new hub.
4749    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4750    pub hub: std::option::Option<crate::model::Hub>,
4751
4752    /// Optional. A request ID to identify requests. Specify a unique request ID so
4753    /// that if you must retry your request, the server knows to ignore the request
4754    /// if it has already been completed. The server guarantees that a request
4755    /// doesn't result in creation of duplicate commitments for at least 60
4756    /// minutes.
4757    ///
4758    /// For example, consider a situation where you make an initial request and
4759    /// the request times out. If you make the request again with the same request
4760    /// ID, the server can check to see whether the original operation
4761    /// was received. If it was, the server ignores the second request. This
4762    /// behavior prevents clients from mistakenly creating duplicate commitments.
4763    ///
4764    /// The request ID must be a valid UUID, with the exception that zero UUID is
4765    /// not supported (00000000-0000-0000-0000-000000000000).
4766    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4767    pub request_id: std::string::String,
4768
4769    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4770    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771}
4772
4773impl CreateHubRequest {
4774    pub fn new() -> Self {
4775        std::default::Default::default()
4776    }
4777
4778    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
4779    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4780        self.parent = v.into();
4781        self
4782    }
4783
4784    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
4785    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786        self.hub_id = v.into();
4787        self
4788    }
4789
4790    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
4791    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
4792        mut self,
4793        v: T,
4794    ) -> Self {
4795        self.hub = v.into();
4796        self
4797    }
4798
4799    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
4800    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801        self.request_id = v.into();
4802        self
4803    }
4804}
4805
4806impl wkt::message::Message for CreateHubRequest {
4807    fn typename() -> &'static str {
4808        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
4809    }
4810}
4811
4812/// Request for
4813/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
4814/// method.
4815///
4816/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
4817#[serde_with::serde_as]
4818#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4819#[serde(default, rename_all = "camelCase")]
4820#[non_exhaustive]
4821pub struct UpdateHubRequest {
4822    /// Optional. In the case of an update to an existing hub, field mask is used
4823    /// to specify the fields to be overwritten. The fields specified in the
4824    /// update_mask are relative to the resource, not the full request. A field is
4825    /// overwritten if it is in the mask. If the user does not provide a mask, then
4826    /// all fields are overwritten.
4827    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4828    pub update_mask: std::option::Option<wkt::FieldMask>,
4829
4830    /// Required. The state that the hub should be in after the update.
4831    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4832    pub hub: std::option::Option<crate::model::Hub>,
4833
4834    /// Optional. A request ID to identify requests. Specify a unique request ID so
4835    /// that if you must retry your request, the server knows to ignore the request
4836    /// if it has already been completed. The server guarantees that a request
4837    /// doesn't result in creation of duplicate commitments for at least 60
4838    /// minutes.
4839    ///
4840    /// For example, consider a situation where you make an initial request and
4841    /// the request times out. If you make the request again with the same request
4842    /// ID, the server can check to see whether the original operation
4843    /// was received. If it was, the server ignores the second request. This
4844    /// behavior prevents clients from mistakenly creating duplicate commitments.
4845    ///
4846    /// The request ID must be a valid UUID, with the exception that zero UUID is
4847    /// not supported (00000000-0000-0000-0000-000000000000).
4848    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4849    pub request_id: std::string::String,
4850
4851    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4852    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4853}
4854
4855impl UpdateHubRequest {
4856    pub fn new() -> Self {
4857        std::default::Default::default()
4858    }
4859
4860    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
4861    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
4862        mut self,
4863        v: T,
4864    ) -> Self {
4865        self.update_mask = v.into();
4866        self
4867    }
4868
4869    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
4870    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
4871        mut self,
4872        v: T,
4873    ) -> Self {
4874        self.hub = v.into();
4875        self
4876    }
4877
4878    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
4879    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4880        self.request_id = v.into();
4881        self
4882    }
4883}
4884
4885impl wkt::message::Message for UpdateHubRequest {
4886    fn typename() -> &'static str {
4887        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
4888    }
4889}
4890
4891/// The request for
4892/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
4893///
4894/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
4895#[serde_with::serde_as]
4896#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4897#[serde(default, rename_all = "camelCase")]
4898#[non_exhaustive]
4899pub struct DeleteHubRequest {
4900    /// Required. The name of the hub to delete.
4901    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4902    pub name: std::string::String,
4903
4904    /// Optional. A request ID to identify requests. Specify a unique request ID so
4905    /// that if you must retry your request, the server knows to ignore the request
4906    /// if it has already been completed. The server guarantees that a request
4907    /// doesn't result in creation of duplicate commitments for at least 60
4908    /// minutes.
4909    ///
4910    /// For example, consider a situation where you make an initial request and
4911    /// the request times out. If you make the request again with the same request
4912    /// ID, the server can check to see whether the original operation
4913    /// was received. If it was, the server ignores the second request. This
4914    /// behavior prevents clients from mistakenly creating duplicate commitments.
4915    ///
4916    /// The request ID must be a valid UUID, with the exception that zero UUID is
4917    /// not supported (00000000-0000-0000-0000-000000000000).
4918    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4919    pub request_id: std::string::String,
4920
4921    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4922    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4923}
4924
4925impl DeleteHubRequest {
4926    pub fn new() -> Self {
4927        std::default::Default::default()
4928    }
4929
4930    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
4931    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4932        self.name = v.into();
4933        self
4934    }
4935
4936    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
4937    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4938        self.request_id = v.into();
4939        self
4940    }
4941}
4942
4943impl wkt::message::Message for DeleteHubRequest {
4944    fn typename() -> &'static str {
4945        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
4946    }
4947}
4948
4949/// The request for
4950/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
4951///
4952/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
4953#[serde_with::serde_as]
4954#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4955#[serde(default, rename_all = "camelCase")]
4956#[non_exhaustive]
4957pub struct ListHubSpokesRequest {
4958    /// Required. The name of the hub.
4959    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4960    pub name: std::string::String,
4961
4962    /// A list of locations.
4963    /// Specify one of the following: `[global]`, a single region (for
4964    /// example, `[us-central1]`), or a combination of
4965    /// values (for example, `[global, us-central1, us-west1]`).
4966    /// If the spoke_locations field is populated, the list of results
4967    /// includes only spokes in the specified location.
4968    /// If the spoke_locations field is not populated, the list of results
4969    /// includes spokes in all locations.
4970    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4971    pub spoke_locations: std::vec::Vec<std::string::String>,
4972
4973    /// The maximum number of results to return per page.
4974    pub page_size: i32,
4975
4976    /// The page token.
4977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4978    pub page_token: std::string::String,
4979
4980    /// An expression that filters the list of results.
4981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4982    pub filter: std::string::String,
4983
4984    /// Sort the results by name or create_time.
4985    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4986    pub order_by: std::string::String,
4987
4988    /// The view of the spoke to return.
4989    /// The view that you use determines which spoke fields are included in the
4990    /// response.
4991    pub view: crate::model::list_hub_spokes_request::SpokeView,
4992
4993    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4994    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4995}
4996
4997impl ListHubSpokesRequest {
4998    pub fn new() -> Self {
4999        std::default::Default::default()
5000    }
5001
5002    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5004        self.name = v.into();
5005        self
5006    }
5007
5008    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
5009    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5010        self.page_size = v.into();
5011        self
5012    }
5013
5014    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
5015    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5016        self.page_token = v.into();
5017        self
5018    }
5019
5020    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
5021    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022        self.filter = v.into();
5023        self
5024    }
5025
5026    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
5027    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5028        self.order_by = v.into();
5029        self
5030    }
5031
5032    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
5033    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
5034        mut self,
5035        v: T,
5036    ) -> Self {
5037        self.view = v.into();
5038        self
5039    }
5040
5041    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5042    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5043    where
5044        T: std::iter::IntoIterator<Item = V>,
5045        V: std::convert::Into<std::string::String>,
5046    {
5047        use std::iter::Iterator;
5048        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5049        self
5050    }
5051}
5052
5053impl wkt::message::Message for ListHubSpokesRequest {
5054    fn typename() -> &'static str {
5055        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
5056    }
5057}
5058
5059/// Defines additional types related to [ListHubSpokesRequest].
5060pub mod list_hub_spokes_request {
5061    #[allow(unused_imports)]
5062    use super::*;
5063
5064    /// Enum that controls which spoke fields are included in the response.
5065    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5066    pub struct SpokeView(i32);
5067
5068    impl SpokeView {
5069        /// The spoke view is unspecified. When the spoke view is unspecified, the
5070        /// API returns the same fields as the `BASIC` view.
5071        pub const SPOKE_VIEW_UNSPECIFIED: SpokeView = SpokeView::new(0);
5072
5073        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
5074        /// and `spoke_type`. This is the default value.
5075        pub const BASIC: SpokeView = SpokeView::new(1);
5076
5077        /// Includes all spoke fields except `labels`.
5078        /// You can use the `DETAILED` view only when you set the `spoke_locations`
5079        /// field to `[global]`.
5080        pub const DETAILED: SpokeView = SpokeView::new(2);
5081
5082        /// Creates a new SpokeView instance.
5083        pub(crate) const fn new(value: i32) -> Self {
5084            Self(value)
5085        }
5086
5087        /// Gets the enum value.
5088        pub fn value(&self) -> i32 {
5089            self.0
5090        }
5091
5092        /// Gets the enum value as a string.
5093        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5094            match self.0 {
5095                0 => std::borrow::Cow::Borrowed("SPOKE_VIEW_UNSPECIFIED"),
5096                1 => std::borrow::Cow::Borrowed("BASIC"),
5097                2 => std::borrow::Cow::Borrowed("DETAILED"),
5098                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5099            }
5100        }
5101
5102        /// Creates an enum value from the value name.
5103        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5104            match name {
5105                "SPOKE_VIEW_UNSPECIFIED" => std::option::Option::Some(Self::SPOKE_VIEW_UNSPECIFIED),
5106                "BASIC" => std::option::Option::Some(Self::BASIC),
5107                "DETAILED" => std::option::Option::Some(Self::DETAILED),
5108                _ => std::option::Option::None,
5109            }
5110        }
5111    }
5112
5113    impl std::convert::From<i32> for SpokeView {
5114        fn from(value: i32) -> Self {
5115            Self::new(value)
5116        }
5117    }
5118
5119    impl std::default::Default for SpokeView {
5120        fn default() -> Self {
5121            Self::new(0)
5122        }
5123    }
5124}
5125
5126/// The response for
5127/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
5128///
5129/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
5130#[serde_with::serde_as]
5131#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5132#[serde(default, rename_all = "camelCase")]
5133#[non_exhaustive]
5134pub struct ListHubSpokesResponse {
5135    /// The requested spokes.
5136    /// The spoke fields can be partially populated based on the `view` field in
5137    /// the request message.
5138    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5139    pub spokes: std::vec::Vec<crate::model::Spoke>,
5140
5141    /// The token for the next page of the response. To see more results,
5142    /// use this value as the page_token for your next request. If this value
5143    /// is empty, there are no more results.
5144    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5145    pub next_page_token: std::string::String,
5146
5147    /// Locations that could not be reached.
5148    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5149    pub unreachable: std::vec::Vec<std::string::String>,
5150
5151    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5152    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5153}
5154
5155impl ListHubSpokesResponse {
5156    pub fn new() -> Self {
5157        std::default::Default::default()
5158    }
5159
5160    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
5161    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162        self.next_page_token = v.into();
5163        self
5164    }
5165
5166    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
5167    pub fn set_spokes<T, V>(mut self, v: T) -> Self
5168    where
5169        T: std::iter::IntoIterator<Item = V>,
5170        V: std::convert::Into<crate::model::Spoke>,
5171    {
5172        use std::iter::Iterator;
5173        self.spokes = v.into_iter().map(|i| i.into()).collect();
5174        self
5175    }
5176
5177    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
5178    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5179    where
5180        T: std::iter::IntoIterator<Item = V>,
5181        V: std::convert::Into<std::string::String>,
5182    {
5183        use std::iter::Iterator;
5184        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5185        self
5186    }
5187}
5188
5189impl wkt::message::Message for ListHubSpokesResponse {
5190    fn typename() -> &'static str {
5191        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
5192    }
5193}
5194
5195#[doc(hidden)]
5196impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
5197    type PageItem = crate::model::Spoke;
5198
5199    fn items(self) -> std::vec::Vec<Self::PageItem> {
5200        self.spokes
5201    }
5202
5203    fn next_page_token(&self) -> std::string::String {
5204        use std::clone::Clone;
5205        self.next_page_token.clone()
5206    }
5207}
5208
5209/// The request for
5210/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
5211///
5212/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
5213#[serde_with::serde_as]
5214#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5215#[serde(default, rename_all = "camelCase")]
5216#[non_exhaustive]
5217pub struct QueryHubStatusRequest {
5218    /// Required. The name of the hub.
5219    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5220    pub name: std::string::String,
5221
5222    /// Optional. The maximum number of results to return per page.
5223    pub page_size: i32,
5224
5225    /// Optional. The page token.
5226    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5227    pub page_token: std::string::String,
5228
5229    /// Optional. An expression that filters the list of results.
5230    /// The filter can be used to filter the results by the following fields:
5231    ///
5232    /// * `psc_propagation_status.source_spoke`
5233    /// * `psc_propagation_status.source_group`
5234    /// * `psc_propagation_status.source_forwarding_rule`
5235    /// * `psc_propagation_status.target_spoke`
5236    /// * `psc_propagation_status.target_group`
5237    /// * `psc_propagation_status.code`
5238    /// * `psc_propagation_status.message`
5239    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5240    pub filter: std::string::String,
5241
5242    /// Optional. Sort the results in ascending order by the specified fields.
5243    /// A comma-separated list of any of these fields:
5244    ///
5245    /// * `psc_propagation_status.source_spoke`
5246    /// * `psc_propagation_status.source_group`
5247    /// * `psc_propagation_status.source_forwarding_rule`
5248    /// * `psc_propagation_status.target_spoke`
5249    /// * `psc_propagation_status.target_group`
5250    /// * `psc_propagation_status.code`
5251    ///   If `group_by` is set, the value of the `order_by` field must be the
5252    ///   same as or a subset of the `group_by` field.
5253    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5254    pub order_by: std::string::String,
5255
5256    /// Optional. Aggregate the results by the specified fields.
5257    /// A comma-separated list of any of these fields:
5258    ///
5259    /// * `psc_propagation_status.source_spoke`
5260    /// * `psc_propagation_status.source_group`
5261    /// * `psc_propagation_status.source_forwarding_rule`
5262    /// * `psc_propagation_status.target_spoke`
5263    /// * `psc_propagation_status.target_group`
5264    /// * `psc_propagation_status.code`
5265    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5266    pub group_by: std::string::String,
5267
5268    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5269    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5270}
5271
5272impl QueryHubStatusRequest {
5273    pub fn new() -> Self {
5274        std::default::Default::default()
5275    }
5276
5277    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
5278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5279        self.name = v.into();
5280        self
5281    }
5282
5283    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
5284    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5285        self.page_size = v.into();
5286        self
5287    }
5288
5289    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
5290    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291        self.page_token = v.into();
5292        self
5293    }
5294
5295    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
5296    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5297        self.filter = v.into();
5298        self
5299    }
5300
5301    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
5302    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5303        self.order_by = v.into();
5304        self
5305    }
5306
5307    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
5308    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5309        self.group_by = v.into();
5310        self
5311    }
5312}
5313
5314impl wkt::message::Message for QueryHubStatusRequest {
5315    fn typename() -> &'static str {
5316        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
5317    }
5318}
5319
5320/// The response for
5321/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
5322///
5323/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
5324#[serde_with::serde_as]
5325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5326#[serde(default, rename_all = "camelCase")]
5327#[non_exhaustive]
5328pub struct QueryHubStatusResponse {
5329    /// The list of hub status.
5330    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5331    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
5332
5333    /// The token for the next page of the response. To see more results,
5334    /// use this value as the page_token for your next request. If this value
5335    /// is empty, there are no more results.
5336    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5337    pub next_page_token: std::string::String,
5338
5339    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5340    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5341}
5342
5343impl QueryHubStatusResponse {
5344    pub fn new() -> Self {
5345        std::default::Default::default()
5346    }
5347
5348    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
5349    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5350        self.next_page_token = v.into();
5351        self
5352    }
5353
5354    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
5355    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
5356    where
5357        T: std::iter::IntoIterator<Item = V>,
5358        V: std::convert::Into<crate::model::HubStatusEntry>,
5359    {
5360        use std::iter::Iterator;
5361        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
5362        self
5363    }
5364}
5365
5366impl wkt::message::Message for QueryHubStatusResponse {
5367    fn typename() -> &'static str {
5368        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
5369    }
5370}
5371
5372#[doc(hidden)]
5373impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
5374    type PageItem = crate::model::HubStatusEntry;
5375
5376    fn items(self) -> std::vec::Vec<Self::PageItem> {
5377        self.hub_status_entries
5378    }
5379
5380    fn next_page_token(&self) -> std::string::String {
5381        use std::clone::Clone;
5382        self.next_page_token.clone()
5383    }
5384}
5385
5386/// A hub status entry represents the status of a set of propagated Private
5387/// Service Connect connections grouped by certain fields.
5388#[serde_with::serde_as]
5389#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5390#[serde(default, rename_all = "camelCase")]
5391#[non_exhaustive]
5392pub struct HubStatusEntry {
5393    /// The number of propagated Private Service Connect connections with this
5394    /// status. If the `group_by` field was not set in the request message, the
5395    /// value of this field is 1.
5396    pub count: i32,
5397
5398    /// The fields that this entry is grouped by. This has the same value as the
5399    /// `group_by` field in the request message.
5400    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5401    pub group_by: std::string::String,
5402
5403    /// The Private Service Connect propagation status.
5404    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5405    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
5406
5407    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5408    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5409}
5410
5411impl HubStatusEntry {
5412    pub fn new() -> Self {
5413        std::default::Default::default()
5414    }
5415
5416    /// Sets the value of [count][crate::model::HubStatusEntry::count].
5417    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5418        self.count = v.into();
5419        self
5420    }
5421
5422    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
5423    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5424        self.group_by = v.into();
5425        self
5426    }
5427
5428    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
5429    pub fn set_psc_propagation_status<
5430        T: std::convert::Into<std::option::Option<crate::model::PscPropagationStatus>>,
5431    >(
5432        mut self,
5433        v: T,
5434    ) -> Self {
5435        self.psc_propagation_status = v.into();
5436        self
5437    }
5438}
5439
5440impl wkt::message::Message for HubStatusEntry {
5441    fn typename() -> &'static str {
5442        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
5443    }
5444}
5445
5446/// The status of one or more propagated Private Service Connect connections in a
5447/// hub.
5448#[serde_with::serde_as]
5449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5450#[serde(default, rename_all = "camelCase")]
5451#[non_exhaustive]
5452pub struct PscPropagationStatus {
5453    /// The name of the spoke that the source forwarding rule belongs to.
5454    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5455    pub source_spoke: std::string::String,
5456
5457    /// The name of the group that the source spoke belongs to.
5458    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5459    pub source_group: std::string::String,
5460
5461    /// The name of the forwarding rule exported to the hub.
5462    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5463    pub source_forwarding_rule: std::string::String,
5464
5465    /// The name of the spoke that the source forwarding rule propagates to.
5466    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5467    pub target_spoke: std::string::String,
5468
5469    /// The name of the group that the target spoke belongs to.
5470    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5471    pub target_group: std::string::String,
5472
5473    /// The propagation status.
5474    pub code: crate::model::psc_propagation_status::Code,
5475
5476    /// The human-readable summary of the Private Service Connect connection
5477    /// propagation status.
5478    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5479    pub message: std::string::String,
5480
5481    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5482    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5483}
5484
5485impl PscPropagationStatus {
5486    pub fn new() -> Self {
5487        std::default::Default::default()
5488    }
5489
5490    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
5491    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5492        self.source_spoke = v.into();
5493        self
5494    }
5495
5496    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
5497    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5498        self.source_group = v.into();
5499        self
5500    }
5501
5502    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
5503    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
5504        mut self,
5505        v: T,
5506    ) -> Self {
5507        self.source_forwarding_rule = v.into();
5508        self
5509    }
5510
5511    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
5512    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5513        self.target_spoke = v.into();
5514        self
5515    }
5516
5517    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
5518    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5519        self.target_group = v.into();
5520        self
5521    }
5522
5523    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
5524    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
5525        mut self,
5526        v: T,
5527    ) -> Self {
5528        self.code = v.into();
5529        self
5530    }
5531
5532    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
5533    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5534        self.message = v.into();
5535        self
5536    }
5537}
5538
5539impl wkt::message::Message for PscPropagationStatus {
5540    fn typename() -> &'static str {
5541        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
5542    }
5543}
5544
5545/// Defines additional types related to [PscPropagationStatus].
5546pub mod psc_propagation_status {
5547    #[allow(unused_imports)]
5548    use super::*;
5549
5550    /// The Code enum represents the state of the Private Service Connect
5551    /// propagation.
5552    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5553    pub struct Code(i32);
5554
5555    impl Code {
5556        /// The code is unspecified.
5557        pub const CODE_UNSPECIFIED: Code = Code::new(0);
5558
5559        /// The propagated Private Service Connect connection is ready.
5560        pub const READY: Code = Code::new(1);
5561
5562        /// The Private Service Connect connection is propagating. This is a
5563        /// transient state.
5564        pub const PROPAGATING: Code = Code::new(2);
5565
5566        /// The Private Service Connect connection propagation failed because the VPC
5567        /// network or the project of the target spoke has exceeded the connection
5568        /// limit set by the producer.
5569        pub const ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED: Code = Code::new(3);
5570
5571        /// The Private Service Connect connection propagation failed because the NAT
5572        /// IP subnet space has been exhausted. It is equivalent to the `Needs
5573        /// attention` status of the Private Service Connect connection. See
5574        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
5575        pub const ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED: Code = Code::new(4);
5576
5577        /// The Private Service Connect connection propagation failed because the
5578        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
5579        /// producer VPC network has been exceeded.
5580        pub const ERROR_PRODUCER_QUOTA_EXCEEDED: Code = Code::new(5);
5581
5582        /// The Private Service Connect connection propagation failed because the
5583        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
5584        /// VPC network has been exceeded.
5585        pub const ERROR_CONSUMER_QUOTA_EXCEEDED: Code = Code::new(6);
5586
5587        /// Creates a new Code instance.
5588        pub(crate) const fn new(value: i32) -> Self {
5589            Self(value)
5590        }
5591
5592        /// Gets the enum value.
5593        pub fn value(&self) -> i32 {
5594            self.0
5595        }
5596
5597        /// Gets the enum value as a string.
5598        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5599            match self.0 {
5600                0 => std::borrow::Cow::Borrowed("CODE_UNSPECIFIED"),
5601                1 => std::borrow::Cow::Borrowed("READY"),
5602                2 => std::borrow::Cow::Borrowed("PROPAGATING"),
5603                3 => std::borrow::Cow::Borrowed(
5604                    "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED",
5605                ),
5606                4 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED"),
5607                5 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_QUOTA_EXCEEDED"),
5608                6 => std::borrow::Cow::Borrowed("ERROR_CONSUMER_QUOTA_EXCEEDED"),
5609                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5610            }
5611        }
5612
5613        /// Creates an enum value from the value name.
5614        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5615            match name {
5616                "CODE_UNSPECIFIED" => std::option::Option::Some(Self::CODE_UNSPECIFIED),
5617                "READY" => std::option::Option::Some(Self::READY),
5618                "PROPAGATING" => std::option::Option::Some(Self::PROPAGATING),
5619                "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => std::option::Option::Some(
5620                    Self::ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED,
5621                ),
5622                "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => {
5623                    std::option::Option::Some(Self::ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED)
5624                }
5625                "ERROR_PRODUCER_QUOTA_EXCEEDED" => {
5626                    std::option::Option::Some(Self::ERROR_PRODUCER_QUOTA_EXCEEDED)
5627                }
5628                "ERROR_CONSUMER_QUOTA_EXCEEDED" => {
5629                    std::option::Option::Some(Self::ERROR_CONSUMER_QUOTA_EXCEEDED)
5630                }
5631                _ => std::option::Option::None,
5632            }
5633        }
5634    }
5635
5636    impl std::convert::From<i32> for Code {
5637        fn from(value: i32) -> Self {
5638            Self::new(value)
5639        }
5640    }
5641
5642    impl std::default::Default for Code {
5643        fn default() -> Self {
5644            Self::new(0)
5645        }
5646    }
5647}
5648
5649/// The request for
5650/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
5651///
5652/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
5653#[serde_with::serde_as]
5654#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5655#[serde(default, rename_all = "camelCase")]
5656#[non_exhaustive]
5657pub struct ListSpokesRequest {
5658    /// Required. The parent resource.
5659    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5660    pub parent: std::string::String,
5661
5662    /// The maximum number of results to return per page.
5663    pub page_size: i32,
5664
5665    /// The page token.
5666    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5667    pub page_token: std::string::String,
5668
5669    /// An expression that filters the list of results.
5670    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5671    pub filter: std::string::String,
5672
5673    /// Sort the results by a certain order.
5674    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5675    pub order_by: std::string::String,
5676
5677    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5678    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5679}
5680
5681impl ListSpokesRequest {
5682    pub fn new() -> Self {
5683        std::default::Default::default()
5684    }
5685
5686    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
5687    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688        self.parent = v.into();
5689        self
5690    }
5691
5692    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
5693    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5694        self.page_size = v.into();
5695        self
5696    }
5697
5698    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
5699    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5700        self.page_token = v.into();
5701        self
5702    }
5703
5704    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
5705    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5706        self.filter = v.into();
5707        self
5708    }
5709
5710    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
5711    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5712        self.order_by = v.into();
5713        self
5714    }
5715}
5716
5717impl wkt::message::Message for ListSpokesRequest {
5718    fn typename() -> &'static str {
5719        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
5720    }
5721}
5722
5723/// The response for
5724/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
5725///
5726/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
5727#[serde_with::serde_as]
5728#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5729#[serde(default, rename_all = "camelCase")]
5730#[non_exhaustive]
5731pub struct ListSpokesResponse {
5732    /// The requested spokes.
5733    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5734    pub spokes: std::vec::Vec<crate::model::Spoke>,
5735
5736    /// The token for the next page of the response. To see more results,
5737    /// use this value as the page_token for your next request. If this value
5738    /// is empty, there are no more results.
5739    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5740    pub next_page_token: std::string::String,
5741
5742    /// Locations that could not be reached.
5743    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5744    pub unreachable: std::vec::Vec<std::string::String>,
5745
5746    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5747    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5748}
5749
5750impl ListSpokesResponse {
5751    pub fn new() -> Self {
5752        std::default::Default::default()
5753    }
5754
5755    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
5756    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5757        self.next_page_token = v.into();
5758        self
5759    }
5760
5761    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
5762    pub fn set_spokes<T, V>(mut self, v: T) -> Self
5763    where
5764        T: std::iter::IntoIterator<Item = V>,
5765        V: std::convert::Into<crate::model::Spoke>,
5766    {
5767        use std::iter::Iterator;
5768        self.spokes = v.into_iter().map(|i| i.into()).collect();
5769        self
5770    }
5771
5772    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
5773    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5774    where
5775        T: std::iter::IntoIterator<Item = V>,
5776        V: std::convert::Into<std::string::String>,
5777    {
5778        use std::iter::Iterator;
5779        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5780        self
5781    }
5782}
5783
5784impl wkt::message::Message for ListSpokesResponse {
5785    fn typename() -> &'static str {
5786        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
5787    }
5788}
5789
5790#[doc(hidden)]
5791impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
5792    type PageItem = crate::model::Spoke;
5793
5794    fn items(self) -> std::vec::Vec<Self::PageItem> {
5795        self.spokes
5796    }
5797
5798    fn next_page_token(&self) -> std::string::String {
5799        use std::clone::Clone;
5800        self.next_page_token.clone()
5801    }
5802}
5803
5804/// The request for
5805/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
5806///
5807/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
5808#[serde_with::serde_as]
5809#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5810#[serde(default, rename_all = "camelCase")]
5811#[non_exhaustive]
5812pub struct GetSpokeRequest {
5813    /// Required. The name of the spoke resource.
5814    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5815    pub name: std::string::String,
5816
5817    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5818    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5819}
5820
5821impl GetSpokeRequest {
5822    pub fn new() -> Self {
5823        std::default::Default::default()
5824    }
5825
5826    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
5827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828        self.name = v.into();
5829        self
5830    }
5831}
5832
5833impl wkt::message::Message for GetSpokeRequest {
5834    fn typename() -> &'static str {
5835        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
5836    }
5837}
5838
5839/// The request for
5840/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
5841///
5842/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
5843#[serde_with::serde_as]
5844#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5845#[serde(default, rename_all = "camelCase")]
5846#[non_exhaustive]
5847pub struct CreateSpokeRequest {
5848    /// Required. The parent resource.
5849    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5850    pub parent: std::string::String,
5851
5852    /// Required. Unique id for the spoke to create.
5853    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5854    pub spoke_id: std::string::String,
5855
5856    /// Required. The initial values for a new spoke.
5857    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5858    pub spoke: std::option::Option<crate::model::Spoke>,
5859
5860    /// Optional. A request ID to identify requests. Specify a unique request ID so
5861    /// that if you must retry your request, the server knows to ignore the request
5862    /// if it has already been completed. The server guarantees that a request
5863    /// doesn't result in creation of duplicate commitments for at least 60
5864    /// minutes.
5865    ///
5866    /// For example, consider a situation where you make an initial request and
5867    /// the request times out. If you make the request again with the same request
5868    /// ID, the server can check to see whether the original operation
5869    /// was received. If it was, the server ignores the second request. This
5870    /// behavior prevents clients from mistakenly creating duplicate commitments.
5871    ///
5872    /// The request ID must be a valid UUID, with the exception that zero UUID is
5873    /// not supported (00000000-0000-0000-0000-000000000000).
5874    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5875    pub request_id: std::string::String,
5876
5877    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5878    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5879}
5880
5881impl CreateSpokeRequest {
5882    pub fn new() -> Self {
5883        std::default::Default::default()
5884    }
5885
5886    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
5887    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5888        self.parent = v.into();
5889        self
5890    }
5891
5892    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
5893    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894        self.spoke_id = v.into();
5895        self
5896    }
5897
5898    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
5899    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
5900        mut self,
5901        v: T,
5902    ) -> Self {
5903        self.spoke = v.into();
5904        self
5905    }
5906
5907    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
5908    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5909        self.request_id = v.into();
5910        self
5911    }
5912}
5913
5914impl wkt::message::Message for CreateSpokeRequest {
5915    fn typename() -> &'static str {
5916        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
5917    }
5918}
5919
5920/// Request for
5921/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
5922/// method.
5923///
5924/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
5925#[serde_with::serde_as]
5926#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5927#[serde(default, rename_all = "camelCase")]
5928#[non_exhaustive]
5929pub struct UpdateSpokeRequest {
5930    /// Optional. In the case of an update to an existing spoke, field mask is used
5931    /// to specify the fields to be overwritten. The fields specified in the
5932    /// update_mask are relative to the resource, not the full request. A field is
5933    /// overwritten if it is in the mask. If the user does not provide a mask, then
5934    /// all fields are overwritten.
5935    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5936    pub update_mask: std::option::Option<wkt::FieldMask>,
5937
5938    /// Required. The state that the spoke should be in after the update.
5939    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5940    pub spoke: std::option::Option<crate::model::Spoke>,
5941
5942    /// Optional. A request ID to identify requests. Specify a unique request ID so
5943    /// that if you must retry your request, the server knows to ignore the request
5944    /// if it has already been completed. The server guarantees that a request
5945    /// doesn't result in creation of duplicate commitments for at least 60
5946    /// minutes.
5947    ///
5948    /// For example, consider a situation where you make an initial request and
5949    /// the request times out. If you make the request again with the same request
5950    /// ID, the server can check to see whether the original operation
5951    /// was received. If it was, the server ignores the second request. This
5952    /// behavior prevents clients from mistakenly creating duplicate commitments.
5953    ///
5954    /// The request ID must be a valid UUID, with the exception that zero UUID is
5955    /// not supported (00000000-0000-0000-0000-000000000000).
5956    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5957    pub request_id: std::string::String,
5958
5959    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5960    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5961}
5962
5963impl UpdateSpokeRequest {
5964    pub fn new() -> Self {
5965        std::default::Default::default()
5966    }
5967
5968    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
5969    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5970        mut self,
5971        v: T,
5972    ) -> Self {
5973        self.update_mask = v.into();
5974        self
5975    }
5976
5977    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
5978    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
5979        mut self,
5980        v: T,
5981    ) -> Self {
5982        self.spoke = v.into();
5983        self
5984    }
5985
5986    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
5987    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5988        self.request_id = v.into();
5989        self
5990    }
5991}
5992
5993impl wkt::message::Message for UpdateSpokeRequest {
5994    fn typename() -> &'static str {
5995        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
5996    }
5997}
5998
5999/// The request for
6000/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
6001///
6002/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
6003#[serde_with::serde_as]
6004#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6005#[serde(default, rename_all = "camelCase")]
6006#[non_exhaustive]
6007pub struct DeleteSpokeRequest {
6008    /// Required. The name of the spoke to delete.
6009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6010    pub name: std::string::String,
6011
6012    /// Optional. A request ID to identify requests. Specify a unique request ID so
6013    /// that if you must retry your request, the server knows to ignore the request
6014    /// if it has already been completed. The server guarantees that a request
6015    /// doesn't result in creation of duplicate commitments for at least 60
6016    /// minutes.
6017    ///
6018    /// For example, consider a situation where you make an initial request and
6019    /// the request times out. If you make the request again with the same request
6020    /// ID, the server can check to see whether the original operation
6021    /// was received. If it was, the server ignores the second request. This
6022    /// behavior prevents clients from mistakenly creating duplicate commitments.
6023    ///
6024    /// The request ID must be a valid UUID, with the exception that zero UUID is
6025    /// not supported (00000000-0000-0000-0000-000000000000).
6026    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6027    pub request_id: std::string::String,
6028
6029    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6030    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6031}
6032
6033impl DeleteSpokeRequest {
6034    pub fn new() -> Self {
6035        std::default::Default::default()
6036    }
6037
6038    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
6039    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040        self.name = v.into();
6041        self
6042    }
6043
6044    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
6045    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6046        self.request_id = v.into();
6047        self
6048    }
6049}
6050
6051impl wkt::message::Message for DeleteSpokeRequest {
6052    fn typename() -> &'static str {
6053        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
6054    }
6055}
6056
6057/// The request for
6058/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
6059///
6060/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
6061#[serde_with::serde_as]
6062#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6063#[serde(default, rename_all = "camelCase")]
6064#[non_exhaustive]
6065pub struct AcceptHubSpokeRequest {
6066    /// Required. The name of the hub into which to accept the spoke.
6067    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6068    pub name: std::string::String,
6069
6070    /// Required. The URI of the spoke to accept into the hub.
6071    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6072    pub spoke_uri: std::string::String,
6073
6074    /// Optional. A request ID to identify requests. Specify a unique request ID so
6075    /// that if you must retry your request, the server knows to ignore the request
6076    /// if it has already been completed. The server guarantees that a request
6077    /// doesn't result in creation of duplicate commitments for at least 60
6078    /// minutes.
6079    ///
6080    /// For example, consider a situation where you make an initial request and
6081    /// the request times out. If you make the request again with the same request
6082    /// ID, the server can check to see whether the original operation
6083    /// was received. If it was, the server ignores the second request. This
6084    /// behavior prevents clients from mistakenly creating duplicate commitments.
6085    ///
6086    /// The request ID must be a valid UUID, with the exception that zero UUID is
6087    /// not supported (00000000-0000-0000-0000-000000000000).
6088    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6089    pub request_id: std::string::String,
6090
6091    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6092    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6093}
6094
6095impl AcceptHubSpokeRequest {
6096    pub fn new() -> Self {
6097        std::default::Default::default()
6098    }
6099
6100    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6101    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6102        self.name = v.into();
6103        self
6104    }
6105
6106    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6107    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6108        self.spoke_uri = v.into();
6109        self
6110    }
6111
6112    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6113    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6114        self.request_id = v.into();
6115        self
6116    }
6117}
6118
6119impl wkt::message::Message for AcceptHubSpokeRequest {
6120    fn typename() -> &'static str {
6121        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
6122    }
6123}
6124
6125/// The response for
6126/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
6127///
6128/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
6129#[serde_with::serde_as]
6130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6131#[serde(default, rename_all = "camelCase")]
6132#[non_exhaustive]
6133pub struct AcceptHubSpokeResponse {
6134    /// The spoke that was operated on.
6135    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6136    pub spoke: std::option::Option<crate::model::Spoke>,
6137
6138    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6139    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6140}
6141
6142impl AcceptHubSpokeResponse {
6143    pub fn new() -> Self {
6144        std::default::Default::default()
6145    }
6146
6147    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
6148    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6149        mut self,
6150        v: T,
6151    ) -> Self {
6152        self.spoke = v.into();
6153        self
6154    }
6155}
6156
6157impl wkt::message::Message for AcceptHubSpokeResponse {
6158    fn typename() -> &'static str {
6159        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
6160    }
6161}
6162
6163/// The request for
6164/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
6165///
6166/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
6167#[serde_with::serde_as]
6168#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6169#[serde(default, rename_all = "camelCase")]
6170#[non_exhaustive]
6171pub struct RejectHubSpokeRequest {
6172    /// Required. The name of the hub from which to reject the spoke.
6173    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6174    pub name: std::string::String,
6175
6176    /// Required. The URI of the spoke to reject from the hub.
6177    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6178    pub spoke_uri: std::string::String,
6179
6180    /// Optional. A request ID to identify requests. Specify a unique request ID so
6181    /// that if you must retry your request, the server knows to ignore the request
6182    /// if it has already been completed. The server guarantees that a request
6183    /// doesn't result in creation of duplicate commitments for at least 60
6184    /// minutes.
6185    ///
6186    /// For example, consider a situation where you make an initial request and
6187    /// the request times out. If you make the request again with the same request
6188    /// ID, the server can check to see whether the original operation
6189    /// was received. If it was, the server ignores the second request. This
6190    /// behavior prevents clients from mistakenly creating duplicate commitments.
6191    ///
6192    /// The request ID must be a valid UUID, with the exception that zero UUID is
6193    /// not supported (00000000-0000-0000-0000-000000000000).
6194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6195    pub request_id: std::string::String,
6196
6197    /// Optional. Additional information provided by the hub administrator.
6198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6199    pub details: std::string::String,
6200
6201    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6203}
6204
6205impl RejectHubSpokeRequest {
6206    pub fn new() -> Self {
6207        std::default::Default::default()
6208    }
6209
6210    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6211    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212        self.name = v.into();
6213        self
6214    }
6215
6216    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6217    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6218        self.spoke_uri = v.into();
6219        self
6220    }
6221
6222    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6223    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224        self.request_id = v.into();
6225        self
6226    }
6227
6228    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6229    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6230        self.details = v.into();
6231        self
6232    }
6233}
6234
6235impl wkt::message::Message for RejectHubSpokeRequest {
6236    fn typename() -> &'static str {
6237        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
6238    }
6239}
6240
6241/// The response for
6242/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
6243///
6244/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
6245#[serde_with::serde_as]
6246#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6247#[serde(default, rename_all = "camelCase")]
6248#[non_exhaustive]
6249pub struct RejectHubSpokeResponse {
6250    /// The spoke that was operated on.
6251    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6252    pub spoke: std::option::Option<crate::model::Spoke>,
6253
6254    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6255    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6256}
6257
6258impl RejectHubSpokeResponse {
6259    pub fn new() -> Self {
6260        std::default::Default::default()
6261    }
6262
6263    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
6264    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6265        mut self,
6266        v: T,
6267    ) -> Self {
6268        self.spoke = v.into();
6269        self
6270    }
6271}
6272
6273impl wkt::message::Message for RejectHubSpokeResponse {
6274    fn typename() -> &'static str {
6275        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
6276    }
6277}
6278
6279/// The request for
6280/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
6281///
6282/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
6283#[serde_with::serde_as]
6284#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6285#[serde(default, rename_all = "camelCase")]
6286#[non_exhaustive]
6287pub struct AcceptSpokeUpdateRequest {
6288    /// Required. The name of the hub to accept spoke update.
6289    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6290    pub name: std::string::String,
6291
6292    /// Required. The URI of the spoke to accept update.
6293    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6294    pub spoke_uri: std::string::String,
6295
6296    /// Required. The etag of the spoke to accept update.
6297    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6298    pub spoke_etag: std::string::String,
6299
6300    /// Optional. A request ID to identify requests. Specify a unique request ID so
6301    /// that if you must retry your request, the server knows to ignore the request
6302    /// if it has already been completed. The server guarantees that a request
6303    /// doesn't result in creation of duplicate commitments for at least 60
6304    /// minutes.
6305    ///
6306    /// For example, consider a situation where you make an initial request and
6307    /// the request times out. If you make the request again with the same request
6308    /// ID, the server can check to see whether the original operation
6309    /// was received. If it was, the server ignores the second request. This
6310    /// behavior prevents clients from mistakenly creating duplicate commitments.
6311    ///
6312    /// The request ID must be a valid UUID, with the exception that zero UUID is
6313    /// not supported (00000000-0000-0000-0000-000000000000).
6314    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6315    pub request_id: std::string::String,
6316
6317    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6318    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6319}
6320
6321impl AcceptSpokeUpdateRequest {
6322    pub fn new() -> Self {
6323        std::default::Default::default()
6324    }
6325
6326    /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6327    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6328        self.name = v.into();
6329        self
6330    }
6331
6332    /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
6333    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6334        self.spoke_uri = v.into();
6335        self
6336    }
6337
6338    /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
6339    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6340        self.spoke_etag = v.into();
6341        self
6342    }
6343
6344    /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
6345    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6346        self.request_id = v.into();
6347        self
6348    }
6349}
6350
6351impl wkt::message::Message for AcceptSpokeUpdateRequest {
6352    fn typename() -> &'static str {
6353        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
6354    }
6355}
6356
6357/// The response for
6358/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
6359///
6360/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
6361#[serde_with::serde_as]
6362#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6363#[serde(default, rename_all = "camelCase")]
6364#[non_exhaustive]
6365pub struct AcceptSpokeUpdateResponse {
6366    /// The spoke that was operated on.
6367    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6368    pub spoke: std::option::Option<crate::model::Spoke>,
6369
6370    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6371    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6372}
6373
6374impl AcceptSpokeUpdateResponse {
6375    pub fn new() -> Self {
6376        std::default::Default::default()
6377    }
6378
6379    /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
6380    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6381        mut self,
6382        v: T,
6383    ) -> Self {
6384        self.spoke = v.into();
6385        self
6386    }
6387}
6388
6389impl wkt::message::Message for AcceptSpokeUpdateResponse {
6390    fn typename() -> &'static str {
6391        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
6392    }
6393}
6394
6395/// The request for
6396/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
6397///
6398/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
6399#[serde_with::serde_as]
6400#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6401#[serde(default, rename_all = "camelCase")]
6402#[non_exhaustive]
6403pub struct RejectSpokeUpdateRequest {
6404    /// Required. The name of the hub to reject spoke update.
6405    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6406    pub name: std::string::String,
6407
6408    /// Required. The URI of the spoke to reject update.
6409    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6410    pub spoke_uri: std::string::String,
6411
6412    /// Required. The etag of the spoke to reject update.
6413    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6414    pub spoke_etag: std::string::String,
6415
6416    /// Optional. Additional information provided by the hub administrator.
6417    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6418    pub details: std::string::String,
6419
6420    /// Optional. A request ID to identify requests. Specify a unique request ID so
6421    /// that if you must retry your request, the server knows to ignore the request
6422    /// if it has already been completed. The server guarantees that a request
6423    /// doesn't result in creation of duplicate commitments for at least 60
6424    /// minutes.
6425    ///
6426    /// For example, consider a situation where you make an initial request and
6427    /// the request times out. If you make the request again with the same request
6428    /// ID, the server can check to see whether the original operation
6429    /// was received. If it was, the server ignores the second request. This
6430    /// behavior prevents clients from mistakenly creating duplicate commitments.
6431    ///
6432    /// The request ID must be a valid UUID, with the exception that zero UUID is
6433    /// not supported (00000000-0000-0000-0000-000000000000).
6434    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6435    pub request_id: std::string::String,
6436
6437    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6438    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6439}
6440
6441impl RejectSpokeUpdateRequest {
6442    pub fn new() -> Self {
6443        std::default::Default::default()
6444    }
6445
6446    /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
6447    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6448        self.name = v.into();
6449        self
6450    }
6451
6452    /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
6453    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6454        self.spoke_uri = v.into();
6455        self
6456    }
6457
6458    /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
6459    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6460        self.spoke_etag = v.into();
6461        self
6462    }
6463
6464    /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
6465    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6466        self.details = v.into();
6467        self
6468    }
6469
6470    /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
6471    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6472        self.request_id = v.into();
6473        self
6474    }
6475}
6476
6477impl wkt::message::Message for RejectSpokeUpdateRequest {
6478    fn typename() -> &'static str {
6479        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
6480    }
6481}
6482
6483/// The response for
6484/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
6485///
6486/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
6487#[serde_with::serde_as]
6488#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6489#[serde(default, rename_all = "camelCase")]
6490#[non_exhaustive]
6491pub struct RejectSpokeUpdateResponse {
6492    /// The spoke that was operated on.
6493    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6494    pub spoke: std::option::Option<crate::model::Spoke>,
6495
6496    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6497    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6498}
6499
6500impl RejectSpokeUpdateResponse {
6501    pub fn new() -> Self {
6502        std::default::Default::default()
6503    }
6504
6505    /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
6506    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6507        mut self,
6508        v: T,
6509    ) -> Self {
6510        self.spoke = v.into();
6511        self
6512    }
6513}
6514
6515impl wkt::message::Message for RejectSpokeUpdateResponse {
6516    fn typename() -> &'static str {
6517        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
6518    }
6519}
6520
6521/// The request for
6522/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
6523///
6524/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
6525#[serde_with::serde_as]
6526#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6527#[serde(default, rename_all = "camelCase")]
6528#[non_exhaustive]
6529pub struct GetRouteTableRequest {
6530    /// Required. The name of the route table resource.
6531    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6532    pub name: std::string::String,
6533
6534    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6535    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6536}
6537
6538impl GetRouteTableRequest {
6539    pub fn new() -> Self {
6540        std::default::Default::default()
6541    }
6542
6543    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
6544    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545        self.name = v.into();
6546        self
6547    }
6548}
6549
6550impl wkt::message::Message for GetRouteTableRequest {
6551    fn typename() -> &'static str {
6552        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
6553    }
6554}
6555
6556/// The request for
6557/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
6558///
6559/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
6560#[serde_with::serde_as]
6561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6562#[serde(default, rename_all = "camelCase")]
6563#[non_exhaustive]
6564pub struct GetRouteRequest {
6565    /// Required. The name of the route resource.
6566    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6567    pub name: std::string::String,
6568
6569    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6570    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6571}
6572
6573impl GetRouteRequest {
6574    pub fn new() -> Self {
6575        std::default::Default::default()
6576    }
6577
6578    /// Sets the value of [name][crate::model::GetRouteRequest::name].
6579    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6580        self.name = v.into();
6581        self
6582    }
6583}
6584
6585impl wkt::message::Message for GetRouteRequest {
6586    fn typename() -> &'static str {
6587        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
6588    }
6589}
6590
6591/// Request for
6592/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
6593/// method.
6594///
6595/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
6596#[serde_with::serde_as]
6597#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6598#[serde(default, rename_all = "camelCase")]
6599#[non_exhaustive]
6600pub struct ListRoutesRequest {
6601    /// Required. The parent resource's name.
6602    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6603    pub parent: std::string::String,
6604
6605    /// The maximum number of results to return per page.
6606    pub page_size: i32,
6607
6608    /// The page token.
6609    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6610    pub page_token: std::string::String,
6611
6612    /// An expression that filters the list of results.
6613    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6614    pub filter: std::string::String,
6615
6616    /// Sort the results by a certain order.
6617    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6618    pub order_by: std::string::String,
6619
6620    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6621    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6622}
6623
6624impl ListRoutesRequest {
6625    pub fn new() -> Self {
6626        std::default::Default::default()
6627    }
6628
6629    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
6630    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6631        self.parent = v.into();
6632        self
6633    }
6634
6635    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
6636    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6637        self.page_size = v.into();
6638        self
6639    }
6640
6641    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
6642    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643        self.page_token = v.into();
6644        self
6645    }
6646
6647    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
6648    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6649        self.filter = v.into();
6650        self
6651    }
6652
6653    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
6654    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6655        self.order_by = v.into();
6656        self
6657    }
6658}
6659
6660impl wkt::message::Message for ListRoutesRequest {
6661    fn typename() -> &'static str {
6662        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
6663    }
6664}
6665
6666/// Response for
6667/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
6668/// method.
6669///
6670/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
6671#[serde_with::serde_as]
6672#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6673#[serde(default, rename_all = "camelCase")]
6674#[non_exhaustive]
6675pub struct ListRoutesResponse {
6676    /// The requested routes.
6677    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6678    pub routes: std::vec::Vec<crate::model::Route>,
6679
6680    /// The token for the next page of the response. To see more results,
6681    /// use this value as the page_token for your next request. If this value
6682    /// is empty, there are no more results.
6683    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6684    pub next_page_token: std::string::String,
6685
6686    /// RouteTables that could not be reached.
6687    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6688    pub unreachable: std::vec::Vec<std::string::String>,
6689
6690    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6691    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6692}
6693
6694impl ListRoutesResponse {
6695    pub fn new() -> Self {
6696        std::default::Default::default()
6697    }
6698
6699    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
6700    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6701        self.next_page_token = v.into();
6702        self
6703    }
6704
6705    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
6706    pub fn set_routes<T, V>(mut self, v: T) -> Self
6707    where
6708        T: std::iter::IntoIterator<Item = V>,
6709        V: std::convert::Into<crate::model::Route>,
6710    {
6711        use std::iter::Iterator;
6712        self.routes = v.into_iter().map(|i| i.into()).collect();
6713        self
6714    }
6715
6716    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
6717    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6718    where
6719        T: std::iter::IntoIterator<Item = V>,
6720        V: std::convert::Into<std::string::String>,
6721    {
6722        use std::iter::Iterator;
6723        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6724        self
6725    }
6726}
6727
6728impl wkt::message::Message for ListRoutesResponse {
6729    fn typename() -> &'static str {
6730        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
6731    }
6732}
6733
6734#[doc(hidden)]
6735impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
6736    type PageItem = crate::model::Route;
6737
6738    fn items(self) -> std::vec::Vec<Self::PageItem> {
6739        self.routes
6740    }
6741
6742    fn next_page_token(&self) -> std::string::String {
6743        use std::clone::Clone;
6744        self.next_page_token.clone()
6745    }
6746}
6747
6748/// Request for
6749/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
6750/// method.
6751///
6752/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
6753#[serde_with::serde_as]
6754#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6755#[serde(default, rename_all = "camelCase")]
6756#[non_exhaustive]
6757pub struct ListRouteTablesRequest {
6758    /// Required. The parent resource's name.
6759    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6760    pub parent: std::string::String,
6761
6762    /// The maximum number of results to return per page.
6763    pub page_size: i32,
6764
6765    /// The page token.
6766    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6767    pub page_token: std::string::String,
6768
6769    /// An expression that filters the list of results.
6770    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6771    pub filter: std::string::String,
6772
6773    /// Sort the results by a certain order.
6774    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6775    pub order_by: std::string::String,
6776
6777    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6778    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6779}
6780
6781impl ListRouteTablesRequest {
6782    pub fn new() -> Self {
6783        std::default::Default::default()
6784    }
6785
6786    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
6787    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6788        self.parent = v.into();
6789        self
6790    }
6791
6792    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
6793    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6794        self.page_size = v.into();
6795        self
6796    }
6797
6798    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
6799    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6800        self.page_token = v.into();
6801        self
6802    }
6803
6804    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
6805    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806        self.filter = v.into();
6807        self
6808    }
6809
6810    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
6811    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6812        self.order_by = v.into();
6813        self
6814    }
6815}
6816
6817impl wkt::message::Message for ListRouteTablesRequest {
6818    fn typename() -> &'static str {
6819        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
6820    }
6821}
6822
6823/// Response for
6824/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
6825/// method.
6826///
6827/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
6828#[serde_with::serde_as]
6829#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6830#[serde(default, rename_all = "camelCase")]
6831#[non_exhaustive]
6832pub struct ListRouteTablesResponse {
6833    /// The requested route tables.
6834    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6835    pub route_tables: std::vec::Vec<crate::model::RouteTable>,
6836
6837    /// The token for the next page of the response. To see more results,
6838    /// use this value as the page_token for your next request. If this value
6839    /// is empty, there are no more results.
6840    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6841    pub next_page_token: std::string::String,
6842
6843    /// Hubs that could not be reached.
6844    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6845    pub unreachable: std::vec::Vec<std::string::String>,
6846
6847    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6848    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6849}
6850
6851impl ListRouteTablesResponse {
6852    pub fn new() -> Self {
6853        std::default::Default::default()
6854    }
6855
6856    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
6857    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6858        self.next_page_token = v.into();
6859        self
6860    }
6861
6862    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
6863    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
6864    where
6865        T: std::iter::IntoIterator<Item = V>,
6866        V: std::convert::Into<crate::model::RouteTable>,
6867    {
6868        use std::iter::Iterator;
6869        self.route_tables = v.into_iter().map(|i| i.into()).collect();
6870        self
6871    }
6872
6873    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
6874    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6875    where
6876        T: std::iter::IntoIterator<Item = V>,
6877        V: std::convert::Into<std::string::String>,
6878    {
6879        use std::iter::Iterator;
6880        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6881        self
6882    }
6883}
6884
6885impl wkt::message::Message for ListRouteTablesResponse {
6886    fn typename() -> &'static str {
6887        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
6888    }
6889}
6890
6891#[doc(hidden)]
6892impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
6893    type PageItem = crate::model::RouteTable;
6894
6895    fn items(self) -> std::vec::Vec<Self::PageItem> {
6896        self.route_tables
6897    }
6898
6899    fn next_page_token(&self) -> std::string::String {
6900        use std::clone::Clone;
6901        self.next_page_token.clone()
6902    }
6903}
6904
6905/// Request for
6906/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
6907/// method.
6908///
6909/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
6910#[serde_with::serde_as]
6911#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6912#[serde(default, rename_all = "camelCase")]
6913#[non_exhaustive]
6914pub struct ListGroupsRequest {
6915    /// Required. The parent resource's name.
6916    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6917    pub parent: std::string::String,
6918
6919    /// The maximum number of results to return per page.
6920    pub page_size: i32,
6921
6922    /// The page token.
6923    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6924    pub page_token: std::string::String,
6925
6926    /// An expression that filters the list of results.
6927    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6928    pub filter: std::string::String,
6929
6930    /// Sort the results by a certain order.
6931    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6932    pub order_by: std::string::String,
6933
6934    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6935    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6936}
6937
6938impl ListGroupsRequest {
6939    pub fn new() -> Self {
6940        std::default::Default::default()
6941    }
6942
6943    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
6944    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6945        self.parent = v.into();
6946        self
6947    }
6948
6949    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
6950    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6951        self.page_size = v.into();
6952        self
6953    }
6954
6955    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
6956    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6957        self.page_token = v.into();
6958        self
6959    }
6960
6961    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
6962    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6963        self.filter = v.into();
6964        self
6965    }
6966
6967    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
6968    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6969        self.order_by = v.into();
6970        self
6971    }
6972}
6973
6974impl wkt::message::Message for ListGroupsRequest {
6975    fn typename() -> &'static str {
6976        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
6977    }
6978}
6979
6980/// Response for
6981/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
6982/// method.
6983///
6984/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
6985#[serde_with::serde_as]
6986#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6987#[serde(default, rename_all = "camelCase")]
6988#[non_exhaustive]
6989pub struct ListGroupsResponse {
6990    /// The requested groups.
6991    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6992    pub groups: std::vec::Vec<crate::model::Group>,
6993
6994    /// The token for the next page of the response. To see more results,
6995    /// use this value as the page_token for your next request. If this value
6996    /// is empty, there are no more results.
6997    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6998    pub next_page_token: std::string::String,
6999
7000    /// Hubs that could not be reached.
7001    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7002    pub unreachable: std::vec::Vec<std::string::String>,
7003
7004    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7005    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7006}
7007
7008impl ListGroupsResponse {
7009    pub fn new() -> Self {
7010        std::default::Default::default()
7011    }
7012
7013    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
7014    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7015        self.next_page_token = v.into();
7016        self
7017    }
7018
7019    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
7020    pub fn set_groups<T, V>(mut self, v: T) -> Self
7021    where
7022        T: std::iter::IntoIterator<Item = V>,
7023        V: std::convert::Into<crate::model::Group>,
7024    {
7025        use std::iter::Iterator;
7026        self.groups = v.into_iter().map(|i| i.into()).collect();
7027        self
7028    }
7029
7030    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
7031    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7032    where
7033        T: std::iter::IntoIterator<Item = V>,
7034        V: std::convert::Into<std::string::String>,
7035    {
7036        use std::iter::Iterator;
7037        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7038        self
7039    }
7040}
7041
7042impl wkt::message::Message for ListGroupsResponse {
7043    fn typename() -> &'static str {
7044        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
7045    }
7046}
7047
7048#[doc(hidden)]
7049impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
7050    type PageItem = crate::model::Group;
7051
7052    fn items(self) -> std::vec::Vec<Self::PageItem> {
7053        self.groups
7054    }
7055
7056    fn next_page_token(&self) -> std::string::String {
7057        use std::clone::Clone;
7058        self.next_page_token.clone()
7059    }
7060}
7061
7062/// A collection of Cloud VPN tunnel resources. These resources should be
7063/// redundant HA VPN tunnels that all advertise the same prefixes to Google
7064/// Cloud. Alternatively, in a passive/active configuration, all tunnels
7065/// should be capable of advertising the same prefixes.
7066#[serde_with::serde_as]
7067#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7068#[serde(default, rename_all = "camelCase")]
7069#[non_exhaustive]
7070pub struct LinkedVpnTunnels {
7071    /// The URIs of linked VPN tunnel resources.
7072    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7073    pub uris: std::vec::Vec<std::string::String>,
7074
7075    /// A value that controls whether site-to-site data transfer is enabled for
7076    /// these resources. Data transfer is available only in [supported
7077    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7078    pub site_to_site_data_transfer: bool,
7079
7080    /// Output only. The VPC network where these VPN tunnels are located.
7081    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7082    pub vpc_network: std::string::String,
7083
7084    /// Optional. IP ranges allowed to be included during import from hub (does not
7085    /// control transit connectivity). The only allowed value for now is
7086    /// "ALL_IPV4_RANGES".
7087    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7088    pub include_import_ranges: std::vec::Vec<std::string::String>,
7089
7090    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7091    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7092}
7093
7094impl LinkedVpnTunnels {
7095    pub fn new() -> Self {
7096        std::default::Default::default()
7097    }
7098
7099    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
7100    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7101        self.site_to_site_data_transfer = v.into();
7102        self
7103    }
7104
7105    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
7106    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7107        self.vpc_network = v.into();
7108        self
7109    }
7110
7111    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
7112    pub fn set_uris<T, V>(mut self, v: T) -> Self
7113    where
7114        T: std::iter::IntoIterator<Item = V>,
7115        V: std::convert::Into<std::string::String>,
7116    {
7117        use std::iter::Iterator;
7118        self.uris = v.into_iter().map(|i| i.into()).collect();
7119        self
7120    }
7121
7122    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
7123    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7124    where
7125        T: std::iter::IntoIterator<Item = V>,
7126        V: std::convert::Into<std::string::String>,
7127    {
7128        use std::iter::Iterator;
7129        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7130        self
7131    }
7132}
7133
7134impl wkt::message::Message for LinkedVpnTunnels {
7135    fn typename() -> &'static str {
7136        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
7137    }
7138}
7139
7140/// A collection of VLAN attachment resources. These resources should
7141/// be redundant attachments that all advertise the same prefixes to Google
7142/// Cloud. Alternatively, in active/passive configurations, all attachments
7143/// should be capable of advertising the same prefixes.
7144#[serde_with::serde_as]
7145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7146#[serde(default, rename_all = "camelCase")]
7147#[non_exhaustive]
7148pub struct LinkedInterconnectAttachments {
7149    /// The URIs of linked interconnect attachment resources
7150    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7151    pub uris: std::vec::Vec<std::string::String>,
7152
7153    /// A value that controls whether site-to-site data transfer is enabled for
7154    /// these resources. Data transfer is available only in [supported
7155    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7156    pub site_to_site_data_transfer: bool,
7157
7158    /// Output only. The VPC network where these VLAN attachments are located.
7159    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7160    pub vpc_network: std::string::String,
7161
7162    /// Optional. IP ranges allowed to be included during import from hub (does not
7163    /// control transit connectivity). The only allowed value for now is
7164    /// "ALL_IPV4_RANGES".
7165    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7166    pub include_import_ranges: std::vec::Vec<std::string::String>,
7167
7168    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7169    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7170}
7171
7172impl LinkedInterconnectAttachments {
7173    pub fn new() -> Self {
7174        std::default::Default::default()
7175    }
7176
7177    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
7178    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7179        self.site_to_site_data_transfer = v.into();
7180        self
7181    }
7182
7183    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
7184    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7185        self.vpc_network = v.into();
7186        self
7187    }
7188
7189    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
7190    pub fn set_uris<T, V>(mut self, v: T) -> Self
7191    where
7192        T: std::iter::IntoIterator<Item = V>,
7193        V: std::convert::Into<std::string::String>,
7194    {
7195        use std::iter::Iterator;
7196        self.uris = v.into_iter().map(|i| i.into()).collect();
7197        self
7198    }
7199
7200    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
7201    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7202    where
7203        T: std::iter::IntoIterator<Item = V>,
7204        V: std::convert::Into<std::string::String>,
7205    {
7206        use std::iter::Iterator;
7207        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7208        self
7209    }
7210}
7211
7212impl wkt::message::Message for LinkedInterconnectAttachments {
7213    fn typename() -> &'static str {
7214        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
7215    }
7216}
7217
7218/// A collection of router appliance instances. If you configure multiple router
7219/// appliance instances to receive data from the same set of sites outside of
7220/// Google Cloud, we recommend that you associate those instances with the same
7221/// spoke.
7222#[serde_with::serde_as]
7223#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7224#[serde(default, rename_all = "camelCase")]
7225#[non_exhaustive]
7226pub struct LinkedRouterApplianceInstances {
7227    /// The list of router appliance instances.
7228    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7229    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
7230
7231    /// A value that controls whether site-to-site data transfer is enabled for
7232    /// these resources. Data transfer is available only in [supported
7233    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7234    pub site_to_site_data_transfer: bool,
7235
7236    /// Output only. The VPC network where these router appliance instances are
7237    /// located.
7238    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7239    pub vpc_network: std::string::String,
7240
7241    /// Optional. IP ranges allowed to be included during import from hub (does not
7242    /// control transit connectivity). The only allowed value for now is
7243    /// "ALL_IPV4_RANGES".
7244    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7245    pub include_import_ranges: std::vec::Vec<std::string::String>,
7246
7247    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7248    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7249}
7250
7251impl LinkedRouterApplianceInstances {
7252    pub fn new() -> Self {
7253        std::default::Default::default()
7254    }
7255
7256    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
7257    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7258        self.site_to_site_data_transfer = v.into();
7259        self
7260    }
7261
7262    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
7263    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7264        self.vpc_network = v.into();
7265        self
7266    }
7267
7268    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
7269    pub fn set_instances<T, V>(mut self, v: T) -> Self
7270    where
7271        T: std::iter::IntoIterator<Item = V>,
7272        V: std::convert::Into<crate::model::RouterApplianceInstance>,
7273    {
7274        use std::iter::Iterator;
7275        self.instances = v.into_iter().map(|i| i.into()).collect();
7276        self
7277    }
7278
7279    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
7280    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7281    where
7282        T: std::iter::IntoIterator<Item = V>,
7283        V: std::convert::Into<std::string::String>,
7284    {
7285        use std::iter::Iterator;
7286        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7287        self
7288    }
7289}
7290
7291impl wkt::message::Message for LinkedRouterApplianceInstances {
7292    fn typename() -> &'static str {
7293        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
7294    }
7295}
7296
7297/// An existing VPC network.
7298#[serde_with::serde_as]
7299#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7300#[serde(default, rename_all = "camelCase")]
7301#[non_exhaustive]
7302pub struct LinkedVpcNetwork {
7303    /// Required. The URI of the VPC network resource.
7304    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7305    pub uri: std::string::String,
7306
7307    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
7308    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7309    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7310
7311    /// Optional. IP ranges allowed to be included from peering.
7312    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7313    pub include_export_ranges: std::vec::Vec<std::string::String>,
7314
7315    /// Optional. The proposed include export IP ranges waiting for hub
7316    /// administration's approval.
7317    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7318    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7319
7320    /// Output only. The proposed exclude export IP ranges waiting for hub
7321    /// administration's approval.
7322    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7323    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7324
7325    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
7326    /// service consumer VPC spoke for. These producer VPCs are connected through
7327    /// VPC peering to this spoke's backing VPC network. Because they are directly
7328    /// connected throuh VPC peering, NCC export filters do not apply between the
7329    /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
7330    /// spoke cannot be deleted as long as any of these producer VPC spokes are
7331    /// connected to the NCC Hub.
7332    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7333    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
7334
7335    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7336    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7337}
7338
7339impl LinkedVpcNetwork {
7340    pub fn new() -> Self {
7341        std::default::Default::default()
7342    }
7343
7344    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
7345    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7346        self.uri = v.into();
7347        self
7348    }
7349
7350    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
7351    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7352    where
7353        T: std::iter::IntoIterator<Item = V>,
7354        V: std::convert::Into<std::string::String>,
7355    {
7356        use std::iter::Iterator;
7357        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7358        self
7359    }
7360
7361    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
7362    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7363    where
7364        T: std::iter::IntoIterator<Item = V>,
7365        V: std::convert::Into<std::string::String>,
7366    {
7367        use std::iter::Iterator;
7368        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7369        self
7370    }
7371
7372    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
7373    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7374    where
7375        T: std::iter::IntoIterator<Item = V>,
7376        V: std::convert::Into<std::string::String>,
7377    {
7378        use std::iter::Iterator;
7379        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7380        self
7381    }
7382
7383    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
7384    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7385    where
7386        T: std::iter::IntoIterator<Item = V>,
7387        V: std::convert::Into<std::string::String>,
7388    {
7389        use std::iter::Iterator;
7390        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7391        self
7392    }
7393
7394    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
7395    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
7396    where
7397        T: std::iter::IntoIterator<Item = V>,
7398        V: std::convert::Into<std::string::String>,
7399    {
7400        use std::iter::Iterator;
7401        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
7402        self
7403    }
7404}
7405
7406impl wkt::message::Message for LinkedVpcNetwork {
7407    fn typename() -> &'static str {
7408        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
7409    }
7410}
7411
7412#[serde_with::serde_as]
7413#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7414#[serde(default, rename_all = "camelCase")]
7415#[non_exhaustive]
7416pub struct LinkedProducerVpcNetwork {
7417    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
7418    /// peered with.
7419    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7420    pub network: std::string::String,
7421
7422    /// Output only. The Service Consumer Network spoke.
7423    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7424    pub service_consumer_vpc_spoke: std::string::String,
7425
7426    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
7427    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
7428    /// hub. This peering must be in ACTIVE state.
7429    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7430    pub peering: std::string::String,
7431
7432    /// Output only. The URI of the Producer VPC.
7433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7434    pub producer_network: std::string::String,
7435
7436    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
7437    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7438    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7439
7440    /// Optional. IP ranges allowed to be included from peering.
7441    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7442    pub include_export_ranges: std::vec::Vec<std::string::String>,
7443
7444    /// Optional. The proposed include export IP ranges waiting for hub
7445    /// administration's approval.
7446    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7447    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7448
7449    /// Output only. The proposed exclude export IP ranges waiting for hub
7450    /// administration's approval.
7451    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7452    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7453
7454    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7455    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7456}
7457
7458impl LinkedProducerVpcNetwork {
7459    pub fn new() -> Self {
7460        std::default::Default::default()
7461    }
7462
7463    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
7464    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7465        self.network = v.into();
7466        self
7467    }
7468
7469    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
7470    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
7471        mut self,
7472        v: T,
7473    ) -> Self {
7474        self.service_consumer_vpc_spoke = v.into();
7475        self
7476    }
7477
7478    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
7479    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7480        self.peering = v.into();
7481        self
7482    }
7483
7484    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
7485    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
7486        mut self,
7487        v: T,
7488    ) -> Self {
7489        self.producer_network = v.into();
7490        self
7491    }
7492
7493    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
7494    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7495    where
7496        T: std::iter::IntoIterator<Item = V>,
7497        V: std::convert::Into<std::string::String>,
7498    {
7499        use std::iter::Iterator;
7500        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7501        self
7502    }
7503
7504    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
7505    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7506    where
7507        T: std::iter::IntoIterator<Item = V>,
7508        V: std::convert::Into<std::string::String>,
7509    {
7510        use std::iter::Iterator;
7511        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7512        self
7513    }
7514
7515    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
7516    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7517    where
7518        T: std::iter::IntoIterator<Item = V>,
7519        V: std::convert::Into<std::string::String>,
7520    {
7521        use std::iter::Iterator;
7522        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7523        self
7524    }
7525
7526    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
7527    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7528    where
7529        T: std::iter::IntoIterator<Item = V>,
7530        V: std::convert::Into<std::string::String>,
7531    {
7532        use std::iter::Iterator;
7533        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7534        self
7535    }
7536}
7537
7538impl wkt::message::Message for LinkedProducerVpcNetwork {
7539    fn typename() -> &'static str {
7540        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
7541    }
7542}
7543
7544/// A router appliance instance is a Compute Engine virtual machine (VM) instance
7545/// that acts as a BGP speaker. A router appliance instance is specified by the
7546/// URI of the VM and the internal IP address of one of the VM's network
7547/// interfaces.
7548#[serde_with::serde_as]
7549#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7550#[serde(default, rename_all = "camelCase")]
7551#[non_exhaustive]
7552pub struct RouterApplianceInstance {
7553    /// The URI of the VM.
7554    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7555    pub virtual_machine: std::string::String,
7556
7557    /// The IP address on the VM to use for peering.
7558    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7559    pub ip_address: std::string::String,
7560
7561    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7562    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7563}
7564
7565impl RouterApplianceInstance {
7566    pub fn new() -> Self {
7567        std::default::Default::default()
7568    }
7569
7570    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
7571    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7572        self.virtual_machine = v.into();
7573        self
7574    }
7575
7576    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
7577    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7578        self.ip_address = v.into();
7579        self
7580    }
7581}
7582
7583impl wkt::message::Message for RouterApplianceInstance {
7584    fn typename() -> &'static str {
7585        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
7586    }
7587}
7588
7589/// Metadata about locations
7590#[serde_with::serde_as]
7591#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7592#[serde(default, rename_all = "camelCase")]
7593#[non_exhaustive]
7594pub struct LocationMetadata {
7595    /// List of supported features
7596    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7597    pub location_features: std::vec::Vec<crate::model::LocationFeature>,
7598
7599    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7600    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7601}
7602
7603impl LocationMetadata {
7604    pub fn new() -> Self {
7605        std::default::Default::default()
7606    }
7607
7608    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
7609    pub fn set_location_features<T, V>(mut self, v: T) -> Self
7610    where
7611        T: std::iter::IntoIterator<Item = V>,
7612        V: std::convert::Into<crate::model::LocationFeature>,
7613    {
7614        use std::iter::Iterator;
7615        self.location_features = v.into_iter().map(|i| i.into()).collect();
7616        self
7617    }
7618}
7619
7620impl wkt::message::Message for LocationMetadata {
7621    fn typename() -> &'static str {
7622        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
7623    }
7624}
7625
7626#[serde_with::serde_as]
7627#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7628#[serde(default, rename_all = "camelCase")]
7629#[non_exhaustive]
7630pub struct NextHopVpcNetwork {
7631    /// The URI of the VPC network resource
7632    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7633    pub uri: std::string::String,
7634
7635    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7636    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7637}
7638
7639impl NextHopVpcNetwork {
7640    pub fn new() -> Self {
7641        std::default::Default::default()
7642    }
7643
7644    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
7645    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7646        self.uri = v.into();
7647        self
7648    }
7649}
7650
7651impl wkt::message::Message for NextHopVpcNetwork {
7652    fn typename() -> &'static str {
7653        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
7654    }
7655}
7656
7657/// A route next hop that leads to a VPN tunnel resource.
7658#[serde_with::serde_as]
7659#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7660#[serde(default, rename_all = "camelCase")]
7661#[non_exhaustive]
7662pub struct NextHopVPNTunnel {
7663    /// The URI of the VPN tunnel resource.
7664    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7665    pub uri: std::string::String,
7666
7667    /// The VPC network where this VPN tunnel is located.
7668    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7669    pub vpc_network: std::string::String,
7670
7671    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
7672    /// resource. Data transfer is available only in [supported
7673    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7674    pub site_to_site_data_transfer: bool,
7675
7676    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7677    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7678}
7679
7680impl NextHopVPNTunnel {
7681    pub fn new() -> Self {
7682        std::default::Default::default()
7683    }
7684
7685    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
7686    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7687        self.uri = v.into();
7688        self
7689    }
7690
7691    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
7692    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7693        self.vpc_network = v.into();
7694        self
7695    }
7696
7697    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
7698    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7699        self.site_to_site_data_transfer = v.into();
7700        self
7701    }
7702}
7703
7704impl wkt::message::Message for NextHopVPNTunnel {
7705    fn typename() -> &'static str {
7706        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
7707    }
7708}
7709
7710/// A route next hop that leads to a Router appliance instance.
7711#[serde_with::serde_as]
7712#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7713#[serde(default, rename_all = "camelCase")]
7714#[non_exhaustive]
7715pub struct NextHopRouterApplianceInstance {
7716    /// The URI of the Router appliance instance.
7717    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7718    pub uri: std::string::String,
7719
7720    /// The VPC network where this VM is located.
7721    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7722    pub vpc_network: std::string::String,
7723
7724    /// Indicates whether site-to-site data transfer is allowed for this Router
7725    /// appliance instance resource. Data transfer is available only in [supported
7726    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7727    pub site_to_site_data_transfer: bool,
7728
7729    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7730    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7731}
7732
7733impl NextHopRouterApplianceInstance {
7734    pub fn new() -> Self {
7735        std::default::Default::default()
7736    }
7737
7738    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
7739    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7740        self.uri = v.into();
7741        self
7742    }
7743
7744    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
7745    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7746        self.vpc_network = v.into();
7747        self
7748    }
7749
7750    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
7751    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7752        self.site_to_site_data_transfer = v.into();
7753        self
7754    }
7755}
7756
7757impl wkt::message::Message for NextHopRouterApplianceInstance {
7758    fn typename() -> &'static str {
7759        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
7760    }
7761}
7762
7763/// A route next hop that leads to an interconnect attachment resource.
7764#[serde_with::serde_as]
7765#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7766#[serde(default, rename_all = "camelCase")]
7767#[non_exhaustive]
7768pub struct NextHopInterconnectAttachment {
7769    /// The URI of the interconnect attachment resource.
7770    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7771    pub uri: std::string::String,
7772
7773    /// The VPC network where this interconnect attachment is located.
7774    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7775    pub vpc_network: std::string::String,
7776
7777    /// Indicates whether site-to-site data transfer is allowed for this
7778    /// interconnect attachment resource. Data transfer is available only in
7779    /// [supported
7780    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
7781    pub site_to_site_data_transfer: bool,
7782
7783    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7784    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7785}
7786
7787impl NextHopInterconnectAttachment {
7788    pub fn new() -> Self {
7789        std::default::Default::default()
7790    }
7791
7792    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
7793    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7794        self.uri = v.into();
7795        self
7796    }
7797
7798    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
7799    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7800        self.vpc_network = v.into();
7801        self
7802    }
7803
7804    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
7805    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7806        self.site_to_site_data_transfer = v.into();
7807        self
7808    }
7809}
7810
7811impl wkt::message::Message for NextHopInterconnectAttachment {
7812    fn typename() -> &'static str {
7813        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
7814    }
7815}
7816
7817/// Summarizes information about the spokes associated with a hub.
7818/// The summary includes a count of spokes according to type
7819/// and according to state. If any spokes are inactive,
7820/// the summary also lists the reasons they are inactive,
7821/// including a count for each reason.
7822#[serde_with::serde_as]
7823#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7824#[serde(default, rename_all = "camelCase")]
7825#[non_exhaustive]
7826pub struct SpokeSummary {
7827    /// Output only. Counts the number of spokes of each type that are
7828    /// associated with a specific hub.
7829    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7830    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
7831
7832    /// Output only. Counts the number of spokes that are in each state
7833    /// and associated with a given hub.
7834    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7835    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
7836
7837    /// Output only. Counts the number of spokes that are inactive for each
7838    /// possible reason and associated with a given hub.
7839    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7840    pub spoke_state_reason_counts:
7841        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
7842
7843    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7844    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7845}
7846
7847impl SpokeSummary {
7848    pub fn new() -> Self {
7849        std::default::Default::default()
7850    }
7851
7852    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
7853    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
7854    where
7855        T: std::iter::IntoIterator<Item = V>,
7856        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
7857    {
7858        use std::iter::Iterator;
7859        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
7860        self
7861    }
7862
7863    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
7864    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
7865    where
7866        T: std::iter::IntoIterator<Item = V>,
7867        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
7868    {
7869        use std::iter::Iterator;
7870        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
7871        self
7872    }
7873
7874    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
7875    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
7876    where
7877        T: std::iter::IntoIterator<Item = V>,
7878        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
7879    {
7880        use std::iter::Iterator;
7881        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
7882        self
7883    }
7884}
7885
7886impl wkt::message::Message for SpokeSummary {
7887    fn typename() -> &'static str {
7888        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
7889    }
7890}
7891
7892/// Defines additional types related to [SpokeSummary].
7893pub mod spoke_summary {
7894    #[allow(unused_imports)]
7895    use super::*;
7896
7897    /// The number of spokes of a given type that are associated
7898    /// with a specific hub. The type indicates what kind of
7899    /// resource is associated with the spoke.
7900    #[serde_with::serde_as]
7901    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7902    #[serde(default, rename_all = "camelCase")]
7903    #[non_exhaustive]
7904    pub struct SpokeTypeCount {
7905        /// Output only. The type of the spokes.
7906        pub spoke_type: crate::model::SpokeType,
7907
7908        /// Output only. The total number of spokes of this type that are
7909        /// associated with the hub.
7910        #[serde_as(as = "serde_with::DisplayFromStr")]
7911        pub count: i64,
7912
7913        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7914        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7915    }
7916
7917    impl SpokeTypeCount {
7918        pub fn new() -> Self {
7919            std::default::Default::default()
7920        }
7921
7922        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
7923        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
7924            mut self,
7925            v: T,
7926        ) -> Self {
7927            self.spoke_type = v.into();
7928            self
7929        }
7930
7931        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
7932        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7933            self.count = v.into();
7934            self
7935        }
7936    }
7937
7938    impl wkt::message::Message for SpokeTypeCount {
7939        fn typename() -> &'static str {
7940            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
7941        }
7942    }
7943
7944    /// The number of spokes that are in a particular state
7945    /// and associated with a given hub.
7946    #[serde_with::serde_as]
7947    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7948    #[serde(default, rename_all = "camelCase")]
7949    #[non_exhaustive]
7950    pub struct SpokeStateCount {
7951        /// Output only. The state of the spokes.
7952        pub state: crate::model::State,
7953
7954        /// Output only. The total number of spokes that are in this state
7955        /// and associated with a given hub.
7956        #[serde_as(as = "serde_with::DisplayFromStr")]
7957        pub count: i64,
7958
7959        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7960        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7961    }
7962
7963    impl SpokeStateCount {
7964        pub fn new() -> Self {
7965            std::default::Default::default()
7966        }
7967
7968        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
7969        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
7970            self.state = v.into();
7971            self
7972        }
7973
7974        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
7975        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7976            self.count = v.into();
7977            self
7978        }
7979    }
7980
7981    impl wkt::message::Message for SpokeStateCount {
7982        fn typename() -> &'static str {
7983            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
7984        }
7985    }
7986
7987    /// The number of spokes in the hub that are inactive for this reason.
7988    #[serde_with::serde_as]
7989    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7990    #[serde(default, rename_all = "camelCase")]
7991    #[non_exhaustive]
7992    pub struct SpokeStateReasonCount {
7993        /// Output only. The reason that a spoke is inactive.
7994        pub state_reason_code: crate::model::spoke::state_reason::Code,
7995
7996        /// Output only. The total number of spokes that are inactive for a
7997        /// particular reason and associated with a given hub.
7998        #[serde_as(as = "serde_with::DisplayFromStr")]
7999        pub count: i64,
8000
8001        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8002        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8003    }
8004
8005    impl SpokeStateReasonCount {
8006        pub fn new() -> Self {
8007            std::default::Default::default()
8008        }
8009
8010        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
8011        pub fn set_state_reason_code<
8012            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
8013        >(
8014            mut self,
8015            v: T,
8016        ) -> Self {
8017            self.state_reason_code = v.into();
8018            self
8019        }
8020
8021        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
8022        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8023            self.count = v.into();
8024            self
8025        }
8026    }
8027
8028    impl wkt::message::Message for SpokeStateReasonCount {
8029        fn typename() -> &'static str {
8030            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
8031        }
8032    }
8033}
8034
8035/// The request for
8036/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
8037///
8038/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
8039#[serde_with::serde_as]
8040#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8041#[serde(default, rename_all = "camelCase")]
8042#[non_exhaustive]
8043pub struct GetGroupRequest {
8044    /// Required. The name of the route table resource.
8045    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8046    pub name: std::string::String,
8047
8048    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8049    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8050}
8051
8052impl GetGroupRequest {
8053    pub fn new() -> Self {
8054        std::default::Default::default()
8055    }
8056
8057    /// Sets the value of [name][crate::model::GetGroupRequest::name].
8058    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8059        self.name = v.into();
8060        self
8061    }
8062}
8063
8064impl wkt::message::Message for GetGroupRequest {
8065    fn typename() -> &'static str {
8066        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
8067    }
8068}
8069
8070/// Request for
8071/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
8072/// method.
8073///
8074/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
8075#[serde_with::serde_as]
8076#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8077#[serde(default, rename_all = "camelCase")]
8078#[non_exhaustive]
8079pub struct UpdateGroupRequest {
8080    /// Optional. In the case of an update to an existing group, field mask is used
8081    /// to specify the fields to be overwritten. The fields specified in the
8082    /// update_mask are relative to the resource, not the full request. A field is
8083    /// overwritten if it is in the mask. If the user does not provide a mask, then
8084    /// all fields are overwritten.
8085    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8086    pub update_mask: std::option::Option<wkt::FieldMask>,
8087
8088    /// Required. The state that the group should be in after the update.
8089    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8090    pub group: std::option::Option<crate::model::Group>,
8091
8092    /// Optional. A request ID to identify requests. Specify a unique request ID so
8093    /// that if you must retry your request, the server knows to ignore the request
8094    /// if it has already been completed. The server guarantees that a request
8095    /// doesn't result in creation of duplicate commitments for at least 60
8096    /// minutes.
8097    ///
8098    /// For example, consider a situation where you make an initial request and
8099    /// the request times out. If you make the request again with the same request
8100    /// ID, the server can check to see whether the original operation
8101    /// was received. If it was, the server ignores the second request. This
8102    /// behavior prevents clients from mistakenly creating duplicate commitments.
8103    ///
8104    /// The request ID must be a valid UUID, with the exception that zero UUID is
8105    /// not supported (00000000-0000-0000-0000-000000000000).
8106    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8107    pub request_id: std::string::String,
8108
8109    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8110    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8111}
8112
8113impl UpdateGroupRequest {
8114    pub fn new() -> Self {
8115        std::default::Default::default()
8116    }
8117
8118    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
8119    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
8120        mut self,
8121        v: T,
8122    ) -> Self {
8123        self.update_mask = v.into();
8124        self
8125    }
8126
8127    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
8128    pub fn set_group<T: std::convert::Into<std::option::Option<crate::model::Group>>>(
8129        mut self,
8130        v: T,
8131    ) -> Self {
8132        self.group = v.into();
8133        self
8134    }
8135
8136    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
8137    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8138        self.request_id = v.into();
8139        self
8140    }
8141}
8142
8143impl wkt::message::Message for UpdateGroupRequest {
8144    fn typename() -> &'static str {
8145        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
8146    }
8147}
8148
8149/// Policy-based routes route L4 network traffic based on not just destination IP
8150/// address, but also source IP address, protocol, and more. If a policy-based
8151/// route conflicts with other types of routes, the policy-based route always
8152/// takes precedence.
8153#[serde_with::serde_as]
8154#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8155#[serde(default, rename_all = "camelCase")]
8156#[non_exhaustive]
8157pub struct PolicyBasedRoute {
8158    /// Immutable. A unique name of the resource in the form of
8159    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
8160    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8161    pub name: std::string::String,
8162
8163    /// Output only. Time when the policy-based route was created.
8164    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8165    pub create_time: std::option::Option<wkt::Timestamp>,
8166
8167    /// Output only. Time when the policy-based route was updated.
8168    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8169    pub update_time: std::option::Option<wkt::Timestamp>,
8170
8171    /// User-defined labels.
8172    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8173    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8174
8175    /// Optional. An optional description of this resource. Provide this field when
8176    /// you create the resource.
8177    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8178    pub description: std::string::String,
8179
8180    /// Required. Fully-qualified URL of the network that this route applies to,
8181    /// for example: projects/my-project/global/networks/my-network.
8182    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8183    pub network: std::string::String,
8184
8185    /// Required. The filter to match L4 traffic.
8186    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8187    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
8188
8189    /// Optional. The priority of this policy-based route. Priority is used to
8190    /// break ties in cases where there are more than one matching policy-based
8191    /// routes found. In cases where multiple policy-based routes are matched, the
8192    /// one with the lowest-numbered priority value wins. The default value is
8193    /// 1000. The priority value must be from 1 to 65535, inclusive.
8194    pub priority: i32,
8195
8196    /// Output only. If potential misconfigurations are detected for this route,
8197    /// this field will be populated with warning messages.
8198    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8199    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
8200
8201    /// Output only. Server-defined fully-qualified URL for this resource.
8202    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8203    pub self_link: std::string::String,
8204
8205    /// Output only. Type of this resource. Always
8206    /// networkconnectivity#policyBasedRoute for policy-based Route resources.
8207    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8208    pub kind: std::string::String,
8209
8210    /// Target specifies network endpoints that this policy-based route applies to.
8211    /// If no target is specified, the PBR will be installed on all network
8212    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
8213    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8214    pub target: std::option::Option<crate::model::policy_based_route::Target>,
8215
8216    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8217    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
8218
8219    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8220    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8221}
8222
8223impl PolicyBasedRoute {
8224    pub fn new() -> Self {
8225        std::default::Default::default()
8226    }
8227
8228    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
8229    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8230        self.name = v.into();
8231        self
8232    }
8233
8234    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
8235    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8236        mut self,
8237        v: T,
8238    ) -> Self {
8239        self.create_time = v.into();
8240        self
8241    }
8242
8243    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
8244    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8245        mut self,
8246        v: T,
8247    ) -> Self {
8248        self.update_time = v.into();
8249        self
8250    }
8251
8252    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
8253    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8254        self.description = v.into();
8255        self
8256    }
8257
8258    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
8259    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8260        self.network = v.into();
8261        self
8262    }
8263
8264    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
8265    pub fn set_filter<
8266        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Filter>>,
8267    >(
8268        mut self,
8269        v: T,
8270    ) -> Self {
8271        self.filter = v.into();
8272        self
8273    }
8274
8275    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
8276    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8277        self.priority = v.into();
8278        self
8279    }
8280
8281    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
8282    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8283        self.self_link = v.into();
8284        self
8285    }
8286
8287    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
8288    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8289        self.kind = v.into();
8290        self
8291    }
8292
8293    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
8294    pub fn set_warnings<T, V>(mut self, v: T) -> Self
8295    where
8296        T: std::iter::IntoIterator<Item = V>,
8297        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
8298    {
8299        use std::iter::Iterator;
8300        self.warnings = v.into_iter().map(|i| i.into()).collect();
8301        self
8302    }
8303
8304    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
8305    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8306    where
8307        T: std::iter::IntoIterator<Item = (K, V)>,
8308        K: std::convert::Into<std::string::String>,
8309        V: std::convert::Into<std::string::String>,
8310    {
8311        use std::iter::Iterator;
8312        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8313        self
8314    }
8315
8316    /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
8317    ///
8318    /// Note that all the setters affecting `target` are mutually
8319    /// exclusive.
8320    pub fn set_target<
8321        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
8322    >(
8323        mut self,
8324        v: T,
8325    ) -> Self {
8326        self.target = v.into();
8327        self
8328    }
8329
8330    /// The value of [target][crate::model::PolicyBasedRoute::target]
8331    /// if it holds a `VirtualMachine`, `None` if the field is not set or
8332    /// holds a different branch.
8333    pub fn virtual_machine(
8334        &self,
8335    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
8336    {
8337        #[allow(unreachable_patterns)]
8338        self.target.as_ref().and_then(|v| match v {
8339            crate::model::policy_based_route::Target::VirtualMachine(v) => {
8340                std::option::Option::Some(v)
8341            }
8342            _ => std::option::Option::None,
8343        })
8344    }
8345
8346    /// The value of [target][crate::model::PolicyBasedRoute::target]
8347    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
8348    /// holds a different branch.
8349    pub fn interconnect_attachment(
8350        &self,
8351    ) -> std::option::Option<
8352        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8353    > {
8354        #[allow(unreachable_patterns)]
8355        self.target.as_ref().and_then(|v| match v {
8356            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
8357                std::option::Option::Some(v)
8358            }
8359            _ => std::option::Option::None,
8360        })
8361    }
8362
8363    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
8364    /// to hold a `VirtualMachine`.
8365    ///
8366    /// Note that all the setters affecting `target` are
8367    /// mutually exclusive.
8368    pub fn set_virtual_machine<
8369        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
8370    >(
8371        mut self,
8372        v: T,
8373    ) -> Self {
8374        self.target = std::option::Option::Some(
8375            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
8376        );
8377        self
8378    }
8379
8380    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
8381    /// to hold a `InterconnectAttachment`.
8382    ///
8383    /// Note that all the setters affecting `target` are
8384    /// mutually exclusive.
8385    pub fn set_interconnect_attachment<
8386        T: std::convert::Into<
8387                std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8388            >,
8389    >(
8390        mut self,
8391        v: T,
8392    ) -> Self {
8393        self.target = std::option::Option::Some(
8394            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
8395        );
8396        self
8397    }
8398
8399    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
8400    ///
8401    /// Note that all the setters affecting `next_hop` are mutually
8402    /// exclusive.
8403    pub fn set_next_hop<
8404        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
8405    >(
8406        mut self,
8407        v: T,
8408    ) -> Self {
8409        self.next_hop = v.into();
8410        self
8411    }
8412
8413    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
8414    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
8415    /// holds a different branch.
8416    pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
8417        #[allow(unreachable_patterns)]
8418        self.next_hop.as_ref().and_then(|v| match v {
8419            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
8420                std::option::Option::Some(v)
8421            }
8422            _ => std::option::Option::None,
8423        })
8424    }
8425
8426    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
8427    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
8428    /// holds a different branch.
8429    pub fn next_hop_other_routes(
8430        &self,
8431    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
8432        #[allow(unreachable_patterns)]
8433        self.next_hop.as_ref().and_then(|v| match v {
8434            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
8435                std::option::Option::Some(v)
8436            }
8437            _ => std::option::Option::None,
8438        })
8439    }
8440
8441    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
8442    /// to hold a `NextHopIlbIp`.
8443    ///
8444    /// Note that all the setters affecting `next_hop` are
8445    /// mutually exclusive.
8446    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8447        self.next_hop = std::option::Option::Some(
8448            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
8449        );
8450        self
8451    }
8452
8453    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
8454    /// to hold a `NextHopOtherRoutes`.
8455    ///
8456    /// Note that all the setters affecting `next_hop` are
8457    /// mutually exclusive.
8458    pub fn set_next_hop_other_routes<
8459        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
8460    >(
8461        mut self,
8462        v: T,
8463    ) -> Self {
8464        self.next_hop = std::option::Option::Some(
8465            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
8466        );
8467        self
8468    }
8469}
8470
8471impl wkt::message::Message for PolicyBasedRoute {
8472    fn typename() -> &'static str {
8473        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
8474    }
8475}
8476
8477/// Defines additional types related to [PolicyBasedRoute].
8478pub mod policy_based_route {
8479    #[allow(unused_imports)]
8480    use super::*;
8481
8482    /// VM instances that this policy-based route applies to.
8483    #[serde_with::serde_as]
8484    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8485    #[serde(default, rename_all = "camelCase")]
8486    #[non_exhaustive]
8487    pub struct VirtualMachine {
8488        /// Optional. A list of VM instance tags that this policy-based route applies
8489        /// to. VM instances that have ANY of tags specified here installs this PBR.
8490        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8491        pub tags: std::vec::Vec<std::string::String>,
8492
8493        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8494        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8495    }
8496
8497    impl VirtualMachine {
8498        pub fn new() -> Self {
8499            std::default::Default::default()
8500        }
8501
8502        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
8503        pub fn set_tags<T, V>(mut self, v: T) -> Self
8504        where
8505            T: std::iter::IntoIterator<Item = V>,
8506            V: std::convert::Into<std::string::String>,
8507        {
8508            use std::iter::Iterator;
8509            self.tags = v.into_iter().map(|i| i.into()).collect();
8510            self
8511        }
8512    }
8513
8514    impl wkt::message::Message for VirtualMachine {
8515        fn typename() -> &'static str {
8516            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
8517        }
8518    }
8519
8520    /// InterconnectAttachment that this route applies to.
8521    #[serde_with::serde_as]
8522    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8523    #[serde(default, rename_all = "camelCase")]
8524    #[non_exhaustive]
8525    pub struct InterconnectAttachment {
8526        /// Optional. Cloud region to install this policy-based route on interconnect
8527        /// attachment. Use `all` to install it on all interconnect attachments.
8528        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8529        pub region: std::string::String,
8530
8531        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8532        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8533    }
8534
8535    impl InterconnectAttachment {
8536        pub fn new() -> Self {
8537            std::default::Default::default()
8538        }
8539
8540        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
8541        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8542            self.region = v.into();
8543            self
8544        }
8545    }
8546
8547    impl wkt::message::Message for InterconnectAttachment {
8548        fn typename() -> &'static str {
8549            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
8550        }
8551    }
8552
8553    /// Filter matches L4 traffic.
8554    #[serde_with::serde_as]
8555    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8556    #[serde(default, rename_all = "camelCase")]
8557    #[non_exhaustive]
8558    pub struct Filter {
8559        /// Optional. The IP protocol that this policy-based route applies to. Valid
8560        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
8561        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8562        pub ip_protocol: std::string::String,
8563
8564        /// Optional. The source IP range of outgoing packets that this policy-based
8565        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
8566        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8567        pub src_range: std::string::String,
8568
8569        /// Optional. The destination IP range of outgoing packets that this
8570        /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
8571        /// is IPv4.
8572        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8573        pub dest_range: std::string::String,
8574
8575        /// Required. Internet protocol versions this policy-based route applies to.
8576        /// For this version, only IPV4 is supported. IPV6 is supported in preview.
8577        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
8578
8579        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8580        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8581    }
8582
8583    impl Filter {
8584        pub fn new() -> Self {
8585            std::default::Default::default()
8586        }
8587
8588        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
8589        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8590            self.ip_protocol = v.into();
8591            self
8592        }
8593
8594        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
8595        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8596            self.src_range = v.into();
8597            self
8598        }
8599
8600        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
8601        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8602            self.dest_range = v.into();
8603            self
8604        }
8605
8606        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
8607        pub fn set_protocol_version<
8608            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
8609        >(
8610            mut self,
8611            v: T,
8612        ) -> Self {
8613            self.protocol_version = v.into();
8614            self
8615        }
8616    }
8617
8618    impl wkt::message::Message for Filter {
8619        fn typename() -> &'static str {
8620            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
8621        }
8622    }
8623
8624    /// Defines additional types related to [Filter].
8625    pub mod filter {
8626        #[allow(unused_imports)]
8627        use super::*;
8628
8629        /// The internet protocol version.
8630        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8631        pub struct ProtocolVersion(i32);
8632
8633        impl ProtocolVersion {
8634            /// Default value.
8635            pub const PROTOCOL_VERSION_UNSPECIFIED: ProtocolVersion = ProtocolVersion::new(0);
8636
8637            /// The PBR is for IPv4 internet protocol traffic.
8638            pub const IPV4: ProtocolVersion = ProtocolVersion::new(1);
8639
8640            /// Creates a new ProtocolVersion instance.
8641            pub(crate) const fn new(value: i32) -> Self {
8642                Self(value)
8643            }
8644
8645            /// Gets the enum value.
8646            pub fn value(&self) -> i32 {
8647                self.0
8648            }
8649
8650            /// Gets the enum value as a string.
8651            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8652                match self.0 {
8653                    0 => std::borrow::Cow::Borrowed("PROTOCOL_VERSION_UNSPECIFIED"),
8654                    1 => std::borrow::Cow::Borrowed("IPV4"),
8655                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8656                }
8657            }
8658
8659            /// Creates an enum value from the value name.
8660            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8661                match name {
8662                    "PROTOCOL_VERSION_UNSPECIFIED" => {
8663                        std::option::Option::Some(Self::PROTOCOL_VERSION_UNSPECIFIED)
8664                    }
8665                    "IPV4" => std::option::Option::Some(Self::IPV4),
8666                    _ => std::option::Option::None,
8667                }
8668            }
8669        }
8670
8671        impl std::convert::From<i32> for ProtocolVersion {
8672            fn from(value: i32) -> Self {
8673                Self::new(value)
8674            }
8675        }
8676
8677        impl std::default::Default for ProtocolVersion {
8678            fn default() -> Self {
8679                Self::new(0)
8680            }
8681        }
8682    }
8683
8684    /// Informational warning message.
8685    #[serde_with::serde_as]
8686    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8687    #[serde(default, rename_all = "camelCase")]
8688    #[non_exhaustive]
8689    pub struct Warnings {
8690        /// Output only. A warning code, if applicable.
8691        pub code: crate::model::policy_based_route::warnings::Code,
8692
8693        /// Output only. Metadata about this warning in key: value format. The key
8694        /// should provides more detail on the warning being returned. For example,
8695        /// for warnings where there are no results in a list request for a
8696        /// particular zone, this key might be scope and the key value might be the
8697        /// zone name. Other examples might be a key indicating a deprecated resource
8698        /// and a suggested replacement.
8699        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8700        pub data: std::collections::HashMap<std::string::String, std::string::String>,
8701
8702        /// Output only. A human-readable description of the warning code.
8703        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8704        pub warning_message: std::string::String,
8705
8706        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8707        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8708    }
8709
8710    impl Warnings {
8711        pub fn new() -> Self {
8712            std::default::Default::default()
8713        }
8714
8715        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
8716        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
8717            mut self,
8718            v: T,
8719        ) -> Self {
8720            self.code = v.into();
8721            self
8722        }
8723
8724        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
8725        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
8726            mut self,
8727            v: T,
8728        ) -> Self {
8729            self.warning_message = v.into();
8730            self
8731        }
8732
8733        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
8734        pub fn set_data<T, K, V>(mut self, v: T) -> Self
8735        where
8736            T: std::iter::IntoIterator<Item = (K, V)>,
8737            K: std::convert::Into<std::string::String>,
8738            V: std::convert::Into<std::string::String>,
8739        {
8740            use std::iter::Iterator;
8741            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8742            self
8743        }
8744    }
8745
8746    impl wkt::message::Message for Warnings {
8747        fn typename() -> &'static str {
8748            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
8749        }
8750    }
8751
8752    /// Defines additional types related to [Warnings].
8753    pub mod warnings {
8754        #[allow(unused_imports)]
8755        use super::*;
8756
8757        /// Warning code for policy-based routing. Expect to add values in the
8758        /// future.
8759        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8760        pub struct Code(i32);
8761
8762        impl Code {
8763            /// Default value.
8764            pub const WARNING_UNSPECIFIED: Code = Code::new(0);
8765
8766            /// The policy-based route is not active and functioning. Common causes are
8767            /// that the dependent network was deleted or the resource project was
8768            /// turned off.
8769            pub const RESOURCE_NOT_ACTIVE: Code = Code::new(1);
8770
8771            /// The policy-based route is being modified (e.g. created/deleted) at this
8772            /// time.
8773            pub const RESOURCE_BEING_MODIFIED: Code = Code::new(2);
8774
8775            /// Creates a new Code instance.
8776            pub(crate) const fn new(value: i32) -> Self {
8777                Self(value)
8778            }
8779
8780            /// Gets the enum value.
8781            pub fn value(&self) -> i32 {
8782                self.0
8783            }
8784
8785            /// Gets the enum value as a string.
8786            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8787                match self.0 {
8788                    0 => std::borrow::Cow::Borrowed("WARNING_UNSPECIFIED"),
8789                    1 => std::borrow::Cow::Borrowed("RESOURCE_NOT_ACTIVE"),
8790                    2 => std::borrow::Cow::Borrowed("RESOURCE_BEING_MODIFIED"),
8791                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8792                }
8793            }
8794
8795            /// Creates an enum value from the value name.
8796            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8797                match name {
8798                    "WARNING_UNSPECIFIED" => std::option::Option::Some(Self::WARNING_UNSPECIFIED),
8799                    "RESOURCE_NOT_ACTIVE" => std::option::Option::Some(Self::RESOURCE_NOT_ACTIVE),
8800                    "RESOURCE_BEING_MODIFIED" => {
8801                        std::option::Option::Some(Self::RESOURCE_BEING_MODIFIED)
8802                    }
8803                    _ => std::option::Option::None,
8804                }
8805            }
8806        }
8807
8808        impl std::convert::From<i32> for Code {
8809            fn from(value: i32) -> Self {
8810                Self::new(value)
8811            }
8812        }
8813
8814        impl std::default::Default for Code {
8815            fn default() -> Self {
8816                Self::new(0)
8817            }
8818        }
8819    }
8820
8821    /// The other routing cases.
8822    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8823    pub struct OtherRoutes(i32);
8824
8825    impl OtherRoutes {
8826        /// Default value.
8827        pub const OTHER_ROUTES_UNSPECIFIED: OtherRoutes = OtherRoutes::new(0);
8828
8829        /// Use the routes from the default routing tables (system-generated routes,
8830        /// custom routes, peering route) to determine the next hop. This effectively
8831        /// excludes matching packets being applied on other PBRs with a lower
8832        /// priority.
8833        pub const DEFAULT_ROUTING: OtherRoutes = OtherRoutes::new(1);
8834
8835        /// Creates a new OtherRoutes instance.
8836        pub(crate) const fn new(value: i32) -> Self {
8837            Self(value)
8838        }
8839
8840        /// Gets the enum value.
8841        pub fn value(&self) -> i32 {
8842            self.0
8843        }
8844
8845        /// Gets the enum value as a string.
8846        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8847            match self.0 {
8848                0 => std::borrow::Cow::Borrowed("OTHER_ROUTES_UNSPECIFIED"),
8849                1 => std::borrow::Cow::Borrowed("DEFAULT_ROUTING"),
8850                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8851            }
8852        }
8853
8854        /// Creates an enum value from the value name.
8855        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8856            match name {
8857                "OTHER_ROUTES_UNSPECIFIED" => {
8858                    std::option::Option::Some(Self::OTHER_ROUTES_UNSPECIFIED)
8859                }
8860                "DEFAULT_ROUTING" => std::option::Option::Some(Self::DEFAULT_ROUTING),
8861                _ => std::option::Option::None,
8862            }
8863        }
8864    }
8865
8866    impl std::convert::From<i32> for OtherRoutes {
8867        fn from(value: i32) -> Self {
8868            Self::new(value)
8869        }
8870    }
8871
8872    impl std::default::Default for OtherRoutes {
8873        fn default() -> Self {
8874            Self::new(0)
8875        }
8876    }
8877
8878    /// Target specifies network endpoints that this policy-based route applies to.
8879    /// If no target is specified, the PBR will be installed on all network
8880    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
8881    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8882    #[serde(rename_all = "camelCase")]
8883    #[non_exhaustive]
8884    pub enum Target {
8885        /// Optional. VM instances that this policy-based route applies to.
8886        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
8887        /// Optional. The interconnect attachments that this policy-based route
8888        /// applies to.
8889        InterconnectAttachment(
8890            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8891        ),
8892    }
8893
8894    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8895    #[serde(rename_all = "camelCase")]
8896    #[non_exhaustive]
8897    pub enum NextHop {
8898        /// Optional. The IP address of a global-access-enabled L4 ILB that is the
8899        /// next hop for matching packets. For this version, only nextHopIlbIp is
8900        /// supported.
8901        NextHopIlbIp(std::string::String),
8902        /// Optional. Other routes that will be referenced to determine the next hop
8903        /// of the packet.
8904        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
8905    }
8906}
8907
8908/// Request for
8909/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
8910/// method.
8911///
8912/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
8913#[serde_with::serde_as]
8914#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8915#[serde(default, rename_all = "camelCase")]
8916#[non_exhaustive]
8917pub struct ListPolicyBasedRoutesRequest {
8918    /// Required. The parent resource's name.
8919    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8920    pub parent: std::string::String,
8921
8922    /// The maximum number of results per page that should be returned.
8923    pub page_size: i32,
8924
8925    /// The page token.
8926    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8927    pub page_token: std::string::String,
8928
8929    /// A filter expression that filters the results listed in the response.
8930    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8931    pub filter: std::string::String,
8932
8933    /// Sort the results by a certain order.
8934    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8935    pub order_by: std::string::String,
8936
8937    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8938    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8939}
8940
8941impl ListPolicyBasedRoutesRequest {
8942    pub fn new() -> Self {
8943        std::default::Default::default()
8944    }
8945
8946    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
8947    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8948        self.parent = v.into();
8949        self
8950    }
8951
8952    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
8953    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8954        self.page_size = v.into();
8955        self
8956    }
8957
8958    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
8959    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8960        self.page_token = v.into();
8961        self
8962    }
8963
8964    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
8965    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8966        self.filter = v.into();
8967        self
8968    }
8969
8970    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
8971    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8972        self.order_by = v.into();
8973        self
8974    }
8975}
8976
8977impl wkt::message::Message for ListPolicyBasedRoutesRequest {
8978    fn typename() -> &'static str {
8979        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
8980    }
8981}
8982
8983/// Response for
8984/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
8985/// method.
8986///
8987/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
8988#[serde_with::serde_as]
8989#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8990#[serde(default, rename_all = "camelCase")]
8991#[non_exhaustive]
8992pub struct ListPolicyBasedRoutesResponse {
8993    /// Policy-based routes to be returned.
8994    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8995    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
8996
8997    /// The next pagination token in the List response. It should be used as
8998    /// page_token for the following request. An empty value means no more result.
8999    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9000    pub next_page_token: std::string::String,
9001
9002    /// Locations that could not be reached.
9003    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9004    pub unreachable: std::vec::Vec<std::string::String>,
9005
9006    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9007    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9008}
9009
9010impl ListPolicyBasedRoutesResponse {
9011    pub fn new() -> Self {
9012        std::default::Default::default()
9013    }
9014
9015    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
9016    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017        self.next_page_token = v.into();
9018        self
9019    }
9020
9021    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
9022    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
9023    where
9024        T: std::iter::IntoIterator<Item = V>,
9025        V: std::convert::Into<crate::model::PolicyBasedRoute>,
9026    {
9027        use std::iter::Iterator;
9028        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
9029        self
9030    }
9031
9032    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
9033    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9034    where
9035        T: std::iter::IntoIterator<Item = V>,
9036        V: std::convert::Into<std::string::String>,
9037    {
9038        use std::iter::Iterator;
9039        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9040        self
9041    }
9042}
9043
9044impl wkt::message::Message for ListPolicyBasedRoutesResponse {
9045    fn typename() -> &'static str {
9046        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
9047    }
9048}
9049
9050#[doc(hidden)]
9051impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
9052    type PageItem = crate::model::PolicyBasedRoute;
9053
9054    fn items(self) -> std::vec::Vec<Self::PageItem> {
9055        self.policy_based_routes
9056    }
9057
9058    fn next_page_token(&self) -> std::string::String {
9059        use std::clone::Clone;
9060        self.next_page_token.clone()
9061    }
9062}
9063
9064/// Request for
9065/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
9066/// method.
9067///
9068/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
9069#[serde_with::serde_as]
9070#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9071#[serde(default, rename_all = "camelCase")]
9072#[non_exhaustive]
9073pub struct GetPolicyBasedRouteRequest {
9074    /// Required. Name of the PolicyBasedRoute resource to get.
9075    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9076    pub name: std::string::String,
9077
9078    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9079    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9080}
9081
9082impl GetPolicyBasedRouteRequest {
9083    pub fn new() -> Self {
9084        std::default::Default::default()
9085    }
9086
9087    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
9088    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9089        self.name = v.into();
9090        self
9091    }
9092}
9093
9094impl wkt::message::Message for GetPolicyBasedRouteRequest {
9095    fn typename() -> &'static str {
9096        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
9097    }
9098}
9099
9100/// Request for
9101/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
9102/// method.
9103///
9104/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
9105#[serde_with::serde_as]
9106#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9107#[serde(default, rename_all = "camelCase")]
9108#[non_exhaustive]
9109pub struct CreatePolicyBasedRouteRequest {
9110    /// Required. The parent resource's name of the PolicyBasedRoute.
9111    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9112    pub parent: std::string::String,
9113
9114    /// Required. Unique id for the policy-based route to create. Provided by the
9115    /// client when the resource is created. The name must comply with
9116    /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
9117    /// must be 1-63 characters long and match the regular expression
9118    /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
9119    /// and all following characters (except for the last character) must be a
9120    /// dash, lowercase letter, or digit. The last character must be a lowercase
9121    /// letter or digit.
9122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9123    pub policy_based_route_id: std::string::String,
9124
9125    /// Required. Initial values for a new policy-based route.
9126    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9127    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
9128
9129    /// Optional. An optional request ID to identify requests. Specify a unique
9130    /// request ID so that if you must retry your request, the server knows to
9131    /// ignore the request if it has already been completed. The server guarantees
9132    /// that for at least 60 minutes since the first request.
9133    ///
9134    /// For example, consider a situation where you make an initial request and
9135    /// the request times out. If you make the request again with the same request
9136    /// ID, the server can check if original operation with the same request ID
9137    /// was received, and if so, ignores the second request. This prevents clients
9138    /// from accidentally creating duplicate commitments.
9139    ///
9140    /// The request ID must be a valid UUID with the exception that zero UUID is
9141    /// not supported (00000000-0000-0000-0000-000000000000).
9142    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9143    pub request_id: std::string::String,
9144
9145    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9146    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9147}
9148
9149impl CreatePolicyBasedRouteRequest {
9150    pub fn new() -> Self {
9151        std::default::Default::default()
9152    }
9153
9154    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
9155    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9156        self.parent = v.into();
9157        self
9158    }
9159
9160    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
9161    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
9162        mut self,
9163        v: T,
9164    ) -> Self {
9165        self.policy_based_route_id = v.into();
9166        self
9167    }
9168
9169    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
9170    pub fn set_policy_based_route<
9171        T: std::convert::Into<std::option::Option<crate::model::PolicyBasedRoute>>,
9172    >(
9173        mut self,
9174        v: T,
9175    ) -> Self {
9176        self.policy_based_route = v.into();
9177        self
9178    }
9179
9180    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
9181    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9182        self.request_id = v.into();
9183        self
9184    }
9185}
9186
9187impl wkt::message::Message for CreatePolicyBasedRouteRequest {
9188    fn typename() -> &'static str {
9189        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
9190    }
9191}
9192
9193/// Request for
9194/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
9195/// method.
9196///
9197/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
9198#[serde_with::serde_as]
9199#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9200#[serde(default, rename_all = "camelCase")]
9201#[non_exhaustive]
9202pub struct DeletePolicyBasedRouteRequest {
9203    /// Required. Name of the policy-based route resource to delete.
9204    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9205    pub name: std::string::String,
9206
9207    /// Optional. An optional request ID to identify requests. Specify a unique
9208    /// request ID so that if you must retry your request, the server knows to
9209    /// ignore the request if it has already been completed. The server guarantees
9210    /// that for at least 60 minutes after the first request.
9211    ///
9212    /// For example, consider a situation where you make an initial request and
9213    /// the request times out. If you make the request again with the same request
9214    /// ID, the server can check if original operation with the same request ID
9215    /// was received, and if so, ignores the second request. This prevents clients
9216    /// from accidentally creating duplicate commitments.
9217    ///
9218    /// The request ID must be a valid UUID with the exception that zero UUID is
9219    /// not supported (00000000-0000-0000-0000-000000000000).
9220    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9221    pub request_id: std::string::String,
9222
9223    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9224    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9225}
9226
9227impl DeletePolicyBasedRouteRequest {
9228    pub fn new() -> Self {
9229        std::default::Default::default()
9230    }
9231
9232    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
9233    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9234        self.name = v.into();
9235        self
9236    }
9237
9238    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
9239    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9240        self.request_id = v.into();
9241        self
9242    }
9243}
9244
9245impl wkt::message::Message for DeletePolicyBasedRouteRequest {
9246    fn typename() -> &'static str {
9247        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
9248    }
9249}
9250
9251/// The infrastructure used for connections between consumers/producers.
9252#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9253pub struct Infrastructure(i32);
9254
9255impl Infrastructure {
9256    /// An invalid infrastructure as the default case.
9257    pub const INFRASTRUCTURE_UNSPECIFIED: Infrastructure = Infrastructure::new(0);
9258
9259    /// Private Service Connect is used for connections.
9260    pub const PSC: Infrastructure = Infrastructure::new(1);
9261
9262    /// Creates a new Infrastructure instance.
9263    pub(crate) const fn new(value: i32) -> Self {
9264        Self(value)
9265    }
9266
9267    /// Gets the enum value.
9268    pub fn value(&self) -> i32 {
9269        self.0
9270    }
9271
9272    /// Gets the enum value as a string.
9273    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9274        match self.0 {
9275            0 => std::borrow::Cow::Borrowed("INFRASTRUCTURE_UNSPECIFIED"),
9276            1 => std::borrow::Cow::Borrowed("PSC"),
9277            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9278        }
9279    }
9280
9281    /// Creates an enum value from the value name.
9282    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9283        match name {
9284            "INFRASTRUCTURE_UNSPECIFIED" => {
9285                std::option::Option::Some(Self::INFRASTRUCTURE_UNSPECIFIED)
9286            }
9287            "PSC" => std::option::Option::Some(Self::PSC),
9288            _ => std::option::Option::None,
9289        }
9290    }
9291}
9292
9293impl std::convert::From<i32> for Infrastructure {
9294    fn from(value: i32) -> Self {
9295        Self::new(value)
9296    }
9297}
9298
9299impl std::default::Default for Infrastructure {
9300    fn default() -> Self {
9301        Self::new(0)
9302    }
9303}
9304
9305/// The error type indicates whether a connection error is consumer facing,
9306/// producer facing or system internal.
9307#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9308pub struct ConnectionErrorType(i32);
9309
9310impl ConnectionErrorType {
9311    /// An invalid error type as the default case.
9312    pub const CONNECTION_ERROR_TYPE_UNSPECIFIED: ConnectionErrorType = ConnectionErrorType::new(0);
9313
9314    /// The error is due to Service Automation system internal.
9315    pub const ERROR_INTERNAL: ConnectionErrorType = ConnectionErrorType::new(1);
9316
9317    /// The error is due to the setup on consumer side.
9318    pub const ERROR_CONSUMER_SIDE: ConnectionErrorType = ConnectionErrorType::new(2);
9319
9320    /// The error is due to the setup on producer side.
9321    pub const ERROR_PRODUCER_SIDE: ConnectionErrorType = ConnectionErrorType::new(3);
9322
9323    /// Creates a new ConnectionErrorType instance.
9324    pub(crate) const fn new(value: i32) -> Self {
9325        Self(value)
9326    }
9327
9328    /// Gets the enum value.
9329    pub fn value(&self) -> i32 {
9330        self.0
9331    }
9332
9333    /// Gets the enum value as a string.
9334    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9335        match self.0 {
9336            0 => std::borrow::Cow::Borrowed("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
9337            1 => std::borrow::Cow::Borrowed("ERROR_INTERNAL"),
9338            2 => std::borrow::Cow::Borrowed("ERROR_CONSUMER_SIDE"),
9339            3 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_SIDE"),
9340            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9341        }
9342    }
9343
9344    /// Creates an enum value from the value name.
9345    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9346        match name {
9347            "CONNECTION_ERROR_TYPE_UNSPECIFIED" => {
9348                std::option::Option::Some(Self::CONNECTION_ERROR_TYPE_UNSPECIFIED)
9349            }
9350            "ERROR_INTERNAL" => std::option::Option::Some(Self::ERROR_INTERNAL),
9351            "ERROR_CONSUMER_SIDE" => std::option::Option::Some(Self::ERROR_CONSUMER_SIDE),
9352            "ERROR_PRODUCER_SIDE" => std::option::Option::Some(Self::ERROR_PRODUCER_SIDE),
9353            _ => std::option::Option::None,
9354        }
9355    }
9356}
9357
9358impl std::convert::From<i32> for ConnectionErrorType {
9359    fn from(value: i32) -> Self {
9360        Self::new(value)
9361    }
9362}
9363
9364impl std::default::Default for ConnectionErrorType {
9365    fn default() -> Self {
9366        Self::new(0)
9367    }
9368}
9369
9370/// The requested IP version for the PSC connection.
9371#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9372pub struct IPVersion(i32);
9373
9374impl IPVersion {
9375    /// Default value. We will use IPv4 or IPv6 depending on the IP version of
9376    /// first available subnetwork.
9377    pub const IP_VERSION_UNSPECIFIED: IPVersion = IPVersion::new(0);
9378
9379    /// Will use IPv4 only.
9380    pub const IPV4: IPVersion = IPVersion::new(1);
9381
9382    /// Will use IPv6 only.
9383    pub const IPV6: IPVersion = IPVersion::new(2);
9384
9385    /// Creates a new IPVersion instance.
9386    pub(crate) const fn new(value: i32) -> Self {
9387        Self(value)
9388    }
9389
9390    /// Gets the enum value.
9391    pub fn value(&self) -> i32 {
9392        self.0
9393    }
9394
9395    /// Gets the enum value as a string.
9396    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9397        match self.0 {
9398            0 => std::borrow::Cow::Borrowed("IP_VERSION_UNSPECIFIED"),
9399            1 => std::borrow::Cow::Borrowed("IPV4"),
9400            2 => std::borrow::Cow::Borrowed("IPV6"),
9401            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9402        }
9403    }
9404
9405    /// Creates an enum value from the value name.
9406    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9407        match name {
9408            "IP_VERSION_UNSPECIFIED" => std::option::Option::Some(Self::IP_VERSION_UNSPECIFIED),
9409            "IPV4" => std::option::Option::Some(Self::IPV4),
9410            "IPV6" => std::option::Option::Some(Self::IPV6),
9411            _ => std::option::Option::None,
9412        }
9413    }
9414}
9415
9416impl std::convert::From<i32> for IPVersion {
9417    fn from(value: i32) -> Self {
9418        Self::new(value)
9419    }
9420}
9421
9422impl std::default::Default for IPVersion {
9423    fn default() -> Self {
9424        Self::new(0)
9425    }
9426}
9427
9428/// Supported features for a location
9429#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9430pub struct LocationFeature(i32);
9431
9432impl LocationFeature {
9433    /// No publicly supported feature in this location
9434    pub const LOCATION_FEATURE_UNSPECIFIED: LocationFeature = LocationFeature::new(0);
9435
9436    /// Site-to-cloud spokes are supported in this location
9437    pub const SITE_TO_CLOUD_SPOKES: LocationFeature = LocationFeature::new(1);
9438
9439    /// Site-to-site spokes are supported in this location
9440    pub const SITE_TO_SITE_SPOKES: LocationFeature = LocationFeature::new(2);
9441
9442    /// Creates a new LocationFeature instance.
9443    pub(crate) const fn new(value: i32) -> Self {
9444        Self(value)
9445    }
9446
9447    /// Gets the enum value.
9448    pub fn value(&self) -> i32 {
9449        self.0
9450    }
9451
9452    /// Gets the enum value as a string.
9453    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9454        match self.0 {
9455            0 => std::borrow::Cow::Borrowed("LOCATION_FEATURE_UNSPECIFIED"),
9456            1 => std::borrow::Cow::Borrowed("SITE_TO_CLOUD_SPOKES"),
9457            2 => std::borrow::Cow::Borrowed("SITE_TO_SITE_SPOKES"),
9458            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9459        }
9460    }
9461
9462    /// Creates an enum value from the value name.
9463    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9464        match name {
9465            "LOCATION_FEATURE_UNSPECIFIED" => {
9466                std::option::Option::Some(Self::LOCATION_FEATURE_UNSPECIFIED)
9467            }
9468            "SITE_TO_CLOUD_SPOKES" => std::option::Option::Some(Self::SITE_TO_CLOUD_SPOKES),
9469            "SITE_TO_SITE_SPOKES" => std::option::Option::Some(Self::SITE_TO_SITE_SPOKES),
9470            _ => std::option::Option::None,
9471        }
9472    }
9473}
9474
9475impl std::convert::From<i32> for LocationFeature {
9476    fn from(value: i32) -> Self {
9477        Self::new(value)
9478    }
9479}
9480
9481impl std::default::Default for LocationFeature {
9482    fn default() -> Self {
9483        Self::new(0)
9484    }
9485}
9486
9487/// The route's type
9488#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9489pub struct RouteType(i32);
9490
9491impl RouteType {
9492    /// No route type information specified
9493    pub const ROUTE_TYPE_UNSPECIFIED: RouteType = RouteType::new(0);
9494
9495    /// The route leads to a destination within the primary address range of the
9496    /// VPC network's subnet.
9497    pub const VPC_PRIMARY_SUBNET: RouteType = RouteType::new(1);
9498
9499    /// The route leads to a destination within the secondary address range of the
9500    /// VPC network's subnet.
9501    pub const VPC_SECONDARY_SUBNET: RouteType = RouteType::new(2);
9502
9503    /// The route leads to a destination in a dynamic route. Dynamic routes are
9504    /// derived from Border Gateway Protocol (BGP) advertisements received from an
9505    /// NCC hybrid spoke.
9506    pub const DYNAMIC_ROUTE: RouteType = RouteType::new(3);
9507
9508    /// Creates a new RouteType instance.
9509    pub(crate) const fn new(value: i32) -> Self {
9510        Self(value)
9511    }
9512
9513    /// Gets the enum value.
9514    pub fn value(&self) -> i32 {
9515        self.0
9516    }
9517
9518    /// Gets the enum value as a string.
9519    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9520        match self.0 {
9521            0 => std::borrow::Cow::Borrowed("ROUTE_TYPE_UNSPECIFIED"),
9522            1 => std::borrow::Cow::Borrowed("VPC_PRIMARY_SUBNET"),
9523            2 => std::borrow::Cow::Borrowed("VPC_SECONDARY_SUBNET"),
9524            3 => std::borrow::Cow::Borrowed("DYNAMIC_ROUTE"),
9525            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9526        }
9527    }
9528
9529    /// Creates an enum value from the value name.
9530    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9531        match name {
9532            "ROUTE_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::ROUTE_TYPE_UNSPECIFIED),
9533            "VPC_PRIMARY_SUBNET" => std::option::Option::Some(Self::VPC_PRIMARY_SUBNET),
9534            "VPC_SECONDARY_SUBNET" => std::option::Option::Some(Self::VPC_SECONDARY_SUBNET),
9535            "DYNAMIC_ROUTE" => std::option::Option::Some(Self::DYNAMIC_ROUTE),
9536            _ => std::option::Option::None,
9537        }
9538    }
9539}
9540
9541impl std::convert::From<i32> for RouteType {
9542    fn from(value: i32) -> Self {
9543        Self::new(value)
9544    }
9545}
9546
9547impl std::default::Default for RouteType {
9548    fn default() -> Self {
9549        Self::new(0)
9550    }
9551}
9552
9553/// The State enum represents the lifecycle stage of a Network Connectivity
9554/// Center resource.
9555#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9556pub struct State(i32);
9557
9558impl State {
9559    /// No state information available
9560    pub const STATE_UNSPECIFIED: State = State::new(0);
9561
9562    /// The resource's create operation is in progress.
9563    pub const CREATING: State = State::new(1);
9564
9565    /// The resource is active
9566    pub const ACTIVE: State = State::new(2);
9567
9568    /// The resource's delete operation is in progress.
9569    pub const DELETING: State = State::new(3);
9570
9571    /// The resource's accept operation is in progress.
9572    pub const ACCEPTING: State = State::new(8);
9573
9574    /// The resource's reject operation is in progress.
9575    pub const REJECTING: State = State::new(9);
9576
9577    /// The resource's update operation is in progress.
9578    pub const UPDATING: State = State::new(6);
9579
9580    /// The resource is inactive.
9581    pub const INACTIVE: State = State::new(7);
9582
9583    /// The hub associated with this spoke resource has been deleted.
9584    /// This state applies to spoke resources only.
9585    pub const OBSOLETE: State = State::new(10);
9586
9587    /// The resource is in an undefined state due to resource creation or deletion
9588    /// failure. You can try to delete the resource later or contact support for
9589    /// help.
9590    pub const FAILED: State = State::new(11);
9591
9592    /// Creates a new State instance.
9593    pub(crate) const fn new(value: i32) -> Self {
9594        Self(value)
9595    }
9596
9597    /// Gets the enum value.
9598    pub fn value(&self) -> i32 {
9599        self.0
9600    }
9601
9602    /// Gets the enum value as a string.
9603    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9604        match self.0 {
9605            0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
9606            1 => std::borrow::Cow::Borrowed("CREATING"),
9607            2 => std::borrow::Cow::Borrowed("ACTIVE"),
9608            3 => std::borrow::Cow::Borrowed("DELETING"),
9609            6 => std::borrow::Cow::Borrowed("UPDATING"),
9610            7 => std::borrow::Cow::Borrowed("INACTIVE"),
9611            8 => std::borrow::Cow::Borrowed("ACCEPTING"),
9612            9 => std::borrow::Cow::Borrowed("REJECTING"),
9613            10 => std::borrow::Cow::Borrowed("OBSOLETE"),
9614            11 => std::borrow::Cow::Borrowed("FAILED"),
9615            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9616        }
9617    }
9618
9619    /// Creates an enum value from the value name.
9620    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9621        match name {
9622            "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
9623            "CREATING" => std::option::Option::Some(Self::CREATING),
9624            "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
9625            "DELETING" => std::option::Option::Some(Self::DELETING),
9626            "ACCEPTING" => std::option::Option::Some(Self::ACCEPTING),
9627            "REJECTING" => std::option::Option::Some(Self::REJECTING),
9628            "UPDATING" => std::option::Option::Some(Self::UPDATING),
9629            "INACTIVE" => std::option::Option::Some(Self::INACTIVE),
9630            "OBSOLETE" => std::option::Option::Some(Self::OBSOLETE),
9631            "FAILED" => std::option::Option::Some(Self::FAILED),
9632            _ => std::option::Option::None,
9633        }
9634    }
9635}
9636
9637impl std::convert::From<i32> for State {
9638    fn from(value: i32) -> Self {
9639        Self::new(value)
9640    }
9641}
9642
9643impl std::default::Default for State {
9644    fn default() -> Self {
9645        Self::new(0)
9646    }
9647}
9648
9649/// The SpokeType enum represents the type of spoke. The type
9650/// reflects the kind of resource that a spoke is associated with.
9651#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9652pub struct SpokeType(i32);
9653
9654impl SpokeType {
9655    /// Unspecified spoke type.
9656    pub const SPOKE_TYPE_UNSPECIFIED: SpokeType = SpokeType::new(0);
9657
9658    /// Spokes associated with VPN tunnels.
9659    pub const VPN_TUNNEL: SpokeType = SpokeType::new(1);
9660
9661    /// Spokes associated with VLAN attachments.
9662    pub const INTERCONNECT_ATTACHMENT: SpokeType = SpokeType::new(2);
9663
9664    /// Spokes associated with router appliance instances.
9665    pub const ROUTER_APPLIANCE: SpokeType = SpokeType::new(3);
9666
9667    /// Spokes associated with VPC networks.
9668    pub const VPC_NETWORK: SpokeType = SpokeType::new(4);
9669
9670    /// Spokes that are backed by a producer VPC network.
9671    pub const PRODUCER_VPC_NETWORK: SpokeType = SpokeType::new(7);
9672
9673    /// Creates a new SpokeType instance.
9674    pub(crate) const fn new(value: i32) -> Self {
9675        Self(value)
9676    }
9677
9678    /// Gets the enum value.
9679    pub fn value(&self) -> i32 {
9680        self.0
9681    }
9682
9683    /// Gets the enum value as a string.
9684    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9685        match self.0 {
9686            0 => std::borrow::Cow::Borrowed("SPOKE_TYPE_UNSPECIFIED"),
9687            1 => std::borrow::Cow::Borrowed("VPN_TUNNEL"),
9688            2 => std::borrow::Cow::Borrowed("INTERCONNECT_ATTACHMENT"),
9689            3 => std::borrow::Cow::Borrowed("ROUTER_APPLIANCE"),
9690            4 => std::borrow::Cow::Borrowed("VPC_NETWORK"),
9691            7 => std::borrow::Cow::Borrowed("PRODUCER_VPC_NETWORK"),
9692            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9693        }
9694    }
9695
9696    /// Creates an enum value from the value name.
9697    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9698        match name {
9699            "SPOKE_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::SPOKE_TYPE_UNSPECIFIED),
9700            "VPN_TUNNEL" => std::option::Option::Some(Self::VPN_TUNNEL),
9701            "INTERCONNECT_ATTACHMENT" => std::option::Option::Some(Self::INTERCONNECT_ATTACHMENT),
9702            "ROUTER_APPLIANCE" => std::option::Option::Some(Self::ROUTER_APPLIANCE),
9703            "VPC_NETWORK" => std::option::Option::Some(Self::VPC_NETWORK),
9704            "PRODUCER_VPC_NETWORK" => std::option::Option::Some(Self::PRODUCER_VPC_NETWORK),
9705            _ => std::option::Option::None,
9706        }
9707    }
9708}
9709
9710impl std::convert::From<i32> for SpokeType {
9711    fn from(value: i32) -> Self {
9712        Self::new(value)
9713    }
9714}
9715
9716impl std::default::Default for SpokeType {
9717    fn default() -> Self {
9718        Self::new(0)
9719    }
9720}
9721
9722/// This enum controls the policy mode used in a hub.
9723#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9724pub struct PolicyMode(i32);
9725
9726impl PolicyMode {
9727    /// Policy mode is unspecified. It defaults to PRESET
9728    /// with preset_topology = MESH.
9729    pub const POLICY_MODE_UNSPECIFIED: PolicyMode = PolicyMode::new(0);
9730
9731    /// Hub uses one of the preset topologies.
9732    pub const PRESET: PolicyMode = PolicyMode::new(1);
9733
9734    /// Creates a new PolicyMode instance.
9735    pub(crate) const fn new(value: i32) -> Self {
9736        Self(value)
9737    }
9738
9739    /// Gets the enum value.
9740    pub fn value(&self) -> i32 {
9741        self.0
9742    }
9743
9744    /// Gets the enum value as a string.
9745    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9746        match self.0 {
9747            0 => std::borrow::Cow::Borrowed("POLICY_MODE_UNSPECIFIED"),
9748            1 => std::borrow::Cow::Borrowed("PRESET"),
9749            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9750        }
9751    }
9752
9753    /// Creates an enum value from the value name.
9754    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9755        match name {
9756            "POLICY_MODE_UNSPECIFIED" => std::option::Option::Some(Self::POLICY_MODE_UNSPECIFIED),
9757            "PRESET" => std::option::Option::Some(Self::PRESET),
9758            _ => std::option::Option::None,
9759        }
9760    }
9761}
9762
9763impl std::convert::From<i32> for PolicyMode {
9764    fn from(value: i32) -> Self {
9765        Self::new(value)
9766    }
9767}
9768
9769impl std::default::Default for PolicyMode {
9770    fn default() -> Self {
9771        Self::new(0)
9772    }
9773}
9774
9775/// The list of available preset topologies.
9776#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9777pub struct PresetTopology(i32);
9778
9779impl PresetTopology {
9780    /// Preset topology is unspecified. When policy_mode = PRESET,
9781    /// it defaults to MESH.
9782    pub const PRESET_TOPOLOGY_UNSPECIFIED: PresetTopology = PresetTopology::new(0);
9783
9784    /// Mesh topology is implemented. Group `default` is automatically created.
9785    /// All spokes in the hub are added to group `default`.
9786    pub const MESH: PresetTopology = PresetTopology::new(2);
9787
9788    /// Star topology is implemented. Two groups, `center` and `edge`, are
9789    /// automatically created along with hub creation. Spokes have to join one of
9790    /// the groups during creation.
9791    pub const STAR: PresetTopology = PresetTopology::new(3);
9792
9793    /// Creates a new PresetTopology instance.
9794    pub(crate) const fn new(value: i32) -> Self {
9795        Self(value)
9796    }
9797
9798    /// Gets the enum value.
9799    pub fn value(&self) -> i32 {
9800        self.0
9801    }
9802
9803    /// Gets the enum value as a string.
9804    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9805        match self.0 {
9806            0 => std::borrow::Cow::Borrowed("PRESET_TOPOLOGY_UNSPECIFIED"),
9807            2 => std::borrow::Cow::Borrowed("MESH"),
9808            3 => std::borrow::Cow::Borrowed("STAR"),
9809            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9810        }
9811    }
9812
9813    /// Creates an enum value from the value name.
9814    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9815        match name {
9816            "PRESET_TOPOLOGY_UNSPECIFIED" => {
9817                std::option::Option::Some(Self::PRESET_TOPOLOGY_UNSPECIFIED)
9818            }
9819            "MESH" => std::option::Option::Some(Self::MESH),
9820            "STAR" => std::option::Option::Some(Self::STAR),
9821            _ => std::option::Option::None,
9822        }
9823    }
9824}
9825
9826impl std::convert::From<i32> for PresetTopology {
9827    fn from(value: i32) -> Self {
9828        Self::new(value)
9829    }
9830}
9831
9832impl std::default::Default for PresetTopology {
9833    fn default() -> Self {
9834        Self::new(0)
9835    }
9836}