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 iam_v1;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// Represents the metadata of the long-running operation.
37#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct OperationMetadata {
42    /// Output only. The time the operation was created.
43    #[serde(skip_serializing_if = "std::option::Option::is_none")]
44    pub create_time: std::option::Option<wkt::Timestamp>,
45
46    /// Output only. The time the operation finished running.
47    #[serde(skip_serializing_if = "std::option::Option::is_none")]
48    pub end_time: std::option::Option<wkt::Timestamp>,
49
50    /// Output only. Server-defined resource path for the target of the operation.
51    #[serde(skip_serializing_if = "std::string::String::is_empty")]
52    pub target: std::string::String,
53
54    /// Output only. Name of the verb executed by the operation.
55    #[serde(skip_serializing_if = "std::string::String::is_empty")]
56    pub verb: std::string::String,
57
58    /// Output only. Human-readable status of the operation, if any.
59    #[serde(skip_serializing_if = "std::string::String::is_empty")]
60    pub status_message: std::string::String,
61
62    /// Output only. Identifies whether the user has requested cancellation
63    /// of the operation. Operations that have been cancelled successfully
64    /// have [Operation.error][] value with a
65    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
66    /// `Code.CANCELLED`.
67    ///
68    /// [google.rpc.Status.code]: rpc::model::Status::code
69    pub requested_cancellation: bool,
70
71    /// Output only. API version used to start the operation.
72    #[serde(skip_serializing_if = "std::string::String::is_empty")]
73    pub api_version: std::string::String,
74}
75
76impl OperationMetadata {
77    pub fn new() -> Self {
78        std::default::Default::default()
79    }
80
81    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
82    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
83        mut self,
84        v: T,
85    ) -> Self {
86        self.create_time = v.into();
87        self
88    }
89
90    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
91    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
92        mut self,
93        v: T,
94    ) -> Self {
95        self.end_time = v.into();
96        self
97    }
98
99    /// Sets the value of [target][crate::model::OperationMetadata::target].
100    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
101        self.target = v.into();
102        self
103    }
104
105    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
106    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
107        self.verb = v.into();
108        self
109    }
110
111    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
112    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
113        self.status_message = v.into();
114        self
115    }
116
117    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
118    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
119        self.requested_cancellation = v.into();
120        self
121    }
122
123    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
124    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
125        self.api_version = v.into();
126        self
127    }
128}
129
130impl wkt::message::Message for OperationMetadata {
131    fn typename() -> &'static str {
132        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
133    }
134}
135
136/// A Network Connectivity Center hub is a global management resource to which
137/// you attach spokes. A single hub can contain spokes from multiple regions.
138/// However, if any of a hub's spokes use the site-to-site data transfer feature,
139/// the resources associated with those spokes must all be in the same VPC
140/// network. Spokes that do not use site-to-site data transfer can be associated
141/// with any VPC network in your project.
142#[serde_with::serde_as]
143#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
144#[serde(default, rename_all = "camelCase")]
145#[non_exhaustive]
146pub struct Hub {
147    /// Immutable. The name of the hub. Hub names must be unique. They use the
148    /// following form:
149    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
151    pub name: std::string::String,
152
153    /// Output only. The time the hub was created.
154    #[serde(skip_serializing_if = "std::option::Option::is_none")]
155    pub create_time: std::option::Option<wkt::Timestamp>,
156
157    /// Output only. The time the hub was last updated.
158    #[serde(skip_serializing_if = "std::option::Option::is_none")]
159    pub update_time: std::option::Option<wkt::Timestamp>,
160
161    /// Optional labels in key-value pair format. For more information about
162    /// labels, see [Requirements for
163    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
164    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
165    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
166
167    /// An optional description of the hub.
168    #[serde(skip_serializing_if = "std::string::String::is_empty")]
169    pub description: std::string::String,
170
171    /// Output only. The Google-generated UUID for the hub. This value is unique
172    /// across all hub resources. If a hub is deleted and another with the same
173    /// name is created, the new hub is assigned a different unique_id.
174    #[serde(skip_serializing_if = "std::string::String::is_empty")]
175    pub unique_id: std::string::String,
176
177    /// Output only. The current lifecycle state of this hub.
178    pub state: crate::model::State,
179
180    /// The VPC networks associated with this hub's spokes.
181    ///
182    /// This field is read-only. Network Connectivity Center automatically
183    /// populates it based on the set of spokes attached to the hub.
184    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
185    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
186
187    /// Output only. The route tables that belong to this hub. They use the
188    /// following form:
189    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
190    ///
191    /// This field is read-only. Network Connectivity Center automatically
192    /// populates it based on the route tables nested under the hub.
193    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
194    pub route_tables: std::vec::Vec<std::string::String>,
195
196    /// Output only. A summary of the spokes associated with a hub. The
197    /// summary includes a count of spokes according to type
198    /// and according to state. If any spokes are inactive,
199    /// the summary also lists the reasons they are inactive,
200    /// including a count for each reason.
201    #[serde(skip_serializing_if = "std::option::Option::is_none")]
202    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
203
204    /// Optional. The policy mode of this hub. This field can be either
205    /// PRESET or CUSTOM. If unspecified, the
206    /// policy_mode defaults to PRESET.
207    pub policy_mode: crate::model::PolicyMode,
208
209    /// Optional. The topology implemented in this hub. Currently, this field is
210    /// only used when policy_mode = PRESET. The available preset topologies are
211    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
212    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
213    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
214    pub preset_topology: crate::model::PresetTopology,
215
216    /// Optional. Whether Private Service Connect transitivity is enabled for the
217    /// hub. If true, Private Service Connect endpoints in VPC spokes attached to
218    /// the hub are made accessible to other VPC spokes attached to the hub.
219    /// The default value is false.
220    #[serde(skip_serializing_if = "std::option::Option::is_none")]
221    pub export_psc: std::option::Option<bool>,
222}
223
224impl Hub {
225    pub fn new() -> Self {
226        std::default::Default::default()
227    }
228
229    /// Sets the value of [name][crate::model::Hub::name].
230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
231        self.name = v.into();
232        self
233    }
234
235    /// Sets the value of [create_time][crate::model::Hub::create_time].
236    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
237        mut self,
238        v: T,
239    ) -> Self {
240        self.create_time = v.into();
241        self
242    }
243
244    /// Sets the value of [update_time][crate::model::Hub::update_time].
245    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
246        mut self,
247        v: T,
248    ) -> Self {
249        self.update_time = v.into();
250        self
251    }
252
253    /// Sets the value of [description][crate::model::Hub::description].
254    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
255        self.description = v.into();
256        self
257    }
258
259    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
260    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
261        self.unique_id = v.into();
262        self
263    }
264
265    /// Sets the value of [state][crate::model::Hub::state].
266    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
267        self.state = v.into();
268        self
269    }
270
271    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
272    pub fn set_spoke_summary<
273        T: std::convert::Into<std::option::Option<crate::model::SpokeSummary>>,
274    >(
275        mut self,
276        v: T,
277    ) -> Self {
278        self.spoke_summary = v.into();
279        self
280    }
281
282    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
283    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
284        mut self,
285        v: T,
286    ) -> Self {
287        self.policy_mode = v.into();
288        self
289    }
290
291    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
292    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
293        mut self,
294        v: T,
295    ) -> Self {
296        self.preset_topology = v.into();
297        self
298    }
299
300    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
301    pub fn set_export_psc<T: std::convert::Into<std::option::Option<bool>>>(
302        mut self,
303        v: T,
304    ) -> Self {
305        self.export_psc = v.into();
306        self
307    }
308
309    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
310    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
311    where
312        T: std::iter::IntoIterator<Item = V>,
313        V: std::convert::Into<crate::model::RoutingVPC>,
314    {
315        use std::iter::Iterator;
316        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
317        self
318    }
319
320    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
321    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
322    where
323        T: std::iter::IntoIterator<Item = V>,
324        V: std::convert::Into<std::string::String>,
325    {
326        use std::iter::Iterator;
327        self.route_tables = v.into_iter().map(|i| i.into()).collect();
328        self
329    }
330
331    /// Sets the value of [labels][crate::model::Hub::labels].
332    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
333    where
334        T: std::iter::IntoIterator<Item = (K, V)>,
335        K: std::convert::Into<std::string::String>,
336        V: std::convert::Into<std::string::String>,
337    {
338        use std::iter::Iterator;
339        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
340        self
341    }
342}
343
344impl wkt::message::Message for Hub {
345    fn typename() -> &'static str {
346        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
347    }
348}
349
350/// RoutingVPC contains information about the VPC networks associated
351/// with the spokes of a Network Connectivity Center hub.
352#[serde_with::serde_as]
353#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
354#[serde(default, rename_all = "camelCase")]
355#[non_exhaustive]
356pub struct RoutingVPC {
357    /// The URI of the VPC network.
358    #[serde(skip_serializing_if = "std::string::String::is_empty")]
359    pub uri: std::string::String,
360
361    /// Output only. If true, indicates that this VPC network is currently
362    /// associated with spokes that use the data transfer feature (spokes where the
363    /// site_to_site_data_transfer field is set to true). If you create new spokes
364    /// that use data transfer, they must be associated with this VPC network. At
365    /// most, one VPC network will have this field set to true.
366    pub required_for_new_site_to_site_data_transfer_spokes: bool,
367}
368
369impl RoutingVPC {
370    pub fn new() -> Self {
371        std::default::Default::default()
372    }
373
374    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
375    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
376        self.uri = v.into();
377        self
378    }
379
380    /// 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].
381    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
382        mut self,
383        v: T,
384    ) -> Self {
385        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
386        self
387    }
388}
389
390impl wkt::message::Message for RoutingVPC {
391    fn typename() -> &'static str {
392        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
393    }
394}
395
396/// A Network Connectivity Center spoke represents one or more network
397/// connectivity resources.
398///
399/// When you create a spoke, you associate it with a hub. You must also
400/// identify a value for exactly one of the following fields:
401///
402/// * linked_vpn_tunnels
403/// * linked_interconnect_attachments
404/// * linked_router_appliance_instances
405/// * linked_vpc_network
406#[serde_with::serde_as]
407#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
408#[serde(default, rename_all = "camelCase")]
409#[non_exhaustive]
410pub struct Spoke {
411    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
412    /// following form:
413    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
414    #[serde(skip_serializing_if = "std::string::String::is_empty")]
415    pub name: std::string::String,
416
417    /// Output only. The time the spoke was created.
418    #[serde(skip_serializing_if = "std::option::Option::is_none")]
419    pub create_time: std::option::Option<wkt::Timestamp>,
420
421    /// Output only. The time the spoke was last updated.
422    #[serde(skip_serializing_if = "std::option::Option::is_none")]
423    pub update_time: std::option::Option<wkt::Timestamp>,
424
425    /// Optional labels in key-value pair format. For more information about
426    /// labels, see [Requirements for
427    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
428    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
429    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
430
431    /// An optional description of the spoke.
432    #[serde(skip_serializing_if = "std::string::String::is_empty")]
433    pub description: std::string::String,
434
435    /// Immutable. The name of the hub that this spoke is attached to.
436    #[serde(skip_serializing_if = "std::string::String::is_empty")]
437    pub hub: std::string::String,
438
439    /// Optional. The name of the group that this spoke is associated with.
440    #[serde(skip_serializing_if = "std::string::String::is_empty")]
441    pub group: std::string::String,
442
443    /// VPN tunnels that are associated with the spoke.
444    #[serde(skip_serializing_if = "std::option::Option::is_none")]
445    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
446
447    /// VLAN attachments that are associated with the spoke.
448    #[serde(skip_serializing_if = "std::option::Option::is_none")]
449    pub linked_interconnect_attachments:
450        std::option::Option<crate::model::LinkedInterconnectAttachments>,
451
452    /// Router appliance instances that are associated with the spoke.
453    #[serde(skip_serializing_if = "std::option::Option::is_none")]
454    pub linked_router_appliance_instances:
455        std::option::Option<crate::model::LinkedRouterApplianceInstances>,
456
457    /// Optional. VPC network that is associated with the spoke.
458    #[serde(skip_serializing_if = "std::option::Option::is_none")]
459    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
460
461    /// Optional. The linked producer VPC that is associated with the spoke.
462    #[serde(skip_serializing_if = "std::option::Option::is_none")]
463    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
464
465    /// Output only. The Google-generated UUID for the spoke. This value is unique
466    /// across all spoke resources. If a spoke is deleted and another with the same
467    /// name is created, the new spoke is assigned a different `unique_id`.
468    #[serde(skip_serializing_if = "std::string::String::is_empty")]
469    pub unique_id: std::string::String,
470
471    /// Output only. The current lifecycle state of this spoke.
472    pub state: crate::model::State,
473
474    /// Output only. The reasons for current state of the spoke. Only present when
475    /// the spoke is in the `INACTIVE` state.
476    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
477    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
478
479    /// Output only. The type of resource associated with the spoke.
480    pub spoke_type: crate::model::SpokeType,
481}
482
483impl Spoke {
484    pub fn new() -> Self {
485        std::default::Default::default()
486    }
487
488    /// Sets the value of [name][crate::model::Spoke::name].
489    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
490        self.name = v.into();
491        self
492    }
493
494    /// Sets the value of [create_time][crate::model::Spoke::create_time].
495    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
496        mut self,
497        v: T,
498    ) -> Self {
499        self.create_time = v.into();
500        self
501    }
502
503    /// Sets the value of [update_time][crate::model::Spoke::update_time].
504    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
505        mut self,
506        v: T,
507    ) -> Self {
508        self.update_time = v.into();
509        self
510    }
511
512    /// Sets the value of [description][crate::model::Spoke::description].
513    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
514        self.description = v.into();
515        self
516    }
517
518    /// Sets the value of [hub][crate::model::Spoke::hub].
519    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520        self.hub = v.into();
521        self
522    }
523
524    /// Sets the value of [group][crate::model::Spoke::group].
525    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
526        self.group = v.into();
527        self
528    }
529
530    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
531    pub fn set_linked_vpn_tunnels<
532        T: std::convert::Into<std::option::Option<crate::model::LinkedVpnTunnels>>,
533    >(
534        mut self,
535        v: T,
536    ) -> Self {
537        self.linked_vpn_tunnels = v.into();
538        self
539    }
540
541    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
542    pub fn set_linked_interconnect_attachments<
543        T: std::convert::Into<std::option::Option<crate::model::LinkedInterconnectAttachments>>,
544    >(
545        mut self,
546        v: T,
547    ) -> Self {
548        self.linked_interconnect_attachments = v.into();
549        self
550    }
551
552    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
553    pub fn set_linked_router_appliance_instances<
554        T: std::convert::Into<std::option::Option<crate::model::LinkedRouterApplianceInstances>>,
555    >(
556        mut self,
557        v: T,
558    ) -> Self {
559        self.linked_router_appliance_instances = v.into();
560        self
561    }
562
563    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
564    pub fn set_linked_vpc_network<
565        T: std::convert::Into<std::option::Option<crate::model::LinkedVpcNetwork>>,
566    >(
567        mut self,
568        v: T,
569    ) -> Self {
570        self.linked_vpc_network = v.into();
571        self
572    }
573
574    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
575    pub fn set_linked_producer_vpc_network<
576        T: std::convert::Into<std::option::Option<crate::model::LinkedProducerVpcNetwork>>,
577    >(
578        mut self,
579        v: T,
580    ) -> Self {
581        self.linked_producer_vpc_network = v.into();
582        self
583    }
584
585    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
586    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
587        self.unique_id = v.into();
588        self
589    }
590
591    /// Sets the value of [state][crate::model::Spoke::state].
592    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
593        self.state = v.into();
594        self
595    }
596
597    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
598    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
599        self.spoke_type = v.into();
600        self
601    }
602
603    /// Sets the value of [reasons][crate::model::Spoke::reasons].
604    pub fn set_reasons<T, V>(mut self, v: T) -> Self
605    where
606        T: std::iter::IntoIterator<Item = V>,
607        V: std::convert::Into<crate::model::spoke::StateReason>,
608    {
609        use std::iter::Iterator;
610        self.reasons = v.into_iter().map(|i| i.into()).collect();
611        self
612    }
613
614    /// Sets the value of [labels][crate::model::Spoke::labels].
615    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
616    where
617        T: std::iter::IntoIterator<Item = (K, V)>,
618        K: std::convert::Into<std::string::String>,
619        V: std::convert::Into<std::string::String>,
620    {
621        use std::iter::Iterator;
622        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
623        self
624    }
625}
626
627impl wkt::message::Message for Spoke {
628    fn typename() -> &'static str {
629        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
630    }
631}
632
633/// Defines additional types related to Spoke
634pub mod spoke {
635    #[allow(unused_imports)]
636    use super::*;
637
638    /// The reason a spoke is inactive.
639    #[serde_with::serde_as]
640    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
641    #[serde(default, rename_all = "camelCase")]
642    #[non_exhaustive]
643    pub struct StateReason {
644        /// The code associated with this reason.
645        pub code: crate::model::spoke::state_reason::Code,
646
647        /// Human-readable details about this reason.
648        #[serde(skip_serializing_if = "std::string::String::is_empty")]
649        pub message: std::string::String,
650
651        /// Additional information provided by the user in the RejectSpoke call.
652        #[serde(skip_serializing_if = "std::string::String::is_empty")]
653        pub user_details: std::string::String,
654    }
655
656    impl StateReason {
657        pub fn new() -> Self {
658            std::default::Default::default()
659        }
660
661        /// Sets the value of [code][crate::model::spoke::StateReason::code].
662        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
663            mut self,
664            v: T,
665        ) -> Self {
666            self.code = v.into();
667            self
668        }
669
670        /// Sets the value of [message][crate::model::spoke::StateReason::message].
671        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672            self.message = v.into();
673            self
674        }
675
676        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
677        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
678            mut self,
679            v: T,
680        ) -> Self {
681            self.user_details = v.into();
682            self
683        }
684    }
685
686    impl wkt::message::Message for StateReason {
687        fn typename() -> &'static str {
688            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
689        }
690    }
691
692    /// Defines additional types related to StateReason
693    pub mod state_reason {
694        #[allow(unused_imports)]
695        use super::*;
696
697        /// The Code enum represents the various reasons a state can be `INACTIVE`.
698        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
699        pub struct Code(std::borrow::Cow<'static, str>);
700
701        impl Code {
702            /// Creates a new Code instance.
703            pub const fn new(v: &'static str) -> Self {
704                Self(std::borrow::Cow::Borrowed(v))
705            }
706
707            /// Gets the enum value.
708            pub fn value(&self) -> &str {
709                &self.0
710            }
711        }
712
713        /// Useful constants to work with [Code](Code)
714        pub mod code {
715            use super::Code;
716
717            /// No information available.
718            pub const CODE_UNSPECIFIED: Code = Code::new("CODE_UNSPECIFIED");
719
720            /// The proposed spoke is pending review.
721            pub const PENDING_REVIEW: Code = Code::new("PENDING_REVIEW");
722
723            /// The proposed spoke has been rejected by the hub administrator.
724            pub const REJECTED: Code = Code::new("REJECTED");
725
726            /// The spoke has been deactivated internally.
727            pub const PAUSED: Code = Code::new("PAUSED");
728
729            /// Network Connectivity Center encountered errors while accepting
730            /// the spoke.
731            pub const FAILED: Code = Code::new("FAILED");
732        }
733
734        impl std::convert::From<std::string::String> for Code {
735            fn from(value: std::string::String) -> Self {
736                Self(std::borrow::Cow::Owned(value))
737            }
738        }
739    }
740}
741
742#[serde_with::serde_as]
743#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
744#[serde(default, rename_all = "camelCase")]
745#[non_exhaustive]
746pub struct RouteTable {
747    /// Immutable. The name of the route table. Route table names must be unique.
748    /// They use the following form:
749    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
750    #[serde(skip_serializing_if = "std::string::String::is_empty")]
751    pub name: std::string::String,
752
753    /// Output only. The time the route table was created.
754    #[serde(skip_serializing_if = "std::option::Option::is_none")]
755    pub create_time: std::option::Option<wkt::Timestamp>,
756
757    /// Output only. The time the route table was last updated.
758    #[serde(skip_serializing_if = "std::option::Option::is_none")]
759    pub update_time: std::option::Option<wkt::Timestamp>,
760
761    /// Optional labels in key-value pair format. For more information about
762    /// labels, see [Requirements for
763    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
764    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
765    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
766
767    /// An optional description of the route table.
768    #[serde(skip_serializing_if = "std::string::String::is_empty")]
769    pub description: std::string::String,
770
771    /// Output only. The Google-generated UUID for the route table. This value is
772    /// unique across all route table resources. If a route table is deleted and
773    /// another with the same name is created, the new route table is assigned
774    /// a different `uid`.
775    #[serde(skip_serializing_if = "std::string::String::is_empty")]
776    pub uid: std::string::String,
777
778    /// Output only. The current lifecycle state of this route table.
779    pub state: crate::model::State,
780}
781
782impl RouteTable {
783    pub fn new() -> Self {
784        std::default::Default::default()
785    }
786
787    /// Sets the value of [name][crate::model::RouteTable::name].
788    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
789        self.name = v.into();
790        self
791    }
792
793    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
794    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
795        mut self,
796        v: T,
797    ) -> Self {
798        self.create_time = v.into();
799        self
800    }
801
802    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
803    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
804        mut self,
805        v: T,
806    ) -> Self {
807        self.update_time = v.into();
808        self
809    }
810
811    /// Sets the value of [description][crate::model::RouteTable::description].
812    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
813        self.description = v.into();
814        self
815    }
816
817    /// Sets the value of [uid][crate::model::RouteTable::uid].
818    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
819        self.uid = v.into();
820        self
821    }
822
823    /// Sets the value of [state][crate::model::RouteTable::state].
824    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
825        self.state = v.into();
826        self
827    }
828
829    /// Sets the value of [labels][crate::model::RouteTable::labels].
830    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
831    where
832        T: std::iter::IntoIterator<Item = (K, V)>,
833        K: std::convert::Into<std::string::String>,
834        V: std::convert::Into<std::string::String>,
835    {
836        use std::iter::Iterator;
837        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
838        self
839    }
840}
841
842impl wkt::message::Message for RouteTable {
843    fn typename() -> &'static str {
844        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
845    }
846}
847
848/// A route defines a path from VM instances within a spoke to a specific
849/// destination resource. Only VPC spokes have routes.
850#[serde_with::serde_as]
851#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
852#[serde(default, rename_all = "camelCase")]
853#[non_exhaustive]
854pub struct Route {
855    /// Immutable. The name of the route. Route names must be unique. Route names
856    /// use the following form:
857    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
858    #[serde(skip_serializing_if = "std::string::String::is_empty")]
859    pub name: std::string::String,
860
861    /// Output only. The time the route was created.
862    #[serde(skip_serializing_if = "std::option::Option::is_none")]
863    pub create_time: std::option::Option<wkt::Timestamp>,
864
865    /// Output only. The time the route was last updated.
866    #[serde(skip_serializing_if = "std::option::Option::is_none")]
867    pub update_time: std::option::Option<wkt::Timestamp>,
868
869    /// The destination IP address range.
870    #[serde(skip_serializing_if = "std::string::String::is_empty")]
871    pub ip_cidr_range: std::string::String,
872
873    /// Output only. The route's type. Its type is determined by the properties of
874    /// its IP address range.
875    #[serde(rename = "type")]
876    pub r#type: crate::model::RouteType,
877
878    /// Immutable. The destination VPC network for packets on this route.
879    #[serde(skip_serializing_if = "std::option::Option::is_none")]
880    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
881
882    /// Optional labels in key-value pair format. For more information about
883    /// labels, see [Requirements for
884    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
885    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
886    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
887
888    /// An optional description of the route.
889    #[serde(skip_serializing_if = "std::string::String::is_empty")]
890    pub description: std::string::String,
891
892    /// Output only. The Google-generated UUID for the route. This value is unique
893    /// across all Network Connectivity Center route resources. If a
894    /// route is deleted and another with the same name is created,
895    /// the new route is assigned a different `uid`.
896    #[serde(skip_serializing_if = "std::string::String::is_empty")]
897    pub uid: std::string::String,
898
899    /// Output only. The current lifecycle state of the route.
900    pub state: crate::model::State,
901
902    /// Immutable. The spoke that this route leads to.
903    /// Example: projects/12345/locations/global/spokes/SPOKE
904    #[serde(skip_serializing_if = "std::string::String::is_empty")]
905    pub spoke: std::string::String,
906
907    /// Output only. The origin location of the route.
908    /// Uses the following form: "projects/{project}/locations/{location}"
909    /// Example: projects/1234/locations/us-central1
910    #[serde(skip_serializing_if = "std::string::String::is_empty")]
911    pub location: std::string::String,
912
913    /// Output only. The priority of this route. Priority is used to break ties in
914    /// cases where a destination matches more than one route. In these cases the
915    /// route with the lowest-numbered priority value wins.
916    #[serde_as(as = "serde_with::DisplayFromStr")]
917    pub priority: i64,
918
919    /// Immutable. The next-hop VPN tunnel for packets on this route.
920    #[serde(skip_serializing_if = "std::option::Option::is_none")]
921    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
922
923    /// Immutable. The next-hop Router appliance instance for packets on this
924    /// route.
925    #[serde(skip_serializing_if = "std::option::Option::is_none")]
926    pub next_hop_router_appliance_instance:
927        std::option::Option<crate::model::NextHopRouterApplianceInstance>,
928
929    /// Immutable. The next-hop VLAN attachment for packets on this route.
930    #[serde(skip_serializing_if = "std::option::Option::is_none")]
931    pub next_hop_interconnect_attachment:
932        std::option::Option<crate::model::NextHopInterconnectAttachment>,
933}
934
935impl Route {
936    pub fn new() -> Self {
937        std::default::Default::default()
938    }
939
940    /// Sets the value of [name][crate::model::Route::name].
941    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
942        self.name = v.into();
943        self
944    }
945
946    /// Sets the value of [create_time][crate::model::Route::create_time].
947    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
948        mut self,
949        v: T,
950    ) -> Self {
951        self.create_time = v.into();
952        self
953    }
954
955    /// Sets the value of [update_time][crate::model::Route::update_time].
956    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
957        mut self,
958        v: T,
959    ) -> Self {
960        self.update_time = v.into();
961        self
962    }
963
964    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
965    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
966        self.ip_cidr_range = v.into();
967        self
968    }
969
970    /// Sets the value of [r#type][crate::model::Route::type].
971    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
972        self.r#type = v.into();
973        self
974    }
975
976    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
977    pub fn set_next_hop_vpc_network<
978        T: std::convert::Into<std::option::Option<crate::model::NextHopVpcNetwork>>,
979    >(
980        mut self,
981        v: T,
982    ) -> Self {
983        self.next_hop_vpc_network = v.into();
984        self
985    }
986
987    /// Sets the value of [description][crate::model::Route::description].
988    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
989        self.description = v.into();
990        self
991    }
992
993    /// Sets the value of [uid][crate::model::Route::uid].
994    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
995        self.uid = v.into();
996        self
997    }
998
999    /// Sets the value of [state][crate::model::Route::state].
1000    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
1001        self.state = v.into();
1002        self
1003    }
1004
1005    /// Sets the value of [spoke][crate::model::Route::spoke].
1006    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1007        self.spoke = v.into();
1008        self
1009    }
1010
1011    /// Sets the value of [location][crate::model::Route::location].
1012    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1013        self.location = v.into();
1014        self
1015    }
1016
1017    /// Sets the value of [priority][crate::model::Route::priority].
1018    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1019        self.priority = v.into();
1020        self
1021    }
1022
1023    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
1024    pub fn set_next_hop_vpn_tunnel<
1025        T: std::convert::Into<std::option::Option<crate::model::NextHopVPNTunnel>>,
1026    >(
1027        mut self,
1028        v: T,
1029    ) -> Self {
1030        self.next_hop_vpn_tunnel = v.into();
1031        self
1032    }
1033
1034    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
1035    pub fn set_next_hop_router_appliance_instance<
1036        T: std::convert::Into<std::option::Option<crate::model::NextHopRouterApplianceInstance>>,
1037    >(
1038        mut self,
1039        v: T,
1040    ) -> Self {
1041        self.next_hop_router_appliance_instance = v.into();
1042        self
1043    }
1044
1045    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
1046    pub fn set_next_hop_interconnect_attachment<
1047        T: std::convert::Into<std::option::Option<crate::model::NextHopInterconnectAttachment>>,
1048    >(
1049        mut self,
1050        v: T,
1051    ) -> Self {
1052        self.next_hop_interconnect_attachment = v.into();
1053        self
1054    }
1055
1056    /// Sets the value of [labels][crate::model::Route::labels].
1057    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1058    where
1059        T: std::iter::IntoIterator<Item = (K, V)>,
1060        K: std::convert::Into<std::string::String>,
1061        V: std::convert::Into<std::string::String>,
1062    {
1063        use std::iter::Iterator;
1064        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1065        self
1066    }
1067}
1068
1069impl wkt::message::Message for Route {
1070    fn typename() -> &'static str {
1071        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
1072    }
1073}
1074
1075/// A group represents a subset of spokes attached to a hub.
1076#[serde_with::serde_as]
1077#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1078#[serde(default, rename_all = "camelCase")]
1079#[non_exhaustive]
1080pub struct Group {
1081    /// Immutable. The name of the group. Group names must be unique. They
1082    /// use the following form:
1083    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
1084    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1085    pub name: std::string::String,
1086
1087    /// Output only. The time the group was created.
1088    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1089    pub create_time: std::option::Option<wkt::Timestamp>,
1090
1091    /// Output only. The time the group was last updated.
1092    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1093    pub update_time: std::option::Option<wkt::Timestamp>,
1094
1095    /// Optional. Labels in key-value pair format. For more information about
1096    /// labels, see [Requirements for
1097    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
1098    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1099    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1100
1101    /// Optional. The description of the group.
1102    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1103    pub description: std::string::String,
1104
1105    /// Output only. The Google-generated UUID for the group. This value is unique
1106    /// across all group resources. If a group is deleted and
1107    /// another with the same name is created, the new route table is assigned
1108    /// a different unique_id.
1109    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1110    pub uid: std::string::String,
1111
1112    /// Output only. The current lifecycle state of this group.
1113    pub state: crate::model::State,
1114
1115    /// Optional. The auto-accept setting for this group.
1116    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1117    pub auto_accept: std::option::Option<crate::model::AutoAccept>,
1118
1119    /// Output only. The name of the route table that corresponds to this group.
1120    /// They use the following form:
1121    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
1122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1123    pub route_table: std::string::String,
1124}
1125
1126impl Group {
1127    pub fn new() -> Self {
1128        std::default::Default::default()
1129    }
1130
1131    /// Sets the value of [name][crate::model::Group::name].
1132    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1133        self.name = v.into();
1134        self
1135    }
1136
1137    /// Sets the value of [create_time][crate::model::Group::create_time].
1138    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1139        mut self,
1140        v: T,
1141    ) -> Self {
1142        self.create_time = v.into();
1143        self
1144    }
1145
1146    /// Sets the value of [update_time][crate::model::Group::update_time].
1147    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1148        mut self,
1149        v: T,
1150    ) -> Self {
1151        self.update_time = v.into();
1152        self
1153    }
1154
1155    /// Sets the value of [description][crate::model::Group::description].
1156    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1157        self.description = v.into();
1158        self
1159    }
1160
1161    /// Sets the value of [uid][crate::model::Group::uid].
1162    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1163        self.uid = v.into();
1164        self
1165    }
1166
1167    /// Sets the value of [state][crate::model::Group::state].
1168    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
1169        self.state = v.into();
1170        self
1171    }
1172
1173    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
1174    pub fn set_auto_accept<T: std::convert::Into<std::option::Option<crate::model::AutoAccept>>>(
1175        mut self,
1176        v: T,
1177    ) -> Self {
1178        self.auto_accept = v.into();
1179        self
1180    }
1181
1182    /// Sets the value of [route_table][crate::model::Group::route_table].
1183    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1184        self.route_table = v.into();
1185        self
1186    }
1187
1188    /// Sets the value of [labels][crate::model::Group::labels].
1189    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1190    where
1191        T: std::iter::IntoIterator<Item = (K, V)>,
1192        K: std::convert::Into<std::string::String>,
1193        V: std::convert::Into<std::string::String>,
1194    {
1195        use std::iter::Iterator;
1196        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1197        self
1198    }
1199}
1200
1201impl wkt::message::Message for Group {
1202    fn typename() -> &'static str {
1203        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
1204    }
1205}
1206
1207/// The auto-accept setting for a group controls whether
1208/// proposed spokes are automatically attached to the hub. If auto-accept is
1209/// enabled, the spoke immediately is attached to the hub and becomes part of the
1210/// group. In this case, the new spoke is in the ACTIVE state.
1211/// If auto-accept is disabled, the spoke goes to the INACTIVE
1212/// state, and it must be reviewed and accepted by a hub
1213/// administrator.
1214#[serde_with::serde_as]
1215#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1216#[serde(default, rename_all = "camelCase")]
1217#[non_exhaustive]
1218pub struct AutoAccept {
1219    /// A list of project ids or project numbers for which you want
1220    /// to enable auto-accept. The auto-accept setting is applied to
1221    /// spokes being created or updated in these projects.
1222    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1223    pub auto_accept_projects: std::vec::Vec<std::string::String>,
1224}
1225
1226impl AutoAccept {
1227    pub fn new() -> Self {
1228        std::default::Default::default()
1229    }
1230
1231    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
1232    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
1233    where
1234        T: std::iter::IntoIterator<Item = V>,
1235        V: std::convert::Into<std::string::String>,
1236    {
1237        use std::iter::Iterator;
1238        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
1239        self
1240    }
1241}
1242
1243impl wkt::message::Message for AutoAccept {
1244    fn typename() -> &'static str {
1245        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
1246    }
1247}
1248
1249/// Request for
1250/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
1251/// method.
1252///
1253/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
1254#[serde_with::serde_as]
1255#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1256#[serde(default, rename_all = "camelCase")]
1257#[non_exhaustive]
1258pub struct ListHubsRequest {
1259    /// Required. The parent resource's name.
1260    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1261    pub parent: std::string::String,
1262
1263    /// The maximum number of results per page to return.
1264    pub page_size: i32,
1265
1266    /// The page token.
1267    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1268    pub page_token: std::string::String,
1269
1270    /// An expression that filters the list of results.
1271    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1272    pub filter: std::string::String,
1273
1274    /// Sort the results by a certain order.
1275    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1276    pub order_by: std::string::String,
1277}
1278
1279impl ListHubsRequest {
1280    pub fn new() -> Self {
1281        std::default::Default::default()
1282    }
1283
1284    /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
1285    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286        self.parent = v.into();
1287        self
1288    }
1289
1290    /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
1291    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1292        self.page_size = v.into();
1293        self
1294    }
1295
1296    /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
1297    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1298        self.page_token = v.into();
1299        self
1300    }
1301
1302    /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
1303    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1304        self.filter = v.into();
1305        self
1306    }
1307
1308    /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
1309    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1310        self.order_by = v.into();
1311        self
1312    }
1313}
1314
1315impl wkt::message::Message for ListHubsRequest {
1316    fn typename() -> &'static str {
1317        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
1318    }
1319}
1320
1321/// Response for
1322/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
1323/// method.
1324///
1325/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
1326#[serde_with::serde_as]
1327#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1328#[serde(default, rename_all = "camelCase")]
1329#[non_exhaustive]
1330pub struct ListHubsResponse {
1331    /// The requested hubs.
1332    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1333    pub hubs: std::vec::Vec<crate::model::Hub>,
1334
1335    /// The token for the next page of the response. To see more results,
1336    /// use this value as the page_token for your next request. If this value
1337    /// is empty, there are no more results.
1338    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1339    pub next_page_token: std::string::String,
1340
1341    /// Locations that could not be reached.
1342    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1343    pub unreachable: std::vec::Vec<std::string::String>,
1344}
1345
1346impl ListHubsResponse {
1347    pub fn new() -> Self {
1348        std::default::Default::default()
1349    }
1350
1351    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
1352    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1353        self.next_page_token = v.into();
1354        self
1355    }
1356
1357    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
1358    pub fn set_hubs<T, V>(mut self, v: T) -> Self
1359    where
1360        T: std::iter::IntoIterator<Item = V>,
1361        V: std::convert::Into<crate::model::Hub>,
1362    {
1363        use std::iter::Iterator;
1364        self.hubs = v.into_iter().map(|i| i.into()).collect();
1365        self
1366    }
1367
1368    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
1369    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1370    where
1371        T: std::iter::IntoIterator<Item = V>,
1372        V: std::convert::Into<std::string::String>,
1373    {
1374        use std::iter::Iterator;
1375        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1376        self
1377    }
1378}
1379
1380impl wkt::message::Message for ListHubsResponse {
1381    fn typename() -> &'static str {
1382        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
1383    }
1384}
1385
1386#[cfg(feature = "unstable-stream")]
1387impl gax::paginator::PageableResponse for ListHubsResponse {
1388    type PageItem = crate::model::Hub;
1389
1390    fn items(self) -> std::vec::Vec<Self::PageItem> {
1391        self.hubs
1392    }
1393
1394    fn next_page_token(&self) -> std::string::String {
1395        gax::paginator::extract_token(&self.next_page_token)
1396    }
1397}
1398
1399/// Request for
1400/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
1401/// method.
1402///
1403/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
1404#[serde_with::serde_as]
1405#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1406#[serde(default, rename_all = "camelCase")]
1407#[non_exhaustive]
1408pub struct GetHubRequest {
1409    /// Required. The name of the hub resource to get.
1410    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1411    pub name: std::string::String,
1412}
1413
1414impl GetHubRequest {
1415    pub fn new() -> Self {
1416        std::default::Default::default()
1417    }
1418
1419    /// Sets the value of [name][crate::model::GetHubRequest::name].
1420    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1421        self.name = v.into();
1422        self
1423    }
1424}
1425
1426impl wkt::message::Message for GetHubRequest {
1427    fn typename() -> &'static str {
1428        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
1429    }
1430}
1431
1432/// Request for
1433/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
1434/// method.
1435///
1436/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
1437#[serde_with::serde_as]
1438#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1439#[serde(default, rename_all = "camelCase")]
1440#[non_exhaustive]
1441pub struct CreateHubRequest {
1442    /// Required. The parent resource.
1443    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1444    pub parent: std::string::String,
1445
1446    /// Required. A unique identifier for the hub.
1447    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1448    pub hub_id: std::string::String,
1449
1450    /// Required. The initial values for a new hub.
1451    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1452    pub hub: std::option::Option<crate::model::Hub>,
1453
1454    /// Optional. A request ID to identify requests. Specify a unique request ID so
1455    /// that if you must retry your request, the server knows to ignore the request
1456    /// if it has already been completed. The server guarantees that a request
1457    /// doesn't result in creation of duplicate commitments for at least 60
1458    /// minutes.
1459    ///
1460    /// For example, consider a situation where you make an initial request and
1461    /// the request times out. If you make the request again with the same request
1462    /// ID, the server can check to see whether the original operation
1463    /// was received. If it was, the server ignores the second request. This
1464    /// behavior prevents clients from mistakenly creating duplicate commitments.
1465    ///
1466    /// The request ID must be a valid UUID, with the exception that zero UUID is
1467    /// not supported (00000000-0000-0000-0000-000000000000).
1468    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1469    pub request_id: std::string::String,
1470}
1471
1472impl CreateHubRequest {
1473    pub fn new() -> Self {
1474        std::default::Default::default()
1475    }
1476
1477    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
1478    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1479        self.parent = v.into();
1480        self
1481    }
1482
1483    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
1484    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1485        self.hub_id = v.into();
1486        self
1487    }
1488
1489    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
1490    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
1491        mut self,
1492        v: T,
1493    ) -> Self {
1494        self.hub = v.into();
1495        self
1496    }
1497
1498    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
1499    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1500        self.request_id = v.into();
1501        self
1502    }
1503}
1504
1505impl wkt::message::Message for CreateHubRequest {
1506    fn typename() -> &'static str {
1507        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
1508    }
1509}
1510
1511/// Request for
1512/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
1513/// method.
1514///
1515/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
1516#[serde_with::serde_as]
1517#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1518#[serde(default, rename_all = "camelCase")]
1519#[non_exhaustive]
1520pub struct UpdateHubRequest {
1521    /// Optional. In the case of an update to an existing hub, field mask is used
1522    /// to specify the fields to be overwritten. The fields specified in the
1523    /// update_mask are relative to the resource, not the full request. A field is
1524    /// overwritten if it is in the mask. If the user does not provide a mask, then
1525    /// all fields are overwritten.
1526    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1527    pub update_mask: std::option::Option<wkt::FieldMask>,
1528
1529    /// Required. The state that the hub should be in after the update.
1530    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1531    pub hub: std::option::Option<crate::model::Hub>,
1532
1533    /// Optional. A request ID to identify requests. Specify a unique request ID so
1534    /// that if you must retry your request, the server knows to ignore the request
1535    /// if it has already been completed. The server guarantees that a request
1536    /// doesn't result in creation of duplicate commitments for at least 60
1537    /// minutes.
1538    ///
1539    /// For example, consider a situation where you make an initial request and
1540    /// the request times out. If you make the request again with the same request
1541    /// ID, the server can check to see whether the original operation
1542    /// was received. If it was, the server ignores the second request. This
1543    /// behavior prevents clients from mistakenly creating duplicate commitments.
1544    ///
1545    /// The request ID must be a valid UUID, with the exception that zero UUID is
1546    /// not supported (00000000-0000-0000-0000-000000000000).
1547    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1548    pub request_id: std::string::String,
1549}
1550
1551impl UpdateHubRequest {
1552    pub fn new() -> Self {
1553        std::default::Default::default()
1554    }
1555
1556    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
1557    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1558        mut self,
1559        v: T,
1560    ) -> Self {
1561        self.update_mask = v.into();
1562        self
1563    }
1564
1565    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
1566    pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
1567        mut self,
1568        v: T,
1569    ) -> Self {
1570        self.hub = v.into();
1571        self
1572    }
1573
1574    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
1575    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1576        self.request_id = v.into();
1577        self
1578    }
1579}
1580
1581impl wkt::message::Message for UpdateHubRequest {
1582    fn typename() -> &'static str {
1583        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
1584    }
1585}
1586
1587/// The request for
1588/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
1589///
1590/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
1591#[serde_with::serde_as]
1592#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1593#[serde(default, rename_all = "camelCase")]
1594#[non_exhaustive]
1595pub struct DeleteHubRequest {
1596    /// Required. The name of the hub to delete.
1597    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1598    pub name: std::string::String,
1599
1600    /// Optional. A request ID to identify requests. Specify a unique request ID so
1601    /// that if you must retry your request, the server knows to ignore the request
1602    /// if it has already been completed. The server guarantees that a request
1603    /// doesn't result in creation of duplicate commitments for at least 60
1604    /// minutes.
1605    ///
1606    /// For example, consider a situation where you make an initial request and
1607    /// the request times out. If you make the request again with the same request
1608    /// ID, the server can check to see whether the original operation
1609    /// was received. If it was, the server ignores the second request. This
1610    /// behavior prevents clients from mistakenly creating duplicate commitments.
1611    ///
1612    /// The request ID must be a valid UUID, with the exception that zero UUID is
1613    /// not supported (00000000-0000-0000-0000-000000000000).
1614    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1615    pub request_id: std::string::String,
1616}
1617
1618impl DeleteHubRequest {
1619    pub fn new() -> Self {
1620        std::default::Default::default()
1621    }
1622
1623    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
1624    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1625        self.name = v.into();
1626        self
1627    }
1628
1629    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
1630    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1631        self.request_id = v.into();
1632        self
1633    }
1634}
1635
1636impl wkt::message::Message for DeleteHubRequest {
1637    fn typename() -> &'static str {
1638        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
1639    }
1640}
1641
1642/// The request for
1643/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
1644///
1645/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
1646#[serde_with::serde_as]
1647#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1648#[serde(default, rename_all = "camelCase")]
1649#[non_exhaustive]
1650pub struct ListHubSpokesRequest {
1651    /// Required. The name of the hub.
1652    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1653    pub name: std::string::String,
1654
1655    /// A list of locations.
1656    /// Specify one of the following: `[global]`, a single region (for
1657    /// example, `[us-central1]`), or a combination of
1658    /// values (for example, `[global, us-central1, us-west1]`).
1659    /// If the spoke_locations field is populated, the list of results
1660    /// includes only spokes in the specified location.
1661    /// If the spoke_locations field is not populated, the list of results
1662    /// includes spokes in all locations.
1663    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1664    pub spoke_locations: std::vec::Vec<std::string::String>,
1665
1666    /// The maximum number of results to return per page.
1667    pub page_size: i32,
1668
1669    /// The page token.
1670    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1671    pub page_token: std::string::String,
1672
1673    /// An expression that filters the list of results.
1674    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1675    pub filter: std::string::String,
1676
1677    /// Sort the results by name or create_time.
1678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1679    pub order_by: std::string::String,
1680
1681    /// The view of the spoke to return.
1682    /// The view that you use determines which spoke fields are included in the
1683    /// response.
1684    pub view: crate::model::list_hub_spokes_request::SpokeView,
1685}
1686
1687impl ListHubSpokesRequest {
1688    pub fn new() -> Self {
1689        std::default::Default::default()
1690    }
1691
1692    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
1693    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694        self.name = v.into();
1695        self
1696    }
1697
1698    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
1699    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1700        self.page_size = v.into();
1701        self
1702    }
1703
1704    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
1705    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706        self.page_token = v.into();
1707        self
1708    }
1709
1710    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
1711    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1712        self.filter = v.into();
1713        self
1714    }
1715
1716    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
1717    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1718        self.order_by = v.into();
1719        self
1720    }
1721
1722    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
1723    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
1724        mut self,
1725        v: T,
1726    ) -> Self {
1727        self.view = v.into();
1728        self
1729    }
1730
1731    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
1732    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
1733    where
1734        T: std::iter::IntoIterator<Item = V>,
1735        V: std::convert::Into<std::string::String>,
1736    {
1737        use std::iter::Iterator;
1738        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
1739        self
1740    }
1741}
1742
1743impl wkt::message::Message for ListHubSpokesRequest {
1744    fn typename() -> &'static str {
1745        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
1746    }
1747}
1748
1749/// Defines additional types related to ListHubSpokesRequest
1750pub mod list_hub_spokes_request {
1751    #[allow(unused_imports)]
1752    use super::*;
1753
1754    /// Enum that controls which spoke fields are included in the response.
1755    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1756    pub struct SpokeView(std::borrow::Cow<'static, str>);
1757
1758    impl SpokeView {
1759        /// Creates a new SpokeView instance.
1760        pub const fn new(v: &'static str) -> Self {
1761            Self(std::borrow::Cow::Borrowed(v))
1762        }
1763
1764        /// Gets the enum value.
1765        pub fn value(&self) -> &str {
1766            &self.0
1767        }
1768    }
1769
1770    /// Useful constants to work with [SpokeView](SpokeView)
1771    pub mod spoke_view {
1772        use super::SpokeView;
1773
1774        /// The spoke view is unspecified. When the spoke view is unspecified, the
1775        /// API returns the same fields as the `BASIC` view.
1776        pub const SPOKE_VIEW_UNSPECIFIED: SpokeView = SpokeView::new("SPOKE_VIEW_UNSPECIFIED");
1777
1778        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
1779        /// and `spoke_type`. This is the default value.
1780        pub const BASIC: SpokeView = SpokeView::new("BASIC");
1781
1782        /// Includes all spoke fields except `labels`.
1783        /// You can use the `DETAILED` view only when you set the `spoke_locations`
1784        /// field to `[global]`.
1785        pub const DETAILED: SpokeView = SpokeView::new("DETAILED");
1786    }
1787
1788    impl std::convert::From<std::string::String> for SpokeView {
1789        fn from(value: std::string::String) -> Self {
1790            Self(std::borrow::Cow::Owned(value))
1791        }
1792    }
1793}
1794
1795/// The response for
1796/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
1797///
1798/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
1799#[serde_with::serde_as]
1800#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1801#[serde(default, rename_all = "camelCase")]
1802#[non_exhaustive]
1803pub struct ListHubSpokesResponse {
1804    /// The requested spokes.
1805    /// The spoke fields can be partially populated based on the `view` field in
1806    /// the request message.
1807    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1808    pub spokes: std::vec::Vec<crate::model::Spoke>,
1809
1810    /// The token for the next page of the response. To see more results,
1811    /// use this value as the page_token for your next request. If this value
1812    /// is empty, there are no more results.
1813    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1814    pub next_page_token: std::string::String,
1815
1816    /// Locations that could not be reached.
1817    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1818    pub unreachable: std::vec::Vec<std::string::String>,
1819}
1820
1821impl ListHubSpokesResponse {
1822    pub fn new() -> Self {
1823        std::default::Default::default()
1824    }
1825
1826    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
1827    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1828        self.next_page_token = v.into();
1829        self
1830    }
1831
1832    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
1833    pub fn set_spokes<T, V>(mut self, v: T) -> Self
1834    where
1835        T: std::iter::IntoIterator<Item = V>,
1836        V: std::convert::Into<crate::model::Spoke>,
1837    {
1838        use std::iter::Iterator;
1839        self.spokes = v.into_iter().map(|i| i.into()).collect();
1840        self
1841    }
1842
1843    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
1844    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1845    where
1846        T: std::iter::IntoIterator<Item = V>,
1847        V: std::convert::Into<std::string::String>,
1848    {
1849        use std::iter::Iterator;
1850        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1851        self
1852    }
1853}
1854
1855impl wkt::message::Message for ListHubSpokesResponse {
1856    fn typename() -> &'static str {
1857        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
1858    }
1859}
1860
1861#[cfg(feature = "unstable-stream")]
1862impl gax::paginator::PageableResponse for ListHubSpokesResponse {
1863    type PageItem = crate::model::Spoke;
1864
1865    fn items(self) -> std::vec::Vec<Self::PageItem> {
1866        self.spokes
1867    }
1868
1869    fn next_page_token(&self) -> std::string::String {
1870        gax::paginator::extract_token(&self.next_page_token)
1871    }
1872}
1873
1874/// The request for
1875/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
1876///
1877/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
1878#[serde_with::serde_as]
1879#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1880#[serde(default, rename_all = "camelCase")]
1881#[non_exhaustive]
1882pub struct QueryHubStatusRequest {
1883    /// Required. The name of the hub.
1884    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1885    pub name: std::string::String,
1886
1887    /// Optional. The maximum number of results to return per page.
1888    pub page_size: i32,
1889
1890    /// Optional. The page token.
1891    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1892    pub page_token: std::string::String,
1893
1894    /// Optional. An expression that filters the list of results.
1895    /// The filter can be used to filter the results by the following fields:
1896    ///
1897    /// * `psc_propagation_status.source_spoke`
1898    /// * `psc_propagation_status.source_group`
1899    /// * `psc_propagation_status.source_forwarding_rule`
1900    /// * `psc_propagation_status.target_spoke`
1901    /// * `psc_propagation_status.target_group`
1902    /// * `psc_propagation_status.code`
1903    /// * `psc_propagation_status.message`
1904    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1905    pub filter: std::string::String,
1906
1907    /// Optional. Sort the results in ascending order by the specified fields.
1908    /// A comma-separated list of any of these fields:
1909    ///
1910    /// * `psc_propagation_status.source_spoke`
1911    /// * `psc_propagation_status.source_group`
1912    /// * `psc_propagation_status.source_forwarding_rule`
1913    /// * `psc_propagation_status.target_spoke`
1914    /// * `psc_propagation_status.target_group`
1915    /// * `psc_propagation_status.code`
1916    ///   If `group_by` is set, the value of the `order_by` field must be the
1917    ///   same as or a subset of the `group_by` field.
1918    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1919    pub order_by: std::string::String,
1920
1921    /// Optional. Aggregate the results by the specified fields.
1922    /// A comma-separated list of any of these fields:
1923    ///
1924    /// * `psc_propagation_status.source_spoke`
1925    /// * `psc_propagation_status.source_group`
1926    /// * `psc_propagation_status.source_forwarding_rule`
1927    /// * `psc_propagation_status.target_spoke`
1928    /// * `psc_propagation_status.target_group`
1929    /// * `psc_propagation_status.code`
1930    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1931    pub group_by: std::string::String,
1932}
1933
1934impl QueryHubStatusRequest {
1935    pub fn new() -> Self {
1936        std::default::Default::default()
1937    }
1938
1939    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
1940    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1941        self.name = v.into();
1942        self
1943    }
1944
1945    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
1946    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1947        self.page_size = v.into();
1948        self
1949    }
1950
1951    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
1952    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1953        self.page_token = v.into();
1954        self
1955    }
1956
1957    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
1958    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1959        self.filter = v.into();
1960        self
1961    }
1962
1963    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
1964    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1965        self.order_by = v.into();
1966        self
1967    }
1968
1969    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
1970    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1971        self.group_by = v.into();
1972        self
1973    }
1974}
1975
1976impl wkt::message::Message for QueryHubStatusRequest {
1977    fn typename() -> &'static str {
1978        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
1979    }
1980}
1981
1982/// The response for
1983/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
1984///
1985/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
1986#[serde_with::serde_as]
1987#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1988#[serde(default, rename_all = "camelCase")]
1989#[non_exhaustive]
1990pub struct QueryHubStatusResponse {
1991    /// The list of hub status.
1992    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1993    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
1994
1995    /// The token for the next page of the response. To see more results,
1996    /// use this value as the page_token for your next request. If this value
1997    /// is empty, there are no more results.
1998    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1999    pub next_page_token: std::string::String,
2000}
2001
2002impl QueryHubStatusResponse {
2003    pub fn new() -> Self {
2004        std::default::Default::default()
2005    }
2006
2007    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
2008    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009        self.next_page_token = v.into();
2010        self
2011    }
2012
2013    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
2014    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
2015    where
2016        T: std::iter::IntoIterator<Item = V>,
2017        V: std::convert::Into<crate::model::HubStatusEntry>,
2018    {
2019        use std::iter::Iterator;
2020        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
2021        self
2022    }
2023}
2024
2025impl wkt::message::Message for QueryHubStatusResponse {
2026    fn typename() -> &'static str {
2027        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
2028    }
2029}
2030
2031#[cfg(feature = "unstable-stream")]
2032impl gax::paginator::PageableResponse for QueryHubStatusResponse {
2033    type PageItem = crate::model::HubStatusEntry;
2034
2035    fn items(self) -> std::vec::Vec<Self::PageItem> {
2036        self.hub_status_entries
2037    }
2038
2039    fn next_page_token(&self) -> std::string::String {
2040        gax::paginator::extract_token(&self.next_page_token)
2041    }
2042}
2043
2044/// A hub status entry represents the status of a set of propagated Private
2045/// Service Connect connections grouped by certain fields.
2046#[serde_with::serde_as]
2047#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2048#[serde(default, rename_all = "camelCase")]
2049#[non_exhaustive]
2050pub struct HubStatusEntry {
2051    /// The number of propagated Private Service Connect connections with this
2052    /// status. If the `group_by` field was not set in the request message, the
2053    /// value of this field is 1.
2054    pub count: i32,
2055
2056    /// The fields that this entry is grouped by. This has the same value as the
2057    /// `group_by` field in the request message.
2058    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2059    pub group_by: std::string::String,
2060
2061    /// The Private Service Connect propagation status.
2062    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2063    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
2064}
2065
2066impl HubStatusEntry {
2067    pub fn new() -> Self {
2068        std::default::Default::default()
2069    }
2070
2071    /// Sets the value of [count][crate::model::HubStatusEntry::count].
2072    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2073        self.count = v.into();
2074        self
2075    }
2076
2077    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
2078    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2079        self.group_by = v.into();
2080        self
2081    }
2082
2083    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
2084    pub fn set_psc_propagation_status<
2085        T: std::convert::Into<std::option::Option<crate::model::PscPropagationStatus>>,
2086    >(
2087        mut self,
2088        v: T,
2089    ) -> Self {
2090        self.psc_propagation_status = v.into();
2091        self
2092    }
2093}
2094
2095impl wkt::message::Message for HubStatusEntry {
2096    fn typename() -> &'static str {
2097        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
2098    }
2099}
2100
2101/// The status of one or more propagated Private Service Connect connections in a
2102/// hub.
2103#[serde_with::serde_as]
2104#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2105#[serde(default, rename_all = "camelCase")]
2106#[non_exhaustive]
2107pub struct PscPropagationStatus {
2108    /// The name of the spoke that the source forwarding rule belongs to.
2109    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2110    pub source_spoke: std::string::String,
2111
2112    /// The name of the group that the source spoke belongs to.
2113    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2114    pub source_group: std::string::String,
2115
2116    /// The name of the forwarding rule exported to the hub.
2117    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2118    pub source_forwarding_rule: std::string::String,
2119
2120    /// The name of the spoke that the source forwarding rule propagates to.
2121    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2122    pub target_spoke: std::string::String,
2123
2124    /// The name of the group that the target spoke belongs to.
2125    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2126    pub target_group: std::string::String,
2127
2128    /// The propagation status.
2129    pub code: crate::model::psc_propagation_status::Code,
2130
2131    /// The human-readable summary of the Private Service Connect connection
2132    /// propagation status.
2133    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2134    pub message: std::string::String,
2135}
2136
2137impl PscPropagationStatus {
2138    pub fn new() -> Self {
2139        std::default::Default::default()
2140    }
2141
2142    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
2143    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2144        self.source_spoke = v.into();
2145        self
2146    }
2147
2148    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
2149    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2150        self.source_group = v.into();
2151        self
2152    }
2153
2154    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
2155    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
2156        mut self,
2157        v: T,
2158    ) -> Self {
2159        self.source_forwarding_rule = v.into();
2160        self
2161    }
2162
2163    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
2164    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165        self.target_spoke = v.into();
2166        self
2167    }
2168
2169    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
2170    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2171        self.target_group = v.into();
2172        self
2173    }
2174
2175    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
2176    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
2177        mut self,
2178        v: T,
2179    ) -> Self {
2180        self.code = v.into();
2181        self
2182    }
2183
2184    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
2185    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2186        self.message = v.into();
2187        self
2188    }
2189}
2190
2191impl wkt::message::Message for PscPropagationStatus {
2192    fn typename() -> &'static str {
2193        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
2194    }
2195}
2196
2197/// Defines additional types related to PscPropagationStatus
2198pub mod psc_propagation_status {
2199    #[allow(unused_imports)]
2200    use super::*;
2201
2202    /// The Code enum represents the state of the Private Service Connect
2203    /// propagation.
2204    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2205    pub struct Code(std::borrow::Cow<'static, str>);
2206
2207    impl Code {
2208        /// Creates a new Code instance.
2209        pub const fn new(v: &'static str) -> Self {
2210            Self(std::borrow::Cow::Borrowed(v))
2211        }
2212
2213        /// Gets the enum value.
2214        pub fn value(&self) -> &str {
2215            &self.0
2216        }
2217    }
2218
2219    /// Useful constants to work with [Code](Code)
2220    pub mod code {
2221        use super::Code;
2222
2223        /// The code is unspecified.
2224        pub const CODE_UNSPECIFIED: Code = Code::new("CODE_UNSPECIFIED");
2225
2226        /// The propagated Private Service Connect connection is ready.
2227        pub const READY: Code = Code::new("READY");
2228
2229        /// The Private Service Connect connection is propagating. This is a
2230        /// transient state.
2231        pub const PROPAGATING: Code = Code::new("PROPAGATING");
2232
2233        /// The Private Service Connect connection propagation failed because the VPC
2234        /// network or the project of the target spoke has exceeded the connection
2235        /// limit set by the producer.
2236        pub const ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED: Code =
2237            Code::new("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED");
2238
2239        /// The Private Service Connect connection propagation failed because the NAT
2240        /// IP subnet space has been exhausted. It is equivalent to the `Needs
2241        /// attention` status of the Private Service Connect connection. See
2242        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
2243        pub const ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED: Code =
2244            Code::new("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED");
2245
2246        /// The Private Service Connect connection propagation failed because the
2247        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
2248        /// producer VPC network has been exceeded.
2249        pub const ERROR_PRODUCER_QUOTA_EXCEEDED: Code = Code::new("ERROR_PRODUCER_QUOTA_EXCEEDED");
2250
2251        /// The Private Service Connect connection propagation failed because the
2252        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
2253        /// VPC network has been exceeded.
2254        pub const ERROR_CONSUMER_QUOTA_EXCEEDED: Code = Code::new("ERROR_CONSUMER_QUOTA_EXCEEDED");
2255    }
2256
2257    impl std::convert::From<std::string::String> for Code {
2258        fn from(value: std::string::String) -> Self {
2259            Self(std::borrow::Cow::Owned(value))
2260        }
2261    }
2262}
2263
2264/// The request for
2265/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
2266///
2267/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
2268#[serde_with::serde_as]
2269#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2270#[serde(default, rename_all = "camelCase")]
2271#[non_exhaustive]
2272pub struct ListSpokesRequest {
2273    /// Required. The parent resource.
2274    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2275    pub parent: std::string::String,
2276
2277    /// The maximum number of results to return per page.
2278    pub page_size: i32,
2279
2280    /// The page token.
2281    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2282    pub page_token: std::string::String,
2283
2284    /// An expression that filters the list of results.
2285    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2286    pub filter: std::string::String,
2287
2288    /// Sort the results by a certain order.
2289    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2290    pub order_by: std::string::String,
2291}
2292
2293impl ListSpokesRequest {
2294    pub fn new() -> Self {
2295        std::default::Default::default()
2296    }
2297
2298    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
2299    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2300        self.parent = v.into();
2301        self
2302    }
2303
2304    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
2305    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2306        self.page_size = v.into();
2307        self
2308    }
2309
2310    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
2311    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2312        self.page_token = v.into();
2313        self
2314    }
2315
2316    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
2317    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318        self.filter = v.into();
2319        self
2320    }
2321
2322    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
2323    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2324        self.order_by = v.into();
2325        self
2326    }
2327}
2328
2329impl wkt::message::Message for ListSpokesRequest {
2330    fn typename() -> &'static str {
2331        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
2332    }
2333}
2334
2335/// The response for
2336/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
2337///
2338/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
2339#[serde_with::serde_as]
2340#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2341#[serde(default, rename_all = "camelCase")]
2342#[non_exhaustive]
2343pub struct ListSpokesResponse {
2344    /// The requested spokes.
2345    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2346    pub spokes: std::vec::Vec<crate::model::Spoke>,
2347
2348    /// The token for the next page of the response. To see more results,
2349    /// use this value as the page_token for your next request. If this value
2350    /// is empty, there are no more results.
2351    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2352    pub next_page_token: std::string::String,
2353
2354    /// Locations that could not be reached.
2355    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2356    pub unreachable: std::vec::Vec<std::string::String>,
2357}
2358
2359impl ListSpokesResponse {
2360    pub fn new() -> Self {
2361        std::default::Default::default()
2362    }
2363
2364    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
2365    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2366        self.next_page_token = v.into();
2367        self
2368    }
2369
2370    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
2371    pub fn set_spokes<T, V>(mut self, v: T) -> Self
2372    where
2373        T: std::iter::IntoIterator<Item = V>,
2374        V: std::convert::Into<crate::model::Spoke>,
2375    {
2376        use std::iter::Iterator;
2377        self.spokes = v.into_iter().map(|i| i.into()).collect();
2378        self
2379    }
2380
2381    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
2382    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2383    where
2384        T: std::iter::IntoIterator<Item = V>,
2385        V: std::convert::Into<std::string::String>,
2386    {
2387        use std::iter::Iterator;
2388        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2389        self
2390    }
2391}
2392
2393impl wkt::message::Message for ListSpokesResponse {
2394    fn typename() -> &'static str {
2395        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
2396    }
2397}
2398
2399#[cfg(feature = "unstable-stream")]
2400impl gax::paginator::PageableResponse for ListSpokesResponse {
2401    type PageItem = crate::model::Spoke;
2402
2403    fn items(self) -> std::vec::Vec<Self::PageItem> {
2404        self.spokes
2405    }
2406
2407    fn next_page_token(&self) -> std::string::String {
2408        gax::paginator::extract_token(&self.next_page_token)
2409    }
2410}
2411
2412/// The request for
2413/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
2414///
2415/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
2416#[serde_with::serde_as]
2417#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2418#[serde(default, rename_all = "camelCase")]
2419#[non_exhaustive]
2420pub struct GetSpokeRequest {
2421    /// Required. The name of the spoke resource.
2422    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2423    pub name: std::string::String,
2424}
2425
2426impl GetSpokeRequest {
2427    pub fn new() -> Self {
2428        std::default::Default::default()
2429    }
2430
2431    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
2432    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2433        self.name = v.into();
2434        self
2435    }
2436}
2437
2438impl wkt::message::Message for GetSpokeRequest {
2439    fn typename() -> &'static str {
2440        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
2441    }
2442}
2443
2444/// The request for
2445/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
2446///
2447/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
2448#[serde_with::serde_as]
2449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2450#[serde(default, rename_all = "camelCase")]
2451#[non_exhaustive]
2452pub struct CreateSpokeRequest {
2453    /// Required. The parent resource.
2454    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2455    pub parent: std::string::String,
2456
2457    /// Required. Unique id for the spoke to create.
2458    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2459    pub spoke_id: std::string::String,
2460
2461    /// Required. The initial values for a new spoke.
2462    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2463    pub spoke: std::option::Option<crate::model::Spoke>,
2464
2465    /// Optional. A request ID to identify requests. Specify a unique request ID so
2466    /// that if you must retry your request, the server knows to ignore the request
2467    /// if it has already been completed. The server guarantees that a request
2468    /// doesn't result in creation of duplicate commitments for at least 60
2469    /// minutes.
2470    ///
2471    /// For example, consider a situation where you make an initial request and
2472    /// the request times out. If you make the request again with the same request
2473    /// ID, the server can check to see whether the original operation
2474    /// was received. If it was, the server ignores the second request. This
2475    /// behavior prevents clients from mistakenly creating duplicate commitments.
2476    ///
2477    /// The request ID must be a valid UUID, with the exception that zero UUID is
2478    /// not supported (00000000-0000-0000-0000-000000000000).
2479    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2480    pub request_id: std::string::String,
2481}
2482
2483impl CreateSpokeRequest {
2484    pub fn new() -> Self {
2485        std::default::Default::default()
2486    }
2487
2488    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
2489    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2490        self.parent = v.into();
2491        self
2492    }
2493
2494    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
2495    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2496        self.spoke_id = v.into();
2497        self
2498    }
2499
2500    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
2501    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
2502        mut self,
2503        v: T,
2504    ) -> Self {
2505        self.spoke = v.into();
2506        self
2507    }
2508
2509    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
2510    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2511        self.request_id = v.into();
2512        self
2513    }
2514}
2515
2516impl wkt::message::Message for CreateSpokeRequest {
2517    fn typename() -> &'static str {
2518        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
2519    }
2520}
2521
2522/// Request for
2523/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
2524/// method.
2525///
2526/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
2527#[serde_with::serde_as]
2528#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2529#[serde(default, rename_all = "camelCase")]
2530#[non_exhaustive]
2531pub struct UpdateSpokeRequest {
2532    /// Optional. In the case of an update to an existing spoke, field mask is used
2533    /// to specify the fields to be overwritten. The fields specified in the
2534    /// update_mask are relative to the resource, not the full request. A field is
2535    /// overwritten if it is in the mask. If the user does not provide a mask, then
2536    /// all fields are overwritten.
2537    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2538    pub update_mask: std::option::Option<wkt::FieldMask>,
2539
2540    /// Required. The state that the spoke should be in after the update.
2541    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2542    pub spoke: std::option::Option<crate::model::Spoke>,
2543
2544    /// Optional. A request ID to identify requests. Specify a unique request ID so
2545    /// that if you must retry your request, the server knows to ignore the request
2546    /// if it has already been completed. The server guarantees that a request
2547    /// doesn't result in creation of duplicate commitments for at least 60
2548    /// minutes.
2549    ///
2550    /// For example, consider a situation where you make an initial request and
2551    /// the request times out. If you make the request again with the same request
2552    /// ID, the server can check to see whether the original operation
2553    /// was received. If it was, the server ignores the second request. This
2554    /// behavior prevents clients from mistakenly creating duplicate commitments.
2555    ///
2556    /// The request ID must be a valid UUID, with the exception that zero UUID is
2557    /// not supported (00000000-0000-0000-0000-000000000000).
2558    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2559    pub request_id: std::string::String,
2560}
2561
2562impl UpdateSpokeRequest {
2563    pub fn new() -> Self {
2564        std::default::Default::default()
2565    }
2566
2567    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
2568    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2569        mut self,
2570        v: T,
2571    ) -> Self {
2572        self.update_mask = v.into();
2573        self
2574    }
2575
2576    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
2577    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
2578        mut self,
2579        v: T,
2580    ) -> Self {
2581        self.spoke = v.into();
2582        self
2583    }
2584
2585    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
2586    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2587        self.request_id = v.into();
2588        self
2589    }
2590}
2591
2592impl wkt::message::Message for UpdateSpokeRequest {
2593    fn typename() -> &'static str {
2594        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
2595    }
2596}
2597
2598/// The request for
2599/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
2600///
2601/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
2602#[serde_with::serde_as]
2603#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2604#[serde(default, rename_all = "camelCase")]
2605#[non_exhaustive]
2606pub struct DeleteSpokeRequest {
2607    /// Required. The name of the spoke to delete.
2608    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2609    pub name: std::string::String,
2610
2611    /// Optional. A request ID to identify requests. Specify a unique request ID so
2612    /// that if you must retry your request, the server knows to ignore the request
2613    /// if it has already been completed. The server guarantees that a request
2614    /// doesn't result in creation of duplicate commitments for at least 60
2615    /// minutes.
2616    ///
2617    /// For example, consider a situation where you make an initial request and
2618    /// the request times out. If you make the request again with the same request
2619    /// ID, the server can check to see whether the original operation
2620    /// was received. If it was, the server ignores the second request. This
2621    /// behavior prevents clients from mistakenly creating duplicate commitments.
2622    ///
2623    /// The request ID must be a valid UUID, with the exception that zero UUID is
2624    /// not supported (00000000-0000-0000-0000-000000000000).
2625    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2626    pub request_id: std::string::String,
2627}
2628
2629impl DeleteSpokeRequest {
2630    pub fn new() -> Self {
2631        std::default::Default::default()
2632    }
2633
2634    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
2635    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2636        self.name = v.into();
2637        self
2638    }
2639
2640    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
2641    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2642        self.request_id = v.into();
2643        self
2644    }
2645}
2646
2647impl wkt::message::Message for DeleteSpokeRequest {
2648    fn typename() -> &'static str {
2649        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
2650    }
2651}
2652
2653/// The request for
2654/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
2655///
2656/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
2657#[serde_with::serde_as]
2658#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2659#[serde(default, rename_all = "camelCase")]
2660#[non_exhaustive]
2661pub struct AcceptHubSpokeRequest {
2662    /// Required. The name of the hub into which to accept the spoke.
2663    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2664    pub name: std::string::String,
2665
2666    /// Required. The URI of the spoke to accept into the hub.
2667    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2668    pub spoke_uri: std::string::String,
2669
2670    /// Optional. A request ID to identify requests. Specify a unique request ID so
2671    /// that if you must retry your request, the server knows to ignore the request
2672    /// if it has already been completed. The server guarantees that a request
2673    /// doesn't result in creation of duplicate commitments for at least 60
2674    /// minutes.
2675    ///
2676    /// For example, consider a situation where you make an initial request and
2677    /// the request times out. If you make the request again with the same request
2678    /// ID, the server can check to see whether the original operation
2679    /// was received. If it was, the server ignores the second request. This
2680    /// behavior prevents clients from mistakenly creating duplicate commitments.
2681    ///
2682    /// The request ID must be a valid UUID, with the exception that zero UUID is
2683    /// not supported (00000000-0000-0000-0000-000000000000).
2684    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2685    pub request_id: std::string::String,
2686}
2687
2688impl AcceptHubSpokeRequest {
2689    pub fn new() -> Self {
2690        std::default::Default::default()
2691    }
2692
2693    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
2694    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2695        self.name = v.into();
2696        self
2697    }
2698
2699    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
2700    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2701        self.spoke_uri = v.into();
2702        self
2703    }
2704
2705    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
2706    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2707        self.request_id = v.into();
2708        self
2709    }
2710}
2711
2712impl wkt::message::Message for AcceptHubSpokeRequest {
2713    fn typename() -> &'static str {
2714        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
2715    }
2716}
2717
2718/// The response for
2719/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
2720///
2721/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
2722#[serde_with::serde_as]
2723#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2724#[serde(default, rename_all = "camelCase")]
2725#[non_exhaustive]
2726pub struct AcceptHubSpokeResponse {
2727    /// The spoke that was operated on.
2728    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2729    pub spoke: std::option::Option<crate::model::Spoke>,
2730}
2731
2732impl AcceptHubSpokeResponse {
2733    pub fn new() -> Self {
2734        std::default::Default::default()
2735    }
2736
2737    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
2738    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
2739        mut self,
2740        v: T,
2741    ) -> Self {
2742        self.spoke = v.into();
2743        self
2744    }
2745}
2746
2747impl wkt::message::Message for AcceptHubSpokeResponse {
2748    fn typename() -> &'static str {
2749        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
2750    }
2751}
2752
2753/// The request for
2754/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
2755///
2756/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
2757#[serde_with::serde_as]
2758#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2759#[serde(default, rename_all = "camelCase")]
2760#[non_exhaustive]
2761pub struct RejectHubSpokeRequest {
2762    /// Required. The name of the hub from which to reject the spoke.
2763    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2764    pub name: std::string::String,
2765
2766    /// Required. The URI of the spoke to reject from the hub.
2767    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2768    pub spoke_uri: std::string::String,
2769
2770    /// Optional. A request ID to identify requests. Specify a unique request ID so
2771    /// that if you must retry your request, the server knows to ignore the request
2772    /// if it has already been completed. The server guarantees that a request
2773    /// doesn't result in creation of duplicate commitments for at least 60
2774    /// minutes.
2775    ///
2776    /// For example, consider a situation where you make an initial request and
2777    /// the request times out. If you make the request again with the same request
2778    /// ID, the server can check to see whether the original operation
2779    /// was received. If it was, the server ignores the second request. This
2780    /// behavior prevents clients from mistakenly creating duplicate commitments.
2781    ///
2782    /// The request ID must be a valid UUID, with the exception that zero UUID is
2783    /// not supported (00000000-0000-0000-0000-000000000000).
2784    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2785    pub request_id: std::string::String,
2786
2787    /// Optional. Additional information provided by the hub administrator.
2788    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2789    pub details: std::string::String,
2790}
2791
2792impl RejectHubSpokeRequest {
2793    pub fn new() -> Self {
2794        std::default::Default::default()
2795    }
2796
2797    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
2798    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2799        self.name = v.into();
2800        self
2801    }
2802
2803    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
2804    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2805        self.spoke_uri = v.into();
2806        self
2807    }
2808
2809    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
2810    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2811        self.request_id = v.into();
2812        self
2813    }
2814
2815    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
2816    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2817        self.details = v.into();
2818        self
2819    }
2820}
2821
2822impl wkt::message::Message for RejectHubSpokeRequest {
2823    fn typename() -> &'static str {
2824        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
2825    }
2826}
2827
2828/// The response for
2829/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
2830///
2831/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
2832#[serde_with::serde_as]
2833#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2834#[serde(default, rename_all = "camelCase")]
2835#[non_exhaustive]
2836pub struct RejectHubSpokeResponse {
2837    /// The spoke that was operated on.
2838    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2839    pub spoke: std::option::Option<crate::model::Spoke>,
2840}
2841
2842impl RejectHubSpokeResponse {
2843    pub fn new() -> Self {
2844        std::default::Default::default()
2845    }
2846
2847    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
2848    pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
2849        mut self,
2850        v: T,
2851    ) -> Self {
2852        self.spoke = v.into();
2853        self
2854    }
2855}
2856
2857impl wkt::message::Message for RejectHubSpokeResponse {
2858    fn typename() -> &'static str {
2859        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
2860    }
2861}
2862
2863/// The request for
2864/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
2865///
2866/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
2867#[serde_with::serde_as]
2868#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2869#[serde(default, rename_all = "camelCase")]
2870#[non_exhaustive]
2871pub struct GetRouteTableRequest {
2872    /// Required. The name of the route table resource.
2873    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2874    pub name: std::string::String,
2875}
2876
2877impl GetRouteTableRequest {
2878    pub fn new() -> Self {
2879        std::default::Default::default()
2880    }
2881
2882    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
2883    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2884        self.name = v.into();
2885        self
2886    }
2887}
2888
2889impl wkt::message::Message for GetRouteTableRequest {
2890    fn typename() -> &'static str {
2891        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
2892    }
2893}
2894
2895/// The request for
2896/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
2897///
2898/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
2899#[serde_with::serde_as]
2900#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2901#[serde(default, rename_all = "camelCase")]
2902#[non_exhaustive]
2903pub struct GetRouteRequest {
2904    /// Required. The name of the route resource.
2905    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2906    pub name: std::string::String,
2907}
2908
2909impl GetRouteRequest {
2910    pub fn new() -> Self {
2911        std::default::Default::default()
2912    }
2913
2914    /// Sets the value of [name][crate::model::GetRouteRequest::name].
2915    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2916        self.name = v.into();
2917        self
2918    }
2919}
2920
2921impl wkt::message::Message for GetRouteRequest {
2922    fn typename() -> &'static str {
2923        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
2924    }
2925}
2926
2927/// Request for
2928/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
2929/// method.
2930///
2931/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
2932#[serde_with::serde_as]
2933#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2934#[serde(default, rename_all = "camelCase")]
2935#[non_exhaustive]
2936pub struct ListRoutesRequest {
2937    /// Required. The parent resource's name.
2938    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2939    pub parent: std::string::String,
2940
2941    /// The maximum number of results to return per page.
2942    pub page_size: i32,
2943
2944    /// The page token.
2945    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2946    pub page_token: std::string::String,
2947
2948    /// An expression that filters the list of results.
2949    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2950    pub filter: std::string::String,
2951
2952    /// Sort the results by a certain order.
2953    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2954    pub order_by: std::string::String,
2955}
2956
2957impl ListRoutesRequest {
2958    pub fn new() -> Self {
2959        std::default::Default::default()
2960    }
2961
2962    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2963    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2964        self.parent = v.into();
2965        self
2966    }
2967
2968    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2969    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2970        self.page_size = v.into();
2971        self
2972    }
2973
2974    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2975    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2976        self.page_token = v.into();
2977        self
2978    }
2979
2980    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2981    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2982        self.filter = v.into();
2983        self
2984    }
2985
2986    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2987    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988        self.order_by = v.into();
2989        self
2990    }
2991}
2992
2993impl wkt::message::Message for ListRoutesRequest {
2994    fn typename() -> &'static str {
2995        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
2996    }
2997}
2998
2999/// Response for
3000/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
3001/// method.
3002///
3003/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
3004#[serde_with::serde_as]
3005#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3006#[serde(default, rename_all = "camelCase")]
3007#[non_exhaustive]
3008pub struct ListRoutesResponse {
3009    /// The requested routes.
3010    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3011    pub routes: std::vec::Vec<crate::model::Route>,
3012
3013    /// The token for the next page of the response. To see more results,
3014    /// use this value as the page_token for your next request. If this value
3015    /// is empty, there are no more results.
3016    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3017    pub next_page_token: std::string::String,
3018
3019    /// RouteTables that could not be reached.
3020    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3021    pub unreachable: std::vec::Vec<std::string::String>,
3022}
3023
3024impl ListRoutesResponse {
3025    pub fn new() -> Self {
3026        std::default::Default::default()
3027    }
3028
3029    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3030    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3031        self.next_page_token = v.into();
3032        self
3033    }
3034
3035    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3036    pub fn set_routes<T, V>(mut self, v: T) -> Self
3037    where
3038        T: std::iter::IntoIterator<Item = V>,
3039        V: std::convert::Into<crate::model::Route>,
3040    {
3041        use std::iter::Iterator;
3042        self.routes = v.into_iter().map(|i| i.into()).collect();
3043        self
3044    }
3045
3046    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3047    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3048    where
3049        T: std::iter::IntoIterator<Item = V>,
3050        V: std::convert::Into<std::string::String>,
3051    {
3052        use std::iter::Iterator;
3053        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3054        self
3055    }
3056}
3057
3058impl wkt::message::Message for ListRoutesResponse {
3059    fn typename() -> &'static str {
3060        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
3061    }
3062}
3063
3064#[cfg(feature = "unstable-stream")]
3065impl gax::paginator::PageableResponse for ListRoutesResponse {
3066    type PageItem = crate::model::Route;
3067
3068    fn items(self) -> std::vec::Vec<Self::PageItem> {
3069        self.routes
3070    }
3071
3072    fn next_page_token(&self) -> std::string::String {
3073        gax::paginator::extract_token(&self.next_page_token)
3074    }
3075}
3076
3077/// Request for
3078/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
3079/// method.
3080///
3081/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
3082#[serde_with::serde_as]
3083#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3084#[serde(default, rename_all = "camelCase")]
3085#[non_exhaustive]
3086pub struct ListRouteTablesRequest {
3087    /// Required. The parent resource's name.
3088    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3089    pub parent: std::string::String,
3090
3091    /// The maximum number of results to return per page.
3092    pub page_size: i32,
3093
3094    /// The page token.
3095    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3096    pub page_token: std::string::String,
3097
3098    /// An expression that filters the list of results.
3099    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3100    pub filter: std::string::String,
3101
3102    /// Sort the results by a certain order.
3103    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3104    pub order_by: std::string::String,
3105}
3106
3107impl ListRouteTablesRequest {
3108    pub fn new() -> Self {
3109        std::default::Default::default()
3110    }
3111
3112    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
3113    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3114        self.parent = v.into();
3115        self
3116    }
3117
3118    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
3119    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3120        self.page_size = v.into();
3121        self
3122    }
3123
3124    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
3125    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3126        self.page_token = v.into();
3127        self
3128    }
3129
3130    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
3131    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3132        self.filter = v.into();
3133        self
3134    }
3135
3136    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
3137    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3138        self.order_by = v.into();
3139        self
3140    }
3141}
3142
3143impl wkt::message::Message for ListRouteTablesRequest {
3144    fn typename() -> &'static str {
3145        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
3146    }
3147}
3148
3149/// Response for
3150/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
3151/// method.
3152///
3153/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
3154#[serde_with::serde_as]
3155#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3156#[serde(default, rename_all = "camelCase")]
3157#[non_exhaustive]
3158pub struct ListRouteTablesResponse {
3159    /// The requested route tables.
3160    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3161    pub route_tables: std::vec::Vec<crate::model::RouteTable>,
3162
3163    /// The token for the next page of the response. To see more results,
3164    /// use this value as the page_token for your next request. If this value
3165    /// is empty, there are no more results.
3166    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3167    pub next_page_token: std::string::String,
3168
3169    /// Hubs that could not be reached.
3170    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3171    pub unreachable: std::vec::Vec<std::string::String>,
3172}
3173
3174impl ListRouteTablesResponse {
3175    pub fn new() -> Self {
3176        std::default::Default::default()
3177    }
3178
3179    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
3180    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3181        self.next_page_token = v.into();
3182        self
3183    }
3184
3185    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
3186    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
3187    where
3188        T: std::iter::IntoIterator<Item = V>,
3189        V: std::convert::Into<crate::model::RouteTable>,
3190    {
3191        use std::iter::Iterator;
3192        self.route_tables = v.into_iter().map(|i| i.into()).collect();
3193        self
3194    }
3195
3196    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
3197    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3198    where
3199        T: std::iter::IntoIterator<Item = V>,
3200        V: std::convert::Into<std::string::String>,
3201    {
3202        use std::iter::Iterator;
3203        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3204        self
3205    }
3206}
3207
3208impl wkt::message::Message for ListRouteTablesResponse {
3209    fn typename() -> &'static str {
3210        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
3211    }
3212}
3213
3214#[cfg(feature = "unstable-stream")]
3215impl gax::paginator::PageableResponse for ListRouteTablesResponse {
3216    type PageItem = crate::model::RouteTable;
3217
3218    fn items(self) -> std::vec::Vec<Self::PageItem> {
3219        self.route_tables
3220    }
3221
3222    fn next_page_token(&self) -> std::string::String {
3223        gax::paginator::extract_token(&self.next_page_token)
3224    }
3225}
3226
3227/// Request for
3228/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
3229/// method.
3230///
3231/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
3232#[serde_with::serde_as]
3233#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3234#[serde(default, rename_all = "camelCase")]
3235#[non_exhaustive]
3236pub struct ListGroupsRequest {
3237    /// Required. The parent resource's name.
3238    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3239    pub parent: std::string::String,
3240
3241    /// The maximum number of results to return per page.
3242    pub page_size: i32,
3243
3244    /// The page token.
3245    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3246    pub page_token: std::string::String,
3247
3248    /// An expression that filters the list of results.
3249    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3250    pub filter: std::string::String,
3251
3252    /// Sort the results by a certain order.
3253    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3254    pub order_by: std::string::String,
3255}
3256
3257impl ListGroupsRequest {
3258    pub fn new() -> Self {
3259        std::default::Default::default()
3260    }
3261
3262    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
3263    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3264        self.parent = v.into();
3265        self
3266    }
3267
3268    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
3269    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3270        self.page_size = v.into();
3271        self
3272    }
3273
3274    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
3275    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3276        self.page_token = v.into();
3277        self
3278    }
3279
3280    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
3281    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3282        self.filter = v.into();
3283        self
3284    }
3285
3286    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
3287    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3288        self.order_by = v.into();
3289        self
3290    }
3291}
3292
3293impl wkt::message::Message for ListGroupsRequest {
3294    fn typename() -> &'static str {
3295        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
3296    }
3297}
3298
3299/// Response for
3300/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
3301/// method.
3302///
3303/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
3304#[serde_with::serde_as]
3305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3306#[serde(default, rename_all = "camelCase")]
3307#[non_exhaustive]
3308pub struct ListGroupsResponse {
3309    /// The requested groups.
3310    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3311    pub groups: std::vec::Vec<crate::model::Group>,
3312
3313    /// The token for the next page of the response. To see more results,
3314    /// use this value as the page_token for your next request. If this value
3315    /// is empty, there are no more results.
3316    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3317    pub next_page_token: std::string::String,
3318
3319    /// Hubs that could not be reached.
3320    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3321    pub unreachable: std::vec::Vec<std::string::String>,
3322}
3323
3324impl ListGroupsResponse {
3325    pub fn new() -> Self {
3326        std::default::Default::default()
3327    }
3328
3329    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
3330    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3331        self.next_page_token = v.into();
3332        self
3333    }
3334
3335    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
3336    pub fn set_groups<T, V>(mut self, v: T) -> Self
3337    where
3338        T: std::iter::IntoIterator<Item = V>,
3339        V: std::convert::Into<crate::model::Group>,
3340    {
3341        use std::iter::Iterator;
3342        self.groups = v.into_iter().map(|i| i.into()).collect();
3343        self
3344    }
3345
3346    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
3347    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3348    where
3349        T: std::iter::IntoIterator<Item = V>,
3350        V: std::convert::Into<std::string::String>,
3351    {
3352        use std::iter::Iterator;
3353        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3354        self
3355    }
3356}
3357
3358impl wkt::message::Message for ListGroupsResponse {
3359    fn typename() -> &'static str {
3360        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
3361    }
3362}
3363
3364#[cfg(feature = "unstable-stream")]
3365impl gax::paginator::PageableResponse for ListGroupsResponse {
3366    type PageItem = crate::model::Group;
3367
3368    fn items(self) -> std::vec::Vec<Self::PageItem> {
3369        self.groups
3370    }
3371
3372    fn next_page_token(&self) -> std::string::String {
3373        gax::paginator::extract_token(&self.next_page_token)
3374    }
3375}
3376
3377/// A collection of Cloud VPN tunnel resources. These resources should be
3378/// redundant HA VPN tunnels that all advertise the same prefixes to Google
3379/// Cloud. Alternatively, in a passive/active configuration, all tunnels
3380/// should be capable of advertising the same prefixes.
3381#[serde_with::serde_as]
3382#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3383#[serde(default, rename_all = "camelCase")]
3384#[non_exhaustive]
3385pub struct LinkedVpnTunnels {
3386    /// The URIs of linked VPN tunnel resources.
3387    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3388    pub uris: std::vec::Vec<std::string::String>,
3389
3390    /// A value that controls whether site-to-site data transfer is enabled for
3391    /// these resources. Data transfer is available only in [supported
3392    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3393    pub site_to_site_data_transfer: bool,
3394
3395    /// Output only. The VPC network where these VPN tunnels are located.
3396    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3397    pub vpc_network: std::string::String,
3398
3399    /// Optional. IP ranges allowed to be included during import from hub (does not
3400    /// control transit connectivity). The only allowed value for now is
3401    /// "ALL_IPV4_RANGES".
3402    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3403    pub include_import_ranges: std::vec::Vec<std::string::String>,
3404}
3405
3406impl LinkedVpnTunnels {
3407    pub fn new() -> Self {
3408        std::default::Default::default()
3409    }
3410
3411    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
3412    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3413        self.site_to_site_data_transfer = v.into();
3414        self
3415    }
3416
3417    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
3418    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3419        self.vpc_network = v.into();
3420        self
3421    }
3422
3423    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
3424    pub fn set_uris<T, V>(mut self, v: T) -> Self
3425    where
3426        T: std::iter::IntoIterator<Item = V>,
3427        V: std::convert::Into<std::string::String>,
3428    {
3429        use std::iter::Iterator;
3430        self.uris = v.into_iter().map(|i| i.into()).collect();
3431        self
3432    }
3433
3434    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
3435    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
3436    where
3437        T: std::iter::IntoIterator<Item = V>,
3438        V: std::convert::Into<std::string::String>,
3439    {
3440        use std::iter::Iterator;
3441        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
3442        self
3443    }
3444}
3445
3446impl wkt::message::Message for LinkedVpnTunnels {
3447    fn typename() -> &'static str {
3448        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
3449    }
3450}
3451
3452/// A collection of VLAN attachment resources. These resources should
3453/// be redundant attachments that all advertise the same prefixes to Google
3454/// Cloud. Alternatively, in active/passive configurations, all attachments
3455/// should be capable of advertising the same prefixes.
3456#[serde_with::serde_as]
3457#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3458#[serde(default, rename_all = "camelCase")]
3459#[non_exhaustive]
3460pub struct LinkedInterconnectAttachments {
3461    /// The URIs of linked interconnect attachment resources
3462    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3463    pub uris: std::vec::Vec<std::string::String>,
3464
3465    /// A value that controls whether site-to-site data transfer is enabled for
3466    /// these resources. Data transfer is available only in [supported
3467    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3468    pub site_to_site_data_transfer: bool,
3469
3470    /// Output only. The VPC network where these VLAN attachments are located.
3471    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3472    pub vpc_network: std::string::String,
3473
3474    /// Optional. IP ranges allowed to be included during import from hub (does not
3475    /// control transit connectivity). The only allowed value for now is
3476    /// "ALL_IPV4_RANGES".
3477    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3478    pub include_import_ranges: std::vec::Vec<std::string::String>,
3479}
3480
3481impl LinkedInterconnectAttachments {
3482    pub fn new() -> Self {
3483        std::default::Default::default()
3484    }
3485
3486    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
3487    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3488        self.site_to_site_data_transfer = v.into();
3489        self
3490    }
3491
3492    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
3493    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3494        self.vpc_network = v.into();
3495        self
3496    }
3497
3498    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
3499    pub fn set_uris<T, V>(mut self, v: T) -> Self
3500    where
3501        T: std::iter::IntoIterator<Item = V>,
3502        V: std::convert::Into<std::string::String>,
3503    {
3504        use std::iter::Iterator;
3505        self.uris = v.into_iter().map(|i| i.into()).collect();
3506        self
3507    }
3508
3509    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
3510    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
3511    where
3512        T: std::iter::IntoIterator<Item = V>,
3513        V: std::convert::Into<std::string::String>,
3514    {
3515        use std::iter::Iterator;
3516        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
3517        self
3518    }
3519}
3520
3521impl wkt::message::Message for LinkedInterconnectAttachments {
3522    fn typename() -> &'static str {
3523        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
3524    }
3525}
3526
3527/// A collection of router appliance instances. If you configure multiple router
3528/// appliance instances to receive data from the same set of sites outside of
3529/// Google Cloud, we recommend that you associate those instances with the same
3530/// spoke.
3531#[serde_with::serde_as]
3532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3533#[serde(default, rename_all = "camelCase")]
3534#[non_exhaustive]
3535pub struct LinkedRouterApplianceInstances {
3536    /// The list of router appliance instances.
3537    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3538    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
3539
3540    /// A value that controls whether site-to-site data transfer is enabled for
3541    /// these resources. Data transfer is available only in [supported
3542    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3543    pub site_to_site_data_transfer: bool,
3544
3545    /// Output only. The VPC network where these router appliance instances are
3546    /// located.
3547    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3548    pub vpc_network: std::string::String,
3549
3550    /// Optional. IP ranges allowed to be included during import from hub (does not
3551    /// control transit connectivity). The only allowed value for now is
3552    /// "ALL_IPV4_RANGES".
3553    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3554    pub include_import_ranges: std::vec::Vec<std::string::String>,
3555}
3556
3557impl LinkedRouterApplianceInstances {
3558    pub fn new() -> Self {
3559        std::default::Default::default()
3560    }
3561
3562    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
3563    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3564        self.site_to_site_data_transfer = v.into();
3565        self
3566    }
3567
3568    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
3569    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3570        self.vpc_network = v.into();
3571        self
3572    }
3573
3574    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
3575    pub fn set_instances<T, V>(mut self, v: T) -> Self
3576    where
3577        T: std::iter::IntoIterator<Item = V>,
3578        V: std::convert::Into<crate::model::RouterApplianceInstance>,
3579    {
3580        use std::iter::Iterator;
3581        self.instances = v.into_iter().map(|i| i.into()).collect();
3582        self
3583    }
3584
3585    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
3586    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
3587    where
3588        T: std::iter::IntoIterator<Item = V>,
3589        V: std::convert::Into<std::string::String>,
3590    {
3591        use std::iter::Iterator;
3592        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
3593        self
3594    }
3595}
3596
3597impl wkt::message::Message for LinkedRouterApplianceInstances {
3598    fn typename() -> &'static str {
3599        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
3600    }
3601}
3602
3603/// An existing VPC network.
3604#[serde_with::serde_as]
3605#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3606#[serde(default, rename_all = "camelCase")]
3607#[non_exhaustive]
3608pub struct LinkedVpcNetwork {
3609    /// Required. The URI of the VPC network resource.
3610    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3611    pub uri: std::string::String,
3612
3613    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
3614    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3615    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
3616
3617    /// Optional. IP ranges allowed to be included from peering.
3618    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3619    pub include_export_ranges: std::vec::Vec<std::string::String>,
3620
3621    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
3622    /// service consumer VPC spoke for. These producer VPCs are connected through
3623    /// VPC peering to this spoke's backing VPC network.
3624    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3625    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
3626}
3627
3628impl LinkedVpcNetwork {
3629    pub fn new() -> Self {
3630        std::default::Default::default()
3631    }
3632
3633    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
3634    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3635        self.uri = v.into();
3636        self
3637    }
3638
3639    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
3640    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
3641    where
3642        T: std::iter::IntoIterator<Item = V>,
3643        V: std::convert::Into<std::string::String>,
3644    {
3645        use std::iter::Iterator;
3646        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
3647        self
3648    }
3649
3650    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
3651    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
3652    where
3653        T: std::iter::IntoIterator<Item = V>,
3654        V: std::convert::Into<std::string::String>,
3655    {
3656        use std::iter::Iterator;
3657        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
3658        self
3659    }
3660
3661    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
3662    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
3663    where
3664        T: std::iter::IntoIterator<Item = V>,
3665        V: std::convert::Into<std::string::String>,
3666    {
3667        use std::iter::Iterator;
3668        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
3669        self
3670    }
3671}
3672
3673impl wkt::message::Message for LinkedVpcNetwork {
3674    fn typename() -> &'static str {
3675        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
3676    }
3677}
3678
3679#[serde_with::serde_as]
3680#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3681#[serde(default, rename_all = "camelCase")]
3682#[non_exhaustive]
3683pub struct LinkedProducerVpcNetwork {
3684    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
3685    /// peered with.
3686    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3687    pub network: std::string::String,
3688
3689    /// Output only. The Service Consumer Network spoke.
3690    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3691    pub service_consumer_vpc_spoke: std::string::String,
3692
3693    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
3694    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
3695    /// hub. This peering must be in ACTIVE state.
3696    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3697    pub peering: std::string::String,
3698
3699    /// Output only. The URI of the Producer VPC.
3700    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3701    pub producer_network: std::string::String,
3702
3703    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
3704    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3705    pub exclude_export_ranges: std::vec::Vec<std::string::String>,
3706
3707    /// Optional. IP ranges allowed to be included from peering.
3708    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3709    pub include_export_ranges: std::vec::Vec<std::string::String>,
3710}
3711
3712impl LinkedProducerVpcNetwork {
3713    pub fn new() -> Self {
3714        std::default::Default::default()
3715    }
3716
3717    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
3718    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719        self.network = v.into();
3720        self
3721    }
3722
3723    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
3724    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
3725        mut self,
3726        v: T,
3727    ) -> Self {
3728        self.service_consumer_vpc_spoke = v.into();
3729        self
3730    }
3731
3732    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
3733    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3734        self.peering = v.into();
3735        self
3736    }
3737
3738    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
3739    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
3740        mut self,
3741        v: T,
3742    ) -> Self {
3743        self.producer_network = v.into();
3744        self
3745    }
3746
3747    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
3748    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
3749    where
3750        T: std::iter::IntoIterator<Item = V>,
3751        V: std::convert::Into<std::string::String>,
3752    {
3753        use std::iter::Iterator;
3754        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
3755        self
3756    }
3757
3758    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
3759    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
3760    where
3761        T: std::iter::IntoIterator<Item = V>,
3762        V: std::convert::Into<std::string::String>,
3763    {
3764        use std::iter::Iterator;
3765        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
3766        self
3767    }
3768}
3769
3770impl wkt::message::Message for LinkedProducerVpcNetwork {
3771    fn typename() -> &'static str {
3772        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
3773    }
3774}
3775
3776/// A router appliance instance is a Compute Engine virtual machine (VM) instance
3777/// that acts as a BGP speaker. A router appliance instance is specified by the
3778/// URI of the VM and the internal IP address of one of the VM's network
3779/// interfaces.
3780#[serde_with::serde_as]
3781#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3782#[serde(default, rename_all = "camelCase")]
3783#[non_exhaustive]
3784pub struct RouterApplianceInstance {
3785    /// The URI of the VM.
3786    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3787    pub virtual_machine: std::string::String,
3788
3789    /// The IP address on the VM to use for peering.
3790    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3791    pub ip_address: std::string::String,
3792}
3793
3794impl RouterApplianceInstance {
3795    pub fn new() -> Self {
3796        std::default::Default::default()
3797    }
3798
3799    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
3800    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3801        self.virtual_machine = v.into();
3802        self
3803    }
3804
3805    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
3806    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3807        self.ip_address = v.into();
3808        self
3809    }
3810}
3811
3812impl wkt::message::Message for RouterApplianceInstance {
3813    fn typename() -> &'static str {
3814        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
3815    }
3816}
3817
3818/// Metadata about locations
3819#[serde_with::serde_as]
3820#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3821#[serde(default, rename_all = "camelCase")]
3822#[non_exhaustive]
3823pub struct LocationMetadata {
3824    /// List of supported features
3825    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3826    pub location_features: std::vec::Vec<crate::model::LocationFeature>,
3827}
3828
3829impl LocationMetadata {
3830    pub fn new() -> Self {
3831        std::default::Default::default()
3832    }
3833
3834    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
3835    pub fn set_location_features<T, V>(mut self, v: T) -> Self
3836    where
3837        T: std::iter::IntoIterator<Item = V>,
3838        V: std::convert::Into<crate::model::LocationFeature>,
3839    {
3840        use std::iter::Iterator;
3841        self.location_features = v.into_iter().map(|i| i.into()).collect();
3842        self
3843    }
3844}
3845
3846impl wkt::message::Message for LocationMetadata {
3847    fn typename() -> &'static str {
3848        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
3849    }
3850}
3851
3852#[serde_with::serde_as]
3853#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3854#[serde(default, rename_all = "camelCase")]
3855#[non_exhaustive]
3856pub struct NextHopVpcNetwork {
3857    /// The URI of the VPC network resource
3858    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3859    pub uri: std::string::String,
3860}
3861
3862impl NextHopVpcNetwork {
3863    pub fn new() -> Self {
3864        std::default::Default::default()
3865    }
3866
3867    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
3868    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3869        self.uri = v.into();
3870        self
3871    }
3872}
3873
3874impl wkt::message::Message for NextHopVpcNetwork {
3875    fn typename() -> &'static str {
3876        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
3877    }
3878}
3879
3880/// A route next hop that leads to a VPN tunnel resource.
3881#[serde_with::serde_as]
3882#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3883#[serde(default, rename_all = "camelCase")]
3884#[non_exhaustive]
3885pub struct NextHopVPNTunnel {
3886    /// The URI of the VPN tunnel resource.
3887    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3888    pub uri: std::string::String,
3889
3890    /// The VPC network where this VPN tunnel is located.
3891    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3892    pub vpc_network: std::string::String,
3893
3894    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
3895    /// resource. Data transfer is available only in [supported
3896    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3897    pub site_to_site_data_transfer: bool,
3898}
3899
3900impl NextHopVPNTunnel {
3901    pub fn new() -> Self {
3902        std::default::Default::default()
3903    }
3904
3905    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
3906    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3907        self.uri = v.into();
3908        self
3909    }
3910
3911    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
3912    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3913        self.vpc_network = v.into();
3914        self
3915    }
3916
3917    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
3918    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3919        self.site_to_site_data_transfer = v.into();
3920        self
3921    }
3922}
3923
3924impl wkt::message::Message for NextHopVPNTunnel {
3925    fn typename() -> &'static str {
3926        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
3927    }
3928}
3929
3930/// A route next hop that leads to a Router appliance instance.
3931#[serde_with::serde_as]
3932#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3933#[serde(default, rename_all = "camelCase")]
3934#[non_exhaustive]
3935pub struct NextHopRouterApplianceInstance {
3936    /// The URI of the Router appliance instance.
3937    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3938    pub uri: std::string::String,
3939
3940    /// The VPC network where this VM is located.
3941    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3942    pub vpc_network: std::string::String,
3943
3944    /// Indicates whether site-to-site data transfer is allowed for this Router
3945    /// appliance instance resource. Data transfer is available only in [supported
3946    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3947    pub site_to_site_data_transfer: bool,
3948}
3949
3950impl NextHopRouterApplianceInstance {
3951    pub fn new() -> Self {
3952        std::default::Default::default()
3953    }
3954
3955    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
3956    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3957        self.uri = v.into();
3958        self
3959    }
3960
3961    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
3962    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3963        self.vpc_network = v.into();
3964        self
3965    }
3966
3967    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
3968    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3969        self.site_to_site_data_transfer = v.into();
3970        self
3971    }
3972}
3973
3974impl wkt::message::Message for NextHopRouterApplianceInstance {
3975    fn typename() -> &'static str {
3976        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
3977    }
3978}
3979
3980/// A route next hop that leads to an interconnect attachment resource.
3981#[serde_with::serde_as]
3982#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3983#[serde(default, rename_all = "camelCase")]
3984#[non_exhaustive]
3985pub struct NextHopInterconnectAttachment {
3986    /// The URI of the interconnect attachment resource.
3987    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3988    pub uri: std::string::String,
3989
3990    /// The VPC network where this interconnect attachment is located.
3991    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3992    pub vpc_network: std::string::String,
3993
3994    /// Indicates whether site-to-site data transfer is allowed for this
3995    /// interconnect attachment resource. Data transfer is available only in
3996    /// [supported
3997    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
3998    pub site_to_site_data_transfer: bool,
3999}
4000
4001impl NextHopInterconnectAttachment {
4002    pub fn new() -> Self {
4003        std::default::Default::default()
4004    }
4005
4006    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
4007    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4008        self.uri = v.into();
4009        self
4010    }
4011
4012    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
4013    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4014        self.vpc_network = v.into();
4015        self
4016    }
4017
4018    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
4019    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4020        self.site_to_site_data_transfer = v.into();
4021        self
4022    }
4023}
4024
4025impl wkt::message::Message for NextHopInterconnectAttachment {
4026    fn typename() -> &'static str {
4027        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
4028    }
4029}
4030
4031/// Summarizes information about the spokes associated with a hub.
4032/// The summary includes a count of spokes according to type
4033/// and according to state. If any spokes are inactive,
4034/// the summary also lists the reasons they are inactive,
4035/// including a count for each reason.
4036#[serde_with::serde_as]
4037#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4038#[serde(default, rename_all = "camelCase")]
4039#[non_exhaustive]
4040pub struct SpokeSummary {
4041    /// Output only. Counts the number of spokes of each type that are
4042    /// associated with a specific hub.
4043    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4044    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
4045
4046    /// Output only. Counts the number of spokes that are in each state
4047    /// and associated with a given hub.
4048    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4049    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
4050
4051    /// Output only. Counts the number of spokes that are inactive for each
4052    /// possible reason and associated with a given hub.
4053    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4054    pub spoke_state_reason_counts:
4055        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
4056}
4057
4058impl SpokeSummary {
4059    pub fn new() -> Self {
4060        std::default::Default::default()
4061    }
4062
4063    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
4064    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
4065    where
4066        T: std::iter::IntoIterator<Item = V>,
4067        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
4068    {
4069        use std::iter::Iterator;
4070        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
4071        self
4072    }
4073
4074    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
4075    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
4076    where
4077        T: std::iter::IntoIterator<Item = V>,
4078        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
4079    {
4080        use std::iter::Iterator;
4081        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
4082        self
4083    }
4084
4085    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
4086    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
4087    where
4088        T: std::iter::IntoIterator<Item = V>,
4089        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
4090    {
4091        use std::iter::Iterator;
4092        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
4093        self
4094    }
4095}
4096
4097impl wkt::message::Message for SpokeSummary {
4098    fn typename() -> &'static str {
4099        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
4100    }
4101}
4102
4103/// Defines additional types related to SpokeSummary
4104pub mod spoke_summary {
4105    #[allow(unused_imports)]
4106    use super::*;
4107
4108    /// The number of spokes of a given type that are associated
4109    /// with a specific hub. The type indicates what kind of
4110    /// resource is associated with the spoke.
4111    #[serde_with::serde_as]
4112    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4113    #[serde(default, rename_all = "camelCase")]
4114    #[non_exhaustive]
4115    pub struct SpokeTypeCount {
4116        /// Output only. The type of the spokes.
4117        pub spoke_type: crate::model::SpokeType,
4118
4119        /// Output only. The total number of spokes of this type that are
4120        /// associated with the hub.
4121        #[serde_as(as = "serde_with::DisplayFromStr")]
4122        pub count: i64,
4123    }
4124
4125    impl SpokeTypeCount {
4126        pub fn new() -> Self {
4127            std::default::Default::default()
4128        }
4129
4130        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
4131        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
4132            mut self,
4133            v: T,
4134        ) -> Self {
4135            self.spoke_type = v.into();
4136            self
4137        }
4138
4139        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
4140        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4141            self.count = v.into();
4142            self
4143        }
4144    }
4145
4146    impl wkt::message::Message for SpokeTypeCount {
4147        fn typename() -> &'static str {
4148            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
4149        }
4150    }
4151
4152    /// The number of spokes that are in a particular state
4153    /// and associated with a given hub.
4154    #[serde_with::serde_as]
4155    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4156    #[serde(default, rename_all = "camelCase")]
4157    #[non_exhaustive]
4158    pub struct SpokeStateCount {
4159        /// Output only. The state of the spokes.
4160        pub state: crate::model::State,
4161
4162        /// Output only. The total number of spokes that are in this state
4163        /// and associated with a given hub.
4164        #[serde_as(as = "serde_with::DisplayFromStr")]
4165        pub count: i64,
4166    }
4167
4168    impl SpokeStateCount {
4169        pub fn new() -> Self {
4170            std::default::Default::default()
4171        }
4172
4173        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
4174        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4175            self.state = v.into();
4176            self
4177        }
4178
4179        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
4180        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4181            self.count = v.into();
4182            self
4183        }
4184    }
4185
4186    impl wkt::message::Message for SpokeStateCount {
4187        fn typename() -> &'static str {
4188            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
4189        }
4190    }
4191
4192    /// The number of spokes in the hub that are inactive for this reason.
4193    #[serde_with::serde_as]
4194    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4195    #[serde(default, rename_all = "camelCase")]
4196    #[non_exhaustive]
4197    pub struct SpokeStateReasonCount {
4198        /// Output only. The reason that a spoke is inactive.
4199        pub state_reason_code: crate::model::spoke::state_reason::Code,
4200
4201        /// Output only. The total number of spokes that are inactive for a
4202        /// particular reason and associated with a given hub.
4203        #[serde_as(as = "serde_with::DisplayFromStr")]
4204        pub count: i64,
4205    }
4206
4207    impl SpokeStateReasonCount {
4208        pub fn new() -> Self {
4209            std::default::Default::default()
4210        }
4211
4212        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
4213        pub fn set_state_reason_code<
4214            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
4215        >(
4216            mut self,
4217            v: T,
4218        ) -> Self {
4219            self.state_reason_code = v.into();
4220            self
4221        }
4222
4223        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
4224        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4225            self.count = v.into();
4226            self
4227        }
4228    }
4229
4230    impl wkt::message::Message for SpokeStateReasonCount {
4231        fn typename() -> &'static str {
4232            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
4233        }
4234    }
4235}
4236
4237/// The request for
4238/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
4239///
4240/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
4241#[serde_with::serde_as]
4242#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4243#[serde(default, rename_all = "camelCase")]
4244#[non_exhaustive]
4245pub struct GetGroupRequest {
4246    /// Required. The name of the route table resource.
4247    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4248    pub name: std::string::String,
4249}
4250
4251impl GetGroupRequest {
4252    pub fn new() -> Self {
4253        std::default::Default::default()
4254    }
4255
4256    /// Sets the value of [name][crate::model::GetGroupRequest::name].
4257    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4258        self.name = v.into();
4259        self
4260    }
4261}
4262
4263impl wkt::message::Message for GetGroupRequest {
4264    fn typename() -> &'static str {
4265        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
4266    }
4267}
4268
4269/// Request for
4270/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
4271/// method.
4272///
4273/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
4274#[serde_with::serde_as]
4275#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4276#[serde(default, rename_all = "camelCase")]
4277#[non_exhaustive]
4278pub struct UpdateGroupRequest {
4279    /// Optional. In the case of an update to an existing group, field mask is used
4280    /// to specify the fields to be overwritten. The fields specified in the
4281    /// update_mask are relative to the resource, not the full request. A field is
4282    /// overwritten if it is in the mask. If the user does not provide a mask, then
4283    /// all fields are overwritten.
4284    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4285    pub update_mask: std::option::Option<wkt::FieldMask>,
4286
4287    /// Required. The state that the group should be in after the update.
4288    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4289    pub group: std::option::Option<crate::model::Group>,
4290
4291    /// Optional. A request ID to identify requests. Specify a unique request ID so
4292    /// that if you must retry your request, the server knows to ignore the request
4293    /// if it has already been completed. The server guarantees that a request
4294    /// doesn't result in creation of duplicate commitments for at least 60
4295    /// minutes.
4296    ///
4297    /// For example, consider a situation where you make an initial request and
4298    /// the request times out. If you make the request again with the same request
4299    /// ID, the server can check to see whether the original operation
4300    /// was received. If it was, the server ignores the second request. This
4301    /// behavior prevents clients from mistakenly creating duplicate commitments.
4302    ///
4303    /// The request ID must be a valid UUID, with the exception that zero UUID is
4304    /// not supported (00000000-0000-0000-0000-000000000000).
4305    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4306    pub request_id: std::string::String,
4307}
4308
4309impl UpdateGroupRequest {
4310    pub fn new() -> Self {
4311        std::default::Default::default()
4312    }
4313
4314    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
4315    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
4316        mut self,
4317        v: T,
4318    ) -> Self {
4319        self.update_mask = v.into();
4320        self
4321    }
4322
4323    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
4324    pub fn set_group<T: std::convert::Into<std::option::Option<crate::model::Group>>>(
4325        mut self,
4326        v: T,
4327    ) -> Self {
4328        self.group = v.into();
4329        self
4330    }
4331
4332    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
4333    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4334        self.request_id = v.into();
4335        self
4336    }
4337}
4338
4339impl wkt::message::Message for UpdateGroupRequest {
4340    fn typename() -> &'static str {
4341        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
4342    }
4343}
4344
4345/// Policy Based Routes (PBR) are more powerful routes that allows GCP customers
4346/// to route their L4 network traffic based on not just destination IP, but also
4347/// source IP, protocol and more. A PBR always take precedence when it conflicts
4348/// with other types of routes.
4349/// Next id: 22
4350#[serde_with::serde_as]
4351#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4352#[serde(default, rename_all = "camelCase")]
4353#[non_exhaustive]
4354pub struct PolicyBasedRoute {
4355    /// Immutable. A unique name of the resource in the form of
4356    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
4357    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4358    pub name: std::string::String,
4359
4360    /// Output only. Time when the PolicyBasedRoute was created.
4361    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4362    pub create_time: std::option::Option<wkt::Timestamp>,
4363
4364    /// Output only. Time when the PolicyBasedRoute was updated.
4365    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4366    pub update_time: std::option::Option<wkt::Timestamp>,
4367
4368    /// User-defined labels.
4369    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4370    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4371
4372    /// Optional. An optional description of this resource. Provide this field when
4373    /// you create the resource.
4374    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4375    pub description: std::string::String,
4376
4377    /// Required. Fully-qualified URL of the network that this route applies to.
4378    /// e.g. projects/my-project/global/networks/my-network.
4379    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4380    pub network: std::string::String,
4381
4382    /// Required. The filter to match L4 traffic.
4383    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4384    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
4385
4386    /// Optional. The priority of this policy based route. Priority is used to
4387    /// break ties in cases where there are more than one matching policy based
4388    /// routes found. In cases where multiple policy based routes are matched, the
4389    /// one with the lowest-numbered priority value wins. The default value is
4390    /// 1000. The priority value must be from 1 to 65535, inclusive.
4391    pub priority: i32,
4392
4393    /// Output only. If potential misconfigurations are detected for this route,
4394    /// this field will be populated with warning messages.
4395    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4396    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
4397
4398    /// Output only. Server-defined fully-qualified URL for this resource.
4399    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4400    pub self_link: std::string::String,
4401
4402    /// Output only. Type of this resource. Always
4403    /// networkconnectivity#policyBasedRoute for Policy Based Route resources.
4404    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4405    pub kind: std::string::String,
4406
4407    /// Target specifies network endpoints to which this policy based route applies
4408    /// to. If none of the target is specified, the PBR will be installed on all
4409    /// network endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
4410    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4411    pub target: std::option::Option<crate::model::policy_based_route::Target>,
4412
4413    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4414    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
4415}
4416
4417impl PolicyBasedRoute {
4418    pub fn new() -> Self {
4419        std::default::Default::default()
4420    }
4421
4422    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
4423    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4424        self.name = v.into();
4425        self
4426    }
4427
4428    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
4429    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4430        mut self,
4431        v: T,
4432    ) -> Self {
4433        self.create_time = v.into();
4434        self
4435    }
4436
4437    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
4438    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4439        mut self,
4440        v: T,
4441    ) -> Self {
4442        self.update_time = v.into();
4443        self
4444    }
4445
4446    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
4447    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4448        self.description = v.into();
4449        self
4450    }
4451
4452    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
4453    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4454        self.network = v.into();
4455        self
4456    }
4457
4458    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
4459    pub fn set_filter<
4460        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Filter>>,
4461    >(
4462        mut self,
4463        v: T,
4464    ) -> Self {
4465        self.filter = v.into();
4466        self
4467    }
4468
4469    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
4470    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4471        self.priority = v.into();
4472        self
4473    }
4474
4475    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
4476    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477        self.self_link = v.into();
4478        self
4479    }
4480
4481    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
4482    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4483        self.kind = v.into();
4484        self
4485    }
4486
4487    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
4488    pub fn set_warnings<T, V>(mut self, v: T) -> Self
4489    where
4490        T: std::iter::IntoIterator<Item = V>,
4491        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
4492    {
4493        use std::iter::Iterator;
4494        self.warnings = v.into_iter().map(|i| i.into()).collect();
4495        self
4496    }
4497
4498    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
4499    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4500    where
4501        T: std::iter::IntoIterator<Item = (K, V)>,
4502        K: std::convert::Into<std::string::String>,
4503        V: std::convert::Into<std::string::String>,
4504    {
4505        use std::iter::Iterator;
4506        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4507        self
4508    }
4509
4510    /// Sets the value of `target`.
4511    pub fn set_target<
4512        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
4513    >(
4514        mut self,
4515        v: T,
4516    ) -> Self {
4517        self.target = v.into();
4518        self
4519    }
4520
4521    /// The value of [target][crate::model::PolicyBasedRoute::target]
4522    /// if it holds a `VirtualMachine`, `None` if the field is not set or
4523    /// holds a different branch.
4524    pub fn get_virtual_machine(
4525        &self,
4526    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
4527    {
4528        #[allow(unreachable_patterns)]
4529        self.target.as_ref().and_then(|v| match v {
4530            crate::model::policy_based_route::Target::VirtualMachine(v) => {
4531                std::option::Option::Some(v)
4532            }
4533            _ => std::option::Option::None,
4534        })
4535    }
4536
4537    /// The value of [target][crate::model::PolicyBasedRoute::target]
4538    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4539    /// holds a different branch.
4540    pub fn get_interconnect_attachment(
4541        &self,
4542    ) -> std::option::Option<
4543        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
4544    > {
4545        #[allow(unreachable_patterns)]
4546        self.target.as_ref().and_then(|v| match v {
4547            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
4548                std::option::Option::Some(v)
4549            }
4550            _ => std::option::Option::None,
4551        })
4552    }
4553
4554    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
4555    /// to hold a `VirtualMachine`.
4556    ///
4557    /// Note that all the setters affecting `target` are
4558    /// mutually exclusive.
4559    pub fn set_virtual_machine<
4560        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
4561    >(
4562        mut self,
4563        v: T,
4564    ) -> Self {
4565        self.target = std::option::Option::Some(
4566            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
4567        );
4568        self
4569    }
4570
4571    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
4572    /// to hold a `InterconnectAttachment`.
4573    ///
4574    /// Note that all the setters affecting `target` are
4575    /// mutually exclusive.
4576    pub fn set_interconnect_attachment<
4577        T: std::convert::Into<
4578            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
4579        >,
4580    >(
4581        mut self,
4582        v: T,
4583    ) -> Self {
4584        self.target = std::option::Option::Some(
4585            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
4586        );
4587        self
4588    }
4589
4590    /// Sets the value of `next_hop`.
4591    pub fn set_next_hop<
4592        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
4593    >(
4594        mut self,
4595        v: T,
4596    ) -> Self {
4597        self.next_hop = v.into();
4598        self
4599    }
4600
4601    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
4602    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
4603    /// holds a different branch.
4604    pub fn get_next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
4605        #[allow(unreachable_patterns)]
4606        self.next_hop.as_ref().and_then(|v| match v {
4607            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
4608                std::option::Option::Some(v)
4609            }
4610            _ => std::option::Option::None,
4611        })
4612    }
4613
4614    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
4615    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
4616    /// holds a different branch.
4617    pub fn get_next_hop_other_routes(
4618        &self,
4619    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
4620        #[allow(unreachable_patterns)]
4621        self.next_hop.as_ref().and_then(|v| match v {
4622            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
4623                std::option::Option::Some(v)
4624            }
4625            _ => std::option::Option::None,
4626        })
4627    }
4628
4629    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
4630    /// to hold a `NextHopIlbIp`.
4631    ///
4632    /// Note that all the setters affecting `next_hop` are
4633    /// mutually exclusive.
4634    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4635        self.next_hop = std::option::Option::Some(
4636            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
4637        );
4638        self
4639    }
4640
4641    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
4642    /// to hold a `NextHopOtherRoutes`.
4643    ///
4644    /// Note that all the setters affecting `next_hop` are
4645    /// mutually exclusive.
4646    pub fn set_next_hop_other_routes<
4647        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
4648    >(
4649        mut self,
4650        v: T,
4651    ) -> Self {
4652        self.next_hop = std::option::Option::Some(
4653            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
4654        );
4655        self
4656    }
4657}
4658
4659impl wkt::message::Message for PolicyBasedRoute {
4660    fn typename() -> &'static str {
4661        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
4662    }
4663}
4664
4665/// Defines additional types related to PolicyBasedRoute
4666pub mod policy_based_route {
4667    #[allow(unused_imports)]
4668    use super::*;
4669
4670    /// VM instances to which this policy based route applies to.
4671    #[serde_with::serde_as]
4672    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4673    #[serde(default, rename_all = "camelCase")]
4674    #[non_exhaustive]
4675    pub struct VirtualMachine {
4676        /// Optional. A list of VM instance tags to which this policy based route
4677        /// applies to. VM instances that have ANY of tags specified here will
4678        /// install this PBR.
4679        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4680        pub tags: std::vec::Vec<std::string::String>,
4681    }
4682
4683    impl VirtualMachine {
4684        pub fn new() -> Self {
4685            std::default::Default::default()
4686        }
4687
4688        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
4689        pub fn set_tags<T, V>(mut self, v: T) -> Self
4690        where
4691            T: std::iter::IntoIterator<Item = V>,
4692            V: std::convert::Into<std::string::String>,
4693        {
4694            use std::iter::Iterator;
4695            self.tags = v.into_iter().map(|i| i.into()).collect();
4696            self
4697        }
4698    }
4699
4700    impl wkt::message::Message for VirtualMachine {
4701        fn typename() -> &'static str {
4702            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
4703        }
4704    }
4705
4706    /// InterconnectAttachment to which this route applies to.
4707    #[serde_with::serde_as]
4708    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4709    #[serde(default, rename_all = "camelCase")]
4710    #[non_exhaustive]
4711    pub struct InterconnectAttachment {
4712        /// Optional. Cloud region to install this policy based route on interconnect
4713        /// attachment. Use `all` to install it on all interconnect attachments.
4714        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4715        pub region: std::string::String,
4716    }
4717
4718    impl InterconnectAttachment {
4719        pub fn new() -> Self {
4720            std::default::Default::default()
4721        }
4722
4723        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
4724        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4725            self.region = v.into();
4726            self
4727        }
4728    }
4729
4730    impl wkt::message::Message for InterconnectAttachment {
4731        fn typename() -> &'static str {
4732            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
4733        }
4734    }
4735
4736    /// Filter matches L4 traffic.
4737    #[serde_with::serde_as]
4738    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4739    #[serde(default, rename_all = "camelCase")]
4740    #[non_exhaustive]
4741    pub struct Filter {
4742        /// Optional. The IP protocol that this policy based route applies to. Valid
4743        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
4744        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4745        pub ip_protocol: std::string::String,
4746
4747        /// Optional. The source IP range of outgoing packets that this policy based
4748        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
4749        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4750        pub src_range: std::string::String,
4751
4752        /// Optional. The destination IP range of outgoing packets that this policy
4753        /// based route applies to. Default is "0.0.0.0/0" if protocol version is
4754        /// IPv4.
4755        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4756        pub dest_range: std::string::String,
4757
4758        /// Required. Internet protocol versions this policy based route applies to.
4759        /// For this version, only IPV4 is supported.
4760        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
4761    }
4762
4763    impl Filter {
4764        pub fn new() -> Self {
4765            std::default::Default::default()
4766        }
4767
4768        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
4769        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4770            self.ip_protocol = v.into();
4771            self
4772        }
4773
4774        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
4775        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4776            self.src_range = v.into();
4777            self
4778        }
4779
4780        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
4781        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4782            self.dest_range = v.into();
4783            self
4784        }
4785
4786        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
4787        pub fn set_protocol_version<
4788            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
4789        >(
4790            mut self,
4791            v: T,
4792        ) -> Self {
4793            self.protocol_version = v.into();
4794            self
4795        }
4796    }
4797
4798    impl wkt::message::Message for Filter {
4799        fn typename() -> &'static str {
4800            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
4801        }
4802    }
4803
4804    /// Defines additional types related to Filter
4805    pub mod filter {
4806        #[allow(unused_imports)]
4807        use super::*;
4808
4809        /// The internet protocol version.
4810        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4811        pub struct ProtocolVersion(std::borrow::Cow<'static, str>);
4812
4813        impl ProtocolVersion {
4814            /// Creates a new ProtocolVersion instance.
4815            pub const fn new(v: &'static str) -> Self {
4816                Self(std::borrow::Cow::Borrowed(v))
4817            }
4818
4819            /// Gets the enum value.
4820            pub fn value(&self) -> &str {
4821                &self.0
4822            }
4823        }
4824
4825        /// Useful constants to work with [ProtocolVersion](ProtocolVersion)
4826        pub mod protocol_version {
4827            use super::ProtocolVersion;
4828
4829            /// Default value.
4830            pub const PROTOCOL_VERSION_UNSPECIFIED: ProtocolVersion =
4831                ProtocolVersion::new("PROTOCOL_VERSION_UNSPECIFIED");
4832
4833            /// The PBR is for IPv4 internet protocol traffic.
4834            pub const IPV4: ProtocolVersion = ProtocolVersion::new("IPV4");
4835        }
4836
4837        impl std::convert::From<std::string::String> for ProtocolVersion {
4838            fn from(value: std::string::String) -> Self {
4839                Self(std::borrow::Cow::Owned(value))
4840            }
4841        }
4842    }
4843
4844    /// Informational warning message.
4845    #[serde_with::serde_as]
4846    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4847    #[serde(default, rename_all = "camelCase")]
4848    #[non_exhaustive]
4849    pub struct Warnings {
4850        /// Output only. A warning code, if applicable.
4851        pub code: crate::model::policy_based_route::warnings::Code,
4852
4853        /// Output only. Metadata about this warning in key: value format. The key
4854        /// should provides more detail on the warning being returned. For example,
4855        /// for warnings where there are no results in a list request for a
4856        /// particular zone, this key might be scope and the key value might be the
4857        /// zone name. Other examples might be a key indicating a deprecated resource
4858        /// and a suggested replacement.
4859        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4860        pub data: std::collections::HashMap<std::string::String, std::string::String>,
4861
4862        /// Output only. A human-readable description of the warning code.
4863        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4864        pub warning_message: std::string::String,
4865    }
4866
4867    impl Warnings {
4868        pub fn new() -> Self {
4869            std::default::Default::default()
4870        }
4871
4872        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
4873        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
4874            mut self,
4875            v: T,
4876        ) -> Self {
4877            self.code = v.into();
4878            self
4879        }
4880
4881        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
4882        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
4883            mut self,
4884            v: T,
4885        ) -> Self {
4886            self.warning_message = v.into();
4887            self
4888        }
4889
4890        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
4891        pub fn set_data<T, K, V>(mut self, v: T) -> Self
4892        where
4893            T: std::iter::IntoIterator<Item = (K, V)>,
4894            K: std::convert::Into<std::string::String>,
4895            V: std::convert::Into<std::string::String>,
4896        {
4897            use std::iter::Iterator;
4898            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4899            self
4900        }
4901    }
4902
4903    impl wkt::message::Message for Warnings {
4904        fn typename() -> &'static str {
4905            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
4906        }
4907    }
4908
4909    /// Defines additional types related to Warnings
4910    pub mod warnings {
4911        #[allow(unused_imports)]
4912        use super::*;
4913
4914        /// Warning code for Policy Based Routing. Expect to add values in the
4915        /// future.
4916        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4917        pub struct Code(std::borrow::Cow<'static, str>);
4918
4919        impl Code {
4920            /// Creates a new Code instance.
4921            pub const fn new(v: &'static str) -> Self {
4922                Self(std::borrow::Cow::Borrowed(v))
4923            }
4924
4925            /// Gets the enum value.
4926            pub fn value(&self) -> &str {
4927                &self.0
4928            }
4929        }
4930
4931        /// Useful constants to work with [Code](Code)
4932        pub mod code {
4933            use super::Code;
4934
4935            /// Default value.
4936            pub const WARNING_UNSPECIFIED: Code = Code::new("WARNING_UNSPECIFIED");
4937
4938            /// The policy based route is not active and functioning. Common causes are
4939            /// the dependent network was deleted or the resource project was turned
4940            /// off.
4941            pub const RESOURCE_NOT_ACTIVE: Code = Code::new("RESOURCE_NOT_ACTIVE");
4942
4943            /// The policy based route is being modified (e.g. created/deleted) at this
4944            /// time.
4945            pub const RESOURCE_BEING_MODIFIED: Code = Code::new("RESOURCE_BEING_MODIFIED");
4946        }
4947
4948        impl std::convert::From<std::string::String> for Code {
4949            fn from(value: std::string::String) -> Self {
4950                Self(std::borrow::Cow::Owned(value))
4951            }
4952        }
4953    }
4954
4955    /// The other routing cases.
4956    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4957    pub struct OtherRoutes(std::borrow::Cow<'static, str>);
4958
4959    impl OtherRoutes {
4960        /// Creates a new OtherRoutes instance.
4961        pub const fn new(v: &'static str) -> Self {
4962            Self(std::borrow::Cow::Borrowed(v))
4963        }
4964
4965        /// Gets the enum value.
4966        pub fn value(&self) -> &str {
4967            &self.0
4968        }
4969    }
4970
4971    /// Useful constants to work with [OtherRoutes](OtherRoutes)
4972    pub mod other_routes {
4973        use super::OtherRoutes;
4974
4975        /// Default value.
4976        pub const OTHER_ROUTES_UNSPECIFIED: OtherRoutes =
4977            OtherRoutes::new("OTHER_ROUTES_UNSPECIFIED");
4978
4979        /// Use the routes from the default routing tables (system-generated routes,
4980        /// custom routes, peering route) to determine the next hop. This will
4981        /// effectively exclude matching packets being applied on other PBRs with a
4982        /// lower priority.
4983        pub const DEFAULT_ROUTING: OtherRoutes = OtherRoutes::new("DEFAULT_ROUTING");
4984    }
4985
4986    impl std::convert::From<std::string::String> for OtherRoutes {
4987        fn from(value: std::string::String) -> Self {
4988            Self(std::borrow::Cow::Owned(value))
4989        }
4990    }
4991
4992    /// Target specifies network endpoints to which this policy based route applies
4993    /// to. If none of the target is specified, the PBR will be installed on all
4994    /// network endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
4995    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4996    #[serde(rename_all = "camelCase")]
4997    #[non_exhaustive]
4998    pub enum Target {
4999        /// Optional. VM instances to which this policy based route applies to.
5000        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
5001        /// Optional. The interconnect attachments to which this route applies to.
5002        InterconnectAttachment(
5003            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
5004        ),
5005    }
5006
5007    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5008    #[serde(rename_all = "camelCase")]
5009    #[non_exhaustive]
5010    pub enum NextHop {
5011        /// Optional. The IP of a global access enabled L4 ILB that should be the
5012        /// next hop to handle matching packets. For this version, only
5013        /// next_hop_ilb_ip is supported.
5014        NextHopIlbIp(std::string::String),
5015        /// Optional. Other routes that will be referenced to determine the next hop
5016        /// of the packet.
5017        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
5018    }
5019}
5020
5021/// Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
5022#[serde_with::serde_as]
5023#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5024#[serde(default, rename_all = "camelCase")]
5025#[non_exhaustive]
5026pub struct ListPolicyBasedRoutesRequest {
5027    /// Required. The parent resource's name.
5028    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5029    pub parent: std::string::String,
5030
5031    /// The maximum number of results per page that should be returned.
5032    pub page_size: i32,
5033
5034    /// The page token.
5035    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5036    pub page_token: std::string::String,
5037
5038    /// A filter expression that filters the results listed in the response.
5039    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5040    pub filter: std::string::String,
5041
5042    /// Sort the results by a certain order.
5043    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5044    pub order_by: std::string::String,
5045}
5046
5047impl ListPolicyBasedRoutesRequest {
5048    pub fn new() -> Self {
5049        std::default::Default::default()
5050    }
5051
5052    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
5053    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5054        self.parent = v.into();
5055        self
5056    }
5057
5058    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
5059    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5060        self.page_size = v.into();
5061        self
5062    }
5063
5064    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
5065    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5066        self.page_token = v.into();
5067        self
5068    }
5069
5070    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
5071    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5072        self.filter = v.into();
5073        self
5074    }
5075
5076    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
5077    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5078        self.order_by = v.into();
5079        self
5080    }
5081}
5082
5083impl wkt::message::Message for ListPolicyBasedRoutesRequest {
5084    fn typename() -> &'static str {
5085        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
5086    }
5087}
5088
5089/// Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
5090#[serde_with::serde_as]
5091#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5092#[serde(default, rename_all = "camelCase")]
5093#[non_exhaustive]
5094pub struct ListPolicyBasedRoutesResponse {
5095    /// Policy based routes to be returned.
5096    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5097    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
5098
5099    /// The next pagination token in the List response. It should be used as
5100    /// page_token for the following request. An empty value means no more result.
5101    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5102    pub next_page_token: std::string::String,
5103
5104    /// Locations that could not be reached.
5105    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5106    pub unreachable: std::vec::Vec<std::string::String>,
5107}
5108
5109impl ListPolicyBasedRoutesResponse {
5110    pub fn new() -> Self {
5111        std::default::Default::default()
5112    }
5113
5114    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
5115    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5116        self.next_page_token = v.into();
5117        self
5118    }
5119
5120    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
5121    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
5122    where
5123        T: std::iter::IntoIterator<Item = V>,
5124        V: std::convert::Into<crate::model::PolicyBasedRoute>,
5125    {
5126        use std::iter::Iterator;
5127        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
5128        self
5129    }
5130
5131    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
5132    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5133    where
5134        T: std::iter::IntoIterator<Item = V>,
5135        V: std::convert::Into<std::string::String>,
5136    {
5137        use std::iter::Iterator;
5138        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5139        self
5140    }
5141}
5142
5143impl wkt::message::Message for ListPolicyBasedRoutesResponse {
5144    fn typename() -> &'static str {
5145        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
5146    }
5147}
5148
5149#[cfg(feature = "unstable-stream")]
5150impl gax::paginator::PageableResponse for ListPolicyBasedRoutesResponse {
5151    type PageItem = crate::model::PolicyBasedRoute;
5152
5153    fn items(self) -> std::vec::Vec<Self::PageItem> {
5154        self.policy_based_routes
5155    }
5156
5157    fn next_page_token(&self) -> std::string::String {
5158        gax::paginator::extract_token(&self.next_page_token)
5159    }
5160}
5161
5162/// Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method.
5163#[serde_with::serde_as]
5164#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5165#[serde(default, rename_all = "camelCase")]
5166#[non_exhaustive]
5167pub struct GetPolicyBasedRouteRequest {
5168    /// Required. Name of the PolicyBasedRoute resource to get.
5169    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5170    pub name: std::string::String,
5171}
5172
5173impl GetPolicyBasedRouteRequest {
5174    pub fn new() -> Self {
5175        std::default::Default::default()
5176    }
5177
5178    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
5179    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5180        self.name = v.into();
5181        self
5182    }
5183}
5184
5185impl wkt::message::Message for GetPolicyBasedRouteRequest {
5186    fn typename() -> &'static str {
5187        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
5188    }
5189}
5190
5191/// Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method.
5192#[serde_with::serde_as]
5193#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5194#[serde(default, rename_all = "camelCase")]
5195#[non_exhaustive]
5196pub struct CreatePolicyBasedRouteRequest {
5197    /// Required. The parent resource's name of the PolicyBasedRoute.
5198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5199    pub parent: std::string::String,
5200
5201    /// Required. Unique id for the Policy Based Route to create.
5202    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5203    pub policy_based_route_id: std::string::String,
5204
5205    /// Required. Initial values for a new Policy Based Route.
5206    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5207    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
5208
5209    /// Optional. An optional request ID to identify requests. Specify a unique
5210    /// request ID so that if you must retry your request, the server will know to
5211    /// ignore the request if it has already been completed. The server will
5212    /// guarantee that for at least 60 minutes since the first request.
5213    ///
5214    /// For example, consider a situation where you make an initial request and
5215    /// the request times out. If you make the request again with the same request
5216    /// ID, the server can check if original operation with the same request ID
5217    /// was received, and if so, will ignore the second request. This prevents
5218    /// clients from accidentally creating duplicate commitments.
5219    ///
5220    /// The request ID must be a valid UUID with the exception that zero UUID is
5221    /// not supported (00000000-0000-0000-0000-000000000000).
5222    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5223    pub request_id: std::string::String,
5224}
5225
5226impl CreatePolicyBasedRouteRequest {
5227    pub fn new() -> Self {
5228        std::default::Default::default()
5229    }
5230
5231    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
5232    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5233        self.parent = v.into();
5234        self
5235    }
5236
5237    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
5238    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
5239        mut self,
5240        v: T,
5241    ) -> Self {
5242        self.policy_based_route_id = v.into();
5243        self
5244    }
5245
5246    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
5247    pub fn set_policy_based_route<
5248        T: std::convert::Into<std::option::Option<crate::model::PolicyBasedRoute>>,
5249    >(
5250        mut self,
5251        v: T,
5252    ) -> Self {
5253        self.policy_based_route = v.into();
5254        self
5255    }
5256
5257    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
5258    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5259        self.request_id = v.into();
5260        self
5261    }
5262}
5263
5264impl wkt::message::Message for CreatePolicyBasedRouteRequest {
5265    fn typename() -> &'static str {
5266        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
5267    }
5268}
5269
5270/// Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method.
5271#[serde_with::serde_as]
5272#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5273#[serde(default, rename_all = "camelCase")]
5274#[non_exhaustive]
5275pub struct DeletePolicyBasedRouteRequest {
5276    /// Required. Name of the PolicyBasedRoute resource to delete.
5277    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5278    pub name: std::string::String,
5279
5280    /// Optional. An optional request ID to identify requests. Specify a unique
5281    /// request ID so that if you must retry your request, the server will know to
5282    /// ignore the request if it has already been completed. The server will
5283    /// guarantee that for at least 60 minutes after the first request.
5284    ///
5285    /// For example, consider a situation where you make an initial request and
5286    /// the request times out. If you make the request again with the same request
5287    /// ID, the server can check if original operation with the same request ID
5288    /// was received, and if so, will ignore the second request. This prevents
5289    /// clients from accidentally creating duplicate commitments.
5290    ///
5291    /// The request ID must be a valid UUID with the exception that zero UUID is
5292    /// not supported (00000000-0000-0000-0000-000000000000).
5293    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5294    pub request_id: std::string::String,
5295}
5296
5297impl DeletePolicyBasedRouteRequest {
5298    pub fn new() -> Self {
5299        std::default::Default::default()
5300    }
5301
5302    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
5303    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5304        self.name = v.into();
5305        self
5306    }
5307
5308    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
5309    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5310        self.request_id = v.into();
5311        self
5312    }
5313}
5314
5315impl wkt::message::Message for DeletePolicyBasedRouteRequest {
5316    fn typename() -> &'static str {
5317        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
5318    }
5319}
5320
5321/// Supported features for a location
5322#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5323pub struct LocationFeature(std::borrow::Cow<'static, str>);
5324
5325impl LocationFeature {
5326    /// Creates a new LocationFeature instance.
5327    pub const fn new(v: &'static str) -> Self {
5328        Self(std::borrow::Cow::Borrowed(v))
5329    }
5330
5331    /// Gets the enum value.
5332    pub fn value(&self) -> &str {
5333        &self.0
5334    }
5335}
5336
5337/// Useful constants to work with [LocationFeature](LocationFeature)
5338pub mod location_feature {
5339    use super::LocationFeature;
5340
5341    /// No publicly supported feature in this location
5342    pub const LOCATION_FEATURE_UNSPECIFIED: LocationFeature =
5343        LocationFeature::new("LOCATION_FEATURE_UNSPECIFIED");
5344
5345    /// Site-to-cloud spokes are supported in this location
5346    pub const SITE_TO_CLOUD_SPOKES: LocationFeature = LocationFeature::new("SITE_TO_CLOUD_SPOKES");
5347
5348    /// Site-to-site spokes are supported in this location
5349    pub const SITE_TO_SITE_SPOKES: LocationFeature = LocationFeature::new("SITE_TO_SITE_SPOKES");
5350}
5351
5352impl std::convert::From<std::string::String> for LocationFeature {
5353    fn from(value: std::string::String) -> Self {
5354        Self(std::borrow::Cow::Owned(value))
5355    }
5356}
5357
5358/// The route's type
5359#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5360pub struct RouteType(std::borrow::Cow<'static, str>);
5361
5362impl RouteType {
5363    /// Creates a new RouteType instance.
5364    pub const fn new(v: &'static str) -> Self {
5365        Self(std::borrow::Cow::Borrowed(v))
5366    }
5367
5368    /// Gets the enum value.
5369    pub fn value(&self) -> &str {
5370        &self.0
5371    }
5372}
5373
5374/// Useful constants to work with [RouteType](RouteType)
5375pub mod route_type {
5376    use super::RouteType;
5377
5378    /// No route type information specified
5379    pub const ROUTE_TYPE_UNSPECIFIED: RouteType = RouteType::new("ROUTE_TYPE_UNSPECIFIED");
5380
5381    /// The route leads to a destination within the primary address range of the
5382    /// VPC network's subnet.
5383    pub const VPC_PRIMARY_SUBNET: RouteType = RouteType::new("VPC_PRIMARY_SUBNET");
5384
5385    /// The route leads to a destination within the secondary address range of the
5386    /// VPC network's subnet.
5387    pub const VPC_SECONDARY_SUBNET: RouteType = RouteType::new("VPC_SECONDARY_SUBNET");
5388
5389    /// The route leads to a destination in a dynamic route. Dynamic routes are
5390    /// derived from Border Gateway Protocol (BGP) advertisements received from an
5391    /// NCC hybrid spoke.
5392    pub const DYNAMIC_ROUTE: RouteType = RouteType::new("DYNAMIC_ROUTE");
5393}
5394
5395impl std::convert::From<std::string::String> for RouteType {
5396    fn from(value: std::string::String) -> Self {
5397        Self(std::borrow::Cow::Owned(value))
5398    }
5399}
5400
5401/// The State enum represents the lifecycle stage of a Network Connectivity
5402/// Center resource.
5403#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5404pub struct State(std::borrow::Cow<'static, str>);
5405
5406impl State {
5407    /// Creates a new State instance.
5408    pub const fn new(v: &'static str) -> Self {
5409        Self(std::borrow::Cow::Borrowed(v))
5410    }
5411
5412    /// Gets the enum value.
5413    pub fn value(&self) -> &str {
5414        &self.0
5415    }
5416}
5417
5418/// Useful constants to work with [State](State)
5419pub mod state {
5420    use super::State;
5421
5422    /// No state information available
5423    pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
5424
5425    /// The resource's create operation is in progress.
5426    pub const CREATING: State = State::new("CREATING");
5427
5428    /// The resource is active
5429    pub const ACTIVE: State = State::new("ACTIVE");
5430
5431    /// The resource's delete operation is in progress.
5432    pub const DELETING: State = State::new("DELETING");
5433
5434    /// The resource's accept operation is in progress.
5435    pub const ACCEPTING: State = State::new("ACCEPTING");
5436
5437    /// The resource's reject operation is in progress.
5438    pub const REJECTING: State = State::new("REJECTING");
5439
5440    /// The resource's update operation is in progress.
5441    pub const UPDATING: State = State::new("UPDATING");
5442
5443    /// The resource is inactive.
5444    pub const INACTIVE: State = State::new("INACTIVE");
5445
5446    /// The hub associated with this spoke resource has been deleted.
5447    /// This state applies to spoke resources only.
5448    pub const OBSOLETE: State = State::new("OBSOLETE");
5449}
5450
5451impl std::convert::From<std::string::String> for State {
5452    fn from(value: std::string::String) -> Self {
5453        Self(std::borrow::Cow::Owned(value))
5454    }
5455}
5456
5457/// The SpokeType enum represents the type of spoke. The type
5458/// reflects the kind of resource that a spoke is associated with.
5459#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5460pub struct SpokeType(std::borrow::Cow<'static, str>);
5461
5462impl SpokeType {
5463    /// Creates a new SpokeType instance.
5464    pub const fn new(v: &'static str) -> Self {
5465        Self(std::borrow::Cow::Borrowed(v))
5466    }
5467
5468    /// Gets the enum value.
5469    pub fn value(&self) -> &str {
5470        &self.0
5471    }
5472}
5473
5474/// Useful constants to work with [SpokeType](SpokeType)
5475pub mod spoke_type {
5476    use super::SpokeType;
5477
5478    /// Unspecified spoke type.
5479    pub const SPOKE_TYPE_UNSPECIFIED: SpokeType = SpokeType::new("SPOKE_TYPE_UNSPECIFIED");
5480
5481    /// Spokes associated with VPN tunnels.
5482    pub const VPN_TUNNEL: SpokeType = SpokeType::new("VPN_TUNNEL");
5483
5484    /// Spokes associated with VLAN attachments.
5485    pub const INTERCONNECT_ATTACHMENT: SpokeType = SpokeType::new("INTERCONNECT_ATTACHMENT");
5486
5487    /// Spokes associated with router appliance instances.
5488    pub const ROUTER_APPLIANCE: SpokeType = SpokeType::new("ROUTER_APPLIANCE");
5489
5490    /// Spokes associated with VPC networks.
5491    pub const VPC_NETWORK: SpokeType = SpokeType::new("VPC_NETWORK");
5492
5493    /// Spokes that are backed by a producer VPC network.
5494    pub const PRODUCER_VPC_NETWORK: SpokeType = SpokeType::new("PRODUCER_VPC_NETWORK");
5495}
5496
5497impl std::convert::From<std::string::String> for SpokeType {
5498    fn from(value: std::string::String) -> Self {
5499        Self(std::borrow::Cow::Owned(value))
5500    }
5501}
5502
5503/// This enum controls the policy mode used in a hub.
5504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5505pub struct PolicyMode(std::borrow::Cow<'static, str>);
5506
5507impl PolicyMode {
5508    /// Creates a new PolicyMode instance.
5509    pub const fn new(v: &'static str) -> Self {
5510        Self(std::borrow::Cow::Borrowed(v))
5511    }
5512
5513    /// Gets the enum value.
5514    pub fn value(&self) -> &str {
5515        &self.0
5516    }
5517}
5518
5519/// Useful constants to work with [PolicyMode](PolicyMode)
5520pub mod policy_mode {
5521    use super::PolicyMode;
5522
5523    /// Policy mode is unspecified. It defaults to PRESET
5524    /// with preset_topology = MESH.
5525    pub const POLICY_MODE_UNSPECIFIED: PolicyMode = PolicyMode::new("POLICY_MODE_UNSPECIFIED");
5526
5527    /// Hub uses one of the preset topologies.
5528    pub const PRESET: PolicyMode = PolicyMode::new("PRESET");
5529}
5530
5531impl std::convert::From<std::string::String> for PolicyMode {
5532    fn from(value: std::string::String) -> Self {
5533        Self(std::borrow::Cow::Owned(value))
5534    }
5535}
5536
5537/// The list of available preset topologies.
5538#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5539pub struct PresetTopology(std::borrow::Cow<'static, str>);
5540
5541impl PresetTopology {
5542    /// Creates a new PresetTopology instance.
5543    pub const fn new(v: &'static str) -> Self {
5544        Self(std::borrow::Cow::Borrowed(v))
5545    }
5546
5547    /// Gets the enum value.
5548    pub fn value(&self) -> &str {
5549        &self.0
5550    }
5551}
5552
5553/// Useful constants to work with [PresetTopology](PresetTopology)
5554pub mod preset_topology {
5555    use super::PresetTopology;
5556
5557    /// Preset topology is unspecified. When policy_mode = PRESET,
5558    /// it defaults to MESH.
5559    pub const PRESET_TOPOLOGY_UNSPECIFIED: PresetTopology =
5560        PresetTopology::new("PRESET_TOPOLOGY_UNSPECIFIED");
5561
5562    /// Mesh topology is implemented. Group `default` is automatically created.
5563    /// All spokes in the hub are added to group `default`.
5564    pub const MESH: PresetTopology = PresetTopology::new("MESH");
5565
5566    /// Star topology is implemented. Two groups, `center` and `edge`, are
5567    /// automatically created along with hub creation. Spokes have to join one of
5568    /// the groups during creation.
5569    pub const STAR: PresetTopology = PresetTopology::new("STAR");
5570}
5571
5572impl std::convert::From<std::string::String> for PresetTopology {
5573    fn from(value: std::string::String) -> Self {
5574        Self(std::borrow::Cow::Owned(value))
5575    }
5576}