1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38#[serde_with::serde_as]
40#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(default, rename_all = "camelCase")]
42#[non_exhaustive]
43pub struct OperationMetadata {
44 #[serde(skip_serializing_if = "std::option::Option::is_none")]
46 pub create_time: std::option::Option<wkt::Timestamp>,
47
48 #[serde(skip_serializing_if = "std::option::Option::is_none")]
50 pub end_time: std::option::Option<wkt::Timestamp>,
51
52 #[serde(skip_serializing_if = "std::string::String::is_empty")]
54 pub target: std::string::String,
55
56 #[serde(skip_serializing_if = "std::string::String::is_empty")]
58 pub verb: std::string::String,
59
60 #[serde(skip_serializing_if = "std::string::String::is_empty")]
62 pub status_message: std::string::String,
63
64 pub requested_cancellation: bool,
74
75 #[serde(skip_serializing_if = "std::string::String::is_empty")]
77 pub api_version: std::string::String,
78
79 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
80 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
81}
82
83impl OperationMetadata {
84 pub fn new() -> Self {
85 std::default::Default::default()
86 }
87
88 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
90 mut self,
91 v: T,
92 ) -> Self {
93 self.create_time = v.into();
94 self
95 }
96
97 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
99 mut self,
100 v: T,
101 ) -> Self {
102 self.end_time = v.into();
103 self
104 }
105
106 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108 self.target = v.into();
109 self
110 }
111
112 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114 self.verb = v.into();
115 self
116 }
117
118 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.status_message = v.into();
121 self
122 }
123
124 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
126 self.requested_cancellation = v.into();
127 self
128 }
129
130 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.api_version = v.into();
133 self
134 }
135}
136
137impl wkt::message::Message for OperationMetadata {
138 fn typename() -> &'static str {
139 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
140 }
141}
142
143#[serde_with::serde_as]
145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
146#[serde(default, rename_all = "camelCase")]
147#[non_exhaustive]
148pub struct ServiceConnectionMap {
149 #[serde(skip_serializing_if = "std::string::String::is_empty")]
154 pub name: std::string::String,
155
156 #[serde(skip_serializing_if = "std::option::Option::is_none")]
158 pub create_time: std::option::Option<wkt::Timestamp>,
159
160 #[serde(skip_serializing_if = "std::option::Option::is_none")]
162 pub update_time: std::option::Option<wkt::Timestamp>,
163
164 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
166 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
167
168 #[serde(skip_serializing_if = "std::string::String::is_empty")]
170 pub description: std::string::String,
171
172 #[serde(skip_serializing_if = "std::string::String::is_empty")]
177 pub service_class: std::string::String,
178
179 #[serde(skip_serializing_if = "std::string::String::is_empty")]
181 pub service_class_uri: std::string::String,
182
183 pub infrastructure: crate::model::Infrastructure,
186
187 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
189 pub producer_psc_configs:
190 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
191
192 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
194 pub consumer_psc_configs:
195 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
196
197 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
199 pub consumer_psc_connections:
200 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
201
202 #[serde(skip_serializing_if = "std::string::String::is_empty")]
205 pub token: std::string::String,
206
207 #[serde(skip_serializing_if = "std::option::Option::is_none")]
211 pub etag: std::option::Option<std::string::String>,
212
213 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
214 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
215}
216
217impl ServiceConnectionMap {
218 pub fn new() -> Self {
219 std::default::Default::default()
220 }
221
222 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
224 self.name = v.into();
225 self
226 }
227
228 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
230 mut self,
231 v: T,
232 ) -> Self {
233 self.create_time = v.into();
234 self
235 }
236
237 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
239 mut self,
240 v: T,
241 ) -> Self {
242 self.update_time = v.into();
243 self
244 }
245
246 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
248 self.description = v.into();
249 self
250 }
251
252 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254 self.service_class = v.into();
255 self
256 }
257
258 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
260 mut self,
261 v: T,
262 ) -> Self {
263 self.service_class_uri = v.into();
264 self
265 }
266
267 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
269 mut self,
270 v: T,
271 ) -> Self {
272 self.infrastructure = v.into();
273 self
274 }
275
276 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
278 self.token = v.into();
279 self
280 }
281
282 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
284 mut self,
285 v: T,
286 ) -> Self {
287 self.etag = v.into();
288 self
289 }
290
291 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
293 where
294 T: std::iter::IntoIterator<Item = V>,
295 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
296 {
297 use std::iter::Iterator;
298 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
299 self
300 }
301
302 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
304 where
305 T: std::iter::IntoIterator<Item = V>,
306 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
307 {
308 use std::iter::Iterator;
309 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
310 self
311 }
312
313 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
315 where
316 T: std::iter::IntoIterator<Item = V>,
317 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
318 {
319 use std::iter::Iterator;
320 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
321 self
322 }
323
324 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
326 where
327 T: std::iter::IntoIterator<Item = (K, V)>,
328 K: std::convert::Into<std::string::String>,
329 V: std::convert::Into<std::string::String>,
330 {
331 use std::iter::Iterator;
332 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
333 self
334 }
335}
336
337impl wkt::message::Message for ServiceConnectionMap {
338 fn typename() -> &'static str {
339 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
340 }
341}
342
343pub mod service_connection_map {
345 #[allow(unused_imports)]
346 use super::*;
347
348 #[serde_with::serde_as]
350 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
351 #[serde(default, rename_all = "camelCase")]
352 #[non_exhaustive]
353 pub struct ProducerPscConfig {
354 #[serde(skip_serializing_if = "std::string::String::is_empty")]
358 pub service_attachment_uri: std::string::String,
359
360 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
361 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
362 }
363
364 impl ProducerPscConfig {
365 pub fn new() -> Self {
366 std::default::Default::default()
367 }
368
369 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
371 mut self,
372 v: T,
373 ) -> Self {
374 self.service_attachment_uri = v.into();
375 self
376 }
377 }
378
379 impl wkt::message::Message for ProducerPscConfig {
380 fn typename() -> &'static str {
381 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
382 }
383 }
384
385 #[serde_with::serde_as]
387 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
388 #[serde(default, rename_all = "camelCase")]
389 #[non_exhaustive]
390 pub struct ConsumerPscConfig {
391 #[serde(skip_serializing_if = "std::string::String::is_empty")]
393 pub project: std::string::String,
394
395 #[serde(skip_serializing_if = "std::string::String::is_empty")]
401 pub network: std::string::String,
402
403 pub disable_global_access: bool,
406
407 pub state: crate::model::service_connection_map::consumer_psc_config::State,
410
411 #[serde(skip_serializing_if = "std::string::String::is_empty")]
414 pub producer_instance_id: std::string::String,
415
416 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
420 pub service_attachment_ip_address_map:
421 std::collections::HashMap<std::string::String, std::string::String>,
422
423 #[serde(skip_serializing_if = "std::string::String::is_empty")]
430 pub consumer_instance_project: std::string::String,
431
432 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
434 pub producer_instance_metadata:
435 std::collections::HashMap<std::string::String, std::string::String>,
436
437 #[serde(skip_serializing_if = "std::option::Option::is_none")]
439 pub ip_version: std::option::Option<crate::model::IPVersion>,
440
441 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
442 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
443 }
444
445 impl ConsumerPscConfig {
446 pub fn new() -> Self {
447 std::default::Default::default()
448 }
449
450 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452 self.project = v.into();
453 self
454 }
455
456 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
458 self.network = v.into();
459 self
460 }
461
462 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
464 self.disable_global_access = v.into();
465 self
466 }
467
468 pub fn set_state<
470 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
471 >(
472 mut self,
473 v: T,
474 ) -> Self {
475 self.state = v.into();
476 self
477 }
478
479 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
481 mut self,
482 v: T,
483 ) -> Self {
484 self.producer_instance_id = v.into();
485 self
486 }
487
488 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
490 mut self,
491 v: T,
492 ) -> Self {
493 self.consumer_instance_project = v.into();
494 self
495 }
496
497 pub fn set_ip_version<
499 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
500 >(
501 mut self,
502 v: T,
503 ) -> Self {
504 self.ip_version = v.into();
505 self
506 }
507
508 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
510 where
511 T: std::iter::IntoIterator<Item = (K, V)>,
512 K: std::convert::Into<std::string::String>,
513 V: std::convert::Into<std::string::String>,
514 {
515 use std::iter::Iterator;
516 self.service_attachment_ip_address_map =
517 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
518 self
519 }
520
521 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
523 where
524 T: std::iter::IntoIterator<Item = (K, V)>,
525 K: std::convert::Into<std::string::String>,
526 V: std::convert::Into<std::string::String>,
527 {
528 use std::iter::Iterator;
529 self.producer_instance_metadata =
530 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
531 self
532 }
533 }
534
535 impl wkt::message::Message for ConsumerPscConfig {
536 fn typename() -> &'static str {
537 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
538 }
539 }
540
541 pub mod consumer_psc_config {
543 #[allow(unused_imports)]
544 use super::*;
545
546 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
548 pub struct State(i32);
549
550 impl State {
551 pub const STATE_UNSPECIFIED: State = State::new(0);
553
554 pub const VALID: State = State::new(1);
558
559 pub const CONNECTION_POLICY_MISSING: State = State::new(2);
562
563 pub const POLICY_LIMIT_REACHED: State = State::new(3);
566
567 pub const CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED: State = State::new(4);
571
572 pub(crate) const fn new(value: i32) -> Self {
574 Self(value)
575 }
576
577 pub fn value(&self) -> i32 {
579 self.0
580 }
581
582 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
584 match self.0 {
585 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
586 1 => std::borrow::Cow::Borrowed("VALID"),
587 2 => std::borrow::Cow::Borrowed("CONNECTION_POLICY_MISSING"),
588 3 => std::borrow::Cow::Borrowed("POLICY_LIMIT_REACHED"),
589 4 => std::borrow::Cow::Borrowed("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED"),
590 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
591 }
592 }
593
594 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
596 match name {
597 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
598 "VALID" => std::option::Option::Some(Self::VALID),
599 "CONNECTION_POLICY_MISSING" => {
600 std::option::Option::Some(Self::CONNECTION_POLICY_MISSING)
601 }
602 "POLICY_LIMIT_REACHED" => std::option::Option::Some(Self::POLICY_LIMIT_REACHED),
603 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
604 std::option::Option::Some(Self::CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED)
605 }
606 _ => std::option::Option::None,
607 }
608 }
609 }
610
611 impl std::convert::From<i32> for State {
612 fn from(value: i32) -> Self {
613 Self::new(value)
614 }
615 }
616
617 impl std::default::Default for State {
618 fn default() -> Self {
619 Self::new(0)
620 }
621 }
622 }
623
624 #[serde_with::serde_as]
626 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
627 #[serde(default, rename_all = "camelCase")]
628 #[non_exhaustive]
629 pub struct ConsumerPscConnection {
630 #[serde(skip_serializing_if = "std::string::String::is_empty")]
633 pub service_attachment_uri: std::string::String,
634
635 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
637
638 #[serde(skip_serializing_if = "std::string::String::is_empty")]
641 pub project: std::string::String,
642
643 #[serde(skip_serializing_if = "std::string::String::is_empty")]
647 pub network: std::string::String,
648
649 #[serde(skip_serializing_if = "std::string::String::is_empty")]
652 pub psc_connection_id: std::string::String,
653
654 #[serde(skip_serializing_if = "std::string::String::is_empty")]
658 pub ip: std::string::String,
659
660 pub error_type: crate::model::ConnectionErrorType,
663
664 #[serde(skip_serializing_if = "std::option::Option::is_none")]
666 pub error: std::option::Option<rpc::model::Status>,
667
668 #[serde(skip_serializing_if = "std::string::String::is_empty")]
670 pub gce_operation: std::string::String,
671
672 #[serde(skip_serializing_if = "std::string::String::is_empty")]
676 pub forwarding_rule: std::string::String,
677
678 #[serde(skip_serializing_if = "std::option::Option::is_none")]
681 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
682
683 #[serde(skip_serializing_if = "std::string::String::is_empty")]
686 pub selected_subnetwork: std::string::String,
687
688 #[serde(skip_serializing_if = "std::string::String::is_empty")]
691 pub producer_instance_id: std::string::String,
692
693 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
695 pub producer_instance_metadata:
696 std::collections::HashMap<std::string::String, std::string::String>,
697
698 #[serde(skip_serializing_if = "std::option::Option::is_none")]
700 pub ip_version: std::option::Option<crate::model::IPVersion>,
701
702 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
703 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
704 }
705
706 impl ConsumerPscConnection {
707 pub fn new() -> Self {
708 std::default::Default::default()
709 }
710
711 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
713 mut self,
714 v: T,
715 ) -> Self {
716 self.service_attachment_uri = v.into();
717 self
718 }
719
720 pub fn set_state<
722 T: std::convert::Into<
723 crate::model::service_connection_map::consumer_psc_connection::State,
724 >,
725 >(
726 mut self,
727 v: T,
728 ) -> Self {
729 self.state = v.into();
730 self
731 }
732
733 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735 self.project = v.into();
736 self
737 }
738
739 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741 self.network = v.into();
742 self
743 }
744
745 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
747 mut self,
748 v: T,
749 ) -> Self {
750 self.psc_connection_id = v.into();
751 self
752 }
753
754 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
756 self.ip = v.into();
757 self
758 }
759
760 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
762 mut self,
763 v: T,
764 ) -> Self {
765 self.error_type = v.into();
766 self
767 }
768
769 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
771 mut self,
772 v: T,
773 ) -> Self {
774 self.error = v.into();
775 self
776 }
777
778 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
780 mut self,
781 v: T,
782 ) -> Self {
783 self.gce_operation = v.into();
784 self
785 }
786
787 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
789 mut self,
790 v: T,
791 ) -> Self {
792 self.forwarding_rule = v.into();
793 self
794 }
795
796 pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
798 mut self,
799 v: T,
800 ) -> Self {
801 self.error_info = v.into();
802 self
803 }
804
805 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
807 mut self,
808 v: T,
809 ) -> Self {
810 self.selected_subnetwork = v.into();
811 self
812 }
813
814 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
816 mut self,
817 v: T,
818 ) -> Self {
819 self.producer_instance_id = v.into();
820 self
821 }
822
823 pub fn set_ip_version<
825 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
826 >(
827 mut self,
828 v: T,
829 ) -> Self {
830 self.ip_version = v.into();
831 self
832 }
833
834 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
836 where
837 T: std::iter::IntoIterator<Item = (K, V)>,
838 K: std::convert::Into<std::string::String>,
839 V: std::convert::Into<std::string::String>,
840 {
841 use std::iter::Iterator;
842 self.producer_instance_metadata =
843 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
844 self
845 }
846 }
847
848 impl wkt::message::Message for ConsumerPscConnection {
849 fn typename() -> &'static str {
850 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
851 }
852 }
853
854 pub mod consumer_psc_connection {
856 #[allow(unused_imports)]
857 use super::*;
858
859 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
864 pub struct State(i32);
865
866 impl State {
867 pub const STATE_UNSPECIFIED: State = State::new(0);
869
870 pub const ACTIVE: State = State::new(1);
874
875 pub const FAILED: State = State::new(2);
878
879 pub const CREATING: State = State::new(3);
881
882 pub const DELETING: State = State::new(4);
884
885 pub const CREATE_REPAIRING: State = State::new(5);
887
888 pub const DELETE_REPAIRING: State = State::new(6);
890
891 pub(crate) const fn new(value: i32) -> Self {
893 Self(value)
894 }
895
896 pub fn value(&self) -> i32 {
898 self.0
899 }
900
901 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
903 match self.0 {
904 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
905 1 => std::borrow::Cow::Borrowed("ACTIVE"),
906 2 => std::borrow::Cow::Borrowed("FAILED"),
907 3 => std::borrow::Cow::Borrowed("CREATING"),
908 4 => std::borrow::Cow::Borrowed("DELETING"),
909 5 => std::borrow::Cow::Borrowed("CREATE_REPAIRING"),
910 6 => std::borrow::Cow::Borrowed("DELETE_REPAIRING"),
911 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
912 }
913 }
914
915 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
917 match name {
918 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
919 "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
920 "FAILED" => std::option::Option::Some(Self::FAILED),
921 "CREATING" => std::option::Option::Some(Self::CREATING),
922 "DELETING" => std::option::Option::Some(Self::DELETING),
923 "CREATE_REPAIRING" => std::option::Option::Some(Self::CREATE_REPAIRING),
924 "DELETE_REPAIRING" => std::option::Option::Some(Self::DELETE_REPAIRING),
925 _ => std::option::Option::None,
926 }
927 }
928 }
929
930 impl std::convert::From<i32> for State {
931 fn from(value: i32) -> Self {
932 Self::new(value)
933 }
934 }
935
936 impl std::default::Default for State {
937 fn default() -> Self {
938 Self::new(0)
939 }
940 }
941 }
942}
943
944#[serde_with::serde_as]
946#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
947#[serde(default, rename_all = "camelCase")]
948#[non_exhaustive]
949pub struct ListServiceConnectionMapsRequest {
950 #[serde(skip_serializing_if = "std::string::String::is_empty")]
952 pub parent: std::string::String,
953
954 pub page_size: i32,
956
957 #[serde(skip_serializing_if = "std::string::String::is_empty")]
959 pub page_token: std::string::String,
960
961 #[serde(skip_serializing_if = "std::string::String::is_empty")]
963 pub filter: std::string::String,
964
965 #[serde(skip_serializing_if = "std::string::String::is_empty")]
967 pub order_by: std::string::String,
968
969 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
970 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
971}
972
973impl ListServiceConnectionMapsRequest {
974 pub fn new() -> Self {
975 std::default::Default::default()
976 }
977
978 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
980 self.parent = v.into();
981 self
982 }
983
984 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
986 self.page_size = v.into();
987 self
988 }
989
990 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
992 self.page_token = v.into();
993 self
994 }
995
996 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
998 self.filter = v.into();
999 self
1000 }
1001
1002 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1004 self.order_by = v.into();
1005 self
1006 }
1007}
1008
1009impl wkt::message::Message for ListServiceConnectionMapsRequest {
1010 fn typename() -> &'static str {
1011 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1012 }
1013}
1014
1015#[serde_with::serde_as]
1017#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1018#[serde(default, rename_all = "camelCase")]
1019#[non_exhaustive]
1020pub struct ListServiceConnectionMapsResponse {
1021 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1023 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1024
1025 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1028 pub next_page_token: std::string::String,
1029
1030 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1032 pub unreachable: std::vec::Vec<std::string::String>,
1033
1034 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1035 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1036}
1037
1038impl ListServiceConnectionMapsResponse {
1039 pub fn new() -> Self {
1040 std::default::Default::default()
1041 }
1042
1043 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.next_page_token = v.into();
1046 self
1047 }
1048
1049 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1051 where
1052 T: std::iter::IntoIterator<Item = V>,
1053 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1054 {
1055 use std::iter::Iterator;
1056 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1057 self
1058 }
1059
1060 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1062 where
1063 T: std::iter::IntoIterator<Item = V>,
1064 V: std::convert::Into<std::string::String>,
1065 {
1066 use std::iter::Iterator;
1067 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1068 self
1069 }
1070}
1071
1072impl wkt::message::Message for ListServiceConnectionMapsResponse {
1073 fn typename() -> &'static str {
1074 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1075 }
1076}
1077
1078#[doc(hidden)]
1079impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1080 type PageItem = crate::model::ServiceConnectionMap;
1081
1082 fn items(self) -> std::vec::Vec<Self::PageItem> {
1083 self.service_connection_maps
1084 }
1085
1086 fn next_page_token(&self) -> std::string::String {
1087 use std::clone::Clone;
1088 self.next_page_token.clone()
1089 }
1090}
1091
1092#[serde_with::serde_as]
1094#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1095#[serde(default, rename_all = "camelCase")]
1096#[non_exhaustive]
1097pub struct GetServiceConnectionMapRequest {
1098 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1100 pub name: std::string::String,
1101
1102 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1103 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104}
1105
1106impl GetServiceConnectionMapRequest {
1107 pub fn new() -> Self {
1108 std::default::Default::default()
1109 }
1110
1111 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.name = v.into();
1114 self
1115 }
1116}
1117
1118impl wkt::message::Message for GetServiceConnectionMapRequest {
1119 fn typename() -> &'static str {
1120 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1121 }
1122}
1123
1124#[serde_with::serde_as]
1126#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1127#[serde(default, rename_all = "camelCase")]
1128#[non_exhaustive]
1129pub struct CreateServiceConnectionMapRequest {
1130 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1133 pub parent: std::string::String,
1134
1135 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1141 pub service_connection_map_id: std::string::String,
1142
1143 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1145 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1146
1147 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1161 pub request_id: std::string::String,
1162
1163 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1164 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1165}
1166
1167impl CreateServiceConnectionMapRequest {
1168 pub fn new() -> Self {
1169 std::default::Default::default()
1170 }
1171
1172 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1174 self.parent = v.into();
1175 self
1176 }
1177
1178 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1180 mut self,
1181 v: T,
1182 ) -> Self {
1183 self.service_connection_map_id = v.into();
1184 self
1185 }
1186
1187 pub fn set_service_connection_map<
1189 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1190 >(
1191 mut self,
1192 v: T,
1193 ) -> Self {
1194 self.service_connection_map = v.into();
1195 self
1196 }
1197
1198 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200 self.request_id = v.into();
1201 self
1202 }
1203}
1204
1205impl wkt::message::Message for CreateServiceConnectionMapRequest {
1206 fn typename() -> &'static str {
1207 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1208 }
1209}
1210
1211#[serde_with::serde_as]
1213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1214#[serde(default, rename_all = "camelCase")]
1215#[non_exhaustive]
1216pub struct UpdateServiceConnectionMapRequest {
1217 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1223 pub update_mask: std::option::Option<wkt::FieldMask>,
1224
1225 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1227 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1228
1229 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1243 pub request_id: std::string::String,
1244
1245 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1246 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1247}
1248
1249impl UpdateServiceConnectionMapRequest {
1250 pub fn new() -> Self {
1251 std::default::Default::default()
1252 }
1253
1254 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1256 mut self,
1257 v: T,
1258 ) -> Self {
1259 self.update_mask = v.into();
1260 self
1261 }
1262
1263 pub fn set_service_connection_map<
1265 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1266 >(
1267 mut self,
1268 v: T,
1269 ) -> Self {
1270 self.service_connection_map = v.into();
1271 self
1272 }
1273
1274 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276 self.request_id = v.into();
1277 self
1278 }
1279}
1280
1281impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1282 fn typename() -> &'static str {
1283 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1284 }
1285}
1286
1287#[serde_with::serde_as]
1289#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1290#[serde(default, rename_all = "camelCase")]
1291#[non_exhaustive]
1292pub struct DeleteServiceConnectionMapRequest {
1293 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1295 pub name: std::string::String,
1296
1297 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1311 pub request_id: std::string::String,
1312
1313 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1317 pub etag: std::option::Option<std::string::String>,
1318
1319 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1320 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1321}
1322
1323impl DeleteServiceConnectionMapRequest {
1324 pub fn new() -> Self {
1325 std::default::Default::default()
1326 }
1327
1328 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.name = v.into();
1331 self
1332 }
1333
1334 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.request_id = v.into();
1337 self
1338 }
1339
1340 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1342 mut self,
1343 v: T,
1344 ) -> Self {
1345 self.etag = v.into();
1346 self
1347 }
1348}
1349
1350impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1351 fn typename() -> &'static str {
1352 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1353 }
1354}
1355
1356#[serde_with::serde_as]
1358#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1359#[serde(default, rename_all = "camelCase")]
1360#[non_exhaustive]
1361pub struct ServiceConnectionPolicy {
1362 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1367 pub name: std::string::String,
1368
1369 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1371 pub create_time: std::option::Option<wkt::Timestamp>,
1372
1373 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1375 pub update_time: std::option::Option<wkt::Timestamp>,
1376
1377 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1379 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1380
1381 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1383 pub description: std::string::String,
1384
1385 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1390 pub network: std::string::String,
1391
1392 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399 pub service_class: std::string::String,
1400
1401 pub infrastructure: crate::model::Infrastructure,
1404
1405 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1408 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1409
1410 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1413 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1414
1415 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1419 pub etag: std::option::Option<std::string::String>,
1420
1421 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1422 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1423}
1424
1425impl ServiceConnectionPolicy {
1426 pub fn new() -> Self {
1427 std::default::Default::default()
1428 }
1429
1430 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1432 self.name = v.into();
1433 self
1434 }
1435
1436 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1438 mut self,
1439 v: T,
1440 ) -> Self {
1441 self.create_time = v.into();
1442 self
1443 }
1444
1445 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1447 mut self,
1448 v: T,
1449 ) -> Self {
1450 self.update_time = v.into();
1451 self
1452 }
1453
1454 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1456 self.description = v.into();
1457 self
1458 }
1459
1460 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.network = v.into();
1463 self
1464 }
1465
1466 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1468 self.service_class = v.into();
1469 self
1470 }
1471
1472 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1474 mut self,
1475 v: T,
1476 ) -> Self {
1477 self.infrastructure = v.into();
1478 self
1479 }
1480
1481 pub fn set_psc_config<
1483 T: std::convert::Into<std::option::Option<crate::model::service_connection_policy::PscConfig>>,
1484 >(
1485 mut self,
1486 v: T,
1487 ) -> Self {
1488 self.psc_config = v.into();
1489 self
1490 }
1491
1492 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1494 mut self,
1495 v: T,
1496 ) -> Self {
1497 self.etag = v.into();
1498 self
1499 }
1500
1501 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1503 where
1504 T: std::iter::IntoIterator<Item = V>,
1505 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1506 {
1507 use std::iter::Iterator;
1508 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1509 self
1510 }
1511
1512 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1514 where
1515 T: std::iter::IntoIterator<Item = (K, V)>,
1516 K: std::convert::Into<std::string::String>,
1517 V: std::convert::Into<std::string::String>,
1518 {
1519 use std::iter::Iterator;
1520 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1521 self
1522 }
1523}
1524
1525impl wkt::message::Message for ServiceConnectionPolicy {
1526 fn typename() -> &'static str {
1527 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1528 }
1529}
1530
1531pub mod service_connection_policy {
1533 #[allow(unused_imports)]
1534 use super::*;
1535
1536 #[serde_with::serde_as]
1539 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1540 #[serde(default, rename_all = "camelCase")]
1541 #[non_exhaustive]
1542 pub struct PscConfig {
1543 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1547 pub subnetworks: std::vec::Vec<std::string::String>,
1548
1549 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1551 #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1552 pub limit: std::option::Option<i64>,
1553
1554 pub producer_instance_location:
1558 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1559
1560 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1576 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1577
1578 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1579 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1580 }
1581
1582 impl PscConfig {
1583 pub fn new() -> Self {
1584 std::default::Default::default()
1585 }
1586
1587 pub fn set_limit<T: std::convert::Into<std::option::Option<i64>>>(mut self, v: T) -> Self {
1589 self.limit = v.into();
1590 self
1591 }
1592
1593 pub fn set_producer_instance_location<
1595 T: std::convert::Into<
1596 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1597 >,
1598 >(
1599 mut self,
1600 v: T,
1601 ) -> Self {
1602 self.producer_instance_location = v.into();
1603 self
1604 }
1605
1606 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1608 where
1609 T: std::iter::IntoIterator<Item = V>,
1610 V: std::convert::Into<std::string::String>,
1611 {
1612 use std::iter::Iterator;
1613 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1614 self
1615 }
1616
1617 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1619 where
1620 T: std::iter::IntoIterator<Item = V>,
1621 V: std::convert::Into<std::string::String>,
1622 {
1623 use std::iter::Iterator;
1624 self.allowed_google_producers_resource_hierarchy_level =
1625 v.into_iter().map(|i| i.into()).collect();
1626 self
1627 }
1628 }
1629
1630 impl wkt::message::Message for PscConfig {
1631 fn typename() -> &'static str {
1632 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1633 }
1634 }
1635
1636 pub mod psc_config {
1638 #[allow(unused_imports)]
1639 use super::*;
1640
1641 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1644 pub struct ProducerInstanceLocation(i32);
1645
1646 impl ProducerInstanceLocation {
1647 pub const PRODUCER_INSTANCE_LOCATION_UNSPECIFIED: ProducerInstanceLocation =
1654 ProducerInstanceLocation::new(0);
1655
1656 pub const CUSTOM_RESOURCE_HIERARCHY_LEVELS: ProducerInstanceLocation =
1659 ProducerInstanceLocation::new(1);
1660
1661 pub(crate) const fn new(value: i32) -> Self {
1663 Self(value)
1664 }
1665
1666 pub fn value(&self) -> i32 {
1668 self.0
1669 }
1670
1671 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1673 match self.0 {
1674 0 => std::borrow::Cow::Borrowed("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED"),
1675 1 => std::borrow::Cow::Borrowed("CUSTOM_RESOURCE_HIERARCHY_LEVELS"),
1676 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1677 }
1678 }
1679
1680 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1682 match name {
1683 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => {
1684 std::option::Option::Some(Self::PRODUCER_INSTANCE_LOCATION_UNSPECIFIED)
1685 }
1686 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => {
1687 std::option::Option::Some(Self::CUSTOM_RESOURCE_HIERARCHY_LEVELS)
1688 }
1689 _ => std::option::Option::None,
1690 }
1691 }
1692 }
1693
1694 impl std::convert::From<i32> for ProducerInstanceLocation {
1695 fn from(value: i32) -> Self {
1696 Self::new(value)
1697 }
1698 }
1699
1700 impl std::default::Default for ProducerInstanceLocation {
1701 fn default() -> Self {
1702 Self::new(0)
1703 }
1704 }
1705 }
1706
1707 #[serde_with::serde_as]
1709 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1710 #[serde(default, rename_all = "camelCase")]
1711 #[non_exhaustive]
1712 pub struct PscConnection {
1713 pub state: crate::model::service_connection_policy::State,
1715
1716 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1719 pub consumer_forwarding_rule: std::string::String,
1720
1721 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1723 pub consumer_address: std::string::String,
1724
1725 pub error_type: crate::model::ConnectionErrorType,
1728
1729 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1732 pub error: std::option::Option<rpc::model::Status>,
1733
1734 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1736 pub gce_operation: std::string::String,
1737
1738 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1740 pub consumer_target_project: std::string::String,
1741
1742 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1744 pub psc_connection_id: std::string::String,
1745
1746 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1749 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
1750
1751 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1754 pub selected_subnetwork: std::string::String,
1755
1756 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1759 pub producer_instance_id: std::string::String,
1760
1761 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1763 pub producer_instance_metadata:
1764 std::collections::HashMap<std::string::String, std::string::String>,
1765
1766 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770 pub service_class: std::string::String,
1771
1772 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1774 pub ip_version: std::option::Option<crate::model::IPVersion>,
1775
1776 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1777 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778 }
1779
1780 impl PscConnection {
1781 pub fn new() -> Self {
1782 std::default::Default::default()
1783 }
1784
1785 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
1787 mut self,
1788 v: T,
1789 ) -> Self {
1790 self.state = v.into();
1791 self
1792 }
1793
1794 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
1796 mut self,
1797 v: T,
1798 ) -> Self {
1799 self.consumer_forwarding_rule = v.into();
1800 self
1801 }
1802
1803 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
1805 mut self,
1806 v: T,
1807 ) -> Self {
1808 self.consumer_address = v.into();
1809 self
1810 }
1811
1812 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1814 mut self,
1815 v: T,
1816 ) -> Self {
1817 self.error_type = v.into();
1818 self
1819 }
1820
1821 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
1823 mut self,
1824 v: T,
1825 ) -> Self {
1826 self.error = v.into();
1827 self
1828 }
1829
1830 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1832 mut self,
1833 v: T,
1834 ) -> Self {
1835 self.gce_operation = v.into();
1836 self
1837 }
1838
1839 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
1841 mut self,
1842 v: T,
1843 ) -> Self {
1844 self.consumer_target_project = v.into();
1845 self
1846 }
1847
1848 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1850 mut self,
1851 v: T,
1852 ) -> Self {
1853 self.psc_connection_id = v.into();
1854 self
1855 }
1856
1857 pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
1859 mut self,
1860 v: T,
1861 ) -> Self {
1862 self.error_info = v.into();
1863 self
1864 }
1865
1866 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1868 mut self,
1869 v: T,
1870 ) -> Self {
1871 self.selected_subnetwork = v.into();
1872 self
1873 }
1874
1875 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1877 mut self,
1878 v: T,
1879 ) -> Self {
1880 self.producer_instance_id = v.into();
1881 self
1882 }
1883
1884 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
1886 mut self,
1887 v: T,
1888 ) -> Self {
1889 self.service_class = v.into();
1890 self
1891 }
1892
1893 pub fn set_ip_version<
1895 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
1896 >(
1897 mut self,
1898 v: T,
1899 ) -> Self {
1900 self.ip_version = v.into();
1901 self
1902 }
1903
1904 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1906 where
1907 T: std::iter::IntoIterator<Item = (K, V)>,
1908 K: std::convert::Into<std::string::String>,
1909 V: std::convert::Into<std::string::String>,
1910 {
1911 use std::iter::Iterator;
1912 self.producer_instance_metadata =
1913 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1914 self
1915 }
1916 }
1917
1918 impl wkt::message::Message for PscConnection {
1919 fn typename() -> &'static str {
1920 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
1921 }
1922 }
1923
1924 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1929 pub struct State(i32);
1930
1931 impl State {
1932 pub const STATE_UNSPECIFIED: State = State::new(0);
1934
1935 pub const ACTIVE: State = State::new(1);
1939
1940 pub const FAILED: State = State::new(2);
1943
1944 pub const CREATING: State = State::new(3);
1946
1947 pub const DELETING: State = State::new(4);
1949
1950 pub const CREATE_REPAIRING: State = State::new(5);
1952
1953 pub const DELETE_REPAIRING: State = State::new(6);
1955
1956 pub(crate) const fn new(value: i32) -> Self {
1958 Self(value)
1959 }
1960
1961 pub fn value(&self) -> i32 {
1963 self.0
1964 }
1965
1966 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1968 match self.0 {
1969 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1970 1 => std::borrow::Cow::Borrowed("ACTIVE"),
1971 2 => std::borrow::Cow::Borrowed("FAILED"),
1972 3 => std::borrow::Cow::Borrowed("CREATING"),
1973 4 => std::borrow::Cow::Borrowed("DELETING"),
1974 5 => std::borrow::Cow::Borrowed("CREATE_REPAIRING"),
1975 6 => std::borrow::Cow::Borrowed("DELETE_REPAIRING"),
1976 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1977 }
1978 }
1979
1980 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1982 match name {
1983 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
1984 "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
1985 "FAILED" => std::option::Option::Some(Self::FAILED),
1986 "CREATING" => std::option::Option::Some(Self::CREATING),
1987 "DELETING" => std::option::Option::Some(Self::DELETING),
1988 "CREATE_REPAIRING" => std::option::Option::Some(Self::CREATE_REPAIRING),
1989 "DELETE_REPAIRING" => std::option::Option::Some(Self::DELETE_REPAIRING),
1990 _ => std::option::Option::None,
1991 }
1992 }
1993 }
1994
1995 impl std::convert::From<i32> for State {
1996 fn from(value: i32) -> Self {
1997 Self::new(value)
1998 }
1999 }
2000
2001 impl std::default::Default for State {
2002 fn default() -> Self {
2003 Self::new(0)
2004 }
2005 }
2006}
2007
2008#[serde_with::serde_as]
2010#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2011#[serde(default, rename_all = "camelCase")]
2012#[non_exhaustive]
2013pub struct ListServiceConnectionPoliciesRequest {
2014 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2016 pub parent: std::string::String,
2017
2018 pub page_size: i32,
2020
2021 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2023 pub page_token: std::string::String,
2024
2025 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2027 pub filter: std::string::String,
2028
2029 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2031 pub order_by: std::string::String,
2032
2033 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2034 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2035}
2036
2037impl ListServiceConnectionPoliciesRequest {
2038 pub fn new() -> Self {
2039 std::default::Default::default()
2040 }
2041
2042 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2044 self.parent = v.into();
2045 self
2046 }
2047
2048 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2050 self.page_size = v.into();
2051 self
2052 }
2053
2054 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056 self.page_token = v.into();
2057 self
2058 }
2059
2060 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2062 self.filter = v.into();
2063 self
2064 }
2065
2066 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.order_by = v.into();
2069 self
2070 }
2071}
2072
2073impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2074 fn typename() -> &'static str {
2075 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2076 }
2077}
2078
2079#[serde_with::serde_as]
2081#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2082#[serde(default, rename_all = "camelCase")]
2083#[non_exhaustive]
2084pub struct ListServiceConnectionPoliciesResponse {
2085 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2087 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2088
2089 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2092 pub next_page_token: std::string::String,
2093
2094 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2096 pub unreachable: std::vec::Vec<std::string::String>,
2097
2098 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2099 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2100}
2101
2102impl ListServiceConnectionPoliciesResponse {
2103 pub fn new() -> Self {
2104 std::default::Default::default()
2105 }
2106
2107 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2109 self.next_page_token = v.into();
2110 self
2111 }
2112
2113 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2115 where
2116 T: std::iter::IntoIterator<Item = V>,
2117 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2118 {
2119 use std::iter::Iterator;
2120 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2121 self
2122 }
2123
2124 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2126 where
2127 T: std::iter::IntoIterator<Item = V>,
2128 V: std::convert::Into<std::string::String>,
2129 {
2130 use std::iter::Iterator;
2131 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2132 self
2133 }
2134}
2135
2136impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2137 fn typename() -> &'static str {
2138 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2139 }
2140}
2141
2142#[doc(hidden)]
2143impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2144 type PageItem = crate::model::ServiceConnectionPolicy;
2145
2146 fn items(self) -> std::vec::Vec<Self::PageItem> {
2147 self.service_connection_policies
2148 }
2149
2150 fn next_page_token(&self) -> std::string::String {
2151 use std::clone::Clone;
2152 self.next_page_token.clone()
2153 }
2154}
2155
2156#[serde_with::serde_as]
2158#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2159#[serde(default, rename_all = "camelCase")]
2160#[non_exhaustive]
2161pub struct GetServiceConnectionPolicyRequest {
2162 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2164 pub name: std::string::String,
2165
2166 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2167 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2168}
2169
2170impl GetServiceConnectionPolicyRequest {
2171 pub fn new() -> Self {
2172 std::default::Default::default()
2173 }
2174
2175 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2177 self.name = v.into();
2178 self
2179 }
2180}
2181
2182impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2183 fn typename() -> &'static str {
2184 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2185 }
2186}
2187
2188#[serde_with::serde_as]
2190#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2191#[serde(default, rename_all = "camelCase")]
2192#[non_exhaustive]
2193pub struct CreateServiceConnectionPolicyRequest {
2194 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2197 pub parent: std::string::String,
2198
2199 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2204 pub service_connection_policy_id: std::string::String,
2205
2206 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2208 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2209
2210 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2224 pub request_id: std::string::String,
2225
2226 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2227 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2228}
2229
2230impl CreateServiceConnectionPolicyRequest {
2231 pub fn new() -> Self {
2232 std::default::Default::default()
2233 }
2234
2235 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2237 self.parent = v.into();
2238 self
2239 }
2240
2241 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2243 mut self,
2244 v: T,
2245 ) -> Self {
2246 self.service_connection_policy_id = v.into();
2247 self
2248 }
2249
2250 pub fn set_service_connection_policy<
2252 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2253 >(
2254 mut self,
2255 v: T,
2256 ) -> Self {
2257 self.service_connection_policy = v.into();
2258 self
2259 }
2260
2261 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2263 self.request_id = v.into();
2264 self
2265 }
2266}
2267
2268impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2269 fn typename() -> &'static str {
2270 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2271 }
2272}
2273
2274#[serde_with::serde_as]
2276#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2277#[serde(default, rename_all = "camelCase")]
2278#[non_exhaustive]
2279pub struct UpdateServiceConnectionPolicyRequest {
2280 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2286 pub update_mask: std::option::Option<wkt::FieldMask>,
2287
2288 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2290 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2291
2292 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2306 pub request_id: std::string::String,
2307
2308 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2309 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2310}
2311
2312impl UpdateServiceConnectionPolicyRequest {
2313 pub fn new() -> Self {
2314 std::default::Default::default()
2315 }
2316
2317 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2319 mut self,
2320 v: T,
2321 ) -> Self {
2322 self.update_mask = v.into();
2323 self
2324 }
2325
2326 pub fn set_service_connection_policy<
2328 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2329 >(
2330 mut self,
2331 v: T,
2332 ) -> Self {
2333 self.service_connection_policy = v.into();
2334 self
2335 }
2336
2337 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2339 self.request_id = v.into();
2340 self
2341 }
2342}
2343
2344impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2345 fn typename() -> &'static str {
2346 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2347 }
2348}
2349
2350#[serde_with::serde_as]
2352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2353#[serde(default, rename_all = "camelCase")]
2354#[non_exhaustive]
2355pub struct DeleteServiceConnectionPolicyRequest {
2356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2358 pub name: std::string::String,
2359
2360 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2374 pub request_id: std::string::String,
2375
2376 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2380 pub etag: std::option::Option<std::string::String>,
2381
2382 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2383 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2384}
2385
2386impl DeleteServiceConnectionPolicyRequest {
2387 pub fn new() -> Self {
2388 std::default::Default::default()
2389 }
2390
2391 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2393 self.name = v.into();
2394 self
2395 }
2396
2397 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2399 self.request_id = v.into();
2400 self
2401 }
2402
2403 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2405 mut self,
2406 v: T,
2407 ) -> Self {
2408 self.etag = v.into();
2409 self
2410 }
2411}
2412
2413impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2414 fn typename() -> &'static str {
2415 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2416 }
2417}
2418
2419#[serde_with::serde_as]
2421#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2422#[serde(default, rename_all = "camelCase")]
2423#[non_exhaustive]
2424pub struct ServiceClass {
2425 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2430 pub name: std::string::String,
2431
2432 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2436 pub service_class: std::string::String,
2437
2438 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2440 pub create_time: std::option::Option<wkt::Timestamp>,
2441
2442 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2444 pub update_time: std::option::Option<wkt::Timestamp>,
2445
2446 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2448 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2449
2450 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2452 pub description: std::string::String,
2453
2454 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2458 pub etag: std::option::Option<std::string::String>,
2459
2460 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2461 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2462}
2463
2464impl ServiceClass {
2465 pub fn new() -> Self {
2466 std::default::Default::default()
2467 }
2468
2469 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2471 self.name = v.into();
2472 self
2473 }
2474
2475 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477 self.service_class = v.into();
2478 self
2479 }
2480
2481 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2483 mut self,
2484 v: T,
2485 ) -> Self {
2486 self.create_time = v.into();
2487 self
2488 }
2489
2490 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2492 mut self,
2493 v: T,
2494 ) -> Self {
2495 self.update_time = v.into();
2496 self
2497 }
2498
2499 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2501 self.description = v.into();
2502 self
2503 }
2504
2505 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2507 mut self,
2508 v: T,
2509 ) -> Self {
2510 self.etag = v.into();
2511 self
2512 }
2513
2514 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2516 where
2517 T: std::iter::IntoIterator<Item = (K, V)>,
2518 K: std::convert::Into<std::string::String>,
2519 V: std::convert::Into<std::string::String>,
2520 {
2521 use std::iter::Iterator;
2522 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2523 self
2524 }
2525}
2526
2527impl wkt::message::Message for ServiceClass {
2528 fn typename() -> &'static str {
2529 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2530 }
2531}
2532
2533#[serde_with::serde_as]
2535#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2536#[serde(default, rename_all = "camelCase")]
2537#[non_exhaustive]
2538pub struct ListServiceClassesRequest {
2539 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2541 pub parent: std::string::String,
2542
2543 pub page_size: i32,
2545
2546 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2548 pub page_token: std::string::String,
2549
2550 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2552 pub filter: std::string::String,
2553
2554 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2556 pub order_by: std::string::String,
2557
2558 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2559 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2560}
2561
2562impl ListServiceClassesRequest {
2563 pub fn new() -> Self {
2564 std::default::Default::default()
2565 }
2566
2567 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.parent = v.into();
2570 self
2571 }
2572
2573 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2575 self.page_size = v.into();
2576 self
2577 }
2578
2579 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581 self.page_token = v.into();
2582 self
2583 }
2584
2585 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2587 self.filter = v.into();
2588 self
2589 }
2590
2591 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2593 self.order_by = v.into();
2594 self
2595 }
2596}
2597
2598impl wkt::message::Message for ListServiceClassesRequest {
2599 fn typename() -> &'static str {
2600 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
2601 }
2602}
2603
2604#[serde_with::serde_as]
2606#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2607#[serde(default, rename_all = "camelCase")]
2608#[non_exhaustive]
2609pub struct ListServiceClassesResponse {
2610 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2612 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
2613
2614 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2617 pub next_page_token: std::string::String,
2618
2619 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2621 pub unreachable: std::vec::Vec<std::string::String>,
2622
2623 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2624 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2625}
2626
2627impl ListServiceClassesResponse {
2628 pub fn new() -> Self {
2629 std::default::Default::default()
2630 }
2631
2632 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.next_page_token = v.into();
2635 self
2636 }
2637
2638 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
2640 where
2641 T: std::iter::IntoIterator<Item = V>,
2642 V: std::convert::Into<crate::model::ServiceClass>,
2643 {
2644 use std::iter::Iterator;
2645 self.service_classes = v.into_iter().map(|i| i.into()).collect();
2646 self
2647 }
2648
2649 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2651 where
2652 T: std::iter::IntoIterator<Item = V>,
2653 V: std::convert::Into<std::string::String>,
2654 {
2655 use std::iter::Iterator;
2656 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2657 self
2658 }
2659}
2660
2661impl wkt::message::Message for ListServiceClassesResponse {
2662 fn typename() -> &'static str {
2663 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
2664 }
2665}
2666
2667#[doc(hidden)]
2668impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
2669 type PageItem = crate::model::ServiceClass;
2670
2671 fn items(self) -> std::vec::Vec<Self::PageItem> {
2672 self.service_classes
2673 }
2674
2675 fn next_page_token(&self) -> std::string::String {
2676 use std::clone::Clone;
2677 self.next_page_token.clone()
2678 }
2679}
2680
2681#[serde_with::serde_as]
2683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2684#[serde(default, rename_all = "camelCase")]
2685#[non_exhaustive]
2686pub struct GetServiceClassRequest {
2687 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2689 pub name: std::string::String,
2690
2691 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2692 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2693}
2694
2695impl GetServiceClassRequest {
2696 pub fn new() -> Self {
2697 std::default::Default::default()
2698 }
2699
2700 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2702 self.name = v.into();
2703 self
2704 }
2705}
2706
2707impl wkt::message::Message for GetServiceClassRequest {
2708 fn typename() -> &'static str {
2709 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
2710 }
2711}
2712
2713#[serde_with::serde_as]
2715#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2716#[serde(default, rename_all = "camelCase")]
2717#[non_exhaustive]
2718pub struct UpdateServiceClassRequest {
2719 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2725 pub update_mask: std::option::Option<wkt::FieldMask>,
2726
2727 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2729 pub service_class: std::option::Option<crate::model::ServiceClass>,
2730
2731 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2745 pub request_id: std::string::String,
2746
2747 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2748 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl UpdateServiceClassRequest {
2752 pub fn new() -> Self {
2753 std::default::Default::default()
2754 }
2755
2756 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2758 mut self,
2759 v: T,
2760 ) -> Self {
2761 self.update_mask = v.into();
2762 self
2763 }
2764
2765 pub fn set_service_class<
2767 T: std::convert::Into<std::option::Option<crate::model::ServiceClass>>,
2768 >(
2769 mut self,
2770 v: T,
2771 ) -> Self {
2772 self.service_class = v.into();
2773 self
2774 }
2775
2776 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2778 self.request_id = v.into();
2779 self
2780 }
2781}
2782
2783impl wkt::message::Message for UpdateServiceClassRequest {
2784 fn typename() -> &'static str {
2785 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
2786 }
2787}
2788
2789#[serde_with::serde_as]
2791#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2792#[serde(default, rename_all = "camelCase")]
2793#[non_exhaustive]
2794pub struct DeleteServiceClassRequest {
2795 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2797 pub name: std::string::String,
2798
2799 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2813 pub request_id: std::string::String,
2814
2815 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2819 pub etag: std::option::Option<std::string::String>,
2820
2821 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2822 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl DeleteServiceClassRequest {
2826 pub fn new() -> Self {
2827 std::default::Default::default()
2828 }
2829
2830 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.name = v.into();
2833 self
2834 }
2835
2836 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2838 self.request_id = v.into();
2839 self
2840 }
2841
2842 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2844 mut self,
2845 v: T,
2846 ) -> Self {
2847 self.etag = v.into();
2848 self
2849 }
2850}
2851
2852impl wkt::message::Message for DeleteServiceClassRequest {
2853 fn typename() -> &'static str {
2854 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
2855 }
2856}
2857
2858#[serde_with::serde_as]
2860#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2861#[serde(default, rename_all = "camelCase")]
2862#[non_exhaustive]
2863pub struct ServiceConnectionToken {
2864 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2869 pub name: std::string::String,
2870
2871 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2873 pub create_time: std::option::Option<wkt::Timestamp>,
2874
2875 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2877 pub update_time: std::option::Option<wkt::Timestamp>,
2878
2879 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2881 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2882
2883 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2885 pub description: std::string::String,
2886
2887 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2891 pub network: std::string::String,
2892
2893 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2895 pub token: std::string::String,
2896
2897 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2899 pub expire_time: std::option::Option<wkt::Timestamp>,
2900
2901 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2905 pub etag: std::option::Option<std::string::String>,
2906
2907 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2908 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2909}
2910
2911impl ServiceConnectionToken {
2912 pub fn new() -> Self {
2913 std::default::Default::default()
2914 }
2915
2916 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2918 self.name = v.into();
2919 self
2920 }
2921
2922 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2924 mut self,
2925 v: T,
2926 ) -> Self {
2927 self.create_time = v.into();
2928 self
2929 }
2930
2931 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2933 mut self,
2934 v: T,
2935 ) -> Self {
2936 self.update_time = v.into();
2937 self
2938 }
2939
2940 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2942 self.description = v.into();
2943 self
2944 }
2945
2946 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948 self.network = v.into();
2949 self
2950 }
2951
2952 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2954 self.token = v.into();
2955 self
2956 }
2957
2958 pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2960 mut self,
2961 v: T,
2962 ) -> Self {
2963 self.expire_time = v.into();
2964 self
2965 }
2966
2967 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2969 mut self,
2970 v: T,
2971 ) -> Self {
2972 self.etag = v.into();
2973 self
2974 }
2975
2976 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2978 where
2979 T: std::iter::IntoIterator<Item = (K, V)>,
2980 K: std::convert::Into<std::string::String>,
2981 V: std::convert::Into<std::string::String>,
2982 {
2983 use std::iter::Iterator;
2984 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2985 self
2986 }
2987}
2988
2989impl wkt::message::Message for ServiceConnectionToken {
2990 fn typename() -> &'static str {
2991 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
2992 }
2993}
2994
2995#[serde_with::serde_as]
2997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2998#[serde(default, rename_all = "camelCase")]
2999#[non_exhaustive]
3000pub struct ListServiceConnectionTokensRequest {
3001 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3003 pub parent: std::string::String,
3004
3005 pub page_size: i32,
3007
3008 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3010 pub page_token: std::string::String,
3011
3012 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3014 pub filter: std::string::String,
3015
3016 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3018 pub order_by: std::string::String,
3019
3020 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3021 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3022}
3023
3024impl ListServiceConnectionTokensRequest {
3025 pub fn new() -> Self {
3026 std::default::Default::default()
3027 }
3028
3029 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3031 self.parent = v.into();
3032 self
3033 }
3034
3035 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3037 self.page_size = v.into();
3038 self
3039 }
3040
3041 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3043 self.page_token = v.into();
3044 self
3045 }
3046
3047 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3049 self.filter = v.into();
3050 self
3051 }
3052
3053 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.order_by = v.into();
3056 self
3057 }
3058}
3059
3060impl wkt::message::Message for ListServiceConnectionTokensRequest {
3061 fn typename() -> &'static str {
3062 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3063 }
3064}
3065
3066#[serde_with::serde_as]
3068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3069#[serde(default, rename_all = "camelCase")]
3070#[non_exhaustive]
3071pub struct ListServiceConnectionTokensResponse {
3072 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3074 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3075
3076 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3079 pub next_page_token: std::string::String,
3080
3081 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3083 pub unreachable: std::vec::Vec<std::string::String>,
3084
3085 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3086 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3087}
3088
3089impl ListServiceConnectionTokensResponse {
3090 pub fn new() -> Self {
3091 std::default::Default::default()
3092 }
3093
3094 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3096 self.next_page_token = v.into();
3097 self
3098 }
3099
3100 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3102 where
3103 T: std::iter::IntoIterator<Item = V>,
3104 V: std::convert::Into<crate::model::ServiceConnectionToken>,
3105 {
3106 use std::iter::Iterator;
3107 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3108 self
3109 }
3110
3111 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3113 where
3114 T: std::iter::IntoIterator<Item = V>,
3115 V: std::convert::Into<std::string::String>,
3116 {
3117 use std::iter::Iterator;
3118 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3119 self
3120 }
3121}
3122
3123impl wkt::message::Message for ListServiceConnectionTokensResponse {
3124 fn typename() -> &'static str {
3125 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3126 }
3127}
3128
3129#[doc(hidden)]
3130impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3131 type PageItem = crate::model::ServiceConnectionToken;
3132
3133 fn items(self) -> std::vec::Vec<Self::PageItem> {
3134 self.service_connection_tokens
3135 }
3136
3137 fn next_page_token(&self) -> std::string::String {
3138 use std::clone::Clone;
3139 self.next_page_token.clone()
3140 }
3141}
3142
3143#[serde_with::serde_as]
3145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3146#[serde(default, rename_all = "camelCase")]
3147#[non_exhaustive]
3148pub struct GetServiceConnectionTokenRequest {
3149 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3151 pub name: std::string::String,
3152
3153 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3154 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3155}
3156
3157impl GetServiceConnectionTokenRequest {
3158 pub fn new() -> Self {
3159 std::default::Default::default()
3160 }
3161
3162 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3164 self.name = v.into();
3165 self
3166 }
3167}
3168
3169impl wkt::message::Message for GetServiceConnectionTokenRequest {
3170 fn typename() -> &'static str {
3171 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3172 }
3173}
3174
3175#[serde_with::serde_as]
3177#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3178#[serde(default, rename_all = "camelCase")]
3179#[non_exhaustive]
3180pub struct CreateServiceConnectionTokenRequest {
3181 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3184 pub parent: std::string::String,
3185
3186 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3192 pub service_connection_token_id: std::string::String,
3193
3194 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3196 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3197
3198 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3212 pub request_id: std::string::String,
3213
3214 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3215 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3216}
3217
3218impl CreateServiceConnectionTokenRequest {
3219 pub fn new() -> Self {
3220 std::default::Default::default()
3221 }
3222
3223 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.parent = v.into();
3226 self
3227 }
3228
3229 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3231 mut self,
3232 v: T,
3233 ) -> Self {
3234 self.service_connection_token_id = v.into();
3235 self
3236 }
3237
3238 pub fn set_service_connection_token<
3240 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionToken>>,
3241 >(
3242 mut self,
3243 v: T,
3244 ) -> Self {
3245 self.service_connection_token = v.into();
3246 self
3247 }
3248
3249 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3251 self.request_id = v.into();
3252 self
3253 }
3254}
3255
3256impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3257 fn typename() -> &'static str {
3258 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3259 }
3260}
3261
3262#[serde_with::serde_as]
3264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3265#[serde(default, rename_all = "camelCase")]
3266#[non_exhaustive]
3267pub struct DeleteServiceConnectionTokenRequest {
3268 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3270 pub name: std::string::String,
3271
3272 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3286 pub request_id: std::string::String,
3287
3288 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3292 pub etag: std::option::Option<std::string::String>,
3293
3294 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3295 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3296}
3297
3298impl DeleteServiceConnectionTokenRequest {
3299 pub fn new() -> Self {
3300 std::default::Default::default()
3301 }
3302
3303 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.name = v.into();
3306 self
3307 }
3308
3309 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3311 self.request_id = v.into();
3312 self
3313 }
3314
3315 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3317 mut self,
3318 v: T,
3319 ) -> Self {
3320 self.etag = v.into();
3321 self
3322 }
3323}
3324
3325impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3326 fn typename() -> &'static str {
3327 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3328 }
3329}
3330
3331#[serde_with::serde_as]
3338#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3339#[serde(default, rename_all = "camelCase")]
3340#[non_exhaustive]
3341pub struct Hub {
3342 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3346 pub name: std::string::String,
3347
3348 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3350 pub create_time: std::option::Option<wkt::Timestamp>,
3351
3352 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3354 pub update_time: std::option::Option<wkt::Timestamp>,
3355
3356 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3360 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3361
3362 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3364 pub description: std::string::String,
3365
3366 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3370 pub unique_id: std::string::String,
3371
3372 pub state: crate::model::State,
3374
3375 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3380 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
3381
3382 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3389 pub route_tables: std::vec::Vec<std::string::String>,
3390
3391 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3397 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
3398
3399 pub policy_mode: crate::model::PolicyMode,
3403
3404 pub preset_topology: crate::model::PresetTopology,
3410
3411 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3416 pub export_psc: std::option::Option<bool>,
3417
3418 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3419 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3420}
3421
3422impl Hub {
3423 pub fn new() -> Self {
3424 std::default::Default::default()
3425 }
3426
3427 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3429 self.name = v.into();
3430 self
3431 }
3432
3433 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3435 mut self,
3436 v: T,
3437 ) -> Self {
3438 self.create_time = v.into();
3439 self
3440 }
3441
3442 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3444 mut self,
3445 v: T,
3446 ) -> Self {
3447 self.update_time = v.into();
3448 self
3449 }
3450
3451 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3453 self.description = v.into();
3454 self
3455 }
3456
3457 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.unique_id = v.into();
3460 self
3461 }
3462
3463 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3465 self.state = v.into();
3466 self
3467 }
3468
3469 pub fn set_spoke_summary<
3471 T: std::convert::Into<std::option::Option<crate::model::SpokeSummary>>,
3472 >(
3473 mut self,
3474 v: T,
3475 ) -> Self {
3476 self.spoke_summary = v.into();
3477 self
3478 }
3479
3480 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
3482 mut self,
3483 v: T,
3484 ) -> Self {
3485 self.policy_mode = v.into();
3486 self
3487 }
3488
3489 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
3491 mut self,
3492 v: T,
3493 ) -> Self {
3494 self.preset_topology = v.into();
3495 self
3496 }
3497
3498 pub fn set_export_psc<T: std::convert::Into<std::option::Option<bool>>>(
3500 mut self,
3501 v: T,
3502 ) -> Self {
3503 self.export_psc = v.into();
3504 self
3505 }
3506
3507 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
3509 where
3510 T: std::iter::IntoIterator<Item = V>,
3511 V: std::convert::Into<crate::model::RoutingVPC>,
3512 {
3513 use std::iter::Iterator;
3514 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
3515 self
3516 }
3517
3518 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
3520 where
3521 T: std::iter::IntoIterator<Item = V>,
3522 V: std::convert::Into<std::string::String>,
3523 {
3524 use std::iter::Iterator;
3525 self.route_tables = v.into_iter().map(|i| i.into()).collect();
3526 self
3527 }
3528
3529 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3531 where
3532 T: std::iter::IntoIterator<Item = (K, V)>,
3533 K: std::convert::Into<std::string::String>,
3534 V: std::convert::Into<std::string::String>,
3535 {
3536 use std::iter::Iterator;
3537 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3538 self
3539 }
3540}
3541
3542impl wkt::message::Message for Hub {
3543 fn typename() -> &'static str {
3544 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
3545 }
3546}
3547
3548#[serde_with::serde_as]
3551#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3552#[serde(default, rename_all = "camelCase")]
3553#[non_exhaustive]
3554pub struct RoutingVPC {
3555 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3557 pub uri: std::string::String,
3558
3559 pub required_for_new_site_to_site_data_transfer_spokes: bool,
3565
3566 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3567 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3568}
3569
3570impl RoutingVPC {
3571 pub fn new() -> Self {
3572 std::default::Default::default()
3573 }
3574
3575 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3577 self.uri = v.into();
3578 self
3579 }
3580
3581 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
3583 mut self,
3584 v: T,
3585 ) -> Self {
3586 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
3587 self
3588 }
3589}
3590
3591impl wkt::message::Message for RoutingVPC {
3592 fn typename() -> &'static str {
3593 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
3594 }
3595}
3596
3597#[serde_with::serde_as]
3608#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3609#[serde(default, rename_all = "camelCase")]
3610#[non_exhaustive]
3611pub struct Spoke {
3612 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3616 pub name: std::string::String,
3617
3618 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3620 pub create_time: std::option::Option<wkt::Timestamp>,
3621
3622 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3624 pub update_time: std::option::Option<wkt::Timestamp>,
3625
3626 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3630 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3631
3632 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3634 pub description: std::string::String,
3635
3636 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3638 pub hub: std::string::String,
3639
3640 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3642 pub group: std::string::String,
3643
3644 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3646 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
3647
3648 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3650 pub linked_interconnect_attachments:
3651 std::option::Option<crate::model::LinkedInterconnectAttachments>,
3652
3653 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3655 pub linked_router_appliance_instances:
3656 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
3657
3658 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3660 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
3661
3662 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3664 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
3665
3666 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3670 pub unique_id: std::string::String,
3671
3672 pub state: crate::model::State,
3674
3675 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3677 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
3678
3679 pub spoke_type: crate::model::SpokeType,
3681
3682 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3686 pub etag: std::string::String,
3687
3688 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3690 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
3691
3692 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3693 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3694}
3695
3696impl Spoke {
3697 pub fn new() -> Self {
3698 std::default::Default::default()
3699 }
3700
3701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.name = v.into();
3704 self
3705 }
3706
3707 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3709 mut self,
3710 v: T,
3711 ) -> Self {
3712 self.create_time = v.into();
3713 self
3714 }
3715
3716 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3718 mut self,
3719 v: T,
3720 ) -> Self {
3721 self.update_time = v.into();
3722 self
3723 }
3724
3725 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3727 self.description = v.into();
3728 self
3729 }
3730
3731 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3733 self.hub = v.into();
3734 self
3735 }
3736
3737 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3739 self.group = v.into();
3740 self
3741 }
3742
3743 pub fn set_linked_vpn_tunnels<
3745 T: std::convert::Into<std::option::Option<crate::model::LinkedVpnTunnels>>,
3746 >(
3747 mut self,
3748 v: T,
3749 ) -> Self {
3750 self.linked_vpn_tunnels = v.into();
3751 self
3752 }
3753
3754 pub fn set_linked_interconnect_attachments<
3756 T: std::convert::Into<std::option::Option<crate::model::LinkedInterconnectAttachments>>,
3757 >(
3758 mut self,
3759 v: T,
3760 ) -> Self {
3761 self.linked_interconnect_attachments = v.into();
3762 self
3763 }
3764
3765 pub fn set_linked_router_appliance_instances<
3767 T: std::convert::Into<std::option::Option<crate::model::LinkedRouterApplianceInstances>>,
3768 >(
3769 mut self,
3770 v: T,
3771 ) -> Self {
3772 self.linked_router_appliance_instances = v.into();
3773 self
3774 }
3775
3776 pub fn set_linked_vpc_network<
3778 T: std::convert::Into<std::option::Option<crate::model::LinkedVpcNetwork>>,
3779 >(
3780 mut self,
3781 v: T,
3782 ) -> Self {
3783 self.linked_vpc_network = v.into();
3784 self
3785 }
3786
3787 pub fn set_linked_producer_vpc_network<
3789 T: std::convert::Into<std::option::Option<crate::model::LinkedProducerVpcNetwork>>,
3790 >(
3791 mut self,
3792 v: T,
3793 ) -> Self {
3794 self.linked_producer_vpc_network = v.into();
3795 self
3796 }
3797
3798 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3800 self.unique_id = v.into();
3801 self
3802 }
3803
3804 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3806 self.state = v.into();
3807 self
3808 }
3809
3810 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
3812 self.spoke_type = v.into();
3813 self
3814 }
3815
3816 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3818 self.etag = v.into();
3819 self
3820 }
3821
3822 pub fn set_reasons<T, V>(mut self, v: T) -> Self
3824 where
3825 T: std::iter::IntoIterator<Item = V>,
3826 V: std::convert::Into<crate::model::spoke::StateReason>,
3827 {
3828 use std::iter::Iterator;
3829 self.reasons = v.into_iter().map(|i| i.into()).collect();
3830 self
3831 }
3832
3833 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
3835 where
3836 T: std::iter::IntoIterator<Item = V>,
3837 V: std::convert::Into<std::string::String>,
3838 {
3839 use std::iter::Iterator;
3840 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
3841 self
3842 }
3843
3844 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3846 where
3847 T: std::iter::IntoIterator<Item = (K, V)>,
3848 K: std::convert::Into<std::string::String>,
3849 V: std::convert::Into<std::string::String>,
3850 {
3851 use std::iter::Iterator;
3852 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3853 self
3854 }
3855}
3856
3857impl wkt::message::Message for Spoke {
3858 fn typename() -> &'static str {
3859 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
3860 }
3861}
3862
3863pub mod spoke {
3865 #[allow(unused_imports)]
3866 use super::*;
3867
3868 #[serde_with::serde_as]
3870 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3871 #[serde(default, rename_all = "camelCase")]
3872 #[non_exhaustive]
3873 pub struct StateReason {
3874 pub code: crate::model::spoke::state_reason::Code,
3876
3877 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3879 pub message: std::string::String,
3880
3881 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3883 pub user_details: std::string::String,
3884
3885 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3886 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3887 }
3888
3889 impl StateReason {
3890 pub fn new() -> Self {
3891 std::default::Default::default()
3892 }
3893
3894 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
3896 mut self,
3897 v: T,
3898 ) -> Self {
3899 self.code = v.into();
3900 self
3901 }
3902
3903 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905 self.message = v.into();
3906 self
3907 }
3908
3909 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
3911 mut self,
3912 v: T,
3913 ) -> Self {
3914 self.user_details = v.into();
3915 self
3916 }
3917 }
3918
3919 impl wkt::message::Message for StateReason {
3920 fn typename() -> &'static str {
3921 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
3922 }
3923 }
3924
3925 pub mod state_reason {
3927 #[allow(unused_imports)]
3928 use super::*;
3929
3930 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3932 pub struct Code(i32);
3933
3934 impl Code {
3935 pub const CODE_UNSPECIFIED: Code = Code::new(0);
3937
3938 pub const PENDING_REVIEW: Code = Code::new(1);
3940
3941 pub const REJECTED: Code = Code::new(2);
3943
3944 pub const PAUSED: Code = Code::new(3);
3946
3947 pub const FAILED: Code = Code::new(4);
3950
3951 pub const UPDATE_PENDING_REVIEW: Code = Code::new(5);
3953
3954 pub const UPDATE_REJECTED: Code = Code::new(6);
3956
3957 pub const UPDATE_FAILED: Code = Code::new(7);
3960
3961 pub(crate) const fn new(value: i32) -> Self {
3963 Self(value)
3964 }
3965
3966 pub fn value(&self) -> i32 {
3968 self.0
3969 }
3970
3971 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3973 match self.0 {
3974 0 => std::borrow::Cow::Borrowed("CODE_UNSPECIFIED"),
3975 1 => std::borrow::Cow::Borrowed("PENDING_REVIEW"),
3976 2 => std::borrow::Cow::Borrowed("REJECTED"),
3977 3 => std::borrow::Cow::Borrowed("PAUSED"),
3978 4 => std::borrow::Cow::Borrowed("FAILED"),
3979 5 => std::borrow::Cow::Borrowed("UPDATE_PENDING_REVIEW"),
3980 6 => std::borrow::Cow::Borrowed("UPDATE_REJECTED"),
3981 7 => std::borrow::Cow::Borrowed("UPDATE_FAILED"),
3982 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3983 }
3984 }
3985
3986 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3988 match name {
3989 "CODE_UNSPECIFIED" => std::option::Option::Some(Self::CODE_UNSPECIFIED),
3990 "PENDING_REVIEW" => std::option::Option::Some(Self::PENDING_REVIEW),
3991 "REJECTED" => std::option::Option::Some(Self::REJECTED),
3992 "PAUSED" => std::option::Option::Some(Self::PAUSED),
3993 "FAILED" => std::option::Option::Some(Self::FAILED),
3994 "UPDATE_PENDING_REVIEW" => {
3995 std::option::Option::Some(Self::UPDATE_PENDING_REVIEW)
3996 }
3997 "UPDATE_REJECTED" => std::option::Option::Some(Self::UPDATE_REJECTED),
3998 "UPDATE_FAILED" => std::option::Option::Some(Self::UPDATE_FAILED),
3999 _ => std::option::Option::None,
4000 }
4001 }
4002 }
4003
4004 impl std::convert::From<i32> for Code {
4005 fn from(value: i32) -> Self {
4006 Self::new(value)
4007 }
4008 }
4009
4010 impl std::default::Default for Code {
4011 fn default() -> Self {
4012 Self::new(0)
4013 }
4014 }
4015 }
4016}
4017
4018#[serde_with::serde_as]
4019#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4020#[serde(default, rename_all = "camelCase")]
4021#[non_exhaustive]
4022pub struct RouteTable {
4023 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4027 pub name: std::string::String,
4028
4029 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4031 pub create_time: std::option::Option<wkt::Timestamp>,
4032
4033 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4035 pub update_time: std::option::Option<wkt::Timestamp>,
4036
4037 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4041 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4042
4043 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4045 pub description: std::string::String,
4046
4047 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4052 pub uid: std::string::String,
4053
4054 pub state: crate::model::State,
4056
4057 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4058 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4059}
4060
4061impl RouteTable {
4062 pub fn new() -> Self {
4063 std::default::Default::default()
4064 }
4065
4066 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068 self.name = v.into();
4069 self
4070 }
4071
4072 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4074 mut self,
4075 v: T,
4076 ) -> Self {
4077 self.create_time = v.into();
4078 self
4079 }
4080
4081 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4083 mut self,
4084 v: T,
4085 ) -> Self {
4086 self.update_time = v.into();
4087 self
4088 }
4089
4090 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.description = v.into();
4093 self
4094 }
4095
4096 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4098 self.uid = v.into();
4099 self
4100 }
4101
4102 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4104 self.state = v.into();
4105 self
4106 }
4107
4108 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4110 where
4111 T: std::iter::IntoIterator<Item = (K, V)>,
4112 K: std::convert::Into<std::string::String>,
4113 V: std::convert::Into<std::string::String>,
4114 {
4115 use std::iter::Iterator;
4116 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4117 self
4118 }
4119}
4120
4121impl wkt::message::Message for RouteTable {
4122 fn typename() -> &'static str {
4123 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
4124 }
4125}
4126
4127#[serde_with::serde_as]
4130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4131#[serde(default, rename_all = "camelCase")]
4132#[non_exhaustive]
4133pub struct Route {
4134 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4138 pub name: std::string::String,
4139
4140 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4142 pub create_time: std::option::Option<wkt::Timestamp>,
4143
4144 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4146 pub update_time: std::option::Option<wkt::Timestamp>,
4147
4148 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4150 pub ip_cidr_range: std::string::String,
4151
4152 #[serde(rename = "type")]
4155 pub r#type: crate::model::RouteType,
4156
4157 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4159 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
4160
4161 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4165 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4166
4167 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4169 pub description: std::string::String,
4170
4171 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4176 pub uid: std::string::String,
4177
4178 pub state: crate::model::State,
4180
4181 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4184 pub spoke: std::string::String,
4185
4186 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4190 pub location: std::string::String,
4191
4192 #[serde_as(as = "serde_with::DisplayFromStr")]
4196 pub priority: i64,
4197
4198 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4200 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
4201
4202 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4205 pub next_hop_router_appliance_instance:
4206 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
4207
4208 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4210 pub next_hop_interconnect_attachment:
4211 std::option::Option<crate::model::NextHopInterconnectAttachment>,
4212
4213 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4214 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4215}
4216
4217impl Route {
4218 pub fn new() -> Self {
4219 std::default::Default::default()
4220 }
4221
4222 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4224 self.name = v.into();
4225 self
4226 }
4227
4228 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4230 mut self,
4231 v: T,
4232 ) -> Self {
4233 self.create_time = v.into();
4234 self
4235 }
4236
4237 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4239 mut self,
4240 v: T,
4241 ) -> Self {
4242 self.update_time = v.into();
4243 self
4244 }
4245
4246 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4248 self.ip_cidr_range = v.into();
4249 self
4250 }
4251
4252 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
4254 self.r#type = v.into();
4255 self
4256 }
4257
4258 pub fn set_next_hop_vpc_network<
4260 T: std::convert::Into<std::option::Option<crate::model::NextHopVpcNetwork>>,
4261 >(
4262 mut self,
4263 v: T,
4264 ) -> Self {
4265 self.next_hop_vpc_network = v.into();
4266 self
4267 }
4268
4269 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4271 self.description = v.into();
4272 self
4273 }
4274
4275 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.uid = v.into();
4278 self
4279 }
4280
4281 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4283 self.state = v.into();
4284 self
4285 }
4286
4287 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289 self.spoke = v.into();
4290 self
4291 }
4292
4293 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4295 self.location = v.into();
4296 self
4297 }
4298
4299 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4301 self.priority = v.into();
4302 self
4303 }
4304
4305 pub fn set_next_hop_vpn_tunnel<
4307 T: std::convert::Into<std::option::Option<crate::model::NextHopVPNTunnel>>,
4308 >(
4309 mut self,
4310 v: T,
4311 ) -> Self {
4312 self.next_hop_vpn_tunnel = v.into();
4313 self
4314 }
4315
4316 pub fn set_next_hop_router_appliance_instance<
4318 T: std::convert::Into<std::option::Option<crate::model::NextHopRouterApplianceInstance>>,
4319 >(
4320 mut self,
4321 v: T,
4322 ) -> Self {
4323 self.next_hop_router_appliance_instance = v.into();
4324 self
4325 }
4326
4327 pub fn set_next_hop_interconnect_attachment<
4329 T: std::convert::Into<std::option::Option<crate::model::NextHopInterconnectAttachment>>,
4330 >(
4331 mut self,
4332 v: T,
4333 ) -> Self {
4334 self.next_hop_interconnect_attachment = v.into();
4335 self
4336 }
4337
4338 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4340 where
4341 T: std::iter::IntoIterator<Item = (K, V)>,
4342 K: std::convert::Into<std::string::String>,
4343 V: std::convert::Into<std::string::String>,
4344 {
4345 use std::iter::Iterator;
4346 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4347 self
4348 }
4349}
4350
4351impl wkt::message::Message for Route {
4352 fn typename() -> &'static str {
4353 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
4354 }
4355}
4356
4357#[serde_with::serde_as]
4359#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4360#[serde(default, rename_all = "camelCase")]
4361#[non_exhaustive]
4362pub struct Group {
4363 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4367 pub name: std::string::String,
4368
4369 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4371 pub create_time: std::option::Option<wkt::Timestamp>,
4372
4373 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4375 pub update_time: std::option::Option<wkt::Timestamp>,
4376
4377 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4381 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4382
4383 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4385 pub description: std::string::String,
4386
4387 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4392 pub uid: std::string::String,
4393
4394 pub state: crate::model::State,
4396
4397 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4399 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
4400
4401 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4405 pub route_table: std::string::String,
4406
4407 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4408 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4409}
4410
4411impl Group {
4412 pub fn new() -> Self {
4413 std::default::Default::default()
4414 }
4415
4416 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4418 self.name = v.into();
4419 self
4420 }
4421
4422 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4424 mut self,
4425 v: T,
4426 ) -> Self {
4427 self.create_time = v.into();
4428 self
4429 }
4430
4431 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4433 mut self,
4434 v: T,
4435 ) -> Self {
4436 self.update_time = v.into();
4437 self
4438 }
4439
4440 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.description = v.into();
4443 self
4444 }
4445
4446 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4448 self.uid = v.into();
4449 self
4450 }
4451
4452 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4454 self.state = v.into();
4455 self
4456 }
4457
4458 pub fn set_auto_accept<T: std::convert::Into<std::option::Option<crate::model::AutoAccept>>>(
4460 mut self,
4461 v: T,
4462 ) -> Self {
4463 self.auto_accept = v.into();
4464 self
4465 }
4466
4467 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469 self.route_table = v.into();
4470 self
4471 }
4472
4473 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4475 where
4476 T: std::iter::IntoIterator<Item = (K, V)>,
4477 K: std::convert::Into<std::string::String>,
4478 V: std::convert::Into<std::string::String>,
4479 {
4480 use std::iter::Iterator;
4481 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4482 self
4483 }
4484}
4485
4486impl wkt::message::Message for Group {
4487 fn typename() -> &'static str {
4488 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
4489 }
4490}
4491
4492#[serde_with::serde_as]
4500#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4501#[serde(default, rename_all = "camelCase")]
4502#[non_exhaustive]
4503pub struct AutoAccept {
4504 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4508 pub auto_accept_projects: std::vec::Vec<std::string::String>,
4509
4510 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4511 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4512}
4513
4514impl AutoAccept {
4515 pub fn new() -> Self {
4516 std::default::Default::default()
4517 }
4518
4519 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
4521 where
4522 T: std::iter::IntoIterator<Item = V>,
4523 V: std::convert::Into<std::string::String>,
4524 {
4525 use std::iter::Iterator;
4526 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
4527 self
4528 }
4529}
4530
4531impl wkt::message::Message for AutoAccept {
4532 fn typename() -> &'static str {
4533 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
4534 }
4535}
4536
4537#[serde_with::serde_as]
4543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4544#[serde(default, rename_all = "camelCase")]
4545#[non_exhaustive]
4546pub struct ListHubsRequest {
4547 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4549 pub parent: std::string::String,
4550
4551 pub page_size: i32,
4553
4554 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4556 pub page_token: std::string::String,
4557
4558 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4560 pub filter: std::string::String,
4561
4562 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4564 pub order_by: std::string::String,
4565
4566 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4567 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4568}
4569
4570impl ListHubsRequest {
4571 pub fn new() -> Self {
4572 std::default::Default::default()
4573 }
4574
4575 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4577 self.parent = v.into();
4578 self
4579 }
4580
4581 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4583 self.page_size = v.into();
4584 self
4585 }
4586
4587 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4589 self.page_token = v.into();
4590 self
4591 }
4592
4593 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595 self.filter = v.into();
4596 self
4597 }
4598
4599 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4601 self.order_by = v.into();
4602 self
4603 }
4604}
4605
4606impl wkt::message::Message for ListHubsRequest {
4607 fn typename() -> &'static str {
4608 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
4609 }
4610}
4611
4612#[serde_with::serde_as]
4618#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4619#[serde(default, rename_all = "camelCase")]
4620#[non_exhaustive]
4621pub struct ListHubsResponse {
4622 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4624 pub hubs: std::vec::Vec<crate::model::Hub>,
4625
4626 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4630 pub next_page_token: std::string::String,
4631
4632 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4634 pub unreachable: std::vec::Vec<std::string::String>,
4635
4636 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4637 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4638}
4639
4640impl ListHubsResponse {
4641 pub fn new() -> Self {
4642 std::default::Default::default()
4643 }
4644
4645 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4647 self.next_page_token = v.into();
4648 self
4649 }
4650
4651 pub fn set_hubs<T, V>(mut self, v: T) -> Self
4653 where
4654 T: std::iter::IntoIterator<Item = V>,
4655 V: std::convert::Into<crate::model::Hub>,
4656 {
4657 use std::iter::Iterator;
4658 self.hubs = v.into_iter().map(|i| i.into()).collect();
4659 self
4660 }
4661
4662 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4664 where
4665 T: std::iter::IntoIterator<Item = V>,
4666 V: std::convert::Into<std::string::String>,
4667 {
4668 use std::iter::Iterator;
4669 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4670 self
4671 }
4672}
4673
4674impl wkt::message::Message for ListHubsResponse {
4675 fn typename() -> &'static str {
4676 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
4677 }
4678}
4679
4680#[doc(hidden)]
4681impl gax::paginator::internal::PageableResponse for ListHubsResponse {
4682 type PageItem = crate::model::Hub;
4683
4684 fn items(self) -> std::vec::Vec<Self::PageItem> {
4685 self.hubs
4686 }
4687
4688 fn next_page_token(&self) -> std::string::String {
4689 use std::clone::Clone;
4690 self.next_page_token.clone()
4691 }
4692}
4693
4694#[serde_with::serde_as]
4700#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4701#[serde(default, rename_all = "camelCase")]
4702#[non_exhaustive]
4703pub struct GetHubRequest {
4704 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4706 pub name: std::string::String,
4707
4708 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4709 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4710}
4711
4712impl GetHubRequest {
4713 pub fn new() -> Self {
4714 std::default::Default::default()
4715 }
4716
4717 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4719 self.name = v.into();
4720 self
4721 }
4722}
4723
4724impl wkt::message::Message for GetHubRequest {
4725 fn typename() -> &'static str {
4726 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
4727 }
4728}
4729
4730#[serde_with::serde_as]
4736#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4737#[serde(default, rename_all = "camelCase")]
4738#[non_exhaustive]
4739pub struct CreateHubRequest {
4740 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4742 pub parent: std::string::String,
4743
4744 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4746 pub hub_id: std::string::String,
4747
4748 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4750 pub hub: std::option::Option<crate::model::Hub>,
4751
4752 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4767 pub request_id: std::string::String,
4768
4769 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4770 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771}
4772
4773impl CreateHubRequest {
4774 pub fn new() -> Self {
4775 std::default::Default::default()
4776 }
4777
4778 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4780 self.parent = v.into();
4781 self
4782 }
4783
4784 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786 self.hub_id = v.into();
4787 self
4788 }
4789
4790 pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
4792 mut self,
4793 v: T,
4794 ) -> Self {
4795 self.hub = v.into();
4796 self
4797 }
4798
4799 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.request_id = v.into();
4802 self
4803 }
4804}
4805
4806impl wkt::message::Message for CreateHubRequest {
4807 fn typename() -> &'static str {
4808 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
4809 }
4810}
4811
4812#[serde_with::serde_as]
4818#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4819#[serde(default, rename_all = "camelCase")]
4820#[non_exhaustive]
4821pub struct UpdateHubRequest {
4822 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4828 pub update_mask: std::option::Option<wkt::FieldMask>,
4829
4830 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4832 pub hub: std::option::Option<crate::model::Hub>,
4833
4834 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4849 pub request_id: std::string::String,
4850
4851 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4852 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4853}
4854
4855impl UpdateHubRequest {
4856 pub fn new() -> Self {
4857 std::default::Default::default()
4858 }
4859
4860 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
4862 mut self,
4863 v: T,
4864 ) -> Self {
4865 self.update_mask = v.into();
4866 self
4867 }
4868
4869 pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
4871 mut self,
4872 v: T,
4873 ) -> Self {
4874 self.hub = v.into();
4875 self
4876 }
4877
4878 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4880 self.request_id = v.into();
4881 self
4882 }
4883}
4884
4885impl wkt::message::Message for UpdateHubRequest {
4886 fn typename() -> &'static str {
4887 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
4888 }
4889}
4890
4891#[serde_with::serde_as]
4896#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4897#[serde(default, rename_all = "camelCase")]
4898#[non_exhaustive]
4899pub struct DeleteHubRequest {
4900 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4902 pub name: std::string::String,
4903
4904 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4919 pub request_id: std::string::String,
4920
4921 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4922 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4923}
4924
4925impl DeleteHubRequest {
4926 pub fn new() -> Self {
4927 std::default::Default::default()
4928 }
4929
4930 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.name = v.into();
4933 self
4934 }
4935
4936 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4938 self.request_id = v.into();
4939 self
4940 }
4941}
4942
4943impl wkt::message::Message for DeleteHubRequest {
4944 fn typename() -> &'static str {
4945 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
4946 }
4947}
4948
4949#[serde_with::serde_as]
4954#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4955#[serde(default, rename_all = "camelCase")]
4956#[non_exhaustive]
4957pub struct ListHubSpokesRequest {
4958 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4960 pub name: std::string::String,
4961
4962 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4971 pub spoke_locations: std::vec::Vec<std::string::String>,
4972
4973 pub page_size: i32,
4975
4976 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4978 pub page_token: std::string::String,
4979
4980 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4982 pub filter: std::string::String,
4983
4984 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4986 pub order_by: std::string::String,
4987
4988 pub view: crate::model::list_hub_spokes_request::SpokeView,
4992
4993 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4994 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4995}
4996
4997impl ListHubSpokesRequest {
4998 pub fn new() -> Self {
4999 std::default::Default::default()
5000 }
5001
5002 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5004 self.name = v.into();
5005 self
5006 }
5007
5008 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5010 self.page_size = v.into();
5011 self
5012 }
5013
5014 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5016 self.page_token = v.into();
5017 self
5018 }
5019
5020 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022 self.filter = v.into();
5023 self
5024 }
5025
5026 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5028 self.order_by = v.into();
5029 self
5030 }
5031
5032 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
5034 mut self,
5035 v: T,
5036 ) -> Self {
5037 self.view = v.into();
5038 self
5039 }
5040
5041 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5043 where
5044 T: std::iter::IntoIterator<Item = V>,
5045 V: std::convert::Into<std::string::String>,
5046 {
5047 use std::iter::Iterator;
5048 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5049 self
5050 }
5051}
5052
5053impl wkt::message::Message for ListHubSpokesRequest {
5054 fn typename() -> &'static str {
5055 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
5056 }
5057}
5058
5059pub mod list_hub_spokes_request {
5061 #[allow(unused_imports)]
5062 use super::*;
5063
5064 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5066 pub struct SpokeView(i32);
5067
5068 impl SpokeView {
5069 pub const SPOKE_VIEW_UNSPECIFIED: SpokeView = SpokeView::new(0);
5072
5073 pub const BASIC: SpokeView = SpokeView::new(1);
5076
5077 pub const DETAILED: SpokeView = SpokeView::new(2);
5081
5082 pub(crate) const fn new(value: i32) -> Self {
5084 Self(value)
5085 }
5086
5087 pub fn value(&self) -> i32 {
5089 self.0
5090 }
5091
5092 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5094 match self.0 {
5095 0 => std::borrow::Cow::Borrowed("SPOKE_VIEW_UNSPECIFIED"),
5096 1 => std::borrow::Cow::Borrowed("BASIC"),
5097 2 => std::borrow::Cow::Borrowed("DETAILED"),
5098 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5099 }
5100 }
5101
5102 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5104 match name {
5105 "SPOKE_VIEW_UNSPECIFIED" => std::option::Option::Some(Self::SPOKE_VIEW_UNSPECIFIED),
5106 "BASIC" => std::option::Option::Some(Self::BASIC),
5107 "DETAILED" => std::option::Option::Some(Self::DETAILED),
5108 _ => std::option::Option::None,
5109 }
5110 }
5111 }
5112
5113 impl std::convert::From<i32> for SpokeView {
5114 fn from(value: i32) -> Self {
5115 Self::new(value)
5116 }
5117 }
5118
5119 impl std::default::Default for SpokeView {
5120 fn default() -> Self {
5121 Self::new(0)
5122 }
5123 }
5124}
5125
5126#[serde_with::serde_as]
5131#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5132#[serde(default, rename_all = "camelCase")]
5133#[non_exhaustive]
5134pub struct ListHubSpokesResponse {
5135 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5139 pub spokes: std::vec::Vec<crate::model::Spoke>,
5140
5141 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5145 pub next_page_token: std::string::String,
5146
5147 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5149 pub unreachable: std::vec::Vec<std::string::String>,
5150
5151 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5152 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5153}
5154
5155impl ListHubSpokesResponse {
5156 pub fn new() -> Self {
5157 std::default::Default::default()
5158 }
5159
5160 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.next_page_token = v.into();
5163 self
5164 }
5165
5166 pub fn set_spokes<T, V>(mut self, v: T) -> Self
5168 where
5169 T: std::iter::IntoIterator<Item = V>,
5170 V: std::convert::Into<crate::model::Spoke>,
5171 {
5172 use std::iter::Iterator;
5173 self.spokes = v.into_iter().map(|i| i.into()).collect();
5174 self
5175 }
5176
5177 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5179 where
5180 T: std::iter::IntoIterator<Item = V>,
5181 V: std::convert::Into<std::string::String>,
5182 {
5183 use std::iter::Iterator;
5184 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5185 self
5186 }
5187}
5188
5189impl wkt::message::Message for ListHubSpokesResponse {
5190 fn typename() -> &'static str {
5191 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
5192 }
5193}
5194
5195#[doc(hidden)]
5196impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
5197 type PageItem = crate::model::Spoke;
5198
5199 fn items(self) -> std::vec::Vec<Self::PageItem> {
5200 self.spokes
5201 }
5202
5203 fn next_page_token(&self) -> std::string::String {
5204 use std::clone::Clone;
5205 self.next_page_token.clone()
5206 }
5207}
5208
5209#[serde_with::serde_as]
5214#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5215#[serde(default, rename_all = "camelCase")]
5216#[non_exhaustive]
5217pub struct QueryHubStatusRequest {
5218 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5220 pub name: std::string::String,
5221
5222 pub page_size: i32,
5224
5225 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5227 pub page_token: std::string::String,
5228
5229 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5240 pub filter: std::string::String,
5241
5242 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5254 pub order_by: std::string::String,
5255
5256 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5266 pub group_by: std::string::String,
5267
5268 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5269 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5270}
5271
5272impl QueryHubStatusRequest {
5273 pub fn new() -> Self {
5274 std::default::Default::default()
5275 }
5276
5277 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5279 self.name = v.into();
5280 self
5281 }
5282
5283 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5285 self.page_size = v.into();
5286 self
5287 }
5288
5289 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291 self.page_token = v.into();
5292 self
5293 }
5294
5295 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5297 self.filter = v.into();
5298 self
5299 }
5300
5301 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5303 self.order_by = v.into();
5304 self
5305 }
5306
5307 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5309 self.group_by = v.into();
5310 self
5311 }
5312}
5313
5314impl wkt::message::Message for QueryHubStatusRequest {
5315 fn typename() -> &'static str {
5316 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
5317 }
5318}
5319
5320#[serde_with::serde_as]
5325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5326#[serde(default, rename_all = "camelCase")]
5327#[non_exhaustive]
5328pub struct QueryHubStatusResponse {
5329 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5331 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
5332
5333 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5337 pub next_page_token: std::string::String,
5338
5339 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5340 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5341}
5342
5343impl QueryHubStatusResponse {
5344 pub fn new() -> Self {
5345 std::default::Default::default()
5346 }
5347
5348 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5350 self.next_page_token = v.into();
5351 self
5352 }
5353
5354 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
5356 where
5357 T: std::iter::IntoIterator<Item = V>,
5358 V: std::convert::Into<crate::model::HubStatusEntry>,
5359 {
5360 use std::iter::Iterator;
5361 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
5362 self
5363 }
5364}
5365
5366impl wkt::message::Message for QueryHubStatusResponse {
5367 fn typename() -> &'static str {
5368 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
5369 }
5370}
5371
5372#[doc(hidden)]
5373impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
5374 type PageItem = crate::model::HubStatusEntry;
5375
5376 fn items(self) -> std::vec::Vec<Self::PageItem> {
5377 self.hub_status_entries
5378 }
5379
5380 fn next_page_token(&self) -> std::string::String {
5381 use std::clone::Clone;
5382 self.next_page_token.clone()
5383 }
5384}
5385
5386#[serde_with::serde_as]
5389#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5390#[serde(default, rename_all = "camelCase")]
5391#[non_exhaustive]
5392pub struct HubStatusEntry {
5393 pub count: i32,
5397
5398 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5401 pub group_by: std::string::String,
5402
5403 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5405 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
5406
5407 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5408 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5409}
5410
5411impl HubStatusEntry {
5412 pub fn new() -> Self {
5413 std::default::Default::default()
5414 }
5415
5416 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5418 self.count = v.into();
5419 self
5420 }
5421
5422 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.group_by = v.into();
5425 self
5426 }
5427
5428 pub fn set_psc_propagation_status<
5430 T: std::convert::Into<std::option::Option<crate::model::PscPropagationStatus>>,
5431 >(
5432 mut self,
5433 v: T,
5434 ) -> Self {
5435 self.psc_propagation_status = v.into();
5436 self
5437 }
5438}
5439
5440impl wkt::message::Message for HubStatusEntry {
5441 fn typename() -> &'static str {
5442 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
5443 }
5444}
5445
5446#[serde_with::serde_as]
5449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5450#[serde(default, rename_all = "camelCase")]
5451#[non_exhaustive]
5452pub struct PscPropagationStatus {
5453 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5455 pub source_spoke: std::string::String,
5456
5457 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5459 pub source_group: std::string::String,
5460
5461 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5463 pub source_forwarding_rule: std::string::String,
5464
5465 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5467 pub target_spoke: std::string::String,
5468
5469 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5471 pub target_group: std::string::String,
5472
5473 pub code: crate::model::psc_propagation_status::Code,
5475
5476 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5479 pub message: std::string::String,
5480
5481 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5482 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5483}
5484
5485impl PscPropagationStatus {
5486 pub fn new() -> Self {
5487 std::default::Default::default()
5488 }
5489
5490 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5492 self.source_spoke = v.into();
5493 self
5494 }
5495
5496 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5498 self.source_group = v.into();
5499 self
5500 }
5501
5502 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
5504 mut self,
5505 v: T,
5506 ) -> Self {
5507 self.source_forwarding_rule = v.into();
5508 self
5509 }
5510
5511 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5513 self.target_spoke = v.into();
5514 self
5515 }
5516
5517 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5519 self.target_group = v.into();
5520 self
5521 }
5522
5523 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
5525 mut self,
5526 v: T,
5527 ) -> Self {
5528 self.code = v.into();
5529 self
5530 }
5531
5532 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5534 self.message = v.into();
5535 self
5536 }
5537}
5538
5539impl wkt::message::Message for PscPropagationStatus {
5540 fn typename() -> &'static str {
5541 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
5542 }
5543}
5544
5545pub mod psc_propagation_status {
5547 #[allow(unused_imports)]
5548 use super::*;
5549
5550 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5553 pub struct Code(i32);
5554
5555 impl Code {
5556 pub const CODE_UNSPECIFIED: Code = Code::new(0);
5558
5559 pub const READY: Code = Code::new(1);
5561
5562 pub const PROPAGATING: Code = Code::new(2);
5565
5566 pub const ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED: Code = Code::new(3);
5570
5571 pub const ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED: Code = Code::new(4);
5576
5577 pub const ERROR_PRODUCER_QUOTA_EXCEEDED: Code = Code::new(5);
5581
5582 pub const ERROR_CONSUMER_QUOTA_EXCEEDED: Code = Code::new(6);
5586
5587 pub(crate) const fn new(value: i32) -> Self {
5589 Self(value)
5590 }
5591
5592 pub fn value(&self) -> i32 {
5594 self.0
5595 }
5596
5597 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5599 match self.0 {
5600 0 => std::borrow::Cow::Borrowed("CODE_UNSPECIFIED"),
5601 1 => std::borrow::Cow::Borrowed("READY"),
5602 2 => std::borrow::Cow::Borrowed("PROPAGATING"),
5603 3 => std::borrow::Cow::Borrowed(
5604 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED",
5605 ),
5606 4 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED"),
5607 5 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_QUOTA_EXCEEDED"),
5608 6 => std::borrow::Cow::Borrowed("ERROR_CONSUMER_QUOTA_EXCEEDED"),
5609 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5610 }
5611 }
5612
5613 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5615 match name {
5616 "CODE_UNSPECIFIED" => std::option::Option::Some(Self::CODE_UNSPECIFIED),
5617 "READY" => std::option::Option::Some(Self::READY),
5618 "PROPAGATING" => std::option::Option::Some(Self::PROPAGATING),
5619 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => std::option::Option::Some(
5620 Self::ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED,
5621 ),
5622 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => {
5623 std::option::Option::Some(Self::ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED)
5624 }
5625 "ERROR_PRODUCER_QUOTA_EXCEEDED" => {
5626 std::option::Option::Some(Self::ERROR_PRODUCER_QUOTA_EXCEEDED)
5627 }
5628 "ERROR_CONSUMER_QUOTA_EXCEEDED" => {
5629 std::option::Option::Some(Self::ERROR_CONSUMER_QUOTA_EXCEEDED)
5630 }
5631 _ => std::option::Option::None,
5632 }
5633 }
5634 }
5635
5636 impl std::convert::From<i32> for Code {
5637 fn from(value: i32) -> Self {
5638 Self::new(value)
5639 }
5640 }
5641
5642 impl std::default::Default for Code {
5643 fn default() -> Self {
5644 Self::new(0)
5645 }
5646 }
5647}
5648
5649#[serde_with::serde_as]
5654#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5655#[serde(default, rename_all = "camelCase")]
5656#[non_exhaustive]
5657pub struct ListSpokesRequest {
5658 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5660 pub parent: std::string::String,
5661
5662 pub page_size: i32,
5664
5665 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5667 pub page_token: std::string::String,
5668
5669 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5671 pub filter: std::string::String,
5672
5673 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5675 pub order_by: std::string::String,
5676
5677 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5678 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5679}
5680
5681impl ListSpokesRequest {
5682 pub fn new() -> Self {
5683 std::default::Default::default()
5684 }
5685
5686 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688 self.parent = v.into();
5689 self
5690 }
5691
5692 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5694 self.page_size = v.into();
5695 self
5696 }
5697
5698 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5700 self.page_token = v.into();
5701 self
5702 }
5703
5704 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5706 self.filter = v.into();
5707 self
5708 }
5709
5710 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5712 self.order_by = v.into();
5713 self
5714 }
5715}
5716
5717impl wkt::message::Message for ListSpokesRequest {
5718 fn typename() -> &'static str {
5719 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
5720 }
5721}
5722
5723#[serde_with::serde_as]
5728#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5729#[serde(default, rename_all = "camelCase")]
5730#[non_exhaustive]
5731pub struct ListSpokesResponse {
5732 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5734 pub spokes: std::vec::Vec<crate::model::Spoke>,
5735
5736 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5740 pub next_page_token: std::string::String,
5741
5742 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5744 pub unreachable: std::vec::Vec<std::string::String>,
5745
5746 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5747 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5748}
5749
5750impl ListSpokesResponse {
5751 pub fn new() -> Self {
5752 std::default::Default::default()
5753 }
5754
5755 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5757 self.next_page_token = v.into();
5758 self
5759 }
5760
5761 pub fn set_spokes<T, V>(mut self, v: T) -> Self
5763 where
5764 T: std::iter::IntoIterator<Item = V>,
5765 V: std::convert::Into<crate::model::Spoke>,
5766 {
5767 use std::iter::Iterator;
5768 self.spokes = v.into_iter().map(|i| i.into()).collect();
5769 self
5770 }
5771
5772 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5774 where
5775 T: std::iter::IntoIterator<Item = V>,
5776 V: std::convert::Into<std::string::String>,
5777 {
5778 use std::iter::Iterator;
5779 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5780 self
5781 }
5782}
5783
5784impl wkt::message::Message for ListSpokesResponse {
5785 fn typename() -> &'static str {
5786 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
5787 }
5788}
5789
5790#[doc(hidden)]
5791impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
5792 type PageItem = crate::model::Spoke;
5793
5794 fn items(self) -> std::vec::Vec<Self::PageItem> {
5795 self.spokes
5796 }
5797
5798 fn next_page_token(&self) -> std::string::String {
5799 use std::clone::Clone;
5800 self.next_page_token.clone()
5801 }
5802}
5803
5804#[serde_with::serde_as]
5809#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5810#[serde(default, rename_all = "camelCase")]
5811#[non_exhaustive]
5812pub struct GetSpokeRequest {
5813 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5815 pub name: std::string::String,
5816
5817 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5818 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5819}
5820
5821impl GetSpokeRequest {
5822 pub fn new() -> Self {
5823 std::default::Default::default()
5824 }
5825
5826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.name = v.into();
5829 self
5830 }
5831}
5832
5833impl wkt::message::Message for GetSpokeRequest {
5834 fn typename() -> &'static str {
5835 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
5836 }
5837}
5838
5839#[serde_with::serde_as]
5844#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5845#[serde(default, rename_all = "camelCase")]
5846#[non_exhaustive]
5847pub struct CreateSpokeRequest {
5848 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5850 pub parent: std::string::String,
5851
5852 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5854 pub spoke_id: std::string::String,
5855
5856 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5858 pub spoke: std::option::Option<crate::model::Spoke>,
5859
5860 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5875 pub request_id: std::string::String,
5876
5877 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5878 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5879}
5880
5881impl CreateSpokeRequest {
5882 pub fn new() -> Self {
5883 std::default::Default::default()
5884 }
5885
5886 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5888 self.parent = v.into();
5889 self
5890 }
5891
5892 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894 self.spoke_id = v.into();
5895 self
5896 }
5897
5898 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
5900 mut self,
5901 v: T,
5902 ) -> Self {
5903 self.spoke = v.into();
5904 self
5905 }
5906
5907 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5909 self.request_id = v.into();
5910 self
5911 }
5912}
5913
5914impl wkt::message::Message for CreateSpokeRequest {
5915 fn typename() -> &'static str {
5916 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
5917 }
5918}
5919
5920#[serde_with::serde_as]
5926#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5927#[serde(default, rename_all = "camelCase")]
5928#[non_exhaustive]
5929pub struct UpdateSpokeRequest {
5930 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5936 pub update_mask: std::option::Option<wkt::FieldMask>,
5937
5938 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5940 pub spoke: std::option::Option<crate::model::Spoke>,
5941
5942 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5957 pub request_id: std::string::String,
5958
5959 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5960 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5961}
5962
5963impl UpdateSpokeRequest {
5964 pub fn new() -> Self {
5965 std::default::Default::default()
5966 }
5967
5968 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5970 mut self,
5971 v: T,
5972 ) -> Self {
5973 self.update_mask = v.into();
5974 self
5975 }
5976
5977 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
5979 mut self,
5980 v: T,
5981 ) -> Self {
5982 self.spoke = v.into();
5983 self
5984 }
5985
5986 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5988 self.request_id = v.into();
5989 self
5990 }
5991}
5992
5993impl wkt::message::Message for UpdateSpokeRequest {
5994 fn typename() -> &'static str {
5995 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
5996 }
5997}
5998
5999#[serde_with::serde_as]
6004#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6005#[serde(default, rename_all = "camelCase")]
6006#[non_exhaustive]
6007pub struct DeleteSpokeRequest {
6008 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6010 pub name: std::string::String,
6011
6012 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6027 pub request_id: std::string::String,
6028
6029 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6030 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6031}
6032
6033impl DeleteSpokeRequest {
6034 pub fn new() -> Self {
6035 std::default::Default::default()
6036 }
6037
6038 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.name = v.into();
6041 self
6042 }
6043
6044 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.request_id = v.into();
6047 self
6048 }
6049}
6050
6051impl wkt::message::Message for DeleteSpokeRequest {
6052 fn typename() -> &'static str {
6053 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
6054 }
6055}
6056
6057#[serde_with::serde_as]
6062#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6063#[serde(default, rename_all = "camelCase")]
6064#[non_exhaustive]
6065pub struct AcceptHubSpokeRequest {
6066 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6068 pub name: std::string::String,
6069
6070 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6072 pub spoke_uri: std::string::String,
6073
6074 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6089 pub request_id: std::string::String,
6090
6091 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6092 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6093}
6094
6095impl AcceptHubSpokeRequest {
6096 pub fn new() -> Self {
6097 std::default::Default::default()
6098 }
6099
6100 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6102 self.name = v.into();
6103 self
6104 }
6105
6106 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6108 self.spoke_uri = v.into();
6109 self
6110 }
6111
6112 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6114 self.request_id = v.into();
6115 self
6116 }
6117}
6118
6119impl wkt::message::Message for AcceptHubSpokeRequest {
6120 fn typename() -> &'static str {
6121 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
6122 }
6123}
6124
6125#[serde_with::serde_as]
6130#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6131#[serde(default, rename_all = "camelCase")]
6132#[non_exhaustive]
6133pub struct AcceptHubSpokeResponse {
6134 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6136 pub spoke: std::option::Option<crate::model::Spoke>,
6137
6138 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6139 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6140}
6141
6142impl AcceptHubSpokeResponse {
6143 pub fn new() -> Self {
6144 std::default::Default::default()
6145 }
6146
6147 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6149 mut self,
6150 v: T,
6151 ) -> Self {
6152 self.spoke = v.into();
6153 self
6154 }
6155}
6156
6157impl wkt::message::Message for AcceptHubSpokeResponse {
6158 fn typename() -> &'static str {
6159 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
6160 }
6161}
6162
6163#[serde_with::serde_as]
6168#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6169#[serde(default, rename_all = "camelCase")]
6170#[non_exhaustive]
6171pub struct RejectHubSpokeRequest {
6172 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6174 pub name: std::string::String,
6175
6176 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6178 pub spoke_uri: std::string::String,
6179
6180 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6195 pub request_id: std::string::String,
6196
6197 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6199 pub details: std::string::String,
6200
6201 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6202 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6203}
6204
6205impl RejectHubSpokeRequest {
6206 pub fn new() -> Self {
6207 std::default::Default::default()
6208 }
6209
6210 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212 self.name = v.into();
6213 self
6214 }
6215
6216 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6218 self.spoke_uri = v.into();
6219 self
6220 }
6221
6222 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224 self.request_id = v.into();
6225 self
6226 }
6227
6228 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6230 self.details = v.into();
6231 self
6232 }
6233}
6234
6235impl wkt::message::Message for RejectHubSpokeRequest {
6236 fn typename() -> &'static str {
6237 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
6238 }
6239}
6240
6241#[serde_with::serde_as]
6246#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6247#[serde(default, rename_all = "camelCase")]
6248#[non_exhaustive]
6249pub struct RejectHubSpokeResponse {
6250 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6252 pub spoke: std::option::Option<crate::model::Spoke>,
6253
6254 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6255 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6256}
6257
6258impl RejectHubSpokeResponse {
6259 pub fn new() -> Self {
6260 std::default::Default::default()
6261 }
6262
6263 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6265 mut self,
6266 v: T,
6267 ) -> Self {
6268 self.spoke = v.into();
6269 self
6270 }
6271}
6272
6273impl wkt::message::Message for RejectHubSpokeResponse {
6274 fn typename() -> &'static str {
6275 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
6276 }
6277}
6278
6279#[serde_with::serde_as]
6284#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6285#[serde(default, rename_all = "camelCase")]
6286#[non_exhaustive]
6287pub struct AcceptSpokeUpdateRequest {
6288 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6290 pub name: std::string::String,
6291
6292 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6294 pub spoke_uri: std::string::String,
6295
6296 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6298 pub spoke_etag: std::string::String,
6299
6300 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6315 pub request_id: std::string::String,
6316
6317 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6318 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6319}
6320
6321impl AcceptSpokeUpdateRequest {
6322 pub fn new() -> Self {
6323 std::default::Default::default()
6324 }
6325
6326 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6328 self.name = v.into();
6329 self
6330 }
6331
6332 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6334 self.spoke_uri = v.into();
6335 self
6336 }
6337
6338 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6340 self.spoke_etag = v.into();
6341 self
6342 }
6343
6344 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6346 self.request_id = v.into();
6347 self
6348 }
6349}
6350
6351impl wkt::message::Message for AcceptSpokeUpdateRequest {
6352 fn typename() -> &'static str {
6353 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
6354 }
6355}
6356
6357#[serde_with::serde_as]
6362#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6363#[serde(default, rename_all = "camelCase")]
6364#[non_exhaustive]
6365pub struct AcceptSpokeUpdateResponse {
6366 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6368 pub spoke: std::option::Option<crate::model::Spoke>,
6369
6370 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6371 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6372}
6373
6374impl AcceptSpokeUpdateResponse {
6375 pub fn new() -> Self {
6376 std::default::Default::default()
6377 }
6378
6379 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6381 mut self,
6382 v: T,
6383 ) -> Self {
6384 self.spoke = v.into();
6385 self
6386 }
6387}
6388
6389impl wkt::message::Message for AcceptSpokeUpdateResponse {
6390 fn typename() -> &'static str {
6391 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
6392 }
6393}
6394
6395#[serde_with::serde_as]
6400#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6401#[serde(default, rename_all = "camelCase")]
6402#[non_exhaustive]
6403pub struct RejectSpokeUpdateRequest {
6404 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6406 pub name: std::string::String,
6407
6408 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6410 pub spoke_uri: std::string::String,
6411
6412 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6414 pub spoke_etag: std::string::String,
6415
6416 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6418 pub details: std::string::String,
6419
6420 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6435 pub request_id: std::string::String,
6436
6437 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6438 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6439}
6440
6441impl RejectSpokeUpdateRequest {
6442 pub fn new() -> Self {
6443 std::default::Default::default()
6444 }
6445
6446 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6448 self.name = v.into();
6449 self
6450 }
6451
6452 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6454 self.spoke_uri = v.into();
6455 self
6456 }
6457
6458 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6460 self.spoke_etag = v.into();
6461 self
6462 }
6463
6464 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6466 self.details = v.into();
6467 self
6468 }
6469
6470 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6472 self.request_id = v.into();
6473 self
6474 }
6475}
6476
6477impl wkt::message::Message for RejectSpokeUpdateRequest {
6478 fn typename() -> &'static str {
6479 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
6480 }
6481}
6482
6483#[serde_with::serde_as]
6488#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6489#[serde(default, rename_all = "camelCase")]
6490#[non_exhaustive]
6491pub struct RejectSpokeUpdateResponse {
6492 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6494 pub spoke: std::option::Option<crate::model::Spoke>,
6495
6496 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6497 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6498}
6499
6500impl RejectSpokeUpdateResponse {
6501 pub fn new() -> Self {
6502 std::default::Default::default()
6503 }
6504
6505 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6507 mut self,
6508 v: T,
6509 ) -> Self {
6510 self.spoke = v.into();
6511 self
6512 }
6513}
6514
6515impl wkt::message::Message for RejectSpokeUpdateResponse {
6516 fn typename() -> &'static str {
6517 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
6518 }
6519}
6520
6521#[serde_with::serde_as]
6526#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6527#[serde(default, rename_all = "camelCase")]
6528#[non_exhaustive]
6529pub struct GetRouteTableRequest {
6530 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6532 pub name: std::string::String,
6533
6534 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6535 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6536}
6537
6538impl GetRouteTableRequest {
6539 pub fn new() -> Self {
6540 std::default::Default::default()
6541 }
6542
6543 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545 self.name = v.into();
6546 self
6547 }
6548}
6549
6550impl wkt::message::Message for GetRouteTableRequest {
6551 fn typename() -> &'static str {
6552 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
6553 }
6554}
6555
6556#[serde_with::serde_as]
6561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6562#[serde(default, rename_all = "camelCase")]
6563#[non_exhaustive]
6564pub struct GetRouteRequest {
6565 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6567 pub name: std::string::String,
6568
6569 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6570 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6571}
6572
6573impl GetRouteRequest {
6574 pub fn new() -> Self {
6575 std::default::Default::default()
6576 }
6577
6578 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6580 self.name = v.into();
6581 self
6582 }
6583}
6584
6585impl wkt::message::Message for GetRouteRequest {
6586 fn typename() -> &'static str {
6587 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
6588 }
6589}
6590
6591#[serde_with::serde_as]
6597#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6598#[serde(default, rename_all = "camelCase")]
6599#[non_exhaustive]
6600pub struct ListRoutesRequest {
6601 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6603 pub parent: std::string::String,
6604
6605 pub page_size: i32,
6607
6608 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6610 pub page_token: std::string::String,
6611
6612 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6614 pub filter: std::string::String,
6615
6616 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6618 pub order_by: std::string::String,
6619
6620 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6621 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6622}
6623
6624impl ListRoutesRequest {
6625 pub fn new() -> Self {
6626 std::default::Default::default()
6627 }
6628
6629 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6631 self.parent = v.into();
6632 self
6633 }
6634
6635 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6637 self.page_size = v.into();
6638 self
6639 }
6640
6641 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643 self.page_token = v.into();
6644 self
6645 }
6646
6647 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6649 self.filter = v.into();
6650 self
6651 }
6652
6653 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6655 self.order_by = v.into();
6656 self
6657 }
6658}
6659
6660impl wkt::message::Message for ListRoutesRequest {
6661 fn typename() -> &'static str {
6662 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
6663 }
6664}
6665
6666#[serde_with::serde_as]
6672#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6673#[serde(default, rename_all = "camelCase")]
6674#[non_exhaustive]
6675pub struct ListRoutesResponse {
6676 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6678 pub routes: std::vec::Vec<crate::model::Route>,
6679
6680 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6684 pub next_page_token: std::string::String,
6685
6686 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6688 pub unreachable: std::vec::Vec<std::string::String>,
6689
6690 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6691 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6692}
6693
6694impl ListRoutesResponse {
6695 pub fn new() -> Self {
6696 std::default::Default::default()
6697 }
6698
6699 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6701 self.next_page_token = v.into();
6702 self
6703 }
6704
6705 pub fn set_routes<T, V>(mut self, v: T) -> Self
6707 where
6708 T: std::iter::IntoIterator<Item = V>,
6709 V: std::convert::Into<crate::model::Route>,
6710 {
6711 use std::iter::Iterator;
6712 self.routes = v.into_iter().map(|i| i.into()).collect();
6713 self
6714 }
6715
6716 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6718 where
6719 T: std::iter::IntoIterator<Item = V>,
6720 V: std::convert::Into<std::string::String>,
6721 {
6722 use std::iter::Iterator;
6723 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6724 self
6725 }
6726}
6727
6728impl wkt::message::Message for ListRoutesResponse {
6729 fn typename() -> &'static str {
6730 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
6731 }
6732}
6733
6734#[doc(hidden)]
6735impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
6736 type PageItem = crate::model::Route;
6737
6738 fn items(self) -> std::vec::Vec<Self::PageItem> {
6739 self.routes
6740 }
6741
6742 fn next_page_token(&self) -> std::string::String {
6743 use std::clone::Clone;
6744 self.next_page_token.clone()
6745 }
6746}
6747
6748#[serde_with::serde_as]
6754#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6755#[serde(default, rename_all = "camelCase")]
6756#[non_exhaustive]
6757pub struct ListRouteTablesRequest {
6758 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6760 pub parent: std::string::String,
6761
6762 pub page_size: i32,
6764
6765 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6767 pub page_token: std::string::String,
6768
6769 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6771 pub filter: std::string::String,
6772
6773 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6775 pub order_by: std::string::String,
6776
6777 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6778 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6779}
6780
6781impl ListRouteTablesRequest {
6782 pub fn new() -> Self {
6783 std::default::Default::default()
6784 }
6785
6786 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6788 self.parent = v.into();
6789 self
6790 }
6791
6792 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6794 self.page_size = v.into();
6795 self
6796 }
6797
6798 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6800 self.page_token = v.into();
6801 self
6802 }
6803
6804 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806 self.filter = v.into();
6807 self
6808 }
6809
6810 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6812 self.order_by = v.into();
6813 self
6814 }
6815}
6816
6817impl wkt::message::Message for ListRouteTablesRequest {
6818 fn typename() -> &'static str {
6819 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
6820 }
6821}
6822
6823#[serde_with::serde_as]
6829#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6830#[serde(default, rename_all = "camelCase")]
6831#[non_exhaustive]
6832pub struct ListRouteTablesResponse {
6833 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6835 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
6836
6837 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6841 pub next_page_token: std::string::String,
6842
6843 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6845 pub unreachable: std::vec::Vec<std::string::String>,
6846
6847 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6848 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6849}
6850
6851impl ListRouteTablesResponse {
6852 pub fn new() -> Self {
6853 std::default::Default::default()
6854 }
6855
6856 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6858 self.next_page_token = v.into();
6859 self
6860 }
6861
6862 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
6864 where
6865 T: std::iter::IntoIterator<Item = V>,
6866 V: std::convert::Into<crate::model::RouteTable>,
6867 {
6868 use std::iter::Iterator;
6869 self.route_tables = v.into_iter().map(|i| i.into()).collect();
6870 self
6871 }
6872
6873 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6875 where
6876 T: std::iter::IntoIterator<Item = V>,
6877 V: std::convert::Into<std::string::String>,
6878 {
6879 use std::iter::Iterator;
6880 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6881 self
6882 }
6883}
6884
6885impl wkt::message::Message for ListRouteTablesResponse {
6886 fn typename() -> &'static str {
6887 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
6888 }
6889}
6890
6891#[doc(hidden)]
6892impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
6893 type PageItem = crate::model::RouteTable;
6894
6895 fn items(self) -> std::vec::Vec<Self::PageItem> {
6896 self.route_tables
6897 }
6898
6899 fn next_page_token(&self) -> std::string::String {
6900 use std::clone::Clone;
6901 self.next_page_token.clone()
6902 }
6903}
6904
6905#[serde_with::serde_as]
6911#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6912#[serde(default, rename_all = "camelCase")]
6913#[non_exhaustive]
6914pub struct ListGroupsRequest {
6915 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6917 pub parent: std::string::String,
6918
6919 pub page_size: i32,
6921
6922 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6924 pub page_token: std::string::String,
6925
6926 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6928 pub filter: std::string::String,
6929
6930 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6932 pub order_by: std::string::String,
6933
6934 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6935 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6936}
6937
6938impl ListGroupsRequest {
6939 pub fn new() -> Self {
6940 std::default::Default::default()
6941 }
6942
6943 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6945 self.parent = v.into();
6946 self
6947 }
6948
6949 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6951 self.page_size = v.into();
6952 self
6953 }
6954
6955 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6957 self.page_token = v.into();
6958 self
6959 }
6960
6961 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6963 self.filter = v.into();
6964 self
6965 }
6966
6967 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6969 self.order_by = v.into();
6970 self
6971 }
6972}
6973
6974impl wkt::message::Message for ListGroupsRequest {
6975 fn typename() -> &'static str {
6976 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
6977 }
6978}
6979
6980#[serde_with::serde_as]
6986#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6987#[serde(default, rename_all = "camelCase")]
6988#[non_exhaustive]
6989pub struct ListGroupsResponse {
6990 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6992 pub groups: std::vec::Vec<crate::model::Group>,
6993
6994 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6998 pub next_page_token: std::string::String,
6999
7000 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7002 pub unreachable: std::vec::Vec<std::string::String>,
7003
7004 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7005 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7006}
7007
7008impl ListGroupsResponse {
7009 pub fn new() -> Self {
7010 std::default::Default::default()
7011 }
7012
7013 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7015 self.next_page_token = v.into();
7016 self
7017 }
7018
7019 pub fn set_groups<T, V>(mut self, v: T) -> Self
7021 where
7022 T: std::iter::IntoIterator<Item = V>,
7023 V: std::convert::Into<crate::model::Group>,
7024 {
7025 use std::iter::Iterator;
7026 self.groups = v.into_iter().map(|i| i.into()).collect();
7027 self
7028 }
7029
7030 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7032 where
7033 T: std::iter::IntoIterator<Item = V>,
7034 V: std::convert::Into<std::string::String>,
7035 {
7036 use std::iter::Iterator;
7037 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7038 self
7039 }
7040}
7041
7042impl wkt::message::Message for ListGroupsResponse {
7043 fn typename() -> &'static str {
7044 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
7045 }
7046}
7047
7048#[doc(hidden)]
7049impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
7050 type PageItem = crate::model::Group;
7051
7052 fn items(self) -> std::vec::Vec<Self::PageItem> {
7053 self.groups
7054 }
7055
7056 fn next_page_token(&self) -> std::string::String {
7057 use std::clone::Clone;
7058 self.next_page_token.clone()
7059 }
7060}
7061
7062#[serde_with::serde_as]
7067#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7068#[serde(default, rename_all = "camelCase")]
7069#[non_exhaustive]
7070pub struct LinkedVpnTunnels {
7071 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7073 pub uris: std::vec::Vec<std::string::String>,
7074
7075 pub site_to_site_data_transfer: bool,
7079
7080 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7082 pub vpc_network: std::string::String,
7083
7084 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7088 pub include_import_ranges: std::vec::Vec<std::string::String>,
7089
7090 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7091 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7092}
7093
7094impl LinkedVpnTunnels {
7095 pub fn new() -> Self {
7096 std::default::Default::default()
7097 }
7098
7099 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7101 self.site_to_site_data_transfer = v.into();
7102 self
7103 }
7104
7105 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7107 self.vpc_network = v.into();
7108 self
7109 }
7110
7111 pub fn set_uris<T, V>(mut self, v: T) -> Self
7113 where
7114 T: std::iter::IntoIterator<Item = V>,
7115 V: std::convert::Into<std::string::String>,
7116 {
7117 use std::iter::Iterator;
7118 self.uris = v.into_iter().map(|i| i.into()).collect();
7119 self
7120 }
7121
7122 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7124 where
7125 T: std::iter::IntoIterator<Item = V>,
7126 V: std::convert::Into<std::string::String>,
7127 {
7128 use std::iter::Iterator;
7129 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7130 self
7131 }
7132}
7133
7134impl wkt::message::Message for LinkedVpnTunnels {
7135 fn typename() -> &'static str {
7136 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
7137 }
7138}
7139
7140#[serde_with::serde_as]
7145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7146#[serde(default, rename_all = "camelCase")]
7147#[non_exhaustive]
7148pub struct LinkedInterconnectAttachments {
7149 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7151 pub uris: std::vec::Vec<std::string::String>,
7152
7153 pub site_to_site_data_transfer: bool,
7157
7158 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7160 pub vpc_network: std::string::String,
7161
7162 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7166 pub include_import_ranges: std::vec::Vec<std::string::String>,
7167
7168 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7169 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7170}
7171
7172impl LinkedInterconnectAttachments {
7173 pub fn new() -> Self {
7174 std::default::Default::default()
7175 }
7176
7177 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7179 self.site_to_site_data_transfer = v.into();
7180 self
7181 }
7182
7183 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7185 self.vpc_network = v.into();
7186 self
7187 }
7188
7189 pub fn set_uris<T, V>(mut self, v: T) -> Self
7191 where
7192 T: std::iter::IntoIterator<Item = V>,
7193 V: std::convert::Into<std::string::String>,
7194 {
7195 use std::iter::Iterator;
7196 self.uris = v.into_iter().map(|i| i.into()).collect();
7197 self
7198 }
7199
7200 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7202 where
7203 T: std::iter::IntoIterator<Item = V>,
7204 V: std::convert::Into<std::string::String>,
7205 {
7206 use std::iter::Iterator;
7207 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7208 self
7209 }
7210}
7211
7212impl wkt::message::Message for LinkedInterconnectAttachments {
7213 fn typename() -> &'static str {
7214 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
7215 }
7216}
7217
7218#[serde_with::serde_as]
7223#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7224#[serde(default, rename_all = "camelCase")]
7225#[non_exhaustive]
7226pub struct LinkedRouterApplianceInstances {
7227 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7229 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
7230
7231 pub site_to_site_data_transfer: bool,
7235
7236 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7239 pub vpc_network: std::string::String,
7240
7241 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7245 pub include_import_ranges: std::vec::Vec<std::string::String>,
7246
7247 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7248 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7249}
7250
7251impl LinkedRouterApplianceInstances {
7252 pub fn new() -> Self {
7253 std::default::Default::default()
7254 }
7255
7256 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7258 self.site_to_site_data_transfer = v.into();
7259 self
7260 }
7261
7262 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7264 self.vpc_network = v.into();
7265 self
7266 }
7267
7268 pub fn set_instances<T, V>(mut self, v: T) -> Self
7270 where
7271 T: std::iter::IntoIterator<Item = V>,
7272 V: std::convert::Into<crate::model::RouterApplianceInstance>,
7273 {
7274 use std::iter::Iterator;
7275 self.instances = v.into_iter().map(|i| i.into()).collect();
7276 self
7277 }
7278
7279 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7281 where
7282 T: std::iter::IntoIterator<Item = V>,
7283 V: std::convert::Into<std::string::String>,
7284 {
7285 use std::iter::Iterator;
7286 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7287 self
7288 }
7289}
7290
7291impl wkt::message::Message for LinkedRouterApplianceInstances {
7292 fn typename() -> &'static str {
7293 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
7294 }
7295}
7296
7297#[serde_with::serde_as]
7299#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7300#[serde(default, rename_all = "camelCase")]
7301#[non_exhaustive]
7302pub struct LinkedVpcNetwork {
7303 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7305 pub uri: std::string::String,
7306
7307 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7309 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7310
7311 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7313 pub include_export_ranges: std::vec::Vec<std::string::String>,
7314
7315 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7318 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7319
7320 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7323 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7324
7325 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7333 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
7334
7335 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7336 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7337}
7338
7339impl LinkedVpcNetwork {
7340 pub fn new() -> Self {
7341 std::default::Default::default()
7342 }
7343
7344 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7346 self.uri = v.into();
7347 self
7348 }
7349
7350 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7352 where
7353 T: std::iter::IntoIterator<Item = V>,
7354 V: std::convert::Into<std::string::String>,
7355 {
7356 use std::iter::Iterator;
7357 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7358 self
7359 }
7360
7361 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7363 where
7364 T: std::iter::IntoIterator<Item = V>,
7365 V: std::convert::Into<std::string::String>,
7366 {
7367 use std::iter::Iterator;
7368 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7369 self
7370 }
7371
7372 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7374 where
7375 T: std::iter::IntoIterator<Item = V>,
7376 V: std::convert::Into<std::string::String>,
7377 {
7378 use std::iter::Iterator;
7379 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7380 self
7381 }
7382
7383 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7385 where
7386 T: std::iter::IntoIterator<Item = V>,
7387 V: std::convert::Into<std::string::String>,
7388 {
7389 use std::iter::Iterator;
7390 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7391 self
7392 }
7393
7394 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
7396 where
7397 T: std::iter::IntoIterator<Item = V>,
7398 V: std::convert::Into<std::string::String>,
7399 {
7400 use std::iter::Iterator;
7401 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
7402 self
7403 }
7404}
7405
7406impl wkt::message::Message for LinkedVpcNetwork {
7407 fn typename() -> &'static str {
7408 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
7409 }
7410}
7411
7412#[serde_with::serde_as]
7413#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7414#[serde(default, rename_all = "camelCase")]
7415#[non_exhaustive]
7416pub struct LinkedProducerVpcNetwork {
7417 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7420 pub network: std::string::String,
7421
7422 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7424 pub service_consumer_vpc_spoke: std::string::String,
7425
7426 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7430 pub peering: std::string::String,
7431
7432 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7434 pub producer_network: std::string::String,
7435
7436 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7438 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7439
7440 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7442 pub include_export_ranges: std::vec::Vec<std::string::String>,
7443
7444 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7447 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7448
7449 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7452 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7453
7454 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7455 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7456}
7457
7458impl LinkedProducerVpcNetwork {
7459 pub fn new() -> Self {
7460 std::default::Default::default()
7461 }
7462
7463 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7465 self.network = v.into();
7466 self
7467 }
7468
7469 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
7471 mut self,
7472 v: T,
7473 ) -> Self {
7474 self.service_consumer_vpc_spoke = v.into();
7475 self
7476 }
7477
7478 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7480 self.peering = v.into();
7481 self
7482 }
7483
7484 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
7486 mut self,
7487 v: T,
7488 ) -> Self {
7489 self.producer_network = v.into();
7490 self
7491 }
7492
7493 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7495 where
7496 T: std::iter::IntoIterator<Item = V>,
7497 V: std::convert::Into<std::string::String>,
7498 {
7499 use std::iter::Iterator;
7500 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7501 self
7502 }
7503
7504 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7506 where
7507 T: std::iter::IntoIterator<Item = V>,
7508 V: std::convert::Into<std::string::String>,
7509 {
7510 use std::iter::Iterator;
7511 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7512 self
7513 }
7514
7515 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7517 where
7518 T: std::iter::IntoIterator<Item = V>,
7519 V: std::convert::Into<std::string::String>,
7520 {
7521 use std::iter::Iterator;
7522 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7523 self
7524 }
7525
7526 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7528 where
7529 T: std::iter::IntoIterator<Item = V>,
7530 V: std::convert::Into<std::string::String>,
7531 {
7532 use std::iter::Iterator;
7533 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7534 self
7535 }
7536}
7537
7538impl wkt::message::Message for LinkedProducerVpcNetwork {
7539 fn typename() -> &'static str {
7540 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
7541 }
7542}
7543
7544#[serde_with::serde_as]
7549#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7550#[serde(default, rename_all = "camelCase")]
7551#[non_exhaustive]
7552pub struct RouterApplianceInstance {
7553 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7555 pub virtual_machine: std::string::String,
7556
7557 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7559 pub ip_address: std::string::String,
7560
7561 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7562 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7563}
7564
7565impl RouterApplianceInstance {
7566 pub fn new() -> Self {
7567 std::default::Default::default()
7568 }
7569
7570 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7572 self.virtual_machine = v.into();
7573 self
7574 }
7575
7576 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7578 self.ip_address = v.into();
7579 self
7580 }
7581}
7582
7583impl wkt::message::Message for RouterApplianceInstance {
7584 fn typename() -> &'static str {
7585 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
7586 }
7587}
7588
7589#[serde_with::serde_as]
7591#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7592#[serde(default, rename_all = "camelCase")]
7593#[non_exhaustive]
7594pub struct LocationMetadata {
7595 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7597 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
7598
7599 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7600 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7601}
7602
7603impl LocationMetadata {
7604 pub fn new() -> Self {
7605 std::default::Default::default()
7606 }
7607
7608 pub fn set_location_features<T, V>(mut self, v: T) -> Self
7610 where
7611 T: std::iter::IntoIterator<Item = V>,
7612 V: std::convert::Into<crate::model::LocationFeature>,
7613 {
7614 use std::iter::Iterator;
7615 self.location_features = v.into_iter().map(|i| i.into()).collect();
7616 self
7617 }
7618}
7619
7620impl wkt::message::Message for LocationMetadata {
7621 fn typename() -> &'static str {
7622 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
7623 }
7624}
7625
7626#[serde_with::serde_as]
7627#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7628#[serde(default, rename_all = "camelCase")]
7629#[non_exhaustive]
7630pub struct NextHopVpcNetwork {
7631 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7633 pub uri: std::string::String,
7634
7635 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7636 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7637}
7638
7639impl NextHopVpcNetwork {
7640 pub fn new() -> Self {
7641 std::default::Default::default()
7642 }
7643
7644 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7646 self.uri = v.into();
7647 self
7648 }
7649}
7650
7651impl wkt::message::Message for NextHopVpcNetwork {
7652 fn typename() -> &'static str {
7653 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
7654 }
7655}
7656
7657#[serde_with::serde_as]
7659#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7660#[serde(default, rename_all = "camelCase")]
7661#[non_exhaustive]
7662pub struct NextHopVPNTunnel {
7663 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7665 pub uri: std::string::String,
7666
7667 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7669 pub vpc_network: std::string::String,
7670
7671 pub site_to_site_data_transfer: bool,
7675
7676 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7677 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7678}
7679
7680impl NextHopVPNTunnel {
7681 pub fn new() -> Self {
7682 std::default::Default::default()
7683 }
7684
7685 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7687 self.uri = v.into();
7688 self
7689 }
7690
7691 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7693 self.vpc_network = v.into();
7694 self
7695 }
7696
7697 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7699 self.site_to_site_data_transfer = v.into();
7700 self
7701 }
7702}
7703
7704impl wkt::message::Message for NextHopVPNTunnel {
7705 fn typename() -> &'static str {
7706 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
7707 }
7708}
7709
7710#[serde_with::serde_as]
7712#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7713#[serde(default, rename_all = "camelCase")]
7714#[non_exhaustive]
7715pub struct NextHopRouterApplianceInstance {
7716 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7718 pub uri: std::string::String,
7719
7720 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7722 pub vpc_network: std::string::String,
7723
7724 pub site_to_site_data_transfer: bool,
7728
7729 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7730 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7731}
7732
7733impl NextHopRouterApplianceInstance {
7734 pub fn new() -> Self {
7735 std::default::Default::default()
7736 }
7737
7738 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7740 self.uri = v.into();
7741 self
7742 }
7743
7744 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7746 self.vpc_network = v.into();
7747 self
7748 }
7749
7750 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7752 self.site_to_site_data_transfer = v.into();
7753 self
7754 }
7755}
7756
7757impl wkt::message::Message for NextHopRouterApplianceInstance {
7758 fn typename() -> &'static str {
7759 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
7760 }
7761}
7762
7763#[serde_with::serde_as]
7765#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7766#[serde(default, rename_all = "camelCase")]
7767#[non_exhaustive]
7768pub struct NextHopInterconnectAttachment {
7769 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7771 pub uri: std::string::String,
7772
7773 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7775 pub vpc_network: std::string::String,
7776
7777 pub site_to_site_data_transfer: bool,
7782
7783 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7784 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7785}
7786
7787impl NextHopInterconnectAttachment {
7788 pub fn new() -> Self {
7789 std::default::Default::default()
7790 }
7791
7792 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7794 self.uri = v.into();
7795 self
7796 }
7797
7798 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7800 self.vpc_network = v.into();
7801 self
7802 }
7803
7804 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7806 self.site_to_site_data_transfer = v.into();
7807 self
7808 }
7809}
7810
7811impl wkt::message::Message for NextHopInterconnectAttachment {
7812 fn typename() -> &'static str {
7813 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
7814 }
7815}
7816
7817#[serde_with::serde_as]
7823#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7824#[serde(default, rename_all = "camelCase")]
7825#[non_exhaustive]
7826pub struct SpokeSummary {
7827 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7830 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
7831
7832 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7835 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
7836
7837 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7840 pub spoke_state_reason_counts:
7841 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
7842
7843 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7844 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7845}
7846
7847impl SpokeSummary {
7848 pub fn new() -> Self {
7849 std::default::Default::default()
7850 }
7851
7852 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
7854 where
7855 T: std::iter::IntoIterator<Item = V>,
7856 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
7857 {
7858 use std::iter::Iterator;
7859 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
7860 self
7861 }
7862
7863 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
7865 where
7866 T: std::iter::IntoIterator<Item = V>,
7867 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
7868 {
7869 use std::iter::Iterator;
7870 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
7871 self
7872 }
7873
7874 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
7876 where
7877 T: std::iter::IntoIterator<Item = V>,
7878 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
7879 {
7880 use std::iter::Iterator;
7881 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
7882 self
7883 }
7884}
7885
7886impl wkt::message::Message for SpokeSummary {
7887 fn typename() -> &'static str {
7888 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
7889 }
7890}
7891
7892pub mod spoke_summary {
7894 #[allow(unused_imports)]
7895 use super::*;
7896
7897 #[serde_with::serde_as]
7901 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7902 #[serde(default, rename_all = "camelCase")]
7903 #[non_exhaustive]
7904 pub struct SpokeTypeCount {
7905 pub spoke_type: crate::model::SpokeType,
7907
7908 #[serde_as(as = "serde_with::DisplayFromStr")]
7911 pub count: i64,
7912
7913 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7914 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7915 }
7916
7917 impl SpokeTypeCount {
7918 pub fn new() -> Self {
7919 std::default::Default::default()
7920 }
7921
7922 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
7924 mut self,
7925 v: T,
7926 ) -> Self {
7927 self.spoke_type = v.into();
7928 self
7929 }
7930
7931 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7933 self.count = v.into();
7934 self
7935 }
7936 }
7937
7938 impl wkt::message::Message for SpokeTypeCount {
7939 fn typename() -> &'static str {
7940 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
7941 }
7942 }
7943
7944 #[serde_with::serde_as]
7947 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7948 #[serde(default, rename_all = "camelCase")]
7949 #[non_exhaustive]
7950 pub struct SpokeStateCount {
7951 pub state: crate::model::State,
7953
7954 #[serde_as(as = "serde_with::DisplayFromStr")]
7957 pub count: i64,
7958
7959 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7960 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7961 }
7962
7963 impl SpokeStateCount {
7964 pub fn new() -> Self {
7965 std::default::Default::default()
7966 }
7967
7968 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
7970 self.state = v.into();
7971 self
7972 }
7973
7974 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7976 self.count = v.into();
7977 self
7978 }
7979 }
7980
7981 impl wkt::message::Message for SpokeStateCount {
7982 fn typename() -> &'static str {
7983 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
7984 }
7985 }
7986
7987 #[serde_with::serde_as]
7989 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7990 #[serde(default, rename_all = "camelCase")]
7991 #[non_exhaustive]
7992 pub struct SpokeStateReasonCount {
7993 pub state_reason_code: crate::model::spoke::state_reason::Code,
7995
7996 #[serde_as(as = "serde_with::DisplayFromStr")]
7999 pub count: i64,
8000
8001 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8002 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8003 }
8004
8005 impl SpokeStateReasonCount {
8006 pub fn new() -> Self {
8007 std::default::Default::default()
8008 }
8009
8010 pub fn set_state_reason_code<
8012 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
8013 >(
8014 mut self,
8015 v: T,
8016 ) -> Self {
8017 self.state_reason_code = v.into();
8018 self
8019 }
8020
8021 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8023 self.count = v.into();
8024 self
8025 }
8026 }
8027
8028 impl wkt::message::Message for SpokeStateReasonCount {
8029 fn typename() -> &'static str {
8030 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
8031 }
8032 }
8033}
8034
8035#[serde_with::serde_as]
8040#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8041#[serde(default, rename_all = "camelCase")]
8042#[non_exhaustive]
8043pub struct GetGroupRequest {
8044 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8046 pub name: std::string::String,
8047
8048 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8049 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8050}
8051
8052impl GetGroupRequest {
8053 pub fn new() -> Self {
8054 std::default::Default::default()
8055 }
8056
8057 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8059 self.name = v.into();
8060 self
8061 }
8062}
8063
8064impl wkt::message::Message for GetGroupRequest {
8065 fn typename() -> &'static str {
8066 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
8067 }
8068}
8069
8070#[serde_with::serde_as]
8076#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8077#[serde(default, rename_all = "camelCase")]
8078#[non_exhaustive]
8079pub struct UpdateGroupRequest {
8080 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8086 pub update_mask: std::option::Option<wkt::FieldMask>,
8087
8088 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8090 pub group: std::option::Option<crate::model::Group>,
8091
8092 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8107 pub request_id: std::string::String,
8108
8109 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8110 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8111}
8112
8113impl UpdateGroupRequest {
8114 pub fn new() -> Self {
8115 std::default::Default::default()
8116 }
8117
8118 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
8120 mut self,
8121 v: T,
8122 ) -> Self {
8123 self.update_mask = v.into();
8124 self
8125 }
8126
8127 pub fn set_group<T: std::convert::Into<std::option::Option<crate::model::Group>>>(
8129 mut self,
8130 v: T,
8131 ) -> Self {
8132 self.group = v.into();
8133 self
8134 }
8135
8136 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8138 self.request_id = v.into();
8139 self
8140 }
8141}
8142
8143impl wkt::message::Message for UpdateGroupRequest {
8144 fn typename() -> &'static str {
8145 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
8146 }
8147}
8148
8149#[serde_with::serde_as]
8154#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8155#[serde(default, rename_all = "camelCase")]
8156#[non_exhaustive]
8157pub struct PolicyBasedRoute {
8158 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8161 pub name: std::string::String,
8162
8163 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8165 pub create_time: std::option::Option<wkt::Timestamp>,
8166
8167 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8169 pub update_time: std::option::Option<wkt::Timestamp>,
8170
8171 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8173 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8174
8175 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8178 pub description: std::string::String,
8179
8180 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8183 pub network: std::string::String,
8184
8185 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8187 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
8188
8189 pub priority: i32,
8195
8196 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8199 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
8200
8201 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8203 pub self_link: std::string::String,
8204
8205 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8208 pub kind: std::string::String,
8209
8210 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8214 pub target: std::option::Option<crate::model::policy_based_route::Target>,
8215
8216 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8217 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
8218
8219 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8220 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8221}
8222
8223impl PolicyBasedRoute {
8224 pub fn new() -> Self {
8225 std::default::Default::default()
8226 }
8227
8228 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8230 self.name = v.into();
8231 self
8232 }
8233
8234 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8236 mut self,
8237 v: T,
8238 ) -> Self {
8239 self.create_time = v.into();
8240 self
8241 }
8242
8243 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8245 mut self,
8246 v: T,
8247 ) -> Self {
8248 self.update_time = v.into();
8249 self
8250 }
8251
8252 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8254 self.description = v.into();
8255 self
8256 }
8257
8258 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8260 self.network = v.into();
8261 self
8262 }
8263
8264 pub fn set_filter<
8266 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Filter>>,
8267 >(
8268 mut self,
8269 v: T,
8270 ) -> Self {
8271 self.filter = v.into();
8272 self
8273 }
8274
8275 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8277 self.priority = v.into();
8278 self
8279 }
8280
8281 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8283 self.self_link = v.into();
8284 self
8285 }
8286
8287 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8289 self.kind = v.into();
8290 self
8291 }
8292
8293 pub fn set_warnings<T, V>(mut self, v: T) -> Self
8295 where
8296 T: std::iter::IntoIterator<Item = V>,
8297 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
8298 {
8299 use std::iter::Iterator;
8300 self.warnings = v.into_iter().map(|i| i.into()).collect();
8301 self
8302 }
8303
8304 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8306 where
8307 T: std::iter::IntoIterator<Item = (K, V)>,
8308 K: std::convert::Into<std::string::String>,
8309 V: std::convert::Into<std::string::String>,
8310 {
8311 use std::iter::Iterator;
8312 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8313 self
8314 }
8315
8316 pub fn set_target<
8321 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
8322 >(
8323 mut self,
8324 v: T,
8325 ) -> Self {
8326 self.target = v.into();
8327 self
8328 }
8329
8330 pub fn virtual_machine(
8334 &self,
8335 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
8336 {
8337 #[allow(unreachable_patterns)]
8338 self.target.as_ref().and_then(|v| match v {
8339 crate::model::policy_based_route::Target::VirtualMachine(v) => {
8340 std::option::Option::Some(v)
8341 }
8342 _ => std::option::Option::None,
8343 })
8344 }
8345
8346 pub fn interconnect_attachment(
8350 &self,
8351 ) -> std::option::Option<
8352 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8353 > {
8354 #[allow(unreachable_patterns)]
8355 self.target.as_ref().and_then(|v| match v {
8356 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
8357 std::option::Option::Some(v)
8358 }
8359 _ => std::option::Option::None,
8360 })
8361 }
8362
8363 pub fn set_virtual_machine<
8369 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
8370 >(
8371 mut self,
8372 v: T,
8373 ) -> Self {
8374 self.target = std::option::Option::Some(
8375 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
8376 );
8377 self
8378 }
8379
8380 pub fn set_interconnect_attachment<
8386 T: std::convert::Into<
8387 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8388 >,
8389 >(
8390 mut self,
8391 v: T,
8392 ) -> Self {
8393 self.target = std::option::Option::Some(
8394 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
8395 );
8396 self
8397 }
8398
8399 pub fn set_next_hop<
8404 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
8405 >(
8406 mut self,
8407 v: T,
8408 ) -> Self {
8409 self.next_hop = v.into();
8410 self
8411 }
8412
8413 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
8417 #[allow(unreachable_patterns)]
8418 self.next_hop.as_ref().and_then(|v| match v {
8419 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
8420 std::option::Option::Some(v)
8421 }
8422 _ => std::option::Option::None,
8423 })
8424 }
8425
8426 pub fn next_hop_other_routes(
8430 &self,
8431 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
8432 #[allow(unreachable_patterns)]
8433 self.next_hop.as_ref().and_then(|v| match v {
8434 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
8435 std::option::Option::Some(v)
8436 }
8437 _ => std::option::Option::None,
8438 })
8439 }
8440
8441 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8447 self.next_hop = std::option::Option::Some(
8448 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
8449 );
8450 self
8451 }
8452
8453 pub fn set_next_hop_other_routes<
8459 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
8460 >(
8461 mut self,
8462 v: T,
8463 ) -> Self {
8464 self.next_hop = std::option::Option::Some(
8465 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
8466 );
8467 self
8468 }
8469}
8470
8471impl wkt::message::Message for PolicyBasedRoute {
8472 fn typename() -> &'static str {
8473 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
8474 }
8475}
8476
8477pub mod policy_based_route {
8479 #[allow(unused_imports)]
8480 use super::*;
8481
8482 #[serde_with::serde_as]
8484 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8485 #[serde(default, rename_all = "camelCase")]
8486 #[non_exhaustive]
8487 pub struct VirtualMachine {
8488 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8491 pub tags: std::vec::Vec<std::string::String>,
8492
8493 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8494 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8495 }
8496
8497 impl VirtualMachine {
8498 pub fn new() -> Self {
8499 std::default::Default::default()
8500 }
8501
8502 pub fn set_tags<T, V>(mut self, v: T) -> Self
8504 where
8505 T: std::iter::IntoIterator<Item = V>,
8506 V: std::convert::Into<std::string::String>,
8507 {
8508 use std::iter::Iterator;
8509 self.tags = v.into_iter().map(|i| i.into()).collect();
8510 self
8511 }
8512 }
8513
8514 impl wkt::message::Message for VirtualMachine {
8515 fn typename() -> &'static str {
8516 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
8517 }
8518 }
8519
8520 #[serde_with::serde_as]
8522 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8523 #[serde(default, rename_all = "camelCase")]
8524 #[non_exhaustive]
8525 pub struct InterconnectAttachment {
8526 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8529 pub region: std::string::String,
8530
8531 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8532 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8533 }
8534
8535 impl InterconnectAttachment {
8536 pub fn new() -> Self {
8537 std::default::Default::default()
8538 }
8539
8540 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8542 self.region = v.into();
8543 self
8544 }
8545 }
8546
8547 impl wkt::message::Message for InterconnectAttachment {
8548 fn typename() -> &'static str {
8549 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
8550 }
8551 }
8552
8553 #[serde_with::serde_as]
8555 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8556 #[serde(default, rename_all = "camelCase")]
8557 #[non_exhaustive]
8558 pub struct Filter {
8559 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8562 pub ip_protocol: std::string::String,
8563
8564 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8567 pub src_range: std::string::String,
8568
8569 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8573 pub dest_range: std::string::String,
8574
8575 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
8578
8579 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8580 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8581 }
8582
8583 impl Filter {
8584 pub fn new() -> Self {
8585 std::default::Default::default()
8586 }
8587
8588 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8590 self.ip_protocol = v.into();
8591 self
8592 }
8593
8594 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8596 self.src_range = v.into();
8597 self
8598 }
8599
8600 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8602 self.dest_range = v.into();
8603 self
8604 }
8605
8606 pub fn set_protocol_version<
8608 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
8609 >(
8610 mut self,
8611 v: T,
8612 ) -> Self {
8613 self.protocol_version = v.into();
8614 self
8615 }
8616 }
8617
8618 impl wkt::message::Message for Filter {
8619 fn typename() -> &'static str {
8620 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
8621 }
8622 }
8623
8624 pub mod filter {
8626 #[allow(unused_imports)]
8627 use super::*;
8628
8629 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8631 pub struct ProtocolVersion(i32);
8632
8633 impl ProtocolVersion {
8634 pub const PROTOCOL_VERSION_UNSPECIFIED: ProtocolVersion = ProtocolVersion::new(0);
8636
8637 pub const IPV4: ProtocolVersion = ProtocolVersion::new(1);
8639
8640 pub(crate) const fn new(value: i32) -> Self {
8642 Self(value)
8643 }
8644
8645 pub fn value(&self) -> i32 {
8647 self.0
8648 }
8649
8650 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8652 match self.0 {
8653 0 => std::borrow::Cow::Borrowed("PROTOCOL_VERSION_UNSPECIFIED"),
8654 1 => std::borrow::Cow::Borrowed("IPV4"),
8655 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8656 }
8657 }
8658
8659 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8661 match name {
8662 "PROTOCOL_VERSION_UNSPECIFIED" => {
8663 std::option::Option::Some(Self::PROTOCOL_VERSION_UNSPECIFIED)
8664 }
8665 "IPV4" => std::option::Option::Some(Self::IPV4),
8666 _ => std::option::Option::None,
8667 }
8668 }
8669 }
8670
8671 impl std::convert::From<i32> for ProtocolVersion {
8672 fn from(value: i32) -> Self {
8673 Self::new(value)
8674 }
8675 }
8676
8677 impl std::default::Default for ProtocolVersion {
8678 fn default() -> Self {
8679 Self::new(0)
8680 }
8681 }
8682 }
8683
8684 #[serde_with::serde_as]
8686 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8687 #[serde(default, rename_all = "camelCase")]
8688 #[non_exhaustive]
8689 pub struct Warnings {
8690 pub code: crate::model::policy_based_route::warnings::Code,
8692
8693 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8700 pub data: std::collections::HashMap<std::string::String, std::string::String>,
8701
8702 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8704 pub warning_message: std::string::String,
8705
8706 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8707 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8708 }
8709
8710 impl Warnings {
8711 pub fn new() -> Self {
8712 std::default::Default::default()
8713 }
8714
8715 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
8717 mut self,
8718 v: T,
8719 ) -> Self {
8720 self.code = v.into();
8721 self
8722 }
8723
8724 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
8726 mut self,
8727 v: T,
8728 ) -> Self {
8729 self.warning_message = v.into();
8730 self
8731 }
8732
8733 pub fn set_data<T, K, V>(mut self, v: T) -> Self
8735 where
8736 T: std::iter::IntoIterator<Item = (K, V)>,
8737 K: std::convert::Into<std::string::String>,
8738 V: std::convert::Into<std::string::String>,
8739 {
8740 use std::iter::Iterator;
8741 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8742 self
8743 }
8744 }
8745
8746 impl wkt::message::Message for Warnings {
8747 fn typename() -> &'static str {
8748 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
8749 }
8750 }
8751
8752 pub mod warnings {
8754 #[allow(unused_imports)]
8755 use super::*;
8756
8757 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8760 pub struct Code(i32);
8761
8762 impl Code {
8763 pub const WARNING_UNSPECIFIED: Code = Code::new(0);
8765
8766 pub const RESOURCE_NOT_ACTIVE: Code = Code::new(1);
8770
8771 pub const RESOURCE_BEING_MODIFIED: Code = Code::new(2);
8774
8775 pub(crate) const fn new(value: i32) -> Self {
8777 Self(value)
8778 }
8779
8780 pub fn value(&self) -> i32 {
8782 self.0
8783 }
8784
8785 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8787 match self.0 {
8788 0 => std::borrow::Cow::Borrowed("WARNING_UNSPECIFIED"),
8789 1 => std::borrow::Cow::Borrowed("RESOURCE_NOT_ACTIVE"),
8790 2 => std::borrow::Cow::Borrowed("RESOURCE_BEING_MODIFIED"),
8791 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8792 }
8793 }
8794
8795 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8797 match name {
8798 "WARNING_UNSPECIFIED" => std::option::Option::Some(Self::WARNING_UNSPECIFIED),
8799 "RESOURCE_NOT_ACTIVE" => std::option::Option::Some(Self::RESOURCE_NOT_ACTIVE),
8800 "RESOURCE_BEING_MODIFIED" => {
8801 std::option::Option::Some(Self::RESOURCE_BEING_MODIFIED)
8802 }
8803 _ => std::option::Option::None,
8804 }
8805 }
8806 }
8807
8808 impl std::convert::From<i32> for Code {
8809 fn from(value: i32) -> Self {
8810 Self::new(value)
8811 }
8812 }
8813
8814 impl std::default::Default for Code {
8815 fn default() -> Self {
8816 Self::new(0)
8817 }
8818 }
8819 }
8820
8821 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8823 pub struct OtherRoutes(i32);
8824
8825 impl OtherRoutes {
8826 pub const OTHER_ROUTES_UNSPECIFIED: OtherRoutes = OtherRoutes::new(0);
8828
8829 pub const DEFAULT_ROUTING: OtherRoutes = OtherRoutes::new(1);
8834
8835 pub(crate) const fn new(value: i32) -> Self {
8837 Self(value)
8838 }
8839
8840 pub fn value(&self) -> i32 {
8842 self.0
8843 }
8844
8845 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8847 match self.0 {
8848 0 => std::borrow::Cow::Borrowed("OTHER_ROUTES_UNSPECIFIED"),
8849 1 => std::borrow::Cow::Borrowed("DEFAULT_ROUTING"),
8850 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8851 }
8852 }
8853
8854 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8856 match name {
8857 "OTHER_ROUTES_UNSPECIFIED" => {
8858 std::option::Option::Some(Self::OTHER_ROUTES_UNSPECIFIED)
8859 }
8860 "DEFAULT_ROUTING" => std::option::Option::Some(Self::DEFAULT_ROUTING),
8861 _ => std::option::Option::None,
8862 }
8863 }
8864 }
8865
8866 impl std::convert::From<i32> for OtherRoutes {
8867 fn from(value: i32) -> Self {
8868 Self::new(value)
8869 }
8870 }
8871
8872 impl std::default::Default for OtherRoutes {
8873 fn default() -> Self {
8874 Self::new(0)
8875 }
8876 }
8877
8878 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8882 #[serde(rename_all = "camelCase")]
8883 #[non_exhaustive]
8884 pub enum Target {
8885 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
8887 InterconnectAttachment(
8890 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8891 ),
8892 }
8893
8894 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8895 #[serde(rename_all = "camelCase")]
8896 #[non_exhaustive]
8897 pub enum NextHop {
8898 NextHopIlbIp(std::string::String),
8902 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
8905 }
8906}
8907
8908#[serde_with::serde_as]
8914#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8915#[serde(default, rename_all = "camelCase")]
8916#[non_exhaustive]
8917pub struct ListPolicyBasedRoutesRequest {
8918 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8920 pub parent: std::string::String,
8921
8922 pub page_size: i32,
8924
8925 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8927 pub page_token: std::string::String,
8928
8929 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8931 pub filter: std::string::String,
8932
8933 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8935 pub order_by: std::string::String,
8936
8937 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8938 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8939}
8940
8941impl ListPolicyBasedRoutesRequest {
8942 pub fn new() -> Self {
8943 std::default::Default::default()
8944 }
8945
8946 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8948 self.parent = v.into();
8949 self
8950 }
8951
8952 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8954 self.page_size = v.into();
8955 self
8956 }
8957
8958 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8960 self.page_token = v.into();
8961 self
8962 }
8963
8964 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8966 self.filter = v.into();
8967 self
8968 }
8969
8970 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8972 self.order_by = v.into();
8973 self
8974 }
8975}
8976
8977impl wkt::message::Message for ListPolicyBasedRoutesRequest {
8978 fn typename() -> &'static str {
8979 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
8980 }
8981}
8982
8983#[serde_with::serde_as]
8989#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8990#[serde(default, rename_all = "camelCase")]
8991#[non_exhaustive]
8992pub struct ListPolicyBasedRoutesResponse {
8993 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8995 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
8996
8997 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9000 pub next_page_token: std::string::String,
9001
9002 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9004 pub unreachable: std::vec::Vec<std::string::String>,
9005
9006 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9007 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9008}
9009
9010impl ListPolicyBasedRoutesResponse {
9011 pub fn new() -> Self {
9012 std::default::Default::default()
9013 }
9014
9015 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.next_page_token = v.into();
9018 self
9019 }
9020
9021 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
9023 where
9024 T: std::iter::IntoIterator<Item = V>,
9025 V: std::convert::Into<crate::model::PolicyBasedRoute>,
9026 {
9027 use std::iter::Iterator;
9028 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
9029 self
9030 }
9031
9032 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9034 where
9035 T: std::iter::IntoIterator<Item = V>,
9036 V: std::convert::Into<std::string::String>,
9037 {
9038 use std::iter::Iterator;
9039 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9040 self
9041 }
9042}
9043
9044impl wkt::message::Message for ListPolicyBasedRoutesResponse {
9045 fn typename() -> &'static str {
9046 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
9047 }
9048}
9049
9050#[doc(hidden)]
9051impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
9052 type PageItem = crate::model::PolicyBasedRoute;
9053
9054 fn items(self) -> std::vec::Vec<Self::PageItem> {
9055 self.policy_based_routes
9056 }
9057
9058 fn next_page_token(&self) -> std::string::String {
9059 use std::clone::Clone;
9060 self.next_page_token.clone()
9061 }
9062}
9063
9064#[serde_with::serde_as]
9070#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9071#[serde(default, rename_all = "camelCase")]
9072#[non_exhaustive]
9073pub struct GetPolicyBasedRouteRequest {
9074 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9076 pub name: std::string::String,
9077
9078 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9079 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9080}
9081
9082impl GetPolicyBasedRouteRequest {
9083 pub fn new() -> Self {
9084 std::default::Default::default()
9085 }
9086
9087 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9089 self.name = v.into();
9090 self
9091 }
9092}
9093
9094impl wkt::message::Message for GetPolicyBasedRouteRequest {
9095 fn typename() -> &'static str {
9096 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
9097 }
9098}
9099
9100#[serde_with::serde_as]
9106#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9107#[serde(default, rename_all = "camelCase")]
9108#[non_exhaustive]
9109pub struct CreatePolicyBasedRouteRequest {
9110 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9112 pub parent: std::string::String,
9113
9114 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9123 pub policy_based_route_id: std::string::String,
9124
9125 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9127 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
9128
9129 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9143 pub request_id: std::string::String,
9144
9145 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9146 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9147}
9148
9149impl CreatePolicyBasedRouteRequest {
9150 pub fn new() -> Self {
9151 std::default::Default::default()
9152 }
9153
9154 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9156 self.parent = v.into();
9157 self
9158 }
9159
9160 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
9162 mut self,
9163 v: T,
9164 ) -> Self {
9165 self.policy_based_route_id = v.into();
9166 self
9167 }
9168
9169 pub fn set_policy_based_route<
9171 T: std::convert::Into<std::option::Option<crate::model::PolicyBasedRoute>>,
9172 >(
9173 mut self,
9174 v: T,
9175 ) -> Self {
9176 self.policy_based_route = v.into();
9177 self
9178 }
9179
9180 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9182 self.request_id = v.into();
9183 self
9184 }
9185}
9186
9187impl wkt::message::Message for CreatePolicyBasedRouteRequest {
9188 fn typename() -> &'static str {
9189 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
9190 }
9191}
9192
9193#[serde_with::serde_as]
9199#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9200#[serde(default, rename_all = "camelCase")]
9201#[non_exhaustive]
9202pub struct DeletePolicyBasedRouteRequest {
9203 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9205 pub name: std::string::String,
9206
9207 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9221 pub request_id: std::string::String,
9222
9223 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9224 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9225}
9226
9227impl DeletePolicyBasedRouteRequest {
9228 pub fn new() -> Self {
9229 std::default::Default::default()
9230 }
9231
9232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9234 self.name = v.into();
9235 self
9236 }
9237
9238 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9240 self.request_id = v.into();
9241 self
9242 }
9243}
9244
9245impl wkt::message::Message for DeletePolicyBasedRouteRequest {
9246 fn typename() -> &'static str {
9247 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
9248 }
9249}
9250
9251#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9253pub struct Infrastructure(i32);
9254
9255impl Infrastructure {
9256 pub const INFRASTRUCTURE_UNSPECIFIED: Infrastructure = Infrastructure::new(0);
9258
9259 pub const PSC: Infrastructure = Infrastructure::new(1);
9261
9262 pub(crate) const fn new(value: i32) -> Self {
9264 Self(value)
9265 }
9266
9267 pub fn value(&self) -> i32 {
9269 self.0
9270 }
9271
9272 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9274 match self.0 {
9275 0 => std::borrow::Cow::Borrowed("INFRASTRUCTURE_UNSPECIFIED"),
9276 1 => std::borrow::Cow::Borrowed("PSC"),
9277 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9278 }
9279 }
9280
9281 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9283 match name {
9284 "INFRASTRUCTURE_UNSPECIFIED" => {
9285 std::option::Option::Some(Self::INFRASTRUCTURE_UNSPECIFIED)
9286 }
9287 "PSC" => std::option::Option::Some(Self::PSC),
9288 _ => std::option::Option::None,
9289 }
9290 }
9291}
9292
9293impl std::convert::From<i32> for Infrastructure {
9294 fn from(value: i32) -> Self {
9295 Self::new(value)
9296 }
9297}
9298
9299impl std::default::Default for Infrastructure {
9300 fn default() -> Self {
9301 Self::new(0)
9302 }
9303}
9304
9305#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9308pub struct ConnectionErrorType(i32);
9309
9310impl ConnectionErrorType {
9311 pub const CONNECTION_ERROR_TYPE_UNSPECIFIED: ConnectionErrorType = ConnectionErrorType::new(0);
9313
9314 pub const ERROR_INTERNAL: ConnectionErrorType = ConnectionErrorType::new(1);
9316
9317 pub const ERROR_CONSUMER_SIDE: ConnectionErrorType = ConnectionErrorType::new(2);
9319
9320 pub const ERROR_PRODUCER_SIDE: ConnectionErrorType = ConnectionErrorType::new(3);
9322
9323 pub(crate) const fn new(value: i32) -> Self {
9325 Self(value)
9326 }
9327
9328 pub fn value(&self) -> i32 {
9330 self.0
9331 }
9332
9333 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9335 match self.0 {
9336 0 => std::borrow::Cow::Borrowed("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
9337 1 => std::borrow::Cow::Borrowed("ERROR_INTERNAL"),
9338 2 => std::borrow::Cow::Borrowed("ERROR_CONSUMER_SIDE"),
9339 3 => std::borrow::Cow::Borrowed("ERROR_PRODUCER_SIDE"),
9340 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9341 }
9342 }
9343
9344 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9346 match name {
9347 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => {
9348 std::option::Option::Some(Self::CONNECTION_ERROR_TYPE_UNSPECIFIED)
9349 }
9350 "ERROR_INTERNAL" => std::option::Option::Some(Self::ERROR_INTERNAL),
9351 "ERROR_CONSUMER_SIDE" => std::option::Option::Some(Self::ERROR_CONSUMER_SIDE),
9352 "ERROR_PRODUCER_SIDE" => std::option::Option::Some(Self::ERROR_PRODUCER_SIDE),
9353 _ => std::option::Option::None,
9354 }
9355 }
9356}
9357
9358impl std::convert::From<i32> for ConnectionErrorType {
9359 fn from(value: i32) -> Self {
9360 Self::new(value)
9361 }
9362}
9363
9364impl std::default::Default for ConnectionErrorType {
9365 fn default() -> Self {
9366 Self::new(0)
9367 }
9368}
9369
9370#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9372pub struct IPVersion(i32);
9373
9374impl IPVersion {
9375 pub const IP_VERSION_UNSPECIFIED: IPVersion = IPVersion::new(0);
9378
9379 pub const IPV4: IPVersion = IPVersion::new(1);
9381
9382 pub const IPV6: IPVersion = IPVersion::new(2);
9384
9385 pub(crate) const fn new(value: i32) -> Self {
9387 Self(value)
9388 }
9389
9390 pub fn value(&self) -> i32 {
9392 self.0
9393 }
9394
9395 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9397 match self.0 {
9398 0 => std::borrow::Cow::Borrowed("IP_VERSION_UNSPECIFIED"),
9399 1 => std::borrow::Cow::Borrowed("IPV4"),
9400 2 => std::borrow::Cow::Borrowed("IPV6"),
9401 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9402 }
9403 }
9404
9405 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9407 match name {
9408 "IP_VERSION_UNSPECIFIED" => std::option::Option::Some(Self::IP_VERSION_UNSPECIFIED),
9409 "IPV4" => std::option::Option::Some(Self::IPV4),
9410 "IPV6" => std::option::Option::Some(Self::IPV6),
9411 _ => std::option::Option::None,
9412 }
9413 }
9414}
9415
9416impl std::convert::From<i32> for IPVersion {
9417 fn from(value: i32) -> Self {
9418 Self::new(value)
9419 }
9420}
9421
9422impl std::default::Default for IPVersion {
9423 fn default() -> Self {
9424 Self::new(0)
9425 }
9426}
9427
9428#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9430pub struct LocationFeature(i32);
9431
9432impl LocationFeature {
9433 pub const LOCATION_FEATURE_UNSPECIFIED: LocationFeature = LocationFeature::new(0);
9435
9436 pub const SITE_TO_CLOUD_SPOKES: LocationFeature = LocationFeature::new(1);
9438
9439 pub const SITE_TO_SITE_SPOKES: LocationFeature = LocationFeature::new(2);
9441
9442 pub(crate) const fn new(value: i32) -> Self {
9444 Self(value)
9445 }
9446
9447 pub fn value(&self) -> i32 {
9449 self.0
9450 }
9451
9452 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9454 match self.0 {
9455 0 => std::borrow::Cow::Borrowed("LOCATION_FEATURE_UNSPECIFIED"),
9456 1 => std::borrow::Cow::Borrowed("SITE_TO_CLOUD_SPOKES"),
9457 2 => std::borrow::Cow::Borrowed("SITE_TO_SITE_SPOKES"),
9458 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9459 }
9460 }
9461
9462 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9464 match name {
9465 "LOCATION_FEATURE_UNSPECIFIED" => {
9466 std::option::Option::Some(Self::LOCATION_FEATURE_UNSPECIFIED)
9467 }
9468 "SITE_TO_CLOUD_SPOKES" => std::option::Option::Some(Self::SITE_TO_CLOUD_SPOKES),
9469 "SITE_TO_SITE_SPOKES" => std::option::Option::Some(Self::SITE_TO_SITE_SPOKES),
9470 _ => std::option::Option::None,
9471 }
9472 }
9473}
9474
9475impl std::convert::From<i32> for LocationFeature {
9476 fn from(value: i32) -> Self {
9477 Self::new(value)
9478 }
9479}
9480
9481impl std::default::Default for LocationFeature {
9482 fn default() -> Self {
9483 Self::new(0)
9484 }
9485}
9486
9487#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9489pub struct RouteType(i32);
9490
9491impl RouteType {
9492 pub const ROUTE_TYPE_UNSPECIFIED: RouteType = RouteType::new(0);
9494
9495 pub const VPC_PRIMARY_SUBNET: RouteType = RouteType::new(1);
9498
9499 pub const VPC_SECONDARY_SUBNET: RouteType = RouteType::new(2);
9502
9503 pub const DYNAMIC_ROUTE: RouteType = RouteType::new(3);
9507
9508 pub(crate) const fn new(value: i32) -> Self {
9510 Self(value)
9511 }
9512
9513 pub fn value(&self) -> i32 {
9515 self.0
9516 }
9517
9518 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9520 match self.0 {
9521 0 => std::borrow::Cow::Borrowed("ROUTE_TYPE_UNSPECIFIED"),
9522 1 => std::borrow::Cow::Borrowed("VPC_PRIMARY_SUBNET"),
9523 2 => std::borrow::Cow::Borrowed("VPC_SECONDARY_SUBNET"),
9524 3 => std::borrow::Cow::Borrowed("DYNAMIC_ROUTE"),
9525 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9526 }
9527 }
9528
9529 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9531 match name {
9532 "ROUTE_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::ROUTE_TYPE_UNSPECIFIED),
9533 "VPC_PRIMARY_SUBNET" => std::option::Option::Some(Self::VPC_PRIMARY_SUBNET),
9534 "VPC_SECONDARY_SUBNET" => std::option::Option::Some(Self::VPC_SECONDARY_SUBNET),
9535 "DYNAMIC_ROUTE" => std::option::Option::Some(Self::DYNAMIC_ROUTE),
9536 _ => std::option::Option::None,
9537 }
9538 }
9539}
9540
9541impl std::convert::From<i32> for RouteType {
9542 fn from(value: i32) -> Self {
9543 Self::new(value)
9544 }
9545}
9546
9547impl std::default::Default for RouteType {
9548 fn default() -> Self {
9549 Self::new(0)
9550 }
9551}
9552
9553#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9556pub struct State(i32);
9557
9558impl State {
9559 pub const STATE_UNSPECIFIED: State = State::new(0);
9561
9562 pub const CREATING: State = State::new(1);
9564
9565 pub const ACTIVE: State = State::new(2);
9567
9568 pub const DELETING: State = State::new(3);
9570
9571 pub const ACCEPTING: State = State::new(8);
9573
9574 pub const REJECTING: State = State::new(9);
9576
9577 pub const UPDATING: State = State::new(6);
9579
9580 pub const INACTIVE: State = State::new(7);
9582
9583 pub const OBSOLETE: State = State::new(10);
9586
9587 pub const FAILED: State = State::new(11);
9591
9592 pub(crate) const fn new(value: i32) -> Self {
9594 Self(value)
9595 }
9596
9597 pub fn value(&self) -> i32 {
9599 self.0
9600 }
9601
9602 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9604 match self.0 {
9605 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
9606 1 => std::borrow::Cow::Borrowed("CREATING"),
9607 2 => std::borrow::Cow::Borrowed("ACTIVE"),
9608 3 => std::borrow::Cow::Borrowed("DELETING"),
9609 6 => std::borrow::Cow::Borrowed("UPDATING"),
9610 7 => std::borrow::Cow::Borrowed("INACTIVE"),
9611 8 => std::borrow::Cow::Borrowed("ACCEPTING"),
9612 9 => std::borrow::Cow::Borrowed("REJECTING"),
9613 10 => std::borrow::Cow::Borrowed("OBSOLETE"),
9614 11 => std::borrow::Cow::Borrowed("FAILED"),
9615 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9616 }
9617 }
9618
9619 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9621 match name {
9622 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
9623 "CREATING" => std::option::Option::Some(Self::CREATING),
9624 "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
9625 "DELETING" => std::option::Option::Some(Self::DELETING),
9626 "ACCEPTING" => std::option::Option::Some(Self::ACCEPTING),
9627 "REJECTING" => std::option::Option::Some(Self::REJECTING),
9628 "UPDATING" => std::option::Option::Some(Self::UPDATING),
9629 "INACTIVE" => std::option::Option::Some(Self::INACTIVE),
9630 "OBSOLETE" => std::option::Option::Some(Self::OBSOLETE),
9631 "FAILED" => std::option::Option::Some(Self::FAILED),
9632 _ => std::option::Option::None,
9633 }
9634 }
9635}
9636
9637impl std::convert::From<i32> for State {
9638 fn from(value: i32) -> Self {
9639 Self::new(value)
9640 }
9641}
9642
9643impl std::default::Default for State {
9644 fn default() -> Self {
9645 Self::new(0)
9646 }
9647}
9648
9649#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9652pub struct SpokeType(i32);
9653
9654impl SpokeType {
9655 pub const SPOKE_TYPE_UNSPECIFIED: SpokeType = SpokeType::new(0);
9657
9658 pub const VPN_TUNNEL: SpokeType = SpokeType::new(1);
9660
9661 pub const INTERCONNECT_ATTACHMENT: SpokeType = SpokeType::new(2);
9663
9664 pub const ROUTER_APPLIANCE: SpokeType = SpokeType::new(3);
9666
9667 pub const VPC_NETWORK: SpokeType = SpokeType::new(4);
9669
9670 pub const PRODUCER_VPC_NETWORK: SpokeType = SpokeType::new(7);
9672
9673 pub(crate) const fn new(value: i32) -> Self {
9675 Self(value)
9676 }
9677
9678 pub fn value(&self) -> i32 {
9680 self.0
9681 }
9682
9683 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9685 match self.0 {
9686 0 => std::borrow::Cow::Borrowed("SPOKE_TYPE_UNSPECIFIED"),
9687 1 => std::borrow::Cow::Borrowed("VPN_TUNNEL"),
9688 2 => std::borrow::Cow::Borrowed("INTERCONNECT_ATTACHMENT"),
9689 3 => std::borrow::Cow::Borrowed("ROUTER_APPLIANCE"),
9690 4 => std::borrow::Cow::Borrowed("VPC_NETWORK"),
9691 7 => std::borrow::Cow::Borrowed("PRODUCER_VPC_NETWORK"),
9692 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9693 }
9694 }
9695
9696 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9698 match name {
9699 "SPOKE_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::SPOKE_TYPE_UNSPECIFIED),
9700 "VPN_TUNNEL" => std::option::Option::Some(Self::VPN_TUNNEL),
9701 "INTERCONNECT_ATTACHMENT" => std::option::Option::Some(Self::INTERCONNECT_ATTACHMENT),
9702 "ROUTER_APPLIANCE" => std::option::Option::Some(Self::ROUTER_APPLIANCE),
9703 "VPC_NETWORK" => std::option::Option::Some(Self::VPC_NETWORK),
9704 "PRODUCER_VPC_NETWORK" => std::option::Option::Some(Self::PRODUCER_VPC_NETWORK),
9705 _ => std::option::Option::None,
9706 }
9707 }
9708}
9709
9710impl std::convert::From<i32> for SpokeType {
9711 fn from(value: i32) -> Self {
9712 Self::new(value)
9713 }
9714}
9715
9716impl std::default::Default for SpokeType {
9717 fn default() -> Self {
9718 Self::new(0)
9719 }
9720}
9721
9722#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9724pub struct PolicyMode(i32);
9725
9726impl PolicyMode {
9727 pub const POLICY_MODE_UNSPECIFIED: PolicyMode = PolicyMode::new(0);
9730
9731 pub const PRESET: PolicyMode = PolicyMode::new(1);
9733
9734 pub(crate) const fn new(value: i32) -> Self {
9736 Self(value)
9737 }
9738
9739 pub fn value(&self) -> i32 {
9741 self.0
9742 }
9743
9744 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9746 match self.0 {
9747 0 => std::borrow::Cow::Borrowed("POLICY_MODE_UNSPECIFIED"),
9748 1 => std::borrow::Cow::Borrowed("PRESET"),
9749 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9750 }
9751 }
9752
9753 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9755 match name {
9756 "POLICY_MODE_UNSPECIFIED" => std::option::Option::Some(Self::POLICY_MODE_UNSPECIFIED),
9757 "PRESET" => std::option::Option::Some(Self::PRESET),
9758 _ => std::option::Option::None,
9759 }
9760 }
9761}
9762
9763impl std::convert::From<i32> for PolicyMode {
9764 fn from(value: i32) -> Self {
9765 Self::new(value)
9766 }
9767}
9768
9769impl std::default::Default for PolicyMode {
9770 fn default() -> Self {
9771 Self::new(0)
9772 }
9773}
9774
9775#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9777pub struct PresetTopology(i32);
9778
9779impl PresetTopology {
9780 pub const PRESET_TOPOLOGY_UNSPECIFIED: PresetTopology = PresetTopology::new(0);
9783
9784 pub const MESH: PresetTopology = PresetTopology::new(2);
9787
9788 pub const STAR: PresetTopology = PresetTopology::new(3);
9792
9793 pub(crate) const fn new(value: i32) -> Self {
9795 Self(value)
9796 }
9797
9798 pub fn value(&self) -> i32 {
9800 self.0
9801 }
9802
9803 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9805 match self.0 {
9806 0 => std::borrow::Cow::Borrowed("PRESET_TOPOLOGY_UNSPECIFIED"),
9807 2 => std::borrow::Cow::Borrowed("MESH"),
9808 3 => std::borrow::Cow::Borrowed("STAR"),
9809 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9810 }
9811 }
9812
9813 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9815 match name {
9816 "PRESET_TOPOLOGY_UNSPECIFIED" => {
9817 std::option::Option::Some(Self::PRESET_TOPOLOGY_UNSPECIFIED)
9818 }
9819 "MESH" => std::option::Option::Some(Self::MESH),
9820 "STAR" => std::option::Option::Some(Self::STAR),
9821 _ => std::option::Option::None,
9822 }
9823 }
9824}
9825
9826impl std::convert::From<i32> for PresetTopology {
9827 fn from(value: i32) -> Self {
9828 Self::new(value)
9829 }
9830}
9831
9832impl std::default::Default for PresetTopology {
9833 fn default() -> Self {
9834 Self::new(0)
9835 }
9836}